http://stackoverflow.com/comment/46120040
type: QuestionComment
comment on: http://stackoverflow.com/q/28931904
has text: Can you show the code in `Amzhen.js` that requires `dice`?
score: 0
type: Comment

http://stackoverflow.com/q/29049282
has answer: http://stackoverflow.com/a/29049301
has body: I've got an empty link: + add stop-point bound to a JS function: $("#stop-point-btn").bind("click", addStopPoint); which simply adds some content in a div: function addStopPoint() { $("#stop-point-content").append(stopPointHtml()) } Upon click, if I have scrolled a bit down, it moves me back to the top of the page (of course, because of the provided # empty id value). But how can I make it so that the position, of where I am at the page, does not change (meaning the scroll position).
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29049301
has answer: http://stackoverflow.com/a/29049323
downvote count: 0
has title: Force click on empty link to not move the page focus
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29049310
tagged with: css
has answer: http://stackoverflow.com/a/29049293
answer count: 4
has answer: http://stackoverflow.com/a/29049310
score: 2
upvote count: 2
linked to: http://stackoverflow.com/q/11847021
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/46180177
type: Comment
type: QuestionComment
has text: `var shape = new shape(54,63,12,13)` , your can't do this, use an other identifier for your object instance. This is redefining the name of `shape` in the local scope, this can be the reason.
score: 1
comment on: http://stackoverflow.com/q/28964100

http://stackoverflow.com/a/28941876
has comment: http://stackoverflow.com/comment/46138216
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28941771
has comment: http://stackoverflow.com/comment/46146301
has body: You should have the attr selected=true|false. Either look at $.prop as in el.prop('selected', true|false) or pass in the value when creating the element: $("&lt;option /&gt;", { "value" : el.attr("href"), "text" : el.text(), "selected": el.hasClass("active") }).appendTo(".converted select");
downvote count: 0
has comment: http://stackoverflow.com/comment/46138177

http://stackoverflow.com/comment/46189385
type: Comment
type: QuestionComment
has text: you might be able to `iframe{zoom:2}` or something...
comment on: http://stackoverflow.com/q/28968768
score: 0

http://stackoverflow.com/comment/46348672
type: QuestionComment
has text: I don't think you can do it without manipulating the inputs result.
comment on: http://stackoverflow.com/q/29055551
type: Comment
score: 0

http://stackoverflow.com/q/28914741
has comment: http://stackoverflow.com/comment/46087595
tagged with: php
has answer: http://stackoverflow.com/a/28914792
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46087655
tagged with: javascript
has body: This is a javascript geo-target code: Is possible add the results of it in the end of URL? Fairfield, CT The javascript result put after ?q= Thanks!
score: -1
has comment: http://stackoverflow.com/comment/46091705
has comment: http://stackoverflow.com/comment/46088487
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46087585
has title: url in javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46087568
has comment: http://stackoverflow.com/comment/46087614
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46088359

http://stackoverflow.com/a/28991496
has comment: http://stackoverflow.com/comment/46232282
has comment: http://stackoverflow.com/comment/46232611
type: Answer
has body: Sounds like bad design, but you're probably looking for eval(); Some code sample: eval("function x() { return '1'; } x();"); prints "1".
score: 0
answers question: http://stackoverflow.com/q/28990993

http://stackoverflow.com/q/28993637
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29001053
score: 0
has comment: http://stackoverflow.com/comment/46239071
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46238696
favorite count: 0
tagged with: twitter-bootstrap-3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46248700
has title: Bootstrap :Go to specific tab using a button in other page
upvote count: 1
downvote count: 1
has body: In here,i have 2 HTML page(a.html,b.html), I use Bootstrap Tab in a.html to show different information. a.html Home iOS Java jmeter ejb abc 123 456 789 Now I have another page(b.html),in (b.html),it has a button,I want if i click the button, I can back to a.html and show out the specific tab(ejb) in dropdown list(Java).How can I do it? I try Default (Gray) Button,but it is not work. If need to change the page to php to show out the specific tab, i can change it. b.html button Default (Gray) Button
has comment: http://stackoverflow.com/comment/46240211

http://stackoverflow.com/comment/46325567
comment on: http://stackoverflow.com/a/29042017
type: Comment
has text: I like the way you did this, however with the table you did - it doesn't work for my table. Thanks though.
score: 0
type: AnswerComment

jquery
tags question: http://stackoverflow.com/q/29025722
tags question: http://stackoverflow.com/q/29034140
tags question: http://stackoverflow.com/q/29012534
tags question: http://stackoverflow.com/q/29006280
tags question: http://stackoverflow.com/q/28918643
tags question: http://stackoverflow.com/q/29051815
tags question: http://stackoverflow.com/q/29007672
tags question: http://stackoverflow.com/q/29061448
tags question: http://stackoverflow.com/q/28914213
tags question: http://stackoverflow.com/q/28996428
tags question: http://stackoverflow.com/q/28910944
tags question: http://stackoverflow.com/q/28993787
tags question: http://stackoverflow.com/q/29044516
tags question: http://stackoverflow.com/q/28940310
tags question: http://stackoverflow.com/q/28979764
tags question: http://stackoverflow.com/q/28956240
tags question: http://stackoverflow.com/q/29014408
tags question: http://stackoverflow.com/q/28920681
tags question: http://stackoverflow.com/q/29044852
tags question: http://stackoverflow.com/q/28921254
tags question: http://stackoverflow.com/q/28981529
tags question: http://stackoverflow.com/q/28984535
tags question: http://stackoverflow.com/q/28957141
tags question: http://stackoverflow.com/q/28993700
tags question: http://stackoverflow.com/q/28939913
tags question: http://stackoverflow.com/q/28940033
tags question: http://stackoverflow.com/q/28955207
tags question: http://stackoverflow.com/q/28996811
tags question: http://stackoverflow.com/q/28987896
tags question: http://stackoverflow.com/q/28916875
tags question: http://stackoverflow.com/q/28954106
tags question: http://stackoverflow.com/q/29040651
tags question: http://stackoverflow.com/q/28989959
tags question: http://stackoverflow.com/q/28946234
tags question: http://stackoverflow.com/q/28991127
tags question: http://stackoverflow.com/q/28968087
tags question: http://stackoverflow.com/q/28948343
tags question: http://stackoverflow.com/q/28985301
tags question: http://stackoverflow.com/q/29024204
tags question: http://stackoverflow.com/q/28932126
tags question: http://stackoverflow.com/q/28936853
tags question: http://stackoverflow.com/q/28924551
tags question: http://stackoverflow.com/q/29060710
tags question: http://stackoverflow.com/q/28962482
tags question: http://stackoverflow.com/q/28982599
tags question: http://stackoverflow.com/q/28994225
tags question: http://stackoverflow.com/q/29049373
tags question: http://stackoverflow.com/q/28954209
tags question: http://stackoverflow.com/q/28997696
tags question: http://stackoverflow.com/q/28981864
tags question: http://stackoverflow.com/q/28916104
tags question: http://stackoverflow.com/q/28982971
tags question: http://stackoverflow.com/q/28954855
tags question: http://stackoverflow.com/q/28938628
tags question: http://stackoverflow.com/q/29028958
tags question: http://stackoverflow.com/q/29035883
tags question: http://stackoverflow.com/q/29012913
tags question: http://stackoverflow.com/q/28976558
tags question: http://stackoverflow.com/q/29022701
tags question: http://stackoverflow.com/q/29017793
tags question: http://stackoverflow.com/q/28977937
tags question: http://stackoverflow.com/q/28924283
tags question: http://stackoverflow.com/q/28937171
tags question: http://stackoverflow.com/q/29051208
tags question: http://stackoverflow.com/q/28933634
tags question: http://stackoverflow.com/q/29034564
tags question: http://stackoverflow.com/q/28929909
tags question: http://stackoverflow.com/q/29001274
tags question: http://stackoverflow.com/q/28944857
tags question: http://stackoverflow.com/q/29003281
tags question: http://stackoverflow.com/q/29005479
tags question: http://stackoverflow.com/q/28907773
tags question: http://stackoverflow.com/q/29053501
tags question: http://stackoverflow.com/q/29007039
tags question: http://stackoverflow.com/q/29056720
tags question: http://stackoverflow.com/q/28965470
tags question: http://stackoverflow.com/q/29046824
tags question: http://stackoverflow.com/q/28932250
tags question: http://stackoverflow.com/q/28952788
tags question: http://stackoverflow.com/q/29048426

http://stackoverflow.com/comment/46106031
type: AnswerComment
has text: this work greats thanks but is it possible to change "You should enter 2014-02-02, for example" to "02-02-2014" format?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28924639

http://stackoverflow.com/comment/46113933
has text: instead of this `var promise = $timeout(function() { $scope.$apply(function() { slideService.prepareNextSlide(); }); }, 0, false);` try `var promise = $scope.$evalAsync(function() { slideService.prepareNextSlide(); });`
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28925396

http://stackoverflow.com/comment/120921772
type: AnswerComment
has text: @AndrewOdri Just wanted to point out how much you have helped the community with this post and thank you in the name of all of us :-)
type: Comment
comment on: http://stackoverflow.com/a/29083467
score: 1

http://stackoverflow.com/comment/46257521
has text: I need to process it in a way that 1) I have to check every for every div in the current document depending on term_name. 2) then check if term name has_children 3) is term_name has_children then take the parentID and find corresponding children through an Ajax call then find the Children in current document and add a few classes to those children I was hoping to do something like break it into arrays and sub-arrays however i'm not that good in javascript. if you have a suggestion i'm open to ideas
comment on: http://stackoverflow.com/q/29005012
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28977474
score: 0
type: Answer
has body: You could use ajax to do this. When the user submits the form you would send an ajax request with the form data to your php script, the script will then respond with a value that you use to deside if you should display an alert or not, here is a basic example using jquery: $(document).ready(function() { // catch submit events for your form $('#your-form-id').submit(function() { // make an ajax request to your validation script $.ajax{( url:'create_acc.php', type:'POST', data:$(this).serialize(), dataType:'json', success:function(response) { if(!response.success) { alert('Something went wrong!'); } } }); return false; }); }); Then in your php script you return a code telling the client how it went: // create_acc.php // I assume the form only has one value 'email' $success = false; if(isset($_POST['email'])) { // here you would check if the email already // exists in the database $query = "SELECT * FROM &lt;table&gt; WHERE email = ?"; $stmt = $con-&gt;prepare($query); $stmt-&gt;bind_param('s', $_POST['email']); // execute the query and check if a row was returned } // if everything went fine you should change success to true // return json response to client $response = array('success' =&gt; $success); print json_encode($response); exit;
has comment: http://stackoverflow.com/comment/46249927
has comment: http://stackoverflow.com/comment/46206891
has comment: http://stackoverflow.com/comment/46264411
accepted answer of: http://stackoverflow.com/q/28977252
answers question: http://stackoverflow.com/q/28977252
has comment: http://stackoverflow.com/comment/46219645
type: AcceptedAnswer

http://stackoverflow.com/comment/46230916
score: 0
type: Comment
type: QuestionComment
has text: I'm not seeing the issue, or I don't understand the steps you're taking.
comment on: http://stackoverflow.com/q/28991353

http://stackoverflow.com/comment/68647652
comment on: http://stackoverflow.com/a/29425789
score: 4
type: Comment
type: AnswerComment
has text: This is one of those situations where it's beneficial to actually give the answer in the answer (linked website is dead).

http://stackoverflow.com/q/28993322
tagged with: ajax
score: 0
answer count: 1
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/46235331
has answer: http://stackoverflow.com/a/28993781
accepted answer: http://stackoverflow.com/a/28993781
tagged with: php
has title: Mysql query progress bar with php and bootstrap
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/5464931
has body: A basic Bootstrap progress bar looks like this: 70% How could I update in real time the percentage values, based upon the progress of a Mysql SELECT query that takes from a few seconds up to a minute to finish. I´m using php for the application. Thanks!
tagged with: mysql
has comment: http://stackoverflow.com/comment/46234966
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46236886

http://stackoverflow.com/comment/46175509
type: QuestionComment
has text: Have you tried anything? Which bit are you finding difficult? It's just: Get all product divs, loop them, add them to a ` ` (which you add to the ` `), and every 4 loops change to a new ` `
score: 1
comment on: http://stackoverflow.com/q/28961721
type: Comment

http://stackoverflow.com/comment/46239526
type: QuestionComment
has text: I gues configuring the server is not a good solution as I need to run real PHP file as well!
score: 0
comment on: http://stackoverflow.com/q/28995561
type: Comment

http://stackoverflow.com/comment/46298108
comment on: http://stackoverflow.com/q/29028299
type: Comment
type: QuestionComment
has text: yes it is cross domain
score: 0

http://stackoverflow.com/comment/46328045
has text: I'm voting to close this question as off-topic because as it is about design philosophy, and therefore is on-topic for the Programmers.StackExchange site.
type: Comment
comment on: http://stackoverflow.com/q/28991697
score: 0
type: QuestionComment

http://stackoverflow.com/comment/46183076
comment on: http://stackoverflow.com/a/28965681
score: 0
type: Comment
has text: Thanks, I already tried this.. didn't work. [Fiddle](http://jsfiddle.net/venkateshwar/xzkby36n/14/).
type: AnswerComment

http://stackoverflow.com/comment/96545719
score: 0
type: AnswerComment
has text: That’s true. If this is a concern to you you can add JSDoc. Or you could do the opposite (destructure the args then restructure them underneath), but it is a little bit more verbose and you will have to repeat each vars twice.
comment on: http://stackoverflow.com/a/33185715
type: Comment

http://stackoverflow.com/comment/46242572
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28997003
score: 0
has text: @babar78 I can see its use, however the data I would need to store must be generated after the images are loaded, and those images have to be loaded on the second page.

http://stackoverflow.com/a/29035841
has comment: http://stackoverflow.com/comment/46312577
score: 0
has body: Also if you have access to ES6 changing i to val instead of var will also work. Main issue is you are dealing with function scoping so you keep reusing the same variable vs val which is {} scoped, or TrueBlueAussie answer which creates a new scope for you.
type: Answer
has comment: http://stackoverflow.com/comment/46312459
answers question: http://stackoverflow.com/q/29035736
has comment: http://stackoverflow.com/comment/46312651

crash
tags question: http://stackoverflow.com/q/28915742
tag name: crash
type: Tag
tags question: http://stackoverflow.com/q/29059223

http://stackoverflow.com/comment/46300374
type: Comment
comment on: http://stackoverflow.com/a/29029485
type: AnswerComment
has text: yes i done that. That was a silly thing i was doing :)
score: 0

http://stackoverflow.com/q/29035896
tagged with: leaflet
upvote count: 14
accepted answer: http://stackoverflow.com/a/29039067
has comment: http://stackoverflow.com/comment/46312626
possible better answer: http://stackoverflow.com/a/54669320
has title: Leaflet: don't fire a click event function on double-click
type: Question
has answer: http://stackoverflow.com/a/54669320
has body: I have a question concerning clicks on a map in Leaflet. If I click on the map I want to set a marker there, but if I double-click on the map, I just want to zoom in without setting a marker. So I have the following code: var map = L.map(attrs.id, { center: [scope.lat, scope.lng], zoom: 14 }); var marker = L.marker([scope.lat, scope.lng],{draggable: true}); map.on('click', function(event){ marker.setLatLng(event.latlng); marker.addTo(map); }); The problem now is, when I double-click on the map, the click event is also fired and I would like to remove that behavior. How can I achieve that?
downvote count: 5
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/46314904
favorite count: 0
has comment: http://stackoverflow.com/comment/46312701
score: 9
has answer: http://stackoverflow.com/a/29039067
has answer: http://stackoverflow.com/a/40600213
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46316913

http://stackoverflow.com/comment/46557056
type: AnswerComment
score: 0
type: Comment
has text: @LászlóLukács well, see if my [YAIL](https://github.com/epistemex/yail) loader can help with the image loading (try f.ex. the LT/light version) :-)
comment on: http://stackoverflow.com/a/29061716

http://stackoverflow.com/a/28959460
has comment: http://stackoverflow.com/comment/46199915
answers question: http://stackoverflow.com/q/28958663
score: 0
has body: easiest way to do it is by just putting an img tag behind your content and then transform: scale(110%,110%);. Animate it using css: div.container { position: relative; } img.background { position: absolute; z-index: -1; left: 0px; // .. etc etc transform: scale(100%, 100%); transform-origin: 50% 50%; // wherever you want the 'midpoint' to be at. transition: transform 5s linear; } img.background.active { transform: scale(110%, 110%); } easy does it. you could of course do this with just background-image but then you will have a tougher time switching from image to image.
has comment: http://stackoverflow.com/comment/46217893
type: Answer
has comment: http://stackoverflow.com/comment/46217827

http://stackoverflow.com/comment/46182993
has text: @NewToJs Ok I have changed the question.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28965111

http://stackoverflow.com/comment/46340680
has text: @kris , the red box does't animate , see 1st fiddle .
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29051208

http://stackoverflow.com/q/28957908
has comment: http://stackoverflow.com/comment/46171142
has comment: http://stackoverflow.com/comment/46170967
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: I have this code (please see below), when the user is selecting an image i'd like to display a preview of the image. It works well for standard formats but since tiff is not supported by some of the browser it will show a broken image if user is selecting a tiff image. I have no problem converting/encoding the image when i'm getting it from the server my issue is on the client side. The relevant javascript: $(function () { $(document).on('change', '#ImageData', function (evt) { try { var file = evt.target.files[0] || evt.srcElement.files[0]; // Read the first file from the list. } catch (e) { // Something went wrong or no file was chosen - // remove current image and return. removeImg(); return; } if (isImage(file)) { // Add only valid images var reader = new FileReader(); reader.onloadend = (function () { return function (event) { var img = document.getElementById('img-id'); img.src = event.target.result; }; })(file); reader.readAsDataURL(file); // Read in the image file as a data URL. } else { removeImg(); // If there is already image remove it } }); }); The relevant html: @Html.ValidationMessageFor(model =&gt; model.imageFile, "", new { @class = "text-danger" }) @Html.TextBoxFor(model =&gt; model.imageFile, new { type = "file", name ="imageFile", id = "ImageData" }) &lt;img id='img-id' style="height: 300px; width: auto;"&gt;
score: 1
linked to: http://stackoverflow.com/q/13138297
tagged with: image
has title: How do I encode tiff image on client side using javascript
has comment: http://stackoverflow.com/comment/46168602
type: Question
has comment: http://stackoverflow.com/comment/46168623
tagged with: tiff
downvote count: 0
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/17979696
tagged with: asp.net

http://stackoverflow.com/q/29013084
tagged with: css
has comment: http://stackoverflow.com/comment/46279021
has comment: http://stackoverflow.com/comment/46271455
tagged with: wordpress
has comment: http://stackoverflow.com/comment/46277386
type: Question
has title: jquery responsive wordpress slider height change
has answer: http://stackoverflow.com/a/29016393
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/46273505
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/46273496
type: UnansweredQuestion
has body: I have a premium wordpress theme which came with a built in full page slider. It integrates nicely into my website but it displays full page and the information underneath is being lost. The slider is responsive to the window size, I'd like it to be only 60%. Please can someone help: (function ($) { "use strict"; $.fn.maximage = function (settings, helperSettings) { var config; if (typeof settings == 'object' || settings === undefined) config = $.extend( $.fn.maximage.defaults, settings || {} ); if (typeof settings == 'string') config = $.fn.maximage.defaults; /*jslint browser: true*/ $.Body = $('body'); $.Window = $(window); $.Scroll = $('html, body'); $.Events = { RESIZE: 'resize' }; this.each(function() { var $self = $(this), preload_count = 0, imageCache = []; /* --------------------- */ // @Modern /* MODERN BROWSER NOTES: Modern browsers have CSS3 background-size option so we setup the DOM to be the following structure for cycle plugin: div = cycle div = slide with background-size:cover div = slide with background-size:cover etc. */ var Modern = { setup: function(){ if($.Slides.length &gt; 0){ // Setup images for(var i in $.Slides) { // Set our image var $img = $.Slides[i]; // Create a div with a background image so we can use CSS3's position cover (for modern browsers) $self.append('&lt;div class="mc-image ' + $img.theclass + '" title="' + $img.alt + '" style="background-image:url(\'' + $img.url + '\');' + $img.style + '" data-href="'+ $img.datahref +'"&gt;'+ $img.content +'&lt;/div&gt;'); } // Begin our preload process (increments itself after load) Modern.preload(0); // If using Cycle, this resets the height and width of each div to always fill the window; otherwise can be done with CSS Modern.resize(); } }, preload: function(n){ // Preload all of the images but never show them, just use their completion so we know that they are done // and so that the browser can cache them / fade them in smoothly // Create new image object var $img = $('&lt;img/&gt;'); $im…

http://stackoverflow.com/comment/46304974
type: Comment
type: QuestionComment
score: 0
has text: Yes. My question is how can I get the grid variable that I create inside the Post request and place it in the items element. Can I use a handler or a listener for this purpose? Thanks.
comment on: http://stackoverflow.com/q/29031556

http://stackoverflow.com/comment/46165985
type: QuestionComment
has text: I can't see your directive in use on div.. typo?
comment on: http://stackoverflow.com/q/28956357
score: 0
type: Comment

http://stackoverflow.com/comment/46379117
score: 0
comment on: http://stackoverflow.com/a/29061536
type: AnswerComment
has text: Define the animations ahead of time using CSS - what does it mean?
type: Comment

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

http://stackoverflow.com/a/29058604
answers question: http://stackoverflow.com/q/29054508
type: Answer
has comment: http://stackoverflow.com/comment/46356485
has body: I suggest to use chrome developer tools so you can see what jquery.ajax send https://developer.chrome.com/devtools#improving-network-performance in php, you can see what are incoming using print_r($_POST) and print_r($_GET)
score: 0

http://stackoverflow.com/q/28952644
tagged with: regex
answer count: 4
has answer: http://stackoverflow.com/a/28952701
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28952816
has body: My question is very simple. Thank God because Regex's can be complex... I have a query parameter in the url, given by ?id=0061ecp6cf0q. I would like to match it, but only capture the part after the equals sign. I have a regex as such: (?:\?id=){1}([a-z0-9])+ When, in JavaScript, I have a string containing the query parameter and do a .match() on it with a regular expression object constructed from the regex above, I am returned an array of length 1 with the entry: "?id=0061ecp6cf0q". When I do a .exec() on the regex with the query string as a parameter, I am returned an array of length 2: array[0] = "?id=0061ecp6cf0q" array[1] = "q" 1) Why is my non-capturing group seemingly capturing? 2) Why is "q" being captured, of all things?
upvote count: 2
accepted answer: http://stackoverflow.com/a/28952701
type: Question
has title: JavaScript RegEx with non-capturing group exhibiting bewildering behavior
tagged with: javascript
linked to: http://stackoverflow.com/q/901115
possible better answer: http://stackoverflow.com/a/28952765
downvote count: 0
has answer: http://stackoverflow.com/a/28952765
favorite count: 0
has answer: http://stackoverflow.com/a/28952767
has comment: http://stackoverflow.com/comment/46159261

http://stackoverflow.com/comment/46201133
type: QuestionComment
score: 1
type: Comment
has text: `if (payments[i][0] == date && payments[i][1] == amt) {...}`
comment on: http://stackoverflow.com/q/28974905

http://stackoverflow.com/comment/46082005
has text: @mohamedrias yup there is no where written scope.$apply is anti pattern in this situation.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28911547

http://stackoverflow.com/a/29049535
score: 0
type: Answer
has body: The way you're attempting to let a person change a site's code is really insecure AND very inefficient. The problem's not about trusting the user. These kind of security holes can be exploited by outsiders if they ever gain secret access to the page. Anyway, as an alternative I'd suggest a version-controlling system such as Git/SVN where your changes are track-able and no security issues will arise. Also, it would be much easier to use.
answers question: http://stackoverflow.com/q/29047863

http://stackoverflow.com/comment/46224733
type: QuestionComment
comment on: http://stackoverflow.com/q/28988027
has text: bit unrelated to question, but `const` won't work in many browsers, as it's a part of ES6 - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const
score: 0
type: Comment

http://stackoverflow.com/q/29009596
accepted answer: http://stackoverflow.com/a/29009749
type: Question
tagged with: canvas
has body: I'm trying to pass an array of points onto a Javascript canvas. The script is pulling the array from a JSON file. I know for a fact that the ajax call is connecting to the JSON file, so I'm not going to include that in the question. Here is the script and the JSON file. JS var x1 = result[0].back_line.x1; var y1 = result[0].back_line.y1; var x2 = result[0].back_line.x2; var y2 = result[0].back_line.y2; var stroke = result[0].back_line.stroke; var stroke_width = result[0].back_line.width; for(var i = 0; i &lt; x1.length - 1; i++){ ctx.beginPath(); ctx.moveTo(x1[i], y1[i]); ctx.lineTo(x2[i], y2[i]); ctx.lineWidth = stroke_width; ctx.strokeStyle = stroke; ctx.stroke(); } JSON [{ "back_lines": { "width": 6, "stroke": "#000000", "x1": [938.4, 621.283, 621.283, 604.267, 549.1, 504.233, 582.817, 582.817, 380.033, 477.5, 477.5, 379.42, 379.42, 344.73, 344.73, 588.37, 646.6, 646.6, 804.33, 804.33, 601.05, 601.05, 597.433, 597.433, 475.433, 362.467, 208.8, 191.217, 191.217, 645.017, 645.017, 866.617, 866.617, 849.25, 849.25, 849.25, 360.033, 360.033, 360.033, 209.8, 209.8, 566.5, 566.5, 611, 611, 360.033, 478.05, 793.083, 793.083, 576, 793.083, 843.32, 843.32, 478.05, 504.233, 504.233, 587.37, 646.07, 646.07, 804.43, 803.4, 622.52, 622.52], "y1": [258.167, 177.82, 177.82, 258.167, 257.633, 256.633, 257.9, 214.22, 214.22, 366, 484.133, 269.767, 308.82, 308.82, 557.05, 483.5, 483.5, 515, 515, 499.2, 483, 434.3, 141.667, 111.267, 111.267, 111.267, 111.267, 111.267, 586.083, 586.083, 534.783, 534.783, 515.417, 499.2, 499.2, 409.683, 111.267, 111.267, 84.383, 84.383, 577.7, 577.7, 577.7, 577.7, 498.667, 84.383, 84.383, 84.383, 377.233, 377.233, 84.383, 84.383, 120.5, 84.383, 366, 466.15, 467.27, 467.27, 394.52, 394.52, 409.7, 467.8, 403.42], "x2": [868, 621.283, 621.283, 604.267, 549.1, 504.233, 582.817, 582.817, 380.033, 477.5, 477.5, 379.42, 379.42, 344.73, 344.73, 588.37, 646.6, 646.6, 804.33, 804.33, 601.05, 601.05, 597.433, 597.433, 475.433, 362.467, 208.8, 191.217, 191.217, …
tagged with: arrays
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46264356
has title: Passing an array of points to draw onto the canvas
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29009749

http://stackoverflow.com/comment/79406697
score: 2
type: AnswerComment
has text: @theWebalyst Subtle detail here is that the `resolve` function is actually an argument to the handler function passed to the `Promise` constructor. The error in your thinking that causes the confusion is *that promise has a resolve() function that does some stuff.*. Actually, the handler function does some stuff and calls the `resolve` function it was passed when it is done. You could add a second argument named `reject` and call that instead of `throw`ing when there are too many redirects. The effect is the same.
comment on: http://stackoverflow.com/a/29020886
type: Comment

http://stackoverflow.com/comment/46184726
comment on: http://stackoverflow.com/q/28966440
type: Comment
type: QuestionComment
has text: If you want to keep you script in the same file use event trigger. $('body').on('change', '#Artist', function(e){ // PUT YOUR CODE HERE })
score: 1

http://stackoverflow.com/q/29052564
tagged with: php
has comment: http://stackoverflow.com/comment/46342949
has comment: http://stackoverflow.com/comment/46342922
has title: changing media library based image file path (date generated) WP
has body: Is there any possible way, I can update an image (generated file path) via Wordpress CMS media library upload? For instance, say, on December 2014 I upload an arrow image to Wordpress Media Library upload area, then it gives me the below file location path. I would like to alter. acoolwebsite.net/wp-content/uploads/2014/12/right_arrow.png Specifically I would like to change the date area.. to a custom one for maintenance purposes. /2014/12/ Any suggestions here? Functions.php alteration to allow, or some reputable plugins? (I'll even take some JS hacky options if any ideas) Cheers
type: Question
tagged with: javascript
score: 0
answer count: 0
type: UnansweredQuestion
tagged with: wordpress

http://stackoverflow.com/q/28946108
has comment: http://stackoverflow.com/comment/46147801
has answer: http://stackoverflow.com/a/28946237
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28946237
has comment: http://stackoverflow.com/comment/46146426
upvote count: 0
has comment: http://stackoverflow.com/comment/46146887
has body: element is always empty. I've tried creating different loops and using other methods, but nothing seems to fix the error. Any ideas?
downvote count: 1
has title: Trying To Place An Image In A Table Using JavaScript
type: Question
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28946302
has answer: http://stackoverflow.com/a/28947580
answer count: 3
favorite count: 0
has comment: http://stackoverflow.com/comment/46146647
has comment: http://stackoverflow.com/comment/46146803
possible better answer: http://stackoverflow.com/a/28946302

http://stackoverflow.com/q/29047918
score: 7
has body: What I have tried: // creating elements var container = document.createDocumentFragment(); var headline = document.createElement('h1'); headline.innerHTML = 'This is a headline.'; // attaching to DOM container.appendChild(headline); document.body.appendChild(container); // attaching click event container.addEventListener('click', function () { console.log(arguments); }); This example does not work. The event is not triggered. Is there any way to attach a click event to a document fragment or is it simply not possible?
has answer: http://stackoverflow.com/a/60838552
answer count: 3
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/60838552
has title: Is it possible to attach a click event to a document fragment?
favorite count: 0
has answer: http://stackoverflow.com/a/29048018
has answer: http://stackoverflow.com/a/65526675
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29048018
upvote count: 7
type: Question

http://stackoverflow.com/a/32277999
answers question: http://stackoverflow.com/q/28977373
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/52440476
score: 1
upvote count: 1
has body: A really hacky/temporary workaround is to modify the package.json of the installed packages with the peerDependency specified, deleting the lines that specify react as a peerDependency. This hack will go away if you (or a colleague) need to npm install your package's requirements from scratch. Like I said, a crappy temporary workaround.

http://stackoverflow.com/a/28979296
answers question: http://stackoverflow.com/q/28978168
has comment: http://stackoverflow.com/comment/46251771
has comment: http://stackoverflow.com/comment/46245564
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46228150
has comment: http://stackoverflow.com/comment/46220040
has comment: http://stackoverflow.com/comment/46222419
type: Answer
has body: You can create a string holding all characters you don't want to match in the count and compare each char to it: var exceptString = "#={}()"; //Korean 2, English 1 count increment for( var i=0; i&lt; msg.length; i++){ if( exceptString.indexOf(msg.charAt(i)) == -1 ){ cnt += (msg.charCodeAt(i) &gt; 128 ) ? 2 : 1; } } return cnt;
score: 0
accepted answer of: http://stackoverflow.com/q/28978168

http://stackoverflow.com/a/29056376
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/46349892
has body: You can pass a boolean to your template: router.get('/', function(req, res, next) { res.render('players', { title: 'Players', foo: true}); }); router.get('/:id', function(req, res, next) { res.render('players', { title: 'Fantasy Players', foo: false}); }); And render a different partial depending on the boolean: &lt;%if (foo) { %&gt; &lt;% include partials/foo %&gt; &lt;% } else { %&gt; &lt;% include partials/bar %&gt; &lt;% } %&gt;
has comment: http://stackoverflow.com/comment/46350584
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29056318
has comment: http://stackoverflow.com/comment/46349906
upvote count: 4
answers question: http://stackoverflow.com/q/29056318

http://stackoverflow.com/comment/46240821
type: QuestionComment
type: Comment
has text: Tried as a class, that doesn't work either. The problem is this line: $('#hiddenDiv').click(function() { Since I am calling hiddenDiv and not the actual ID of the div being create by append, it just pulls the first result in there. If I change that to $('#zippy').click(function() { (that's what it should be), the function doesn't work.
comment on: http://stackoverflow.com/q/28996193
score: 0

http://stackoverflow.com/comment/46194509
type: QuestionComment
comment on: http://stackoverflow.com/q/28970305
type: Comment
has text: @charlietfl You mean as a AngularJS model? I haven't tried that yet, I'll try that in a minute. That might work best because I already rendered the inital html with rails, because each route includes html action and json api call separately. I'd love to not request more than I have to.
score: 0

http://stackoverflow.com/q/28969988
possible better answer: http://stackoverflow.com/a/28970914
has answer: http://stackoverflow.com/a/28970914
type: AnsweredQuestion
has body: I have an android app that retrieves and downloads audio from the web. What I did so far is to get the download link shown on WebView using webview.loadUrl("some javascript code"). What I want to do is get the href attribute of the download link and store it as a String. But I have two problems: First, there are several anchor tags with no id or class that are all under the div with id "dl_links". All those anchor tags have an href attribute but all of them except the correct download link have display:none. I have no idea how to select this without using jQuery. Secondly, since the download link is loaded with JavaScript, the url of the website before and after the showing the download link are the same. At first I was planning to use jsoup to pull out the href attribute that I needed but since the url after loading the webpage is the same, I'm not sure how to do that.
tagged with: javascript
has title: Filter DOM elements in Android WebView without jQuery
type: Question
has answer: http://stackoverflow.com/a/28971614
tagged with: android
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28971614
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/8200945
has comment: http://stackoverflow.com/comment/46191826

http://stackoverflow.com/comment/46262999
comment on: http://stackoverflow.com/q/29008783
type: Comment
score: 0
type: QuestionComment
has text: Even if you fix the elem issue I think your code will break. You're mixing a 'pure' CSS solution with javascript. Once you hide the side menu you will not be able to show it again - it will be hidden.

http://stackoverflow.com/comment/46307161
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29032353
has text: Since I cannot find any graph in highcharts/Googlecharts similar to mine i thought if merging two different types of chart would get me a solution then why not do that way, So came up with idea where if possible merge 2 charts. Foe example, Area chart and line chart(Where area chart will give me no. of users on each date and line chart giving algorithm changes/update on that date).
score: 0

http://stackoverflow.com/q/28998153
accepted answer: http://stackoverflow.com/a/28998353
tagged with: shadow-dom
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28998353
has title: Can get templateInstance value but can't use it for another function?
type: Question
tagged with: polymer
tagged with: javascript
score: 0
answer count: 1
has body: I just recently figured out how to get the id of an element from one of my template instances and am trying to use it in another function, but although the console log returns the correct IDs, when I try to use them, like in my .play() function, it says that "undefined is not a function". This occurs no matter what function I try to do, be it eventlistener, or anything! I figured that the problem was something to do with how javascript sees elements in the shadowDOM maybe? I'm not entirely sure. Here's my function: //plays an audio file by it's id specified in a repeating template playAudio: function () { var audioId = event.target.templateInstance.model.s.soundId; console.log(audioId); //^ that is correct in the console log for every ID var image = event.target.templateInstance.model.s.imgId; console.log(image); //^ further tests, this is correct for every img ID audioId.play(); //"undefined is not a function" } and then my repeating template, which has the on-click:{{playAudio}} on the img element. {{s.quote}} Is there something I'm missing in regards to how javascript handles elements that I got from a repeating template?

http://stackoverflow.com/a/28988603
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28988552
has comment: http://stackoverflow.com/comment/46226932
type: Answer
has comment: http://stackoverflow.com/comment/46226857
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28988552
has comment: http://stackoverflow.com/comment/46227298
has body: Using: $(".articleBoxContent").click(function() { var el = $(this); if( el.find('p a[href]').length == 0 ){ el.find('h2 a[href]').trigger('click'); } // if });
type: AcceptedAnswer

http://stackoverflow.com/a/29030577
answers question: http://stackoverflow.com/q/29030451
type: Answer
downvote count: 0
score: 1
has body: Try this, Here is http://api.jquery.com/attribute-contains-selector/ $('#btn').click(function() { $('ul &gt; li:not([data-index*=\"' + $('#search').val() + '\"])').hide(); });
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29030451

http://stackoverflow.com/comment/46354053
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29058303
has text: Found a fix :-) Will leave Answer below shortly !
type: AnswerComment

internet-explorer-9
tag name: internet-explorer-9
tags question: http://stackoverflow.com/q/28937712
type: Tag
tags question: http://stackoverflow.com/q/29007077
tags question: http://stackoverflow.com/q/28982110
tags question: http://stackoverflow.com/q/28962072

http://stackoverflow.com/q/28963301
possible better answer: http://stackoverflow.com/a/28963910
has answer: http://stackoverflow.com/a/28963910
has title: auto submit form on pageload using AJAX and get html type result?
type: Question
has answer: http://stackoverflow.com/a/28964057
tagged with: javascript
tagged with: jquery
tagged with: ajax
upvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/28963553
accepted answer: http://stackoverflow.com/a/28963553
has body: I'm trying to autosubmit a form on page load using ajax and then get the HTML (a bunch of divs that will be echo-ed on the AJAX URL) back to my AJAX page. first off, my code auto submits the form but it will ignore the AJAX call so the user will be taken to the form's action page. also, if I remove the auto submit code from my AJAX code and submit the form manually via the submit button I get nothing back from the AJAX URL page! This is my entire code: window.onload = function(){ document.forms['myformR'].submit() // this is the id of the form $("#myformR").submit(function() { var url = "results.php"; // the script where you handle the form input. $.ajax({ type: "POST", url: url, dataType: "html", //expect html to be returned success: function (response) { $("#prores").html(response); } }); return false; // avoid to execute the actual submit of the form. }); } any advise would be appreciated. EDIT, THIS IS MY ajax PHP URL page: <?php session_start(); ?> <?php include "config/connect.php"; $searchList = ""; $clause = " WHERE ";//Initial clause $sql="SELECT * FROM `yt` INNER JOIN `ATTRIBUTES` ON yt.subcats=ATTRIBUTES.type";//Query stub if(isset($_POST['submit'])){ if(isset($_POST['keyword'])){ foreach($_POST['keyword'] as $c){ if(!empty($c)){ ##NOPE##$sql .= $clause."`".$c."` LIKE '%{$c}%'"; $sql .= $clause . " (ATTRIBUTES.sizes LIKE BINARY '$c' OR ATTRIBUTES.colors LIKE BINARY '$c' OR ATTRIBUTES.type LIKE BINARY '$c')"; $clause = " OR ";//Change to OR after 1st WHERE } } $sql .= " GROUP BY yt.id "; //print "SQL Query: $sql "; //<-- Debug SQl syntax. // Run query outside of foreach loop so it only runs one time. $query = mysqli_query($db_conx, $sql); //var_dump($query); //<-- Debug query results. // Check that the query ran fine. if (!$query) { print "ERROR: " . mysqli_error($db_conx); } else { // Use $query inside this section to make sure $query exists. $productCount = mysqli_num_rows($query); $i=0; // count the output amount if ($productCount > 0) { while($row = my…
favorite count: 0
tagged with: php
has comment: http://stackoverflow.com/comment/46178633
type: AnsweredQuestion
score: 2
downvote count: 0

http://stackoverflow.com/comment/46245630
comment on: http://stackoverflow.com/q/28998430
score: 0
type: Comment
type: QuestionComment
has text: I've added some more code. I do use the getMarkers method

http://stackoverflow.com/comment/46309983
has text: I most certainly did not intentionally type that title. Please don't accuse me of that.
comment on: http://stackoverflow.com/q/29033734
score: 0
type: Comment
type: QuestionComment

javascript
tags question: http://stackoverflow.com/q/28952156
tags question: http://stackoverflow.com/q/28933876
tags question: http://stackoverflow.com/q/28941225
tags question: http://stackoverflow.com/q/29039448
tags question: http://stackoverflow.com/q/28965064
tags question: http://stackoverflow.com/q/28971049
tags question: http://stackoverflow.com/q/28935299
tags question: http://stackoverflow.com/q/29058568
tags question: http://stackoverflow.com/q/29036126
tags question: http://stackoverflow.com/q/28937712
tags question: http://stackoverflow.com/q/28935492
tags question: http://stackoverflow.com/q/28990565
tags question: http://stackoverflow.com/q/28982548
tags question: http://stackoverflow.com/q/29061590
tags question: http://stackoverflow.com/q/28934782
tags question: http://stackoverflow.com/q/29059799
tags question: http://stackoverflow.com/q/29052564
tags question: http://stackoverflow.com/q/28949704
tags question: http://stackoverflow.com/q/28926746
tags question: http://stackoverflow.com/q/28988114
tags question: http://stackoverflow.com/q/28933546
tags question: http://stackoverflow.com/q/29032679
tags question: http://stackoverflow.com/q/28962246
tags question: http://stackoverflow.com/q/28948413
tags question: http://stackoverflow.com/q/28929822
tags question: http://stackoverflow.com/q/29028827
tags question: http://stackoverflow.com/q/29000451
tags question: http://stackoverflow.com/q/28967351
tags question: http://stackoverflow.com/q/29021978
tags question: http://stackoverflow.com/q/29027470
tags question: http://stackoverflow.com/q/28968716
tags question: http://stackoverflow.com/q/28944761
tags question: http://stackoverflow.com/q/28983477
tags question: http://stackoverflow.com/q/29058476
tags question: http://stackoverflow.com/q/29043619
tags question: http://stackoverflow.com/q/28916640
tags question: http://stackoverflow.com/q/29006486
tags question: http://stackoverflow.com/q/28918371
tags question: http://stackoverflow.com/q/29009715
tags question: http://stackoverflow.com/q/28937478
tags question: http://stackoverflow.com/q/29039424
tags question: http://stackoverflow.com/q/28989174
tags question: http://stackoverflow.com/q/29015257
tags question: http://stackoverflow.com/q/29049665
tags question: http://stackoverflow.com/q/29040590
tags question: http://stackoverflow.com/q/28973094
tags question: http://stackoverflow.com/q/28926381
tags question: http://stackoverflow.com/q/28935516
tags question: http://stackoverflow.com/q/28930689
tags question: http://stackoverflow.com/q/28975629
tags question: http://stackoverflow.com/q/29036141
tags question: http://stackoverflow.com/q/28928012
tags question: http://stackoverflow.com/q/28996820
tags question: http://stackoverflow.com/q/28926065
tags question: http://stackoverflow.com/q/29058371
tags question: http://stackoverflow.com/q/28996163
tags question: http://stackoverflow.com/q/28962425
tags question: http://stackoverflow.com/q/28958700
tags question: http://stackoverflow.com/q/28917468
tags question: http://stackoverflow.com/q/29013069
tags question: http://stackoverflow.com/q/29001816
tags question: http://stackoverflow.com/q/28936755
tags question: http://stackoverflow.com/q/29053448
tags question: http://stackoverflow.com/q/29055422
tags question: http://stackoverflow.com/q/28910897
tags question: http://stackoverflow.com/q/28932653
tags question: http://stackoverflow.com/q/28963726
tags question: http://stackoverflow.com/q/28948282
tags question: http://stackoverflow.com/q/29000086
tags question: http://stackoverflow.com/q/29018704
tags question: http://stackoverflow.com/q/29012497
tags question: http://stackoverflow.com/q/28962693
tags question: http://stackoverflow.com/q/28977449
tags question: http://stackoverflow.com/q/29028813
tags question: http://stackoverflow.com/q/29033257
tags question: http://stackoverflow.com/q/29056903
tags question: http://stackoverflow.com/q/29024029
tags question: http://stackoverflow.com/q/28955905
tags question: http://stackoverflow.com/q/28995600
tags question: http://stackoverflow.com/q/28997521

http://stackoverflow.com/q/28946234
has answer: http://stackoverflow.com/a/28947647
has body: I'm on a worpress website and i try to make a mandala with changing images. I use jquery, and area from css, when the mouse is over a section delimited by an area, i display the image corresponding. But there is an issue, when i put the mouse over, it take some time(1s) before displaying the image, and when i put the mouse over another section, it's not working well eather.. I think the issue is due to the fact that the new displayed image comes over the mouseover section delimited by the area here is the html code: js code: the mandala looks like this: The image displayed on the mouse over looks like this: thank you for your help
type: AnsweredQuestion
score: 1
has title: Jquery area mouseover issue
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/46146769
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46147657
accepted answer: http://stackoverflow.com/a/28947647
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 1
tagged with: css
favorite count: 0

http://stackoverflow.com/q/28914542
tagged with: forms
has comment: http://stackoverflow.com/comment/46159008
has body: It seems I have it almost working, but for some reason when I'm trying to submit data from an input field to a Google spreadsheet, it does add data, but not the data that is being inputed. So in the Google spreadsheet I see a new entry with timestamp, but not the inputed data. Here's the code: &lt;script&gt; $('#emailForm').one('submit',function(){ var inputField = encodeURIComponent($('#emailForm').val()); var baseURL = 'http://docs.google.com/forms/d/1vl7imylKoya3y8bnboD7WTQ5VsdVw1YmDA1-3_66Apo/formResponse?entry.1017875735='; var submitRef = '&amp;submit=Submit'; var submitURL = (baseURL + emailAddress + submitRef); $(this)[0].action=submitURL; $('#email').addClass('active').val('Thank You!'); setTimeout(function(){ $('#form-container').hide(); $('#update-form').animate({'width': '0px'},300,function(){ $('#get-updates-link').hide(); $('#email').addClass('active').val('Thank You!'); }); },1000); &lt;/script&gt; &lt;form action="https://docs.google.com/forms/d/1vl7imylKoya3y8bnboD7WTQ5VsdVw1YmDA1-3_66Apo/formResponse?entry.1017875735=" &lt;form id="emailForm" action="" method="POST" target="no-target"&gt; &lt;input id="email" type="email" placeholder="enter email" name="email"&gt; &lt;button id="email-submit" type="submit"&gt;&lt;/button&gt; &lt;/form&gt;
type: Question
tagged with: google-sheets
has comment: http://stackoverflow.com/comment/46159223
has answer: http://stackoverflow.com/a/34463215
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
has title: HTML input field to Google Spreadsheet
score: 0
has comment: http://stackoverflow.com/comment/46159694

http://stackoverflow.com/comment/46219421
comment on: http://stackoverflow.com/q/28982077
type: QuestionComment
has text: I have succeeded to get the results on the screen by adding a tag to the html page and changing the id in the js page accordingly and now, how can I get these invocation results in the form of a table to the HTML page?
type: Comment
score: 0

http://stackoverflow.com/comment/83713431
type: AnswerComment
score: 0
type: Comment
has text: Strange that the text doesn't appear inside the element, as one might expect. Though I'm seeing that it does work regardless in my use cases.
comment on: http://stackoverflow.com/a/28930990

http://stackoverflow.com/comment/46197292
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28972963
has text: @user3784238 It is replicating a button click on the button with the id of ctl00_btnSearch002 when they hit enter. Do you have the source code are you replicating the functionality within WebForms?
score: 0

http://stackoverflow.com/a/28971600
downvote count: 0
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28971382
has body: Actually your script works almost. But you make one step too many. You request input.value.value which will result in undefined. If you change checked = inputs[i].value; to checked = inputs[i] your code will work fine. However if you select using document.getElementsByName('choices'); the name of your radio elements must match choices. Added a simple click handler to the radio buttons in this example here to show you the difference: function check() { var checked = null; var inputs = document.getElementsByName('choices'); for (var i = 0; i &lt; inputs.length; i++) { if (inputs[i].checked) { checked = inputs[i]; break; } } if(checked==null) { alert('Please choose an option.'); return false; } else{ return confirm('You have chosen '+ checked.value + ', is this correct?'); } } &lt;input onclick="check()" type="radio" name="choices" value="value 1"&gt;Value 1 &lt;br /&gt; &lt;input onclick="check()" type="radio" name="choices" value="value 2"&gt;Value 2
answers question: http://stackoverflow.com/q/28971382
type: AcceptedAnswer

http://stackoverflow.com/comment/46292439
comment on: http://stackoverflow.com/q/29024779
score: 0
type: Comment
type: QuestionComment
has text: You're expecting to get a *"success"* message in AJAX success callback. So do `echo "success";` then in PHP.

http://stackoverflow.com/q/29040159
type: Question
has body: library(shiny) runApp(list( ui = navbarPage( title = 'Tables', tabPanel('dataTableOutput', dataTableOutput('ex1')), tabPanel('tableOutput', tableOutput('ex2')) ), server = function(input, output) { output$ex1 <- renderDataTable(iris) output$ex2 <- renderTable(iris) } )) What do I do if I want to make just the first column wider? I "Inspect"ed the result, and found that what I really want is this to change. I know it has something to do with writing Javascript code, but the only other answer I found on here was if you wanted to change every column, and I don't know javascript enough to modify it without debugging. For reference, that code looked like this output$ex1 <- renderDataTable(iris, option = list( drawCallback = I("function( settings ) {document.getElementById('ex1').style.width = '600px';}")) ) which is probably pretty close...? if there's an easier way to do this without JS thats more than welcome! edit: looks like adjusting "Width" in this way doesn't work on my actual data, but what does work is changing it from style="width: 300px;" to style="width: 300px;padding-right: 200px;" so that's probably better...
has title: Shiny DataTables, adjust width or padding of one column
tagged with: javascript
tagged with: http://stackoverflow.com/tag/r
tagged with: shiny
tagged with: datatables
downvote count: 0
favorite count: 0
upvote count: 2
type: UnansweredQuestion
score: 2
answer count: 0

http://stackoverflow.com/comment/46207295
comment on: http://stackoverflow.com/a/28978118
has text: Sorry for a very late reply here :) I was editing the question... I am currently using this code in one of projects I am working on so I had to copy paste and then edit it a/c to your question. Yes the code is similar to a tutorial because I had learned it from one of the articles on Microsoft's site and just modified it according to my needs... Happy to help if the code works for you :)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28951873
upvote count: 1
tagged with: memory
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46157816
has comment: http://stackoverflow.com/comment/46158064
downvote count: 0
score: 1
has body: I am playing with NodeJS and for this purpose created an email extractor. Somehow when i create multiple http requests the node.exe memory useage in windows task manager keeps increasing. I understand that the node needs more memory to process the requests but what i noticed that this memory usage does not come down even after all requests have been successfully processed. When i start nodejs it consumes about 35000K memory but after about 80-100 request this goes upto 50000K and stays. Here is my simple email extractor module: var request = require('request'), cheerio = require('cheerio'), async = require('async'), urlHelper = require('url'); function Extractor(config) { this.baseUrl = config.url; this.parsedUrl = urlHelper.parse(config.url); this.urls = []; this.emails = []; } Extractor.prototype.getEmails = function getEmails(html) { var foundEmails = html.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi) || []; if(foundEmails.length) this.emails = this.emails.concat(foundEmails); } Extractor.prototype.extract = function extract(html) { var $ = cheerio.load(html), that = this; if($('body')){ this.getEmails($('body').html()); } if(!this.emails.length){ $("a[href^='http://" + this.parsedUrl.host + "'], a[href^='https://" + this.parsedUrl.host + "'], a[href^='/'], a[href^='./'], a[href^='../']").each(function(k, v) { that.urls.push(urlHelper.resolve(that.baseUrl, $(v).attr('href'))); }); } }; /** * Process the base URL */ Extractor.prototype.processBase = function processBase(next) { request(this.baseUrl, function(err, response, body) { return next(err, body); }); } /** * Process the internal pages */ Extractor.prototype.processInternal = function processInternal(cb) { var that = this; async.whilst( // while this condition returns true function () { return that.emails.length === 0 &amp;&amp; that.urls.length &gt; 0; }, // do this function (callback) { request(that.urls.shift(), function (err, response, body) { var $ = cheerio.load(body); if($(body)){ tha…
favorite count: 0
has title: NodeJS memory usage
type: UnansweredQuestion
tagged with: node.js
answer count: 0

http://stackoverflow.com/comment/46327600
type: AnswerComment
comment on: http://stackoverflow.com/a/29043682
has text: You don't even need PHP to do this, but this can help: http://stackoverflow.com/questions/23740548/how-to-pass-variables-and-data-from-php-to-javascript
type: Comment
score: 0

http://stackoverflow.com/comment/105115555
type: Comment
score: 0
has text: One should read this answer before proceeding further with JavaScript date and time manipulations.
comment on: http://stackoverflow.com/a/28997705
type: AnswerComment

http://stackoverflow.com/comment/46320561
type: Comment
comment on: http://stackoverflow.com/a/29039912
type: AnswerComment
score: 0
has text: Sorry, I didn't see your change to the script. I added that and it worked! Thank you so much.

http://stackoverflow.com/q/28953243
has title: Troubles with getDay in Javascript
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28953379
favorite count: 0
score: 1
upvote count: 1
has body: Hi this seems simple enough but it's not working! I am trying to take two Epoch numbers and calculate the day of the week in a loop for that current day. I need this because I want to not count the days that are on the weekend (i.e. 0 or 6). Click the button to display todays day of the week. Try it The output looks like this: out:1425618000 out:6 out:1425704400 out:6 out:1425790800 out:6 out:1425877200 out:6 out:1425963600 out:6 Why am I ALWAYS getting '6' for each Epoch? Something wrong with my Epoch values? Note, it's 5 days so each day is 86400 long. I copied the code into this page to test it: http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_getday
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28953379

http://stackoverflow.com/q/28939821
has body: Or how would I convert a list of SelectItems to a JavaScript array? Currently I am trying this: &lt;h:outputScript&gt; &lt;!-- Trailing commas valid as per http://www.ecma-international.org/ecma-262/5.1/#sec-11.1.5 --&gt; var possibleOption = [&lt;ui:repeat value="#{bean.mySelectItems}" var="selectItem"&gt;"#{selectItem.value}",&lt;/ui:repeat&gt;]; var firstOption = possibleOption[0]; &lt;/h:outputScript&gt; And it works, except that firstOption is undefined although possibleOption gets correctly populated when I check in the console. Maybe a timing problem? Is this even valid JSF, and if so, is there a "blocking" version of ui:repeat or something? Or which other approach would you recommend?
has answer: http://stackoverflow.com/a/28940244
score: -1
upvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46134955
favorite count: 0
linked to: http://stackoverflow.com/q/8644116
type: UnansweredQuestion
tagged with: jsf
has title: Can I use ui:repeat inside h:outputScript?
downvote count: 1
has comment: http://stackoverflow.com/comment/46134690
type: Question

http://stackoverflow.com/a/28914889
answers question: http://stackoverflow.com/q/28914706
has body: You need to change the way you are compiling. First give the element the content, and then compile its content with the scope: element.html(" Some test content "); $compile(element.contents())(scope); Fiddle
accepted answer of: http://stackoverflow.com/q/28914706
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/q/28975629
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/28975902
has answer: http://stackoverflow.com/a/28976937
accepted answer: http://stackoverflow.com/a/28978128
tagged with: css
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/6021526
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28978128
type: Question
has body: In a nutshell, Below is what I am trying to accomplish: http://jsfiddle.net/n3r8conn/8/ but as shown I am having issues, it would work as follow: User clicks on button once, the file gets selected from input and then display in the files_1 id, user clicks on button again, file gets selected, and then output into files_id2, This part only shows the upload part, in other words, everything mention above beside displaying the image on screen. Html COde: &lt;button id="uploadDevice" class="button button-block button-positive"&gt; &lt;i class="icon ion-android-mail"&gt;&lt;/i&gt; &amp;nbsp; &lt;text id="textBtn1"&gt;From Device &lt;/text&gt; &lt;/button&gt; &lt;input type="file" class="uploadDevice" id="files_1" name="image_file_arr[]" multiple&gt; &lt;input type="file" class="uploadDevice" id="files_2" name="image_file_arr[]" multiple&gt; &lt;input type="file" class="uploadDevice" id="files_3" name="image_file_arr[]" multiple&gt; JavaScript Code: $('#uploadDevice').click(function(){ myGlobalCounter++; $( '#files_' +myGlobalCounter ).val('Secret text ' + myGlobalCounter); }); CSS code: .uploadDevice{ visibility : hidden; } Update: &lt;ion-content&gt; &lt;ion-slide-box id="uploadedPictures" on-slide-changed="slideHasChanged($index)"&gt; &lt;ion-slide&gt; &lt;output id="profilePic1"&gt;&lt;/output&gt; &lt;/ion-slide&gt; &lt;ion-slide&gt; &lt;output id="profilePic2"&gt;&lt;/output&gt; &lt;/ion-slide&gt; &lt;ion-slide&gt; &lt;output id="profilePic3"&gt;&lt;/output&gt; &lt;/ion-slide&gt; &lt;/ion-slide-box&gt; &lt;div class="row"&gt; &lt;div class="col col-50"&gt; &lt;button id="uploadFacebook" class="button button-block button-positive"&gt; &lt;i class="icon ion-social-facebook"&gt;&lt;/i&gt; &amp;nbsp; &lt;text id="textBtn1"&gt; From Facebook &lt;/button&gt; &lt;/div&gt; &lt;div class="col col-50"&gt;&lt;a href="javascript:void(0)" id="buttonFile" href=""&gt; &lt;button id="uploadDevice" class="button button-block button-positive"&gt; &lt;i class="icon ion-android-mail"&gt;&…
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28975662
upvote count: 1
has title: Output multiple input file to a different id with a single button
linked to: http://stackoverflow.com/q/210643
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28975662

http://stackoverflow.com/comment/46357750
type: Comment
has text: thanks, i think the error is in the js file, function Send
comment on: http://stackoverflow.com/q/29060572
score: 0
type: QuestionComment

http://stackoverflow.com/q/28920007
type: Question
has answer: http://stackoverflow.com/a/29013568
has comment: http://stackoverflow.com/comment/46335592
tagged with: javascript
answer count: 1
has body: I'm looking for a way to group my data by months and the months by years... two levels of grouping. For now, I can group my data only by years... Can anyone help me please ? My model : Ext.define('User', { extend: 'Ext.data.Model', fields: [ // 'name', // 'email', 'phone' ]}); My data : var userStore = Ext.create('Ext.data.Store', { model: 'User', data: [ { year: '2015', month : 'march', phone: '555-111-1224' }, { year: '2015', month : 'april', phone: '555-222-1234' }, { year: '2014', month : 'march', phone: '555-222-1244' }, { year: '2014', month : 'april', phone: '555-222-1254' } ], groupField: 'year'}); The grid : Ext.application({ name : 'MyApp', launch : function() { Ext.create('Ext.grid.Panel', { renderTo: Ext.getBody(), features: [{ ftype: 'grouping' }], store: userStore, width: 250, height: 300, title: 'Application Users', columns: [ { text: 'Phone Number', flex: 1, dataIndex: 'phone', sortable: false, hideable: false } ] }); }}); Thx in advance ! Mayes
tagged with: extjs
type: UnansweredQuestion
has title: extJs 5 - grid multiple level grouping
tagged with: extjs5
has comment: http://stackoverflow.com/comment/46360366
has comment: http://stackoverflow.com/comment/46401134
score: 0
tagged with: grid

http://stackoverflow.com/comment/46193454
has text: @J Richard thanks for your reply... i am using mac os firefox in that i am seeing this error... ReferenceError: Ext is not defined..i see empty page even in chrome mac
type: Comment
comment on: http://stackoverflow.com/a/28968525
score: 0
type: AnswerComment

http://stackoverflow.com/q/28926825
possible better answer: http://stackoverflow.com/a/28927010
has answer: http://stackoverflow.com/a/28926998
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/28927010
upvote count: 2
type: Question
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28926998
has body: The piece of code I wrote for automating responses to questions is skipping the first response. Another thing I'd like it to do is hiding the sendButton after the last message in the array is send. I tried putting a .hide() in the message array, hoping it will use it as a last response to disable the button, but this did not seem to do anything besides messing up the code haha. If someone can help me, I'd greatly appreciate it! code: $(window).load(function(){ $(document).ready(function() { $("#typing").hide(); var n = "You:&lt;br&gt;"; var o = $('#outputWindow'); var i = $('#inputWindow'); var s = $('#sendButton'); var t = $('#typing'); var r = 0; //arrays var msg = ['msg1&lt;br /&gt;', 'msg2&lt;br /&gt;', 'msg3&lt;br /&gt;']; //fire send events $(s).click(function() { runAI(); }); $(i).keydown(function(e) { if (e.keyCode == 13) { runAI(); } }); function runAI() { if (i.val().length &gt; 0) { r = r + 1; o.html(o.html()+n+$("#inputWindow").val()+"&lt;br&gt;&lt;hr&gt;" ); setTimeout(function(){ $("#typing").show(); }, 3000); i.val(''); i.focus(); } } i.focus(); });
has comment: http://stackoverflow.com/comment/46109763
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/46109859
favorite count: 0
has title: Making a automated live chat / fake chat and my javascript is skipping the first response
has comment: http://stackoverflow.com/comment/46109717

http://stackoverflow.com/q/28981896
has answer: http://stackoverflow.com/a/28982136
tagged with: arrays
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28982454
answer count: 3
has answer: http://stackoverflow.com/a/28982072
favorite count: 0
has body: I have 2 arrays of the following contents: var answer = [[2,1],[1,1],[0,0]]; var selectedObject = [[1,1],[0,0],[2,1]]; I want to match the contents of both the arrays. _.Equals is not working for me in the above condition. As the contents being same are not in same position in array. Is there any easy way to match the contents of above mentioned arrays. Any demo code, example, or logic will be helpful.
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28982072
tagged with: kineticjs
accepted answer: http://stackoverflow.com/a/28982454
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
has title: Matching contents of 2 arrays angularjs

http://stackoverflow.com/q/28951649
tagged with: css
has comment: http://stackoverflow.com/comment/46157261
score: 2
upvote count: 2
tagged with: wordpress
type: Question
type: AnsweredQuestion
has body: I'm trying to setup a tabbed pane (via jQuery) on one of my pages in a WordPress site. I have the tabs working and for the most part, it looks how I want it at this stage. There's one issue though - setting the width of the tabs so that each tab's span is long enough that all of them combined is equal to the space of the pane. Now this normally wouldn't be too hard, but the thing is I don't know how many tabs will be there in the end (my client is unsure). Here's the CSS I'm using via Jetpack's Custom CSS functionality: .ui-tabs-nav { font-size: larger; font-weight: bold; background: none; height: 30px; /*To stop nav block scaling of tab size*/ } .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; border: none; background: none; } .ui-tabs .ui-tabs-nav li { display: inline; border: none; margin: 0 0 -5px; background: none; } .ui-tabs-anchor { color: #000034; } ul.ui-widget-header, ul.ui-widget-content, ul.ui-state-default, ul.ui-state-hover { background: none; border: none; } .ui-tabs-active a { text-decoration: none; background: none; color: #222222; position: relative; z-index: 5; } And some javascript to adjust the width of the tabs: jQuery(document).ready(function($) { var numTabs = $('#tabs li').length; var tabWidth = 100 / numTabs; var tabPercent = tabWidth + "%"; var liArray = $('#tabs li'); var i; for (i = 0; i < liArray.length; i++) { liArray[i].style.width = tabPercent; } }); And finally, some HTML: First Second Third Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum. Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum,…
has answer: http://stackoverflow.com/a/28952613
downvote count: 0
has title: Wordpress + JQuery UI Tabs + Dynamically changing Width of Tabs
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28952613
favorite count: 0

http://stackoverflow.com/a/29013167
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28988608
type: AcceptedAnswer
has body: Just don't set this in the theme. When you create that one, chosen chart, then set that option. Something like this: $("#container").highcharts({ chart: { events: { load: your_callback } } });
answers question: http://stackoverflow.com/q/28988608

http://stackoverflow.com/q/28935402
score: 0
answer count: 2
tagged with: jquery-mobile
tagged with: javascript
has body: I am building a mobile website using jQuery Mobile and I want to display a page for like 5 seconds and then have it automatically re direct you to the next page. I saw this code on the internet but I don't think it applies to jQuery Mobile: &lt;META HTTP-EQUIV=Refresh CONTENT="10; URL=index.html/"&gt; Any help would be greatly appreciated!
accepted answer: http://stackoverflow.com/a/30288663
tagged with: http://stackoverflow.com/tag/html
has title: jquery mobile display page for 5 seconds then redirect
has comment: http://stackoverflow.com/comment/46126410
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46160264
tagged with: http-redirect
type: Question
has comment: http://stackoverflow.com/comment/46126329
possible better answer: http://stackoverflow.com/a/28935470
has answer: http://stackoverflow.com/a/28935470
has answer: http://stackoverflow.com/a/30288663
has comment: http://stackoverflow.com/comment/46127331
has comment: http://stackoverflow.com/comment/46142550

http://stackoverflow.com/q/28906965
possible better answer: http://stackoverflow.com/a/28907122
tagged with: ajax
has answer: http://stackoverflow.com/a/28907122
has answer: http://stackoverflow.com/a/28907037
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28907078
accepted answer: http://stackoverflow.com/a/28907078
has title: Am I using the jQuery .each function incorrectly?
tagged with: each
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has body: I am using some jQuery to retrieve and parse some JSON from a third party website, so I can use images from that site to populate a gallery. Please see the details below, and reproduced in this JSFiddle: $(document).ready(function() { function populateImages(path) { $('.crush').each(function() { $(this).html(' '); }); } $.ajax({ url: 'http://tubecrush.net/wp_api/v1/posts?callback=show', dataType: "jsonp", type: "get", success: function(data) { var regex = /"/g; var i = 0; for (i = 0; i < 20; i++) { var content = data.posts[i].content_display; var part1 = content.split('src="'); var part2 = part1[1].split(regex); var imgPath = part2[0]; console.log(imgPath); populateImages(imgPath); } } }); }); Result: I know the part that's retrieving the JSON query is working because it is outputting the image path I want to grab in the console. However, the last part is using the jQuery .each function to add an tag and fill it with the path I have retrieved with the AJAX, but it's not working. Not sure what I am doing wrong. Please note that although the second part is in its own function called populateImages, I have tried embedding that code in the loop part, and still had the same effect. Greatly appreciated if anyone can help.
type: Question
has comment: http://stackoverflow.com/comment/46073455
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/46253134
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28987693
has text: As has already been pointed out, you have several branches of code which generate text output, and that will interfere with creating a redirect header. But what do you want to do about those messages? Should the page display an error or, for a successful deletion, the success message, or should it always redirect?
score: 0

http://stackoverflow.com/a/29046262
score: 0
has body: Use Number(variable) to convert text to number and then do your comparing maths. Example:- var price = Number(document.getElementById(price).value); var price_sell = Number(document.getElementById(price_sell).value); var compare = price_sell - price; Or you can check the variable type, using typeof If value is null or undefined then Number function will convert it to 0 (zero). Even though the 'price_sell' is twice as big/small as the 'price'- Updated Answer 2: /* Errors - price = '10 $'; means remove currency symbols or characters from price_sell and price variable Use trim() to remove whitespace. I recheck my code, and found brackets missing, and posted again. */ price_sell = Number(price_sell.trim()); price = Number(price.trim()); if ((price_sell &gt; (price/0.80)) &amp;&amp; (price_sell &lt; (price*1.30))) { // good } else { // bad } Regards
type: Answer
has comment: http://stackoverflow.com/comment/46331545
answers question: http://stackoverflow.com/q/29046059
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/46415759

http://stackoverflow.com/comment/139121549
type: AnswerComment
comment on: http://stackoverflow.com/a/29017677
score: 0
type: Comment
has text: s.display="inline" allows the effect to repeat every time it's triggered.

http://stackoverflow.com/q/28920134
possible better answer: http://stackoverflow.com/a/28920167
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 2
tagged with: custom-data-attribute
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/28920167
has title: Data attribute undefined
has body: I have a textbox and a checkbox: &lt;input type="text" id="tb1" onFocus="CheckboxDisable('cb1');" /&gt; &lt;input type="checkbox" id="cb1" data-ieflub=""/&gt; When the textbox comes into focus, I would like to disable the checkbox and set the data attribute ieflub to a value. My code is the following: function CheckboxDisable(id){ document.getElementById(id).disabled = true; $('#id').attr('ieflub', 'yes'); } As you can see, quite simple. Except, it doesn't work. I traced through this, using Firebug and see that $('#id').data('data-ieflub'); is undefined inside the CheckboxDisable function. Why?
tagged with: javascript
upvote count: 2
answer count: 2
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28920148
accepted answer: http://stackoverflow.com/a/28920148

http://stackoverflow.com/comment/46162660
has text: Yeah,I had noticed the zero bytes.I know java's library must use padding, so for this reason , the result can't be the same , am I right?
comment on: http://stackoverflow.com/a/28938923
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46159256
has text: Tried the script library now I get : Error loading grid data: TypeError: Grid is not a constructor csJSBODLibrary Listing (line 103) TypeError: Grid is not a constructor grid = new Grid({
type: AnswerComment
comment on: http://stackoverflow.com/a/28952536
score: 0
type: Comment

http://stackoverflow.com/a/29053810
downvote count: 0
answers question: http://stackoverflow.com/q/29053758
accepted answer of: http://stackoverflow.com/q/29053758
has body: It's matching the second "is" because the first part of the regular expression is greedy. That means that .* will start out as matching the entire string, then the regex evaluator will start to backtrack by removing a character at a time from the match until it can find a match for the rest of the pattern. You can make the quantifier non-greedy by adding a question mark after it: /#(.*?) is (.*)/ That will make .*? starting out as matching zero characters, and then a character at a time is added until the rest of the pattern matches. Demo: var string = "#This is a string (which is neat!)" var match = string.match(/#(.*?) is (.*)/); alert('1st match: \t' + match[1] + '\n2nd match: \t' + match[2]);
type: Answer
score: 3
upvote count: 3
type: AcceptedAnswer

http://stackoverflow.com/a/28943975
score: 5
type: AcceptedAnswer
has body: According to the docs, it seems the 5th column should control the size of the bubble. And the 4th should be an ID (I'd use the country's code for this, or just repeat the counytry col again).
upvote count: 5
type: Answer
accepted answer of: http://stackoverflow.com/q/28943751
downvote count: 0
answers question: http://stackoverflow.com/q/28943751

http://stackoverflow.com/q/28925925
tagged with: javascript
has answer: http://stackoverflow.com/a/37601162
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28926113
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/46124091
has comment: http://stackoverflow.com/comment/46110942
has comment: http://stackoverflow.com/comment/46109618
has body: First of all, i have a return from API in a form of html. This will be used in my jqgrid. The sample return would be like this Example name for my object is obj. Then obj.something is below. &lt;div title="custom_title"&gt; &lt;div id="upper"&gt; data from somewhere and this is the part that sometimes need to be sanitized without affecting the other tags &lt;/div&gt; &lt;/div&gt; What i tried so far was trying to do this: var esc = $(''); then did do this: esc.text(obj.something).html(); but it sanitize all of it. Is there anything that i may not know on how to sanitize purely on javascript? Any help is greatly appreciated.
has comment: http://stackoverflow.com/comment/46108493
type: Question
has comment: http://stackoverflow.com/comment/46108561
has comment: http://stackoverflow.com/comment/46108278
answer count: 2
has comment: http://stackoverflow.com/comment/46109703
has title: Javascript - sanitize specific html element

http://stackoverflow.com/comment/46317052
type: QuestionComment
has text: Can you edit your question to include your json returned from `/Justin/graph`? It's hard to wade through the code without seeing it run...
comment on: http://stackoverflow.com/q/29018116
score: 0
type: Comment

http://stackoverflow.com/q/28919351
answer count: 1
has title: Multiple Images displaying last image with dynamically created canvas and assigning to images
has answer: http://stackoverflow.com/a/28919520
type: AnsweredQuestion
has body: function innerAjax(FILE_DIR,imgJPGList){ var imgLength = imgJPGList.length; $("#imgID").empty();// This is a div if(imgLength!=0){ img = []; for(i=0;i&lt; imgLength;i++){ // dir = FILE_DIR+"/"+imgJPGList[i]; var canvasCreator = document.createElement("canvas"); canvasCreator.id = imgJPGList[i].substr(0, imgJPGList[i].indexOf('.')); console.log("canvas id is---"+canvasCreator.id); var canvas = $(canvasCreator).get(0); var ctx = canvas.getContext('2d'); img[i] = new Image(); img[i].onload = function() { console.log("inside onload function"); ctx.drawImage(img[i],0,0); } img[i].src = FILE_DIR+"/"+imgJPGList[i]; canvas.width = img[i].width; canvas.height = img[i].height; $("#imgID").append(canvas); $("#imgID").append($("&lt;br/&gt;")); } } $(canvas).mouseover(function myDown(e) { console.log("mouseover-----"); }) } I have multiple images in a single page i am trying to create a dynamic canvas and set image height and width to it so that i could do some annotation on images. But my last image is getting displayed every time or nothing is displayed. Anyhelp is appreciated.
type: Question
tagged with: canvas
tagged with: javascript
tagged with: image
linked to: http://stackoverflow.com/q/28932978
score: 0
accepted answer: http://stackoverflow.com/a/28919520
tagged with: html5-canvas

http://stackoverflow.com/comment/46417997
type: Comment
has text: You should put this in the question
comment on: http://stackoverflow.com/a/29093232
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46294680
comment on: http://stackoverflow.com/q/29026348
score: 0
type: Comment
type: QuestionComment
has text: can you check the console logs for errors?

http://stackoverflow.com/comment/46174286
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28948935
has text: There's no default values of current datetime at page load in bootstrap.

http://stackoverflow.com/q/28939010
type: Question
has body: I need to put content in a jquery slider and for the slider each slide is a &lt;li&gt; element and I have to put a list of products within that slide, but it also must automatically create a new slide when it's full. Now I've decided that I'm going to put 4 elements in a boundry of 1 slide so after 4 elements, the php loop must create a new slide. How can I do that? It looks somewhat like this: while($r=mysql_fetch_array($sql)) { echo " &lt;li&gt; $r['title'] &lt;li&gt;"; } but of course, this code creates a new slide everytime it returns the result, which isn't what I want.
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28939059
tagged with: jquery
score: 0
answer count: 2
has title: How to divide array in parts (without using multidimensional arrays) with php?
has comment: http://stackoverflow.com/comment/46133060
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28940425
tagged with: php
has comment: http://stackoverflow.com/comment/46135843
tagged with: loops

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/29052817
tags question: http://stackoverflow.com/q/28964370
tags question: http://stackoverflow.com/q/28936423
tags question: http://stackoverflow.com/q/28967128
tags question: http://stackoverflow.com/q/28993668
tags question: http://stackoverflow.com/q/29044332
tags question: http://stackoverflow.com/q/28986599
tags question: http://stackoverflow.com/q/28958004
tags question: http://stackoverflow.com/q/28962037
tags question: http://stackoverflow.com/q/28932919
tags question: http://stackoverflow.com/q/28967521
tags question: http://stackoverflow.com/q/29057429
tags question: http://stackoverflow.com/q/28971881
tags question: http://stackoverflow.com/q/28972588
tags question: http://stackoverflow.com/q/29005660
tags question: http://stackoverflow.com/q/28957079
tags question: http://stackoverflow.com/q/28978648
tags question: http://stackoverflow.com/q/28965357
tags question: http://stackoverflow.com/q/29015493
tags question: http://stackoverflow.com/q/28912272
tags question: http://stackoverflow.com/q/28924780
tags question: http://stackoverflow.com/q/28972466
tags question: http://stackoverflow.com/q/28990558
tags question: http://stackoverflow.com/q/28951275
tags question: http://stackoverflow.com/q/28929584
tags question: http://stackoverflow.com/q/28935363
tags question: http://stackoverflow.com/q/29006411
tags question: http://stackoverflow.com/q/28929020
tags question: http://stackoverflow.com/q/28939067
tags question: http://stackoverflow.com/q/29004213
tags question: http://stackoverflow.com/q/29020721
tags question: http://stackoverflow.com/q/28994294
tags question: http://stackoverflow.com/q/29033321
tags question: http://stackoverflow.com/q/28943691
tags question: http://stackoverflow.com/q/28923355
tags question: http://stackoverflow.com/q/28985259
tags question: http://stackoverflow.com/q/28935037
tags question: http://stackoverflow.com/q/29025845
tags question: http://stackoverflow.com/q/28931704
tags question: http://stackoverflow.com/q/28953336
tags question: http://stackoverflow.com/q/28990298
tags question: http://stackoverflow.com/q/29037383
tags question: http://stackoverflow.com/q/29002462
tags question: http://stackoverflow.com/q/28944163
tags question: http://stackoverflow.com/q/28926825
tags question: http://stackoverflow.com/q/29011413
tags question: http://stackoverflow.com/q/28929869
tags question: http://stackoverflow.com/q/29061488
tags question: http://stackoverflow.com/q/28975647
tags question: http://stackoverflow.com/q/28955942
tags question: http://stackoverflow.com/q/28927091
tags question: http://stackoverflow.com/q/28975999
tags question: http://stackoverflow.com/q/28961889
tags question: http://stackoverflow.com/q/29055824
tags question: http://stackoverflow.com/q/29003673
tags question: http://stackoverflow.com/q/28951518
tags question: http://stackoverflow.com/q/29029691
tags question: http://stackoverflow.com/q/29060350
tags question: http://stackoverflow.com/q/29049761
tags question: http://stackoverflow.com/q/28951142
tags question: http://stackoverflow.com/q/28993275
tags question: http://stackoverflow.com/q/28972436
tags question: http://stackoverflow.com/q/29017375
tags question: http://stackoverflow.com/q/28918387
tags question: http://stackoverflow.com/q/29042886
tags question: http://stackoverflow.com/q/29056227
tags question: http://stackoverflow.com/q/29029431
tags question: http://stackoverflow.com/q/28986681
tags question: http://stackoverflow.com/q/28994375
tags question: http://stackoverflow.com/q/28913956
tags question: http://stackoverflow.com/q/28933293
tags question: http://stackoverflow.com/q/29057563
tags question: http://stackoverflow.com/q/29023276
tags question: http://stackoverflow.com/q/28932836
tags question: http://stackoverflow.com/q/28943321
tags question: http://stackoverflow.com/q/28959416
tags question: http://stackoverflow.com/q/29030685
tags question: http://stackoverflow.com/q/28993157
tags question: http://stackoverflow.com/q/28939536
tags question: http://stackoverflow.com/q/29010590

http://stackoverflow.com/comment/46216684
type: QuestionComment
comment on: http://stackoverflow.com/q/28976442
has text: Set the transform on the SVG.
score: 0
type: Comment

http://stackoverflow.com/q/29061862
tagged with: javascript
has title: want to check the value of the input type number
has comment: http://stackoverflow.com/comment/46360016
answer count: 1
downvote count: 0
tagged with: jquery
has body: i'm new to js i wanted to check the entered number of amount in input type "number" &lt;input type="number" id="val" value="1" class="input-text" &gt; I was trying $("input: number").focus(function(){ var val = $("#val").val(); alert("there are", val + "in your cart"); }); i don't know how to get value from form fields with jquery i just wanted to display the number entered in number field Here is an fiddle example https://jsfiddle.net/s81g6963/
accepted answer: http://stackoverflow.com/a/29063274
favorite count: 0
has comment: http://stackoverflow.com/comment/46362084
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/46360079
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29063274

http://stackoverflow.com/comment/84320732
has text: @SamSaffron,is this answer really solved your problem, can u send some example that worked for u, am working on the same, but it dint worked for me.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/32389421
type: Comment

webpack
tags question: http://stackoverflow.com/q/29021737
tags question: http://stackoverflow.com/q/28969861
type: Tag
tags question: http://stackoverflow.com/q/29017440
tag name: webpack
tags question: http://stackoverflow.com/q/28964886
tags question: http://stackoverflow.com/q/28987626
tags question: http://stackoverflow.com/q/28923792
tags question: http://stackoverflow.com/q/29037307
tags question: http://stackoverflow.com/q/28989228

http://stackoverflow.com/q/29034234
has answer: http://stackoverflow.com/a/29034545
accepted answer: http://stackoverflow.com/a/29034493
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29034545
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: angularjs
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
type: AnsweredQuestion
has title: Filter an angular.js array based on range
has answer: http://stackoverflow.com/a/29034493
has body: I have an angular.js array of 3 products and a range slider that is counting from 0 - 20 with a step of 1. I need to make it so, as I slide the range slider it will filter my array and only show products with the height property that fits in that category. ie: filtering 0 to 10 would show anything with a height of 0, 1, 2, 3, 5, 6, 7, 8, 9, 10. This is not required for my question but if it was possible to append inches to the end of the value, I would appreciate that help as well. My html is just a basic range slider set up: {{p.name}} {{p.height}} My App.js //app var app = angular.module('plunker', ['rzModule']); app.controller('MainCtrl', function($scope) { $scope.priceSlider = { min: 0, max: 20, ceil: 20, floor: 0, step: 1 }; $scope.products = [ { name: 'one', height: '00' }, { name: 'two', height: '10' }, { name: 'three', height: '20' } ]; }); Since I have to call to some outside sources and have a ton of css in this aswell, here is a codepen link I have been trying to solve this for days and am starting to question if it's even possible! Thanks for the help in advance!

http://stackoverflow.com/a/28971614
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46203597
has body: I don't understand your second part of your statement regarding not being able to use jSoup because the URL is the same? Can you explain that better? In any rate to pull the links out using jSoup is really easy. Document doc = Jsoup.parse(pageHTML); Elements pageLinks = doc.select("div#dl_links a"); ArrayList&lt;String&gt; theLinks; theLinks= new ArrayList&lt;String&gt;(pageLinks.size()); if (pageLinks.size() &gt; 0) { for (Element lnk : theLinks) { if (lnk.attr("style").contains("display:none")) { theLinks.add(lnk.attr("href")); } } } EDIT You could also probably shorten the results by doing something like... doc.select("div#dl_links a[style*=display:none]") EDIT 2 Since your needing to get the information after a javascript press then your going to want to do something like this... WebView.loadUrl("javascript:(function() { document.querySelectorAll(\"button[type='submit']\")[0].click();})()"); The above would click the item that needs to be clicked so the new HTML will be shown. You might need to do a pause or thread sleep to make sure the new text has been shown. The program is the WebView doesn't have a great way of allowing you to just read the new HTML, so you will need to look into those ways if you need to wait until that specific text is on the page if it takes a while for it to load on the page after pressing the button. This isn't an "easy" task. You would want to refer to this page for ideas and concepts: how to get html content from a webview? Once your done returning the HTML, then you would just do the jSoup over the page's HTML.
type: Answer
answers question: http://stackoverflow.com/q/28969988
has comment: http://stackoverflow.com/comment/46201668
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28969988
has comment: http://stackoverflow.com/comment/46194951
score: 1
has comment: http://stackoverflow.com/comment/46198079

php
tags question: http://stackoverflow.com/q/28991788
tags question: http://stackoverflow.com/q/28920891
tags question: http://stackoverflow.com/q/29048813
tags question: http://stackoverflow.com/q/28994425
tags question: http://stackoverflow.com/q/28935956
tags question: http://stackoverflow.com/q/29061023
tags question: http://stackoverflow.com/q/28947106
tags question: http://stackoverflow.com/q/29008204
tags question: http://stackoverflow.com/q/28965286
tags question: http://stackoverflow.com/q/28996255
tags question: http://stackoverflow.com/q/28922422
tags question: http://stackoverflow.com/q/28939168
tags question: http://stackoverflow.com/q/28968384
tags question: http://stackoverflow.com/q/29055425
tags question: http://stackoverflow.com/q/28955368
tags question: http://stackoverflow.com/q/28930624
tags question: http://stackoverflow.com/q/28916571
tags question: http://stackoverflow.com/q/28957005
tags question: http://stackoverflow.com/q/29026149
tags question: http://stackoverflow.com/q/28911335
tags question: http://stackoverflow.com/q/28942359
tags question: http://stackoverflow.com/q/28954899
tags question: http://stackoverflow.com/q/28925259
tags question: http://stackoverflow.com/q/28991393
tags question: http://stackoverflow.com/q/29007941
tags question: http://stackoverflow.com/q/28959175
tags question: http://stackoverflow.com/q/29005657
tags question: http://stackoverflow.com/q/29062116
tags question: http://stackoverflow.com/q/29006462
tags question: http://stackoverflow.com/q/28930074
tags question: http://stackoverflow.com/q/28972684
tags question: http://stackoverflow.com/q/28930371
tags question: http://stackoverflow.com/q/29018211
tags question: http://stackoverflow.com/q/28951850
tags question: http://stackoverflow.com/q/28909511
tags question: http://stackoverflow.com/q/28914013
tags question: http://stackoverflow.com/q/28930747
tags question: http://stackoverflow.com/q/28910879
tags question: http://stackoverflow.com/q/28908607
tags question: http://stackoverflow.com/q/29056336
tags question: http://stackoverflow.com/q/29026845
tags question: http://stackoverflow.com/q/28916918
tags question: http://stackoverflow.com/q/29015607
tags question: http://stackoverflow.com/q/29008351
tags question: http://stackoverflow.com/q/29037539
tags question: http://stackoverflow.com/q/28955598
tags question: http://stackoverflow.com/q/29001764
tags question: http://stackoverflow.com/q/29058513
tags question: http://stackoverflow.com/q/29053073
tags question: http://stackoverflow.com/q/28921564
tags question: http://stackoverflow.com/q/28957500
tags question: http://stackoverflow.com/q/28958929
tags question: http://stackoverflow.com/q/28926243
tags question: http://stackoverflow.com/q/29037538
tags question: http://stackoverflow.com/q/29050244
tags question: http://stackoverflow.com/q/29027891
tags question: http://stackoverflow.com/q/28927732
tags question: http://stackoverflow.com/q/28963301
tags question: http://stackoverflow.com/q/29046228
tags question: http://stackoverflow.com/q/28955547
tags question: http://stackoverflow.com/q/29026123
tags question: http://stackoverflow.com/q/29019301
tags question: http://stackoverflow.com/q/28985363
tags question: http://stackoverflow.com/q/29024517
tags question: http://stackoverflow.com/q/28934174
tags question: http://stackoverflow.com/q/28988717
tags question: http://stackoverflow.com/q/28932234
tags question: http://stackoverflow.com/q/28991697
tags question: http://stackoverflow.com/q/29010995
tags question: http://stackoverflow.com/q/29046926
tags question: http://stackoverflow.com/q/29009522
tags question: http://stackoverflow.com/q/29046406
tags question: http://stackoverflow.com/q/28975745
tags question: http://stackoverflow.com/q/28977035
tags question: http://stackoverflow.com/q/29006221
tags question: http://stackoverflow.com/q/29031297
tags question: http://stackoverflow.com/q/28914297
tags question: http://stackoverflow.com/q/28962057
tags question: http://stackoverflow.com/q/28912030
tags question: http://stackoverflow.com/q/29061532

http://stackoverflow.com/a/28971867
has comment: http://stackoverflow.com/comment/46279495
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46297230
has body: when you are using wp_enqueue_script, the handle name ( first attribute ) must be uniqe for each one. so try following code. function my_bootstrap_scripts() { wp_enqueue_script('jquery'); wp_enqueue_script('bootstrap-js', get_template_directory_uri() . '/js/vendor/bootstrap.min.js', array('jquery'), '', true); wp_enqueue_script('main-js', get_template_directory_uri() . '/js/main.js', array('jquery'), '', true); } add_action('wp_enqueue_scripts', 'my_bootstrap_scripts');
answers question: http://stackoverflow.com/q/28970534

http://stackoverflow.com/q/28973807
has comment: http://stackoverflow.com/comment/46200115
accepted answer: http://stackoverflow.com/a/28974099
has body: I'm writing some node.js to interact with sensors over a serial port connection. The code for reading the sensor is asynchronous, naturally. In my control code, though, I need to read a sensor, do something based on the value, read again, do something else, etc. To do this, I'm using code like the following self-contained test: var main = new Main(); main.next(); function* Main() { var reading = yield readSensor(this.next.bind(this)); console.log(reading); var reading = yield readSensor(this.next.bind(this)); console.log(reading); } function readSensor(callback) { // simulate asynchrounous callback from reading sensor setTimeout(function sensorCallback() { callback('foo'); }, 100); } So, my sequential control code is in a generator which yields to readSensor() when it needs to get a reading. When the sensor reading is done, it calls the callback, and control returns to the main code. I'm doing it this way because I may need to read from various sensors in different orders depending on previous readings. So, here's the questionable part: I pass this.next.bind(this) as a callback to the asynchronous read function. The code seems to work when generators are enabled (--harmony_generators), but I am wondering if there are pitfalls here that I am missing. I'm relatively new to JS, so don't be afraid to point out the obvious :)
upvote count: 5
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46221066
tagged with: yield
has title: Using generator function next() as a callback in node.js
linked to: http://stackoverflow.com/q/28250680
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28987556
favorite count: 0
has comment: http://stackoverflow.com/comment/46223514
has answer: http://stackoverflow.com/a/28987556
type: Question
linked to: http://stackoverflow.com/q/23551418
answer count: 2
score: 5
has answer: http://stackoverflow.com/a/28974099
tagged with: node.js

http://stackoverflow.com/q/28944625
answer count: 1
tagged with: javascript
has body: In the below example I have to use service inside roles how to use service and return array value from there Example : .config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider, $rootScope) { $urlRouterProvider.otherwise('signin'); $stateProvider.state('site', { 'abstract': true, resolve: { authorize: ['authorization', function (authorization) { return authorization.authorize(); }, ] } }) .state('signin', { parent: 'site', url: '/signin', data: { roles: (function () { //principal.GetRoles(); --&gt; in the below line i am returning hardcoded array value but i have take that array value from below principle factory return ['Dev','Admin']; })() }, views: { '': { templateUrl: '/signin.html' }, 'content@': { templateUrl: '/index.html', controller: 'SigninCtrl' } }, })} ]) Service / Factory :- from here i need to return array to the above custom object data->roles that inside signin state Below Example:- .factory('principal', ['$q', '$http', '$timeout', '$cookieStore', '$cookies', function ($q, $http, $timeout, $cookieStore, $cookies) { var _identity = undefined, _authenticated = false; return { isIdentityResolved: function () { return angular.isDefined(_identity); }, isAuthenticated: function () { return _authenticated; }, RedirectUrl: function (absUrl) { $cookieStore.put('RedirectUrl', absUrl); return true; }, GetRoles: function () { return ['Dev','Admin'] }, } ])
score: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46145613
type: UnansweredQuestion
tagged with: angularjs-ng-route
has comment: http://stackoverflow.com/comment/46144654
tagged with: angular-ui-router
has answer: http://stackoverflow.com/a/41075908
type: Question
has title: In the config function inside state how to use factory /service for the custom data properties in angular js

wordpress
tags question: http://stackoverflow.com/q/28922422
tags question: http://stackoverflow.com/q/28972684
tags question: http://stackoverflow.com/q/28970452
tags question: http://stackoverflow.com/q/28979910
tags question: http://stackoverflow.com/q/28958929
tags question: http://stackoverflow.com/q/28992883
tags question: http://stackoverflow.com/q/29058845
tags question: http://stackoverflow.com/q/28927842
tags question: http://stackoverflow.com/q/29018451
tags question: http://stackoverflow.com/q/28978756
tags question: http://stackoverflow.com/q/28914181
tags question: http://stackoverflow.com/q/29026294
tags question: http://stackoverflow.com/q/29015425
tags question: http://stackoverflow.com/q/28942586
tags question: http://stackoverflow.com/q/28920579
tags question: http://stackoverflow.com/q/29052564
tags question: http://stackoverflow.com/q/28965314
tags question: http://stackoverflow.com/q/29042772
tags question: http://stackoverflow.com/q/28970534
tag name: wordpress
tags question: http://stackoverflow.com/q/28955349
tags question: http://stackoverflow.com/q/28997696
tags question: http://stackoverflow.com/q/29039144
tags question: http://stackoverflow.com/q/28995738
tags question: http://stackoverflow.com/q/29013084
tags question: http://stackoverflow.com/q/28965266
tags question: http://stackoverflow.com/q/28933756
tags question: http://stackoverflow.com/q/29019992
tags question: http://stackoverflow.com/q/28947605
tags question: http://stackoverflow.com/q/28957783
tags question: http://stackoverflow.com/q/29000096
tags question: http://stackoverflow.com/q/28919852
tags question: http://stackoverflow.com/q/28912369
tags question: http://stackoverflow.com/q/28993787
tags question: http://stackoverflow.com/q/28946210
tags question: http://stackoverflow.com/q/28951649
tags question: http://stackoverflow.com/q/29043699
type: Tag
tags question: http://stackoverflow.com/q/29030123

http://stackoverflow.com/q/28963530
upvote count: 5
downvote count: 0
tagged with: javascript
has title: Calling AngularJS controller function when html5 video ends
has comment: http://stackoverflow.com/comment/64218310
has body: I have a video on the homepage of my app which plays when I launch it. When the video ends I'd then like to use some CSS 3 transitions to move the page around. &lt;ion-view hide-back-button="true" title=""&gt; &lt;ion-pane&gt; &lt;div class="home-video"&gt; &lt;video autoplay="autoplay" ng-click="ctrl.video()" aria-label="video of IBM logo" tabindex="-1" aria-hidden="true" poster="images/Hero_Final_Placeholder.gif" onended="ctrl.video()"&gt; &lt;source src="videos/video.mp4" type="video/mp4"&gt; &lt;img src="images/video_backup.gif" title="Your browser does not support the video tag."&gt; &lt;/video&gt; &lt;/div&gt; &lt;/ion-pane&gt; &lt;/ion-view&gt; At the end of the video I'd like to be able to call an angularJS Controller function. 'use strict'; angular.module('app', ['ionic']).config(function ($stateProvider, $urlRouterProvider) { $stateProvider.state('home', { url: "/home", templateUrl: 'views/home.html', controller: 'homeCtrl as ctrl' }).state('project', { url: "/project/:projectId", templateUrl: 'views/project.html', controller: 'projectCtrl' }); // Default view to show $urlRouterProvider.when('', '/home'); }).run(function ($http, pouchDB, replicationService, $rootScope) { replicationService.replicate(); }); My controller looks like: 'use strict'; var app = angular.module('app', false); app.controller('homeCtrl', function ($rootScope){ this.data = {}; var ctrl = this; this.video = function () { console.log("video done"); } }); If I put a console.log() in the &lt;video onended=""&gt; element it prints it out. If I try and call ctrl.video() which contains the same console.log I get the following error: Uncaught ReferenceError: ctrl is not defined I know that ctrl is defined because if I add an ng-click="ctrl.video()" and I click the video player it prints out.
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/121833556
type: AnsweredQuestion
tagged with: video
linked to: http://stackoverflow.com/q/39090942
possible better answer: http://stackoverflow.com/a/28996150
has answer: http://stackoverflow.com/a/29030565
has answer: http://stackoverflow.com/a/28996150
tagged with: html5-video
tagged with: ionic-framework
type: Question
answer count: 2
score: 5
accepted answer: http://stackoverflow.com/a/29030565

http://stackoverflow.com/comment/46449119
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29016925
has text: You have your import_file_orders function in the Meteor.isClient block. I moved it to the Meteor.isServer where the upload method can see it and now it runs.

http://stackoverflow.com/q/28950069
has comment: http://stackoverflow.com/comment/46154005
score: 1
type: Question
linked to: http://stackoverflow.com/q/191413
linked to: http://stackoverflow.com/q/7300632
downvote count: 0
tagged with: javascript
has body: I have an intensive jQuery function that takes place on my page when a button is clicked. I display a loading gif while this takes place. This can take around 5 seconds. The problem I have is that the animated gif stops spinning while the JavaScript is processing, causing users to think it's crashed. Is there a way to ensure the loading gif remains spinning? $('button').click(function() { myFunction(); }); function myFunction() { var text = ""; var i = 0; while (i < 50500) { text += " The number is " + i; i++; } $("p").append(text); } click here DEMO http://jsfiddle.net/wgh2oseu/1/
tagged with: jquery
duplicate of: http://stackoverflow.com/q/7300632
has comment: http://stackoverflow.com/comment/46154448
has comment: http://stackoverflow.com/comment/46154199
linked to: http://stackoverflow.com/q/12419579
favorite count: 0
answer count: 0
type: UnansweredQuestion
has title: Display animated gif while carrying out Jquery function
upvote count: 1
has comment: http://stackoverflow.com/comment/46153995

http://stackoverflow.com/comment/100444271
type: AnswerComment
has text: You can use [edit] link to edit your post instead of deleting an answer and posting again
type: Comment
score: 1
comment on: http://stackoverflow.com/a/56952754

http://stackoverflow.com/a/29028352
score: 0
has body: see this regex demo https://regex101.com/r/vV2gT7/2 /([\w\d]{1,})/g "/ ( ( C * 20 ) + 100 ) + C ".match(/([\w\d]{1,})/g)
type: Answer
answers question: http://stackoverflow.com/q/29028278

http://stackoverflow.com/a/29042523
accepted answer of: http://stackoverflow.com/q/29040083
has body: You need to reset PolygonOffset or disable/reenable it, otherwise both triangles are offset by the same amount. GPUs are state machines, you're in charge of managing the state(variables): function render() { // Clear color and depth buffer gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // Draw the triangles gl.polygonOffset(0.0, 0.0); // Reset the polygon offset gl.drawArrays(gl.TRIANGLES, 0, n/2); // The green triangle gl.polygonOffset(1.0, 1.0); // Set the polygon offset gl.drawArrays(gl.TRIANGLES, n/2, n/2); // The yellow triangle }
answers question: http://stackoverflow.com/q/29040083
type: Answer
score: 3
downvote count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/46396931
type: AcceptedAnswer

http://stackoverflow.com/a/28929880
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28927757
answers question: http://stackoverflow.com/q/28927757
has body: Add an id to your form or to a div in your form (calling it '#addinput' here), then append a hidden input once your button is clicked: &lt;script&gt; $('#button').click(function(){ var cost = +($("#cost").text().replace('$','')); $('#addinput').append('&lt;input type="hidden" name="id" value="'+cost+'" id="id"&gt;') }); &lt;/script&gt;

http://stackoverflow.com/comment/46137218
type: Comment
type: QuestionComment
has text: Apart from loop you will need lookup map(s) also if you want to avoid loop inside loop kind of logic.
comment on: http://stackoverflow.com/q/28941225
score: 0

http://stackoverflow.com/q/28947337
has answer: http://stackoverflow.com/a/28947639
type: AnsweredQuestion
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28947886
downvote count: 0
accepted answer: http://stackoverflow.com/a/28947639
tagged with: javascript
score: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/28947886
has title: Increment of counter on dynamic addition of rows
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to add the rows dynamically plus auto-increment of a counter.I want to start with 1 then 2 then 3 and so on . I have added my code on plunker ,in which every time the max value is getting in first column like 4 then 1,1,2,3.Where am i going wrong ?i Want it to be 1,2,3,4. Here is the plunker link http://plnkr.co/edit/GuDbJ3SHOPvWkHfNfd8E?p=preview var _counter = 0; function Add() { _counter++; var oClone = document.getElementById("template").cloneNode(true); oClone.id += (_counter + ""); document.getElementById("placeholder1").appendChild(oClone); document.getElementById("myVal").value=_counter; } &lt;div id="placeholder1"&gt; &lt;div id="template"&gt; &lt;div&gt; Value:&lt;input type="text" id="myVal" placeholder="1"&gt; Quantity:&lt;input type="text" placeholder="Qty"&gt; &lt;input type="button" onClick="Add()" value="Click! "&gt; &lt;/div&gt; &lt;/div&gt;
upvote count: 1

http://stackoverflow.com/q/28989077
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28989261
score: 2
upvote count: 2
has body: I'm trying to update my language change hardcoded placeholder so I have &lt;input type="text" placeholder="{{placeholderText}} /&gt; and in my angular controller $scope.placeholderText =filter("translate")("label"); but when the language is updated the placeholder remains in the original language. also is there a way to hide the placeholder's {{placeholderText}} uppon loading the page, before the translate kicks in.
linked to: http://stackoverflow.com/q/14302267
type: Question
has title: Angular-translate update on placeholder
tagged with: javascript
tagged with: angular-translate
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs

heroku
tags question: http://stackoverflow.com/q/28913452
tags question: http://stackoverflow.com/q/29000089
tags question: http://stackoverflow.com/q/28947087
tags question: http://stackoverflow.com/q/29017337
tags question: http://stackoverflow.com/q/29033548
tags question: http://stackoverflow.com/q/29043431
tags question: http://stackoverflow.com/q/28923323
type: Tag
tag name: heroku

http://stackoverflow.com/comment/46189730
type: Comment
comment on: http://stackoverflow.com/a/28968868
type: AnswerComment
has text: Its not following on, its pseudocode and a step in the right direction
score: 0

http://stackoverflow.com/comment/46315164
type: Comment
comment on: http://stackoverflow.com/a/29034760
score: 0
type: AnswerComment
has text: _> My desire is for an error to not open a new window and instead display the HTML on the original page._ I think that's an HTML issue. AFAIK, where the response goes is based on your target attribute. You don't really have an opportunity to make it conditional upon the response. I think your only alternative would be to write a lot of javascript that uses XMLHTTPRequest object to talk to the server and control the presentation of the response.

http://stackoverflow.com/q/29020721
has title: Download image from url using html/jquery
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46286477
has comment: http://stackoverflow.com/comment/46286623
has body: I'm trying to show a images from a JSON file, which change dynamically. However it seems like this url has denied permission for hotlinking and showing image through iframes. I've come to this conclusion from following errors: Refused to display 'http://www.gosugamers.net/uploads/images/teams/10649-1422301535.jpeg' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. http://www.gosugamers.net/uploads/images/teams/10649-1422301535.jpeg Failed to load resource: the server responded with a status of 403 (Forbidden) My question is then how can i using html/jquery download the image without using to much memories since it will download the image everytime a user visit this page? This is what i've tried so far image1.html('&lt;iframe src="http://www.gosugamers.net/' + m['team 1']['image'] + '" name="imgbox" id="imgbox"&gt;&lt;/iframe&gt;') image1.html('&lt;img class="team1" src="http://www.gosugamers.net/' + m['team 1']['image'] + '"&gt;')
type: Question

http://stackoverflow.com/comment/46165760
type: Comment
type: QuestionComment
has text: What are you trying to achieve exactly? It sounds like you want a particle system or point cloud
comment on: http://stackoverflow.com/q/28948467
score: 0

http://stackoverflow.com/a/28931778
has comment: http://stackoverflow.com/comment/46119421
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28922148
has comment: http://stackoverflow.com/comment/46119483
has comment: http://stackoverflow.com/comment/46122210
type: AcceptedAnswer
downvote count: 0
has body: Why not just remove it yourself? insert’s second parameter is a callback, inside which you can use setTimeout to wait 2 seconds: Tasks.insert({ text: text, createdAt: new Date(), }, function(err, _id) { if (_id != null) { Meteor.setTimeout(function() { Tasks.remove(_id); }, 2000); // 2 seconds delay } });
answers question: http://stackoverflow.com/q/28922148
type: Answer

http://stackoverflow.com/comment/46250852
type: QuestionComment
has text: you are using a plugin called `tabulous` but haven't included that library script
comment on: http://stackoverflow.com/q/29001604
score: 0
type: Comment

http://stackoverflow.com/comment/46228838
comment on: http://stackoverflow.com/q/28989959
type: Comment
type: QuestionComment
has text: @johnG the view shouldn't matter... you're using event delegation to bind the event to the form regardless of when a view is rendered. Maybe there's a JS error or something?
score: 0

http://stackoverflow.com/a/28948084
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28947450
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/46150680
has body: You should add the following line to sort the values: index.sort(function(a, b) { return data[b] - data[a]; }); Check out the jsfiddle: http://jsfiddle.net/k9rcyeyo/
answers question: http://stackoverflow.com/q/28947450
score: 1
upvote count: 1

http://stackoverflow.com/q/29026062
type: Question
has comment: http://stackoverflow.com/comment/46295491
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46295122
has comment: http://stackoverflow.com/comment/46295613
has answer: http://stackoverflow.com/a/29027572
has title: Links within littleBoxes JQuery code
score: 0
accepted answer: http://stackoverflow.com/a/29027572
has comment: http://stackoverflow.com/comment/46294546
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/46294391
has comment: http://stackoverflow.com/comment/46295640
has comment: http://stackoverflow.com/comment/46294225
tagged with: css
type: AnsweredQuestion
has body: I'm trying to add this neat header to my site: http://tympanus.net/codrops/2010/05/18/little-boxes-menu-with-jquery/ The one problem is that the javascript was making all links animate in the same way as the little boxes, so any links I included within the header would become animated. I found one thread here on Stack Overflow that offered some solutions. After finding one that appeared to work, I discovered that the boxes no longer animate once expanded. When you click on the box div to have it close, it will instead refresh the page. I'd like to find a way to include links without compromising the animated effect. Here's the Javascript: $(function() { /* object to save the initial positions of each box */ var divinfo = {"initial": []}; /* index of the selected / clicked box */ var current = -1; /* we save the index,top and left of each box */ $('#littleBoxes &gt; div','staffer').each(function(){ $('staffer').removeClass('#littleBoxes a').addClass('#staffer a'); var $this = $(this); var initial = { 'index' : $this.index(), 'top' : $this.css('top'), 'left' : $this.css('left') }; divinfo.initial.push(initial); }); /* click event for the anchors inside of the boxes */ $('#littleBoxes a').bind('click',function(e){ var $this = $(this); var $currentBox = $this.parent(); /* set a z-index lower than all the other boxes, to see the other boxes animation on the top*/ $currentBox.css('z-index','1'); /* if we are clicking on an expanded box: */ if(current == $currentBox.index()){ /* put it back (decrease width, height, and set the top and left back) the previous positions are saved in the divinfo obj*/ $currentBox.stop().animate({ 'top' : divinfo.initial[$currentBox.index()].top, 'left' : divinfo.initial[$currentBox.index()].left, 'width' : '90px', 'height' : '90px' },800,'easeOutBack').find('.boxcontent').fadeOut(); $('#littleBoxes &gt; div').not($currentBox).each(function(){ var $ele = $(this); var elemTop = divinfo.initial[$ele.index()].top; var elemLeft = divinfo.initial[$…
has comment: http://stackoverflow.com/comment/46294325

http://stackoverflow.com/comment/46090073
type: QuestionComment
comment on: http://stackoverflow.com/q/28915127
score: 1
has text: It seems that you're using version 2.x-RC1. Try using a nightly buid from here: https://github.com/Studio-42/elFinder#downloads. This will, most likely, solve you're issue
type: Comment

http://stackoverflow.com/comment/46139667
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28942541
has text: Your `if` statements are all invalid and you've not given any example of your DOM. Please take the time to create an actual demo of the problem.

http://stackoverflow.com/a/74866220
type: Answer
answers question: http://stackoverflow.com/q/28965112
has body: const categoryWithDuplicates =[ 'breakfast', 'lunch', 'shakes', 'breakfast', 'lunch', 'shakes', 'breakfast', 'lunch', 'shakes' ] const categoryWithoutDuplicates =[...new Set(categoryWithDuplicates)]; console.log(categoryWithoutDuplicates) Output: [ 'breakfast', 'lunch', 'shakes' ]
score: 15
upvote count: 15
downvote count: 0

http://stackoverflow.com/comment/46315451
type: Comment
score: 0
type: AnswerComment
has text: You second question depends on your use-case, but personally I'd pack all jquery plugins + jquery itself into one bundle.
comment on: http://stackoverflow.com/a/28989476

http://stackoverflow.com/comment/46074338
type: Comment
score: 1
has text: Beyond that, check out the yeoman angular.ja generator. It's awesome. https://github.com/yeoman/generator-angular
comment on: http://stackoverflow.com/a/28907412
type: AnswerComment

http://stackoverflow.com/a/28931063
type: Answer
has body: Since a notation like \U0001f374 is undefined in JavaScript, you need to construct the character from it with your own code (or suitable library code). You could parse the Unicode number from the string and convert it to a pair of surrogate code points. But if you are using JavaScript in the HTML (or XML) context, you could let the HTML (or XML) parser do the job. Just change the string (assumed to have 8 hex digits) to an HTML or XML character reference and make sure the result is parsed as markup: var sample = document.getElementById('in').value; sample = sample.replace(/\\U([0-9a-f]{8})/gi, "&#x$1;"); document.getElementById('demo').innerHTML = sample; To be replaced
accepted answer of: http://stackoverflow.com/q/28924961
upvote count: 3
answers question: http://stackoverflow.com/q/28924961
score: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46192869
comment on: http://stackoverflow.com/q/28970542
has text: @JayBlanchard `return false` should do that, assuming no errors are thrown beforehand
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/46308324
score: 0
type: QuestionComment
type: Comment
has text: The for loop is definitely the better way to go. It's not worth the trouble or extra code to figure it out with the .each method. I have updated the fiddle to use the for loop. http://jsfiddle.net/JacobHeater/vm09jsrw/4/
comment on: http://stackoverflow.com/q/29031981

http://stackoverflow.com/q/28963671
has title: Unable to set date format & dropdown text in jqGrid
has comment: http://stackoverflow.com/comment/46181263
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46209951
has answer: http://stackoverflow.com/a/28982729
has comment: http://stackoverflow.com/comment/46209369
has comment: http://stackoverflow.com/comment/46213141
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46209464
has body: I am using jqGrid to display data. Data is in xml format. I am unable to format date column (source format : yyyyMMdd, target format : dd-mm-yyy). My Grid is unable to display text value from select, It shows values instead of text. Strange thing is it is working in some other screen. <SalesOpportunitiesLines> 0 1 20131126 20131126 1 0.000000 1000000.000000 bodt_MinusOne ACCM Services CLINAC0709 366 1 1212 </SalesOpportunities> $("#uxStages").jqGrid({ datatype: 'xmlstring', datastr: xmlstring, mtype: 'GET', ajaxGridOptions: { contentType: 'application/json; charset=utf-8' }, xmlReader: { repeatitems: false, root: "BO>SalesOpportunitiesLines", row: 'row' }, colNames: ['LineNum', 'Star tDate', 'Clos Date', 'Sales Employee', 'Stage', 'Percentage', 'Potential Amount', 'Document Type', 'Doc. No.', 'Owner'], colModel: [ { name: 'LineNum', key: true, index: 'LineNum', hidden: true, sortable: false, width: 60 }, { name: 'StartDate', key: false, index: 'StartDate', sortable: false, align: "left", width: 90, editable: true, formatter: 'date', formatoptions: { srcformat: 'yyyyMMdd', newformat: 'd-M-y' }, editoptions: { dataInit: function (elem) { $(elem).datepicker({ dateFormat: 'dd-M-yy' }); } } }, { name: 'ClosingDate', key: false, index: 'ClosingDate', sortable: false, align: "left", width: 90, editable: true, formatter: 'date', formatoptions: { srcformat: 'yyyyMMdd', newformat: 'd-M-y' }, editoptions: { dataInit: function (elem) { $(elem).datepicker({ dateFormat: 'dd-M-yy' }); } } }, { name: 'SalesPerson', key: false, index: 'SalesPerson', sortable: false, width: 80, editable: true, edittype: "select" }, { name: 'StageKey', key: false, index: 'StageKey', hidden: false, sortable: false, width:80, editable: true, edittype: "select" }, { name: 'PercentageRate', key: false, index: 'PercentageRate', sortable: false, width: 60 }, { name: 'MaxLocalTotal', key: false, index: 'MaxLocalTotal', sortable: false, width: 100, editable: true, edittype: "text", formatter: 'currency', form…
has comment: http://stackoverflow.com/comment/46209556
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46208863
tagged with: jqgrid
has comment: http://stackoverflow.com/comment/46209606
has comment: http://stackoverflow.com/comment/46213204
has comment: http://stackoverflow.com/comment/46181130
accepted answer: http://stackoverflow.com/a/28982729
type: Question
has comment: http://stackoverflow.com/comment/46209582

http://stackoverflow.com/comment/46106331
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28918884
has text: you're right, the filter doesn't need it. thanks!

http://stackoverflow.com/a/28919365
score: 0
answers question: http://stackoverflow.com/q/28919246
has comment: http://stackoverflow.com/comment/46097861
has comment: http://stackoverflow.com/comment/46099420
type: Answer
has body: This is down to the page life cycle of web forms. If you add controls to the aspx markup then the code behind will handle creation of these controls on post back. If you create dynamic controls then you need to recreate them yourself at the appropriate stage of the life cycle. The Page_init event is the safest place and should allow the view state to populate the state and fire the event. You will need to reattach the event handler. Microsoft will tell you more here.
has comment: http://stackoverflow.com/comment/46096453
has comment: http://stackoverflow.com/comment/46096347

http://stackoverflow.com/q/28943028
has body: I have a form that I cannot modify the source of, but need to add additional actions so I added an external js file that contains this: $("input[title=Save]").click(function(){ alert("Profile saved"); window.location.replace("/newpage.asp"); }); All works fine in IE and FF (after the Save button submits the form, an alert appears and then it redirects you). But in Chrome everything seems to work but the contents of the form do not submit correctly, that is to say if you reload the page the fields aren't saved. This is the button &lt;input class="rButton" type="button" value="Save" title="Save" onclick="javascript:submitME(0,0);return false;" /&gt;
tagged with: javascript
tagged with: jquery
has title: Form not submitting correctly in Chrome (data not saving)
has comment: http://stackoverflow.com/comment/46161723
has comment: http://stackoverflow.com/comment/46140354
has comment: http://stackoverflow.com/comment/46140994
has comment: http://stackoverflow.com/comment/46141364
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46143286
answer count: 0
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/46161996
tagged with: forms
score: 0

http://stackoverflow.com/q/28989242
type: AnsweredQuestion
has body: I have the following JQuery function which I want to be called when the page loads. class Fitbit(object): @cherrypy.expose def index(self): currentDate = (time.strftime("%d/%m/%Y")) return """ Fitbit {0} Steps """ .format(currentDate) #return html index.exposed = True if __name__ == '__main__': conf = { '/': { 'tools.sessions.on': True, 'tools.staticdir.root': os.path.abspath(os.getcwd()) }, '/static': { 'tools.staticdir.on': True, 'tools.staticdir.dir': './public' }, '/images': {'tools.staticdir.on': True, 'tools.staticdir.dir': './public'} } cherrypy.quickstart(Fitbit(), '/', conf) This is within my HTML which is in my .py file using return """ etc. I am using CherryPy to do this, and I need to find how to call this function when the page loads. All examples I have found are called on a button click, which isn't any help to me, especially as I am new to this and not sure how to do similar for on load. Thanks
type: Question
accepted answer: http://stackoverflow.com/a/28989362
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
tagged with: cherrypy
tagged with: python
has title: Call JQuery on load using Python CherryPy
has answer: http://stackoverflow.com/a/28989362

http://stackoverflow.com/a/28934950
type: Answer
has comment: http://stackoverflow.com/comment/46125570
has comment: http://stackoverflow.com/comment/46126349
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46125541
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28934934
has body: The problem with your code is that, _.each will iterate through all the elements of the array and call the function you pass to it. You will not be able to come to a conclusion with that, since you are not getting any value returned from it (unless you maintain state outside _.each). Note that the values returned from the function you pass to _.each will not be used anywhere and they will not affect the course of the program in any way. But, instead, you can use _.some as an alternate, like this var checkValue = function(arg) { return _.some(helloArr, function(currentString) { return arg === currentString; }); }; But, a better solution would be, _.contains function for this purpose. You can use it like this var checkValue = function(arg) { return _.contains(helloArr, arg); }; But, since you have only Strings in the Array, the best solution would be to use Array.prototype.indexOf, like this var checkValue = function(arg) { return helloArr.indexOf(arg) !== -1; };
accepted answer of: http://stackoverflow.com/q/28934934
upvote count: 1

http://stackoverflow.com/a/28932760
has body: You are on the right track. Use JQuery's bind and unbind functions: function move() { $("#carr").unbind("click"); //do stuff $("#carr").bind("click", function () { move(); }); } $(document).ready(function () { move(); });
score: 0
answers question: http://stackoverflow.com/q/28932647
type: Answer

http://stackoverflow.com/q/28964780
type: Question
accepted answer: http://stackoverflow.com/a/28965295
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28965295
has body: Tipsy is used to display a lot of text when hovering over my nodes and I'd like to make that text smaller. How do I do that? $('.node').tipsy({ gravity: 'w', html: true, title: function() { var d = this.__data__, id = d.id, inc_calls = d.inc_calls, out_calls = d.out_calls, inc_texts = d.inc_texts, out_texts = d.out_texts; return 'Incoming Calls: ' + inc_calls + '&lt;br/&gt;' + 'Outgoing Calls: ' + out_calls + '&lt;br/&gt;' + 'Incoming Texts: ' + inc_texts + '&lt;br/&gt;' + 'Outgoing Texts: ' + out_texts ; } });
tagged with: css
has title: Make hover text smaller using Tipsy in D3
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46181750
tagged with: tipsy
score: 1
upvote count: 1

http://stackoverflow.com/comment/46158385
has text: Do you know the exact algo? Because the current epoch time is 1425937474 and that doesn't start with a 5.
type: AnswerComment
comment on: http://stackoverflow.com/a/28952319
score: 0
type: Comment

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/29044996
tags question: http://stackoverflow.com/q/28996989
tags question: http://stackoverflow.com/q/29029190
tags question: http://stackoverflow.com/q/28911533
tags question: http://stackoverflow.com/q/29037287
tags question: http://stackoverflow.com/q/29058471
tags question: http://stackoverflow.com/q/29044227
tags question: http://stackoverflow.com/q/29055675
tags question: http://stackoverflow.com/q/28969586
tags question: http://stackoverflow.com/q/29027248
tags question: http://stackoverflow.com/q/29029704
tags question: http://stackoverflow.com/q/28942878
tags question: http://stackoverflow.com/q/28937598
tags question: http://stackoverflow.com/q/28926243
tags question: http://stackoverflow.com/q/29002275
tags question: http://stackoverflow.com/q/29002523
tags question: http://stackoverflow.com/q/28921317
tags question: http://stackoverflow.com/q/28976314
tags question: http://stackoverflow.com/q/29014888
tags question: http://stackoverflow.com/q/28969365
tags question: http://stackoverflow.com/q/29024624
tags question: http://stackoverflow.com/q/28985363
tags question: http://stackoverflow.com/q/29000129
tags question: http://stackoverflow.com/q/28972758
tags question: http://stackoverflow.com/q/28953088
tags question: http://stackoverflow.com/q/29010995
tags question: http://stackoverflow.com/q/28972371
tags question: http://stackoverflow.com/q/28929303
tags question: http://stackoverflow.com/q/28968987
tags question: http://stackoverflow.com/q/28986767
tags question: http://stackoverflow.com/q/28972247
tags question: http://stackoverflow.com/q/29019925
tags question: http://stackoverflow.com/q/29014626
tags question: http://stackoverflow.com/q/29036180
tags question: http://stackoverflow.com/q/28963734
tags question: http://stackoverflow.com/q/28994425
tags question: http://stackoverflow.com/q/29003057
tags question: http://stackoverflow.com/q/28921114
tags question: http://stackoverflow.com/q/29050720
tags question: http://stackoverflow.com/q/28976760
tags question: http://stackoverflow.com/q/29030572
tags question: http://stackoverflow.com/q/28990993
tags question: http://stackoverflow.com/q/29044688
tags question: http://stackoverflow.com/q/28980510
tags question: http://stackoverflow.com/q/28954728
tags question: http://stackoverflow.com/q/29035864
tags question: http://stackoverflow.com/q/29009529
tags question: http://stackoverflow.com/q/29032525
tags question: http://stackoverflow.com/q/28959175
tags question: http://stackoverflow.com/q/28976987
tags question: http://stackoverflow.com/q/28931294
tags question: http://stackoverflow.com/q/28959259
tags question: http://stackoverflow.com/q/29053894
tags question: http://stackoverflow.com/q/28956324
tags question: http://stackoverflow.com/q/28978312
tags question: http://stackoverflow.com/q/28998832
tags question: http://stackoverflow.com/q/29022848
tags question: http://stackoverflow.com/q/28955602
tags question: http://stackoverflow.com/q/29001885
tags question: http://stackoverflow.com/q/28934315
tags question: http://stackoverflow.com/q/28955490
tags question: http://stackoverflow.com/q/29011511
tags question: http://stackoverflow.com/q/29018963
tags question: http://stackoverflow.com/q/29009022
tags question: http://stackoverflow.com/q/28955993
tags question: http://stackoverflow.com/q/29049827
tags question: http://stackoverflow.com/q/28970541
tags question: http://stackoverflow.com/q/29011932
type: Tag
tags question: http://stackoverflow.com/q/29021197
tags question: http://stackoverflow.com/q/28918232
tags question: http://stackoverflow.com/q/29035509
tags question: http://stackoverflow.com/q/29017024
tags question: http://stackoverflow.com/q/28952481
tags question: http://stackoverflow.com/q/28926506
tags question: http://stackoverflow.com/q/29061488
tags question: http://stackoverflow.com/q/28997055
tags question: http://stackoverflow.com/q/29034918
tags question: http://stackoverflow.com/q/28909047
tags question: http://stackoverflow.com/q/28923124

http://stackoverflow.com/comment/46220577
type: AnswerComment
score: 0
type: Comment
has text: PS: i call this method in XHTML file and i use JSF
comment on: http://stackoverflow.com/a/28985903

http://stackoverflow.com/comment/46292662
comment on: http://stackoverflow.com/a/29002257
type: Comment
score: 1
has text: I added the function to the html head and it worked, but I've checked the file name and it matches. The files are in the same folder. Does it matter that the .html and .js files have the same name?
type: AnswerComment

http://stackoverflow.com/comment/46228615
has text: if the user changes the position of the mouse to the2 nd screen, the focus will be inactivated but he can continues reading in the 1 st screen, that means I get less accuracy. In these kind of issues i think we can not get a 100% exactitude, we have to use an error margin
score: 0
comment on: http://stackoverflow.com/a/28948365
type: Comment
type: AnswerComment

http://stackoverflow.com/q/29049073
accepted answer: http://stackoverflow.com/a/29050653
type: Question
type: AnsweredQuestion
score: 1
favorite count: 0
has title: Nodejs mssql and PreparedStatement, excute not getting called
upvote count: 1
answer count: 1
tagged with: node.js
has body: I have included the mssql module into our node configuration. The version of node is: 0.12.0, mssql is version 2.1.1 by Patrik Simek. I can connect to our database I have prepared a statement but execute never gets called. Before the code is executed, I know that a connection is estabilished to the database. //The client object contains the user name eg. "First Last" var aryNames = objClient['usr'].split(" "); if ( !(aryNames &amp;&amp; aryNames.length) ) { return; } var strSQL = "SELECT" + " MIN(EventID)" + ",MAX(EventID)" + ",MIN(EventTime)" + ",MAX(EventTime)" + ",FirstName" + ",Surname" + " FROM" + " [Net2].[sdk].[EventsEx]" + " WHERE" + " CAST(EventTime AS Date) BETWEEN @bow AND @eow" + " AND FirstName=@firstname" + " AND Surname=@surname" + " GROUP BY" + " CONVERT(VARCHAR(10), EventTime, 102)" + ",FirstName" + ",Surname", objParams = {bow : objClient['tk_bow'] ,eow : objClient['tk_eow'] ,firstname : aryNames[0] ,surname : aryNames[aryNames.length-1]}, ps = new mssql.PreparedStatement(); ps.input("bow", mssql.DateTime2); ps.input("eow", mssql.DateTime2); ps.input("firstname", mssql.VarChar); ps.input("surname", mssql.VarChar); ps.prepare(strSQL, function(err) { console.log("prepare"); if ( err ) { console.log(err); return; } ps.execute(objParams, function(err, recordset) { console.log("execute"); console.log(err); console.dir(recordset); ps.unprepare(function(err) { }); }); }); When this code is executed, the debug statement prepare is displayed, but I never see the execute statement. I've looked at numerous examples and I cannot see what I am doing wrong.
has answer: http://stackoverflow.com/a/29050653
downvote count: 0
tagged with: javascript
tagged with: sql-server

http://stackoverflow.com/q/28942224
has answer: http://stackoverflow.com/a/28943134
tagged with: javascript
tagged with: jquery
score: 0
has body: I am struggling to find offset top position from left. For example left 50px i want find top position based on left.
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: position
accepted answer: http://stackoverflow.com/a/28943134
tagged with: physics
type: AnsweredQuestion
has title: Rotated div offset top position from based on left position
type: Question

http://stackoverflow.com/comment/46262439
comment on: http://stackoverflow.com/q/29008351
type: QuestionComment
has text: do not change the input field.. generate different input fields for different purpose.. it will be easier to manage...
type: Comment
score: 1

http://stackoverflow.com/comment/46245336
comment on: http://stackoverflow.com/q/28998619
score: 0
type: Comment
type: QuestionComment
has text: `setInterval()` with an AJAX call inside of it may be the way to go for this, then you won't have to deal with Client vs. Server time. The Client time is usually dependent on their computer, which of course they can alter.

http://stackoverflow.com/a/28932123
has comment: http://stackoverflow.com/comment/46124902
has comment: http://stackoverflow.com/comment/46124933
type: Answer
answers question: http://stackoverflow.com/q/28931981
has body: You can't dynamically create a variable name. What you could do though is store them in arrays or objects. Objects can accept dynamic property names using [] notation. var danger =['green','red','blue','pink']; var dangerItem = []; for(var j = 0; j &lt; 4; j++){ dangerItem.push( "#" + danger[j]); } // returns ["#green", "#red", "#blue", "#pink"] /* or */ var dangerItem = {}; for(var j = 0; j &lt; 4; j++){ dangerItem[ danger[j] ] = "#" + danger[j]; } // returns {"green":"#green","red":"#red","blue":"#blue","pink":"#pink"}
has comment: http://stackoverflow.com/comment/46124815
score: 0

http://stackoverflow.com/comment/46185614
has text: Please don't propose the deferredPromise constructor antipattern.
score: 0
comment on: http://stackoverflow.com/a/28966875
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46106571
type: QuestionComment
has text: Note: ` ` has been deprecated and should no longer be used.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28925081

http://stackoverflow.com/q/28980175
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28980234
has title: How do I fix this SyntaxError: Unexpected identifier?
has comment: http://stackoverflow.com/comment/46210498
has comment: http://stackoverflow.com/comment/46210475
type: AnsweredQuestion
score: 1
has body: on.pitch = event.value+GetParameter('Starting Note'+' 'event.channel)+GetParameter('Number'+' 'event.channel)*12; And the error is: [JS Exception] SyntaxError: Unexpected identifier 'event'. Expected ')' to end a argument list. line:4 How do I resolve this issue?
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28980234
tagged with: javascript

http://stackoverflow.com/q/28958249
downvote count: 0
has comment: http://stackoverflow.com/comment/46169382
has body: I have following JavaScript array: [ { "day": 0, "best_hour_of_the_day": "10", "appt_success_rate": "60", "appt_100_numbers": "27" }, { "day": 2, "best_hour_of_the_day": "10", "appt_success_rate": "60", "appt_100_numbers": "27" }, { "day": 3, "best_hour_of_the_day": "10", "appt_success_rate": "60", "appt_100_numbers": "27" }, { "day": 4, "best_hour_of_the_day": "10", "appt_success_rate": "60", "appt_100_numbers": "27" }, { "day": 6, "best_hour_of_the_day": "--", "appt_success_rate": "0", "appt_100_numbers": "0" } ] And I have defined array with with representation of the days which i need in result. var daysOfTheWeek = [0,1,2,3,4,5,6]; I would like to ask, what is the good way how to add missing items to JavaScript array? It means add missing values 1 and 6 to get following JavaScript result: [ { "day": 0, "best_hour_of_the_day": "10", "appt_success_rate": "60", "appt_100_numbers": "27" }, { "day": 1, "best_hour_of_the_day": "--", "appt_success_rate": "0", "appt_100_numbers": "0" }, { "day": 2, "best_hour_of_the_day": "10", "appt_success_rate": "60", "appt_100_numbers": "27" }, { "day": 3, "best_hour_of_the_day": "10", "appt_success_rate": "60", "appt_100_numbers": "27" }, { "day": 4, "best_hour_of_the_day": "10", "appt_success_rate": "60", "appt_100_numbers": "27" }, { "day": 5, "best_hour_of_the_day": "10", "appt_success_rate": "60", "appt_100_numbers": "27" }, { "day": 6, "best_hour_of_the_day": "--", "appt_success_rate": "0", "appt_100_numbers": "0" } ]
has answer: http://stackoverflow.com/a/28980061
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46169230
possible better answer: http://stackoverflow.com/a/28980061
type: Question
answer count: 2
has title: How to Add missing items into JavaScript array?
tagged with: arrays
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28959139
accepted answer: http://stackoverflow.com/a/28959139
has comment: http://stackoverflow.com/comment/46170067
upvote count: 4
has comment: http://stackoverflow.com/comment/46169210
favorite count: 0
has comment: http://stackoverflow.com/comment/46169442

http://stackoverflow.com/q/29007024
type: AnsweredQuestion
score: 2
tagged with: jquery
tagged with: asp.net
favorite count: 0
accepted answer: http://stackoverflow.com/a/29007265
type: Question
has comment: http://stackoverflow.com/comment/46259831
has body: I've an textbox in asp.net,when i enter ";" semicolon in textbox means it have to call a function.Is there any way to do this.please help me out guys..i tried change function but it calls at every keypress in textbox. $('#prgrp').on('change', function (evt) { var txt = $("#prgrp").val(); var valueArray = txt.split(';'); var valueSortArray = valueArray.sort(); var duplicateValues = []; for (var i = 0; i &lt; valueSortArray.length; i++) { if (valueSortArray[i + 1] == valueSortArray[i]) { duplicateValues.push(valueSortArray[i]); } } if (duplicateValues.length &gt; 0) { $("#duplicate").html("Don't enter repeated values"); $('#duplicate').css('color', 'RED'); $("#prgrp").autocomplete("disable"); } else { $("#duplicate").html(""); $("#prgrp").autocomplete("enable"); } });
possible better answer: http://stackoverflow.com/a/29007169
upvote count: 3
answer count: 3
has comment: http://stackoverflow.com/comment/46259675
has answer: http://stackoverflow.com/a/29007169
downvote count: 1
has answer: http://stackoverflow.com/a/29007265
tagged with: javascript
has title: Call function based on input
has answer: http://stackoverflow.com/a/29007204
has comment: http://stackoverflow.com/comment/46270863

http://stackoverflow.com/q/28968384
answer count: 1
has body: EDITED: I have created an information display using jquery to show information. I want to have the top div open one page load. My current method is to change the name of the top box, and have it act differently. I am going to use php to populate the divs from a mysql table using a loop, and will not be able to use my current work around. Is there a smarter way of doing it? Here is the current script below in action: http://www.luke-sargeant.com/punchline/faq.html. Where will we meet? In Bristol, we always meet In front In front of the Sainsburys/Subway On Broadquay In Cardiff, the pick up point is at the front of the National Museum. How can I book the trips? You can book online using PAYPAL or speak with the activities coordinator of your school. They can help you to book a trip or get in touch How do I find out information about trips? Head to the trips page click the trip you want, and the information will be available. feel free to get in touch if you have any questions. What should I bring with me? Bring yourself along with the email address you booked the trip with. Be sure to bring a camera and your best smile. Warm clothing for cold days and light clothing for hot ones. Money for food, souvenirs and any extra attractions you may be interested in. What happens if I miss a trip? you must let us know 24 hours in advance to cancel a daytrip and 7 days before a weekend trip to consider a refund. sometimes we can find someone to take your place, if we can, your money will be refunded to you. If you cannot find the meeting point on the day of departure, or are going to be late contact us. if you provide a mobile telephone number when booking, we will call you if you are late and wait a reasonable time for you to arrive.
has answer: http://stackoverflow.com/a/28968738
accepted answer: http://stackoverflow.com/a/28968738
has title: Java single div open on pageload, collapses when other div header clicked. pop'd with PHP data
has comment: http://stackoverflow.com/comment/46189379
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46190209
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/q/29010023
tagged with: javascript
score: 0
has body: I have an JSON object coming from the database as one big object e.g: $scope.totalsum = { "A1": 1155000, "A2": null, "A3": 2133, "A31": 29292, "A32": 2321, "A33": 232342, etc.... }, I need to have the A31 & A32 etc to populate a collapsed table data row. Here is the ng-repeat for object so far: 0" ng-hide="isRowCollapsed"> 0"> I initially had the ng-repeat working for a JSON object like this: $scope.totalsum = [ { "total": 1155000, "breakdown": null }, { "total": 233235000, "breakdown": [ { "subtotal": 22002020 }, { "subtotal": 22002020 } ] },
tagged with: angularjs-ng-repeat
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29010262
type: Question
has title: How to map JSON object to collapsed rows in ng-repeat
answer count: 1

http://stackoverflow.com/a/28907612
type: Answer
accepted answer of: http://stackoverflow.com/q/28907440
answers question: http://stackoverflow.com/q/28907440
score: 0
type: AcceptedAnswer
has body: The problem is that you need to set $next to the first image when you reach the end. You can assume that if there is no $next elements, then it means that you need to start over from the beginning. For example like this: function slideSwitch() { var $active = $('div#slideshow .active'); var $next = $active.next(); if (!$next.length) { $next = $('div#slideshow &gt; :first'); } $next.addClass('active'); $active.removeClass('active'); } $(function () { setInterval(slideSwitch, 1000); }); Unrelated, but instead of setInterval("slideSwitch()", 5000); pass function reference like in example above. Demo: https://jsfiddle.net/na8zvhwh/2/

http://stackoverflow.com/comment/46330019
type: QuestionComment
comment on: http://stackoverflow.com/q/29045323
score: 0
has text: browser submits to `main.html` ,when you click `submit`
type: Comment

http://stackoverflow.com/q/29002435
has comment: http://stackoverflow.com/comment/46252445
has comment: http://stackoverflow.com/comment/46252625
has comment: http://stackoverflow.com/comment/46253314
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46252281
has body: I want to change my array structure this is my array Array ( [0] =&gt; Array ( [0] =&gt; 0.2 [1] =&gt; 0.10 ) [1] =&gt; Array ( [0] =&gt; 0.4 [1] =&gt; 0.21 ) [2] =&gt; Array ( [0] =&gt; 0.6 [1] =&gt; 0.45 ) [3] =&gt; Array ( [0] =&gt; 0.8 [1] =&gt; 0.75 ) ) I want to change this array in this form:- ([[0.2,0.10], [0.4,0.21],[0.6,0.45],[0.8, 0.75]])
has title: change array structure in javascript
has comment: http://stackoverflow.com/comment/46253329
has comment: http://stackoverflow.com/comment/46252132
has comment: http://stackoverflow.com/comment/46253339
has comment: http://stackoverflow.com/comment/46252267
type: Question
has comment: http://stackoverflow.com/comment/46252159
has comment: http://stackoverflow.com/comment/46252877
has comment: http://stackoverflow.com/comment/46252937
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/46253471
score: 0
has comment: http://stackoverflow.com/comment/46252252

http://stackoverflow.com/q/28923426
tagged with: arraybuffer
has body: Hi all I'm learning DataView and TypedArrays. I have an array of LONG's and USIGGNED_LONG's, I'll just paste the LONG one below. I've been trying to swap the array at bottom which is in ARGB to be RGBA. The first step I do is making it a Uint32Array but that after that I'm having trouble swapping bytes. Thanks var buffer = new ArrayBuffer(argb_16x16_LONG.length * 4); var view = new DataView(buffer); var argb_16x16_LONG = [ '16777215', '50331648', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '50331648', '16777215', '117440512', '-179727685', '-13794122', '-7501709', '-2579612', '-12091753', '-11689787', '-8663845', '-8729638', '-12612424', '-12360329', '-4941740', '-670645', '-342721', '-106524059', '117440512', '520093696', '-1924502', '-3243974', '-1669338', '-9017258', '-15895118', '-13397058', '-10042412', '-10042412', '-13991247', '-16164456', '-16298359', '-10130877', '-600557', '-137156', '520093696', '587202560', '-2000091', '-2199019', '-2199024', '-8563138', '-15965032', '-11755851', '-10108719', '-10042669', '-13596748', '-16164712', '-15902826', '-16233077', '-12693681', '-669681', '587202560', '587202560', '-2066396', '-2133221', '-2660335', '-3126519', '-2206455', '-5019855', '-10505018', '-11227448', '-13004873', '-13005900', '-10636341', '-11559489', '-16434316', '-4224992', '587202560', '654311424', '-2066654', '-2133221', '-2133221', '-1666476', '-1001601', '-7692655', '-10307379', '-11557437', '-10767926', '-10636854', '-12744270', '-11428673', '-14722936', '-3237322', '654311424', '654311424', '-2066655', '-2133221', '-2066657', '-2324167', '-10773841', '-10572087', '-10506038', '-10506038', '-10901050', '-15904626', '-15839603', '-14326887', '-11563857', '-1390041', '654311424', '687865856', '-2132705', '-2923495', '-3510485', '-4092338', '-11497296', '-10837309', '-10771004', '-10771004', '-10837053', '-13536862', '-16434563', '-1597530…
type: Question
score: 3
tagged with: javascript
has title: Swapping byte order with DataView and TypedArrays
upvote count: 3
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28923612
accepted answer: http://stackoverflow.com/a/28923612
tagged with: typed-arrays
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/a/29046675
type: Answer
answers question: http://stackoverflow.com/q/28977449
has body: Since you are anyways going to use JSON and jQuery, I would suggest that you should check out the getJSON method of jQuery. I feel that it would reduce some lines of code, though I am not sure if it would help it become more efficient. Anyways getJSON is just a shorthand of AJAX and I thought I should suggest this.
has comment: http://stackoverflow.com/comment/46370153
score: 0
has comment: http://stackoverflow.com/comment/46435631

http://stackoverflow.com/comment/46276608
has text: Is your json data well-formed? Try to call it directly from a browser address bar.
comment on: http://stackoverflow.com/q/29015723
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/46096303
has text: if you're seeing the server receiving the request, can you also say what you're using server side, and how you're generating the response? What does the network tab in your dev tools say when that request happens? Does it say you're suing GET when you wanted POST (or vice verse), does the request work but you never get an answer back (because maybe your server's forgetting to send a response end?) etc. etc
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28918760

http://stackoverflow.com/q/28948885
tagged with: javascript
upvote count: 2
answer count: 2
has title: What is the preferred method to create a javascript object with associated dom elements?
downvote count: 1
has comment: http://stackoverflow.com/comment/46152135
favorite count: 0
has answer: http://stackoverflow.com/a/28949129
has body: Currently I am doing it like this: function createPlayer(id) { var playerWrapper = document.createElement("div"); document.body.appendChild(playerWrapper); var player = document.createElement("div"); playerWrapper.appendChild(player); var Player = { wrapper: playerWrapper, player: player } } Just wondering if this is the best way or if there is some way I can create dom elements and the object at the same time? The object will also have methods attached. There will also be multiple instances of the object and associated elements.
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/387707
score: 1
tagged with: dom
has answer: http://stackoverflow.com/a/28949194
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/46152069

http://stackoverflow.com/q/29031556
has answer: http://stackoverflow.com/a/29032438
has comment: http://stackoverflow.com/comment/46304974
type: Question
has comment: http://stackoverflow.com/comment/46304780
tagged with: javascript
has comment: http://stackoverflow.com/comment/46304753
tagged with: extjs
score: 0
has comment: http://stackoverflow.com/comment/46304933
answer count: 1
has body: I have created an array with data, a store with this data and a grid. All these exist inside a callback ajax function (the array with the data is the response of a POST request). var ajaxurl = 'requests/requestKomvus.php', // script to run data = {datastr:datastr}; // data to pass $.post(ajaxurl, data, function (response) { var myData = [ ['Company1',71.72,0.02], ['Company2',29.01,0.42], ['Company3',83.81,0.28], ['Company4',52.55,0.01] ]; var store = new Ext.data.ArrayStore({ fields: [ {name: 'company'}, {name: 'price', type: 'float'}, {name: 'change', type: 'float'}, ] }); store.loadData(myData); var grid = Ext.create('Ext.grid.Panel', { store: store, columns: [ {id:'company',header: "Company", width: 160, sortable: true, dataIndex: 'company'}, {header: "Price", width: 75, sortable: true, dataIndex: 'price'}, {header: "Change", width: 75, sortable: true, dataIndex: 'change'}, ], stripeRows: true, height:940, width:500 });.... //end of ajax request What I want is to get the "grid" variable inside my items element: items: [{ xtype: 'panel', title: 'Images', items: [{contentEl:'img',autoScroll:true, height:940 }], },{ xtype: 'panel', title: 'Material', items: [{contentEl:'msg',autoScroll:true,height:940 }] }, { xtype: 'panel', title: 'Check', items: [grid], //// how to put it here? }] }],renderTo : Ext.getBody() Is there some straight forward way doing this using extjs? For example defining in my grid an Id and then get the variable with this id?
has comment: http://stackoverflow.com/comment/46304881
type: UnansweredQuestion
has title: How to select an Extjs grid by Id and display it on the panel
has comment: http://stackoverflow.com/comment/46304756
has comment: http://stackoverflow.com/comment/46304706

http://stackoverflow.com/q/28988529
upvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/46225488
has body: Right now I am trying to pass a Variable to a Javascript but its not showing the value that I pass.. This is my code: &lt;script&gt; function printPage(school_number) { var school_number; alert(school_number); } &lt;/script&gt; I am passing the value 0211 &lt;body onLoad="printPage(0211);"&gt; the alert is showing 155.. Why and where is the number getting changed?
has answer: http://stackoverflow.com/a/28988561
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28988561
has answer: http://stackoverflow.com/a/28988581
has comment: http://stackoverflow.com/comment/46225606
downvote count: 1
type: Question
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/28988581
answer count: 2
has title: Passing Variable into JavaScript

http://stackoverflow.com/comment/47242038
has text: I'm having the opposite problem. My module.run method to load a config file isn't running at all.
comment on: http://stackoverflow.com/q/29051277
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46182417
has text: @gecco are you getting confused with a **`value`** and **`id`** because both a different things. ID = identifier / Value = a value of something.
comment on: http://stackoverflow.com/q/28965111
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/54760274
comment on: http://stackoverflow.com/a/28922465
type: Comment
score: 2
has text: @Clever One solution that may work for simple cases is to do both the sync and async. Use the sync `setState` to update the value such that when the async is processed, the virtual DOM is already updated, therefore doesn't update the input field and so the cursor is never reset.
type: AnswerComment

http://stackoverflow.com/comment/46128173
comment on: http://stackoverflow.com/q/28936462
score: 1
has text: If you're using `$("#popup").load(...)` then the `#popup` element exists all along and so can have click handlers assigned to it. But the `#closeBox"` element won't exist until *after* the `.load()` and so can't have a click handler assigned until after the load is complete. Or use a delegated handler: `$("#popup").on("click", "#closeBox", function() { ... });`
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46163284
type: AnswerComment
comment on: http://stackoverflow.com/a/28954736
type: Comment
has text: Nope, it is a client-side tag and runs entirely in the browser. Just append it to the page. The docs pages in the link for require.js will explain how to do all of this. Accept if you think the answer is alright please :)
score: 1

http://stackoverflow.com/comment/46452247
comment on: http://stackoverflow.com/a/29037051
type: Comment
score: 1
type: AnswerComment
has text: If it's a problem with AngularJS Eclipse, please tell me what is the problem. What do you mean with " Does not display values correctly. Clear works. Alert etc don't.", completion, hover, validation doesn't work inside JS Editor or HTML Editor for Angular expression?

http://stackoverflow.com/comment/63579533
score: 3
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29042720
has text: I try "element.parentNode.parentNode.rowIndex" but it returns undefined

http://stackoverflow.com/comment/96623013
has text: Yeah, I didn't know either. I found out during this Selenium test case, and I'm trying to find a way around it. Tks anyways.
comment on: http://stackoverflow.com/a/37250674
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46406437
type: QuestionComment
comment on: http://stackoverflow.com/q/29022746
has text: when I execute the demo and see its moon texture it too has such boarder lines visible if you roll to view the backside of the moon ... maybe the lines are just part of the texture
score: 0
type: Comment

http://stackoverflow.com/a/29031295
score: 0
answers question: http://stackoverflow.com/q/29031003
has comment: http://stackoverflow.com/comment/46303605
type: Answer
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/46303688
has body: You may combine slice and splice methods: var fruits = ["Banana", "Orange", "Apple", "Mango", "App", "Man"]; fruits.splice(2,1); var x = fruits.slice(1,4); x; Explanation: splice deletes 1 element starting at index 2 ( ie. "Apple" ). slice extracts 3 elements starting at index 1 ( ie. "Orange", "Apple", "Mango", "App"; remember that at this time, the array no longer contains "Apple"). Variation (non-destructive): var fruits = ["Banana", "Orange", "Apple", "Mango", "App", "Man"]; var x = fruits.slice(1,2).concat(fruits.slice(3,5)); x;

http://stackoverflow.com/a/29061566
type: Answer
answers question: http://stackoverflow.com/q/29061504
score: 0
has body: var x = ""; is a primitive type String. var x = Object('abc'); is an Object String. Check the Type section for more : http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

http://stackoverflow.com/q/29058557
upvote count: 3
has body: I am trying to build a web scraper for Facebook using phantomjs. The connection fails due to SSL handshake failure. I get the same result for twitter, but google works fine. Does anyone know a solution for this? I am running phantomjs version 1.9.7. I have posted my code and my error output below. var system = require('system'); var page = require('webpage').create(); page.open('https://www.facebook.com', function(status){ console.log("status: " + status); if(status === "success"){ console.log("no error"); } else { console.log("Error opening url \"" + page.reason_url + "\": " + page.reason); } phantom.exit(); }); output: unable to load url: "https://www.facebook.com/" error code: 6, description: SSL handshake failed status: fail Error opening url "undefined": undefined
answer count: 1
has answer: http://stackoverflow.com/a/29058889
tagged with: phantomjs
linked to: http://stackoverflow.com/q/12021578
tagged with: ssl
tagged with: javascript
duplicate of: http://stackoverflow.com/q/12021578
type: AnsweredQuestion
score: 3
downvote count: 0
accepted answer: http://stackoverflow.com/a/29058889
favorite count: 0
type: Question
tagged with: facebook
has title: Phantomjs connection to Facebook fails SSL handshake

http://stackoverflow.com/comment/46157775
score: 0
comment on: http://stackoverflow.com/a/28951836
type: AnswerComment
type: Comment
has text: Do you think there would be an issue if the timeout was set to 14400000?

http://stackoverflow.com/a/28985934
has comment: http://stackoverflow.com/comment/46235318
answers question: http://stackoverflow.com/q/28985771
type: Answer
has comment: http://stackoverflow.com/comment/46220876
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46235430
has comment: http://stackoverflow.com/comment/46235091
has comment: http://stackoverflow.com/comment/46220992
has comment: http://stackoverflow.com/comment/46220968
has comment: http://stackoverflow.com/comment/46220959
type: AcceptedAnswer
downvote count: 0
has body: What is the real reason to use first method ? In fact neither of them does properly work. If have another class that inherits from Child, this.parent and this.constructor will not point to the expected function - and you'll either skip a level or get into infinite recursion. What problems I can get if I will use second method ? (new Child).constructor would be Parent, which is kinda unexpected. See Is there a good use case for the constructor property in Javascript?. And above problem of course still exists, regardless whether you use parent or constructor for the property name to refer to your parent class. For a proper "super" call reference the parent constructor explicitly: function Child() { Parent.apply(this,arguments); console.log('child constructor'); }
accepted answer of: http://stackoverflow.com/q/28985771

http://stackoverflow.com/a/28983599
score: 1
type: Answer
has body: try this way to bind select option
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28982837
has comment: http://stackoverflow.com/comment/46222309
answers question: http://stackoverflow.com/q/28982837
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46103927
type: QuestionComment
has text: this.innerHTML doesn't work ?
comment on: http://stackoverflow.com/q/28923573
score: 0
type: Comment

http://stackoverflow.com/comment/46319822
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29039609
has text: how do i do this? I tried putting in alert(event.target) in the function but this did not work.

http://stackoverflow.com/comment/46826338
comment on: http://stackoverflow.com/q/29051854
score: 0
type: Comment
type: QuestionComment
has text: Thank you! I was getting mixed up with passing into other methods

http://stackoverflow.com/comment/46074262
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28906829
has text: Can you provide the html code producing that error ?
score: 0

http://stackoverflow.com/q/28966678
accepted answer: http://stackoverflow.com/a/28968968
has answer: http://stackoverflow.com/a/74997358
possible better answer: http://stackoverflow.com/a/62106310
tagged with: css
score: 30
has answer: http://stackoverflow.com/a/62106310
type: AnsweredQuestion
has body: I'm struggling a little trying to determine the current location and size of an element within the DOM. I've put together a fragment to illustrate a card based system down the right hand side of the screen. The behavior that I'm trying to build is that when you click on one of those cards, another card will be added (ultimately underneath, but on top for now) which will fly out to the top left corner of the screen before filling the available space. d3.selectAll("attribute-card").on("click", function (d) { var rect = this.getBoundingClientRect(); var card = d3.select("body") .append("div") .attr("class", "card") .style("background", "transparent") .style("border", "thin solid red") .style("left", rect.left + "px") .style("top", rect.top + "px") .style("width", (rect.right - rect.left) + "px") .style("height", (rect.bottom - rect.top) + "px") .style("position", "absolute"); }); html { height: 100%; margin: 0; font-family: Arial; overflow: hidden; } body { height: 100%; } svg { background: #2c272b; width: 100%; height: 100%; } .radial-menu .segment { fill: #3b3944; } .radial-menu .segment:hover { fill: #535060; } .radial-menu .symbol { pointer-events: none; fill: white; } .radial-menu .symbol.icon { font-family: 'FontAwesome'; } .beam { stroke: #fff; } .planet circle { fill: #399745; stroke: #3b3944; stroke-width: 0; stroke-dasharray: 33,11; } .planet .related { fill: none; stroke: #3b3944; stroke-dasharray: none; stroke-width: 25px; } .planet text { fill: #000; opacity: 0.4; text-anchor: middle; pointer-events: none; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .planet .name { font-size: 2.5em; width: 94%; margin: 125px 0px 0px 10px; } .planet.selected text { fill: white; opacity: 1; } .planet.focused text { fill: white; opacity: 1; } .moon circle { fill: #3b3944; } .moon:hover { fill: #535060; } .moon text { fill: white; text-anchor: middle; pointer-events: none;…
has comment: http://stackoverflow.com/comment/46185892
has comment: http://stackoverflow.com/comment/46186010
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28968968
has comment: http://stackoverflow.com/comment/46185856
answer count: 3
downvote count: 0
has title: getBoundingClientRect returning wrong results
favorite count: 0
has comment: http://stackoverflow.com/comment/46185788
upvote count: 30
tagged with: d3.js
has comment: http://stackoverflow.com/comment/46185645
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28949028
upvote count: 1
tagged with: javascript
tagged with: countdown
has answer: http://stackoverflow.com/a/28951081
accepted answer: http://stackoverflow.com/a/28951081
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: reset
favorite count: 0
has comment: http://stackoverflow.com/comment/46152710
tagged with: timer
has comment: http://stackoverflow.com/comment/46152157
type: AnsweredQuestion
downvote count: 0
has body: Currently I have a script, which has a countdown for a specific date, but I want the countdown to be specific on a timer, so let's say if I start the timer and I have set the timer to run for 30 days, it will then run for 30 days and then reset back to 30 days again and start running. Is it possible to change it to do so? My code: &lt;body&gt; &lt;span id="countdown"&gt;&lt;/span&gt; &lt;script LANGUAGE="Javascript"&gt; // set the date we're counting down to var target_date = new Date("Apr 9, 2015").getTime(); // variables for time units var days, hours, minutes, seconds; // get tag element var countdown = document.getElementById("countdown"); // update the tag with id "countdown" every 1 second setInterval(function () { // find the amount of "seconds" between now and target var current_date = new Date().getTime(); var seconds_left = (target_date - current_date) / 1000; // do some time calculations days = parseInt(seconds_left / 86400); seconds_left = seconds_left % 86400; hours = parseInt(seconds_left / 3600); seconds_left = seconds_left % 3600; minutes = parseInt(seconds_left / 60); seconds = parseInt(seconds_left % 60); // format countdown string + set tag value countdown.innerHTML = days + "d, " + hours + "h, " + minutes + "m, " + seconds + "s"; }, 1000); &lt;/script&gt; &lt;/body&gt; EDIT: I have now changed the code to look like underneath, but now when I open the website in my browser its blank. New code: &lt;span id="countdown"&gt;&lt;/span&gt; &lt;script LANGUAGE="Javascript"&gt; // set the date we're counting down to var target_date = new Date("Apr 9, 2015").getTime(); // variables for time units var days, hours, minutes, seconds; // get tag element var countdown = document.getElementById("countdown"); if (seconds_left &lt;= 0){ target_date = target_date + 30 days; } // update the tag with id "countdown" every 1 second setInterval(function () { // find the amount of "seconds" between now and target var current_date = new Date().getTime(); var seconds_left …
score: 1
has comment: http://stackoverflow.com/comment/46152194
type: Question
has title: Countdown reset on specific time

http://stackoverflow.com/q/29011465
tagged with: javascript
has body: Hello i am creating a bootstrap addon for firefox i need to run a python script to handle some task,can any one tell me how to execute the python file packaged with in the addon,so far i tried to execute the system command using the code below but it doesn't work ... i already googled a lot for this but can't find suitable answer.In the below script i tried to execute the file that is already on the system but it still don't work. function startup(){ Components.utils.import("resource://gre/modules/FileUtils.jsm"); var env = Components.classes["@mozilla.org/process/environment;1"] .getService(Components.interfaces.nsIEnvironment); var shell = new FileUtils.File("/usr/bin/python"); var filename = '/tmp/test.py' var args = [file_name]; var process = Components.classes["@mozilla.org/process/util;1"] .createInstance(Components.interfaces.nsIProcess); process.init(shell); process.runAsync(args, args.length); } Thanks in advance.
favorite count: 0
upvote count: 1
answer count: 0
type: UnansweredQuestion
type: Question
score: 1
has title: How to run python files packaged with in firefox addon
tagged with: firefox
downvote count: 0

http://stackoverflow.com/comment/46325837
type: QuestionComment
has text: Well can you actually reach the URL when you open it up with curl or the browser? Even then, the browser security settings might still not allow you to make XHR requests to a remote URL unless the server responds with proper CORS headers.
score: 0
comment on: http://stackoverflow.com/q/29042863
type: Comment

http://stackoverflow.com/comment/46380800
type: AnswerComment
comment on: http://stackoverflow.com/a/29063109
score: 0
type: Comment
has text: so when the space bar is pressed, modal loads again! I don't want this to happen.

http://stackoverflow.com/comment/46132516
comment on: http://stackoverflow.com/q/28938128
type: Comment
type: QuestionComment
score: 0
has text: @NewDev - I saw an empty tag in my mark up so i've asked a question to make sure im following correct an best practices.. Empty markup tags usually raises the question of if its really needed... So i changed my directive an removed the transclude, this had no impact on the result or the result markup.. Hence why i am asking if i have written a directive correctly.

http://stackoverflow.com/comment/46167957
type: QuestionComment
comment on: http://stackoverflow.com/q/28957517
type: Comment
has text: is there any difference between single and double quotes?
score: 0

http://stackoverflow.com/q/28916710
has title: What do double brackets mean in javascript and how to access them
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46091361
score: 81
has answer: http://stackoverflow.com/a/49103813
has answer: http://stackoverflow.com/a/56846980
linked to: http://stackoverflow.com/q/22519784
has answer: http://stackoverflow.com/a/28916952
has comment: http://stackoverflow.com/comment/46091865
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/41409150
has comment: http://stackoverflow.com/comment/46091290
has answer: http://stackoverflow.com/a/48067847
has comment: http://stackoverflow.com/comment/46125121
has comment: http://stackoverflow.com/comment/46091471
has body: Situation I have the following function which uses Promise. var getDefinitions = function() { return new Promise(function(resolve) { resolve(ContactManager.request("definition:entities")); }); } var definitions = getDefinitions() The contents of definitions is: Promise { PromiseStatus: "resolved", PromiseValue: child } Accessing the PromiseValue property directly returns undefined var value = definitions.PromiseValue; // undefined Question What do the double brackets [[ ]] mean, and how do I retrieve the value of PromiseValue.
tagged with: es6-promise
has comment: http://stackoverflow.com/comment/46091334
tagged with: javascript
has comment: http://stackoverflow.com/comment/46091460
has comment: http://stackoverflow.com/comment/46091245
has comment: http://stackoverflow.com/comment/46091968
has comment: http://stackoverflow.com/comment/46091208
has comment: http://stackoverflow.com/comment/46126487
has comment: http://stackoverflow.com/comment/46091240
has comment: http://stackoverflow.com/comment/46091257
has comment: http://stackoverflow.com/comment/46091408
has comment: http://stackoverflow.com/comment/46091449
has comment: http://stackoverflow.com/comment/46091329
answer count: 7
upvote count: 82
linked to: http://stackoverflow.com/q/14220321
has answer: http://stackoverflow.com/a/28917161
favorite count: 0
has comment: http://stackoverflow.com/comment/46091262
linked to: http://stackoverflow.com/q/33075262
tagged with: promise
has comment: http://stackoverflow.com/comment/46091538
has answer: http://stackoverflow.com/a/55818717

recursion
type: Tag
tags question: http://stackoverflow.com/q/28933700
tags question: http://stackoverflow.com/q/29023932
tags question: http://stackoverflow.com/q/29013969
tags question: http://stackoverflow.com/q/29052075
tag name: recursion
tags question: http://stackoverflow.com/q/28915336
tags question: http://stackoverflow.com/q/28965966
tags question: http://stackoverflow.com/q/28988074
tags question: http://stackoverflow.com/q/29019376
tags question: http://stackoverflow.com/q/28925230
tags question: http://stackoverflow.com/q/29014644
tags question: http://stackoverflow.com/q/29020722
tags question: http://stackoverflow.com/q/28949409
tags question: http://stackoverflow.com/q/29059012
tags question: http://stackoverflow.com/q/29023436
tags question: http://stackoverflow.com/q/28933161

document.write
tags question: http://stackoverflow.com/q/28922568
tag name: document.write
type: Tag

http://stackoverflow.com/comment/46176568
type: Comment
type: QuestionComment
has text: http://en.wikipedia.org/wiki/AtScript
score: 1
comment on: http://stackoverflow.com/q/28960934

http://stackoverflow.com/comment/46233791
comment on: http://stackoverflow.com/q/28992302
has text: As per your suggestion, I removed p and a tag, but it still showing the same error. And if it is then why the hardcoded value is working fine but not with this rowCount variable.... If I write dynamicRow[1].id instead of dynamicRow['+rowCount+'], then it works fine
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46260031
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29006570
has text: Thank you for answering. Would giving the elements in this project id's simplify the code? I haven't worked with id's all that much yet and while I did consider and test the option, I didn't understand it well enough to implement just yet. (By that I mean initial attempts didn't run so I went looking for an alternative.) So an SSI is a file that only contains the meta tags for browsers. Do you think it'll be worthwhile to make an SSI for this project then save it for future projects or can it only be used to use for one at a time?
type: AnswerComment

http://stackoverflow.com/q/28952429
has title: Pass a url parameter into multiple distinct a href links via javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46158630
has answer: http://stackoverflow.com/a/28952574
has body: Admittedly, javascript is not my strong suit. I need to be able to append a parameter from the url into three a href links using javascript. The structure of the url will be www.mysite.com?parameter. Currently, the links are: https://www.acme.com/sui?bc=QOS-B20 https://www.acme.com/sui?bc=USE-BFN https://www.acme.com/sui?bc=USP-BFN The resulting links should be: https://www.acme.com/sui?bc=QOS-B20&amp;sc=parameter https://www.acme.com/sui?bc=USE-BFN&amp;sc=parameter https://www.acme.com/sui?bc=USP-BFN&amp;sc=parameter I already have jquery loaded on the page. I tried to follow the directions on this post: Passing an URL parameter to a href link using Javascript but it didn't work. Thanks!
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
linked to: http://stackoverflow.com/q/9508425
tagged with: url
type: Question

http://stackoverflow.com/comment/46170385
comment on: http://stackoverflow.com/a/28958897
type: Comment
has text: I actually see whats in the div 'getData' since it's on the same page. But it seems it's not recognizing it as a int/number. How can I inspect it? I used the $('#getData').html() but still the same result.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28967171
type: Answer
has comment: http://stackoverflow.com/comment/46188977
has comment: http://stackoverflow.com/comment/46189680
has comment: http://stackoverflow.com/comment/46188645
score: 2
has comment: http://stackoverflow.com/comment/46188201
downvote count: 0
has comment: http://stackoverflow.com/comment/46189616
answers question: http://stackoverflow.com/q/28965798
has comment: http://stackoverflow.com/comment/46187884
has body: jQuery load function is fine and works perfectly, you should looking for this problem in either your JavaScript codes or at your server side, which creates HTML pages. So some guidelines would be as follows Put a consol.log(...) before that jQuery load function and make sure the loading URL is exatcly what you want. Open that URL in a new tab in your browser and check whether its HTML codes/contents is okay or not. Also note that if dynamically loaded HTML codes have CSS stylesheets, you should preload them first. As a side note, I really wonder why do you use pure JavaScript to creating/attaching elements when Super Powerful jQuery is present. for (i = 0; i &lt; pages.length; i++) { $('&lt;div&gt;&lt;/div&gt;') .attr('id', "dynamicdiv-" + i) .css({'position': 'absolute', 'left', left + 'px', 'color', '#0000bb'}) .appendTo(e); $('#' + eid).load(pages[i]); }
has comment: http://stackoverflow.com/comment/46191094
upvote count: 2
has comment: http://stackoverflow.com/comment/46187336

http://stackoverflow.com/comment/46232717
has text: If you are comfortable with Python, and web GUIs, you could try Django. Here is a project already started you could get ideas from: https://github.com/maxolasersquad/orthosie
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28991993
score: 1

http://stackoverflow.com/comment/46075748
has text: It's exactly as I've put it above, which is a function as far as I can tell.
comment on: http://stackoverflow.com/a/28907147
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46108260
type: AnswerComment
has text: I didn't see the fiddle, that's in my updated code. I'm struggling to see the part in my code that changes it though.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28914945

http://stackoverflow.com/q/28954727
has body: I have this structure into my html. Name Age Address Option here is the name here is the age here is the address update here is the name2 here is the age2 here is the address2 update2 as you can see from the above structure, the display will be this. table header = Name, Age, Address, Option. table body = here is the name, here is the age, here is the address, button update table body = here is the name2, here is the age2, here is the address2, button update2 now what Im trying to do is when I click the update button, i must able get the content of the address td to name td at the single same row and each must be stored in a specified variable e.g. ($name, $age, $address). assume i have mutiple row, I must able to retrieve only the content of address td to name td of the same row. To be more precise, as the structure above, I must able to get the 'here is the name', 'here is the age', 'here is the address' and put each in a specified variable e.g. ($name, $age, $address) when I click the u"update" button and not the "update2" button. so far what I tried is. $('.update').click(function(){ $address = $(this).prev('td').content(); alert ($dateposted); }); but seems not returning anything. Any help would be greatly appreciated. Thank you!
upvote count: 1
possible better answer: http://stackoverflow.com/a/28954731
has answer: http://stackoverflow.com/a/28954731
type: AnsweredQuestion
score: 1
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28954875
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46163129
has title: get the content of the prev element jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28954875

http://stackoverflow.com/a/28975260
answers question: http://stackoverflow.com/q/28974905
score: 0
type: Answer
has body: If you want to find the index/indices within an array where a subarray appears, you could use a mixture of a map and filter, but you'd also need an array equality checking function. Let's presume we have Array.prototype.equals, per this SO answer, courtesy of @TomášZato, then we can do: haystackArray.map(function(e, i) { return e.equals(needleArray) ? i : false; }) .filter(function(e) { return e !== false; }); This will return an array of matching indicies (or an empty array, if the needleArray wasn't found). // Array equality function by Tomáš Zato // attach the .equals method to Array's prototype to call it on any array Array.prototype.equals = function (array) { // if the other array is a falsy value, return if (!array) return false; // compare lengths - can save a lot of time if (this.length != array.length) return false; for (var i = 0, l=this.length; i &lt; l; i++) { // Check if we have nested arrays if (this[i] instanceof Array &amp;&amp; array[i] instanceof Array) { // recurse into the nested arrays if (!this[i].equals(array[i])) return false; } else if (this[i] != array[i]) { // Warning - two different object instances will never be equal: {x:20} != {x:20} return false; } } return true; }; var subarrayIndexOf = function(haystack, needle) { return haystack.map(function(e, i) { return e.equals(needle) ? i : false; }) .filter(function(e) { return e !== false; }); }; var haystack = [ [1,2], [3,4], [5,6], [3,4] ], needle = [3,4]; alert('subarray found at indices: ' + subarrayIndexOf(haystack, needle).toString());

http://stackoverflow.com/comment/46331018
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29038610
has text: There was no reason to bind in the example you showed.
score: 1

http://stackoverflow.com/comment/46096277
type: Comment
comment on: http://stackoverflow.com/a/28919225
score: 0
type: AnswerComment
has text: @qmnew In that case, you will need to know the root folder to prepend it to the `file` variable. If the page is at the root directory, you could use `/`. See updated answer.

odata
tag name: odata
tags question: http://stackoverflow.com/q/29027887
type: Tag
tags question: http://stackoverflow.com/q/28943164
tags question: http://stackoverflow.com/q/28949629
tags question: http://stackoverflow.com/q/28995757

http://stackoverflow.com/comment/46122853
has text: Alright made those changes but the text still isn't showing as green.
comment on: http://stackoverflow.com/a/28933475
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28975512
score: 0
type: Answer
has body: A non elegant solution would be to declare your function at the global scope : window.arrow=function(x){ for (i = 1; i &lt;5; i++) { if (i==x) { document.getElementById("submenu"+i).style.display = "block"; } else { document.getElementById("submenu"+i).style.display = "none"; } } }
answers question: http://stackoverflow.com/q/28975030

http://stackoverflow.com/comment/46345615
comment on: http://stackoverflow.com/a/29053267
score: 0
type: AnswerComment
has text: why doesn't it feel right. If you `obj.x++` which is 6 the object is also updated in the map because that is the same object? what's not to get, or what is it your trying to accomplish?
type: Comment

http://stackoverflow.com/comment/46242184
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28996128
score: 0
has text: affect which way ? you trying to do almost the same doing `fn.apply(this,`

http://stackoverflow.com/comment/46309910
has text: You're probably missing a `}` or `});` somewhere (maybe both). Use proper indentation and you'll find the problem fast.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29017057
type: AnswerComment

http://stackoverflow.com/comment/46301722
type: AnswerComment
has text: I tried this code, but it always gives 'Term has not been found' .. not sure the reason yet.. (I've given existing term name correctly)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29029833

http://stackoverflow.com/a/28981237
has body: Place your HTML code, as follows: &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;&lt;/div&gt; inside your Echo. &lt;?php echo ' HERE &lt;div class="modal-dialog"&gt; UPDATED: &lt;div id="prerequisites-container" class="container-fluid"&gt; &lt;a href="#" data-toggle="modal" data-target="#trymodalbootstrap" role="button" data-toggle="modal" class="btn btn-default"&gt;Launch Modal&lt;/a&gt; &lt;/div&gt; &lt;?php echo '&lt;div class="modal fade" id="trymodalbootstrap" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;&lt;/div&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt; &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt; &lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Modal title&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt;...&lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt;'; ?&gt;
downvote count: 0
has comment: http://stackoverflow.com/comment/46212594
has comment: http://stackoverflow.com/comment/46212801
accepted answer of: http://stackoverflow.com/q/28980961
upvote count: 2
answers question: http://stackoverflow.com/q/28980961
has comment: http://stackoverflow.com/comment/46212252
has comment: http://stackoverflow.com/comment/46212709
type: AcceptedAnswer
type: Answer
score: 2

ones-complement
tag name: ones-complement
type: Tag
tags question: http://stackoverflow.com/q/29042840

http://stackoverflow.com/comment/46274973
has text: @T.J.Crowder It clicked on the `div` when the if is commented out of the code, but when I actually implement it, it won't work... for example: The `div` was linking to certain content, but there are more div's with the `classname: .event_list`, But i wan't the script to only click on the `event_list without the span type sold`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29014731

http://stackoverflow.com/comment/46204791
type: QuestionComment
has text: Why do you use full url (`http://localhost:3000/orders...`) instead of relative (`/orders...`)? If your html page is not loaded from the same origin (localhost:3000), then you may want to read about [same-origin policy](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy)
comment on: http://stackoverflow.com/q/28976760
score: 0
type: Comment

http://stackoverflow.com/comment/46093993
type: QuestionComment
has text: @PushkerYadav What do you mean?
comment on: http://stackoverflow.com/q/28918031
score: 0
type: Comment

http://stackoverflow.com/q/28911523
score: 1
has title: javascript merge array elements that are the same
tagged with: arrays
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28911652
answer count: 3
possible better answer: http://stackoverflow.com/a/28911660
has answer: http://stackoverflow.com/a/28911660
has body: I have this array: I was wondering how can I remove the duplicate arrays elements regardless of the position of the elements inside the array example array1 = [[0, 1], [1, 0], [2, 3], [3, 2], [4, 5], [5, 4]]; //the [0,1],[1,0] will be counted as the same element, so as the others.. //to array1 = [[0, 1], [2, 3], [4, 5]] thanks in advance sorry i have this so far newArrayVal = []; arr1= [[0, 1], [1, 0], [2, 3], [3, 2], [4, 5], [5, 4]]; for(i=0; i&lt;arr1.length; i++){ newArrayVal[i] = arr1[i].sort(); } console.log(newArrayVal); //thanks frenchie I think i am near to the solution, i just need to filter this now, hehe thanks
has comment: http://stackoverflow.com/comment/46081783
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/46081892
downvote count: 1
accepted answer: http://stackoverflow.com/a/28911652
has comment: http://stackoverflow.com/comment/46082259
has answer: http://stackoverflow.com/a/28912017
type: Question

http://stackoverflow.com/a/28964945
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46181744
type: Answer
has body: I found the error myself: else{ jQuery('#pricealarm-fakeSubmit')after('[{ oxmultilang ident="ERROR_MESSAGE_INPUT_NOTALLFIELDS" }]'); } was missing a . before after else{ jQuery('#pricealarm-fakeSubmit').after('[{ oxmultilang ident="ERROR_MESSAGE_INPUT_NOTALLFIELDS" }]'); }
score: 1
accepted answer of: http://stackoverflow.com/q/28964602
upvote count: 1
answers question: http://stackoverflow.com/q/28964602

http://stackoverflow.com/comment/46073963
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28907220
has text: Post your code in your question please.

http://stackoverflow.com/q/29032700
has answer: http://stackoverflow.com/a/29032803
possible better answer: http://stackoverflow.com/a/29032998
has answer: http://stackoverflow.com/a/29032998
accepted answer: http://stackoverflow.com/a/29033015
upvote count: 1
has body: I have a dynamic string value "radio_3_*". Like: 1 - radio_3_5 2 - radio_3_8 3 - radio_3_78 4 - radio_3_157 5 - radio_3_475 How can I pick the radio_3 part.
downvote count: 7
score: -6
tagged with: javascript
has comment: http://stackoverflow.com/comment/46306328
has title: Javascript SUBSTR
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29033015
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/46306333
type: Question
has answer: http://stackoverflow.com/a/29032816
has comment: http://stackoverflow.com/comment/46306280

http://stackoverflow.com/q/28994864
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: dictionary
tagged with: popup
score: 1
has title: How to open popup in jquery in this case?
type: Question
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has body: I tried to open a popup in a page and it worked very well, but now I am trying to open it in an "info" window of Google map marker and it doesn't work anymore. Here's my code: In head : var chaine = markers[i].getAttribute("address"); var reg=new RegExp("[ ,]+", "g"); var mot= chaine.split(reg); // add each marker's location to the bounds bounds.extend(point); var html = " Dernier statut : " + name + " Cliquez-ici pour voir le profil de "+ mot[1] +" Clavarder "; In body : test I think the problem is with the "" in var html :
favorite count: 0

http://stackoverflow.com/q/28997027
downvote count: 0
answer count: 0
has body: After a Firefox crash, the browser's restore functionality seems to be causing an incorrect AngularJS binding. EDIT: I am updating the title to reflect what may be closer to the actual problem. I just discovered the Session Store in Firefox. After I kill the browser in Step 4 below, I can open recovery.js from my Firefox profile and see the details of Case A. I have confirmed that this is where the data is coming from in Step 6 by changing a value in the .js file directly before reopening Firefox. I've written a web application with AngularJS that allows my users to manage their legal case load. I have a very strange bug in Firefox (currently using 36.0.1) that I can reproduce consistently. Summary: A user saves one case and moves to work on another, when their browser or computer crashes. When they reopen Firefox, the details for their previous case have now been associated with the latest one. Upon closer inspection, I can see that the correct case details are shown for a split second when the browser reloads, but then replaced with the incorrect details. Walkthrough: The user opens Case A, edits some data, and saves. The URL is https://url/cases/A $scope.case is set to Case A from a web service call, updated, and posted to the web service The user clicks back to their list of pending cases The URL is https://url/cases $scope.case = {} The user opens Case B, may or may not edit data, but does not save The URL is https://url/cases/B $scope.case is set to Case B from a web service call The browser crashes (reproduced by killing the task) The user reopens the browser and Case B is reloaded The URL is https://url/cases/B $scope.case is set to Case B but no web service call has taken place After a fraction of a second, the fields switch to display Case A The URL is still https://url/cases/B $scope.case is set to Case A but no web service call has taken place If the user saves the page, Case B is overwritten with Case A's information The URL is still https://url/cases/B…
tagged with: javascript
type: UnansweredQuestion
type: Question
score: 1
favorite count: 0
tagged with: angularjs
has title: Firefox Session Restore causes bug in javascript
upvote count: 1
tagged with: firefox

http://stackoverflow.com/comment/46106261
has text: alright thanks for the help, but this "rejects" a date if its not in 2014, so how do I make it so it will accept any date as long as it isn't in the future? sorry if im asking too many questions
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28924639
score: 0

http://stackoverflow.com/comment/46199684
has text: @Plentybinary will give innerText a go thanks.
comment on: http://stackoverflow.com/q/28973946
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/46338504
has text: I am using the wsyihtml5 editor. http://xing.github.io/wysihtml5/
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29047130
score: 0

http://stackoverflow.com/comment/46141190
type: QuestionComment
has text: ... There's no JavaScript function `getContextPath()`, and after you submit, doing a reload is pointless--you're no longer on the same page. Right now you're relying on pure luck/timing.
score: 1
comment on: http://stackoverflow.com/q/28938183
type: Comment

jsbin
tags question: http://stackoverflow.com/q/28930333
type: Tag
tag name: jsbin

http://stackoverflow.com/q/28958230
has answer: http://stackoverflow.com/a/28980107
score: 0
has title: Show border of an object on mouseover(Fabricjs)
tagged with: javascript
tagged with: fabricjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/67215675
has body: I'm trying to show borders of an object on the mouseover. i tried to use 'mouse:over' event of fabric and manually selected the object. canvas.on('mouse:over', function(opts){ var selectedObj = opts.target; canvas.setActiveObject(opts.target); }); But there is one problem with this approach. I select one object and then try to do some operation by clicking some buttons(outside canvas). On the way of clicking button, if there is some object then that objects get selected. So any other way to show borders of an object on its mouseover?
type: Question
answer count: 2

http://stackoverflow.com/q/28920619
has body: I am trying to make a simple Javascript and Jquery game in which a user controls a blue ball and has to avoid red balls. I attempted to make a collision detection system that would get rid of the red balls when one was touched. This works however it occasionally detects a collision when there isn't one and I cannot figure out why. I made a jsfiddle of the game. By the way, I commented out the function which makes the red balls move so that it would be easier to test the collisions. Thanks https://jsfiddle.net/clayjames/bxcffwty/4/ Here is the javascript for the game so far: var keyDown = function() { $(document).keydown(function(e) { switch(e.which) { case 37 : $("#blue").css("marginLeft","-=40"); blue.xcordinate = blue.xcordinate - 40; check(); break; case 38 : $("#blue").css("marginTop","-=40"); blue.ycordinate = blue.ycordinate - 40; check(); break; case 39 : $("#blue").css("marginLeft","+=40"); blue.xcordinate = blue.xcordinate + 40; check(); break; case 40 : $("#blue").css("marginTop","+=40"); blue.ycordinate = blue.ycordinate + 40; check(); break; }; }); }; var redX = [0]; var redY = [0]; var loop = 0; var createRed = function() { var randTop = Math.floor(1+Math.random()*600); var randLeft = Math.floor(1+Math.random()*1308); $("body").append($("&lt;div&gt;&lt;/div&gt;").addClass("red").css("marginTop",randTop).css("marginLeft",randLeft)); redX[loop] = randLeft; redY[loop] = randTop; loop++; } var redMovement = function(){ var redDirection = Math.floor(1 + Math.random() * 4); switch(redDirection) { case 1 : $(".red").animate({"marginLeft": "-=20"}); break; case 2 : $(".red").animate({"marginLeft": "+=20"}); break; case 3 : $(".red").animate({"marginTop": "-=20"}); break; case 4 : $(".red").animate({"marginTop": "+=20"}); }; }; var blue = { xcordinate: 630, ycordinate: 320 } var xMatch = false; var yMatch = false; var check = function() { for(x = 0; x &lt; redX.length; x++){ if(((redX[x] - 25) &lt;= blue.xcordinate + 25 &amp;&amp; blue.xcordinate + 25 &lt;= (red…
has answer: http://stackoverflow.com/a/28920961
score: 2
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
upvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/28920993
has answer: http://stackoverflow.com/a/28921044
favorite count: 0
has title: collision detection on game
type: UnansweredQuestion

http://stackoverflow.com/comment/46187407
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28967841
has text: so loop through the object and use split()

http://stackoverflow.com/comment/46122648
score: 1
type: Comment
type: QuestionComment
has text: You have a... *peculiar* coding style...
comment on: http://stackoverflow.com/q/28933442

http://stackoverflow.com/comment/46241904
has text: Ok, so for every new request I get, I store the time in session cookie, and then add a timeout in javascript using the time set in the cookie to show the message after the timeout? Since I am using persistent sessions, maybe @dlkulp suggestion of using localstorage will be better than using cookies?
type: QuestionComment
comment on: http://stackoverflow.com/q/28996268
score: 0
type: Comment

windows
tags question: http://stackoverflow.com/q/28949074
tags question: http://stackoverflow.com/q/28923092
tags question: http://stackoverflow.com/q/28943893
type: Tag
tag name: windows

http://stackoverflow.com/q/28986128
downvote count: 3
type: Question
tagged with: c#
has title: Form Creation - ASP.NET vs Angular.JS?
score: -2
tagged with: .net
tagged with: javascript
has comment: http://stackoverflow.com/comment/46221509
upvote count: 1
answer count: 1
linked to: http://stackoverflow.com/q/26445342
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/46221952
tagged with: angularjs
type: UnansweredQuestion
has body: Good morning, I am developing a kind of internal form to the staff of a blog submit certain information that will later be posted . The application is developed in ASP.NET using some Controls in Javascript . The problem that arises is that I have a rented server on Linux and ASP.NET works only on Windows Server ( except in Mono) , but wanted something more functional on Linux, told me in Angular.JS . It will be the best option ? Here is attached an example of a form to the test. Thanks Alex Ferreira
has answer: http://stackoverflow.com/a/28986522

http://stackoverflow.com/a/28912102
has comment: http://stackoverflow.com/comment/46083256
score: 0
has body: The blur you are seeing is anti-aliasing, there is really no way to get rid of it entirely but there are a couple of things you can try to reduce it: Try to offset your lines by 0.5px so they don't fall exactly on a pixel boundary. You can either do a translation by 0.5 0.5, or add the offset to your path (i.e. start at 107.5). Sometimes this can help. Set your stroke width to to 1.5 instead of 1 In your css, set shape-rendering: crispEdges; This tells the browser not to do any anti-aliasing at all. Works great for horizontal and vertical lines, but will probably make diagonal lines look horrible.
answers question: http://stackoverflow.com/q/28912047
type: Answer

http://stackoverflow.com/comment/46187163
has text: this would end up in an endless recursion.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28949746
type: Comment

http://stackoverflow.com/comment/46223220
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28977136
has text: check this code, https://github.com/Mido22/tmp1, for me, it works on both `firefox` and `chrome` in linux env...
score: 0

http://stackoverflow.com/q/28945923
has title: Load code without using a button
tagged with: javascript
has body: I am trying to change this code so that it no longer needs a button to tell me which browser I am using. I want it to pop up when the page loads instead of being on a button. If someone can show me the changes needed that would be great. I tried changing to btn.onload and adding body onload="btn" but this does not work. Current code (WITH BUTTON): &lt;script type='text/javascript'&gt;//&lt;![CDATA[ window.onload = function() { var btn = document.getElementById('btn'); btn.onclick = function() { var isChrome = /Chrome/.test(navigator.userAgent) &amp;&amp; /Google Inc/.test(navigator.vendor); var isSafari = /Safari/.test(navigator.userAgent) &amp;&amp; /Apple Computer/.test(navigator.vendor); if (isChrome) alert("You are using Chrome!"); if (isSafari) alert("You are using Safari!"); }; }//]]&gt; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="button" style="cursor:pointer;" id="btn" name="btn" value="Detect browser!"/&gt; &lt;/body&gt;
possible better answer: http://stackoverflow.com/a/28946007
score: 0
has comment: http://stackoverflow.com/comment/46145977
answer count: 3
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28946240
has answer: http://stackoverflow.com/a/28946007
tagged with: onload
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28946060
has answer: http://stackoverflow.com/a/28946240
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/46146018
type: Question

http://stackoverflow.com/q/29019440
has body: I am quite new to Backbone and I'm experiencing the following problem. define([ 'jquery', 'underscore', 'backbone', 'vm' ], function($, _, Backbone, Vm){ 'use strict'; var AppRouter = Backbone.Router.extend({ register: function(route, name, path) { this.route(route, name, function(){ var args = arguments; require([path], function(module) { var options = null, parameters = route.match(/[:\*]\w+/g); if (parameters) { options = {}; _.each(parameters, function(name, idx) { options[name.substring(1)] = args[idx]; }); } var view = Vm.create(name, module, path); view.render(); }); }); } }); var initialize = function(){ var appRouter = new AppRouter(); appRouter.register('detail', 'detailView', 'views/detail/DetailView'); appRouter.register('', 'HomeView', 'views/home/HomeView'); Backbone.history.start({pushstate:true}); }; return { initialize: initialize }; }); Above there's my router, so the problem is that when I visit directly the url localhost/detail the route detail is not matched, instead the empty route is matched. If I manually add a an # (localhost/#detail) to the url it works the correct route is matched. Could someone point me in the right direction, so that I will be able to load directly an url that is different from '/'
has title: Backbone router : url visited directly no route match
has answer: http://stackoverflow.com/a/29021004
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: backbone.js
type: UnansweredQuestion
tagged with: backbone-routing

http://stackoverflow.com/comment/46283064
has text: oh my mistake hehehe :P I was reading the css code while I was posting the question :)
comment on: http://stackoverflow.com/q/29019301
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46452443
score: 0
comment on: http://stackoverflow.com/q/29020026
has text: [this link](https://msdn.microsoft.com/en-us/library/hh977020%28v=vs.110%29.aspx) shows the way to send multiple callback from the server, [redirect the stdout](http://stackoverflow.com/questions/6024172/is-it-possible-to-intercept-console-output) and then send response. I can not recommend you to use SignalR because my company had a lot of problems with this technology(exceptions, disconnection and etc...) till we decided to remove it. [this stream service](http://www.codemag.com/Article/1210051) look interesting
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29034850
answers question: http://stackoverflow.com/q/29032084
type: Answer
has comment: http://stackoverflow.com/comment/46380541
has comment: http://stackoverflow.com/comment/46381375
has comment: http://stackoverflow.com/comment/46382307
has comment: http://stackoverflow.com/comment/46382038
has comment: http://stackoverflow.com/comment/46381013
score: 5
has comment: http://stackoverflow.com/comment/46382623
has body: Better solution is to have a if-condition for the repeat ng-if="$index%5" Update: Added - for filling rest of the columns if its less than 5 Plunkr Demo var app = angular.module('app', []); app.controller('MainCtrl', function($scope) { $scope.basicInfoCustomFields = [ {"name":"Anto"}, {"name":"Julie"}, {"name":"John"}, {"name":"Doe"}, {"name":"Ray"}, {"name":"Sassy"}, {"name":"Wright"}, {"name":"Fred"}, {"name":"Flintstone"}, {"name":"Price"}, {"name":"Dave"}, {"name":"Neo"}, {"name":"Jack"}, {"name":"Lee"}, {"name":"Eoin"}, {"name":"Victor"}, {"name":"Rita"} ]; }); /* Put your css in here */ .row-orange { background: orange; margin-bottom: 10px;} .row-orange td {border-bottom: 1px solid #fff;}
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/46380829
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29032084

http://stackoverflow.com/q/28977283
score: -1
has title: loop over an array of page url's in angularjs
tagged with: angularjs
type: UnansweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/28978377
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/46206458
answer count: 1
tagged with: javascript
has body: I am new to AngularJs, I am trying to build an app which has 10 pages and a user goes from one page to another while swiping to left.I just want to know how to write the logic in angularjs. For example, if a user is on the third page, if he swipes left he goes to 4th page and if he swipes right he goes to 2nd page.Can anyone please help? Thank You! I have set up all routes, controllers and views for all the pages. Here's my swipe.js file $(document).ready(function(){ var myElement = document.getElementById('first'); var hammer = new Hammer.Manager(myElement); var swipe = new Hammer.Swipe(); hammer.add(swipe); hammer.on('swipeleft', function(){ window.location = '#/exhibits'; }); hammer.on('swiperight', function(){ window.location = '#/pavilion'; }); }); Since a swipe event should be on a body according to me, i put the "id='first'" on the body element. This works perfectly fine but how should i navigate through multiple pages.A snippet of my app.js file: var myApp = angular.module('myApp', ['ngRoute', 'mm.foundation']); myApp.config(['$compileProvider', function($compileProvider){ $compileProvider.aHrefSanitizationWhitelist(/^s*(https?|file|ms- appx):/); }]); myApp.config(['$routeProvider', function($routeProvider){ $routeProvider. when('/', { title : 'WELCOME', templateUrl: 'pages/homepage/home.html', controller: 'HomeController' }). when('/pavilion', { title : "AT A GLANCE : PAVILION OVERVIEW ", templateUrl: 'pages/pavilion/pavilion.html', controller: 'PavilionController' }). when('/exhibits', { title : 'AT A GLANCE : EXHIBITS OVERVIEW', templateUrl: 'pages/exhibits/exhibits.html', controller: 'ExhibitsController'
favorite count: 0

http://stackoverflow.com/a/28948034
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46162494
downvote count: 0
has comment: http://stackoverflow.com/comment/46155218
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28942661
has body: Alright, a few things are going on here: Suggestions AngularFire was updated to 1.1.1 and $firebase is now deprecated. Use $firebaseObject and $firebaseArray instead. There is no need to do all that stuff in your Projects service and return a promise. $firebaseObject and $firebaseArray return promises. Example Check out this PLNKR I made showing a working version of what you're trying to accomplish. It's tied to one of my public Firebase instances. You can create a new piece of data and see it on the home page. JavaScript: (function(angular) { angular.module('project', ['firebase', 'ngRoute']) .value('fbURL', 'https://sb-plnkr.firebaseio.com/so:28942661') .service('fbRef', function(fbURL) { return new Firebase(fbURL) }) .service('fbAuth', function($q, $firebaseAuth, fbRef) { var auth; return function () { if (auth) return $q.when(auth); var authObj = $firebaseAuth(fbRef); if (authObj.$getAuth()) { return $q.when(auth = authObj.$getAuth()); } var deferred = $q.defer(); authObj.$authAnonymously().then(function(authData) { auth = authData; deferred.resolve(authData); }); return deferred.promise; } }) .service('Projects', function($q, $firebaseArray, fbRef) { this.sync = $firebaseArray(fbRef); this.sync.$loaded().then(function(data) { var projects = data; }); return this.sync; }) .controller('ListCtrl', function($scope, $location, Projects) { Projects.$loaded().then(function(data){ $scope.projects = data; }); }) .controller('CreateCtrl', function($scope, $location, Projects) { console.log("CreateCtrl"); $scope.save = function() { console.debug("Adding"); if ($scope.project && $scope.project.content !== '') { Projects.$add($scope.project).then(function(ref) { console.log("Added ref",ref); $location.path('/'); }).catch(function(errorObject){ console.error(errorObject); }); } else { alert("You have to enter something."); } }; }) .controller('EditCtrl',function($scope, $location, $routeParams, Projects) { var projectId = $routeParams.projectId, projectIndex; $scope.init = f…
accepted answer of: http://stackoverflow.com/q/28942661
has comment: http://stackoverflow.com/comment/46162590
has comment: http://stackoverflow.com/comment/46162069
has comment: http://stackoverflow.com/comment/46162380

http://stackoverflow.com/comment/46112661
score: 0
type: AnswerComment
has text: @DavidThomas The left side 2 chinese charater with (US) is by script...on the right side is by clicking mouse makes it appear (US 9). Centre picture is when i try to click the left picture, it already show me US 9 was selected. but just not shown as the picture on the right
type: Comment
comment on: http://stackoverflow.com/a/28927202

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

http://stackoverflow.com/a/29042689
answers question: http://stackoverflow.com/q/29042067
type: Answer
has body: JavaScript $(document).ready(function() { $("#signin-btn").click(function(){ $("#new-account-tab").removeClass("active"); $("#signin-tab,#signin-pane").addClass("active"); }); $("#join-btn").click(function(){ $("#new-account-tab,#signup-pane").addClass("active"); $("#signin-tab").removeClass("active"); }); });
score: 2
upvote count: 2
downvote count: 0

http://stackoverflow.com/comment/46099362
has text: Why wouldn't that work too good for you?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28921000

http://stackoverflow.com/comment/46144854
type: Comment
type: QuestionComment
has text: ` ` – that is total nonsense and miles away from valid syntax. You need to go learn some basics.
score: 4
comment on: http://stackoverflow.com/q/28945384

http://stackoverflow.com/q/29017024
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46325220
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29084967
has comment: http://stackoverflow.com/comment/46319619
has body: I have some issue about my Phonegap App! When I test inside my browser all works Well ! But when I compile to apk... In my phone doesn't find the JSON... I'm new in programming , sorry about my bad english too... What Can I do ? var number = Math.floor(Math.random() * 23); $.ajax({ type: 'GET', url: "/../pages/desafio/desafiando.json", dataType: 'json', contentType: 'application/json', crossDomain: true, cache:false, success: function(data) { $.each(data, function(i, desafio) { item = "&lt;center&gt;&lt;h4&gt;" + desafio.meta + "&lt;/h4&gt;&lt;/center&gt;"; if (desafio.id == number) { $('#blocodesafio').append(item); } }); }, error:function(jqXHR, textStatus, errorThrown){ alert('Erro ao carregar'); console.log(errorThrown); } I'm thinking " /../pages/desafio/desafiando.json " this is the problem but I don't know what I have to put to work inside phonegap...
upvote count: 1
tagged with: android
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29084967
has comment: http://stackoverflow.com/comment/59337704
tagged with: cordova
tagged with: phonegap-build
has title: Json inside App Phonegap ! What is the Path?
has comment: http://stackoverflow.com/comment/46285713
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46278530

http://stackoverflow.com/comment/46237633
has text: There are easier ways to do validations like this, but I DO encourage you to write code the way you are most comfortable with, and then over time your code will become more compact and cleaner, follow your inner FLOW, if you listen to others you will never come up with some new and original piece of code. Although if you plan to work for a large company then you need to follow conventions.
score: 1
comment on: http://stackoverflow.com/q/28992764
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46290971
type: AnswerComment
type: Comment
has text: Maybe calling the divs buybtn2 and buybtn in a jquery cause that?
score: 0
comment on: http://stackoverflow.com/a/29024021

http://stackoverflow.com/comment/46088856
type: QuestionComment
comment on: http://stackoverflow.com/q/28915336
score: 1
has text: Please show the code you are using.
type: Comment

http://stackoverflow.com/a/28908473
answers question: http://stackoverflow.com/q/28908435
score: 3
accepted answer of: http://stackoverflow.com/q/28908435
has body: maybe you need to group strings because | has low precedence /string one(.*?)(?:string two|\.|string three|string four)/gi Edit: adding parentheses changes precedence because the expression in parentheses is evaluated before the rest of the expression. In addition, here we use non-capturing groups because we use the (?: syntax.
has comment: http://stackoverflow.com/comment/46076441
upvote count: 3
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/46077742
downvote count: 0

http://stackoverflow.com/comment/46361016
type: AnswerComment
type: Comment
has text: Okay globally I could run this command something like `intern-client config=tests/intern`, but how can I run this command locally in window7? If I do something like `./node_modules/.bin/intern-client config=tests/intern` then the error message shows `.` is not internal or external command.
score: 1
comment on: http://stackoverflow.com/a/28927339

http://stackoverflow.com/comment/46157959
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28951428
has text: It looks like you'll need to include some extra code to get datatables playing nicely with knockout. There's an [example here](http://datatables.net/dev/knockout/)

http://stackoverflow.com/comment/46082363
score: 1
comment on: http://stackoverflow.com/q/28911825
has text: What do you intend for `parseFloat (smallest) = 0` to do?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46246939
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28995643
has text: Hmm.. Yeah I can see that.. Do you have a recommendation of how to handle that?

http://stackoverflow.com/comment/46348767
type: Comment
has text: Blobs on their own are not file-like as seen from remote URLs, you would need to use FormData to convert them first. Blobs themselves also provide no URL, though you can make one from a Blob with FileReader or URL.createObjectURL, and you can get them from ajax via xhr.responseType='blob', so while your answer hints around different potential aspects of blobs, it doesn't provide a lot of info to go on.
comment on: http://stackoverflow.com/a/29055617
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46166909
has text: This is not JavaScript. It is ERb that generates JavaScript, so you need to preprocess it. If you serve it as-is, it will not be able to be interpreted. Where is this line (which file, which directory), and how are you rendering it?
score: 1
comment on: http://stackoverflow.com/q/28956940
type: Comment
type: QuestionComment

angularjs
tags question: http://stackoverflow.com/q/28933846
tags question: http://stackoverflow.com/q/29001552
tags question: http://stackoverflow.com/q/29029062
tags question: http://stackoverflow.com/q/28938154
tags question: http://stackoverflow.com/q/29001029
tags question: http://stackoverflow.com/q/29016011
tags question: http://stackoverflow.com/q/28981896
tags question: http://stackoverflow.com/q/28916985
tags question: http://stackoverflow.com/q/28938293
tags question: http://stackoverflow.com/q/28958875
tags question: http://stackoverflow.com/q/29008744
tags question: http://stackoverflow.com/q/28997230
tags question: http://stackoverflow.com/q/28975737
tags question: http://stackoverflow.com/q/28958540
tags question: http://stackoverflow.com/q/29020120
tags question: http://stackoverflow.com/q/28934936
tags question: http://stackoverflow.com/q/29049421
tags question: http://stackoverflow.com/q/28948384
tags question: http://stackoverflow.com/q/29007948
tags question: http://stackoverflow.com/q/29009719
tags question: http://stackoverflow.com/q/28941354
tags question: http://stackoverflow.com/q/29010054
tags question: http://stackoverflow.com/q/28913564
tags question: http://stackoverflow.com/q/28955560
tags question: http://stackoverflow.com/q/28968922
tags question: http://stackoverflow.com/q/28931074
tags question: http://stackoverflow.com/q/29056152
tags question: http://stackoverflow.com/q/28952860
tags question: http://stackoverflow.com/q/28958362
tags question: http://stackoverflow.com/q/28953932
tags question: http://stackoverflow.com/q/29049991
tags question: http://stackoverflow.com/q/28978815
tags question: http://stackoverflow.com/q/28921186
tags question: http://stackoverflow.com/q/29062201
tags question: http://stackoverflow.com/q/29029390
tags question: http://stackoverflow.com/q/28942576
tags question: http://stackoverflow.com/q/29018725
tags question: http://stackoverflow.com/q/29023785
tags question: http://stackoverflow.com/q/28973321
tags question: http://stackoverflow.com/q/28971945
tags question: http://stackoverflow.com/q/29061380
tags question: http://stackoverflow.com/q/28915927
tags question: http://stackoverflow.com/q/28941027
tags question: http://stackoverflow.com/q/28989077
tags question: http://stackoverflow.com/q/28925379
tags question: http://stackoverflow.com/q/29033406
tags question: http://stackoverflow.com/q/29026535
tags question: http://stackoverflow.com/q/28929081
tags question: http://stackoverflow.com/q/28908690
tags question: http://stackoverflow.com/q/28982337
tags question: http://stackoverflow.com/q/28963673
tags question: http://stackoverflow.com/q/28965579
tags question: http://stackoverflow.com/q/28908463
tags question: http://stackoverflow.com/q/29034234
tags question: http://stackoverflow.com/q/28953645
tags question: http://stackoverflow.com/q/28971451
type: Tag
tags question: http://stackoverflow.com/q/29018227
tags question: http://stackoverflow.com/q/28987646
tags question: http://stackoverflow.com/q/28991226
tags question: http://stackoverflow.com/q/28944273
tags question: http://stackoverflow.com/q/28950938
tags question: http://stackoverflow.com/q/28924312
tags question: http://stackoverflow.com/q/29012982
tags question: http://stackoverflow.com/q/28961350
tags question: http://stackoverflow.com/q/29044002
tags question: http://stackoverflow.com/q/28957643
tags question: http://stackoverflow.com/q/28980310
tags question: http://stackoverflow.com/q/29003765
tags question: http://stackoverflow.com/q/28947106
tags question: http://stackoverflow.com/q/29008204
tags question: http://stackoverflow.com/q/28994751
tags question: http://stackoverflow.com/q/28923924
tags question: http://stackoverflow.com/q/29032005
tags question: http://stackoverflow.com/q/28948511
tags question: http://stackoverflow.com/q/29005509
tags question: http://stackoverflow.com/q/28935808
tags question: http://stackoverflow.com/q/29051476
tags question: http://stackoverflow.com/q/29001528
tags question: http://stackoverflow.com/q/28914081

http://stackoverflow.com/a/28980894
accepted answer of: http://stackoverflow.com/q/28980479
answers question: http://stackoverflow.com/q/28980479
type: AcceptedAnswer
upvote count: 1
has body: there are no spaces elemenated in your code, you see empty spans, &lt;span class="cls_4 textHighLight userNote1"&gt; &lt;/span&gt; this is where the spaces are added in some cases, either remove them and go with DemoUser's answer Or just add them, where they are not added. See this Fiddle
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/28971604
score: 1
tagged with: visual-studio-2012
accepted answer: http://stackoverflow.com/a/28981824
tagged with: asp.net
favorite count: 0
tagged with: backbone.js
has body: Im trying to set up Backbone.js within Visual Studio the guide from the link down below is telling me that I need to install BackBoneSpa.vsix but since its a Visual Studio file extension I need to install ASP.net Web Tools 2012. Is this the only way of adding backbone.js to your visualstudio C# project? http://www.asp.net/single-page-application/overview/templates/backbonejs-template
type: AnsweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28981824
type: Question
tagged with: c#
has title: Backbone.js Visual Studio set up
downvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/28997396
has comment: http://stackoverflow.com/comment/46243573
has comment: http://stackoverflow.com/comment/46243475
has comment: http://stackoverflow.com/comment/46243080
has comment: http://stackoverflow.com/comment/46243502
has comment: http://stackoverflow.com/comment/46243540
has title: How to make a switch button post to the db when clicked
type: UnansweredQuestion
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/46243686
tagged with: php
has comment: http://stackoverflow.com/comment/46243838
has answer: http://stackoverflow.com/a/28997997
has comment: http://stackoverflow.com/comment/46243458
has comment: http://stackoverflow.com/comment/46243309
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I am trying to figure out how to make a toggle switch button post to the db when it is pressed, so that it can update the info: yes or no. Like a submit button. This is in the view of my codeigniter app. toggle switch html code Complete: Yes NO <input type="hidden" class="default"value="<?php echo $e->Complete;?>"> controller <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Callin extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('callin_model'); } //Shows the dashboard public function index() { if($this->session->userdata('logged_admin')) { $this->load->view('templates/admin_header'); $this->load->view('insert_callins_view'); }else{ redirect('admin_authentication/admin_login_show'); } } //Insert the callin public function insert_callin() { if($this->session->userdata('logged_admin')) { $data=array('Date_Scheduled'=>$this->input->post('Date_Scheduled'), 'Employee_Name'=>$this->input->post('Employee_Name'), 'Employee_Number'=>$this->input->post('Employee_Number'), 'Time_Reported'=>$this->input->post('Time_Reported'), 'Reason'=>$this->input->post('Reason'), 'Scheduled_Area'=>$this->input->post('Scheduled_Area'), 'Contact'=>$this->input->post('Contact'), 'Approval'=>$this->input->post('Approval'), 'Complete'=>$this->input->post('Complete'), 'status'=>1); //print_r($data); $result=$this->callin_model->insert_callin($data); if($result > 0) { $this->session->set_flashdata('msg',"Callin Record Added Successfully"); redirect('callin'); } else { $this->session->set_flashdata('msg1',"Callin Record Added Failed"); redirect('callin'); } }else{ redirect('admin_authentication/admin_login_show'); } } //List of callins public function list_callins() { if($this->session->userdata('logged_admin')) { $data['callin'] =$this->callin_model->get_callin(); $this->load->view('templates/admin_header'); $this->load->view('admin_callins_view',$data); }else{ redirect('admin_authentication/admin_login_show'); } } //List of …
score: 0

http://stackoverflow.com/comment/46191192
type: AnswerComment
has text: use `strokeColor` instead of `fillColor`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28955134

http://stackoverflow.com/comment/46344498
score: 0
type: QuestionComment
type: Comment
has text: Check out ideas #1 and #2 on this other answer: http://stackoverflow.com/questions/28907351/timed-out-waiting-for-protractor-to-synchronize-with-the-page-after-50001ms/28969956#28969956
comment on: http://stackoverflow.com/q/29011360

http://stackoverflow.com/q/28996428
answer count: 2
has answer: http://stackoverflow.com/a/28996627
has comment: http://stackoverflow.com/comment/46241401
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1490563
has answer: http://stackoverflow.com/a/28996582
has title: Switch HTML content of div with another piece of HTML without fading out to white first using jQuery
score: 0
type: Question
has body: I'm looking for a way to fade from one piece of HTML in a div to another piece of HTML without fading out to white (to the background color of the div) first like i'm doing in this example: The positionNumber variable is just an int with the number (e.g. 3). function changeContent(positionNumber) { $('.banner-content-wrapper').fadeOut('fast', function() { var contentHtml = $('.slidercontent#' + positionNumber).html(); $('.banner-content-wrapper').hide().fadeIn(1000).html(contentHtml); }); } This example does the exact same by fading to white first but this is not what I'm lookig for: Why doesn&#39;t jquery fadeIn() work with .html()? I want to fade directly from one piece of HTML to another. I haven't been able to find any example on Stack Overflow that shows how to do exact that. I know this is not valid code but it's something like this I'm looking for: $('.banner-content-wrapper').fadeToHtml(contentHtml); How can I fade directly?
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28949020
has body: Console log show me the active user, but I cannot use it in view, I am using plain html. app.post('/', function (req, res) { var user = { user : req.body.username }; res.render('doctor_hagfish/pets', { locals:{ user:user }}); console.log(user) }); I don't know what i am doing wrong, suggestions? Until now i tried these syntaxes in view #{user} {{user}} My Template Engine Settings app.engine('html', require('ejs').renderFile); app.set('view engine', 'html'); So i used ejs tags &lt;% user %&gt; and then nothing is displayed, so it means that template engine recognise it as defined var but still it is not displayed. The problem was wrong syntax for ejs template engine locals answer : &lt;%= user %&gt;
score: 0
has comment: http://stackoverflow.com/comment/46152298
tagged with: javascript
has answer: http://stackoverflow.com/a/28949283
tagged with: express
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28949671
tagged with: templates
has answer: http://stackoverflow.com/a/28949671
has comment: http://stackoverflow.com/comment/46152968
type: Question
accepted answer: http://stackoverflow.com/a/28949283
has title: Expressjs passing locals with route.render
answer count: 2
tagged with: node.js

http://stackoverflow.com/a/29023974
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29015044
has body: Within your $('#addrow').click(function() {});, I would add this: $('.edit').off(); $('.edit').fn1(); $('.edit').fn2(); With fn1 and fn2 being whatever functions are bound to the edit class already (i.e. .editable and .on) That rebinds the function to the selected elements, but first removes the binding so elements don't get double (or triple, etc.) bindings.
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46291299
accepted answer of: http://stackoverflow.com/q/29015044

http://stackoverflow.com/q/28948275
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28952195
type: Question
has comment: http://stackoverflow.com/comment/46151123
tagged with: javascript
has title: ng-bind-html html with css does not work
accepted answer: http://stackoverflow.com/a/28952195
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 1
favorite count: 0
has body: Where word[key] is item 1 item 2 item 3 CSS: ul {padding: 1px 10px 1px 20px;list-style-type: upper-roman;} I have a much more complex structure with css. The CSS works on cordova and react but since i am porting function to ng, the css do not work. Please Advise or point what i am missing here.
tagged with: angularjs
upvote count: 2
tagged with: css
score: 2

http://stackoverflow.com/a/29039810
has comment: http://stackoverflow.com/comment/46320859
downvote count: 0
answers question: http://stackoverflow.com/q/29039760
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/46321288
upvote count: 1
has comment: http://stackoverflow.com/comment/46320621
has body: You are leaving the page immediately after running the JS that triggers the POST request. This causes the POST request to be cancelled. You need to wait until you get a response to the POST request before setting location to a new value.

http://stackoverflow.com/comment/46221287
score: 0
type: Comment
type: QuestionComment
has text: why dont you check timestamp while loading the page..accordingly set variable and use condition on it `var d = new Date(); var n = d.getHours(); `
comment on: http://stackoverflow.com/q/28986280

http://stackoverflow.com/a/29017867
upvote count: 1
has comment: http://stackoverflow.com/comment/46280647
has body: it seems like you not terminating the function with semi column. use something like onkeyup="CountChars();"
answers question: http://stackoverflow.com/q/29017358
has comment: http://stackoverflow.com/comment/46280432
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46281599
type: Answer

http://stackoverflow.com/q/29018505
has comment: http://stackoverflow.com/comment/46308979
type: Question
has answer: http://stackoverflow.com/a/29035151
answer count: 2
accepted answer: http://stackoverflow.com/a/29035151
has comment: http://stackoverflow.com/comment/46314515
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46309619
has body: I have an application that generates a PDF on the fly (accessed via service/generatePdf). It returns a HTTP response with content-type="application/pdf" and the outputStream set to the binary contents. Per business specs, when the user clicks a button we need to open a new window/tab that displays that PDF. Submitting the form below, that all works beautifully on the Happy Path, where the response is an actual PDF. &lt;form action="service/generatePdf" method="post" name="PdfForm" target="_blank"&gt; However, what does not work so well is when the PDF can't be generated for whatever reason. For example, let's say that the HTTP response outputStream is empty. What I want to be able to do is display a nice error message on the first page, and not open the new window/tab. But there doesn't seem to be any way to do it. Your choices seem to be Return a valid PDF, or Live with how the browser's PDF plugin handles corrupt files I've tried jQuery, Ajax, the jQuery Form Plugin, the jQuery Download plugin plugin, and nothing seems to work.
linked to: http://stackoverflow.com/q/2805330
has comment: http://stackoverflow.com/comment/46311758
upvote count: 2
tagged with: http://stackoverflow.com/tag/pdf
possible better answer: http://stackoverflow.com/a/29034760
favorite count: 0
has answer: http://stackoverflow.com/a/29034760
has comment: http://stackoverflow.com/comment/46310640
tagged with: rest
has title: Gracefully Handle REST Server Error
score: 2
linked to: http://stackoverflow.com/q/20035615
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/28991147
score: 1
tagged with: sapui5
has answer: http://stackoverflow.com/a/32213575
upvote count: 1
type: Question
has title: Setting constraints to sap.m.DatePicker
has answer: http://stackoverflow.com/a/32206391
tagged with: javascript
has body: How do I get my DatePicker to implement my minimum and maximum date constraint? If an unallowed date is chosen, I preferably do not even want it to trigger a change event, or at least revert the date to one that is allowed. I use 2-way binding, so if I change the date, the date in my model also changes. var oData = { "minimumConstraint" : "2010-01-01", "maximumConstraint" : "2020-01-01", "displayDate" : "2015-01-01" }; var oModel = new sap.ui.model.json.JSONModel(oData); sap.ui.getCore().setModel(oModel); var oDatePicker = new sap.m.DatePicker({ displayFormat: "dd-MM-yyyy", valueFormat: "yyyy-MM-dd", value: {path: "displayDate"} }); I also tried some variations of implementing sap.ui.model.type.Date(oFormatOptions?, oConstraints?), but it does not work: var oDatePicker = new sap.m.DatePicker({ displayFormat: "dd-MM-yyyy", valueFormat: "yyyy-MM-dd", value: {path: "displayDate", type: new sap.ui.model.type.Date({ constraints: { minimum: { path: "minimumConstraint"}, maximum: { path: "maximumConstraint"} } }) } });
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/46234264
type: UnansweredQuestion
tagged with: datepicker

http://stackoverflow.com/comment/46212684
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28981526
score: 0
has text: Perhaps create a bootply.com and share it here.

http://stackoverflow.com/q/29018682
linked to: http://stackoverflow.com/q/12376173
linked to: http://stackoverflow.com/q/21392110
answer count: 2
possible better answer: http://stackoverflow.com/a/29018869
has answer: http://stackoverflow.com/a/40182994
accepted answer: http://stackoverflow.com/a/40182994
tagged with: submit
downvote count: 0
favorite count: 0
tagged with: timer
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29018869
score: 1
has title: Auto-submit the prompt() pop up based on a timer
upvote count: 1
linked to: http://stackoverflow.com/q/4515944
type: Question
tagged with: prompt
has body: Ok, I may have found enough information that I should be able to put this together myself, but I just can't. I'm trying (because reasons) to get string input from users by calling something like this: var myVar = prompt("Some question?"); I want the prompt popup to automatically submit after, say, 30 seconds. Then I want the script to keep running. I want to use prompt because it's easy. Is there a way to auto submit that based on a timer? I feel like the key might be somewhere in these two links: http://www.w3schools.com/js/js_timing.asp Click a button every second Do I need to use a popup, not a prompt? Javascript popups: Submit form, show "wait" screen for 5 seconds, then auto-close popup Or do I need to use a form? Auto-Submit Form using JavaScript Thanks in advance for the help. New user here, and I don't think this question has been answered before.
tagged with: javascript

http://stackoverflow.com/q/28923769
has body: I have been working on a simple form submission. First, I wanted to create a modal alert before form submission. So, i used bootstrap's modal function, and repeatedly got TypeError: $(...).modal is not a function After searching around the net for a lot of time, I added jQuery.noConflict(); and code worked out. Then, I wanted to validate my form before invoking the modal. So, i am using the jQuery validation plugin to do the same. Then, I am getting this error: TypeError: $(...).validate is not a function* Can someone kindly help me out as to what exactly is the problem I am facing. All my jquery files seem to be in order. <!jquery> <!jquery form validation plugin> <! Bootstraplinks> <!Alert Plugin links> $(document).ready(function(){ jQuery.noConflict(); $("#addtype").validate(); $("#button_submit").click(function(){ if($("#addtype").valid()){ $('#myModal').modal('show'); } }); $("#button_proceed").click(function(){ $('#addtype').submit(); }); });
score: 1
has comment: http://stackoverflow.com/comment/46188347
upvote count: 1
type: Question
has title: jquery TypeError: $(...).validate and TypeError: $(...).modal is not a function
tagged with: javascript
has answer: http://stackoverflow.com/a/30926870
tagged with: jquery
has comment: http://stackoverflow.com/comment/46188409
tagged with: validation
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/46104707
favorite count: 0
has comment: http://stackoverflow.com/comment/46104405
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46108500

http://stackoverflow.com/q/28981409
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28983705
has comment: http://stackoverflow.com/comment/46212563
has comment: http://stackoverflow.com/comment/46212505
type: Question
has title: How to make text rotating scroll with jquery library.(needed example)
has comment: http://stackoverflow.com/comment/46212901
has comment: http://stackoverflow.com/comment/46212499
has answer: http://stackoverflow.com/a/28981478
answer count: 2
has body: $('.marquee').marquee({ pauseOnHover: true }); I dont know how to make text rotating scroll with jquery library. I dont know what jquery must i use. the text rotating scroll i'll use in html and css. im stuck on marquee.
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46213145
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/46213830
score: 0

http://stackoverflow.com/q/29055456
tagged with: blockly
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: eval
favorite count: 0
has answer: http://stackoverflow.com/a/36866153
type: UnansweredQuestion
upvote count: 1
has body: I'm attempting to use Blockly to do a "make your own game" sort of thing, and for the most part it works. However, when trying to run code generated (by Blockly's own pre-defined function generators) by declaring a function and calling it, I consistently get told that the function isn't defined, no matter what it is or what it contains. I'm grabbing and running the code like so: var code = Blockly.JavaScript.workspaceToCode(); try{ eval(code); } catch (e){ alert(e); } Which is how the demos provide on Blockly generate code. I've also echoed the code out elsewhere in the page and it looks right to me: function whatINameIt() { //code I give it } //rest of code Is this something to do with how eval works? The only thing I can think of is that for some reason it's "evaluating" the function code but not adding it as something callable. If that's the case, is there an alternate way I should run the code string Blockly gives me?
has title: Blockly - Reference Error: functions not defined
score: 1

http://stackoverflow.com/comment/46263358
comment on: http://stackoverflow.com/a/29008864
has text: So right after my console.log(messageCount) is the correct place for those two?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28908269
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28908180
type: Answer
has comment: http://stackoverflow.com/comment/46204373
score: 9
has body: Well, here is a simple implementation for chaining functions by queuing them. First of all, the function: function waterfall(arr, cb){} // takes an array and a callback on completion Now, we need to keep track of the array and iterate it: function waterfall(arr, cb){ var fns = arr.slice(); // make a copy } Let's start with handling passed and empty array, by adding an extra parameter so we can pass results around called result: function waterfall(arr, cb, result){ // result is the initial result var fns = arr.slice(); // make a copy if(fns.length === 0){ process.nextTick(function(){ // don't cause race conditions cb(null, result); // we're done, nothing more to do }); } } That's nice: waterfall([], function(err, data){ console.log("Done!"); }); Now, let's handle actually having stuff in: function waterfall(arr, cb, result){ // result is the initial result var fns = arr.slice(1); // make a copy, apart from the first element if(!arr[0]){ // if there is nothing in the first position process.nextTick(function(){ // don't cause race conditions cb(null, result); // we're done, nothing more to do }); return; } var first = arr[0]; // get the first function first(function(err, data){ // invoke it // when it is done if(err) return cb(err); // early error, terminate entire call // perform the same call, but without the first function // and with its result as the result waterfall(fns, cb, data); }); } And that's it! We overcome the fact we can't loop with callbacks by using recursion basically. Here is a fiddle illustrating it. It's worth mentioning that if we were implementing it with promises we could have used a for loop.
upvote count: 9
accepted answer of: http://stackoverflow.com/q/28908180

http://stackoverflow.com/a/28923011
has body: You could put the retry logic in a request interceptor. From the breeze docs: Stock Breeze AJAX adapters offer an extension point, the requestInterceptor. This interceptor gives the developer one last look at each request before the adapter calls the actual AJAX component. The interceptor takes a single parameter, the requestInfo, and returns nothing. var requestInfo = { adapter: this, // this AJAX adapter config: ..., // the configuration object passed to the wrapped AJAX component dsaConfig: config, // the config arg from the calling Breeze DataServiceAdapter success: successFn, // adapter's success callback error: errorFn // adapter's error callback } Your request interceptor could wrap the error callback and add retry logic and 401 handling. If you're using breeze with jQuery you could do this at a lower level, using jQuery's ajax prefilter.
answers question: http://stackoverflow.com/q/28920506
type: Answer
score: 1
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/46158552

http://stackoverflow.com/q/28952621
linked to: http://stackoverflow.com/q/19239217
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/46159273
tagged with: javascript
tagged with: string
score: 0
has body: I have a problem parsing a string variable back to an object.I have looked at all other question around this topic but none solve my problem. if(subMatch.match(/\{.*\}/)){ /// new Object of some sort var objStr=subMatch.match(/\{.*\}/)[0]; //objStr= JSON.stringify(objStr); // I tried this , no difference //objStr='"'+objStr+'"'; // Tried this way: unexpected token t //objStr="'"+objStr+"'"; // Tried this way: unexpected token ' objStr=JSON.parse("'"+objStr+"'"); // puts out unexpected token ' This is the string I am trying it out on: {"type": "lawnmowing","hours": 10,"rate": 10.5,"permanent": false} According to JSONLint it is valid. With the extra quotes it looks like: '{"type": "lawnmowing","hours": 10,"rate": 10.5,"permanent": false}' I looked at this question, JSON.Parse,&#39;Uncaught SyntaxError: Unexpected token o but their variable starts as an object. My objStr has type String, I checked. I am adding literal single quotes around objStr. Because objStr is already a String, that should not be a problem right? I've also tried completely without extra quotes around the variable How can I correctly JSON.parse a String variable. I can get it to work with eval, but I rather not use that, because it is user input that I have to put in an object. Sorry to bother you with a question about this topic again, but I haven't found the solution among the other questions. Help would be really appreciated! Thanks Jenita
has comment: http://stackoverflow.com/comment/46159338
answer count: 1
has title: Convert a string (variable ) to object with JSON.parse , error unexpected token
tagged with: parsing
has answer: http://stackoverflow.com/a/28952776
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46159036

http://stackoverflow.com/comment/46303350
type: AnswerComment
score: 0
type: Comment
has text: the thing is not i can't change it because it will take time to change `number` to `text` it will take time cause my code depend on the type `number` and the width of the inputs will take more because when i limit the value to 99999 it take smaller width but when it back it will take wider width i know i can fix it again to be just like it now with type text but it need time
comment on: http://stackoverflow.com/a/29030810

http://stackoverflow.com/q/28968458
accepted answer: http://stackoverflow.com/a/29002127
has body: I have a html page running from a node.js server. I'm trying to use syncfusions basic grid feature and have followed the set up provided http://help.syncfusion.com/web. My code is as follows: I have just copied and pasted it and tried to run it but got the error ej.web.all-latest.min.js:1 Uncaught SyntaxError: Unexpected token ILLEGAL test.html:27 Uncaught ReferenceError: ej is not defined I've included their js file for ej. The first error is line 1 of this file http://cdn.syncfusion.com/js/web/ej.web.all-latest.min.js What is happening? I can't figure it out :/ Any help would be great as today is the first day I've started to use syncfusion and there is not really much documentation to help you set it up...
possible better answer: http://stackoverflow.com/a/28968557
has answer: http://stackoverflow.com/a/29002127
type: AnsweredQuestion
tagged with: syncfusion
has title: Syncfusion JavaScript grid not displaying. Syntax and Reference error
type: Question
has answer: http://stackoverflow.com/a/28968557
answer count: 2
tagged with: javascript
score: 0

http://stackoverflow.com/comment/46180589
comment on: http://stackoverflow.com/q/28964370
has text: Are there not any workaround? Like encoding before sending and decoding in controller? Or I just simply shouldn't keep any record that contains # symbol?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/135789237
comment on: http://stackoverflow.com/a/48498691
type: AnswerComment
score: 0
type: Comment
has text: There is nothing wrong with this solution. However if I were you I would put your fallback code into an external file and use document.write(" ") to load it so that people with modern browsers aren't forced to download code that they don't need.

http://stackoverflow.com/q/28918608
upvote count: 10
type: Question
has comment: http://stackoverflow.com/comment/46094964
has comment: http://stackoverflow.com/comment/55474477
score: 10
tagged with: javascript
tagged with: google-document-viewer
has title: Google Document Viewer shows "No Preview Available"
answer count: 3
has comment: http://stackoverflow.com/comment/50096009
tagged with: http://stackoverflow.com/tag/pdf
has answer: http://stackoverflow.com/a/43475079
downvote count: 0
has comment: http://stackoverflow.com/comment/50026959
has answer: http://stackoverflow.com/a/39711447
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46095280
has body: I have used Google Document Viewer to open PDF files in my Android device. A black screen with "No Preview Available" text is shown, instead of opening my PDF files. I have tested with sample PDF files from Google. They are working fine, but not my PDF files. Is there anything that i need to do from code side to view my PDF. http://docs.google.com/viewer?url=myurl.pdf
has answer: http://stackoverflow.com/a/67245546

http://stackoverflow.com/comment/46204726
type: Comment
comment on: http://stackoverflow.com/q/28976802
score: 1
type: QuestionComment
has text: What kind of db is it? What are you using to connect to it? Can you include the source that does the db insertion for the e-mail address?

http://stackoverflow.com/comment/46295303
type: Comment
has text: obj[$scope.upperCase] = uppercaseFilter(obj[$scope.upperCase]) would be more appropriate given that he was trying to inject the filter, no? Or easier still it would be be easier to just suffix the "| uppercase" to the template
comment on: http://stackoverflow.com/a/29026545
score: 0
type: AnswerComment

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

http://stackoverflow.com/comment/46195466
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28971372
type: Comment
has text: @Banana I didn't *assume* anything. This is a demo, i don't have the full source code so i have put this into something simple *for demo use*. Comments are in place to explain the function. @Shakira; This is where you have to put some work in and work out how to put this into your existing source code (if you want to use this).

http://stackoverflow.com/comment/46130022
type: QuestionComment
comment on: http://stackoverflow.com/q/28936975
score: 0
has text: Do you want the user to always check the checkbox? what is the rule that you are looking for?
type: Comment

http://stackoverflow.com/comment/46094845
comment on: http://stackoverflow.com/q/28917998
score: 0
type: Comment
type: QuestionComment
has text: What has classic asp to do with this? It's a server side technology

http://stackoverflow.com/a/28913410
has comment: http://stackoverflow.com/comment/46085256
type: Answer
has comment: http://stackoverflow.com/comment/46085300
has comment: http://stackoverflow.com/comment/46085266
score: 0
has body: It's not binding because both are two different objects. When you create object, a separate memory location is allocated to it. var a = {}; var b = {}; if you check whether a === b, it will return you false. Because both are two different objects. That's the reason why $scope.doesNotBindModel = {ID: 57, Title: "57 - Does not bind"}; does not bind whereas $scope.doesBindModel = $scope.doesBind[3]; Because in later case, you are referring to the same object based on its index.
has comment: http://stackoverflow.com/comment/46085224
answers question: http://stackoverflow.com/q/28913317

http://stackoverflow.com/a/29858325
score: 0
answers question: http://stackoverflow.com/q/29054312
type: Answer
has body: Property message will give you access to the error message itself.

http://stackoverflow.com/q/28959884
has body: I have a dropdown in my webapp in which there are two values; code and description. In the input field i can filter them. When i click on the item i want i send a http POST request (in angularjs). This request send all values in json format. So i send in POST, code and the description. After the submit, i have the server response that returns only the code. This is correct and i need mantain this kind of structure. What i would do is show in the input field, after submit, the description that is "connected" to that code. Here i created a simultion (without send url of course). http://jsfiddle.net/8y48q/26/ Nav item - Works OK Code Description {{item.first}} {{item.last}} Send Angular part: var myApp = angular.module('myApp',[]); function MyCtrl($scope, $http) { var url = "http://...."; $scope.item={} $scope.numberList={} $scope.numberList.getList=[{'first':'1','last':'skeet'},{'first':'2','last':'shaikh'},{'first':'3','last':'game'}] $scope.inputList={} $scope.inputList.getinputList=[{'firstA':'AAA','lastB':'BBBB'}] $scope.idSelectedVote = null; $scope.setSelected = function (idSelectedVote) { $scope.idSelectedVote = idSelectedVote; $scope.item.value=idSelectedVote.last; //alert(idSelectedVote); }; $scope.send = function() { $http({ method: 'POST', url: url, data: { datas: $scope.numberList.getList } }).success(function(data) { $scope.result = data; }).error(function(data, status) { console.log(status); console.log(data); }); }; } As i wrote, when i click "send" button i inject a http POST request that sends the datas inside the input text to a url as json. The server send me a response without the description but only the code. I need from that code go back to the correct description
type: Question
has comment: http://stackoverflow.com/comment/46172781
tagged with: javascript
score: 0
tagged with: http-post
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46172857
type: UnansweredQuestion
has title: Get description from code in dropdown
has comment: http://stackoverflow.com/comment/46172321
has comment: http://stackoverflow.com/comment/46172364
answer count: 0

http://stackoverflow.com/a/28970336
accepted answer of: http://stackoverflow.com/q/28969814
type: Answer
has comment: http://stackoverflow.com/comment/46280041
has comment: http://stackoverflow.com/comment/46203571
has comment: http://stackoverflow.com/comment/46203643
answers question: http://stackoverflow.com/q/28969814
has comment: http://stackoverflow.com/comment/46203535
has comment: http://stackoverflow.com/comment/46203628
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46203600
has comment: http://stackoverflow.com/comment/46202386
has body: The selector is incorrect, you can simplify your code to make it work as the ad iframes have the classes .ad-frame.frame-for-homepage. This works fine: $(document).ready(function (){ setTimeout(function() { console.log("starting..."); console.log(document.querySelectorAll("iframe")); var frames = $("iframe.ad-frame.frame-for-homepage"); console.log(frames); frames.on("mouseover", function(event){ console.log("on ad"); }); }, 10000); }); Edit: tested it as a Chrome extension and it works fine, the console logs "on ad" when mousing over the ads, except the flash one on top (I checked and the iframe has height:0)

http://stackoverflow.com/comment/46262228
comment on: http://stackoverflow.com/q/29008052
score: 0
type: Comment
type: QuestionComment
has text: I am not sure exactly what the best method is I am used to oo programming and would just use properties but can't figure out how I would do it in asp. So if that is what you would suggest would be the easiest way to pass a single value when the dialog is closed I'll give it a go.

http://stackoverflow.com/comment/46355238
has text: @MrTeale - OK, I've edited my answer in the light of your additional code.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29059121

http://stackoverflow.com/comment/46275990
comment on: http://stackoverflow.com/a/29015372
type: Comment
score: 0
has text: what u mean by bound reference, this will modify the parent code a bit, but still will behave the ay i need it
type: AnswerComment

http://stackoverflow.com/comment/46356699
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29060142
type: Comment
has text: @Hatul: answer edited. Forgot ``$(e.target)``. It should works fine (see codepen link).

http://stackoverflow.com/comment/46222418
type: QuestionComment
type: Comment
has text: `window.getSelection().getRangeAt(0).cloneRange()` is the nearest equivalent. It's difficult to work out exactly what you're trying to do. A demo page would help.
comment on: http://stackoverflow.com/q/28980383
score: 0

http://stackoverflow.com/comment/46289652
comment on: http://stackoverflow.com/q/29023436
score: 0
has text: What is the input and expected output?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28930307
has answer: http://stackoverflow.com/a/29626131
type: Question
has title: how can I set this conditions? (Jquery/javascript)
tagged with: conditional-statements
score: 1
tagged with: jquery-selectors
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46116521
favorite count: 0
has body: thanks for your time and first of all I'm a noobie who's been learning by his own javascript so I don't manage quite good the selectors to achieve what I want. Here it's my problem: html list item 1 list item 2 list item 3 list item 4 list item 5 list item 1 list item 2 list item 3 item 4 list item 5 CSS .highlighted{ color: red; } .goods{ border:1px solid red; cursor: pointer; padding: 0px; list-style: none; } .match_group{ border: 1px solid black; } Look here pelase: * http://jsfiddle.net/nero_noob_123/ctcn7kfy/2/ basically what I want to achieve with the jquery and javascript it's the following.... but I don't know how write it as a condition so try to read it as follows: $('#stuff2').addClass('match_group'); $('#stuff2').addClass('match_group'); if($('li').has('span.highlighted').length){ //so span exist! $('span.highlighted').closest('.goods').addClass('match_group'); }else if($('.goods').hasClass('match_group') && // span.highlight DOESN'T EXIST inside .goods) { /// remove the match_group class from '.goods' where span.highlight doesn't exist }else{ if any of the '.goods' classes has span.highlighted inside them, don not apply .match_group } I hope I have made myself clear, and sorry that's the best I can do with my current knowledge in JQ and javascript PD: feel free to modify the crapy code I wrote to acheive what I need, thank you!
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/q/28917854
favorite count: 0
has comment: http://stackoverflow.com/comment/46093906
has comment: http://stackoverflow.com/comment/46093483
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28918253
score: 1
upvote count: 1
type: AnsweredQuestion
has title: show and hide menu with jquery
has comment: http://stackoverflow.com/comment/46093988
tagged with: javascript
has comment: http://stackoverflow.com/comment/46094019
has answer: http://stackoverflow.com/a/28917995
accepted answer: http://stackoverflow.com/a/28918253
type: Question
has body: I would like,when clicking on the menu icon change to an X shape with animation and when clicking on X shape it change to menu icon. I write this part.I have problem with clicking function. at first when I click on the menu button it change to X shape and show the menu but when I want to close menu my js codes does not work and I don't know why this happening. I used bootstrap in my codes I upload my site here html دانلود اپلیکیشن صفحه اصلی سوالات متداول فرصت های شغلی درباره ما js $('.try-op').click(function() { $('.navbar-toggle').removeClass('try-op'); $('.navbar-toggle').addClass('texting'); $('.top-m').addClass('top-animate'); $('.mid-m').addClass('mid-animate'); $('.bottom-m').addClass('bottom-animate'); $('.menu').addClass('opened'); var height = $( window ).height(); $('.menu').css('height',height); }); $('.texting').click(function() { $('.navbar-toggle').removeClass('texting'); $('.menu').removeClass('opened'); $('.top-m').removeClass('top-animate'); $('.mid-m').removeClass('mid-animate'); $('.bottom-m').removeClass('bottom-animate'); $('.navbar-toggle').addClass('try-op'); }); css .icon-bar{ transition: 0.6s ease; transition-timing-function: cubic-bezier(.75, 0, .29, 1.01); } .top-animate { background: #fff !important; top: 13px !important; -webkit-transform: rotate(43deg); transform: rotate(43deg); transform-origin: 7% 100%; -webkit-transform-origin: 7% 100%; } .mid-animate { opacity: 0; } .bottom-animate { background: #fff !important; top: 13px !important; -webkit-transform: rotate(-221deg); transform: rotate(-221deg); transform-origin: 45% 18%; -webkit-transform-origin: 45% 18%; margin-top: 0px !important; } .bazar-green, .bazar { color: #fff; display: block; font-size: 20px; position: absolute; right: 80px; top: 5px; line-height: 43px; background: url(image/bazarlogo.png) no-repeat left center; padding-left: 80px; z-index: 401; } .navbar-toggle { display: block; position: absolute; right: 0px; top: 0px; } .navbar-toggle{ float: right; padding: 9px 10px;…
answer count: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/28917995
tagged with: jquery

http://stackoverflow.com/q/29044727
answer count: 1
downvote count: 0
favorite count: 0
has body: Having a strange issue - for some reason, accessing the parent object inside a property using the call() method only works when it is returned inside a function. Why am I not able to access MyObject in the second example, but I can in the first? I need to get the second working as I don't want to constantly be calling functions inside loops as it's slow and looks bad. What I have right now: var MyObject = { "selectorArray": ['[id*="example"]','[class*="example"]'], "all": function() { return Array.prototype.slice.call(document.querySelectorAll(MyObject.selectorArray.join())); }, "somemethod": function () { for (var i = 0; i &lt; MyObject.all().length; i++) { MyObject.all()[i] // do something etc } } .. I need to use all() in loops other methods also } What I want (faster and better looking) var MyObject = { "selectorArray": ['[id*="example"]','[class*="example"]'], "all": Array.prototype.slice.call(document.querySelectorAll(MyObject.selectorArray.join())), "somemethod": function () { for (var i = 0; i &lt; MyObject.all.length; i++) { MyObject.all[i] // do something etc } } .. I need to use all in loops other methods also }
has answer: http://stackoverflow.com/a/29044780
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29044780
score: 1
upvote count: 1
type: Question
has title: Access Object inside property call()?
tagged with: javascript

http://stackoverflow.com/comment/46265401
type: Comment
score: 0
type: AnswerComment
has text: my bad - my debug statements were throwing me off. it's throttling ok though Amazon is still giving me throttling errors but not sure why yet. Unrelated to this code though. Thanks!
comment on: http://stackoverflow.com/a/29000651

http://stackoverflow.com/comment/46331739
score: 1
comment on: http://stackoverflow.com/q/29046220
type: Comment
type: QuestionComment
has text: You should also import jQuery UI library.

http://stackoverflow.com/comment/46165081
score: 0
type: Comment
type: QuestionComment
has text: my bad, its in the model reopen, posted the code above, this code above works fine in live app also, it's the test where it's crashing
comment on: http://stackoverflow.com/q/28950952

http://stackoverflow.com/a/28918192
answers question: http://stackoverflow.com/q/28918079
has body: This is not possible from the web browser alone. Most systems aren't even capable of this directly. It is up to the client to decide how to route audio and there is no control of this within the browser, except for what happens within the page itself. The best you can do is to recommend to your users how to configure their systems. For your Windows users, they will need a virtual audio loopback driver. http://vb-audio.pagesperso-orange.fr/Cable/
has comment: http://stackoverflow.com/comment/46094110
downvote count: 0
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/comment/46356953
comment on: http://stackoverflow.com/q/29060343
score: 0
type: QuestionComment
has text: This looks promising for me: http://jsfiddle.net/jqwidgets/pfF53/
type: Comment

http://stackoverflow.com/comment/46404050
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29078275
has text: It's currently being developed for SOASTA's mPulse, but will get backported to the public repository.
type: AnswerComment

http://stackoverflow.com/comment/46145042
comment on: http://stackoverflow.com/a/28945447
type: AnswerComment
type: Comment
has text: Yup! Thats what I have in the actual file, posted it wrong here! For some reason its not changing the color when I click the button
score: 0

http://stackoverflow.com/comment/46430825
comment on: http://stackoverflow.com/a/29094545
has text: Very sad. What happens when one pastes into Google-office? Maybe they have found a solution or workaround. If not, I would think that is a major limitation of Google-office.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28968827
tagged with: minitest
answer count: 2
has answer: http://stackoverflow.com/a/28969675
has title: How to trigger a JS controller action with Minitest
has answer: http://stackoverflow.com/a/28969119
possible better answer: http://stackoverflow.com/a/28969675
type: AnsweredQuestion
has body: In a test I want to simulate a request that only accepts JS requests. I tried it in the "normal" style: patch study_update_user_vocab_path(@user, @vocabs[index]), { strength: "1", resume_study_index: "index" } Here, "strength" and "resume_study_index" are the ids of the form fields. When running the test I get the following error message: ActionView::MissingTemplate: ActionView::MissingTemplate: Missing template vocabs/study_update, application/study_update with {:locale=&gt;[:en], :formats=&gt;[:html], :variants=&gt;[], :handlers=&gt;[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. This makes perfect sense, as there is no view to render. But how can I tell Mini:Test to trigger/expect JS?
score: 0
tagged with: integration-testing
tagged with: ruby-on-rails
type: Question
accepted answer: http://stackoverflow.com/a/28969119
tagged with: javascript

http://stackoverflow.com/q/28970756
has comment: http://stackoverflow.com/comment/46194151
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46194025
upvote count: 1
has comment: http://stackoverflow.com/comment/46193362
has comment: http://stackoverflow.com/comment/46195094
type: Question
tagged with: angularjs-routing
has body: I have a situation where I want to either route a intranet user to the default start page (if they have used the app before or take them to the "how to use" / tutorial page if they have not used the app before. The user identify is known and we have a flag held against user identities, so i can tell if a user has used the app before. When they follow the link from the tutorial. The controller on the tutorial sets and persists this flag via an ajax call. What I basically want to be able to do is: angular.module('uiApp', ['meModule']) .config(['$routeProvider', 'me', function($routeProvider, me)) { $routeProvider .when('/home', { templateUrl: '/views/home.html', controller: 'homeCtrl', tab: 'home' }) .when(' ... ', { ... other routes ... }) .when('/tutorial', { templateUrl: '/views/tutorial.html', controller: 'tutorialCtrl' }) .otherwise({ redirectTo: (me.isNew ? '/tutorial' : '/home') }); } }]) .run() { .. the run code here } So basically the idea being that a browser navigating to intranet.company.com/ with will always fall into otherwise and should for existing users take them to '/home' but for first timers will take them to '/tutorial' The issue is that I can't seem to pass in the module that returns the user information and get a failed to instantiate module uiApp due to unknown provider: messages and I'm uncertain how I would achieve this routing situation in the .run section. Can anyone turn me around and point me in the right direction?
has comment: http://stackoverflow.com/comment/46194361
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
tagged with: angularjs
has title: Angular JS routing between two pages at start

http://stackoverflow.com/a/29054315
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46346310
upvote count: 9
accepted answer of: http://stackoverflow.com/q/29054152
has comment: http://stackoverflow.com/comment/46346226
answers question: http://stackoverflow.com/q/29054152
type: Answer
has comment: http://stackoverflow.com/comment/46346662
downvote count: 0
has comment: http://stackoverflow.com/comment/46346157
has comment: http://stackoverflow.com/comment/46346130
has comment: http://stackoverflow.com/comment/102487207
score: 9
has comment: http://stackoverflow.com/comment/46346560
has comment: http://stackoverflow.com/comment/46346944
has body: You didn't defined Android as a javascripinterface you have to write below lines // If your callback methods are in same class then just same class object webView.addJavascriptInterface(this, "Android"); Syntax of addJavascriptInterface() method addJavascriptInterface(Object object, String name); // 1. `object` – *the Java object to inject into this WebView’s JavaScript context.* // 2. `name` – *the name used to expose the object in JavaScript*

http://stackoverflow.com/comment/46560012
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28954345
type: Comment
has text: For the store vs. action creator question, I think it's mostly a question of style, and whether you trust your team to not make the mistake of handling the response directly in the store. If you put it in the action creators, there is no way to make that mistake. Choose one approach for the project and stick with it. For the caching, I've seen different approaches, but all of them obviously need access to the store data, either directly or through getters. Generally I like to keep everything related to XHRs in a Utils module and just call it from either the store or the action creators.

http://stackoverflow.com/comment/46350339
comment on: http://stackoverflow.com/a/29056537
score: 0
type: Comment
has text: well, it's not so easy :( even when I get to '9' in my original code, I am returned 'false', but the SerialNumber gets the value '10'....
type: AnswerComment

http://stackoverflow.com/comment/46147784
comment on: http://stackoverflow.com/a/28946508
type: Comment
score: 1
has text: the `bind` method essentially does the same thing as the anonymous function. A ridiculously simple test case says the Chrome's V8 prefers the anonymous ever so slightly (http://jsperf.com/raf-bind-vs-anonymous). I wouldn't worry about it either way, they're both very readable lines of code.
type: AnswerComment

http://stackoverflow.com/comment/46332954
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29028947
has text: @skip405 Yes, the error is still there. This is the [live site](http://staging.keebs.com) if it helps at all. The console error pops up right when the site loads.

http://stackoverflow.com/a/28945182
answers question: http://stackoverflow.com/q/28944914
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46145260
has body: This seems to work for now function setTheme(themeOp){ var Themelink = document.getElementById('ppt').contentWindow.document.getElementById('theme'); var e = document.getElementById("theme"); var option = e.options[e.selectedIndex].value; localStorage['value'] = option; console.log('The selected value is: ' + localStorage['value']); console.log (localStorage.theme); if (Themelink){ Themelink.setAttribute('href','http://myurl/css/theme/' + localStorage['value'] + '.css'); } }

http://stackoverflow.com/q/28969327
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28970753
has comment: http://stackoverflow.com/comment/46190489
type: Question
has body: I send an AJAX request to server which include page number that I want from the server. I get this page number from user using an input box. I use this code: (function($) { $(function() { // Overall viewmodel for this screen, along with initial state function CartableViewModel(totalItems) { var self = this; // Editable data self.data = ko.observable(); self.pageIndex = ko.observable(1).extend({ rateLimit: { method: "notifyWhenChangesStop", timeout: 1500 } }); ko.computed(function() { Mostafa.myApp.Order.Cartable("CreatorID=23 &amp; (CreatorID=23|CreatorID&gt;23)", self.pageSize(), function(data) { self.data(data); }); }); }); } Mostafa.myApp.Order.CartableViewModel = new CartableViewModel(); ko.applyBindings(Mostafa.myApp.Order.CartableViewModel); }); $("#form_page_select").on("submit", function() { return false; }); })(jQuery); my HTML is: &lt;form id="form_page_select"&gt; &lt;input type="number" id="input_page_select" min="1" data-bind='value: pageIndex, valueUpdate: ["input", "keypress"]' /&gt; &lt;/form&gt; actually I send this AJAX request with another java script method which it's name is "Mostafa.myApp.Order.Cartable()" and it works fine. my Question is: How can I send this Ajax call not only after timeout, but if the user press enter on this input field. Thanks a lot,
upvote count: 2
answer count: 1
tagged with: knockout.js
has title: cancel knockout ratelimit extender if user press Enter on an input
type: UnansweredQuestion
score: 2
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/46228576
type: Comment
has text: @davidkonrad I meant you shouldn't suggest to use such bad practice (especially for beginners). The problem is not only in index order. T.J. Crowder has pretty detailed [explanation](http://stackoverflow.com/a/9329476/2118955) of why you shouldn't use `for..in` with arrays
comment on: http://stackoverflow.com/a/28989514
score: 0
type: AnswerComment

http://stackoverflow.com/q/28930034
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28930336
accepted answer: http://stackoverflow.com/a/28930083
has title: How to get around the asynchronous Node.js behaviour?
type: Question
has answer: http://stackoverflow.com/a/28930083
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28930336
answer count: 2
tagged with: asynchronous
has body: I'm working on a script that pings websites and returns the results in a web UI. However, I've run into a problem which I am trying to figure out the best solution for. This block of code needs to return a array of statuses but due to the asynchronous behaviour of Node.js, it returns an empty array because the code takes time to execute. Here is what I have: var ping = require('ping'); function checkConnection(hosts) { var results = []; hosts.forEach(function (host) { ping.sys.probe(host, function (isAlive) { results.push({"host": host, "status": isAlive}); }); }); return {results: results, timestamp: new Date().getTime()}; } module.exports.checkConnection = checkConnection; I know that you could solve this problem with the use of timers but what would be the simples and most ideal solution here?
tagged with: node.js

http://stackoverflow.com/a/28999822
has body: This is all you need: jQuery(function() { jQuery('.showSingle').click(function(){ jQuery('.targetDiv').slideUp(); jQuery('#div'+$(this).attr('target')).slideToggle(); }); }); Demo: jQuery('.showSingle').click(function() { jQuery('.targetDiv').slideUp(); jQuery('#div' + $(this).attr('target')).slideToggle(); }); Div 1 Div 2 Div 3 Div 4 Lorum Ipsum1 Lorum Ipsum2 Lorum Ipsum3 Lorum Ipsum4 Edited: replaced the $(document).ready() wrapper, just in case it's not understood
type: Answer
has comment: http://stackoverflow.com/comment/46247886
has comment: http://stackoverflow.com/comment/46247508
has comment: http://stackoverflow.com/comment/46247945
has comment: http://stackoverflow.com/comment/46247900
answers question: http://stackoverflow.com/q/28999725
score: 0
has comment: http://stackoverflow.com/comment/46247867

http://stackoverflow.com/q/28930209
answer count: 2
has comment: http://stackoverflow.com/comment/46145436
tagged with: google-chrome-extension
tagged with: url
favorite count: 0
type: UnansweredQuestion
tagged with: regex
has answer: http://stackoverflow.com/a/28950221
has title: Comparing user-specific URL list with current URL?
has comment: http://stackoverflow.com/comment/46145069
has comment: http://stackoverflow.com/comment/46145345
upvote count: 1
downvote count: 1
type: Question
has body: I have a whitelist where users can enter specific URLs/URL patterns (only targetting http and https. I would like to transfrom and compare these URL/URL patterns so that the wildcard selector (*) can be used like so user enters: example.*/test I want to transform this to: *//*.example.*/test so that it matches: http://www.example.com/test, https://example.co.uk/test Another example: user enters: http://www.*.com/* I want to transform this to: http://www.*.com/* so that it matches: http://www.blah.com/test, http://www.other.com/null.html and user enters: www.example.com/* I want to transform this to: *//www.example.com/* so that it matches: http://www.example.com/testtwo, https://www.example.com/arfg The reason I want to insert a leading protocol (if it wasn't included by the user) is because I am using this to compare against the current tab URL. I get this array of URL strings and would like to compare them with the current url, but am having trouble matching all use cases: "isNotWhitelisted" : function(){ var whitelist = MyObject.userLists.whitelist; var currentUrl = document.location.href; for(var i=0; i<whitelist.length; i++){ var regexListItem = new RegExp(whitelist[i].toString().replace(".", "\\.").replace("*", ".+")); if(currentUrl.match(regexListItem)) { return false; } } return true; }, Firstly, the regex conversion matches end cases (e.g. example.com/* but not kinds like example.*/about This is part of a Chrome extension, is there not a better/easier way to do this maybe using inbuilt methods? Thanks for any help in advance.
has comment: http://stackoverflow.com/comment/46134102
linked to: http://stackoverflow.com/q/12433271
has answer: http://stackoverflow.com/a/28933033
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/46118002
has comment: http://stackoverflow.com/comment/46145830
score: 0

http://stackoverflow.com/comment/46158844
comment on: http://stackoverflow.com/a/28952381
has text: Yes, i will add to my answer now, give me a few moments.
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28911335
score: 0
has comment: http://stackoverflow.com/comment/46081766
has comment: http://stackoverflow.com/comment/46081517
tagged with: php
has comment: http://stackoverflow.com/comment/46081646
has title: How to load part of a page, and get the attribute from the drop down button without using session
has comment: http://stackoverflow.com/comment/46081611
has comment: http://stackoverflow.com/comment/46081666
type: Question
has comment: http://stackoverflow.com/comment/46081814
has comment: http://stackoverflow.com/comment/46081595
tagged with: javascript
tagged with: drop-down-menu
tagged with: ajax
has comment: http://stackoverflow.com/comment/46081725
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46081699
has body: I surf the net, and there are a lot of php and ajax codes, the problem is i am not really familiar with php, ajax and ccs... and i really need to do this asap. tried using this but nothing really happened This is the only part that i want to load first... <% ArrayList<PurchaseOrder> PurchaseOrder = (ArrayList<PurchaseOrder>) session.getAttribute("poList"); %> <% for (int i = 0; i < PurchaseOrder.size(); i++) { %> <option value="<%=PurchaseOrder.get(i).getPoNumber()%>"> <%=PurchaseOrder.get(i).getPoNumber()%> <% } %> Then this part should load by having the attribute "selected" in the dropdwon <% int y = Integer.parseInt(request.getParameter("value")); %> Purchase Order Item Description Quantity Unit Measurement Unit Price Vat Date Made Prepared By Approved By <%=PurchaseOrder.get(y).getPoNumber()%> <%= PurchaseOrder.get(y).getItemDescription()%> <%= PurchaseOrder.get(y).getQty()%> <%= PurchaseOrder.get(y).getUnitMeasurement()%> <%= PurchaseOrder.get(y).getUnitprice()%> <%= PurchaseOrder.get(y).getVat()%> <%= PurchaseOrder.get(y).getDateMade()%> <%= PurchaseOrder.get(y).getPreparedBy()%> .... The problem is, all the scriplets codes load at the same time?? Error Message, i think this error is due to this <% int y = Integer.parseInt(request.getParameter("value")); %> since it get loaded... when there is no "set value" yet.. > HTTP Status 500 - Internal Server Error > > type Exception report > > messageInternal Server Error > > descriptionThe server encountered an internal error that prevented it > from fulfilling this request. > > exception > > org.apache.jasper.JasperException: java.lang.NumberFormatException: > null root cause > > java.lang.NumberFormatException: null note The full stack traces of > the exception and its root causes are available in the GlassFish > Server Open Source Edition 4.1 logs. > > GlassFish Server Open Source Edition 4.1 console error/ glassfish > > Warning: StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lan…
has comment: http://stackoverflow.com/comment/46081573
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/46285461
type: Comment
type: QuestionComment
has text: Why do you need to do that? It's the same thing.
comment on: http://stackoverflow.com/q/29020931
score: 0

http://stackoverflow.com/a/28946192
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28946040
has body: document.querySelector("#score").addEventListener("change", function(){ document.querySelector("#displaytotalscore").textContent = this.value; }, false); Add More Field Total: This shows the basic working of the onchange event. User fills in a score in the input with id score. When this loses focus (blurs) it will invoke the onchange event setting the score to the div using the property textContent. Updated with your fiddle: http://jsfiddle.net/41fw2c4x/2/ function addmore() { var top_level_div = document.getElementById('addmore'); var count = top_level_div.getElementsByTagName('ul').length; var ul = document.createElement('ul'); ul.className = 'jcform'; ul.id = 'remove' + count; var tbl1 = ' Name Score Removed '; ul.innerHTML = tbl1; document.getElementById('addmore').appendChild(ul) } //my solution document.querySelector("#addmore").addEventListener("keyup", function(e){ if (e.target && e.target.tagName == "INPUT" && e.target.name == "cpoints[]") { updateScore(); } }, false); function updateScore() { var score = 0; Array.prototype.map.call(document.querySelectorAll("input[name='cpoints[]']"), function(element){ score += !isNaN(parseInt(element.value)) ? parseInt(element.value) : 0; //when not a digit add 0, or ignore. }); document.querySelector("#displaytotalscore").textContent = score; } function removeme(numm) { document.getElementById('remove' + numm + '').parentElement.removeChild(document.getElementById('remove' + numm + '')); updateScore(); } //solution end Add More Field Name Score Total: This adds an keyup event to the main div (addmore). Every time it detect an input element with the name cpoints[], it will iterate over all inputs with that name. Sum the total amount and display it in the div. It ignores values other than numbers by assigning the value 0. It checks if something is a number with the isNaN method. Why did I switch to the keyup event? It allows me to use only one event, instead of adding an onchange event for every input. Why not set an onch…
has comment: http://stackoverflow.com/comment/46148086
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46148296
has comment: http://stackoverflow.com/comment/46147843
type: Answer
accepted answer of: http://stackoverflow.com/q/28946040

http://stackoverflow.com/comment/46126562
type: AnswerComment
score: 0
type: Comment
has text: Hint: `level` is `path.length`.
comment on: http://stackoverflow.com/a/28930020

http://stackoverflow.com/q/28992173
tagged with: javascript
type: Question
has body: can anyone explain what the following JavaScript object means or how it works: var var1 = (function(){ // some code })(); var1(function(){ // some code })
answer count: 2
has answer: http://stackoverflow.com/a/28992473
accepted answer: http://stackoverflow.com/a/28992473
tagged with: object
score: 0
possible better answer: http://stackoverflow.com/a/28992474
has answer: http://stackoverflow.com/a/28992474
has comment: http://stackoverflow.com/comment/46232531
has title: Understanding javascript object instance or work flow
type: AnsweredQuestion

http://stackoverflow.com/comment/46102145
score: 0
type: Comment
type: QuestionComment
has text: It's possible so long as you're not generating some kind of random link, and the page can just rebuild the same view each time according to the url. That's just normal routing, though. I'm not sure what you're asking.
comment on: http://stackoverflow.com/q/28922470

http://stackoverflow.com/q/28917926
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/46093453
has answer: http://stackoverflow.com/a/28917956
tagged with: ruby
type: UnansweredQuestion
tagged with: asset-pipeline
tagged with: ruby-on-rails
type: Question
has body: Occasionally I'll click a link in my application, and the *.css and *.js files that are loaded are referring to the wrong controller. If I refresh the page, this is immediately fixed, but I do not want to tell my users that the occasional page refresh may be required. This is where the content is loaded in my application layout: = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' =&gt; true = stylesheet_link_tag params[:controller] = javascript_include_tag 'application', 'data-turbolinks-track' =&gt; true = javascript_include_tag params[:controller] And where the assets are loaded in my assets.rb initilizer Rails.application.config.assets.paths &lt;&lt; Rails.root.join('vendor', 'assets', 'flash') %w( comments contact_types ensembles favorite_instruments fields gds gigs instuments rank_members recruit_statuses scores seasons section_notes sections static students announcements ).each do |controller| Rails.application.config.assets.precompile += ["#{controller}.js", "#{controller}.css"] end It's strange to me that sometimes it work work and other times, it would not. I assume that I have a gem issue with some of the page loading stuff. I am using turbolinks, spring, and quiet_assets. I don't think any of the other gems touch assets.
tagged with: javascript
has title: Rails - Incorrect Assets Loading
has comment: http://stackoverflow.com/comment/46093493
score: 0

http://stackoverflow.com/q/28944973
tagged with: mysql
type: Question
score: 3
tagged with: javascript
has body: I have the followin code : '; while($pendingTransfers = mysql_fetch_assoc($getPending)){ $id = $pendingTransfers['id']; echo ' '.$counter++.' '.$pendingTransfers['NumarInventar'].' '.$pendingTransfers['DenumireArticol'].' ';} echo ' Finish transfers The above code brings the inserted DB id for each record and on each row in the above table an select option from wich the user can chose some value. When user finishes , he will press the button " Finish transfers" and all the inputs must be serialized. The problem is that i have multiple inputs with same name and i cannot group them all as i can use them later in PHP. For exemple i can have 5 row's on each row 1 of each input . So the result will id=1 DepId=3456 , id =2 DepId = 5432 and so on. $('#BtnSendObj').on('click', function(event) { event.preventDefault(); var data; var a = $('#sendObj').serializeArray(); $.each(a, function () { var depID = $('input[name=depDestinatie]').serializeArray(); var id = $('input[name=id]').serializeArray(); data =[{"id":id, "depID":depID}]; }); //The above will output something like : // [Object]0: Object //depId: Array[4]0: Object1: Object2: Object3: Object... // id: Array[4]0: Object1: Object2: Object3: Object // Like this i cannot handle them togerther in PHP. // I think it should look like an array of objects so like this i would //be able to acces them easly , i think that both id's should be in same object //, but this is were i dont know how to proceed. $.ajax({ url: 'subpages/data/transferObjects.php', data: {data: data}, type: 'POST', success:function(data, textStatus, jqXHR){ console.log('AJAX SUCCESS'); console.log(data); }, complete : function(data, textStatus, jqXHR){ } }); }); Here i handle the ajax post. What i want to achieve it's to send the data to a php file where i will update DB with the values from the form. The php files looks like this : //some connection if(isset($_POST['data'])) { $updateObjects = mysql_query("UPDATE transactions SET IDDepartamentDestinatie =…
answer count: 3
downvote count: 0
tagged with: jquery
has title: Serialize form - input's with same name
favorite count: 0
has answer: http://stackoverflow.com/a/28945573
has answer: http://stackoverflow.com/a/38094531
possible better answer: http://stackoverflow.com/a/28945123
tagged with: php
has answer: http://stackoverflow.com/a/28945123
accepted answer: http://stackoverflow.com/a/28945573
type: AnsweredQuestion
upvote count: 3

http://stackoverflow.com/comment/121386377
comment on: http://stackoverflow.com/q/29002979
score: 0
type: Comment
type: QuestionComment
has text: https://octoperf.com/blog/2019/08/22/kraken-angular-workspace-multi-application-project/

http://stackoverflow.com/q/29032727
type: AnsweredQuestion
has body: I am using mongoose and node and I am trying to paginate data from sub-documents. I am able to limit subdocuments, but not skip them. The versions I am using are: Mongo 3.0.0 Node 0.10.33 Mongoose 3.9.7 The Data [{ "name" : "Ranger Table", "_id" : ObjectId("550234d3d06039d507d238d8"), "body" : [ { "name" : "Jason", "colour" : "Red", "animal" : "T-rex", "_id" : ObjectId("550234d3d06039d507d238de") }, { "name" : "Billy", "colour" : "Blue", "animal" : "Triceratops", "_id" : ObjectId("550234d3d06039d507d238dd") }, { "name" : "Zach", "colour" : "Black", "animal" : "Mastadon", "_id" : ObjectId("550234d3d06039d507d238dc") }, { "name" : "Tommy", "colour" : "Green", "animal" : "Dragon" "_id" : ObjectId("550234d3d06039d507d238d9") } ] },{ "name" : "Bot Table", "_id" : ObjectId("5502d205184cd74033f64e6b"), "body" : [ { "name" : "Optimus", "team" : "Autobots", "class" : "Leader", "_id" : ObjectId("550234d3d06039d507d238d9") }, { "name" : "Bumblebee", "team" : "Autobots", "class" : "Scout", "_id" : ObjectId("550234d3d06039d507d238da") }, { "name" : "Astrotrain", "team" : "Decepticons", "class" : "Transport", "_id" : ObjectId("550234d3d06039d507d238db") } ] }] The Code var BodySchema = new Schema({random: String},{strict:false}); var FeedSchema = new Schema({ name: String, body:[BodySchema] }); var feed = mongoose.model('Feed', FeedSchema); feed.find({_id:'550234d3d06039d507d238d8'}) .populate({ "path":"body", "options":{ limit:2, //This works fine skip:2 //This doesn't work } }) .exec(function(err, result){ if(err){return(res.send(500, err))} res.send(result); }); The Result The above code DOES limit the number of "body" sub-documents to 2, but doesn't skip any. The code above returns this: { "name" : "Ranger Table", "_id" : ObjectId("550234d3d06039d507d238d8"), "body" : [ { "name" : "Jason", "colour" : "Red", "animal" : "T-rex", "_id" : ObjectId("550234d3d06039d507d238de") }, { "name" : "Billy", "colour" : "Blue", "animal" : "Triceratops", "_id" : ObjectId("550234d3d06039d507d2…
has comment: http://stackoverflow.com/comment/46330721
has answer: http://stackoverflow.com/a/29075295
downvote count: 0
tagged with: mongoose
tagged with: javascript
favorite count: 0
type: Question
score: 3
has comment: http://stackoverflow.com/comment/46352580
has comment: http://stackoverflow.com/comment/46327219
accepted answer: http://stackoverflow.com/a/29075295
answer count: 1
tagged with: node.js
has title: unable to "skip" mongoose sub-documents
has comment: http://stackoverflow.com/comment/46306556
upvote count: 3
has comment: http://stackoverflow.com/comment/46306559
tagged with: mongodb

http://stackoverflow.com/comment/46190421
type: Comment
comment on: http://stackoverflow.com/a/28969138
score: 0
type: AnswerComment
has text: @user244394 Could that be because I decided not to repeat you code twice? The `else` is exactly the same.

http://stackoverflow.com/comment/46256655
score: 0
type: AnswerComment
has text: could you explain this question please? I'm not sure of understand you
type: Comment
comment on: http://stackoverflow.com/a/29004639

http://stackoverflow.com/a/28952743
score: 3
accepted answer of: http://stackoverflow.com/q/28952663
answers question: http://stackoverflow.com/q/28952663
has comment: http://stackoverflow.com/comment/46160414
downvote count: 0
has body: Create a title element that is the child of each polygon e.g. <polygon id="Andor" fill="none" points="1200.25,708.5 1161.25,722.25 1125,741.25 1109.5,750 1101.75,758.25 1090.5,762.5 1081.5,773.75 1066.75,781 1071.25,762.5 1071.25,738.75 1063,722.25 1034.75,711.75 1017.25,710.5 958,729 951.25,729 943,732.25 913.25,737.75 910.75,722.25 893.75,715 875.75,715 853.75,702 849.25,700.75 835.25,692.75 817,690.5 779.25,678.5 772.75,674 738.75,659.25 720,655.25 704,657.25 690,665.25 693.5,624.5 707.75,583.5 702.25,558.5 702.25,512.75 716,512.75 727.5,530.25 727.5,563.25 746,589.5 766,589.5 770.25,596.75 785.5,587.5 794,589.5 802.25,605.75 815.75,609 831.25,605.75 849.25,619.75 873.5,625.75 881,638 889.75,639.25 896,645.25 908.25,639.25 947.12,638 969.25,630.5 1001.75,630.5 1177,615.25 "> Andor </polygon> If you want carriage returns you can write them as line 1 line 2 line 3
upvote count: 3
has comment: http://stackoverflow.com/comment/46159788
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/46161665
has comment: http://stackoverflow.com/comment/46159578

http://stackoverflow.com/q/28917056
has comment: http://stackoverflow.com/comment/46094050
has title: How to kill a linux child_process.spawn using javascript?
tagged with: kill-process
has body: var child_process = require('child_process'); if (typeof ffmpegrec == "undefined" || ffmpegrec == null) { var ffmpegrec = ''; } if(record === "1") { ffmpegrec = child_process.spawn("ffmpeg",[ "-re", // Real time mode "-f","x11grab", // Grab screen "-framerate","60", // Framerate "-s",width+"x"+height, // Capture size "-i",":"+screen+"+"+top+","+left, // Capture offset "-vb","1024k", // Target bit rate "-f","mpeg1video", // File format "/home/CloudGaming/webContent/recordedVideos/test.mpg"]); } else if(record === "0") { ffmpegrec.kill(); } I am sending a signal of 1 to record the video stream while 0 to stop the video stream. Recording works like a charm but the process can't be killed. Please help out. Thanks in advance!
has answer: http://stackoverflow.com/a/28919316
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46094759
score: 0
tagged with: linux
has comment: http://stackoverflow.com/comment/46094952
has comment: http://stackoverflow.com/comment/46091981
tagged with: child-process
accepted answer: http://stackoverflow.com/a/28919316
tagged with: process
has comment: http://stackoverflow.com/comment/46094149
has comment: http://stackoverflow.com/comment/46093974
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46094012
linked to: http://stackoverflow.com/q/9722624

http://stackoverflow.com/comment/46140393
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28941748
has text: Thank you i added an external function called 'doubletap' and it worked.
type: AnswerComment

http://stackoverflow.com/a/28946822
type: Answer
has body: Here is your load your script from external pages, or from external resources, more details if you do not understand. moment.js load via jquery, script loaded via javscript eval Copy paste this only in Chrome console and understand what's happening: //In my example using plain html let say ajax result or jquery load //Note that if here different approach is required $.getScript( "http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js" ) .done(function( script, textStatus ) { parseScript(true); }); function parseScript(go) { if (go) { var xhr = $(' '); //var1 in global scope var1 = undefined; //cars in global scope; cars = undefined; $(xhr).filter("script").each( function(e) { if (var1 != undefined && cars != undefined ) return; console.log(moment().format('MMMM Do YYYY, h:mm:ss a') + ' ______ script executed ' + $(this).html()); eval($(this).html()); alert(moment().format('MMMM Do YYYY, h:mm:ss a') + ' _______ var1: ' + var1 + ' cars: ' + cars); }); } }
upvote count: 1
has comment: http://stackoverflow.com/comment/46159480
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28945220

http://stackoverflow.com/a/46333105
score: 5
has comment: http://stackoverflow.com/comment/79793637
answers question: http://stackoverflow.com/q/28998570
upvote count: 5
type: Answer
has body: This workaround is for turbolinks 5, but should be easy to adapt. The loading appears instantly because turbolinks cache, it renders the page before the ajax call is made, breaking the animation. In order to get a loading effect working we must disable it: &lt;head&gt; .... &lt;meta name="turbolinks-cache-control" content="no-cache"&gt; Then we can do something like: (using animated.css) $(document).on('turbolinks:click', function(){ $('.page-content') .addClass('animated fadeOut') .off('webkitAnimationEnd oanimationend msAnimationEnd animationend') }); $(document).on('turbolinks:load', function(event){ // if call was fired by turbolinks if (event.originalEvent.data.timing.visitStart) { $('.page-content') .addClass('animated fadeIn') .one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function(){ $('.page-content').removeClass('animated'); }); }else{ $('.page-content').removeClass('hide') } ... With that, the transition is nice and smooth.
downvote count: 0

http://stackoverflow.com/q/28946025
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28946257
type: Question
tagged with: internet-explorer
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28946257
answer count: 1
tagged with: jquery
has body: I'm hosting a simple test page at http://ss.amityregion5.org/crypto.php. It's simply testing RSA encryption: Client Jquery, upon hitting the submit button, encrypts the message with the server's public key (visible in javascript). This encrypted value is sent to the server, which decrypts the message with its own private key. This code runs perfectly fine in Chrome and Safari. However in Internet Explorer (11), the form fails to submit. Interestingly, however, the Developer Console never spits out an error, so I'm at a loss as to what the issue is. I may just be missing something stupid, or IE could be doing something funky with JS parsing. From my incremental testing, I suspect the issue might be the last line of my javascript, where I create a hidden form element, fill it with the ciphertext, and submit it. Is this behavior not supported on I.E., and if not, how may I fix it. Thanks in advance.
has title: Jquery form creation not submitting in IE

http://stackoverflow.com/q/29055013
favorite count: 0
has comment: http://stackoverflow.com/comment/46366754
type: UnansweredQuestion
upvote count: 1
linked to: http://stackoverflow.com/q/20253246
has title: Call SignalR hub method with dynamically created button
has comment: http://stackoverflow.com/comment/46348094
tagged with: signalr-hub
score: 1
tagged with: signalr
type: Question
has answer: http://stackoverflow.com/a/41849850
has comment: http://stackoverflow.com/comment/46366738
has comment: http://stackoverflow.com/comment/46364733
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/20819501
has body: I have a problem with button click does not firing when it dynamically created, I know, here is the solution. Question is this: I am using SignalR. I must declare click event (to call some hub method) when chat hub is started. Please see below button click works in this situation $(document).on('click', "#chatlist li .gobtn", function (e) { var id = $(this).closest("li").data("message-id"); }); But i should call it from here $.connection.hub.start().done(function () { //button click not fires here but it must be here $('#chatlist li .gobtn').click(function () { var id = $(this).closest("li").data("message-id"); chat.server.sendAnswer(id); }) }) Please help if you have any idea to solve it.
tagged with: asp.net

http://stackoverflow.com/a/58217096
answers question: http://stackoverflow.com/q/28977346
has body: Old question but here is my solution using one of the answer above: const el = document.createElement("audio"); el.muted = true; el.loop = true; const source = document.createElement("source"); source.src = lineSe; source.type = "audio/mpeg"; el.appendChild(source); // need to call this function after user first interaction, or safari won't do it. function firstPlay() { el.play(); } let timeout = null; function play() { // In case user press the button too fast, cancel last timeout if (lineSeTimeout) { clearTimeout(timeout); } // Back to beginning el.currentTime = 0; // unmute el.muted = false; // set to mute after the audio finish. In my case 500ms later // onended event won't work because loop=tue timeout = setTimeout(() =&gt; { // mute audio again el.muted = true; }, 500); }
score: 1
upvote count: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/46323171
type: QuestionComment
has text: You haven't explained your problem. What do you mean 'it makes no difference'?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29041223

http://stackoverflow.com/a/28954524
has body: Here's one possible solution. Would like to know if there's other possible answers. var isMobile = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/); var iPadStyle = [ '&lt;style&gt;', '::-webkit-scrollbar {', 'height: initial;', 'z-index: initial;', '}', '', '::-webkit-scrollbar-track {', '-webkit-box-shadow: initial;', 'border-radius: initial;', 'z-index: initial;', 'background-color: initial;', '', '}', '', '::-webkit-scrollbar-thumb {', 'border-radius: initial;', '-webkit-box-shadow: initial;', 'background-color: initial;', 'width: initial;', '}', '&lt;/style&gt;' ].join('\n'); if (isMobile){ angular.element("head").append(iPadStyle); }
type: Answer
accepted answer of: http://stackoverflow.com/q/28954292
answers question: http://stackoverflow.com/q/28954292
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/46095487
has text: then it's so simple. Why you failed to mention this before?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28918837

http://stackoverflow.com/q/29059223
has body: My Javascript timer is for people with a rubiks cube with generates a scramble (nevermind all this, but just to tell you I'm generating after each solve a new scramble will be generated) and my scrambles do actually have a while (true) statement. So that does crash my script, but it 95/100 times stops just before the script crashes but I don't wanna have any times. Let me explain a bit more detailed about the problem. Problem: javascript crashes because my script takes too long to generate a scramble. Below you have 3 functions I use. This function generates a scramble with the Fisher-Yates shuffle. Timer.prototype.generateScramble = function(array) { for (var i = array.length - 1; i &gt; 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; }; This function validates the input e.g. I receive an array as the following: Here I only have to check the first character. That's why I use the seconds [ ] notation. I don't want people get an F with an F2 e.g. var scr = ["F","R","U","B","L","D","F2","R2","U2","B2","L2","D2","F'","R'","U'","B'","L'","D'"] Timer.prototype.validateScramble2 = function(array) { var last = array.length-1; for (var i = 0; i &lt; array.length-1; i++) { if (array[i][0] == array[i+1][0]) { return false; } } for (var i = 0; i &lt; array.length-2; i++) { if (array[i][0] == array[i+2][0]) { return false; } } if (array[0][0] == [last][0]) { return false; } return true; }; The above functions are just waiting to be called. Well in the function below I use them. Timer.prototype.updateScramble2 = function(scrambleArr, len, type) { var self = this; var scramble = '', j, updatedArr = []; while (updatedArr.length &lt; len) { j = (Math.floor(Math.random() * scrambleArr.length)); updatedArr.push(scrambleArr[j]); } while (!self.validateScramble2(updatedArr)) { updatedArr = self.generateScramble(updatedArr); } for (var i = 0; i &lt; updatedArr.length; i++) { scramble += updatedArr[i] + ' '…
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29059275
tagged with: oop
type: Question
tagged with: browser
tagged with: crash
tagged with: javascript
tagged with: prototype
score: 0
answer count: 1
has title: JS crashes sometimes with Timer scramble
has comment: http://stackoverflow.com/comment/46417506

http://stackoverflow.com/q/29053023
has body: I try to make a game with HTML Canvas but I've a problem. When I call my 'init' function with 'window.onload', my program doesn't load any images. The canvas has been created, but images aren't there, and when I submit my function in chrome console, images appears... So I want to load my images and execute the function when it's done. Thanks for help ! var requestAnimId; // Initialisation function init() { var tilemapCtx = new Canvas('tilemap', 800, 600, 1); var tilemap = new Tilemap("sand", tilemapCtx); requestAnimId = window.requestAnimationFrame(update); } // Boucle de rafraîchissement function update() { requestAnimId = window.requestAnimationFrame(update); } window.onload = init; Here is Tilemap : var Tilemap = function(map, canvas) { for (var y = 0; y &lt; 10; y++) { for (var x = 0; x &lt; 10; x++) { // Création de la tile this.image = new Image(); // Définition de l'image switch(tilemaps[map][y][x]) { case " ": this.image.src = "assets/sand.png"; break; case "#": this.image.src = "assets/wall.png"; break; } // Affichage de l'image //canvas.drawImage(this.image, tileX, tileY, tilesetWidth, tilesetHeight, x, y, 32, 32); canvas.drawImage(this.image, 32, 32); } } } and Canvas : var Canvas = function(name, width, height, zIndex) { this.canvas = window.document.createElement("canvas"); this.canvas.id = name; this.canvas.style.position = "absolute"; this.canvas.width = width; this.canvas.height = height; this.canvas.style.zIndex = zIndex; document.body.appendChild(this.canvas); return this.canvas.getContext('2d'); }
linked to: http://stackoverflow.com/q/7116303
accepted answer: http://stackoverflow.com/a/29053100
type: Question
tagged with: canvas
has title: Canvas HTML loading time
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
score: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29053100
upvote count: 3
type: AnsweredQuestion

http://stackoverflow.com/comment/46302735
comment on: http://stackoverflow.com/q/29030169
type: Comment
type: QuestionComment
has text: In jsp i can use this option, but inside the java script how can i use that method?
score: 0

http://stackoverflow.com/comment/46332877
has text: Have you finished? help me
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29046628

http://stackoverflow.com/comment/46309513
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29034187
has text: try to change top from 0 to top 100% - 25px > top:calc(100% - 25px);
score: 0

http://stackoverflow.com/comment/46159571
type: QuestionComment
has text: @Eyal in the html its literally just {{myvar}}
type: Comment
comment on: http://stackoverflow.com/q/28951657
score: 0

http://stackoverflow.com/comment/46205289
comment on: http://stackoverflow.com/q/28977130
score: 0
type: QuestionComment
type: Comment
has text: **ID of an element must be unique** so use `drag1` and `drop2` as classes instead

http://stackoverflow.com/a/29032083
has comment: http://stackoverflow.com/comment/46306115
has comment: http://stackoverflow.com/comment/46306443
answers question: http://stackoverflow.com/q/29031981
has comment: http://stackoverflow.com/comment/46305451
type: Answer
has comment: http://stackoverflow.com/comment/46305176
has body: Check for the presence of the item css class in the parent element: if ( ! carouselitems.last().parent().hasClass("item") ) { carouselitems.slice(i, i+count).wrapAll("&lt;div class='item'&gt;&lt;/div&gt;"); } Fiddle here.
score: 0
has comment: http://stackoverflow.com/comment/46306039
has comment: http://stackoverflow.com/comment/46305356

http://stackoverflow.com/comment/46426052
score: 0
type: Comment
has text: Yeah it's odd - I may try to investigate or dig into specs to see if I can find out why IE behaves like this a bit later when I have time. I'm on IE11 and it still seems to do the same thing.
comment on: http://stackoverflow.com/a/29032576
type: AnswerComment

dom
tags question: http://stackoverflow.com/q/29060352
tags question: http://stackoverflow.com/q/28973603
type: Tag
tags question: http://stackoverflow.com/q/28958506
tags question: http://stackoverflow.com/q/28991044
tags question: http://stackoverflow.com/q/29017957
tags question: http://stackoverflow.com/q/28948885
tags question: http://stackoverflow.com/q/29010764
tags question: http://stackoverflow.com/q/28923573
tags question: http://stackoverflow.com/q/28929609
tags question: http://stackoverflow.com/q/28955862
tags question: http://stackoverflow.com/q/28930488
tags question: http://stackoverflow.com/q/28986061
tags question: http://stackoverflow.com/q/28997769
tags question: http://stackoverflow.com/q/29015824
tags question: http://stackoverflow.com/q/28934174
tags question: http://stackoverflow.com/q/29055046
tags question: http://stackoverflow.com/q/29013969
tags question: http://stackoverflow.com/q/29056607
tags question: http://stackoverflow.com/q/29054919
tags question: http://stackoverflow.com/q/29023861
tags question: http://stackoverflow.com/q/29026574
tags question: http://stackoverflow.com/q/28934916
tags question: http://stackoverflow.com/q/28925070
tags question: http://stackoverflow.com/q/28915690
tags question: http://stackoverflow.com/q/29038031
tags question: http://stackoverflow.com/q/29061411
tags question: http://stackoverflow.com/q/28942324
tags question: http://stackoverflow.com/q/28966958
tags question: http://stackoverflow.com/q/28914100
tags question: http://stackoverflow.com/q/28926898
tags question: http://stackoverflow.com/q/28938844
tags question: http://stackoverflow.com/q/29023095
tags question: http://stackoverflow.com/q/28934413
tags question: http://stackoverflow.com/q/28955383
tags question: http://stackoverflow.com/q/28917998
tags question: http://stackoverflow.com/q/28909610
tags question: http://stackoverflow.com/q/29041267
tags question: http://stackoverflow.com/q/28962995
tags question: http://stackoverflow.com/q/28997521
tags question: http://stackoverflow.com/q/29019127
tags question: http://stackoverflow.com/q/28933438
tags question: http://stackoverflow.com/q/28971879
tags question: http://stackoverflow.com/q/29040758
tags question: http://stackoverflow.com/q/28978179
tags question: http://stackoverflow.com/q/28978457
tags question: http://stackoverflow.com/q/29060399
tags question: http://stackoverflow.com/q/28927011
tags question: http://stackoverflow.com/q/28927161
tags question: http://stackoverflow.com/q/28927190
tags question: http://stackoverflow.com/q/28983177
tags question: http://stackoverflow.com/q/28943931
tags question: http://stackoverflow.com/q/28966088
tags question: http://stackoverflow.com/q/29034951
tags question: http://stackoverflow.com/q/28938961
tag name: dom
tags question: http://stackoverflow.com/q/28990973
tags question: http://stackoverflow.com/q/29002053
tags question: http://stackoverflow.com/q/29016619
tags question: http://stackoverflow.com/q/29013035
tags question: http://stackoverflow.com/q/28912937

http://stackoverflow.com/comment/46298896
type: Comment
type: QuestionComment
has text: You need to do an ajax call to load the new page and then show the loading icon when the link is clicked and on success of the ajax call hide it again. [Have a read of this](http://api.jquery.com/jquery.ajax/)
score: 0
comment on: http://stackoverflow.com/q/29028459

http://stackoverflow.com/q/28971497
tagged with: titanium
has title: How to make a word in a Titanium TextArea bold or italic
type: Question
tagged with: ios
has comment: http://stackoverflow.com/comment/46196366
tagged with: javascript
has comment: http://stackoverflow.com/comment/46196420
score: 0
has body: Is it possible to format the text in a Titanium TextArea (or similar?) to make some words bold some italic, etc.? I am trying to display a paragraph of text in my Titanium Alloy app but can't see any way to have some words bold and some italic. It may be that TextArea is not the right thing to be using? I am just wanting to display a simple paragraph of word wrapped text where some of the words are formatted.
answer count: 1
tagged with: appcelerator
accepted answer: http://stackoverflow.com/a/28998838
has comment: http://stackoverflow.com/comment/46197340
has comment: http://stackoverflow.com/comment/46219313
has comment: http://stackoverflow.com/comment/46194494
has comment: http://stackoverflow.com/comment/46216284
has comment: http://stackoverflow.com/comment/46228292
type: AnsweredQuestion
tagged with: titanium-alloy
has answer: http://stackoverflow.com/a/28998838
has comment: http://stackoverflow.com/comment/46208130

android-deep-link
type: Tag
tag name: android-deep-link
tags question: http://stackoverflow.com/q/29009642

http://stackoverflow.com/comment/46284249
type: QuestionComment
comment on: http://stackoverflow.com/q/29019615
has text: Does `forever logs app.js` provide any details?
type: Comment
score: 1

http://stackoverflow.com/comment/46342140
type: QuestionComment
has text: Did you check for script errors to see if that is why you aren't seeing the results of those lines? I hope you know that your `setTimeout()` function call is doing absolutely nothing. It does not delay the following lines of code at all.
comment on: http://stackoverflow.com/q/29045616
score: 0
type: Comment

http://stackoverflow.com/comment/50114587
score: 0
type: AnswerComment
type: Comment
has text: yes: search for `__proto__`, it's an older comment, you need to scroll down a little
comment on: http://stackoverflow.com/a/31046021

http://stackoverflow.com/a/28988257
upvote count: 2
has comment: http://stackoverflow.com/comment/46224918
has body: var count = 1; $('.text').click(function() { $(this).toggleClass('uppercase', count === 2); $(this).toggleClass('lowercase', count === 3); if (count === 3) { count = 0 } count++; }); .uppercase { text-transform: uppercase; } .lowercase { text-transform: lowercase; } CamelCase 1
type: Answer
has comment: http://stackoverflow.com/comment/46224858
answers question: http://stackoverflow.com/q/28988114
downvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/46225012

http://stackoverflow.com/a/29044380
has body: you just have to use an expression to assign the value to a variable. Then log it. Then return it. var damage = function() { var num = Math.floor(Math.random() * 5 + 1); console.log(num); return num; }; damage();
score: 0
has comment: http://stackoverflow.com/comment/46328491
type: Answer
answers question: http://stackoverflow.com/q/29044332

addeventlistener
tags question: http://stackoverflow.com/q/29024624
tags question: http://stackoverflow.com/q/28920599
tags question: http://stackoverflow.com/q/28922324
tags question: http://stackoverflow.com/q/29048091
tags question: http://stackoverflow.com/q/28951042
tag name: addeventlistener
type: Tag

http://stackoverflow.com/q/28989091
answer count: 4
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28989169
has body: I am trying to devise a way to use a simple Javascript object (one level deep key value pairs) as a key to another object. I am aware that merely using the object without stringification will result in [Object object] being used as the key; see the following: Using an object as a property key in JavaScript (so this question is not a duplicate). There is a blog post about it that takes this into account and also accounts for the need to sort by object key since their order is not guaranteed, but the included Javascript code runs over a 100 lines. We are using the underscore.js library since that goes hand in hand with backbone but pure Javascript alternatives will also be of interest.
type: Question
tagged with: object
tagged with: underscore.js
upvote count: 5
has answer: http://stackoverflow.com/a/28989847
linked to: http://stackoverflow.com/q/12386450
has title: Using Javascript object as object key
has answer: http://stackoverflow.com/a/61866916
downvote count: 0
tagged with: javascript
tagged with: key
favorite count: 0
has answer: http://stackoverflow.com/a/28989092
score: 5

http://stackoverflow.com/q/29027487
favorite count: 0
has comment: http://stackoverflow.com/comment/46296748
has title: How to use for loop in javascript function
has answer: http://stackoverflow.com/a/29027654
tagged with: http://stackoverflow.com/tag/html
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/29027654
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/29027590
has answer: http://stackoverflow.com/a/29027656
type: Question
score: 0
answer count: 3
tagged with: for-loop
possible better answer: http://stackoverflow.com/a/29027590
has body: I've created few map areas in an image. I want to display the description of particular area onclick. I used one javascript function. Image contains around 15-20 map areas. Below is simple function for only 3 areas. This one working fine. function showdiv(id) { obj = document.getElementById(id); alert(obj); if (obj.style.display == 'block') { obj.style.display = 'none'; } if (obj.style.display == 'none') { if (obj == whatever1) { whatever1.style.display = 'block'; whatever2.style.display = 'none'; whatever3.style.display = 'none'; } else if (obj == whatever2) { whatever2.style.display = 'block'; whatever1.style.display = 'none'; whatever3.style.display = 'none'; } else if (obj == whatever3) { whatever3.style.display = 'block'; whatever2.style.display = 'none'; whatever1.style.display = 'none'; } } } I believe this is method not fair for more than 15 map areas. So i tried to use for loop. But something went wrong. &lt;script&gt; function showdiv(id) { obj = document.getElementById(id); if (obj.style.display == 'block') { obj.style.display = 'none'; } if (obj.style.display == 'none') { for (var i=0; i&lt;=12; i++) { var div = whatever + i; if (div == obj) { div.style.display = 'block'; home.style.display = 'none'; } else { div.style.display = 'none'; } } } } &lt;/script&gt; What's the solution to this basic problem? Anybody have any suggestion?? Thank you so much in advance.

http://stackoverflow.com/comment/46263465
type: Comment
comment on: http://stackoverflow.com/a/29009104
type: AnswerComment
has text: That's a clever solution :)
score: 0

http://stackoverflow.com/q/28977346
has answer: http://stackoverflow.com/a/28977465
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has answer: http://stackoverflow.com/a/28977805
tagged with: audio
type: Question
has answer: http://stackoverflow.com/a/52827570
score: 8
tagged with: javascript
tagged with: jquery
has body: I just built a real-time app using socket.io where a "master" user can trigger sounds on receiving devices (desktop browsers, mobile browsers). That master user sees a list of sound files, and can click "Play" on a sound file. The audio playback is instant on browsers. On mobiles however, there is a 0.5-2 seconds delay (my Nexus 4 and iPhone 5 about 1 second and iPhone 3GS 1-2 seconds). I've tried several things to optimize the audio playback to make it faster on mobiles. Right now (at the best "phase" of its optimization I'd say), I combine all the mp3's together in one audio file (it creates .mp3, .ogg, and .mp4 files). I need ideas on how I can further fix / improve this issue. The bottleneck really seems to be in the hmtl 5 audio methods such as .play(). On the receivers I use as such: Your browser does not support HTML5 audio. In my JS: var audioFile = document.getElementById('audioFile'); // Little hack for mobile, as only a user generated click will enable us to play the sounds $('#prepareAudioBtn').on('click', function () { $(this).hide(); audioFile.play(); audioFile.pause(); audioFile.currentTime = 0; }); // Master user triggered a sound sprite to play socket.on('playAudio', function (audioClip) { if (audioFile.paused) audioFile.play(); audioFile.currentTime = audioClip.startTime; // checks every 750ms to pause the clip if the endTime has been reached. // There is a second of "silence" between each sound sprite so the pause is sure to happen at a correct time. timeListener(audioClip.endTime); }); function timeListener(clipEndTime) { this.clear = function () { clearInterval(interval); interval = null; }; if (interval !== null) { this.clear(); } interval = setInterval(function () { if (audioFile.currentTime >= clipEndTime) { audioFile.pause(); this.clear(); } }, 750); } Also considered blob for each sound but some sounds can go for minutes so that's why I resorted to combining all sounds together for 1 big audio file (better than several audio tags on the pag…
downvote count: 0
has answer: http://stackoverflow.com/a/58217096
favorite count: 0
upvote count: 8
has title: HTML 5 audio .play() delay on mobile
type: UnansweredQuestion

http://stackoverflow.com/q/28915136
has body: It's possible a log like this? 07-&lt;...&gt;.js ... Stacktrace: [31m[31mError: Failed expectation[31m [31m at [object Object].&lt;anonymous&gt; (...06-....js)[31m[31m[22m[39m So, it basically something is failing in file -06- when I'm already processing file -07- inside a suite. Is there an option to say to protractor / webdriver.js something like "hey don't wait for previous promises to be resolved"? I guess not, but maybe there is a known scenario where this can happen. Sorry for the little information. I can't give much more info. This is a similar issue, I think it's related with the previous one: [32m46 tests, 11 assertions, 0 failures [39m [launcher] BUG: launcher exited with 1 tasks remaining And I have another case where I have an error stacktrace -after- the tests, assertions and failures line. Ej: 032 - "alert.msg" equals text: "invalid login"[32mâœ”[39m 033 - set detailTestLevel: 1 Finished in 3 seconds. Speed: 12.89 tests per second Last Test Id: (ch_loginvalid_enUS_122_01) [32m33 tests, 0 assertions, 0 failures [39m sh: 1: beep: not found /home/*******/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1654 var result = fn(); ^ Error: Index out of bound. Trying to access element at index:0, but there are only 0 elements at /home/*******/common/ext/ElementFinder.js:618:15 at /home/*******/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1582:15 at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ /home/*******/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1654:20) at notify /home/*******/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:465:12) at notifyAll /home/*******/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:442:7) at resolve /home/*******/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:420:7) at fulfill /home/*******/node_modules/protractor/node_mod…
tagged with: selenium
has comment: http://stackoverflow.com/comment/46163462
has comment: http://stackoverflow.com/comment/46230222
has comment: http://stackoverflow.com/comment/46151546
tagged with: protractor
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46115611
has title: Async callbacks/promises running that protractor/webdriver is not aware of
accepted answer: http://stackoverflow.com/a/28991112
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/46095671
favorite count: 0
tagged with: jenkins
type: Question
has comment: http://stackoverflow.com/comment/46138407
has comment: http://stackoverflow.com/comment/46160530
answer count: 1
tagged with: selenium-webdriver
upvote count: 3
has answer: http://stackoverflow.com/a/28991112

http://stackoverflow.com/comment/46231487
score: 0
type: AnswerComment
has text: the yellow is for showing only so you can see it better
type: Comment
comment on: http://stackoverflow.com/a/28991666

http://stackoverflow.com/q/28954163
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/28954320
tagged with: angularjs
has title: "binding" between factory and controller
score: 0
answer count: 1
has body: I'm trying to return a scope for binding from a factory to a controller. it would be ideal if i could pass the name so it could be dynamic. Here's what I have so far .factory('urlWatch', function (urlFactory) { var _this = this; return { listenToUrl: function (scope, moduleName, stateName) { scope.$on('$locationChangeSuccess', function (event) { console.log(scope.bind); scope = urlFactory.parseState(moduleName, stateName); }); } }; return _this; }); and in the controller I have $scope.mod1m3 = urlWatch.listenToUrl($scope, "module1", "mod1"); So this does not work but if I change the factory to look like this listenToUrl: function (scope, moduleName, stateName) { scope.$on('$locationChangeSuccess', function (event) { console.log(scope.bind); scope.mod1m3 = urlFactory.parseState(moduleName, stateName); }); } What i was trying to do is change it to listenToUrl: function (scope, moduleName, stateName, bind) { scope.$on('$locationChangeSuccess', function (event) { scope.bind = urlFactory.parseState(moduleName, stateName); }); } and $scope.mod1m3 = urlWatch.listenToUrl($scope, "module1", "mod1", "mod1m3"); however it doesn't seem to want to connect the 2, I'm getting : TypeError: Cannot read property '$on' of undefined Unsure how i can get it to connect to get it to work as intended. Thanks!
has comment: http://stackoverflow.com/comment/46162336
has comment: http://stackoverflow.com/comment/46162274
accepted answer: http://stackoverflow.com/a/28954320
type: AnsweredQuestion

http://stackoverflow.com/comment/46197735
type: QuestionComment
has text: @GeorgeJempty can you help me with a little piece of code ?
comment on: http://stackoverflow.com/q/28972966
score: 0
type: Comment

http://stackoverflow.com/comment/46139003
type: AnswerComment
score: 0
type: Comment
has text: i did not use Selenium IDE anytime. so i don't know where did you place this code.so you need to check where you can wight this code. This answer is a javascript solution of your problem.
comment on: http://stackoverflow.com/a/28935918

http://stackoverflow.com/q/28999884
has title: Posting long and lat on database
has comment: http://stackoverflow.com/comment/46247858
accepted answer: http://stackoverflow.com/a/29008329
has answer: http://stackoverflow.com/a/29000077
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46247818
has comment: http://stackoverflow.com/comment/46248081
has answer: http://stackoverflow.com/a/29008329
score: -1
type: Question
has comment: http://stackoverflow.com/comment/46248301
has comment: http://stackoverflow.com/comment/46248038
answer count: 2
has body: I am having some problems with my current code. I am not able to receive the results of the longitude and latitude from the address text field. Once I receive that I want to put the longitude and latitude into my database. I am not sure if that is possible because the value that it is checking(address) is in the form tag. Any input would help... thanks function initialize() { var address = (document.getElementById('address')); var autocomplete = new google.maps.places.Autocomplete(address); autocomplete.setTypes(['geocode']); google.maps.event.addListener(autocomplete, 'place_changed', function() { var place = autocomplete.getPlace(); if (!place.geometry) { return; } var address = ''; if (place.address_components) { address = [ (place.address_components[0] && place.address_components[0].short_name || ''), (place.address_components[1] && place.address_components[1].short_name || ''), (place.address_components[2] && place.address_components[2].short_name || '') ].join(' '); } }); } function codeAddress() { geocoder = new google.maps.Geocoder(); var address = document.getElementById("address").value; geocoder.geocode({ 'address': address }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { alert("Latitude: " + results[0].geometry.location.lat() + "Longitude: " + results[0].geometry.location.lng()); } else { alert("Geocode was not successful for the following reason: " + status); } }); } google.maps.event.addDomListener(window, 'load', initialize); Add new location Please add your company information within this form Name: Hours: Baseball: Yes No Coming Soon Basketball: Yes No Coming Soon Hockey: Yes No Coming Soon Golf: Yes No Coming Soon Soccer: Yes No Coming Soon Address: Here is the formconnect.php too $sql="INSERT INTO markers (name, hours, baseball, basketball, hockey, golf, soccer, address, lat, lng) VALUES ('$_POST[name]','$_POST[hours]','$_POST[baseball]','$_POST[basketball]','$_POST[hockey]','$_POST[golf]','$_POST[soccer]','$_POST[addr…
has comment: http://stackoverflow.com/comment/46248231
has comment: http://stackoverflow.com/comment/46247896
possible better answer: http://stackoverflow.com/a/29000077
tagged with: javascript
has comment: http://stackoverflow.com/comment/46247881
favorite count: 0
tagged with: google-maps-api-3
downvote count: 1
upvote count: 0

http://stackoverflow.com/comment/46207409
score: 0
type: Comment
has text: this worked... and also what about two conditions? whenever i textbox some value then corresponding checkbox shall be checked
comment on: http://stackoverflow.com/a/28978296
type: AnswerComment

http://stackoverflow.com/a/28977955
answers question: http://stackoverflow.com/q/28977894
downvote count: 0
type: Answer
has body: You could do something like var invalue = $('#input').val(); $('#output').val(invalue.replace(/^(.*)$/gm, '$1\n$1')) Demo: Fiddle
score: 1
upvote count: 1

http://stackoverflow.com/q/28945220
score: 0
tagged with: google-chrome-extension
has answer: http://stackoverflow.com/a/28946822
tagged with: filereader
has comment: http://stackoverflow.com/comment/46146938
has comment: http://stackoverflow.com/comment/46144655
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46144653
has comment: http://stackoverflow.com/comment/46146790
type: Question
has comment: http://stackoverflow.com/comment/46146832
has comment: http://stackoverflow.com/comment/46146449
has comment: http://stackoverflow.com/comment/46145411
has title: extract variable from imported HTML/JS file
has comment: http://stackoverflow.com/comment/46145318
answer count: 1
has comment: http://stackoverflow.com/comment/46147033
tagged with: javascript
has comment: http://stackoverflow.com/comment/46145420
has body: I have HTML file that has &lt;script&gt; tag and in that scrip among other code there is a variable that holds array of data. I need to extract that var/data. Only solution I can think of is to find patterns in imported file (with filereader, before JSON.parse), and split it in crucial points, eg. on array start var data = [ and at the end }]; but I'm afraid that's not 100% sure. Is there any clean method in those situation that I can target inner variable and extract it? HTML file is uniquely structured, but array data is different for every file.

http://stackoverflow.com/a/28997997
has comment: http://stackoverflow.com/comment/46246468
has comment: http://stackoverflow.com/comment/46283338
has comment: http://stackoverflow.com/comment/46246451
has comment: http://stackoverflow.com/comment/46246382
answers question: http://stackoverflow.com/q/28997396
has comment: http://stackoverflow.com/comment/46246172
has comment: http://stackoverflow.com/comment/46246090
has comment: http://stackoverflow.com/comment/46246245
has comment: http://stackoverflow.com/comment/46246271
has comment: http://stackoverflow.com/comment/46281575
score: 0
has comment: http://stackoverflow.com/comment/46246157
type: Answer
has body: You could try something like this: <div class="switch_options" for='<?php echo $Employee_Number;?>'> Complete: Yes NO You will need a controller to work your database query.Here it is: public function edit_complete() { if($this->session->userdata('logged_admin')){ $complete_value = $this->input->post('complete'); $Employee_Number = $this->input->post('id'); if($this->callin_model->edit_complete($Employee_Number, $complete_value)){ echo 'Edit complete OK'; } } } And inside your model: function edit_complete($Employee_Number,$complete_value){ $data = array('Complete' => $complete_value); $this->db->where('Employee_Number', $Employee_Number); $this->db->update('mytable_name', $data); if($this->db->affected_rows()==1)return TRUE; return FALSE; }
has comment: http://stackoverflow.com/comment/46281256

http://stackoverflow.com/comment/46171212
type: AnswerComment
comment on: http://stackoverflow.com/a/28958897
type: Comment
has text: No worries - a bit of trial and error but glad we finally found the root of the problem :)
score: 0

http://stackoverflow.com/comment/46267367
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29011180
type: Comment
has text: I am not sure if I understand your answer correctly, but `setAttribute` and `getAttribute` are both native methods, and not added by some framework.

underscore.js
tags question: http://stackoverflow.com/q/28991014
tags question: http://stackoverflow.com/q/29028827
tags question: http://stackoverflow.com/q/28973094
tags question: http://stackoverflow.com/q/28928240
tags question: http://stackoverflow.com/q/28968379
tags question: http://stackoverflow.com/q/28924502
type: Tag
tags question: http://stackoverflow.com/q/28933021
tags question: http://stackoverflow.com/q/28911349
tags question: http://stackoverflow.com/q/28975820
tag name: underscore.js
tags question: http://stackoverflow.com/q/29002545
tags question: http://stackoverflow.com/q/29012922
tags question: http://stackoverflow.com/q/28988587
tags question: http://stackoverflow.com/q/29061724
tags question: http://stackoverflow.com/q/29023352
tags question: http://stackoverflow.com/q/28989091
tags question: http://stackoverflow.com/q/28972966
tags question: http://stackoverflow.com/q/28934934
tags question: http://stackoverflow.com/q/28966592
tags question: http://stackoverflow.com/q/28991602
tags question: http://stackoverflow.com/q/29014742
tags question: http://stackoverflow.com/q/28938504

http://stackoverflow.com/q/28976993
tagged with: joomla
tagged with: http://stackoverflow.com/tag/xml
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: php
score: 1
has body: '&lt;field name="id_'.$filter_record['id'].'_hourfrom" type="integer" label="from" description="Delivery Hour Range" size="'.$filter_record['holdout'].'" maxlength="20" required="true" class = "hourfrom" first = "1" last = "'.$filter_record['list_limit'].'" step = "1" filter="user_utc" /&gt; i have this code above which dynamically generates input fields in the view using XML. The problem is I want to add a custom attribute so I can use it in javascript processing. for example: value_type = "single" When i try to add this in the code above, in the processed page, it is not displayed, i cannot also get the attribute. Is there a proper way to do this?
type: Question
has title: Cannot add custom XML Attribute in Joomla/PHP
downvote count: 0
tagged with: javascript
favorite count: 0

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

http://stackoverflow.com/q/28932234
type: Question
has body: I am having trouble with the FileTransfer method in Cordova. The function was working before, but now I have switched hosting provider, and the params I send with the options object does not work. The upload code I use is; $scope.uploadPhoto = function() { var img = document.getElementById('image'); var imageURI = img.src; var options = new FileUploadOptions(); options.fileKey = "file"; options.fileName = imageURI.substr(imageURI.lastIndexOf('/') + 1); options.mimeType = "image/jpeg"; options.headers = { Connection: "close" }; options.chunkedMode = false; var params = new Object(); //$scope.username = window.localStorage.getItem("uname"); navigator.geolocation.getCurrentPosition( function(position) { $scope.hideLoading(); params.lon = position.coords.longitude; params.lat = position.coords.latitude; params.uname = $scope.username; alert(params.lon + ',' + params.lat); options.params = params; var ft = new FileTransfer(); ft.upload(imageURI, "http://file/to/upload.php", win, fail, options, true); }, function() { alert('Error getting location'); } ); } And the server side PHP file is $file_url = "\'http://path/to/{$new_image_name}\'"; //Set up the query and run it //$myquery = " SELECT `imgurl`, `lat`, `long` FROM `pins` "; $insert = " INSERT INTO pins VALUES ('$file_url', '$lat', '$lon', '$uname' ) "; $query = mysqli_query($connection, $insert); //Check the query worked if ( ! $query ) { echo mysql_error(); die; } This code was working fine up until I switched server provider. It also inserts the $file_url parameter properly into the database, as that is set in the same PHP file, so the connection and insert to the database is working. The problem is the params that are sent with the FileTransfer options appear to be empty. Could there a be a PHP configuration option that is not set, that should be? I'd really appreciate any help, as right now I am out of ideas.
has comment: http://stackoverflow.com/comment/46196055
tagged with: ionic-framework
score: 0
has title: Server does not read Cordova FileTransfer options params
has answer: http://stackoverflow.com/a/33673394
answer count: 1
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46130945
tagged with: cordova
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/a/28959139
accepted answer of: http://stackoverflow.com/q/28958249
upvote count: 3
answers question: http://stackoverflow.com/q/28958249
score: 3
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: I am giving the solution in JAVASCRIPT : see demo: jsfiddle link: http://jsfiddle.net/3phba87q/ given: var dummyData=[ { day: 0, best_hour_of_the_day: "10", appt_success_rate: "60", appt_100_numbers: "27" }, { day: 2, best_hour_of_the_day: "10", appt_success_rate: "60", appt_100_numbers: "27" }, { day: 3, best_hour_of_the_day: "10", appt_success_rate: "60", appt_100_numbers: "27" }, { day: 4, best_hour_of_the_day: "10", appt_success_rate: "60", appt_100_numbers: "27" }, { day: 5, best_hour_of_the_day: "10", appt_success_rate: "60", appt_100_numbers: "27" } ]; var daysOfTheWeek = [0,1,2,3,4,5,6]; in order to get expected result: var existingDays = []; // get the existing days for(var i=0;i&lt;dummyData.length;i++){ existingDays[i] = dummyData[i]['day']; } // check which day's data is missing; then create a dummy object and push it to the dummyData object for(var i=0;i&lt;daysOfTheWeek.length;i++){ if(existingDays.indexOf(parseInt(daysOfTheWeek[i])) &lt; 0){ var dummyObject = { "day": i, "best_hour_of_the_day": "--", "appt_success_rate": "0", "appt_100_numbers": "0" }; dummyData.push(dummyObject); } } //sort day wise ascending dummyData.sort(function(x,y){ return parseInt(x.day) - parseInt(y.day) });

http://stackoverflow.com/a/29053203
has comment: http://stackoverflow.com/comment/46344550
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29052817
answers question: http://stackoverflow.com/q/29052817
type: AcceptedAnswer
downvote count: 0
has body: Fixed. I had to add a z-index of 1 to the css of the sub-menu. Turns out it was behind another item... z-index: 1;
type: Answer

http://stackoverflow.com/comment/46293365
type: QuestionComment
comment on: http://stackoverflow.com/q/29023440
has text: Ok, took me a second, I was doing something silly. Yes, that's exactly what I was initially looking for. Not sure what the meta says in this case. At a minimum if you post the link to the related question and your directive, I'll upvote it, although I should probably accept PSL's approach if I'm to treat it as a different question.
score: 0
type: Comment

http://stackoverflow.com/comment/46343280
has text: If the salt and secret key are stored locally, then encrypting the data in the local storage only provides some obscuration of the data, not real security. In fact, anyone can just grab your local JS code and run it locally to get at the data without having any credentials. Now, if the secret key was stored on the server and only retrieved after authentication with the server, that would provide some actual security because server authentication would be required before being able to decrypt the data. Important to make sure you know the difference between obfuscation and security.
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29052692
type: Comment

http://stackoverflow.com/comment/46116601
score: 0
type: Comment
type: QuestionComment
has text: @Brad will do! Thanks guys. Still new to using this as a user as opposed to an observer. I'm on crunch time and should have paid more attention to the formatting of this site.
comment on: http://stackoverflow.com/q/28930156

http://stackoverflow.com/q/28931983
tagged with: http://stackoverflow.com/tag/html
has title: Validating Radio Buttons with an alert box so it can be either accepted or rejected
type: Question
tagged with: function
has answer: http://stackoverflow.com/a/28932617
tagged with: javascript
score: 0
has body: For my school work I have to add a set of radio buttons to the form to accept a level of entry such as GCSE, AS or A2. Then I have to write a javascript function that displays the level of entry to the user in an alert box so that the level can be confirmed or rejected. So far I have done the radio buttons but don't know how to do the function. Heres my code so far: http://jsbin.com/hibutazide/1/edit?html,js,output
tagged with: radio-button
tagged with: validation
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/q/28989955
accepted answer: http://stackoverflow.com/a/28992932
upvote count: 1
has title: Uncaught SyntaxError: Unexpected token } when using iFrame
type: AnsweredQuestion
tagged with: iframe
downvote count: 3
type: Question
score: -2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28992932
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have been trying to use an iFrame to load web pages from an external site. The links to the pages are being dynamically loaded from a web server. Without the iFrames, the website loads up perfectly, however when I add in the iFrame I get this error: Uncaught SyntaxError: Unexpected token } The Log says it is on line 2 of the HTML file which is: &lt;head&gt; I'm not really sure what's wrong or what to do. Can anybody help me resolve this please? The iFrame's code looks like: &lt;iframe id="aModule" src="#error"&gt;&lt;/iframe&gt; The src is changed using this function (which is never used because the alert() lines are never triggered: function setTheModule(link){ alert(); document.getElementById("aModule").src = link; alert(); } setTheModule is called from another list which is dynamically generated using these methods: function loadModules(course){ var data = { "fn" : "mod", "data": course, "ajax" : "true" }; $.ajax({ type: "GET", url: SERVICE_URL, //Relative or absolute path to response.php file data: data, contentType: "application/json", success: function(response) { var i, list = ""; for (i = 0; i &lt; response.module.length; i++) { list += formatModuleListItem(response.module[i]); } window.location="#modules"; $("#mList").html(list).listview('refresh'); } }); } function formatModuleListItem(item){ var fItem = "&lt;li class='wrap'&gt;&lt;a href='#' onclick='setTheModule('http://" + item.link +"')'&gt;"+ item.name +"&lt;/p&gt;&lt;/li&gt;"; return fItem; } I really hope somebody can help me :)
favorite count: 0

http://stackoverflow.com/a/28969785
accepted answer of: http://stackoverflow.com/q/28969586
type: Answer
score: 2
upvote count: 2
has body: You need to loop through every property of the data object and select corresponding input element, then set its value: for (var key in data) { document.getElementById(key).value = data[key]; } The data is the object you called "JSON array".
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28969586
has comment: http://stackoverflow.com/comment/46191365

http://stackoverflow.com/comment/46255591
type: Comment
type: QuestionComment
has text: @TBasak make necessary changes in markup, your problem will resolve. i.e : http://codepen.io/vilaskumkar/pen/xbyXeW
comment on: http://stackoverflow.com/q/29004403
score: 0

http://stackoverflow.com/q/29014483
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/46273791
has answer: http://stackoverflow.com/a/29014760
accepted answer: http://stackoverflow.com/a/29014760
tagged with: css
has comment: http://stackoverflow.com/comment/46274127
type: AnsweredQuestion
has title: How can I make a button have a :active state for 1 second?
has body: I have this code: document.getElementById("aButton").click(); Is there any way at all that I can make this button maintain an active state for one second. The code works but there's no feedback to suggest the button was clicked. Note that I am not using JQuery.
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46274814
has comment: http://stackoverflow.com/comment/46274056

http://stackoverflow.com/comment/46179450
has text: @Lix Oh. I have tried to accomplish this using PHP but didn't work out so well so I resorted to jQuery. I did a search for removing part of a URL but couldn't find much pertaining to removing before an anchor, maybe I didn't search the right terms. Thanks for the help
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28963645
type: QuestionComment

http://stackoverflow.com/comment/81589045
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28983668
has text: Added info about using `async/await` in ES2017.

http://stackoverflow.com/comment/46074987
type: Comment
comment on: http://stackoverflow.com/q/28907809
score: 0
has text: You need to access the input's value inside your function. It's setting the variable when the page loads before you've typed anything.
type: QuestionComment

http://stackoverflow.com/a/29052700
score: 2
has comment: http://stackoverflow.com/comment/46343224
has comment: http://stackoverflow.com/comment/46343078
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29052630
type: Answer
upvote count: 2
has body: there is a question similar to this one here that answers your question on how to highlight text: Simple JavaScript Animation for 1 Second to Highlight Text? HTML5 is good for audio: http://www.w3schools.com/html/html5_audio.asp These resources will hopefully get you on the right track!
answers question: http://stackoverflow.com/q/29052630

http://stackoverflow.com/comment/46355069
has text: Can I not set my variable in a function and then use it elsewhere in my code?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29059052
type: AnswerComment

http://stackoverflow.com/comment/46332850
type: Comment
comment on: http://stackoverflow.com/q/29046667
has text: If you just want to bind a function with arguments to an onclick it can be done like: `onclick=yadcf.exFilterColum.bind(this, oTable, 4, 'Tag1');`
score: 0
type: QuestionComment

http://stackoverflow.com/a/28925260
downvote count: 1
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28924740
upvote count: 2
has body: !!x is commonly used as a shortcut for Boolean(x). I just ran a little test and the double negation has exactly zero performance cost. Even when the assigned value is not a constant and even when it is not a Boolean to begin with. Boolean conversion is so simple that it's basically free.

http://stackoverflow.com/comment/46216985
comment on: http://stackoverflow.com/a/28983868
score: 0
type: Comment
has text: @GaneshSalunkhe : if you see I have 3 labels and 3 buttons. If i click on 1st button, then the Abcd1 label should get delete. This is my requirement.
type: AnswerComment

http://stackoverflow.com/q/28912250
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28912319
answer count: 3
has answer: http://stackoverflow.com/a/28912297
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46083531
possible better answer: http://stackoverflow.com/a/28912268
tagged with: css
has answer: http://stackoverflow.com/a/28912268
upvote count: 2
tagged with: php
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28912319
has title: How to print HTML/PHP page without including the NAVIGATION TAB contents, FOOTER, and head part
has body: How to print HTML/PHP page without including the NAVIGATION TAB contents, FOOTER, and head part. I'm using plain HTML. I don't have CSS applied on it because of the purpose of printing... I actually am using these codes: or Print for printing... So in my page I have a link that says "Back" its a link where I have to back to the page where I was before going to this print page. When I am going to print, CTRL+P, the BACK link is included on printing. How can I hide it when printing?
type: Question
downvote count: 0

http://stackoverflow.com/comment/46228955
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28990268
has text: The jQuery you provided works given the markup you posted http://jsfiddle.net/21xfg8b0/

http://stackoverflow.com/comment/46171413
score: 1
has text: I did that. but list remains undefined.
comment on: http://stackoverflow.com/a/28959303
type: Comment
type: AnswerComment

http://stackoverflow.com/a/29026723
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29019707
type: Answer
answers question: http://stackoverflow.com/q/29019707
upvote count: 3
score: 3
has body: Write your own validator and set required=false, so something like: &lt;input data-dojo-type="dijit/form/ValidationTextBox" name="email" data-dojo-props="required: false, validator: function(text){ if (!text){ return true; } return dojox.validate.isEmailAddress(text); }, invalidMessage: 'Invalid email'" /&gt;

http://stackoverflow.com/q/29009022
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46263670
type: UnansweredQuestion
downvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/46263474
score: -2
has comment: http://stackoverflow.com/comment/46263489
has comment: http://stackoverflow.com/comment/46263517
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46263572
has comment: http://stackoverflow.com/comment/46263790
has comment: http://stackoverflow.com/comment/46263338
has body: I have a json array [ {Age: "01-10 Days", EventName: "Invoice AP Review", Value: 1, ActiveInvoices: []} ,{Age: "01-10 Days", EventName: "Invoice Distribution", Value: 5, ActiveInvoices: []} ,{Age: "01-10 Days", EventName: "Invoice Pay Pending", Value: 2, ActiveInvoices: []} ,{Age: "10-20 Days", EventName: "Invoice AP Review", Value: 1, ActiveInvoices: []} ,{Age: "10-20 Days", EventName: "Invoice Approval", Value: 2, ActiveInvoices: []} ,{Age: "10-20 Days", EventName: "Invoice Distribution", Value: 11, ActiveInvoices: []} ,{Age: "10-20 Days", EventName: "Invoice Paid", Value: 1, ActiveInvoices: []} ,{Age: "10-20 Days", EventName: "Invoice Pay Pending", Value: 2, ActiveInvoices: []} ] Please help me to sort this into array below in javascript. EventName field should come respectively for Age fields like 01-10 Days and 10-20 Days. I made and try on this jsfiddle.. please check. http://jsfiddle.net/h829p07n/1/ // Required Output [ {Age: "01-10 Days", EventName: "Invoice AP Review", Value: 1, ActiveInvoices: []} ,{Age: "01-10 Days", EventName: "Invoice Distribution", Value: 5, ActiveInvoices: []} ,{Age: "01-10 Days", EventName: "Invoice Pay Pending", Value: 2, ActiveInvoices: []} ,{Age: "10-20 Days", EventName: "Invoice AP Review", Value: 1, ActiveInvoices: []} ,{Age: "10-20 Days", EventName: "Invoice Distribution", Value: 11, ActiveInvoices: []} ,{Age: "10-20 Days", EventName: "Invoice Pay Pending", Value: 2, ActiveInvoices: []} ,{Age: "10-20 Days", EventName: "Invoice Approval", Value: 2, ActiveInvoices: []} ,{Age: "10-20 Days", EventName: "Invoice Paid", Value: 1, ActiveInvoices: []} ] Thanks in advance
has answer: http://stackoverflow.com/a/29009434
has title: Sort one Part of json array respectively to other part of same array
has comment: http://stackoverflow.com/comment/46263285
upvote count: 0
tagged with: arrays

http://stackoverflow.com/comment/46159726
score: 0
has text: I try it and all html is escaped, I would escape only insecure labels, such as
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28952898

http://stackoverflow.com/a/28917250
upvote count: 2
answers question: http://stackoverflow.com/q/28917090
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28917090
has comment: http://stackoverflow.com/comment/46092239
type: Answer
has body: change return def.promise(); to return def.promise; example : function deferredTimer(success) { var deferred = $q.defer(); $timeout(function() { if (success) { deferred.resolve({ message: "This is great!" }); } else { deferred.reject({ message: "Really bad" }); } }, 1000); return deferred.promise; }
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/46092378

http://stackoverflow.com/a/29056433
has body: I'm sure there are many ways and approaches to this. I can tell you what worked for me, a method I've adopted from pluralsight. Let your express routes all serve up the same index.ejs file: app.get('/', function(req, res, next) { res.render('index.ejs',{ page: 'home' }); }); app.get('/about', function(req, res, next) { res.render('index.ejs',{ page: 'about' }); }); app.get('/about/:id', function(req, res, next) { res.render('index.ejs',{ page: 'about' }); }); My index.ejs is stripped down for the most part with the navigation ng-view and footer. My express routes handle all of the server logic on http requests: router.get('/abo', aboutController.list); router.post('/abo', aboutController.create); router.route('/abo/:_id') .get(function(req, res) { About.findById(req.params._id, function(err, result) { if (err) res.send(err); res.json(result); }); }) .put(function(req, res) { About.findById(req.params._id, function(err, abo) { if (err) res.send(err); abo.title = req.body.title; // update the items info abo.shortname = req.body.shortname; abo.contents = req.body.contents; // save the items abo.save(function(err) { if (err) res.send(err); res.json({ message: 'About content updated!' }); }); }); }) .delete(function(req, res) { About.remove({ _id: req.params._id }, function(err, service) { if (err) res.send(err); res.json({ message: 'Successfully deleted' }); }); }); Angular matches the express url routes: .when('/', { templateUrl: 'templates/home.html', controller:'homeController' }) .when('/about/:id', { templateUrl: 'templates/template.html', controller: 'refactoredController' }) I'm also using: $locationProvider.html5Mode(true); Which allows for clean urls without the # My angular controllers talk to the angular service I have set up for http calls, which pass the data along to the backend(express), where the routes take over. function getByID(shortname, api) { return $http({ method: 'GET', url: '/api/' + api, shortname: shortname }) .then(getVolunteerByIDSuccess) .c…
answers question: http://stackoverflow.com/q/29056318
downvote count: 0
type: Answer
upvote count: 2
score: 2

http://stackoverflow.com/q/29012590
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46270644
has answer: http://stackoverflow.com/a/29013004
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/46270475
type: Question
has body: I have an element, which has its css style controlled by javascript, simply by adding/removing classes. For example, I have a hide class, which I apply to an element when I want it to hide, and when the element is hidden the page restructures as if the content was never there (collapse). This is great. I now want the item to fade out first, and then collapse but I'm lost. My effort is document.getElementById("clicky").addEventListener("click", changeMe); function changeMe() { var ele = document.getElementById("item"); ele.className= "hide"; } #clicky{cursor:pointer;} .hide { animation: fadeout 1s ; -webkit-animation: fadeout 1s ; /* Chrome, Safari, Opera */ animation-fill-mode: forwards; -webkit-animation-fill-mode: forwards; } /* Chrome, Safari, Opera */ @-webkit-keyframes fadeout { from { display:block; visibility:visible; opacity: 1;} to { display:none; visibility:hidden; opacity:0;} } /* Standard syntax */ @keyframes fadeout { from { display:block; visibility:visible; opacity: 1;} to { display:none; visibility:hidden; opacity:0;} } Click me I remaine! I should go bye byes but also collapse so the page can re-organise when I disapear!!!!! I should stay forever but move physically up the page when the line above disappears!
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/98055801
has answer: http://stackoverflow.com/a/29012951
tagged with: css
possible better answer: http://stackoverflow.com/a/29012853
has answer: http://stackoverflow.com/a/29012853
upvote count: 1
has comment: http://stackoverflow.com/comment/46270681
has answer: http://stackoverflow.com/a/29013044
has comment: http://stackoverflow.com/comment/46271146
has comment: http://stackoverflow.com/comment/46270330
accepted answer: http://stackoverflow.com/a/29012951
tagged with: javascript
has title: How to make CSS fade out but the HTML to collapse
answer count: 4

http://stackoverflow.com/a/29013004
score: 1
has body: Instead of messing with the height, I would just set the display to none after the animation is finished. document.getElementById("clicky").addEventListener("click", changeMe); function changeMe() { var ele = document.getElementById("item"); ele.className= "hide"; setTimeout(function() { ele.style.display = 'none'; }, 1000); } #clicky{cursor:pointer;} .hide { animation: fadeout 1s ; -webkit-animation: fadeout 1s ; /* Chrome, Safari, Opera */ animation-fill-mode: forwards; -webkit-animation-fill-mode: forwards; } /* Chrome, Safari, Opera */ @-webkit-keyframes fadeout { from { display:block; visibility:visible; opacity: 1;} to { display:none; visibility:hidden; opacity:0;} } /* Standard syntax */ @keyframes fadeout { from { display:block; visibility:visible; opacity: 1;} to { display:none; visibility:hidden; opacity:0;} } Click me I remaine! I should go bye byes but also collapse so the page can re-organise when I disapear!!!!! I should stay forever but move physically up the page when the line above disappears!
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29012590
downvote count: 0

http://stackoverflow.com/a/29055583
accepted answer of: http://stackoverflow.com/q/29055517
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29055517
has body: That's correct watcher's behavior. Adding if (angular.equals(newValue, oldValue)) { return; } inside callback will solve your issue.

http://stackoverflow.com/comment/46315814
type: Comment
has text: All the tutorials I find are on creating custom HTML5 video controls. That's fine and most have been helpful but I haven't been able to find anything to show me how to initiate default controls
comment on: http://stackoverflow.com/q/29037383
score: 0
type: QuestionComment

http://stackoverflow.com/q/28935801
has answer: http://stackoverflow.com/a/28935935
favorite count: 0
has comment: http://stackoverflow.com/comment/46127640
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28936034
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28936530
has answer: http://stackoverflow.com/a/28936422
type: Question
tagged with: arrays
has comment: http://stackoverflow.com/comment/46126976
tagged with: javascript
has title: Loop through Javascript Array
has comment: http://stackoverflow.com/comment/46127201
has comment: http://stackoverflow.com/comment/46126996
score: 0
tagged with: multidimensional-array
tagged with: http://stackoverflow.com/tag/html
has body: I have the following array... var structure = [ [icon, "Section 1 Name", [icon, "Item 1.1"], [icon, "Item 1.2"] ], [icon, "Section 2 Name", [icon, "Item 2.1"], [icon, "Item 2.2"] ], [icon, "Section 3 Name", [icon, "Item 3.1"], [icon, "Item 3.2"] ] ]; And I would like to loop through it to populate my HTML structure in the following method... Section 1 Name Menu Item 1.1 Menu Item 1.2 Section 2 Name Menu Item 2.1 Menu Item 2.2 Section 3 Name Menu Item 3.1 Menu Item 3.2 I have been trying to find advice online about how to achieve this but most of the advice I have been able to find is more suited to multi-dimensional arrays which are used to show a data grid type of layout rather than heading and sub item structures. Thanks
has comment: http://stackoverflow.com/comment/46127134
answer count: 4

http://stackoverflow.com/comment/46258807
type: QuestionComment
has text: You haven't fully explained the problem? Where is the code showing you calling session variables?
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29006462

http://stackoverflow.com/a/42595284
type: Answer
upvote count: 35
has body: If using ES2016 you can use async and await and do something like: (async () =&gt; { const data = await fetch(url) myFunc(data) }()) If using ES2015 you can use Generators. If you don't like the syntax you can abstract it away using an async utility function as explained here. If using ES5 you'll probably want a library like Bluebird to give you more control. Finally, if your runtime supports ES2015 already execution order may be preserved with parallelism using Fetch Injection.
score: 21
has comment: http://stackoverflow.com/comment/86934688
has comment: http://stackoverflow.com/comment/136550537
downvote count: 14
has comment: http://stackoverflow.com/comment/72322254
has comment: http://stackoverflow.com/comment/72339962
answers question: http://stackoverflow.com/q/28921127

ajax
tags question: http://stackoverflow.com/q/28980278
tags question: http://stackoverflow.com/q/28908607
tags question: http://stackoverflow.com/q/28989225
tags question: http://stackoverflow.com/q/28956629
tags question: http://stackoverflow.com/q/28966644
tags question: http://stackoverflow.com/q/29040803
tags question: http://stackoverflow.com/q/29044227
tags question: http://stackoverflow.com/q/29037740
tags question: http://stackoverflow.com/q/29045889
tags question: http://stackoverflow.com/q/28943757
tags question: http://stackoverflow.com/q/29037184
tags question: http://stackoverflow.com/q/29010354
tags question: http://stackoverflow.com/q/28910692
tags question: http://stackoverflow.com/q/29005084
tags question: http://stackoverflow.com/q/28999697
tags question: http://stackoverflow.com/q/28949048
tags question: http://stackoverflow.com/q/28972366
tags question: http://stackoverflow.com/q/28954106
tags question: http://stackoverflow.com/q/29039242
tags question: http://stackoverflow.com/q/28942848
tags question: http://stackoverflow.com/q/28942343
tags question: http://stackoverflow.com/q/28953088
tags question: http://stackoverflow.com/q/28986767
tags question: http://stackoverflow.com/q/29006221
tags question: http://stackoverflow.com/q/29025677
tags question: http://stackoverflow.com/q/29035717
tags question: http://stackoverflow.com/q/29023861
tags question: http://stackoverflow.com/q/28978609
tags question: http://stackoverflow.com/q/28941623
tags question: http://stackoverflow.com/q/28946004
tags question: http://stackoverflow.com/q/28925394
tags question: http://stackoverflow.com/q/28953741
tags question: http://stackoverflow.com/q/28977996
tags question: http://stackoverflow.com/q/29015391
type: Tag
tags question: http://stackoverflow.com/q/29014974
tags question: http://stackoverflow.com/q/29013880
tags question: http://stackoverflow.com/q/28976760
tags question: http://stackoverflow.com/q/29058598
tags question: http://stackoverflow.com/q/29055425
tags question: http://stackoverflow.com/q/28962721
tags question: http://stackoverflow.com/q/28991119
tags question: http://stackoverflow.com/q/28911335
tags question: http://stackoverflow.com/q/29053229
tags question: http://stackoverflow.com/q/28941857
tags question: http://stackoverflow.com/q/28908342
tags question: http://stackoverflow.com/q/28988082
tags question: http://stackoverflow.com/q/28919036
tags question: http://stackoverflow.com/q/29003334
tags question: http://stackoverflow.com/q/28974095
tags question: http://stackoverflow.com/q/28929559
tags question: http://stackoverflow.com/q/29062116
tags question: http://stackoverflow.com/q/29047318
tags question: http://stackoverflow.com/q/28972684
tags question: http://stackoverflow.com/q/29009532
tags question: http://stackoverflow.com/q/28929609
tags question: http://stackoverflow.com/q/29037658
tags question: http://stackoverflow.com/q/28914013
tags question: http://stackoverflow.com/q/28994641
tags question: http://stackoverflow.com/q/29047659
tags question: http://stackoverflow.com/q/29029190
tags question: http://stackoverflow.com/q/29053773
tags question: http://stackoverflow.com/q/29056336
tags question: http://stackoverflow.com/q/28916918
tags question: http://stackoverflow.com/q/28987300
tags question: http://stackoverflow.com/q/29056430
tags question: http://stackoverflow.com/q/28918760
tags question: http://stackoverflow.com/q/28917058
tags question: http://stackoverflow.com/q/28912005
tags question: http://stackoverflow.com/q/28970541
tags question: http://stackoverflow.com/q/28992422
tags question: http://stackoverflow.com/q/28962552
tags question: http://stackoverflow.com/q/28908100
tags question: http://stackoverflow.com/q/28994764
tags question: http://stackoverflow.com/q/28963301
tags question: http://stackoverflow.com/q/28955547
tags question: http://stackoverflow.com/q/29059424
tags question: http://stackoverflow.com/q/29019301
tags question: http://stackoverflow.com/q/28985363
tags question: http://stackoverflow.com/q/29024517

http://stackoverflow.com/q/28968228
score: -3
downvote count: 4
has answer: http://stackoverflow.com/a/28968882
has comment: http://stackoverflow.com/comment/46190604
type: Question
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28968290
has title: How to replace [ ] in an array with a var result in JavaScript
upvote count: 1
favorite count: 0
has body: How do I get the var number = 33; to be placed into [] in {helloBean.day1WeatherType[]} before it is placed onto my page? var number = 33; document.write("&lt;h2&gt;&lt;h:outputText value=\"#{helloBean.day1WeatherTyp[number]}\" /&gt;&lt;/h2&gt;"); I don't want to push the number into the array; I want to read that place in the array so array[33], but I need to be able to change it and not have it as a set number which.
type: UnansweredQuestion

ruby-on-rails
tags question: http://stackoverflow.com/q/29021548
type: Tag
tags question: http://stackoverflow.com/q/28980310
tags question: http://stackoverflow.com/q/29038495
tags question: http://stackoverflow.com/q/29017809
tags question: http://stackoverflow.com/q/28968231
tags question: http://stackoverflow.com/q/29017337
tags question: http://stackoverflow.com/q/29003364
tags question: http://stackoverflow.com/q/29018447
tags question: http://stackoverflow.com/q/28923323
tags question: http://stackoverflow.com/q/28958373
tags question: http://stackoverflow.com/q/28982418
tags question: http://stackoverflow.com/q/28960903
tags question: http://stackoverflow.com/q/28915321
tags question: http://stackoverflow.com/q/29020749
tags question: http://stackoverflow.com/q/29000089
tags question: http://stackoverflow.com/q/29041223
tags question: http://stackoverflow.com/q/29055015
tags question: http://stackoverflow.com/q/29034208
tags question: http://stackoverflow.com/q/28952760
tags question: http://stackoverflow.com/q/29033548
tags question: http://stackoverflow.com/q/29043431
tags question: http://stackoverflow.com/q/29000464
tags question: http://stackoverflow.com/q/28993043
tags question: http://stackoverflow.com/q/28947428
tags question: http://stackoverflow.com/q/28917926
tags question: http://stackoverflow.com/q/29037689
tags question: http://stackoverflow.com/q/29012205
tags question: http://stackoverflow.com/q/28923808
tag name: ruby-on-rails
tags question: http://stackoverflow.com/q/29026660
tags question: http://stackoverflow.com/q/29058365
tags question: http://stackoverflow.com/q/29057730
tags question: http://stackoverflow.com/q/28946204
tags question: http://stackoverflow.com/q/29045336
tags question: http://stackoverflow.com/q/28971227
tags question: http://stackoverflow.com/q/28968827
tags question: http://stackoverflow.com/q/28997786
tags question: http://stackoverflow.com/q/29013156
tags question: http://stackoverflow.com/q/28972935
tags question: http://stackoverflow.com/q/28972436
tags question: http://stackoverflow.com/q/29047737
tags question: http://stackoverflow.com/q/29023544
tags question: http://stackoverflow.com/q/29046146
tags question: http://stackoverflow.com/q/28998570
tags question: http://stackoverflow.com/q/28907989
tags question: http://stackoverflow.com/q/28997270
tags question: http://stackoverflow.com/q/28917169
tags question: http://stackoverflow.com/q/28949981
tags question: http://stackoverflow.com/q/29024097
tags question: http://stackoverflow.com/q/28975455
tags question: http://stackoverflow.com/q/28982587
tags question: http://stackoverflow.com/q/28956940
tags question: http://stackoverflow.com/q/28975410
tags question: http://stackoverflow.com/q/28999697
tags question: http://stackoverflow.com/q/28953932

http://stackoverflow.com/comment/46251057
score: 0
type: Comment
type: QuestionComment
has text: it could be that you are passing a value of undefined to a callback... or you are accidentally overriding an internal function... without a recreated issue we won't be able to offer much help
comment on: http://stackoverflow.com/q/29001647

http://stackoverflow.com/comment/46303015
type: Comment
type: QuestionComment
has text: @markpsmith, no, if he will use ajax, it is not mandatory...
comment on: http://stackoverflow.com/q/29030944
score: 0

http://stackoverflow.com/q/28938183
tagged with: jsp
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46132760
has comment: http://stackoverflow.com/comment/46138140
has comment: http://stackoverflow.com/comment/46132694
type: Question
score: 0
has comment: http://stackoverflow.com/comment/46131467
tagged with: internet-explorer
has title: IE browser when trying to save and close a page,
has comment: http://stackoverflow.com/comment/46141190
has comment: http://stackoverflow.com/comment/46136671
has body: I have a function in my JSP file: function saveAndClose() { document.myForm.action=getContextPath()+'/MyController.do?method=save'; document.myForm.submit(); window.parent.document.location.reload(); } When I test on Firefox, all is OK, but when I test on IE, nothing is saved! The action isn't reached in IE! When I comment this line: window.parent.document.location.reload(); I reach the action, and my data are saved. Really I don't know why!
answer count: 0

http://stackoverflow.com/comment/46302437
type: QuestionComment
comment on: http://stackoverflow.com/q/29030138
has text: HI Jordi, can you shed more light on what you mean by this? How can I send an ajax request when page loads without actually pressing on a button or acting on some input component.
score: 0
type: Comment

http://stackoverflow.com/comment/46209503
comment on: http://stackoverflow.com/q/28979026
type: Comment
has text: Using scriptlet is not a good practice, so I want to avoid it
score: 1
type: QuestionComment

http://stackoverflow.com/comment/46249284
score: 0
type: Comment
type: AnswerComment
has text: I cannot see a problem with your code. But maybe this will help: https://jsfiddle.net/rrun9ftz/ I've created an example. When you click "upload" it adds a progress bar to the page, and then starts a simulated upload process that uses the progress handler to update the progress bar. You can click multiple times and watch multiple bars being updated independently.
comment on: http://stackoverflow.com/a/28999114

http://stackoverflow.com/comment/46187902
has text: This checks if the focus is on the window of the site, so if the user has two screens and is not actively browsing the current screen the window should go inactive -> I didnt try it, so if you do please confirm
comment on: http://stackoverflow.com/a/28948365
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28920681
has body: I really like the way Stack Overflow has done their dropdown menus on the top. Notice how you must click in order for the dropdown to trigger, but you still must hover to get the dropdown. There is also what seems to be groups - once you click, hover will activate the menus shown in the picture. It is hard to explain, but if you play around for a minute you'll see what I mean. Also, it is important that the last hovered menu will show until a user clicks off again. Here is what I have so far; note that I almost have the same functionality, except for the last menu hovered doesn't stay dropped (it closes on mouseout when it shouldn't until off-click) and the toggle functionality is sketchy: $(document).ready(function() { var depressed = false; $('.menu').click(function() { depressed = true; $('.menu').toggleClass('active'); }); $('.menu').hover(function() { if (depressed) { $('.menu').toggleClass('active'); } }); }); ul { margin: 0; padding: 0; } ul li { display: inline-block; padding: 10px 20px; background: #333; color: #eee; } ul li.active:hover ul { display: block; } ul li ul { display: none; position: absolute; border: 2px solid #555; } ul li ul li { display: block; } button 1 sub button 1 sub button 2 button 2 sub button 1 sub button 2 button 3 sub button 1 sub button 2 My JS is not cuttin git. So, what is the best way to go about this?
has answer: http://stackoverflow.com/a/28921276
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28920943
type: AnsweredQuestion
upvote count: 1
type: Question
has title: How to Make a Menu Like Stack Overflow's
score: 1
accepted answer: http://stackoverflow.com/a/28921276
possible better answer: http://stackoverflow.com/a/28920943
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: drop-down-menu
tagged with: jquery

master-pages
tags question: http://stackoverflow.com/q/28973749
tags question: http://stackoverflow.com/q/29044686
type: Tag
tag name: master-pages

http://stackoverflow.com/q/28975549
tagged with: javascript
tagged with: jquery
has body: So I took this code from this website. I don't want to have all the fields being required. Like, let's say, full middle name. I want that field to be optional (hence, not affecting the function for checking which fields have error). How can I do it? $(function() { /* number of fieldsets */ var fieldsetCount = $('#formElem').children().length; /* current position of fieldset / navigation link */ var current = 1; /* sum and save the widths of each one of the fieldsets set the final sum as the total width of the steps element */ var stepsWidth = 0; var widths = new Array(); $('#steps .step').each(function(i){ var $step = $(this); widths[i] = stepsWidth; stepsWidth += $step.width(); }); $('#steps').width(stepsWidth); /* to avoid problems in IE, focus the first input of the form */ $('#formElem').children(':first').find(':input:first').focus(); /* show the navigation bar */ $('#navigation').show(); /* when clicking on a navigation link the form slides to the corresponding fieldset */ $('#navigation a').bind('click',function(e){ var $this = $(this); var prev = current; $this.closest('ul').find('li').removeClass('selected'); $this.parent().addClass('selected'); /* we store the position of the link in the current variable */ current = $this.parent().index() + 1; /* animate / slide to the next or to the corresponding fieldset. The order of the links in the navigation is the order of the fieldsets. Also, after sliding, we trigger the focus on the first input element of the new fieldset If we clicked on the last link (confirmation), then we validate all the fieldsets, otherwise we validate the previous one before the form slided */ $('#steps').stop().animate({ marginLeft: '-' + widths[current-1] + 'px' },500,function(){ if(current == fieldsetCount) validateSteps(); else validateStep(prev); $('#formElem').children(':nth-child('+ parseInt(current) +')').find(':input:first').focus(); }); e.preventDefault(); }); /* clicking on the tab (on the last input of each fieldset), makes th…
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/46202220
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28975718
accepted answer: http://stackoverflow.com/a/28975718
has title: How can I make a field NOT required in this code?
type: Question

http://stackoverflow.com/comment/46334848
type: Comment
type: QuestionComment
has text: Welcome to SO! In general, get right to the problem, don't open with a couple of paragraphs about how you're new to things and have been searching for an answer without finding out. Also: Use stack snippets for **runnable** code; otherwise, just use code formatting. I've edited the question to demonstrate.
comment on: http://stackoverflow.com/q/29048201
score: 0

http://stackoverflow.com/comment/46330179
comment on: http://stackoverflow.com/q/29002278
type: QuestionComment
has text: @New Dev.I wanted to change the model ie., get the model value of the selected check box.But I managed to get the values by using the ng-change function
score: 0
type: Comment

http://stackoverflow.com/q/28940540
has answer: http://stackoverflow.com/a/28954856
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46172634
linked to: http://stackoverflow.com/q/28849296
type: Question
tagged with: c#
tagged with: asp.net-mvc
accepted answer: http://stackoverflow.com/a/28954856
tagged with: javascript
tagged with: jquery
score: 0
linked to: http://stackoverflow.com/q/28019793
has body: I have a table:. <% using(Html.BeginForm("View2","Order")) { %> ProductId Productname Quantity UnitPrice <%for (int i = 0; i < Model.NorthOrderDetails.Count; i++) {%> <%: Html.HiddenFor(m => m.NorthOrderDetails[i].ProductID) %> <%: Html.HiddenFor(m => m.NorthOrderDetails[i].ProductName) %> <%: Html.DisplayFor(m => m.NorthOrderDetails[i].ProductID) %> <%: Html.DisplayFor(m => m.NorthOrderDetails[i].ProductName) %> <input type="hidden" name="NorthOrderDetails.Index" value="<%: i %>" /> <%: Html.TextBoxFor(m => m.NorthOrderDetails[i].Quantity) %> <%: Html.TextBoxFor(m => m.NorthOrderDetails[i].UnitPrice) %> <button type="button" class="delete" data-id="<%:Model.NorthOrderDetails[i].ProductID %>">Delete <input type="hidden" name="<%:Model.NorthOrderDetails[i].ProductName %>" value="<%: Model.NorthOrderDetails[i].Quantity %>" /> <% } %> <% } %> And the script call this method in the Controller [HttpPost] public JsonResult Delete(int ID) { NorthOrder forOrderDetail = (NorthOrder)Session["Order"]; forOrderDetail.NorthOrderDetails.RemoveAll(z => z.ProductID == ID); Session["Order"] = forOrderDetail; return Json(null); } When I click the add button I'm calling this method in Controller: [HttpPost] public ActionResult View2(NorthOrder q, string button) { string strDDLValue = Request.Form["sda"].ToString(); int drop = Convert.ToInt32(strDDLValue); NorthOrder forOrderDetail = (NorthOrder)Session["Order"]; if (button == "Add") { NorthwindEntities n = new NorthwindEntities(); string strDDLValuse = n.Products.FirstOrDefault(_ => _.ProductID == drop).ProductName; NorthOrderDetailscs orddetailForSession = new NorthOrderDetailscs(); orddetailForSession.ProductName = strDDLValuse; orddetailForSession.Quantity = 0; orddetailForSession.UnitPrice = 0; orddetailForSession.ProductID = drop; forOrderDetail.NorthOrderDetails.Add(orddetailForSession); Session["Order"] = forOrderDetail; } return View(forOrderDetail); // } and problem concludes displaying data in new row in textboxes from nonde…
has title: Displaying values in row of table from existing item in new row
answer count: 1
linked to: http://stackoverflow.com/q/28886230
tagged with: asp.net
has comment: http://stackoverflow.com/comment/46142391

http://stackoverflow.com/comment/46219773
comment on: http://stackoverflow.com/q/28985363
score: 0
type: QuestionComment
type: Comment
has text: what do you mean by readable format ?

http://stackoverflow.com/comment/81280232
type: QuestionComment
score: 1
has text: Take a look at this article entitled [How to Find a County By Using a ZIP Code](https://smartystreets.com/articles/county-by-zip-code).
comment on: http://stackoverflow.com/q/28981130
type: Comment

http://stackoverflow.com/comment/46247527
type: Comment
type: QuestionComment
has text: if you're just making an application to interact with on the command line, I really don't think you want the interaction you're describing. If you're trying to make a terminal-based but more complicated interaction than tty, you really need to look into an existing framework to support this, as dave says
comment on: http://stackoverflow.com/q/28999738
score: 0

http://stackoverflow.com/q/28907570
tagged with: android
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28947146
score: 0
has comment: http://stackoverflow.com/comment/46074909
has body: I'm building this website with Bootstrap in which there is a drop down menu under "Projects" that is working fine on desktop PCs but on mobile devices it goes like this: the buttons opens at the touch and so does the menu "Projects" but then when tapping on one of the submenu items it does nothing and only a second tap will eventually open the desired submenu item. That means, you have to click twice to open a submenu link which is annoying. Here is the HTML code: PROJECTS NAPOLI PORTRAITS BIO CONTACT BLABLABLA Anyone could help here?
type: Question
has comment: http://stackoverflow.com/comment/46100834
has comment: http://stackoverflow.com/comment/46106010
tagged with: javascript
has title: Drop down works strange on mobile device
has comment: http://stackoverflow.com/comment/46085950
tagged with: touchscreen
has answer: http://stackoverflow.com/a/28947146
answer count: 1
has comment: http://stackoverflow.com/comment/46148321
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/46248348
has text: In fact it is not correct for my case $('#parent-form1') as an id because I'm calling the parent forms with the class name like $('.parent-form1'),if you read above I explained it before, that's why I'm using the concatenated dot(.), so it's in fact working good. I don't need preventDefault(); for the second submit function because it's already returning false for the same effect. thanks for the fast answer anyway.
type: Comment
comment on: http://stackoverflow.com/a/29000258
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46218087
type: Comment
type: QuestionComment
has text: since you made a comment in the answer to that post which included an error, perhaps you might add the error to your question?
comment on: http://stackoverflow.com/q/28984640
score: 0

http://stackoverflow.com/comment/46231060
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28991346
has text: @peterdotjs Sorry, what I really meant is "It's not supported today and it should never ever be supported". That is screaming "go ahead and be a lousy programmer", not really best-practices material.

http://stackoverflow.com/q/29004513
has title: Div does not refresh when last character is deleted from input
has comment: http://stackoverflow.com/comment/46255758
accepted answer: http://stackoverflow.com/a/29004751
possible better answer: http://stackoverflow.com/a/29004670
has body: I'm currently making a search function using a onkeyup="Search();" like this: &lt;input type="text" id="IDsearch" onkeyup="Search()" autofocus&gt; The function for it is: &lt;script type="text/javascript"&gt; function Search() { var inputVal = $('#IDsearch').val(); $.post('searchTest.php', {postname: inputVal}, function (data) { $('#IDsearch').val(data) }); $('#divRefresh').load('searchTest.php'); } &lt;/script&gt; Yes, I am using the same file to both put the value in a php $_SESSION['value']; AND to store the new div data. That's no problem, it works, it does fine. But when I delete my last character from my search box, I need to press backspace twice in order for my div to update. Say I had a textbox with "a" in it. I will press backspace to update the a, and nothing will happen. Once I press backspace again, my div will update and post all the original values again. Am I missing something obvious? It's supposed to work the same way http://www.datatables.net/ does. I have asked a question about this program before, but not about this issue, I hope it's not a problem.
has answer: http://stackoverflow.com/a/29004670
tagged with: javascript
tagged with: jquery
type: Question
has answer: http://stackoverflow.com/a/29004751
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 0
answer count: 2
tagged with: php

http://stackoverflow.com/comment/46276000
score: 0
type: QuestionComment
has text: Can you not simply assign it twice after your JSON call? In your controller: `$scope.data=response; $scope.data2=response;` and second ng-repeat would be `foo in data2` - not ideal but an option?
type: Comment
comment on: http://stackoverflow.com/q/29015493

http://stackoverflow.com/q/28928135
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46112710
has answer: http://stackoverflow.com/a/28928519
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
tagged with: document
has comment: http://stackoverflow.com/comment/78521373
type: Question
score: 0
tagged with: mongodb
answer count: 1
tagged with: mongoose
has body: I have a JSON Object called parsedSong that I want to convert into a Mongo document using Mongoose. var newSong = new Song(parsedSong); However, this only provides me with a new document that only has an id attribute. How can I make a conversion that doesn't cut my data from parsedSong?
has comment: http://stackoverflow.com/comment/46113432
has title: How do I convert a regular JSON object into a Mongo document using Mongoose?
accepted answer: http://stackoverflow.com/a/28928519

http://stackoverflow.com/comment/46350210
has text: @Delight, yeah, MySQL is an option
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29056444

http://stackoverflow.com/q/29014644
downvote count: 1
accepted answer: http://stackoverflow.com/a/29016517
has comment: http://stackoverflow.com/comment/46276015
has answer: http://stackoverflow.com/a/29016517
tagged with: recursion
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46279207
has title: Recursive JSON Generation Function
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has body: This is going to be a bit long winded, but here goes: I am writing two separate web applications: one for generating a JSON object with a bunch of data and formatting information and another for turning that JSON object into a nice formatted HTML page for viewing. The particular issue I am having currently is with nested lists. For the viewing application, I wrote a recursive function that will parse the supplied javascript object and create the HTML for a list with an arbitrary magnitude of nested elements. function createUnorderedList(object) { var ul = $('&lt;ol&gt;'); for (var i = 0; i &lt; object.length; i++) { if (object[i].children === undefined) { ul.append($('&lt;li&gt;').text(object[i].value)); } else { ul.append( $('&lt;li&gt;').html( object[i].value + "&lt;ul&gt;" + createUnorderedList(object[i].children) + "&lt;/ul&gt;")); } } return ul.html(); } The jsfiddle for that function can be seen here: jsfiddle: Recursive HTML List Generation Now, I need to create a function for the JSON creation side of things. Having tried and failed to wrap my brain around how to do this recursively, I settled upon a more linear function, seen here: function createList( array ) { var json = { "value": [] } ; var k = 0 ; if(array[array.length-1] === "") array.pop() ; for(var i=0; i&lt;array.length; i++ ){ json.value.push( { "value": array[i] } ) ; for(var j=i+1; j&lt;array.length; j++) { if(array[j].charAt(0) === '\t') { array[j] = array[j].replace( /\t/, '' ) ; i++; if(json.value[k].children === undefined) $.extend( json.value[k], { children : [] } ) ; json.value[k].children.push( { "value": array[j] } ) ; } else { k++; j=array.length; } } } return json ; } jsfiddle: JSON List Generation. This function can only handle a nested list of one order of magnitude, which should suffice for now but is not ideal. How can I make this function capable of generating a json object with an arbitrary magnitude of nested elements? Thank you.
possible better answer: http://stackoverflow.com/a/29016254
favorite count: 0
upvote count: 3
has answer: http://stackoverflow.com/a/29016254

http://stackoverflow.com/q/29061992
type: Question
has body: I'm writing a Firebase web app (Javascript). If I write a reference to child_added like this: dataRef.child('bids').child(auction).child(lotno).on('child_added', function(data){...} "auction" and "lotno" are variables and will change as the app runs. I am writing the script to close each old reference (using OFF) whenever this happens, and then I open a new reference. My OFF looks like this: dataRef.child('bids').child(auction).child(lotno).off('child_added'); First of all, am I doing this correctly? And second, is there a more universal way I can close child_added references, to avoid the possibility of one being left open accidentally? Meaning, can I simply write Javascript that will close all child_added within 'bids'? Wondering if something like this is valid: dataRef.child('bids').off('child_added'); Is there a wildcase that would cover all children? Would that close everything, or must each specific path through child elements be written out?
tagged with: javascript
has answer: http://stackoverflow.com/a/29080658
upvote count: 1
accepted answer: http://stackoverflow.com/a/29080658
answer count: 1
has comment: http://stackoverflow.com/comment/46373837
has comment: http://stackoverflow.com/comment/46370517
favorite count: 0
has comment: http://stackoverflow.com/comment/46360643
tagged with: firebase
type: AnsweredQuestion
downvote count: 0
score: 1
has title: Removing references to child_added in Firebase data

http://stackoverflow.com/comment/46279172
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29017574
type: AnswerComment
has text: While a valid point, this should be a comment, the OP wants to know what is wrong with their code, it was very close to working

bourbon
type: Tag
tag name: bourbon
tags question: http://stackoverflow.com/q/28991650
tags question: http://stackoverflow.com/q/29035883

http://stackoverflow.com/q/28970746
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46193136
accepted answer: http://stackoverflow.com/a/28971316
answer count: 1
tagged with: windows-server-2012
has comment: http://stackoverflow.com/comment/46193086
tagged with: jquery
favorite count: 0
has title: "Member not found" - jQuery not working in MSIE but works in Chrome -
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has body: I have an MVC4 .NET web app which performs without issue/errors while debugging. I published the solution to a folder and deployed the app files to a web server (Windows Server 2012). The application loads and runs correctly however on one page where I have a jQuery autocomplete, an error is thrown while using the browser debugger in MSIE 11 and the auto complete does not work. ** There are no errors when the page is viewed in Google Chrome, nor are there errors in Visual Studio. What could be causing this? Here's the error thrown on page load in IE only member not found: Here's a larger image of the error
upvote count: 2
score: 1
has answer: http://stackoverflow.com/a/28971316
tagged with: google-chrome
downvote count: 1

http://stackoverflow.com/comment/46116646
score: 0
has text: check the [ui-view directive documentation](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-view)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28929959

http://stackoverflow.com/q/28993670
favorite count: 0
accepted answer: http://stackoverflow.com/a/28994471
tagged with: http://stackoverflow.com/tag/html
tagged with: php
score: 2
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/46235558
type: Question
has title: Change total input value according to dynamic radio input attribute values with jQuery
has answer: http://stackoverflow.com/a/28994471
tagged with: javascript
has body: Need help with adding, removing, changing the values of data-dynamic attribute of radio input elements from the total input value. Dynamic generated radio inputs &lt;input type="radio" id="valetId" name="valetId" value="0" data-dynamic="0" /&gt; &lt;input type="radio" id="valetId" name="valetId" value="1" data-dynamic="20" /&gt; &lt;input type="radio" id="valetId" name="valetId" value="2" data-dynamic="40" /&gt; and the total input is: &lt;input type="text" id="Total" name="Total" class="form-control" value="" /&gt; So far I have the jQuery script, that adds the radio input data-dynamic values to total $("input[type=radio]").click(function(event) { //alert('Button pressed with value: '+dynamicValue); $("input[type=radio]:checked").each(function() { total = Number($('#Total').val()) + $(this).data('dynamic'); }); $('#Total').val(total); }); I need help with how to remove the checked radio input data-dynamic attribute from the total, add the 2nd radio input data-dynamic attribute if checked or reset the total input value to original price if radio input data-dynamic attribute with 0 is checked. Thanks.
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/46235525
tagged with: jquery

http://stackoverflow.com/a/29000559
has comment: http://stackoverflow.com/comment/46249405
has comment: http://stackoverflow.com/comment/46251797
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46254669
has comment: http://stackoverflow.com/comment/46258414
has comment: http://stackoverflow.com/comment/46249300
has comment: http://stackoverflow.com/comment/46287351
has comment: http://stackoverflow.com/comment/46258997
has comment: http://stackoverflow.com/comment/46251600
type: Answer
answers question: http://stackoverflow.com/q/29000522
has comment: http://stackoverflow.com/comment/46374561
has comment: http://stackoverflow.com/comment/46259272
accepted answer of: http://stackoverflow.com/q/29000522
has comment: http://stackoverflow.com/comment/46249191
has comment: http://stackoverflow.com/comment/46257916
has body: Using the HTMLs onClick to call a javascript function. Also corrected the javascript and made it readable. Note I have removed the document.write and replace with the https link, if your site uses both http and https, you will need to revert back to the document.write Run script RSS Feed Widget
has comment: http://stackoverflow.com/comment/46249172
has comment: http://stackoverflow.com/comment/46249455

http://stackoverflow.com/a/29004474
upvote count: 13
has body: You might look into javaScript event delegation. There are many answers on SO (an example here) and many good articles ( here or here ). Basically the idea you had is actually a good solution. So, instead of binding - let's say - one hundred rows with their own event handlers, you bind only their common parent which will fire an event when any of its child will receive a mouse input. Roughly speaking instead of this: $('tr').on("click", function() {}); You will do this: $('table').on('click', 'tr', function() {}); This is obviously a very simplified example, but it should be enough to build a good pattern upon. As a side note, it's a very interesting thing (well, at least for me...) to inspect the event that is fired doing something like: $('table').on('click', 'tr', function(evt) { console.log(evt); }); And see how much information an event carries, and how much useful information you get out of the box with a simple click or mouse enter. VanillaJs Of course the same result can be achieved without any library. A simple implementation using Vanilla JS can be taken from David Walsh's article linked at the beginning of the answer, it goes roughly like this: // Get the element, add a click listener... document.getElementById("#myTable").addEventListener("click", function(e) { // e.target is the clicked element. // Check if it was a ... if(e.target && e.target.nodeName == "TR") { // Element has been found, do something with it } }); If you try this code though chances are that the actual target.element is the , and not the we want. This means we have to be a bit more clever and walk the DOM upwards to see if the clicked element ( ) is contained in the one we really want ( ). A rough implementation to get you started would look like this: function walk(startEl, stopEl, targetNodeName) { if (!startEl || startEl === stopEl || startEl.nodeName === 'BODY') { return false; } if (startEl.nodeName === targetNodeName) { // Found it, return the element return startEl; } // Keep o…
accepted answer of: http://stackoverflow.com/q/29004245
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29004245
type: Answer
downvote count: 0
score: 13

http://stackoverflow.com/comment/46145925
type: AnswerComment
has text: I have something like this: ` This room is currently {this.props.roomId} <SongQueue queue={this.state.queue}/> <Search addSongToQueue={this.addSongToQueue}/> ` The `this.state.queue` is changing, but my child `SongQueue` can't seem to receive it properly. This is in the `render` of my first main parent component.
score: 0
comment on: http://stackoverflow.com/a/28945173
type: Comment

http://stackoverflow.com/a/64950481
upvote count: 6
answers question: http://stackoverflow.com/q/29017379
downvote count: 0
has comment: http://stackoverflow.com/comment/130025956
type: Answer
has comment: http://stackoverflow.com/comment/126981508
has comment: http://stackoverflow.com/comment/128870847
has body: In addition to the accepted answer, we now have WAAPI which basically adds animation API to JavaScript. For example, /** * @returns {Object} */ function defaultFadeConfig() { return { easing: 'linear', iterations: 1, direction: 'normal', fill: 'forwards', delay: 0, endDelay: 0 } } /** * @param {HTMLElement} el * @param {number} durationInMs * @param {Object} config * @returns {Promise} */ async function fadeOut(el, durationInMs, config = defaultFadeConfig()) { return new Promise((resolve, reject) =&gt; { const animation = el.animate([ { opacity: '1' }, { opacity: '0', offset: 0.5 }, { opacity: '0', offset: 1 } ], {duration: durationInMs, ...config}); animation.onfinish = () =&gt; resolve(); }) } /** * @param {HTMLElement} el * @param {number} durationInMs * @param {Object} config * @returns {Promise} */ async function fadeIn(el, durationInMs, config = defaultFadeConfig()) { return new Promise((resolve) =&gt; { const animation = el.animate([ { opacity: '0' }, { opacity: '0.5', offset: 0.5 }, { opacity: '1', offset: 1 } ], {duration: durationInMs, ...config}); animation.onfinish = () =&gt; resolve(); }); } window.addEventListener('load', async ()=&gt; { const el = document.getElementById('el1'); for(const ipsum of "Neque porro quisquam est qui dolorem ipsum quia dolor \uD83D\uDE00".split(' ')) { await fadeOut(el, 1000); el.innerText = ipsum; await fadeIn(el, 2000); } }); .text-center { text-align: center; } &lt;h1 id="el1" class="text-center"&gt;...&lt;/h1&gt;
score: 6

http://stackoverflow.com/comment/46319146
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29039205
has text: My webhost has a built in editor which I use. I like it better getting it online immediatelly. Though I like Visual Studio's debugger for apsx, but I doubt that will work with pure HTML without having to copy around the source.
type: AnswerComment

http://stackoverflow.com/comment/46106496
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28914934
type: Comment
has text: I need to update the html of the template, can I do that from the directive itself?

http://stackoverflow.com/a/29022903
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29022635
accepted answer of: http://stackoverflow.com/q/29022635
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: you should make the element you click moving more left. instead of "-=10" $(this).animate({ "margin-left": "-=10" }, 500) using "-=20" $(this).animate({ "margin-left": "-=20" }, 500) I've test your code on jsfiddle. The fact the element you click is not moving showing exactly the code is working. Since you're asking the element on its left moving right 10 px (which makes itself moves right 10px) and then asking the element moving left 10 px, makes it not moving at all. but since you might not want the element on its right moves too, you should also handling those elements' margin I've modify your code like this: $('.lang').on('click', function(){ var dist = 10; console.log("here"); //.when( $.when( $(this).animate({ "margin-left": "-="+dist*2 }, 500), $(this).next().animate({ "margin-left": "+="+dist }, 500), $('.active').animate({ "margin-left": "+="+dist }, 500) ).done(function(){ console.log("done"); }); }); increasing dist if you want to move more.

http://stackoverflow.com/comment/46131773
score: 0
type: QuestionComment
type: Comment
has text: I need to zoom. so if I use a image of circle, when zooming in, the image of circle maybe become mosaic.
comment on: http://stackoverflow.com/q/28938019

http://stackoverflow.com/comment/91359649
type: AnswerComment
type: Comment
has text: Making an abstract concept concrete, people understand better.
score: 8
comment on: http://stackoverflow.com/a/41747759

http://stackoverflow.com/comment/46230963
comment on: http://stackoverflow.com/a/28991346
has text: @TIMINeutron Just saying its not "you HAVE to". It's you probably SHOULD since ES6 isn't yet supported everywhere but you can still get around that with other libraries "have to"
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46337047
comment on: http://stackoverflow.com/a/29047910
type: AnswerComment
score: 0
type: Comment
has text: I get data from `updatepost.php` , `mail.php` , updatefriend.php` ect for there particular notification. So how to send multiple url request.

http://stackoverflow.com/q/28933634
upvote count: 0
has answer: http://stackoverflow.com/a/28933647
type: Question
has body: The source code site:enter link description here var table = $(data).find("table").removeAttr("width"); I can using the table,beacause there is only one table tag :... . But how can visit a table(the table have a id) if there are two table in the html,eg: ... Thank you for thinking my question.Thank you very much.
tagged with: javascript
tagged with: jquery
downvote count: 3
has title: how can i visit and manipulate a html table by find function and its id?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion
score: -3

http://stackoverflow.com/a/28986982
answers question: http://stackoverflow.com/q/28982592
has body: // Line break: var br = "\r\n"; // Input string: var str = " title 1 " + br + " title 2 " + br ; // All rows: [ ' title 1 ', ' title 2 ', '' ] var all = str.split(br); // ...or even better: [ ' title 1 ', ' title 2 ' ] var notEmpty = str.split(br).filter(function(txt){return txt.length;});
score: 0
type: Answer

http://stackoverflow.com/a/28994697
type: Answer
answers question: http://stackoverflow.com/q/28993348
has body: Very simple one line of code to execute to show hide. Just a few lines to set up. This code is tested and works well. This is for just one menu but can easily to expand to multiple. See my other Answer for multiple menus (added after this one) Setup code is run one time when the page loads. The setup: Create an array to do the toggle. This eliminates the if else. var toggle = new Array; toggle['none'] = 'block'; toggle['block'] = 'none'; Read the "collections div into a variable. Read once, never again. var div = document.getElementById('d1'); The initialize the div so the DOM holds the display:none. Otherwise the first read will be null. div.style.display='none'; Then the showHide function function showHide(id) {div.style.display=toggle[div.style.display];} The div.style.display within the toggle array toggle[div.style.display] wil either be block or none. Which ever, toggle will return the opposite. The sames as if it were toggle['block'] which returns 'none' which get assigned to the collections div. Note: The JS code should be located just before the closing body tag . This way it will not be parsed until the HTML is all loaded. Also it is very important to use a valid DOC Type. If not the Browser has to guess and may guess wrong. Slows own page load time. The JavaScript code: Also way too much white space. This could significantly increase your transmission time. Most should be compressed as your pages should be gzipped. Menu Test THE ARDMORE COLLECTION Qalakabusha Sofa Qalakabusha Fabric Collection Hand bags Scatter Cushions Batonka Stools Tablecloths Place Mats Napkins Table Runners Art Into Design The Collections Contact Us Newsletter Note: The CDATA is to isolate the JS from HTML. Without the CDATA the JS will sometimes cause HTML errors when running the W3C HTML Markup Validator. It is a recommended best practice. The CDATA tells the Browser it is not HTML. The format is data goes here The reason it has the two slashes is comment out the CDATA tags from th…
score: 0

http://stackoverflow.com/a/28932064
answers question: http://stackoverflow.com/q/28926903
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28926903
upvote count: 1
score: 1
has body: OK, so the central limit theorem says that the average of a sufficiently large number of uniformally distributed variables will be normal. In the statistics classes I have taken, 30 is usually used as the cutoff, so you might want to increase your simulation's "sample size". However, you can find the Standard Deviation of your average as follows regardless of "sample size". The standard deviation of your uniform variable is (b-a)/sqrt(12)== noiseMax/sqrt(3). Variances add when you add variables, so the standard deviation of n the sum of n of these variables is sqrt(n*(noiseMax/sqrt(3))*(noiseMax/sqrt(3)))==noiseMax*sqrt(n/3). Dividing by n to get the average gives you a final standard deviation of noiseMax/sqrt(3*n). In your case, sigma = noiseMax * 0.12909944487.

http://stackoverflow.com/comment/46109545
score: 0
type: Comment
type: QuestionComment
has text: is there a need to use `$compile` service? Why not just to use `template` field? Here is the [link](http://plnkr.co/edit/AAT7gIE1mhLsf0us6ojp?p=preview)
comment on: http://stackoverflow.com/q/28926671

http://stackoverflow.com/comment/46148037
has text: @Xufox FF 36, Mac OS. Try to drag near by the label's text [screenshot](https://yadi.sk/i/UM1BzQ0ff8Uzu)
comment on: http://stackoverflow.com/q/28946307
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46297936
comment on: http://stackoverflow.com/a/29028094
type: AnswerComment
score: 0
type: Comment
has text: ok i got it, you want to draw HTML table using data from json ? and assign each value in its corresponding cell ?

http://stackoverflow.com/q/29048354
has comment: http://stackoverflow.com/comment/46335097
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: init
possible better answer: http://stackoverflow.com/a/29048421
favorite count: 0
has answer: http://stackoverflow.com/a/29048421
tagged with: initialization
has answer: http://stackoverflow.com/a/29048381
has body: I'm freeze in my app. I want to create my own reports.js file using variables like a functions but I can not initialize it. I'm copying other ones already done in the template but I can't understand why mine is not working. Here is the part where I call it into the head section. $(document).ready(function(){ "use strict"; App.init(); // Init layout and core plugins Plugins.init(); // Init all plugins FormComponents.init(); // Init all form-specific plugins Reports.init(); $('#StartDate').pickadate({ formatSubmit: 'yyyy/mm/dd', hiddenName: true }); }); When I run the site, the console shows TypeError: Reports.init is not a function Now I'm going to share the report.js file: var Reports = function () { "use strict"; var form = $('form').attr('id'); alert(form); /* * * * * * * * * * * * * * * * Employee Clock-In Clock-Out * * * * * * * * * * * * * * */ var EmployeeClocks = function(form) { // will do something } return { // main function to initiate reports init: function () { // EmployeeClocks(); }, }; }
upvote count: 1
type: Question
type: AnsweredQuestion
score: 1
has title: Why I can not initialize my variable in jQuery?
answer count: 2
accepted answer: http://stackoverflow.com/a/29048381
tagged with: function

http://stackoverflow.com/comment/46352403
has text: Thank you so much! I vaguely have an idea on how I should plan my code!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29057779
type: Comment

http://stackoverflow.com/comment/46226669
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28988988
score: 0
has text: Couldn't you do `c = c.replace(/10/g, 2);`?

http://stackoverflow.com/q/28945010
has comment: http://stackoverflow.com/comment/46145210
has comment: http://stackoverflow.com/comment/46144264
downvote count: 0
has title: The Choice of Java Constructor Replace is Ambiguous
has body: I have that javascript code for a RhinoScript based framework: function cleaner(tracker) { var nRegex = new RegExp(reggo); var regexMatch = tracker.match(nRegex); if (regexMatch == null || regexMatch == "" || regexMatch.length &lt;= 0) { return tracker; } tracker = tracker.replace(nRegex, ""); return tracker; } However I get that exception for it: Exception: InternalError: The choice of Java constructor replace matching JavaScript argument types (function,string) is ambiguous; candidate constructors are: class java.lang.String replace(java.lang.CharSequence,java.lang.CharSequence) class java.lang.String replace(char,char) (#114) I've tried something but didn't work as expected. Any ideas?
tagged with: javascript
type: UnansweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/46145578
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/49019312
answer count: 1
upvote count: 3
tagged with: rhino

http://stackoverflow.com/comment/54177950
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/33185715
has text: And even better, you can use `const` here :-)
type: Comment

http://stackoverflow.com/comment/46116870
has text: People will be more willing to help if you show what you've tried.
comment on: http://stackoverflow.com/q/28930321
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/46416093
has text: I had done a mistake with the copy-paste. The original code was not wrapped in quotes, but it still does nothing. Thanks for your help.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29025335
type: AnswerComment

http://stackoverflow.com/q/28932963
has body: I have an svg file comprised of a bunch of paths which I am animating through the method seen here. This is the standard method of animating paths—the one with the dash offset and what not. I've tested the code and it works fine on my svg file, when it is written inline— that is, the code for the svg paths are written directly into the same document as the script. You can see it in action here. The script being used is this: $(document).ready(function(){ var path = document.getElementsByTagName('path'); var length; var anim = document.getElementsByTagName('animate'); for(i = 0; i &lt; path.length; i++){ length = path[i].getTotalLength().toString(); path[i].setAttribute('stroke-dasharray',length+','+length); anim[i].setAttribute('values','-'+length+';0'); } }); However, when trying to make it work with an svg file in an &lt;object&gt;, I am not so lucky. I have placed the file correctly, and it shows up fine. When I run the modified script, it runs fine, and assigns the length values and what not to each &lt;path&gt; and &lt;animate&gt; element as it should (you can verify this by inspecting the svg elements — the stroke-dasharray property should have a value equal to the length of each path). The problem is, despite the values properly changing to what should trigger the animation, nothing animates. I am not sure why this would be, as the code operates the exact same as the inline one, with the exception of looking into the svg document rather than the current document... here is the modified version of the script (to work with a loaded svg rather than an inline one): $(document).ready(function(){ var a = document.getElementById("logoSVG"); //it's important to add an load event listener to the object, as it will load the svg doc asynchronously a.addEventListener("load",function(){ var svgDoc = a.contentDocument; //get the inner DOM of .svg var path = svgDoc.getElementsByClassName('line'); var length; var anim = svgDoc.getElementsByTagName('animate'); for(i = 0; i &l…
upvote count: 3
type: Question
has title: Animating a linked svg not working; Working fine when inline
answer count: 1
downvote count: 0
tagged with: svg-animate
linked to: http://stackoverflow.com/q/4906148
tagged with: javascript
has answer: http://stackoverflow.com/a/28933146
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
accepted answer: http://stackoverflow.com/a/28933146
type: AnsweredQuestion
score: 3

http://stackoverflow.com/q/28937200
has comment: http://stackoverflow.com/comment/46129976
has comment: http://stackoverflow.com/comment/46129823
has answer: http://stackoverflow.com/a/42504861
has comment: http://stackoverflow.com/comment/68616487
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
answer count: 4
has title: How to pass PHP variable to JavaScript function from Blade format HTML
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/23740548
tagged with: php
has answer: http://stackoverflow.com/a/59668794
tagged with: laravel-blade
has body: I am using Laravel Blade format for my HTML and I am passing multiple PHP variables to JavaScript functions. The issue is that the variables being passed to JavaScript function could have special characters. I want the JavaScript function to be as follows: jsFunction("argument1","argument2","argument3") What I get: jsFunction('argument1','argument2','argument3') My Blade format code is: property_id}}','{{ $bannerProperty->id }}','{{$bannerProperty->end_date}}','{{$bannerProperty->no_of_days}}','{{$bannerProperty->total}}','{{$bannerProperty->vat_percentage}}')">
tagged with: laravel
type: Question
has comment: http://stackoverflow.com/comment/46129918
has answer: http://stackoverflow.com/a/47384540
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28937865
score: 4
favorite count: 0

http://stackoverflow.com/comment/46252982
has text: possible duplicate of [jQuery "Please Wait, Loading..." animation?](http://stackoverflow.com/questions/1964839/jquery-please-wait-loading-animation)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29002953

http://stackoverflow.com/comment/115313286
comment on: http://stackoverflow.com/a/65215681
score: 0
type: Comment
has text: i was trying with "// textShadow: false" but that one "textOutline: false" worked for me.
type: AnswerComment

http://stackoverflow.com/q/29047659
has body: For my script I want to send few data in multiple url's by ajax for multiple php query. So I tried as below which not call ajax waitForRep(). How to do it please? my Javascript: var url = ['/server/server2','/server/server']; var tutid = '&lt;?php echo $tutid; ?&gt;'; var CID = '&lt;?php echo $id; ?&gt;'; function waitForRep(){ $.each(url, function(i,u){ $.ajax({ type: "GET", cache: false, data: { tutid : tutid, CID : CID }, timeout:15000, success: function(data){ // do something with result setTimeout(waitForRep, 15000 ); }, error: function(XMLHttpRequest, textStatus, errorThrown){ setTimeout(waitForRep, 15000); } }); } } $(document).ready(function(){ waitForRep(); });
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/44249407
has comment: http://stackoverflow.com/comment/46333743
tagged with: jquery
has answer: http://stackoverflow.com/a/44249586
tagged with: ajax
type: UnansweredQuestion
has title: How to sent data by ajax in multiple urls
linked to: http://stackoverflow.com/q/15005500
type: Question

http://stackoverflow.com/q/29029112
has title: Reset div to its original position after click
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29029250
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I have this application that shows small windows after clicking a button JsFiddle $('.modules').draggable(); $('.glyphicon').click(function() { $(this).next('.modules').slideToggle(); }); .glyphicon { font-size: 2em; color: #A70000; position:absolute; z-index: 10; display: block; } .glyphicon:hover { cursor: pointer; color: #000; } .modules{ position: absolute; width: 30%; box-shadow: 5px 5px 15px #000; z-index: 5; display: none; overflow: hidden; } .modules_box { color: white; background-color: rgba(159,159,159,0.8) } .module img{ padding: 5px; } #module1 { left: 10%; top: 7%; } #button_module1 { left: 10%; top: 7%; } DANE: Parametr 1: 500 Parametr 2: 700 Parametr 3: 1500 cm Windows are draggable so a user can move them around. What I want to achieve is to reset the window position after it's hidden so it always shows at its origin. I would like the universal solution that doesn't require writing separate code for every window. There will be many windows placed at different spots using absolute position. Any suggestions how this could be achieved?
score: 0
linked to: http://stackoverflow.com/q/5735270
has answer: http://stackoverflow.com/a/29029250
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46299830
tagged with: css

http://stackoverflow.com/comment/46212425
type: QuestionComment
score: 0
has text: Can you create a JSFiddle or a Plunk?
comment on: http://stackoverflow.com/q/28981388
type: Comment

http://stackoverflow.com/q/28969125
answer count: 1
accepted answer: http://stackoverflow.com/a/28969807
downvote count: 0
tagged with: string
favorite count: 0
tagged with: multidimensional-array
has body: I have a 2 dimensional array with different elements in it. I want to sort the array based on 2 different criteria. One being a string and the other an integer. Here is an example. var arr = [ ['ABC', 87, 'WHAT'], ['ABC', 34, 'ARE'], ['DEF', 13, 'YOU'], ['ABC', 18, 'DOING'], ['ABC', 34, 'DOING'], ['DEF', 24, 'TODAY'] ]; I want to sort first by the first element and then by the second element.
has comment: http://stackoverflow.com/comment/46190119
has answer: http://stackoverflow.com/a/28969807
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46190131
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46205795
type: Question
has title: Sorting multi dimensional array by 2 columns - JavaScript
linked to: http://stackoverflow.com/q/6993302
tagged with: arrays
tagged with: javascript
tagged with: sorting
linked to: http://stackoverflow.com/q/2784230

http://stackoverflow.com/comment/46271995
score: 1
has text: If you want to store across tabs, then yes `localStorage` or cookies would be better.
type: Comment
comment on: http://stackoverflow.com/q/29013529
type: QuestionComment

http://stackoverflow.com/comment/70935440
score: 4
type: AnswerComment
has text: This is GOLD, and should be valid response.
comment on: http://stackoverflow.com/a/40869830
type: Comment

http://stackoverflow.com/comment/46093622
type: Comment
comment on: http://stackoverflow.com/a/28917956
has text: Also, removing that fixed it. I'll accept your answer once the time limit is up.
type: AnswerComment
score: 0

http://stackoverflow.com/q/28927434
tagged with: easeljs
upvote count: 2
tagged with: createjs
answer count: 2
tagged with: canvas
tagged with: html5-canvas
favorite count: 0
has title: Easiest way to load a video in CreateJS?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28949684
has comment: http://stackoverflow.com/comment/46156824
score: 2
has answer: http://stackoverflow.com/a/29030365
downvote count: 0
has body: I'm looking to load a video via CreateJS (Flash CC), either mp4 or ogg format. What is the easiest way to do this? There is almost no documentation out there. I know videos can be uploaded as a bitmap, eg: var bitmap = new createjs.Bitmap("moviePath.mp4"); When I load a video in this way, I can hear the audio playing, but can't actually see the video on the canvas. I suspect this is because the canvas isn't drawing each individual frame, despite putting ticker functions and stage.update() Any help is appreciated!
type: Question
tagged with: javascript

http://stackoverflow.com/q/29042794
has comment: http://stackoverflow.com/comment/46326008
favorite count: 0
type: Question
has body: I'm using jQuery ajax to perform a request but sometimes it is blocked by the browser (ie. when my site is running over https and it tries to make an external call to a http resource). I use this code to make the request jQuery.ajax({ url: videoCallString, success: function(result) { //...if it isn't, we can't playback the video so skip next slide if (result != 1) { console.log('found no video_check on localhost so skip slide '+self.nextSlide); self.skip(); } else { //success, proceed as normal self.beforeComplete(); } }, /* fail: function() { console.log('found no video_check on localhost so skip slide '+self.nextSlide); self.skip(); }, */ complete: function(xhr, data) { if (xhr.status != 200) { //we could not find the check-video file on localhost so skip next slide console.log('found no video_check on localhost so skip slide '+self.nextSlide); self.skip(); } else { //success, proceed as normal self.beforeComplete(); } }, //above would cause a double-slide-skip, I think. Removed for now, that should be trapped by the fail clause anyways. async: true }); But if a request is blocked, none of these events are triggered. Would the fail event trigger if I didn't have it commented out? I did that because otherwise I get double skip() which is very undesirable...
upvote count: 1
has answer: http://stackoverflow.com/a/30681374
answer count: 1
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
tagged with: ajax
has title: how to catch a browser-blocked XMLHttpRequest?
has comment: http://stackoverflow.com/comment/46345694
downvote count: 0
score: 1

http://stackoverflow.com/comment/46356063
has text: Well that worked perfectly thanks but I'm still not sure why! Does it keep adding more and more squares to the current path, which all get drawn when you call .stroke() and .fill()?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29059712
type: Comment

http://stackoverflow.com/comment/46237898
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28994842
has text: What do you mean by "expel"? Also, what is "objectToMove"?

http://stackoverflow.com/comment/46266056
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29010451
type: AnswerComment
has text: @MatiCicero: I added an optional `finally` callback you can do that with :-)

http://stackoverflow.com/comment/46206137
score: 0
type: Comment
has text: thing is I checked locally and on the server and saw no .../cursors directories thats why it baffles me. Check edit to the OP
comment on: http://stackoverflow.com/a/28976037
type: AnswerComment

http://stackoverflow.com/comment/46155116
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28941995
has text: I'm not sure why that worked, but it did! Thank you!
type: AnswerComment

http://stackoverflow.com/a/34616708
score: 0
has comment: http://stackoverflow.com/comment/56997767
type: Answer
answers question: http://stackoverflow.com/q/28915927
has body: This question seems outdated because Angular Material tabs already have a ripple effect on them when clicked, and it is achieved by dynamic application of md-ink-ripple. See the demo: https://material.angularjs.org/latest/demo/tabs

http://stackoverflow.com/q/29058716
has body: I have an object on which i would like to perform add/remove/find operation. So i'm just trying to convert that Object as HashMap/Collection object using Ext.util.Collection/Ext.util.MixedCollection/Ext.util.HashMap classes. As it is already an Object i just want to perform typecasting? Is there a straight forward option availble in ExtJS to attain this? Currently using the following utility method i'm attaining this. Is there any other better option available other than this? Raw Object:- Object {abbreviateValues: true, category: "P", charCode: 13092,charDescription: Array[5], charId: 13092…} Utility Method:- convertObjectToCollection: function(rawObject){ var hashMapObject = Ext.create('Ext.util.HashMap'); for(var key in rawObject) { hashMapObject.add(key,rawObject[key]); } return hashMapObject; } Thanks!
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: extjs
possible better answer: http://stackoverflow.com/a/29058784
has answer: http://stackoverflow.com/a/29058784
tagged with: extjs5
has title: ExtJS 5 - How to convert Object to Collection/MixedCollection/HashMap?
accepted answer: http://stackoverflow.com/a/29060113
upvote count: 1
type: AnsweredQuestion
score: 1
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29060113

http://stackoverflow.com/comment/46110076
type: AnswerComment
comment on: http://stackoverflow.com/a/28927010
type: Comment
has text: changing `var r = 0;` to `var r = -1;` did a better job
score: 1

http://stackoverflow.com/q/29058987
tagged with: http
downvote count: 1
type: Question
tagged with: http-headers
accepted answer: http://stackoverflow.com/a/29059002
has title: Node.js static header for all requests
score: 0
answer count: 1
tagged with: javascript
favorite count: 0
has body: I want to set a static header for all incoming request in my node.js server. My current way is to add for each request the same 4 lines of header(code duplication) and i want to fix that, here is one example of the header i want to add : app.post('/postJob', function(req,res){ console.log("request method :" + req.method); // Website you wish to allow to connect res.setHeader('Access-Control-Allow-Origin', '*'); // Request methods you wish to allow res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE'); // Request headers you wish to allow res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type'); // Set to true if you need the website to include cookies in the requests sent // to the API (e.g. in case you use sessions) res.setHeader('Access-Control-Allow-Credentials', true); res.setHeader('Content-Type', 'application/json'); Someone knows a way to define that ?
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29059002
upvote count: 1

http://stackoverflow.com/comment/46223254
has text: also it will be better to do the second call to `done` after the 1st request is finished
comment on: http://stackoverflow.com/q/28987356
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/28933317
tagged with: aura.js
tagged with: javascript
has answer: http://stackoverflow.com/a/28933458
accepted answer: http://stackoverflow.com/a/28933458
score: 0
answer count: 1
has title: Aura component without any DOM element?
has body: On the Aura.js 'Getting Started' page (which is down at the moment, so that's a Google cache link) it says the following: The other way to start components on application start is to explicitly pass a list to the app.start method. Example: `app.start([{ name: 'hello', options: { el: '#hello' } }]);` All listed components MUST have at least the name and options.el defined, where name is the name of the component to start and options.el is a DOM selector to target the DOM Element that will be the root of your component. So from that it seems like Aura requires that every module/component MUST have an associated DOM element. Is that correct? In my app I'd like to have some modules which are purely for running long background calculations which shouldn't be associated with any DOM element. They emit their computed results to other modules which deal with displaying. I love the philosophy behind Aura.js (mediator/modules + MVC) but I don't really want to hack around it too much. Any insights would really be appreciated. Maybe I've misinterpreted something? Maybe there's a better framework for me? Thanks!
tagged with: model-view-controller
type: AnsweredQuestion
tagged with: scalability
type: Question

http://stackoverflow.com/a/29011148
upvote count: 6
score: 6
has comment: http://stackoverflow.com/comment/46267772
has comment: http://stackoverflow.com/comment/46268642
accepted answer of: http://stackoverflow.com/q/29010946
has comment: http://stackoverflow.com/comment/46267832
answers question: http://stackoverflow.com/q/29010946
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46267907
has body: Notwithstanding the warnings about exposing a raw SQL interface in your API, the problem you have is that i in the callback once the AJAX call completes doesn't have the same value it did when you initiated the call. The easiest solution is to use $.each or Array#forEach instead of a for loop, and use the index parameter that is then correctly bound to the current value in the callback: $.each(queries, function(i, query) { $.ajax({ url: "querySQL.php", type: "GET", cache: false, data: { query: query }, success: function(data) { $("#" + (i + 1)).html(data); // NB: i starts at 0, not 1 } }); });
type: Answer

http://stackoverflow.com/comment/46160512
type: QuestionComment
has text: If you meant to base64 and then comparing them, that's a huge work...for list of couple of hundred nodes... meh...I thought there is a easy trick/way, but if not, I'll use what i have
score: 0
comment on: http://stackoverflow.com/q/28953282
type: Comment

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

http://stackoverflow.com/q/29031792
has comment: http://stackoverflow.com/comment/46304624
has comment: http://stackoverflow.com/comment/46311825
accepted answer: http://stackoverflow.com/a/29074974
has comment: http://stackoverflow.com/comment/46308133
linked to: http://stackoverflow.com/q/29009868
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46306364
has comment: http://stackoverflow.com/comment/46306370
score: 4
has body: Yesterday I made a question about Detect non valid XML characters in java, and this expression works as expected: String xml10pattern = "[^" + " " // #x9 | #xA | #xD + " -퟿" // [#x20-#xD7FF] + "-�" // [#xE000-#xFFFD] + "𐀀-􏿿" // [#x10000-#x10FFFF] + "]"; However, I realized it would be better checking for invalid characters on client side using javascript, but I didn't succeed. I almost achieved, except for range U+10000–U+10FFFF: http://jsfiddle.net/mymxyjaf/15/ For last range, I tried var rg = /[^ -퟿-�𐀀-􏿿]/g; but it doesn't work. In regextester, tells "Range values reversed". I think it is because 𐀀-􏿿 is intepreted as 3 expressions: ; -; and, of course, the middle one fails. So, my question is how convert above java regular expression into javascript. Thanks. ==== UPDATE ==== Thanks to @collapsar comments, I tried to make two regular expressions. Because of that, I realized I can't negate characters [^...]. It'll discard correct characters like U+10001. I mean, this is not right: function validateIllegalChars(str) { var re1 = /[^ -퟿-�]/g; var re2 = /[^[-][-]]/g; var str2 = str.replace(re1, '').replace(re2, ''); // First replace would remove all valid characters [#x10000-#x10FFFF] alert('str2:' + str2); if (str2 != str) return false; return true; } Then, I tried next (http://jsfiddle.net/mymxyjaf/18/): function valPos(str) { var re1 = /[ -퟿-�]/g; var re2 = /[-][-]/g; var str2 = str.replace(re1, '').replace(re2, ''); if (str2.length === 0) return true; alert('str2:' + str2 + '; length: ' + str2.length); return false; } However, when I call this function: valPos('eo' + String.fromCharCode(65537)), where 65537 is U+10001 it returns false. What is wrong or how can I solve it?
has comment: http://stackoverflow.com/comment/46327453
type: Question
upvote count: 4
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46344691
has answer: http://stackoverflow.com/a/29074974
has comment: http://stackoverflow.com/comment/46305882
has comment: http://stackoverflow.com/comment/46311363
tagged with: regex
has comment: http://stackoverflow.com/comment/46306460
has comment: http://stackoverflow.com/comment/46307010
has title: Detect non valid XML characters (javascript)
linked to: http://stackoverflow.com/q/16346567

http://stackoverflow.com/comment/46095060
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28916104
score: 1
has text: Try `window.parent.postMessage`.

yield
tags question: http://stackoverflow.com/q/28973807
type: Tag
tag name: yield

http://stackoverflow.com/q/28953291
has title: How to access nested objects with replacer param json.stringify
type: Question
has comment: http://stackoverflow.com/comment/46160241
has answer: http://stackoverflow.com/a/30577932
downvote count: 0
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/46187338
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: node.js
score: 2
has body: Here is a minified example of my problem: var myObj = {hello: {bye: "bye"} }; JSON.stringify(myObj, ['hello']); returns "{"hello": {}}" How can I access nested objects using the replacer array parameter? I researched posts demonstrating the "data" parameter in an ajax request, I am not making an ajax request, I am reading json, filtering properties, and writing the results to a new file.
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/29017489
has body: I have ded3e8c2e3460a97500c09d752a83c4eb44eda90998e33ce8d346a1174c0b97f and I want 7fb9c0.... I am using lodash and where's what I have so far mytxid = 'ded3e8c2e3460a97500c09d752a83c4eb44eda90998e33ce8d346a1174c0b97f' reverseTxid = _.chunk mytxid.split(''), 2 reverseTxid = reverseTxid.reverse() reverseTxid _.flattenDeep reverseTxid However, I get an error on the .reverse(): [TypeError: object is not a function] What am I doing wrong and what's a better way to do it?
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: string
favorite count: 0
tagged with: byte
accepted answer: http://stackoverflow.com/a/29017642
type: AnsweredQuestion
has title: How can I reverse order, byte wise, of a string in JavaScript?
type: Question
score: 4
has answer: http://stackoverflow.com/a/29017642
upvote count: 4

http://stackoverflow.com/a/28922464
score: 62
downvote count: 0
has comment: http://stackoverflow.com/comment/78211519
has comment: http://stackoverflow.com/comment/70609702
type: AcceptedAnswer
has body: Can't you do person instanceof Person? Comparing constructors alone won't work for subclasses
type: Answer
accepted answer of: http://stackoverflow.com/q/28922435
has comment: http://stackoverflow.com/comment/78201916
answers question: http://stackoverflow.com/q/28922435
has comment: http://stackoverflow.com/comment/70599822
upvote count: 62
has comment: http://stackoverflow.com/comment/46102051

http://stackoverflow.com/comment/46328446
comment on: http://stackoverflow.com/a/29043341
type: Comment
score: 0
type: AnswerComment
has text: Also, the `name` has to stay how it was because that's how it manages to push the data to google sheets, for example: `name="entry.186425174"` will put into column 11

http://stackoverflow.com/a/28988183
has body: Yes, you need to add a callback parameter to your findRecur function. It makes no sense to pass two parameters into a function that only looks at the first one. function findRecur(tree, callback) { for (var i = 1; i &lt; tree.length; i++) { if (Array.isArray(tree[i])) { findRecur(tree[i], callback); } else { callback(tree[i]); } } } Then you can call your function like this: findRecur(data, function(text) { console.log(text); }); Or just like this: findRecur(data, console.log);
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28988074
has comment: http://stackoverflow.com/comment/46225095
answers question: http://stackoverflow.com/q/28988074
has comment: http://stackoverflow.com/comment/46225177
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46224904

http://stackoverflow.com/comment/46324777
type: Comment
comment on: http://stackoverflow.com/a/29034760
score: 0
type: AnswerComment
has text: But here's the problem. Scenario #1 is where a PDF **should** be generated but for whatever reason isn't. That, I agree, wouldn't be the worst thing to put into an HTML error message in a window. Scenario #2 is that the PDF can't be generated because they've entered a date that's outside the range supported by back-end systems. In that case, they view that as an input error and want notification consistent with other input errors. The REST layer can make that distinction, but without a way to handle it on the client (browser) side it's a moot point.

http://stackoverflow.com/comment/46255361
type: QuestionComment
comment on: http://stackoverflow.com/q/29004409
has text: It would be better to use actual checkboxes for accessibility. Then use a div/iimage/whatever to trigger clicks on these check boxes, that you can hide. You'd have to check after the click if the checkbox is enabled, then you'd enable the div/image/whatever also.
score: 0
type: Comment

http://stackoverflow.com/q/28980383
has comment: http://stackoverflow.com/comment/46222418
tagged with: internet-explorer-11
tagged with: document
has comment: http://stackoverflow.com/comment/46216767
has comment: http://stackoverflow.com/comment/46253102
tagged with: selection
has comment: http://stackoverflow.com/comment/46216600
score: 0
has title: Unable to get any value from window.getselection
answer count: 1
tagged with: javascript
has body: In our project we have been using a functionality that when we select some text and right click on it the text is copied and another right click will cause the copied text to be pasted in javascript. The code was working fine until IE11. In IE11 we get error at textEl.caretPos = document.selection.createRange().duplicate(); I have researched a lot and found that document.selection is no more supported on IE11 and we need to use window.getSelection() but that didnt work either. I have tried all combinations window.getSelection(); window.document.getSelection(); document.getSelection(); window.external.menuArguments.document.getSelection(); nothing works. I have already reffered these links Unable to get property 'createRange' of undefined or null reference https://tracker.phpbb.com/browse/PHPBB3-12094 https://social.msdn.microsoft.com/Forums/ie/en-US/138e9cbc-aee7-46fc-bb7e-c5112e88497a/unable-to-get-property-createrange-of-undefined-or-null-reference?forum=ieextensiondevelopment These dint help either as everywhere they have asked to use window.getSelection(). Here is my code: EDIT: Please note the below code works fine in IE7/8 and chrome it doesnt work on IE11 as window.getSelection().toString() is empty. Also note this in inside an Iframe if that creates any difference. /** * Copies or Pastes text into a text box. If the * text is selected, then right clicking on it does a copy. * If no text is selected, then right clicking invokes a paste * of any clipboard text into the textbox. * * NOTE: Pasting will replace any value already in the textbox */ function copyPasteHelper() { // if something is currently selected, copy it var selectedText = ""; if(document.selection != null){// for IE 8 and below only storeCaret (event.srcElement); selectedText = document.selection.createRange().text; }else if(typeof window.getSelection() != "undefined") // for IE 9+ and Chrome { //storeCaret (event.srcElement); selectedText = window.getSelection().toString(); alert(selectedText);…
linked to: http://stackoverflow.com/q/19748500
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/41579166

http://stackoverflow.com/q/29000572
tagged with: concatenation
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29000626
favorite count: 0
tagged with: typeerror
has body: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;script&gt; function myFunction() { var objDate = new Date(); var hours = objDate.getHours(); var mins = objDate.getMinutes(); var time = hours.concat(mins); window.alert(time); if (time&gt;=1600&amp;&amp;time&lt;=0900) { document.body.style.background ="url('closed.png') no-repeat"; } else if (time&gt;=1230&amp;&amp;time&lt;=1315) { document.body.style.background ="url('lunch.png') no-repeat"; } else { document.body.style.background ="url('open.png') no-repeat"; } } setInterval(myFunction, 3000); &lt;/script&gt; &lt;/html&gt; At line 8 "var time = hours.concat(mins);" I get "Uncaught TypeError: undefined is not a function" and it refuses to continue. All I want to do is specify if its between a certain time then we are open, closed or at lunch. Schedule never really changes so it doesn't need to be more advanced than that.
downvote count: 0
has answer: http://stackoverflow.com/a/29000588
accepted answer: http://stackoverflow.com/a/29000588
has answer: http://stackoverflow.com/a/29000626
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46248908
has title: Javascript concat() not working as it should be
type: Question
upvote count: 2
answer count: 2

http://stackoverflow.com/a/29033264
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/46307485
accepted answer of: http://stackoverflow.com/q/29033243
answers question: http://stackoverflow.com/q/29033243
score: 1
has body: Try this $( ".employee-big" ).click(function() { $(this).find( ".info" ).toggle( "slow" ); });
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/28941491
score: 0
tagged with: date-format
has comment: http://stackoverflow.com/comment/46137425
has answer: http://stackoverflow.com/a/28941904
has title: How to assign default value for input type date by javascript?
type: UnansweredQuestion
tagged with: php
has body: I can assign default value to input[type="date"] like this in php: &lt;input name="date" type="date" value="&lt;?php echo date('Y-m-d'); ?&gt;"&gt; which is resulting into string: value="2015-03-09" and input even display this date in my local dateformat: 09.03.2015 (idk why, but it is great). But if I want to assign default date value by javascript: protocolDate = new Date(protocolDate.substr(0,4), protocolDate.substr(5,2), protocolDate.substr(8,2)); which is returning the same string and generating the same html: value="2015-03-09" input shows default value like this: dd.mm.rrrr. Is there a way how to assign default value for input type date by javascript?
has comment: http://stackoverflow.com/comment/46137472
tagged with: date
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/46458680
type: QuestionComment
comment on: http://stackoverflow.com/q/28977449
has text: I don't think there is much to improve here in terms of performance. Your code performance at this moment depends mostly on network latency between browser and remote point (where AJAX call is sent). Client-side event is triggered by click (cannot happen "faster"), server-side event is processed by a static set of "if" conditions. If you are not going to add 100 other AJAX URLs and request types – you probably shouldn't waste your time doing premature optimisations.
score: 0
type: Comment

http://stackoverflow.com/comment/46147608
has text: Use the same method in the .change event? `+2`
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28946593
type: Comment

http://stackoverflow.com/comment/46347695
score: 0
type: Comment
type: QuestionComment
has text: have you read [how to return the response from an asynchronous call?](http://stackoverflow.com/q/14220321/1048572) already?
comment on: http://stackoverflow.com/q/29055164

http://stackoverflow.com/comment/46218066
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28983639
type: Comment
has text: Negative; I'm still trying to solve my original problem of a smooth page-changing effect. I wiped out the entire brick of code inside the onClick() and replaced it with yours and the other person's.

http://stackoverflow.com/a/29025578
accepted answer of: http://stackoverflow.com/q/28995757
score: 49
answers question: http://stackoverflow.com/q/28995757
has comment: http://stackoverflow.com/comment/112848311
has comment: http://stackoverflow.com/comment/97400012
has comment: http://stackoverflow.com/comment/134141616
type: Answer
has comment: http://stackoverflow.com/comment/94730249
upvote count: 49
has comment: http://stackoverflow.com/comment/83786964
has body: If the OData service is of protocol version V4, the correct query URL should be: $filter=OrganizationId eq 4c2c1c1e-1838-42ca-b730-399816de85f8 No single quotes is required.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28958663
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46200474
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28959918
answer count: 3
has comment: http://stackoverflow.com/comment/46172985
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28959460
type: UnansweredQuestion
upvote count: 1
has body: Here is my code html DAVE css h1.logo-title {background: url(bg.jpg) no-repeat;background-position: 50% 100%;-webkit-background-clip: text;} I am trying to use my background image zoomin and zoomout animation effect like those websites. here is demo. http://wowslider.com/jquery-slider-bar-kenburns-demo.html http://owwwlab.com/toranj/index-2.html please give me any sollution for my background image. Anybody help me out in this situation. ??
has answer: http://stackoverflow.com/a/28959345
score: 1
has title: background image zoomin Effect.
type: Question

http://stackoverflow.com/q/28942017
has comment: http://stackoverflow.com/comment/46138453
tagged with: arrays
has title: How to count elements in the array in Javascript
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/2228362
score: 0
has answer: http://stackoverflow.com/a/28942100
has comment: http://stackoverflow.com/comment/46138510
favorite count: 0
tagged with: multidimensional-array
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46138550
upvote count: 1
linked to: http://stackoverflow.com/q/19395257
has comment: http://stackoverflow.com/comment/46138461
duplicate of: http://stackoverflow.com/q/19395257
downvote count: 1
type: Question
has body: I want to make an Array of 100 elements from numbers[1,10] and then count how many of every number is in that Array. How can I do it? I have the Array with random numbers: function random(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } for(var y=0 ; y&lt;100 ; y++) { tab[y]=random(1, 10); } but I don't know how to search for every number.

http://stackoverflow.com/comment/46281127
type: QuestionComment
comment on: http://stackoverflow.com/q/29018550
score: 0
has text: Or try to see the object itself, by `console.log(tableLength)`.
type: Comment

http://stackoverflow.com/comment/46327640
comment on: http://stackoverflow.com/q/29040216
type: Comment
type: QuestionComment
has text: Why can’t you simply output the logout button server-side only when there is a logged-in user?
score: 0

http://stackoverflow.com/comment/46293396
score: 0
type: AnswerComment
has text: its works I have tried it in my local, tested and posted this answer. let me know if you have any concern on this
type: Comment
comment on: http://stackoverflow.com/a/29025480

http://stackoverflow.com/q/28947955
tagged with: selenium
tagged with: jquery-ui-selectmenu
has body: I'm struggling to get Selenium to select an option from a select menu generated by the jQueryUI official plugin, as described in more detail below, Selenium opens the menu, and then goes for the click to select an item, closes the menu, but the option is not selected. Some background on the setup: Using Selenium IDE Firefox Plugin Using the jQueryUI SelectMenu Demo page to test on (So we can ensure the code snippet is one everyone can access, and eliminate that the selectmenu is at least properly implemented, as its their demo site) Test source: http://jqueryui.com/selectmenu/ I have tried targeting the span.ui-selectmenu-text for the selenium click, and then clicking the element with ID=ui-id-5, no luck. I then tried clicking on span.speed-button, and then select the option. Also no luck. In all cases, the menu opens, and closes, but the original value is still selected. However, a weird thing happens. In the Selenium IDE, if I do the following, then it IS selected: Double click on the Command for opening the menu. Double click on the Command for selecting the correct ID element. Double click again on the Command for selecting the correct ID element. Suddenly now, the selected option is updated. But when I run a script end to end, with the two click Commands, it fails again, and just has the default option selected on the page. The code: open /selectmenu/ click css=span.ui-selectmenu-text click id=ui-id-5 If someone could point me in the right direction, any tips or hints, or an actual solution to the problem, that would be great. I DID search SO before posting this, but the only one I could find was from 3 years ago, and the solution did not work anymore: how to test using ui selectmenu (jQuery) and selenium
tagged with: jquery-ui
score: 1
has answer: http://stackoverflow.com/a/30110304
has answer: http://stackoverflow.com/a/29500063
type: Question
answer count: 2
upvote count: 1
tagged with: javascript
has title: How to automate jQueryUI selectmenu with Selenium web driver/Selenium IDE
tagged with: select-menu
linked to: http://stackoverflow.com/q/6219717
favorite count: 0
downvote count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28934286
upvote count: 2
has title: show/hide divs on click- how to make div 1 show on page load?
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28934438
score: 2
has comment: http://stackoverflow.com/comment/46124369
answer count: 1
downvote count: 0
favorite count: 0
has body: I have learned how to show and hide divs using javascript but how do I make the first div show on page load without having to click it? Basically I am creating a menu with 6 different links. I would like the first link div to show on page load and then hide when other links are clicked. Topic One Topic Two Topic Three Page 1 First section of content. Page 2 Second section of content Page 3 Third section of content. JavaScript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28934438

http://stackoverflow.com/comment/46294696
type: Comment
type: QuestionComment
has text: I have no idea what `System.Web.HttpContext.Current.Session` is.
comment on: http://stackoverflow.com/q/29026348
score: 0

http://stackoverflow.com/comment/46290428
comment on: http://stackoverflow.com/a/29023259
score: 0
type: AnswerComment
type: Comment
has text: Yes. Right. Just call autoNumeric after each row addition. This is the simplest. By the way which gem are you using for row addition?

http://stackoverflow.com/comment/46088379
type: Comment
type: QuestionComment
score: 0
has text: Use a query string in the hrefs and then extract it and use it to trigger the appropriate function on the target page.
comment on: http://stackoverflow.com/q/28915093

http://stackoverflow.com/comment/46275861
comment on: http://stackoverflow.com/a/29015250
type: Comment
has text: Each of this ajax takes 1~2 seconds when response is not cached. 1000 (maybe more) would take to long to wait for the response.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28956946
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46180178
has title: How to add Promise to event handler in javascript
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/46178847
type: Question
has body: Now I want to wrap amqp with Promise Q, here are the codes Sender.prototype.createConnection_ = function () { var deferred = Q.defer(); this.con_ = amqp.createConnection( this.connectOpt_, this.implementOpt_ ); deferred.resolve( this.con_ ); return deferred.promise; } Sender.prototype.connectionReady_ = function() { var deferred = Q.defer(), self = this; self.con_.on('ready', function() { console.log('connection is ok now'); deferred.resolve(self.con_); }); return deferred.promise; } Sender.prototype.createExchange_ = function() { var deferred = Q.defer(), self = this; this.con_.exchange( this.exchangeName_, this.exchangeOpt_, function ( ex ) { self.ex_ = ex; deferred.resolve(self.ex_); }); return deferred.promise; } Sender.prototype.exchangeReady_ = function() { var deferred = Q.defer(), self = this; this.ex_.on('open', function() { console.log('Sender: exchange opened'); deferred.resolve(this.ex_); }); return deferred.promise; } Sender.prototype.connect_ = function() { var self = this; return self.createConnection_() .then( self.connectionReady_() ) .then( self.createExchange_() ) .then( self.exchangeReady_() ) .catch( function(err) { console.info( err ); }); } When I want to invoke connect_, there is one error show that this.ex_ is null in the exchangeReady_ function. I want to how to add Q in the event open and ready function ?
tagged with: node.js
has answer: http://stackoverflow.com/a/28957092
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/28957092
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
type: AnsweredQuestion
tagged with: amqp
has comment: http://stackoverflow.com/comment/46183400

http://stackoverflow.com/q/29044688
linked to: http://stackoverflow.com/q/728360
has answer: http://stackoverflow.com/a/29044796
has body: I have an unordened list where each list item is given a data id, I need this ID value to update the view later, basically I cant remove the values from the json, is there a way to hide the value from the html without removing it from the json data? and console.log with a click? The objects are: "level_0_id": 1, "level_1_id": 1, "level_2_id": 1, "id": 1 Here is the code from the fiddle: https://jsfiddle.net/creativestudio/m4t8tszk/1/ Here's the Js: function list(object) { var json="&lt;ul class='dropdown'&gt;"; for(prop in object){ var value = object[prop]; switch (typeof(value)){ case "object": var token = Math.random().toString(36).substr(2,16); json += "&lt;li&gt;&lt;div id='"+ token +"' class='collapse'&gt;"+list(value)+"&lt;/div&gt;&lt;/li&gt;"; break; default: json += "&lt;li&gt;"+value+"&lt;/li&gt;"; } } return json+"&lt;/ul&gt;"; } $(document).ready(function() { console.log(data); $('#sidebar').html(list(data)); });
has comment: http://stackoverflow.com/comment/46329271
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46329451
has title: Strip out a specific object value from json from rendering view with Javascript
has answer: http://stackoverflow.com/a/29044834
score: 0
tagged with: java
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46329737
tagged with: javascript
has comment: http://stackoverflow.com/comment/46329822
tagged with: jquery
has comment: http://stackoverflow.com/comment/46329510
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46329465

http://stackoverflow.com/comment/46128137
score: 0
has text: I use `.load()` to bring it in after a `setTimeout`
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28936462

http://stackoverflow.com/a/29094545
has comment: http://stackoverflow.com/comment/46526025
has comment: http://stackoverflow.com/comment/46430825
type: Answer
has body: The assumption that clipboard holds "HTML markup" is not correct. When you copy from a browser (or a window that utilizes Multiple Clipboard Formats) the window provides data in as many formats as possible. This includes Rich Text Format (RTF) and plain text. When you paste text, the desitination picks what it likes or what it can render. So a plain text box will pick the plain text, and your word-processor will prefer the rich text one, and defaults to the plain text copy. EDIT: Some browsers -including Chrome > v.37 at least- may add source HTML as you copy content to clipboard. This is not a web standard thus unsafe.
has comment: http://stackoverflow.com/comment/46463795
upvote count: 9
has comment: http://stackoverflow.com/comment/46426311
has comment: http://stackoverflow.com/comment/46424598
has comment: http://stackoverflow.com/comment/46463505
has comment: http://stackoverflow.com/comment/46518542
score: 9
answers question: http://stackoverflow.com/q/28983016
downvote count: 0

http://stackoverflow.com/comment/46201275
has text: I'm not following your idea...could you do a demo?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28968069

http://stackoverflow.com/q/28957319
type: Question
has body: hey guys I have follow exactly what the demo page shows however i still getting this error when i try to open a bottom sheet. i'm using angularjs 1.3.14 and i have try on 1.3.6 as well.besides, i have follow the instruction on Getting started page to Including Angular Material and its dependencies. HTML(master.html this is the master page contain all the js and css library ) Show as Grid {{alert}} app.js var app = angular.module('app',['ngMaterial','ngRoute','ngSanitize','ngCookies','ngAnimate']). config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { $routeProvider. when('/', { templateUrl: '/static/views/main.html', controller: 'IndexCtrl' }). when('/signin',{ templateUrl: '/static/views/signin.html', controller: 'SignInCtrl' }). when('/signup',{ templateUrl: '/static/views/signup.html', controller: 'SignUpCtrl' }). otherwise({ templateUrl: '/static/views/error.html' }); $locationProvider.html5Mode({ enabled: true, requireBase: false }); }]); controller.js angular.module('app').controller('MasterCtrl', [ '$http', '$scope', '$location', '$rootScope', '$timeout', '$mdBottomSheet', function ($http, $scope, $location, $rootScope, $timeout, $mdBottomSheet) { $scope.alert = ''; $scope.showGridBottomSheet = function($event) { $scope.alert = ''; $mdBottomSheet.show({ templateUrl: 'bottom-sheet-grid-template.html', controller: 'GridBottomSheetCtrl', targetEvent: $event }).then(function(clickedItem) { $scope.alert = clickedItem.name + ' clicked!'; }); }; } ]); angular.module('app').controller('GridBottomSheetCtrl', [ '$scope', '$mdBottomSheet', function ($scope,$mdBottomSheet) { $scope.items = [ { name: 'Hangout', icon: 'hangout' }, { name: 'Mail', icon: 'mail' }, { name: 'Message', icon: 'message' }, { name: 'Copy', icon: 'copy' }, { name: 'Facebook', icon: 'facebook' }, { name: 'Twitter', icon: 'twitter' }, ]; $scope.listItemClick = function($index) { var clickedItem = $scope.items[$index]; $mdBottomSheet.hide(clickedItem); }; } ]); t…
tagged with: javascript
has answer: http://stackoverflow.com/a/28999637
downvote count: 0
answer count: 1
favorite count: 0
has title: getting "TypeError: undefined is not a function" when trying to open up the bottomsheet
tagged with: angularjs
type: UnansweredQuestion
score: 1
tagged with: angular-material
upvote count: 1
has comment: http://stackoverflow.com/comment/46194393
has comment: http://stackoverflow.com/comment/47065380

http://stackoverflow.com/a/28994395
type: Answer
has comment: http://stackoverflow.com/comment/46237037
has body: You are splitting by space, so you will end up with this two element array: [(555), 555-5555] Do this instead: var number = document.getElementById("pNumber").value; document.getElementById("aCode").innerHTML = number[1] + number[2] + number[3]; document.getElementById("aNumber").innerHTML= number[5] + number[6] + number[7] + number[8] + number[9] + number[10] + number[11];
score: 0
has comment: http://stackoverflow.com/comment/46237012
answers question: http://stackoverflow.com/q/28994260
has comment: http://stackoverflow.com/comment/46314590

http://stackoverflow.com/comment/46201352
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28973815
has text: I deleted the last two line `form.target = originalTarget; form.action = originalAction;` and putted a `submitform('')` in the other link. Now work. Thanx :)

http://stackoverflow.com/q/28965584
tagged with: ajax
has answer: http://stackoverflow.com/a/28966557
has comment: http://stackoverflow.com/comment/46184252
tagged with: php
has comment: http://stackoverflow.com/comment/46183055
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28966557
has comment: http://stackoverflow.com/comment/46184115
has answer: http://stackoverflow.com/a/30479402
score: 1
has title: Output image to browser before saving it to the folder
tagged with: codeigniter
has body: I've created a functionality on my website where user's can change the background image via upload. The procedure is following: User goes to settings page and selects an image file to be uploaded. After selecting image, the browser will output it so that user can preview it before actually saving it's file to in to the folder and filepath in to the database. After that, if user is happy with the result, he can save it to the folder by pressing "Upload Background Image" button. All of the above is handled with AJAX. I am having trouble to just output the image to the browser without actually saving it twice, first into tests folder and after that into backgrounds folder. I'm using CodeIgniter as my backend framework and jQuery for my AJAX requests. Here are my methods for outputting (testing) and saving the image: public function test_image() { if($this-&gt;input-&gt;is_ajax_request()) { // This part of code needs to be replaced to only just output the image (return it as a JSON), not actually saving it to another a folder $ext = pathinfo($_FILES['userfile']['name'], PATHINFO_EXTENSION); $new_img_name = random_string('unique'). "." . $ext; $config['upload_path'] = './public/images/uploads/tests'; $config['allowed_types'] = 'gif|jpg|jpeg|png'; $config['max_size'] = '1000000'; $config['max_width'] = '2000'; $config['max_height'] = '1600'; $config['file_name'] = $new_img_name; $this-&gt;load-&gt;library('upload', $config); if (!$this-&gt;upload-&gt;do_upload()) { $this-&gt;output-&gt;set_content_type('application_json'); $this-&gt;output-&gt;set_output(json_encode(array('image_errors' =&gt; $this-&gt;upload-&gt;display_errors('&lt;p class="text-center"&gt;','&lt;/p&gt;')))); return false; } else { $this-&gt;output-&gt;set_content_type('application_json'); $this-&gt;output-&gt;set_output(json_encode(array('userfile' =&gt; $new_img_name))); } } else { echo "Not an ajax request"; } } // This method works properly public function upload_background_image() { if (isset($_POST…
upvote count: 1
has comment: http://stackoverflow.com/comment/46183193
type: Question
linked to: http://stackoverflow.com/q/14069421
has comment: http://stackoverflow.com/comment/46183677
has answer: http://stackoverflow.com/a/28966838
tagged with: javascript
has comment: http://stackoverflow.com/comment/46183376
accepted answer: http://stackoverflow.com/a/28966838
answer count: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/46183091
tagged with: jquery
has comment: http://stackoverflow.com/comment/46183161
favorite count: 0

http://stackoverflow.com/q/28929039
has body: I want to check domain availability with php and ajax request. Requests will be sent to "whois.apitruck.com" API like this: "whois.apitruck.com/domain.com". For each domain, a request is sent. I want to append table after complate all ajax request but this not work! $(document).ready(function () { $("#submit").click(function () { var domain = $('#domains').val().split("\n"); var all_suffix = ["com","net","org","ir","biz","info","us","name","pro","eu","in","me","tv","cc"]; var counter = 0; var TableDataString = ' ID Domain Name .Com .Net .Org .Ir .Biz .Info .Us .Name .Pro .In .Me .Tv .Cc '; var domain_count = domain.length; $.each(domain, function (i, val) { //increase i counter counter++; TableDataString += ' '+ counter +' '+ val +' '; $('input[type=checkbox]:checkbox:checked').each(function () { var flag = ''; var suffix = $(this).val(); $.ajax({ type: "POST", url: "includes/ajax/ajax.php", dataType: "json", data: {domain: val, suffix: suffix}, success: function (msg) { flag = msg.suc; }, error: function (err) { $('#domain_tables').html(err.error); } });//end $.ajax if(flag){TableDataString += ' ';}else{TableDataString += ' ';} });//end get each suffix TableDataString += ' '; });//end each domain TableDataString += ' '; if(counter === domain_count){ $(document).ajaxComplete(function(){ $('#domain_tables').append(TableDataString); }); } }); }); I am used a flag and check this after $.ajax. The display problem solved. But for each ajax request echo a new table, If that display one table for all ajax request. How to append table after complate all ajax request?! Another problem is that check flag does not work properly! why?!
has comment: http://stackoverflow.com/comment/46114371
tagged with: php
has comment: http://stackoverflow.com/comment/46114424
type: AnsweredQuestion
score: 3
has title: How to append table after complate all ajax request
has comment: http://stackoverflow.com/comment/46114835
has comment: http://stackoverflow.com/comment/46114647
type: Question
has comment: http://stackoverflow.com/comment/46114339
answer count: 2
possible better answer: http://stackoverflow.com/a/28929591
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/46114476
tagged with: ajax
has comment: http://stackoverflow.com/comment/46114778
upvote count: 3
has answer: http://stackoverflow.com/a/28929591
has comment: http://stackoverflow.com/comment/46114725
has answer: http://stackoverflow.com/a/28930953
accepted answer: http://stackoverflow.com/a/28930953
has comment: http://stackoverflow.com/comment/46114780

http://stackoverflow.com/comment/46187177
type: QuestionComment
comment on: http://stackoverflow.com/q/28967648
type: Comment
has text: The regex link above is a good answer, however you might want to change it to something like `/\(([0-9 .]*)\)/` just to filter out any invalid responses (i.e. error messing inside the brackets) by only accepting numbers, '.' and ' ' values.
score: 0

http://stackoverflow.com/comment/46276439
comment on: http://stackoverflow.com/a/29015886
score: 0
type: AnswerComment
type: Comment
has text: innerText does not work, it gives undefined

http://stackoverflow.com/a/29052135
answers question: http://stackoverflow.com/q/29052105
has body: you multiple bStyle by 2 and doing the bitwise or. I guess they have to encode it, so that it will give you the numbers in 0-3
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29052105
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29040511
has answer: http://stackoverflow.com/a/29040622
downvote count: 1
type: AnsweredQuestion
tagged with: javascript
has body: I hope you all are doing just fine. I have a little problem when creating a route on google maps: I create polygons dinamically from information stored in a database and I want an alert to be shown when the route I create passes by the polygon. The problem is that no markers are generated inside the polygon, therefore no alert is shown, so I want to know if there is walkaround for this. This is the code I use: var posiciones; var rendererOptions = { draggable: true }; var directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions); var directionsService = new google.maps.DirectionsService(); var map; var polys = new Array(); var resultado; var routCoordinates; var respuesta; var myPolygons = [ <asp:Repeater ID='rptMarkers' runat='server'> { "name": '<%# Eval("carajo") %>', "coordinates": [ '<%# Eval("poligono1") %>', '<%# Eval("poligono2") %>', '<%# Eval("poligono3") %>', '<%# Eval("poligono4") %>' ] } , </asp:Repeater> ]; function drawPolygon(poly, polyLabel) { var options = { paths: poly, strokeColor: '#AA2143', strokeOpacity: 1, strokeWeight: 2, fillColor: "#FF6600", fillOpacity: 0.7, polyTitle: polyLabel }; newPoly = new google.maps.Polygon(options); newPoly.setMap(map); polys.push(newPoly); } function sendPolygonForDrawing() { for (var i = 0; i < myPolygons.length; i++) { poly = new Array(); var coord = myPolygons[i].coordinates; var lng = coord.length; for (var j = 0; j < lng; j++) { var longit_Latid = coord[j].split(','); poly.push(new google.maps.LatLng(parseFloat(longit_Latid[0]), parseFloat(longit_Latid[1]))); } drawPolygon(poly, myPolygons[i].name); poly.pop(); } } var trucka = new google.maps.LatLng(21.984797, -102.27668); function initialize() { var mapOptions = { zoom: 12, center: trucka }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); directionsDisplay.setMap(map); //directionsDisplay.setPanel(document.getElementById('directionsPanel')); directionsDisplay.setPanel(document.getElementById('hola')); google.map…
score: -1
tagged with: google-maps-api-3
type: Question
tagged with: polygon
tagged with: google-maps
upvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29040622
favorite count: 0
has title: Show alert when route crosses polygon in google maps, no markers near the polygon

http://stackoverflow.com/comment/46120399
comment on: http://stackoverflow.com/q/28932322
type: QuestionComment
type: Comment
has text: ... and `null` becomes `"null"`. You need an `if` statement there.
score: 0

http://stackoverflow.com/comment/47576708
comment on: http://stackoverflow.com/a/28915435
has text: Yes, I think it deserves a downvote because I consider it a bad practise (And it's not only drifting, but also readability and maintainability, what if someone changes `1000` to `1500` but misses to adjust `2000`?). It doesn't matter whether OP upvoted or not, or whether he accepted it. I'm not hating around, and my votes are not personal. It's just when I come across a good answer, I upvote it, and when I come across a bad answer I downvote and comment what is wrong/could be improved from my pov.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28918232
score: 102
accepted answer: http://stackoverflow.com/a/28918362
linked to: http://stackoverflow.com/q/1423081
has answer: http://stackoverflow.com/a/67279292
has answer: http://stackoverflow.com/a/43294507
has answer: http://stackoverflow.com/a/38110857
upvote count: 102
has answer: http://stackoverflow.com/a/35078054
tagged with: dictionary
has comment: http://stackoverflow.com/comment/102026002
has answer: http://stackoverflow.com/a/48169704
has answer: http://stackoverflow.com/a/28918362
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/69315246
linked to: http://stackoverflow.com/q/43704904
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/29085197
has title: How do I persist a ES6 Map in localstorage (or elsewhere)?
has answer: http://stackoverflow.com/a/78421968
type: Question
tagged with: ecmascript-6
has answer: http://stackoverflow.com/a/47718992
has answer: http://stackoverflow.com/a/51221692
tagged with: javascript
linked to: http://stackoverflow.com/q/31190885
answer count: 11
possible better answer: http://stackoverflow.com/a/48169704
has body: var a = new Map('a', 1 ); a.get('a') // 1 var forStorageSomewhere = JSON.stringify(a); // Store, in my case, in localStorage. // Later: var a = JSON.parse(forStorageSomewhere); a.get('a') // TypeError: undefined is not a function Unfortunately JSON.stringify(a); simply returns '{}', which means a becomes an empty object when restored. I found es6-mapify which allows up/down-casting between a Map and a plain object, so that might be one solution, but I was hoping I wouldn't need to resort to an external dependency simply to persist my map.
downvote count: 0
has answer: http://stackoverflow.com/a/57730562
favorite count: 0

http://stackoverflow.com/comment/46353273
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29046490
has text: @Mike'Pomax'Kamermans I've edited the question to include the details you mentioned as well. Also, I think the problem has something to do with the namespace. I can call setMosaic from INSIDE setup() in sketch, but not from a tag in the html page. when I try calling p5.setMosaic(), it says p5 is not defined. Can be a javascript nuance I don't know about. Thanks

http://stackoverflow.com/comment/46260420
score: 0
type: AnswerComment
type: Comment
has text: i think i found the problem..or maybe not..you have set the ng-model as input.. in my case i have another ng-model.. see my edit
comment on: http://stackoverflow.com/a/29006914

bluebird
tags question: http://stackoverflow.com/q/28949178
tags question: http://stackoverflow.com/q/29042208
tags question: http://stackoverflow.com/q/28931084
tags question: http://stackoverflow.com/q/28958458
tags question: http://stackoverflow.com/q/28926055
tags question: http://stackoverflow.com/q/29013899
tags question: http://stackoverflow.com/q/28956080
tag name: bluebird
tags question: http://stackoverflow.com/q/28915677
tags question: http://stackoverflow.com/q/29021783
type: Tag
tags question: http://stackoverflow.com/q/29000478
tags question: http://stackoverflow.com/q/29038585

http://stackoverflow.com/a/28967475
upvote count: 1
downvote count: 0
has body: JSON is a format used to store data in a structured format, while POST is an HTTP protocol which is typically used to send data to a server. To save your data to a file called orders.json, you'll have to create a server-side script that can has permission to interact with your filesystem. Client-side code (like Javascript in the browser) can't do this, because it doesn't run on the server. Here's some untested PHP code to take a value from $_POST['data'] and save it to orders.json. It is important to note that this will simply slap your data onto the end of the file, and will not keep structure. It is highly advised to use a database to store structured data, rather than invent your own format and write APIs for it. if($_POST['data'] &amp;&amp; strlen($_POST['data']) &gt; 0) { //This is super dangerous - saving user input directly to a file. //I'm not sure exactly what $_POST['data'] will contain for you, so please make sure it's sanitized before doing this file_put_contents("orders.json", $_POST['data'], FILE_APPEND | LOCK_EX); } Then just call it with AJAX: $http.post('filesaver.php', order) .success(function(data, status, headers, config) { //do stuff }) .error(function(data, status, headers, config) { //do different stuff });
type: Answer
answers question: http://stackoverflow.com/q/28966986
score: 1

http://stackoverflow.com/q/29037288
downvote count: 0
tagged with: javascript
has body: I'm working on converting some C# code to Javascript. I have the following code snippet. float goldenRatioConjugate = 0.618033988749895f; float currentHue = (float) random.NextDouble(); currentHue += goldenRatioConjugate; currentHue %= 1.0f; My question is I don't understand what the last line is doing? I've never seen a modulo operation with a float.
answer count: 2
has comment: http://stackoverflow.com/comment/46315482
favorite count: 0
type: UnansweredQuestion
has title: Converting some C# code to Javascript
linked to: http://stackoverflow.com/q/20671518
score: 3
has answer: http://stackoverflow.com/a/29037458
upvote count: 3
has comment: http://stackoverflow.com/comment/46317926
duplicate of: http://stackoverflow.com/q/20671518
type: Question
has answer: http://stackoverflow.com/a/29037332
tagged with: c#

http://stackoverflow.com/q/29027675
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46297243
has comment: http://stackoverflow.com/comment/46297622
has answer: http://stackoverflow.com/a/29027819
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/29027819
downvote count: 0
tagged with: javascript
has body: I'm trying to make a simple Angular/Express todo-list app, and I ran into quite a bit of trouble. It's still in the works, but when I ran the code below on localhost:3000 I ended up getting {{ thing }} literally printed in the webpage. My file paths are: app js app.js index.html node_modules (here lies angular, express, etc) index.js package.json Here is my code for index.html: Angular-Express Test App Item Remove {{ item }} Done? Here is my code for index.js: var express = require('express'); var app = express(); var http = require('http').Server(app); var bodyParser = require('body-parser'); var jsonParser = bodyParser.json(); var urlencodedParser = bodyParser.urlencoded({ extended: false }); app.set('port', process.env.OPENSHIFT_NODEJS_PORT || 3000); //yes I plan to deploy to OpenShift app.set('ipaddr', process.env.OPENSHIFT_NODEJS_IP || "127.0.0.1"); app.get('*', function(req, res){ res.sendFile(__dirname + '/app/index.html', res); }); http.listen(3000, function () { 'use strict'; console.log('Express server listening on IP: ' + app.get('ipaddr') + ' and port ' + app.get('port')); }); And app.js: angular.module('testApp', ['ngRoute']) .controller('TestCtrl', [$scope, function ($scope) { 'use strict'; $scope.items = ["foo", "bar"]; }]); Here's a screenshot of what I see, though there really isn't much in it that I haven't mentioned already...: http://puu.sh/gyhjT/684fa116f7.png I spent a ridiculous amount of time trying to figure out what went wrong, so any help at all would be greatly appreciated!
has title: Configuring Express and Angular
tagged with: express
has answer: http://stackoverflow.com/a/29028077
has comment: http://stackoverflow.com/comment/46297395
has comment: http://stackoverflow.com/comment/46311322
score: 1
favorite count: 0
tagged with: angularjs
upvote count: 1
accepted answer: http://stackoverflow.com/a/29028077

http://stackoverflow.com/q/29055333
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29055420
has title: HTML - CSS - How to left-align images in a centered and resizable parent
favorite count: 0
has comment: http://stackoverflow.com/comment/46347946
has comment: http://stackoverflow.com/comment/46348207
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46347962
has answer: http://stackoverflow.com/a/29056609
downvote count: 0
score: 1
has body: I have a lot of thumbnails in my page: I want them to be centered, but the last line looks awful while resizing and I have something like one or two orphan images floating in the center of the page. The last line should be left-aligned. How to do it? I tried to insert another div with "margin:0 auto 0 auto;" but it doesn't work. https://jsfiddle.net/4hw4fkm9/ What I try to have: &lt;div style="text-align:center;"&gt; &lt;img /&gt; &lt;img /&gt; &lt;img /&gt; &lt;img /&gt; etc.. &lt;/div&gt;
type: Question
has comment: http://stackoverflow.com/comment/46348303
upvote count: 1
tagged with: javascript
tagged with: alignment
answer count: 3
has comment: http://stackoverflow.com/comment/46348250
has answer: http://stackoverflow.com/a/29055361

http://stackoverflow.com/q/29034951
tagged with: dom
has comment: http://stackoverflow.com/comment/46311326
answer count: 1
has answer: http://stackoverflow.com/a/29035571
has comment: http://stackoverflow.com/comment/46311023
tagged with: javascript
score: 0
has body: I want adding elements to DOM while avoid page reflowing. My questions: var Span = document.createElement('span'); document.body.appendChild(Span); // Span doesn't contain any child node // and isn't setted or inherited any style // so Span has width = height = 0 Will adding Span to DOM cause page reflowing? // After adding Span to DOM, // I need to add style and text to Span. // In order to avoid page reflowing, I set style 'display:none' to Span. Span.style.cssText = 'display:none;other:value'; Span.textContent = 'some text'; Can I use style.cssText property to set display:none and other css properties and avoiding page reflowing? Or do I have to set style.display = none to avoid page reflowing first then use cssText to set other properties later? Waiting for your advice and thanks for reading!
has comment: http://stackoverflow.com/comment/46310746
has title: DOM: Adding empty element to DOM and page reflowing
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/46310837
has comment: http://stackoverflow.com/comment/46313989

http://stackoverflow.com/a/29057676
score: 0
answers question: http://stackoverflow.com/q/29057632
type: Answer
has body: Right hold up, you're trying to reinvent the wheel here! :) Have a look at the Jquery tabs library: http://jqueryui.com/tabs/ Just copy the code into your site, remove the style sheet link and away you go! :D

http://stackoverflow.com/q/28998363
has body: I'm using Bootstrap with a couple of components (removing them individually didn't fix the problem - but for the sake of completeness, here's a list). I'd like to load remote content (test.html) into a Modal. It all works fine on a standalone html page, but when I insert the exact same code into my project's layout, nodemon gives me a "GET test.html 404". The Modal still opens, but the remote page isn't loaded (apparently it can't find it, and I don't understand why) and the "yada yada" appears in the modal-body instead. &lt;script src="/javascripts/jquery.js"&gt;&lt;/script&gt; &lt;script src="/javascripts/bootstrap.js"&gt;&lt;/script&gt; &lt;script src="/javascripts/bootstrap-tagsinput.js"&gt;&lt;/script&gt; &lt;script src="/javascripts/typeahead.bundle.js"&gt;&lt;/script&gt; &lt;script src="/javascripts/pinboot.js"&gt;&lt;/script&gt; &lt;script src="/javascripts/bootstrap-dialog.js"&gt;&lt;/script&gt; &lt;script&gt; $("#myModal").on("show.bs.modal", function(e) { var link = $(e.relatedTarget); $(this).find(".modal-body").load(link.attr("href")); }); &lt;/script&gt; &lt;a href="test.html" data-toggle="modal" data-target="#myModal" class="btn btn-default"&gt;Launch Modal&lt;/a&gt; &lt;!-- Default bootstrap modal example --&gt; &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Modal title&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt;yada yada&lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div…
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: twitter-bootstrap-3
has title: bootstrap 3.3 modal remote content gives 404
has answer: http://stackoverflow.com/a/28999244
type: UnansweredQuestion
tagged with: http-status-code-404
tagged with: node.js
type: Question

http://stackoverflow.com/comment/46357271
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29059525
has text: @stylesenberg thanks for trying out but i guess you didn't get my question. In my case everytime if i click on next button table get re-draw and complete selected data of previous page get reset . If were to use localstorage 1) how efficient it will be , how much i can store here . I am pretty sure i am missing something here , surely datatables have this feature but not sure how to do that
type: AnswerComment

http://stackoverflow.com/q/28908788
tagged with: asynchronous
tagged with: synchronization
favorite count: 0
has body: I am getting an error while setting a class property in javascript class. I am using nodejs prompt module to get user input and setting it to the class property. But i am getting following error. TypeError: Cannot read property 'resultAge' of undefined I figured it out that it has something to do with synchronization, but i am not able to figure it out that how to implement it for this situation. Also i want to prompt user again until he has entered a valid number (I can not use a do while loop, what might be the solution?) var prompt = require("prompt"); var ageTotal = function(){ this.resultAge = 0; this.getUserAge = function(){ prompt.start(); //i want to run this until valid input is entered prompt.get(["age"], function(err, result){ //I know i have to convert userInput to int but thats for later this.resultAge += result.age }); } } ageTotal.prototype.displayTotalAge = function(){ return this.resultAge; } var a = new ageTotal(); a.getUserAge(); var age = a.displayTotalAge(); console.log(age); //This is running before the above function finishes EDIT: The problem setting resultAge is solved but now the problem is var age = a.displayTotalAge(); is evaluated after console.log(age) which results in 0;
tagged with: node.js
score: -1
type: AnsweredQuestion
has title: Error assigning value to JavaScript class property
accepted answer: http://stackoverflow.com/a/28908883
downvote count: 1
type: Question
tagged with: prompt
tagged with: javascript
upvote count: 0
has answer: http://stackoverflow.com/a/28908883
answer count: 1

http://stackoverflow.com/q/28989142
has comment: http://stackoverflow.com/comment/46226749
upvote count: 1
downvote count: 1
favorite count: 0
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46237666
has title: javascript show hide div onload dynamically
has comment: http://stackoverflow.com/comment/46226793
has comment: http://stackoverflow.com/comment/46238963
has comment: http://stackoverflow.com/comment/46237810
type: Question
has body: I want to use a javascript loop to check if a div exists and if it does show it onload. I have been tasked with this but am very much a novice when it comes to javascript. Here is my javascript: function createtitleid() { var div_title = []; for (i = 1; i < 10;) { var title = 'div_title' + i; if (document.getElementById(title)) { document.getElementById(title).style.display = "block"; } i++; } } HTML: Text I have added the createtitleid function to the onload statement. Right now nothing happens, but when I check the console there are no errors. The final page will have anywhere between 1 and 10 divs with an id using the naming convention of div_title and the number. The script should check to see if the div id exists and if so show the title. Any help would be greatly appreciated.
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46237865
has comment: http://stackoverflow.com/comment/46237904

http://stackoverflow.com/q/29046537
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/29048287
type: Question
tagged with: slidetoggle
tagged with: javascript
has body: I have a bit of js toggle code that has worked for me in the past but isn't working after I've altered it for another project. For some reason there is a display:none; property that will not toggle. It might be because I have moved the div that is to be toggled; originally it came directly after the triggering div but I now have it in a seperate li element. I'm an amateur coder and a bit confused as to what is going on. Any help is greatly appreciated! Here's a fiddle: https://jsfiddle.net/mfqa5ahb/1/ When I inspect the html of the fiddle this shows up as an attribute of the div I want toggled (davebiobox): element.style { display: none; } And if I temporarily disable this attribute and click the view/hide bio button it toggles properly once and then resets to display:none; Here's the code: HTML: Dave Henderson CPA, CA, Partner VIEW BIO Dave Henderson DAVE DAVE DAVE DAVE DAVE DAVE CSS: .ourteamlist{ max-width:1200px; padding-left:30px; padding-right:10px; background-color:#eeeeee; text-align:center; margin:0 auto; margin-left:-1px; clear:both; } .ourteamlist ul li{ display:inline-block; margin-right:-3px; text-align:left; margin-top:1px; } .profilepic{ height:205px; width:299px; padding-left:0px; padding-right:1px; padding-bottom:1px; } .lilbluebox{ background-color:#FFFFFF; margin-top:-5px; width:299px; height:80px; } .teambox{ padding-left:30px; padding-top:20px; width:100%; } .teambox ul li{ display:inline-block; } .viewbio{ font-size:11px; font-weight:600; text-align:right; margin-right:30px; color:#888888; cursor:pointer; letter-spacing:1px; } .teambox ul li a{ text-decoration: none; } #davebiobox{ position:relative; display:inline-block; max-width:1200px; height:287px; background:#FFFFFF; } #davebiobox:after{ content:""; position:relative; display:block; width:0; height:0; } .bioleft{ position:relative; float:left; width:50%; } .bioright{ position:relative; float:right; width:50%; } JS: $(document).ready(function () { $(".viewbio").click(function() { var $self…
accepted answer: http://stackoverflow.com/a/29048287
downvote count: 0
answer count: 1
has title: elements won't display for js toggle function
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/a/28958752
answers question: http://stackoverflow.com/q/28958573
has body: Try this: var arr = [1,2,3,4,4,4,4,4,5,6,6,6], result = [], fisrtOccurence = -1; for(var i=0; i&lt;arr.length; i++) { fisrtOccurence = result.indexOf(arr[i]); if(fisrtOccurence === -1) { result.push(arr[i]); } else { if(result.indexOf(arr[i],fisrtOccurence+1) === -1) { result.push(arr[i]); } } } console.log(result);
score: 0
type: Answer

http://stackoverflow.com/comment/46354011
has text: Please don't add additional information as comment, use the [edit](https://stackoverflow.com/posts/29058703/edit) button instead.
type: Comment
comment on: http://stackoverflow.com/q/29058703
type: QuestionComment
score: 0

http://stackoverflow.com/comment/46214027
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28982207
has text: yes.. onclick is the event
score: 0

css
tags question: http://stackoverflow.com/q/29025032
tags question: http://stackoverflow.com/q/28920958
tags question: http://stackoverflow.com/q/28974211
tags question: http://stackoverflow.com/q/28974438
tags question: http://stackoverflow.com/q/28996776
tags question: http://stackoverflow.com/q/28909327
tags question: http://stackoverflow.com/q/29046918
tags question: http://stackoverflow.com/q/28909673
tags question: http://stackoverflow.com/q/28921115
tags question: http://stackoverflow.com/q/28915081
tags question: http://stackoverflow.com/q/29030766
tags question: http://stackoverflow.com/q/29038960
tags question: http://stackoverflow.com/q/28975622
tags question: http://stackoverflow.com/q/29012590
tags question: http://stackoverflow.com/q/28929817
tags question: http://stackoverflow.com/q/29003615
tags question: http://stackoverflow.com/q/29026062
tags question: http://stackoverflow.com/q/28924482
tags question: http://stackoverflow.com/q/28960639
tags question: http://stackoverflow.com/q/29058174
tags question: http://stackoverflow.com/q/28945774
tags question: http://stackoverflow.com/q/29042772
tags question: http://stackoverflow.com/q/29001527
tags question: http://stackoverflow.com/q/28973766
tags question: http://stackoverflow.com/q/28945376
tags question: http://stackoverflow.com/q/28947548
tags question: http://stackoverflow.com/q/29034522
tags question: http://stackoverflow.com/q/29037193
tags question: http://stackoverflow.com/q/29052033
tags question: http://stackoverflow.com/q/28931985
tags question: http://stackoverflow.com/q/28931318
tags question: http://stackoverflow.com/q/29052888
tags question: http://stackoverflow.com/q/28997744
tags question: http://stackoverflow.com/q/28993739
tags question: http://stackoverflow.com/q/28916680
tags question: http://stackoverflow.com/q/28913571
tags question: http://stackoverflow.com/q/29035475
tags question: http://stackoverflow.com/q/28943090
tags question: http://stackoverflow.com/q/29042629
tags question: http://stackoverflow.com/q/28948275
tags question: http://stackoverflow.com/q/29019343
tags question: http://stackoverflow.com/q/28917119
tags question: http://stackoverflow.com/q/29061644
tags question: http://stackoverflow.com/q/29022553
tags question: http://stackoverflow.com/q/29017022
tags question: http://stackoverflow.com/q/29039653
tags question: http://stackoverflow.com/q/28977925
tags question: http://stackoverflow.com/q/28988043
tags question: http://stackoverflow.com/q/28950987
tags question: http://stackoverflow.com/q/29002530
tags question: http://stackoverflow.com/q/29041272
tags question: http://stackoverflow.com/q/28925446
tags question: http://stackoverflow.com/q/29009577
tags question: http://stackoverflow.com/q/29061814
tags question: http://stackoverflow.com/q/29010534
tags question: http://stackoverflow.com/q/28995451
tags question: http://stackoverflow.com/q/28967128
tags question: http://stackoverflow.com/q/29044332
tags question: http://stackoverflow.com/q/29057429
tags question: http://stackoverflow.com/q/28971881
tags question: http://stackoverflow.com/q/28966142
tags question: http://stackoverflow.com/q/29055501
tags question: http://stackoverflow.com/q/28990558
tags question: http://stackoverflow.com/q/28951275
tags question: http://stackoverflow.com/q/29016484
tags question: http://stackoverflow.com/q/28908616
tags question: http://stackoverflow.com/q/28929020
tags question: http://stackoverflow.com/q/29004213
tags question: http://stackoverflow.com/q/28935047
tags question: http://stackoverflow.com/q/28923355
tags question: http://stackoverflow.com/q/28912599
tags question: http://stackoverflow.com/q/28944163
tags question: http://stackoverflow.com/q/29056779
tags question: http://stackoverflow.com/q/29019762
tags question: http://stackoverflow.com/q/29031287
tags question: http://stackoverflow.com/q/28929869
tags question: http://stackoverflow.com/q/28927091
tags question: http://stackoverflow.com/q/29060039
tags question: http://stackoverflow.com/q/29055824
tags question: http://stackoverflow.com/q/29029691

http://stackoverflow.com/a/28941068
has comment: http://stackoverflow.com/comment/46136944
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46136896
type: Answer
has body: I don't really know how you are printing your element. First of all, your tags inside the <li are not valid, you should not use the "-" character inside a data, therefore I would suggest you to change your HTML to this: First description Note: the image is a PLACEHOLDER in this html, change it to what you have in your own page. That said, just to give you a tip, here is a little snippet to do something that will insert into the data-thumbnailOverlayColor the HEX of the RGB data of the image provided inside data-thumbnailPath: Javascript: First, we have to write a function to convert the RGB result to a valid HEX code.. And we're going to steal that here: RGB to Hex and Hex to RGB function componentToHex(c) { var hex = c.toString(16); return hex.length == 1 ? "0" + hex : hex; } function rgbToHex(r, g, b) { return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b); } Second, we're going to loop through EACH element of the DOM and we will create an image object from the data-thumbnailPath. From that image object, we will temporarely create an instance of ColorFinder, retrieve the Most prominent color and PARSE it inside the data-thumbnailOverlayColor : var liIterator = document.getElementsByTagName("li"); for (var i = 0; i < liIterator.length; i++) { var img = new Image(); img.src = liIterator[i].dataset.thumbnailPath; var rgb = new ColorFinder().getMostProminentColor(img); liIterator[i].setAttribute("data-thumbnailOverlayColor", rgbToHex(rgb.r, rgb.g, rgb.b)); } The output is the following [visual]: And the HTML output is this: The working fiddle can be found here: http://jsfiddle.net/82bo2wtx/ EDIT: I'm wrong about the tag elements, "-" is accepted, but the above example works too. In order to give you less work to do, here is the fiddle working for YOUR specific case: you just have to copy the following in a script and include that in your document or, even easier, at the very bottom of your document (just slightly before the , write this: http://jsfidd…
accepted answer of: http://stackoverflow.com/q/28940241
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46137687
answers question: http://stackoverflow.com/q/28940241

http://stackoverflow.com/comment/46095375
comment on: http://stackoverflow.com/a/28918536
score: 0
has text: Thank you so so much! That's what I wanted yeah.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46794816
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29035005
has text: do you still need help?

http://stackoverflow.com/a/28996872
answers question: http://stackoverflow.com/q/28996820
has comment: http://stackoverflow.com/comment/46242531
score: 0
has comment: http://stackoverflow.com/comment/46251416
has comment: http://stackoverflow.com/comment/46242068
has comment: http://stackoverflow.com/comment/46242006
has comment: http://stackoverflow.com/comment/46533309
has comment: http://stackoverflow.com/comment/46531415
has comment: http://stackoverflow.com/comment/46242643
type: Answer
has comment: http://stackoverflow.com/comment/46268432
has comment: http://stackoverflow.com/comment/46242093
has body: You wouldn't store a ref to the address, you'd store a ref to 'User' user: {type: Schema.Types.ObjectId, ref: 'User'} Because the address is under the user key. Then you can retrieve the address via order.user.address which is still only one populate because address is embedded in the user document. I also wouldn't get in the habit of calling these joins, because they're not. They're just a second round trip to the database, so you should avoid these like the plague whenever possible. An alternative solution might be just storing userAddress as an embedded document on the order model if you need to access this often

http://stackoverflow.com/q/29028537
has comment: http://stackoverflow.com/comment/46299541
has comment: http://stackoverflow.com/comment/46299294
has comment: http://stackoverflow.com/comment/46310100
favorite count: 0
has answer: http://stackoverflow.com/a/29028615
has answer: http://stackoverflow.com/a/29028636
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46309880
answer count: 4
tagged with: node.js
has answer: http://stackoverflow.com/a/29028689
score: 1
has answer: http://stackoverflow.com/a/29028639
has body: What is the difference between following snippets // calling a function function execute(){ } function fn(){ asynchronousFunction(function(){ execute(); }) } fn(); How the below snippet is different from above // callback a function function execute(){ } function fn(done){ asynchronousFunction(function(){ done(); }) } fn(execute); In which way callback is different from calling a function directly? What are pros and cons of each approach?
downvote count: 2
has comment: http://stackoverflow.com/comment/46298757
type: Question
has comment: http://stackoverflow.com/comment/46298716
tagged with: javascript
has title: What is difference between calling a function and callback function?
upvote count: 3

http://stackoverflow.com/comment/46127658
has text: buddy @Jennifer, plz provide ur javascript try code...
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28936150

http://stackoverflow.com/q/28990565
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/39312736
possible better answer: http://stackoverflow.com/a/62527947
has answer: http://stackoverflow.com/a/28990793
has answer: http://stackoverflow.com/a/62527947
tagged with: google-chrome
has title: DELETE is not allowed by Access-Control-Allow-Methods
tagged with: http
has comment: http://stackoverflow.com/comment/46229494
type: AnsweredQuestion
has body: I'm trying to send a cross-origin DELETE request from Chrome using jQuery. However, that fail with the following error message being logged in the developer console: XMLHttpRequest cannot load http://actual/url/here. Method DELETE is not allowed by Access-Control-Allow-Methods. The javascript code is running on localhost and looks like this: $.ajax({ type: "DELETE", url: "http://actual/url/here", xhrFields: { withCredentials: true } }); This results in a pre-flight request like this being sent: OPTIONS http://actual/url/here HTTP/1.1 Host: actual Connection: keep-alive Access-Control-Request-Method: DELETE Origin: null User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36 Access-Control-Request-Headers: accept Accept: */* Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8 And the response looks like this: HTTP/1.1 200 OK Cache-Control: must-revalidate, private Content-Length: 0 Server: Microsoft-HTTPAPI/2.0 Access-Control-Allow-Methods: DELETE GET HEAD POST PUT OPTIONS TRACE Access-Control-Allow-Headers: accept Access-Control-Max-Age: 900 Access-Control-Allow-Origin: null Access-Control-Allow-Credentials: true Date: Wed, 11 Mar 2015 15:03:46 GMT As far as I can tell this is just fine. The client checks whether DELETE is allowed by sending Access-Control-Request-Method: DELETE and the server says that it is allowed by responding with Access-Control-Allow-Methods: DELETE GET HEAD POST PUT OPTIONS TRACE. However, no DELETE request is ever sent and the error message (above) is reported instead. Why?
score: 10
upvote count: 10
linked to: http://stackoverflow.com/q/20144847
type: Question
answer count: 2
tagged with: cors
accepted answer: http://stackoverflow.com/a/28990793

http://stackoverflow.com/a/28953638
score: 0
has body: You are doing +1 when the text is not yet faded out. To solve that, move everything inside the fadeOut() callback: var questions = ["Question 1","Question 2","Question 3","Question 4"]; var currentQuestionIndex = 0; function showQuestion() { if (currentQuestionIndex &lt;= questions.length-1) { var question = $('#question'); question.fadeOut(400, function () { question.text(questions[currentQuestionIndex]); question.fadeIn(400); currentQuestionIndex = currentQuestionIndex+1; questionTimer(); }); } else { console.log("End question 1"); } } function questionTimer() { setTimeout(function () { showQuestion(); }, 3000); } showQuestion(); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="question"&gt;&lt;/div&gt;
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28953529
accepted answer of: http://stackoverflow.com/q/28953529

http://stackoverflow.com/comment/46073728
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28906836
score: 0
has text: @djechlin ofcourse, where I am unsure is how you check the dynmic keys in the object array against each other and have them overrite the value if they are the same, else push in

http://stackoverflow.com/q/29059249
type: AnsweredQuestion
has body: i have dragged a (dropdownlist) and i try to add a button beside it, in the design view it is beside the (dropdownlist) but when i run it, i see a more than five space between them see the below code. i don't know what to do actually. i have tried to put them into a table one row with two columns but the space between them is quite a lot. i only want one space between them &lt;asp:DropDownList ID="DropDownList1" runat="server" Height="16px" Width="280px"&gt; &lt;/asp:DropDownList&gt; &lt;asp:Button ID="Button1" runat="server" Text="Button" /&gt; in design view in run mode
has comment: http://stackoverflow.com/comment/46355901
type: Question
upvote count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/46356099
accepted answer: http://stackoverflow.com/a/29060049
answer count: 1
downvote count: 0
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/29060049
has title: how to put a button beside a dropdownlist in asp.net properly?
score: 2

http://stackoverflow.com/q/29007801
type: Question
has comment: http://stackoverflow.com/comment/115600899
has comment: http://stackoverflow.com/comment/46261018
tagged with: javascript
score: 4
has body: I have a jquery Datetimepicker and i want to disable the keyboard input. I want only edit this field over the picker (Modalbox).
upvote count: 4
has comment: http://stackoverflow.com/comment/46262390
answer count: 3
possible better answer: http://stackoverflow.com/a/55592910
has comment: http://stackoverflow.com/comment/46261031
downvote count: 0
linked to: http://stackoverflow.com/q/153759
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29008074
type: AnsweredQuestion
has title: Disable Keyboard in Input Textfield
has answer: http://stackoverflow.com/a/55592910
has answer: http://stackoverflow.com/a/29007907
accepted answer: http://stackoverflow.com/a/29007907

http://stackoverflow.com/comment/46180293
comment on: http://stackoverflow.com/a/28964266
has text: Don't think that's overriding the shape constructor .., it's hiding the shape constructor in the current scope, as it's `var shape =` and not `shape =`
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46111219
type: QuestionComment
has text: Found a solution now with `message.match(new RegExp('^!' + cmd, 'i'))`
comment on: http://stackoverflow.com/q/28919869
score: 0
type: Comment

http://stackoverflow.com/comment/46139330
type: QuestionComment
comment on: http://stackoverflow.com/q/28941675
has text: I assume you have explicitly set the font-family by highlighting the words in Word and setting the font-family to Calibri?
score: 0
type: Comment

http://stackoverflow.com/comment/46243702
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28997738
score: 0
has text: `$("#no_need_click").click();`

http://stackoverflow.com/comment/46117977
comment on: http://stackoverflow.com/a/28928787
type: Comment
has text: I need only 1 loop of function A.. it should start every 60 seconds OR with button 1 click... for example: Page load = First call.. after 25 seconds you click on button = second call.. that means the next call (if the button is not clicked) will be on second 85 (25+60) after page load.. I deleted "setTimeOut" and added a setInterval(A(), 60000); at the end of the script but it is not working..
score: 0
type: AnswerComment

http://stackoverflow.com/q/29043746
downvote count: 1
has comment: http://stackoverflow.com/comment/46327842
type: Question
has answer: http://stackoverflow.com/a/29043774
upvote count: 0
tagged with: javascript
score: -1
possible better answer: http://stackoverflow.com/a/29043812
has answer: http://stackoverflow.com/a/29043962
accepted answer: http://stackoverflow.com/a/29043774
has answer: http://stackoverflow.com/a/29043812
answer count: 3
has comment: http://stackoverflow.com/comment/46327303
favorite count: 0
has title: Why javascript return object place of true or false
has body: I try to get the return value (true or false) of the fonction but the result is only an circular object, so I can't use this function. The code used: function check_session(data) { var sql_read_req="SELECT * FROM "+appconfig['bdd_table']+" WHERE `"+appconfig['bdd_pseudo']+"`="+mySqlRead.escape(data.name)+" AND `"+appconfig['bdd_session_hash']+"`="+mySqlRead.escape(data.session)+" AND `"+appconfig['bdd_is_valide']+"`=1"; mySqlRead.query(sql_read_req, function (err, result){ if((result)&amp;&amp;(result.length!=0)){ console.log('session ok: '+result); return true; } else { return false; } }); } So check_session(data) return Object. I can't serialize the result because it's a circular object. Where is the error?
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/q/29042886
tagged with: css
has body: I'm making a website and I have this code that blur out the background: CSS #background{ background: url(img/bg.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; width: 100%; min-height: calc(100% - 96px); -o-transition: all 750ms; -moz-transition: all 750ms; -webkit-transition: all 750ms; transition: all 750ms } .covered{ background: url(img/bgb.jpg) no-repeat center center fixed!important; -webkit-background-size: cover!important; -moz-background-size: cover!important; -o-background-size: cover!important; background-size: cover!important; } jQuery $('.overlay,.ov').click(function(){ $('#background').addClass('covered'); } HTML &lt;div id="background"&gt; //content of my page &lt;/div&gt; I tried: -Using blur filter but the content blurs out too. -Using a sprite but since my backgrounds needs to be centered it appears the top part normal, and the bottom part blurred. My current code works great but the image has to load and when you click overlay/ov the background turns white until the new blurry background fully loaded. Any sugestions?
favorite count: 0
possible better answer: http://stackoverflow.com/a/29042942
has answer: http://stackoverflow.com/a/29042942
upvote count: 1
has title: Blur the background without filter
accepted answer: http://stackoverflow.com/a/29043406
type: AnsweredQuestion
score: 1
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29043406
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/46305285
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29031981
has text: Why not use carouselitems.each? jQuery provides easy iteration over objects with .each method. http://api.jquery.com/each/
score: 0

http://stackoverflow.com/comment/46203566
type: Comment
comment on: http://stackoverflow.com/a/28976152
has text: I don't there's much wrong with the toggle part, that's why I didn't include it. At your `if (sports.length)` you set all sports to checked, ignoring what the server result is. Also, check if the toggleSport method is outside of the then() callback function.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28923417
has comment: http://stackoverflow.com/comment/46103549
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46103653
answers question: http://stackoverflow.com/q/28923373
has comment: http://stackoverflow.com/comment/46103576
has body: Edit: as suggested by @Sukima: the data parameter renamed to url_figure to avoid declaring unnecessary variable. Assuming that your jQuery script, HTML files are both hosted on the same server that has the figure (eobot.com) then here is how it could be done. $(document).on('keyup', '#w_amount', function(){ // alert('pressed') $.get( "https://www.eobot.com/api.aspx?coin=DOGE", function( url_figure) { var totalcost= url_figure * $(this).val() $(".total_cost").html(totalcost); }); });
has comment: http://stackoverflow.com/comment/46103565

http://stackoverflow.com/a/28935552
score: 0
answers question: http://stackoverflow.com/q/28935519
type: Answer
has body: Use regex with vanilla JS: if(/[a-z]-\d{4}/i.test(value) &amp;&amp;v value.length == 6){ //Do stuff with valid value }

http://stackoverflow.com/comment/46294303
comment on: http://stackoverflow.com/q/29025846
has text: Here is a possible solution... http://stackoverflow.com/questions/2742144/how-to-print-a-image-file-in-printer
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28912216
accepted answer: http://stackoverflow.com/a/28912254
tagged with: blogger
type: Question
has title: Change all external links using jQuery
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery
has body: I want to change all external links on my blog (blogspot here, that's why I'm looking for jQuery code) without changing the posting of my blog because I need a lot of work if I do that. For example, my website is example.com. I want to change all external links to http://example.com/p/go.html?url=http://externallink.com without need for any changes on my blog post. I don't have any idea to start with. SOLVED: https://gist.github.com/2342509 Thanks everyone :D I just need to change it a bit.
has answer: http://stackoverflow.com/a/28912315
has answer: http://stackoverflow.com/a/28912254
possible better answer: http://stackoverflow.com/a/28912315
type: AnsweredQuestion

http://stackoverflow.com/comment/46217218
has text: Thank you. I found a way which add to main() this line of code:
type: Comment
comment on: http://stackoverflow.com/a/28983367
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46318846
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29039094
has text: The error is "BeginSort is not defined". What this means is that there is in error somewhere in that function. You need to make sure that everysingle line in that function is accessing something that actually exists.
type: Comment

http://stackoverflow.com/a/29083467
has comment: http://stackoverflow.com/comment/128558081
answers question: http://stackoverflow.com/q/29055518
score: 111
has comment: http://stackoverflow.com/comment/70631031
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/120959193
type: Answer
has comment: http://stackoverflow.com/comment/120921772
has comment: http://stackoverflow.com/comment/138725590
has comment: http://stackoverflow.com/comment/106175523
has comment: http://stackoverflow.com/comment/139888387
has comment: http://stackoverflow.com/comment/83418797
accepted answer of: http://stackoverflow.com/q/29055518
has comment: http://stackoverflow.com/comment/128541707
has comment: http://stackoverflow.com/comment/68103363
has comment: http://stackoverflow.com/comment/106212973
has comment: http://stackoverflow.com/comment/106200684
upvote count: 116
has body: It seems for the moment string concatenation is faster: https://jsperf.app/es6-string-literals-vs-string-concatenation ES6 with variable 19,992,512 ±5.21% 78% slower String concatenation with variable 89,791,408 ±2.15% fastest ES6 with function 461,358 ±3.12% 99% slower String concatenation with function 503,255 ±1.77% 99% slower I tested was run on Chrome 43.0.2334.0 canary (64-bit), which is using V8 4.3.31, with the #enable-javascript-harmony flag enabled. For reference, the latest version on Node.js (0.12.0 at the time of writing) is using V8 3.28.73: https://raw.githubusercontent.com/joyent/node/master/ChangeLog I'm sure all the possible performance optimizations that could be applied have not been applied yet, so it would be reasonable to expect performance to get better as ES6 gets closer to finalization and these features get migrated to the stable branch. Edit: Thanks for the comments @user1329482, @icl7126, Nicolai Borisik, and FesterCluck. Now that about 2 years have passed since this question was asked, ES6 browser support has greatly increased, and a good amount of performance optimization has taken place. Here are some updates. Edit: (February 2020) Updated Chrome result based on @JorgeFuentesGonzález comments and subsequent confirmation. In Chrome (as of 59.0.3035), ES6 string literals are faster: ES6 with variable 48,161,401 ±1.07% fastest String concatenation with variable 27,046,298 ±0.48% 44% slower ES6 with function 820,441 ±1.10% 98% slower String concatenation with function 807,088 ±1.08% 98% slower Update: In Chrome (as of 79.0.3945), String concatenation is faster... See comments. In Firefox (as of 57.0.0), ES6 string literals are faster: ES6 with variable 1,924,610,984 ±0.50% fastest String concatenation with variable 1,876,993,458 ±0.79% 3% slower ES6 with function 539,762 ±5.04% 100% slower String concatenation with function 546,030 ±5.88% 100% slower In Safari (as of 11.0.2), it depends: ES6 with variable 1,382,752,744 ±0.71% fastest Stri…
has comment: http://stackoverflow.com/comment/140097946
downvote count: 5

http://stackoverflow.com/a/29011101
type: Answer
answers question: http://stackoverflow.com/q/29010639
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/46267453
downvote count: 0
has body: You can use promises, something like this: uploadDataAndImage(formData) .done(function(){ // Its true, do my things }).fail(function(){ //Its false }); function uploadDataAndImage(dataForm) { var deferred = $.Deferred(); var localURL = dataForm.cardurl; console.log(localURL); if (localURL == "") { $$.ajax({ type: "POST", url: "upload.php", crossDomain: true, data: dataForm, success: function(data) { console.log("Upload to server without card"); deferred.resolve(); }, error: function() { console.log("Form couldn't upload to the server"); //alert("Couldnt upload to server, saving locally"); deferred.reject(); } }); } else { //set upload options var options = new FileUploadOptions(); options.chunkedMode = false; console.log("Start upload picture"); var ft = new FileTransfer(); ft.upload(deLokaleURL, encodeURI("uploaderino.php"), win, fail, options); function win(r) { console.log("Code = " + r.responseCode); console.log("R" + r.response); console.log("Sent = " + r.bytesSent); dataForm.cardurl = r.response; var dataString = JSON.stringify(dataForm); $$.ajax({ type: "POST", url: "upload.php", crossDomain: true, data: dataForm, success: function(data) { console.log("Upload to server with card"); deferred.resolve(); }, error: function() { console.log("Form couldn't upload to the server, do nothing"); deferred.reject(); } }); } function fail(error) { //alert("An error has occurred: Code = " + error.code); console.log("An error has occurred: Code = " + error.code); console.log("upload error source " + error.source); console.log("upload error target " + error.target); showMessage("Image upload has failed, get a better internet connection and try again!", function() { console.log("Upload van de form is mislukt!") }); deferred.reject(); } } return deferred.promise(); }

http://stackoverflow.com/a/28974214
has body: var geocoder; var map; function initialize() { geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(-34.397, 150.644); var mapOptions = { zoom: 8, center: latlng } map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } function codeAddress() { var address = document.getElementById('address').value; geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); // Remove Div if Error message exist on the page var elem = document.getElementById("lsError"); if (elem) { elem.parentNode.removeChild(elem); } } else { //alert('Geocode was not successful for the following reason: ' + status); // Add error message in the div id=lsError if (!document.getElementById("lsError")) { var node = document.createElement("div"); node.id = "lsError"; var textnode = document.createTextNode("Please Enter Zipcode or City"); node.appendChild(textnode); document.getElementById("searchLocation").appendChild(node); } } }); } google.maps.event.addDomListener(window, 'load', initialize); with CSS for error message. &lt;style&gt; #searchLocation{ position: relative; } #lsError{ position: absolute; bottom: -20px; background: red; color: #fff; padding: 10px; } &lt;/style&gt; So I ended up using Javascript to create error message in Div. Seems like it works.
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28972688
answers question: http://stackoverflow.com/q/28972688
type: Answer
downvote count: 0

http://stackoverflow.com/comment/50313312
score: 0
type: Comment
has text: Is this safe? Say two `withDb()` calls were made in quick succession. Would the two connections be completely independent?. If not, then you might need a mechanism by which either connection was released only when both requests were satisfied.
comment on: http://stackoverflow.com/a/28915678
type: AnswerComment

http://stackoverflow.com/comment/46128223
has text: i have checked it. the master value=60 and local value=60. how much i should increase and where will i get the file to increase. i mean location.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28936157

http://stackoverflow.com/comment/46275474
score: 1
has text: Looks like you're returning a Deferred instead of a promise when the value is in the cache.
type: Comment
comment on: http://stackoverflow.com/a/29014028
type: AnswerComment

http://stackoverflow.com/a/29021051
has comment: http://stackoverflow.com/comment/46285575
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46285526
type: Answer
accepted answer of: http://stackoverflow.com/q/29020931
score: 7
upvote count: 7
answers question: http://stackoverflow.com/q/29020931
has body: JSON.stringify(eval('{name:"User 01"}')); Not really great but works.

http://stackoverflow.com/a/28931275
score: 2
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
has body: Try this $(this).find('td').each(function(index) { console.log($(this).text() + ','); });
accepted answer of: http://stackoverflow.com/q/28931258
answers question: http://stackoverflow.com/q/28931258

http://stackoverflow.com/q/29017548
has body: I have 5 buttons and I can not change DOM and can not use id and name attribute and cant use innerHTML and now I need to give output like when I click button 1 it should give a alert like "You click button # 1" and same will continue for all 5 buttons. I want to print the value of i .Now I got stuck as I have two solutions : HTML Part: //creating 5 buttons one two three four five 1st Solution: /* here I am always having you clicked element #5*/ var nodes = document.getElementsByTagName('button');//getting references var counter; for (var i = 0; i < nodes.length; i++) { nodes[i].addEventListener('click', function() { alert('You clicked element #' + i); }); } //which is not working 2nd Solution: /* here I am getting correct output*/ var nodes = document.getElementsByTagName('button'); var counter; for (var i = 0; i < nodes.length; i++) { assignEvent(nodes[i], i); } function assignEvent(node, i){ node.addEventListener('click', function(){ alert('You clicked element#' + (i+1)); }); }//this one is working Now my question is why Solution 2 is working but solution 1 doesn't.. Please help. Why solution 2 is carrying the value of i correctly, while not solution 1.
linked to: http://stackoverflow.com/q/750486
type: Question
has comment: http://stackoverflow.com/comment/46279209
linked to: http://stackoverflow.com/q/8909652
has title: Javascript concept for variable scope
tagged with: javascript
has answer: http://stackoverflow.com/a/29018050
accepted answer: http://stackoverflow.com/a/29018050
score: 0
has answer: http://stackoverflow.com/a/29017820
answer count: 3
tagged with: button
tagged with: jquery
duplicate of: http://stackoverflow.com/q/750486
tagged with: http://stackoverflow.com/tag/html
duplicate of: http://stackoverflow.com/q/8909652
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29017820
has answer: http://stackoverflow.com/a/29018471

http://stackoverflow.com/q/28969803
has comment: http://stackoverflow.com/comment/46191449
type: Question
has title: Drag link from another page into div using ondragover
has comment: http://stackoverflow.com/comment/46191207
tagged with: javascript
has comment: http://stackoverflow.com/comment/46191543
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46191348
score: 0
has body: I'm wanting to have a link dragger which sets a specific input box's value to the link's url when the link is dragged over a div on my page. I have the code below which works but only for links that have been dragged from within the page itself. My guess is that the link drop 'reciever' isn't being activated like it is when a link is dragged from within the page but I don't know why exactly. The HTML for the div which used ondrop and ondragover: &lt;div id = "add" ondrop="drop(event)" ondragover="allowDrop(event)"&gt; The related js: function allowDrop(ev) { ev.preventDefault(); } function drop(ev) { ev.preventDefault(); var data = ev.dataTransfer.getData("text"); $("#linkin").val(data); } Thanks EDIT: I used the URL as an example. The end goal involves pulling the page title from the link among other things.

http://stackoverflow.com/a/29020886
score: 62
answers question: http://stackoverflow.com/q/29020722
has comment: http://stackoverflow.com/comment/105749040
accepted answer of: http://stackoverflow.com/q/29020722
upvote count: 62
has body: The problem is that the promise you return from getRedirectUrl() needs to include the entire chain of logic to get to the URL. You're just returning a promise for the very first request. The .then() you're using in the midst of your function isn't doing anything. To fix this: Create a promise that resolves to redirectUrl for a redirect, or null otherwise: function getRedirectsTo(xhr) { if (xhr.status &lt; 400 &amp;&amp; xhr.status &gt;= 300) { return xhr.getResponseHeader("Location"); } if (xhr.responseURL &amp;&amp; xhr.responseURL != url) { return xhr.responseURL; } return null; } var p = new Promise(function (resolve) { var xhr = new XMLHttpRequest(); xhr.onload = function () { resolve(getRedirectsTo(xhr)); }; xhr.open('HEAD', url, true); xhr.send(); }); Use .then() on that to return the recursive call, or not, as needed: return p.then(function (redirectsTo) { return redirectsTo ? getRedirectUrl(redirectsTo, redirectCount+ 1) : url; }); Full solution: function getRedirectsTo(xhr) { if (xhr.status &lt; 400 &amp;&amp; xhr.status &gt;= 300) { return xhr.getResponseHeader("Location"); } if (xhr.responseURL &amp;&amp; xhr.responseURL != url) { return xhr.responseURL; } return null; } function getRedirectUrl(url, redirectCount) { redirectCount = redirectCount || 0; if (redirectCount &gt; 10) { throw new Error("Redirected too many times."); } return new Promise(function (resolve) { var xhr = new XMLHttpRequest(); xhr.onload = function () { resolve(getRedirectsTo(xhr)); }; xhr.open('HEAD', url, true); xhr.send(); }) .then(function (redirectsTo) { return redirectsTo ? getRedirectUrl(redirectsTo, redirectCount + 1) : url; }); }
has comment: http://stackoverflow.com/comment/62855125
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/79406697
has comment: http://stackoverflow.com/comment/62808279
type: Answer

http://stackoverflow.com/comment/46170411
comment on: http://stackoverflow.com/q/28958778
score: 0
type: Comment
type: QuestionComment
has text: @briosheje `$('img').attr({src:files[0].name});` it doesn't read the file from pc.

http://stackoverflow.com/comment/46265588
type: AnswerComment
has text: Thx you so much for spending such a long time on explaining those details to me. I do appreciate that !!!! It turn out that I just have to add parent() like $('#'des_id'').parent().html(result) to resolve my problem. Stackoverflow should invent a ''thank you x 100 times'' button. Can I give any point or something?
type: Comment
comment on: http://stackoverflow.com/a/28950525
score: 1

http://stackoverflow.com/a/28931334
score: 1
has comment: http://stackoverflow.com/comment/46118683
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46118742
type: Answer
has comment: http://stackoverflow.com/comment/46118757
answers question: http://stackoverflow.com/q/28931081
upvote count: 1
has body: Your code works fine if you make some adjustments. First, to get the last 8 videos, you need to include that number in your 'query url' as max-results: here ▼ https://gdata.youtube.com/feeds/api/users/VEVO/uploads?max-results=8&amp;orderby=published&amp;v=2&amp;alt=jsonc&amp;callback=showVideo Then, to show every video, instead of an if statement, you need to have a loop (for loop here), and to .append() each video instead of replacing the entire content each time with .html(): function showVideo(response) { if(response.data &amp;&amp; response.data.items) { var items = response.data.items; // the loop i'm talking about for(var i=0, l=items.length; i&lt;l; i++){ var item = items[i]; var videoid = "http://www.youtube.com/embed/"+item.id; console.log("Latest ID: '"+videoid+"'"); var video = "&lt;iframe width='420' height='315' src='"+videoid+"' frameborder='0' allowfullscreen&gt;&lt;/iframe&gt;"; // here, add the video to the container $('#static_video').append(video); } } }
accepted answer of: http://stackoverflow.com/q/28931081

http://stackoverflow.com/a/28983868
has comment: http://stackoverflow.com/comment/46216868
upvote count: 1
has comment: http://stackoverflow.com/comment/46216751
has comment: http://stackoverflow.com/comment/46216985
has body: Because you are calling remove() javascript function. Reference : W3Schools Just Change function remove() to function xyz() like function xyz() { debugger; alert('sahd'); } Abcd1 Abcd1 Abcd1
answers question: http://stackoverflow.com/q/28983708
downvote count: 0
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/46216929

http://stackoverflow.com/comment/46409903
score: 0
type: QuestionComment
has text: PS1: Here is the deal: - Save the last milliseconds; - Quantify the energy of the voice (micro) in real time; - Save the last milliseconds + the voice above a limit of energy;
type: Comment
comment on: http://stackoverflow.com/q/28994032

http://stackoverflow.com/q/29058847
tagged with: jquery
has body: I want to be able view my pane when I click on the link "Forgot your password?". Right now what I have done is that I've created a tab for the specific pane. When I click on the tab or the link, I am able to view the pane. I created a JS function that will "click" the tab and display the pane when I click the "Forgot your password?" link. I do not want the tab to be displayed. So I want to view the pane only when clicking the "Forgot your password?" link. I think I can achieve this by hiding the tab but the logic still exists. I believe I can also achieve this without using the tab, however I am not sure how to do this. JSFIDDLE: http://jsfiddle.net/essnm8bd/1/ JS: $(document).ready(function() { var join_btn = document.getElementById("join-btn"), signin_btn = document.getElementById("signin-btn"), reset_password_link = document.getElementsByClassName("reset-password-link")[0]; join_btn.addEventListener("click", joinSelected); signin_btn.addEventListener("click", signInSelected); reset_password_link.addEventListener("click", resetPasswordSelected); function joinSelected() { $('[href="#signup-pane"]').trigger('click'); } function signInSelected() { $('[href="#signin-pane"]').trigger('click'); } function resetPasswordSelected() { $('[href="#reset-password-pane"]').trigger('click'); } }); HTML: LOGO Join Spark Sign in Sign in New Account test {% csrf_token %} {% csrf_token %} Forgot your password?
upvote count: 1
has answer: http://stackoverflow.com/a/29059177
answer count: 1
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
type: Question
has title: Viewing bootstrap pane when link is clicked
tagged with: javascript

http://stackoverflow.com/q/28971675
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
favorite count: 0
accepted answer: http://stackoverflow.com/a/28971853
tagged with: http://stackoverflow.com/tag/html
tagged with: twitter-bootstrap
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28971853
has title: How to properly disable spans used with input-group-addon
has comment: http://stackoverflow.com/comment/46194781
upvote count: 4
has body: I'm using Bootstrap and I have a span with the input-group-addon class. As we're all aware, using add-ons with other components is fairly common. The problem I have is disabling the span that has this class after I've disabled the input its tied to. In my example, I use a calendar addon with a bootstrap datepicker component. &lt;div class="input-group date"&gt; &lt;input type="text" class="form-control" id="dp1" /&gt; &lt;span class="input-group-addon" id="dp1Icon"&gt;&lt;img src="&lt;%=context%&gt;/images/calendar-glyph.png"&gt;&lt;/span&gt; &lt;/div&gt; I define my Bootstrap datepicker as such: var datePicker = $(".input-group.date").datepicker({myOptions}); Sometimes I disable my datepicker like this: $("#dp1").prop("disabled", true); But I can't disable the dp1Icon. I've researched quite a bit. First, there is no method "showing" in the bootstrap datepicker that'll allow me to trap and prevent default. Second, "pointer-events:none" doesn't work on IE. Third, using this won't work either: $("#dp1Icon").click(function(e){// if it has a certain class, e.preventDefault()}); wont' work either. I can easily remove the click handler like this: $("#dp1Icon").off("click"); But then how do I re-assign it to open up the datepicker again? This doesn't work: $("#dp1Icon").on("click",$(".input-group.date").datepicker("show"); What solutions am I left with? Thanks for any helpful tips.

http://stackoverflow.com/q/29028609
has title: Expand all collapsed table rows in Angular
tagged with: angularjs-ng-repeat
has body: I have a directive which I use to expand and collapse a data row within a table: angular.module('rokoApp') .directive('dir', function() { return { link: function(scope, elem) { $(elem).on('click', function() { $(this) .parent('tr') .next('tr') .toggle(); }); } }; }); and here is the ng-repeat code: 0" ng-hide="isRowCollapsed"> 0"> I wish to expand all hidden data rows when one is clicked.
tagged with: angularjs
type: Question
score: 0
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/46301729
has comment: http://stackoverflow.com/comment/46299254
answer count: 0
tagged with: javascript
type: UnansweredQuestion

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

http://stackoverflow.com/q/28914264
possible better answer: http://stackoverflow.com/a/28914324
upvote count: 2
answer count: 5
has answer: http://stackoverflow.com/a/28914296
accepted answer: http://stackoverflow.com/a/28914296
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28914324
has answer: http://stackoverflow.com/a/28914795
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28914350
tagged with: http://stackoverflow.com/tag/html
has title: Jquery prepend based on own content
favorite count: 0
has answer: http://stackoverflow.com/a/28914331
has body: I need something in jQuery but can't figure it out. I got this html: My Name 1 My Name 2 // many more In jQuery I want to get the content of this `h2' and need that for: My Name 1 This is working: jQuery(".content h2").prepend("").append(""); But the href has to be based on its content... How to do that? Thanks!

http://stackoverflow.com/comment/46921417
has text: @mish Your code is working buthas one major flaw. { "action": "find", "value": "{ qty: { $lt: 20 } }", "limit": "5", "skip": "0" } Values are getting converted to string. Eg. "limit":5
comment on: http://stackoverflow.com/a/29026752
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/46140831
comment on: http://stackoverflow.com/q/28936943
score: 0
type: Comment
type: QuestionComment
has text: How about changing your way a little? I suggest to set `shared=false`, where you have required point. Now, just find proper point in the second series using my advice above, a little changed: `var series = this.point.series.chart` -> get all series from the chart. `var index = this.point.series.xData.indexOf(this.x)` - get index. Now just get proper points using `series[i].data[index]`.

http://stackoverflow.com/a/28938818
has comment: http://stackoverflow.com/comment/46132767
score: 0
has body: Try this , $('div').datepicker({ multidate: false, }); Demo:http://jsfiddle.net/UI_Designer/2L1ovhbm/2/
answers question: http://stackoverflow.com/q/28938628
type: Answer

http://stackoverflow.com/q/28929506
has title: Meteor: disable hot code push
answer count: 2
downvote count: 0
tagged with: meteor
favorite count: 0
tagged with: cordova
accepted answer: http://stackoverflow.com/a/28929566
tagged with: phonegap-build
type: AnsweredQuestion
score: 3
upvote count: 3
possible better answer: http://stackoverflow.com/a/29813662
has body: I'm developing a phonegap app and hot code push is causing a problem for some of my users (after push, app hangs and users have to re-install the new app). I'd like to disable hot code pushes and found the following snippet but am getting the error, "TypeError: Cannot call method 'onMigrate' of undefined" Meteor._reload.onMigrate(function() { return [false]; });
has answer: http://stackoverflow.com/a/29813662
type: Question
has answer: http://stackoverflow.com/a/28929566
tagged with: javascript

http://stackoverflow.com/comment/46178431
has text: I'm sorry the button is inside another div!
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28963224

http://stackoverflow.com/a/29080658
answers question: http://stackoverflow.com/q/29061992
accepted answer of: http://stackoverflow.com/q/29061992
score: 0
type: AcceptedAnswer
type: Answer
has body: Since the path is built with two variables, and only one listener is open at any given time, I decided to solve this problem by simply storing the two values separately, in their own variables, such as: var storedPath1; var storedPath2; dataRef.child('bids').child(auction).child(lotno).on('child_added', function(data){ if (storedPath1!=undefined &amp;&amp; storedPath2!=undefined{ dataRef.child('bids').child(storedPath1).child(storedPath2).off('child_added'); } storedPath1=auction; storedPath2=lotno; } If the listener was previously established, this will close it when opening the new one.

http://stackoverflow.com/a/28981055
type: Answer
has comment: http://stackoverflow.com/comment/46211902
answers question: http://stackoverflow.com/q/28980988
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/46212154
accepted answer of: http://stackoverflow.com/q/28980988
has comment: http://stackoverflow.com/comment/46212132
has comment: http://stackoverflow.com/comment/46211871
has comment: http://stackoverflow.com/comment/46212242
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46212362
has body: You need to use: $("tr td.one:first-child").each(function(i) { temp[i] = $(this).text(); console.log("Result: "+temp[i]); }); Working Demo
has comment: http://stackoverflow.com/comment/46212299

http://stackoverflow.com/q/28936150
tagged with: converters
has comment: http://stackoverflow.com/comment/46127945
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28937649
favorite count: 0
linked to: http://stackoverflow.com/q/13161477
has comment: http://stackoverflow.com/comment/46128511
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46127915
has title: Change currency depending on country
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46127720
has comment: http://stackoverflow.com/comment/46127837
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46127667
has body: I have a package table. I want to change automatically the currency of each amount depending on the location of the user. For example, if the user is from UK, it will change to pounds, if from Australia it will be AUD. I have looked for a tutorial in google but all I can see is a conversion table, like this one not. How will I do this using HTML and javascript? $100 $200 $300 Package A Package B Package C
has comment: http://stackoverflow.com/comment/46127658
has comment: http://stackoverflow.com/comment/46127700
tagged with: javascript
tagged with: currency
has answer: http://stackoverflow.com/a/28937045
upvote count: 1

http://stackoverflow.com/q/28960614
answer count: 4
has comment: http://stackoverflow.com/comment/46173935
has answer: http://stackoverflow.com/a/28960953
has comment: http://stackoverflow.com/comment/46174046
has comment: http://stackoverflow.com/comment/46173616
has title: ASP .NET MVC - Ajax POST action fail
has comment: http://stackoverflow.com/comment/46174316
has comment: http://stackoverflow.com/comment/46173826
has comment: http://stackoverflow.com/comment/46173577
type: Question
tagged with: c#
linked to: http://stackoverflow.com/q/19093603
has comment: http://stackoverflow.com/comment/46174000
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/46173639
has answer: http://stackoverflow.com/a/28961150
has answer: http://stackoverflow.com/a/28960943
has comment: http://stackoverflow.com/comment/46173679
has comment: http://stackoverflow.com/comment/46173937
has body: I'm trying to do a simple action with some JavaScript code. I've got some items on a scheduler (DevExpress scheduler component). When I'm double clicking on an appointment (an item then), it should raise an JS function which is the case. My function should get the selected appointment id and pass it to Controller Action. Here is my JS code : function DoubleClick() { debugger; var apt = GetSelectedAppointment(scheduler); var aptid = apt.appointmentId; $.ajax({ type: "POST", url: "/Home/GetAppId", data: { id: aptid }, dataType: 'json', success: function () { alert("ok"); }, error: function () { alert("error"); } }); } And here is my C# code : [HttpPost] public JsonResult GetAppId(int id) { context = new SchedulingDataClassesDataContext(); DBAppointment app = (from a in context.DBAppointment where a.UniqueID == id select a).FirstOrDefault(); return Json(new {rep = app}); } As you can see in my JS code, I'm not doing anything special in case of success. However, I never reach the success part. Plus, when I'm looking at the Chrome dev tool (F12), I'm getting that red error message. POST http://localhost:25206/Home/GetAppId 500 (Internal Server Error) Anything that I'm doing wrong?
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46173852
score: 0
tagged with: asp.net
has comment: http://stackoverflow.com/comment/46173834
has comment: http://stackoverflow.com/comment/46174375
has comment: http://stackoverflow.com/comment/46173518
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28961206
has comment: http://stackoverflow.com/comment/46173874
has comment: http://stackoverflow.com/comment/46173970

http://stackoverflow.com/q/29028268
tagged with: http://stackoverflow.com/tag/html
score: -3
tagged with: css
has answer: http://stackoverflow.com/a/29028365
has comment: http://stackoverflow.com/comment/46298230
has comment: http://stackoverflow.com/comment/46298059
has comment: http://stackoverflow.com/comment/46298199
type: Question
has comment: http://stackoverflow.com/comment/46298939
has body: I have an image of a human body where I should make all organs like eyes, nose and ears clickable to link to different webpages. Is this possible out-of-the-box with HTML and/or JavaScript?
tagged with: javascript
downvote count: 5
has comment: http://stackoverflow.com/comment/46298287
has comment: http://stackoverflow.com/comment/46298202
has title: How to create links for certain parts of an image?
answer count: 1
has comment: http://stackoverflow.com/comment/46298159
favorite count: 0
has comment: http://stackoverflow.com/comment/46298320
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/q/29058584
has body: I'm a developing a web application by using dojo(v1.7).There is a drop down list & I coded it as below; Data is populated by selection tool as below;(data1=item list) itemCategoryStore = new dojo.store.Memory({ data : data1 }); dijit.byId("itemSelection").store=itemCategoryStore; But this can be executed properly in windows environment,but it is not working in Ipad(IOS 8), What could be the root cause for this? Any suggestions to solve this issue?
tagged with: dojo
score: 3
downvote count: 0
type: Question
tagged with: javascript
upvote count: 3
has title: Dojo FilteringSelect or MultiSelect not working on IPad(IOS 8)
favorite count: 0
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/29042208
has body: Why are these not equivalent and is there a way to make them so? // Returns result of promiseB var p = self.promiseA() .then(self.promiseB); return p; // Returns result of promiseA var p = self.promiseA(); p.then(self.promiseB); return p; For example if I wanted to do something like: var p = self.promiseA(); if(cond) { p.then(self.promiseB); } return p;
downvote count: 0
favorite count: 0
tagged with: promise
has answer: http://stackoverflow.com/a/29045481
upvote count: 1
has title: Breaking up promise chain
type: AnsweredQuestion
tagged with: bluebird
score: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46337253
accepted answer: http://stackoverflow.com/a/29045481
answer count: 1

http://stackoverflow.com/q/29030233
tagged with: jquery
has body: There are multiple carousels in my page and they all work the same way. I'd like to make one of them have different settings though (interval), but I can't make it happen. Here is the fiddle. I'd like to have "#slideshow" carousel work with interval/auto slide set to active, and the rest of them to have interval/auto slide disabled. jQuery('.carousel').each(function () { jQuery(this).carousel({ interval: false }); jQuery('#slideshow').carousel({ interval: 3000 }); });
tagged with: carousel
favorite count: 0
tagged with: twitter-bootstrap-3
upvote count: 1
type: AnsweredQuestion
has title: Multiple bootstrap carousels with different settings
has answer: http://stackoverflow.com/a/29033916
score: 1
accepted answer: http://stackoverflow.com/a/29033916
type: Question
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/28926914
type: Answer
has comment: http://stackoverflow.com/comment/46132675
has body: Here is a simple PDF viewer for php websites check it out : http://flexpaper.devaldi.com/
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28926727
answers question: http://stackoverflow.com/q/28926727

http://stackoverflow.com/comment/46289353
comment on: http://stackoverflow.com/a/29023212
type: AnswerComment
score: 0
has text: This works but if you put the h1 tag first this won't work. Good answer though, i almost posted the same thing. Out of curiosity, do you know how to do this for elements before the menu? also if you have other elements between the menu/h1 you can swap the `+` for `~` Example: #menu #somethingElse then your H1 tag.
type: Comment

http://stackoverflow.com/comment/46301955
comment on: http://stackoverflow.com/a/29030153
type: AnswerComment
has text: Hi bigt - I have tried your suggestion, ajax call is firing correctly, but instead of filling the data in the `instrument_code` field, the `drop-down` selection field is going white.
score: 0
type: Comment

http://stackoverflow.com/q/29006288
answer count: 3
score: -2
has body: Is it possible to make javascript click on a div when the div exists in the browser? For example, the script could refresh a webpage until a div shows up (with content), and than if the div is clickable, let javascript click it (or just follow the link, if there is one).
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29006406
has title: Can javascript click a div?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29006490
has comment: http://stackoverflow.com/comment/46258542
possible better answer: http://stackoverflow.com/a/29006489
has answer: http://stackoverflow.com/a/29006489
has comment: http://stackoverflow.com/comment/46258489
upvote count: 2
has comment: http://stackoverflow.com/comment/46258438
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29006490
has comment: http://stackoverflow.com/comment/46258625
type: Question
tagged with: browser
downvote count: 4

http://stackoverflow.com/q/28997887
has answer: http://stackoverflow.com/a/28998877
has answer: http://stackoverflow.com/a/29013720
accepted answer: http://stackoverflow.com/a/29013720
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29014819
type: Question
tagged with: django-sessions
has body: How can I get the django session ID that is ultimately stored in the cookie using javascript? The reason I need to get that ID is that I'm doing everything from a REST API, including authentication. So, the guys developing the mobile app are using ionic and they want to make a request to the API to get that session ID - and then use it in future requests. Any advice?
tagged with: javascript
upvote count: 3
has title: Get session ID for a django site in javascript
answer count: 3
downvote count: 1
tagged with: django-rest-framework
favorite count: 0
has comment: http://stackoverflow.com/comment/46243932
possible better answer: http://stackoverflow.com/a/28998877
tagged with: django

http://stackoverflow.com/a/28930678
has comment: http://stackoverflow.com/comment/46117773
upvote count: 1
has comment: http://stackoverflow.com/comment/46117065
has body: Replace jQuery(document).ready(function() { by $(document).ready(function() { Secondly from Jquery documentation: Note: Only "successful controls" are serialized to the string. No submit button value is serialized since the form was not submitted using a button. For a form element's value to be included in the serialized string, the element must have a name attribute. Values from checkboxes and radio buttons (inputs of type "radio" or "checkbox") are included only if they are checked. Data from file select elements is not serialized. Therefore submit button won't serialize through jQuery.serialize() function. A solution below: &lt;script&gt; $(document).ready(function() { $('.success-message-subscribe').hide(); $('.error-message-subscribe').hide(); $('#submitter').click(function(e) { e.preventDefault(); $myform = $(this).parent('form'); $btnid = $(this).attr('name'); $btnval = $(this).attr('value'); var postdata = $myform.serialize(); $.ajax({ type: 'POST', url: 'contact.php', data: { "btnid" : $btnid, "btnval": $btnval, "form-data": $form.serialize() }, dataType: 'json', success: function(json) { if(json.valid == 1) { $('.box_form').hide(); $('.error-message-subscribe').hide(); $('.success-message-subscribe').hide(); $('.subscribe form').hide(); $('.success-message-subscribe').html(json.message); $('.success-message-subscribe').fadeIn(); } } }); return false; }); }); &lt;/script&gt;
downvote count: 0
has comment: http://stackoverflow.com/comment/46117787
type: Answer
answers question: http://stackoverflow.com/q/28930624
score: 1

http://stackoverflow.com/comment/46125563
type: Comment
type: QuestionComment
has text: @nnnnnn because the current css() already doesn't work
comment on: http://stackoverflow.com/q/28934776
score: 0

http://stackoverflow.com/q/29016328
tagged with: javascript
has title: Subclassing Meteor.users() to get different user types
tagged with: mongodb
has answer: http://stackoverflow.com/a/29017816
upvote count: 1
answer count: 1
tagged with: meteor
favorite count: 0
type: UnansweredQuestion
downvote count: 0
score: 1
type: Question
has body: In meteor, there is the Meteor.users collection in the database. I want several different types of users, I want a lot of the same methods that a // after creating a user profile and sending an email to confirm profile enrollUser: function(id) { var profile = MyCollection.findOne(id); // send enrollment email // when user confirms email and sets a password, they are registered as a user. // `profile` is added as the `user.profile`, with the email in `profile` registered } It seems like you have to create a user in order to send an enrollment email. Is there any way to create the profile and register the profile to a new user on an enrollment link?

http://stackoverflow.com/a/29022068
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29020771
has body: Keys are used for something else, not for sorting. React uses keys to optimize its internal Virtual DOM operations. It means you tell React that "no matter the order of these siblings, the individual sibling is still identified by this key". That's how React knows whether it should prepend, insert, delete, or append new siblings by reusing the old, without throwing stuff away unnecessarily. As for your sorting question: To change the order of the siblings, just sort the JavaScript array this.props.data.
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/51671291
has comment: http://stackoverflow.com/comment/51627102

http://stackoverflow.com/a/29046075
has comment: http://stackoverflow.com/comment/46331825
has comment: http://stackoverflow.com/comment/46408726
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46531202
has comment: http://stackoverflow.com/comment/46374181
has comment: http://stackoverflow.com/comment/46332186
has comment: http://stackoverflow.com/comment/46374350
answers question: http://stackoverflow.com/q/29045070
has comment: http://stackoverflow.com/comment/46374162
has body: Excel
has comment: http://stackoverflow.com/comment/46529355
has comment: http://stackoverflow.com/comment/46407352
has comment: http://stackoverflow.com/comment/46407965
has comment: http://stackoverflow.com/comment/46407264
has comment: http://stackoverflow.com/comment/46331747

http://stackoverflow.com/a/29018630
downvote count: 0
type: Answer
score: 3
upvote count: 3
has body: It would be more common that you'd set a property on the LoadingScreen component instance to control the visibility of the internal representation rather than adjusting the state via a function call on the object instance. class LoadingScreen extends React.Component { constructor(props) { super(props); } render() { switch (this.props.mode) { case 'isHidden': return null; case 'isTrying': // Returns a bunch of DOM elements } } } LoadingScreen.propTypes = { mode: React.PropTypes.string }; LoadingScreen.defaultProps = { mode: 'isTrying' }; Then, from the parent, you'd do something like this for example: var currentMode = "isTrying"; React.render(&lt;LoadingScreen mode={ currentMode } /&gt;, mountNode); Or, another pattern is that the parent container/component uses the value of the property (I've called mode) to just not create and render the LoadingScreen component at all. If the LoadingScreen needs to, you could copy the property value into local state as you've done.
has comment: http://stackoverflow.com/comment/46283707
has comment: http://stackoverflow.com/comment/46283769
has comment: http://stackoverflow.com/comment/46283243
answers question: http://stackoverflow.com/q/29017485

http://stackoverflow.com/a/28907970
answers question: http://stackoverflow.com/q/28907773
has comment: http://stackoverflow.com/comment/46076252
has comment: http://stackoverflow.com/comment/46076233
type: AcceptedAnswer
score: 0
type: Answer
has body: Here's my attempt: http://jsfiddle.net/u9ycpLgs/ Looping through test.values and creating a new object where the value of the type is the new key and the value of the match is the new value. var test = { "values": [{ "type": "NAME", "match": "EXACT" }, { "type": "LASTNAME", "match": "AMBIG" }] }; keyValuePairs = {}; test.values.forEach(function (item) { keyValuePairs[item.type] = item.match; }); console.log(JSON.stringify(keyValuePairs)); /* Output: {"NAME":"EXACT","LASTNAME":"AMBIG"} */
accepted answer of: http://stackoverflow.com/q/28907773

http://stackoverflow.com/q/28959321
tagged with: visual-studio
tagged with: formatting
type: Question
tagged with: notepad++
has title: Notepad++ Javascript format style and list of variables
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46177706
has answer: http://stackoverflow.com/a/28959560
has body: I'm using JSTool plugin for Notepad ++ but I have problem with formating list of variables. Visual Studio formats list in this way: var test = 1, test2 = 2, test3 = 3; And N++ formats lists in this way: var test = 1, test2 = 2, test3 = 3; You see... N++ lost indentations before second and third line... It is very annoying. How can I change that? Is there any solution?
type: UnansweredQuestion

http://stackoverflow.com/a/29103303
answers question: http://stackoverflow.com/q/28937788
has body: The following answer is my reaction to seeing the humongous answer by @AaditMShah awarded a fat bounty. While its length and thoroughness impressed me, its ability to succintly answer the question did not. So, on the off-chance that I'm not the only one, here goes... Promises API is an instance of the monad pattern from functional programming, which allows extending functional composition to cooperate with some aspect of the functions' return values. Its syntax reflects this pattern; asynchronous execution is only being dealt with in its implementation. Therefore, recognition of the pattern is an answer in itself. To expand a bit, you might want to use the pattern whenever you need to tap into the process of functional composition. The code in your question is not a good example, because there is no apparent connection between the functions apart from exception handling. (Of course, you can use the pattern for custom failure handling, if that was your original concern.) Consider the following code instead. var a = 'initial value', b = foo(a, 'more', 'arguments'), // ... result = bar(z); We could tap into its functional composition by re-writing it as on('initial value') .do(_.partialRight(foo, 'more', 'arguments')) // ... .do(bar) .do(function (result) { // ... }); (_.partialRight is just argument binding.) In this case, the new syntax could be immensely useful, because it intercepts the data flow between the functions. Depending on your needs, you could implement on/do to do anything, e.g. parallel processing of complex data structure nodes or yielding after blocking for some time. Like any other pattern, this one too introduces an overhead (in both efficiency and code maintenance) and should only be used when there's a reason for it.
type: Answer
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/comment/46211169
comment on: http://stackoverflow.com/a/28980595
score: 1
type: AnswerComment
has text: Regardless, imo, `.filter()` is a better fit for this problem.
type: Comment

http://stackoverflow.com/comment/46250357
has text: im not sure i understand what you want to accomplish
score: 2
comment on: http://stackoverflow.com/q/29001277
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46145225
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28945396
has text: @epascarello I use both, so I edited the post a bit to avoid this kind of comment :)
score: 0

http://stackoverflow.com/comment/46082282
score: 0
comment on: http://stackoverflow.com/a/28910935
type: AnswerComment
type: Comment
has text: Actually, the effect I'm after is just a full screen overlay. I was thinking modal was a solution but maybe there's a better one.

http://stackoverflow.com/a/29055423
downvote count: 0
type: Answer
has body: code the querys a user querys a role then adds the user to the role var qu = new Parse.Query(Parse.User); var qr = new Parse.Query(Parse.Role); qr.get(roleId, { success: function(role) { _role = role; qu.get(userId, { success: function(user) { _role.getACL().setRoleReadAccess(_role, true); _role.getUsers().add(user); _role.save(); response.success(_role.toJSON()); }, error: function(object, error) { console.log('got role, failed on get user'); } });
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/29053919

http://stackoverflow.com/comment/46106891
score: 1
type: QuestionComment
type: Comment
has text: `hr` is the last string in `[ 'hr' ]`. Why that is not included?
comment on: http://stackoverflow.com/q/28925230

http://stackoverflow.com/comment/46204060
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28976460
has text: Normally you can subscribe for those changes and use `setState` to change the state.

http://stackoverflow.com/a/28990308
has body: try with document.getElementById("content").innerHTML ='text to be replaced with "" '; or with document.getElementById("content").innerHTML ="text to be replaced with \"\""; or with document.getElementById("content").innerHTML ='text to be replaced with \'\''; ( \" is the escape sequence for the character " and in javascript you can use either ' or " for the strings) here the jsfiddle sample
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/28990225
score: 2
has comment: http://stackoverflow.com/comment/46229492
downvote count: 0

http://stackoverflow.com/comment/46195791
type: AnswerComment
has text: In your code you add class active and then remove, because `$('img.glasses.active')` will be matched
type: Comment
comment on: http://stackoverflow.com/a/28971890
score: 0

http://stackoverflow.com/a/29022289
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46300449
type: Answer
has comment: http://stackoverflow.com/comment/46305053
answers question: http://stackoverflow.com/q/29021978
has comment: http://stackoverflow.com/comment/46300554
accepted answer of: http://stackoverflow.com/q/29021978
has body: this will work $(function() { $('#ifedit').prop('disabled',true); $('#drpevent').on('change', function(){ $('#ifedit').prop('disabled', $(this).val() !== 'custom'); ($(this).val() == 'custom' ? $('#ifedit').css({'opacity':1}) : $('#ifedit').css({'opacity':0.5})); }); }); cause the prop disabled has two values true and false in this case till value will be different than "custom" it will put disabled to true :)
score: 0

http://stackoverflow.com/comment/46256313
type: AnswerComment
has text: And another example that doeesn't fade directly: http://jsfiddle.net/9Dubr/1/ Please help me figure out how to fade directly without fading to white (transparent) first
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28996582

http://stackoverflow.com/a/28954731
has comment: http://stackoverflow.com/comment/46163218
has comment: http://stackoverflow.com/comment/46163142
upvote count: 1
has comment: http://stackoverflow.com/comment/46163455
score: 1
has comment: http://stackoverflow.com/comment/46163223
has comment: http://stackoverflow.com/comment/46163332
downvote count: 0
answers question: http://stackoverflow.com/q/28954727
has body: Here this is the button, which does not have a previous sibling, the td you are looking for is the previous sibling of the td parent of the clicked button, also you have to use .text()/.html() to get the contents $address = $(this).parent().prev('td').text();//$(this).closest('td')
type: Answer

http://stackoverflow.com/comment/46199280
comment on: http://stackoverflow.com/q/28951012
score: 0
type: Comment
type: QuestionComment
has text: Ok. Thanks. I will check SwiftMailer. I am not good with php so I just wanted to know how to test this code and if it works properly.

http://stackoverflow.com/comment/46170064
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28958700
score: 0
has text: jQuery.toggle(), since it TOGGLES, it automatically checks whether the element is visible or not visibile. If it is visible, it automatically set it to invisible and if it is invisible it automatically set it to visible. About the animation, it starts from top left because it is standard of that animation. you may check its parameters or use slideToggle() <- http://api.jquery.com/slidetoggle/.

http://stackoverflow.com/comment/46285369
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29000152
has text: Yes, kind of the OWL Carousel can achieve out of the box, see the example here: http://www.owlcarousel.owlgraphic.com/. About the TweenLite ScrollTo Carousel, i wondering if it was possible to use a built in drag function / method given in the library it self. Sorry for my bad english... :-)
score: 0

http://stackoverflow.com/comment/46558408
score: 0
type: Comment
has text: Thanks for your help Ibrahim. Good to know that you can't set the default streams programmatically. It was my bind that wasn't working properly.
comment on: http://stackoverflow.com/a/29153664
type: AnswerComment

http://stackoverflow.com/q/28962879
has title: map do not appear on google maps javascript api v3
tagged with: javascript
favorite count: 0
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/46183317
tagged with: http://stackoverflow.com/tag/html
has body: Im am new to google maps api, and I'm trying to create my first map, by copying the example google gives you, but somehow, it isn't working. <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=<MYKEY>&sensor=true"> I'm using a blog to test it, but when I publish the map doesn't appear. I am able to post text, but not the map. Ideas?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46178617
downvote count: 1
type: Question
score: -1
has answer: http://stackoverflow.com/a/28963240
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/28962973
has comment: http://stackoverflow.com/comment/46180586

http://stackoverflow.com/comment/47544990
comment on: http://stackoverflow.com/q/28983735
score: 1
has text: I have encountered this same issue in the TinyMCE contained within WordPress. Even though I was able to write a PHP function that excluded certain tags from being stripped by the editor (similar to what you have here), I found that the comment code was always there. I couldn't figure out how to get rid of it. But I think I know why it's there. I believe this is to prevent the code within the tags from being wrapped in paragraph tags, as TinyMCE does by default for each line break. So I left the comment code in there since my scripts still worked fine on the front end.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29020722
has answer: http://stackoverflow.com/a/55874953
has comment: http://stackoverflow.com/comment/98426786
has answer: http://stackoverflow.com/a/51560328
downvote count: 0
answer count: 7
has answer: http://stackoverflow.com/a/53913811
has body: I'm writing a Javascript Promise that finds the final redirect URL of a link. What I'm doing is making a HEAD request in a Promise using an XMLHttpRequest. Then, on load, check the HTTP Status for something in the 300 range, or if it has a responseURL attached to the object and that url is different than the it was one handed. If neither of these are true, I resolve(url). Otherwise, I recursively call getRedirectUrl() on the response URL, and resolve(). Here's my code: function getRedirectUrl(url, maxRedirects) { maxRedirects = maxRedirects || 0; if (maxRedirects &gt; 10) { throw new Error("Redirected too many times."); } var xhr = new XMLHttpRequest(); var p = new Promise(function (resolve) { xhr.onload = function () { var redirectsTo; if (this.status &lt; 400 &amp;&amp; this.status &gt;= 300) { redirectsTo = this.getResponseHeader("Location"); } else if (this.responseURL &amp;&amp; this.responseURL != url) { redirectsTo = this.responseURL; } if (redirectsTo) { // check that redirect address doesn't redirect again // **problem line** p.then(function () { self.getRedirectUrl(redirectsTo, maxRedirects + 1); }); resolve(); } else { resolve(url); } } xhr.open('HEAD', url, true); xhr.send(); }); return p; } Then to use this function I do something like: getRedirectUrl(myUrl).then(function (url) { ... }); The issue is that resolve(); in getRedirectUrl will call the then() from the calling function before it calls the getRedirectUrl recursive call, and at that point, the URL is undefined. I tried, rather than p.then(...getRedirectUrl...) doing return self.getRedirectUrl(...) but this will never resolve. My guess is that the pattern I'm using (that I basically came up with on the fly) isn't right, altogether.
accepted answer: http://stackoverflow.com/a/29020886
favorite count: 0
tagged with: promise
upvote count: 61
has comment: http://stackoverflow.com/comment/46285027
possible better answer: http://stackoverflow.com/a/53913811
has answer: http://stackoverflow.com/a/63936254
has title: Recursive Promise in javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/57751853
type: Question
tagged with: recursion
has answer: http://stackoverflow.com/a/29020886
score: 61
tagged with: javascript
has answer: http://stackoverflow.com/a/69627622

http://stackoverflow.com/a/29059023
has body: A few things, first one that your console.log happens before they come from db. Second, and better, do not do all the unnecessary calls per user, make just one call for all of this. router.get('/account',isAuthenticated, function(req,res){ var following_users_details = []; User.find({ username: {$in: req.user.following_users} // assuming this is an array }, { // select options. This might be done differently though, // depending on your MongoDB driver/ORM username: true, profilepic: true, userbio: true }, // callback function (err, followedUsers) { // only now you have access to users, not before. Now log/send them if (err) {/* handle DB error */ res.render('users/userAccount',{ user:req.user, following_users_details: followedUsers }); // also log them to console. followedUsers.forEach(function(followedUser) { console.log(JSON.stringify(followedUser, null, 2); }); }); });
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29047069
answers question: http://stackoverflow.com/q/29047069
upvote count: 1
score: 1

http://stackoverflow.com/comment/46124984
has text: This is perfect thank you so much! I'm just learning jQuery a bit and was not sure of how to use conditionals! This makes perfect sense now that I look at it and apply it to my code! Thanks a bunch!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28934574
type: AnswerComment

http://stackoverflow.com/a/29053871
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29053773
type: AcceptedAnswer
downvote count: 0
has body: Count your successful calls and compare with the total number of calls. $('#update').click(function () { var calls=$('#view_26 tbody input[type=checkbox]:checked').length; var success=0; $('#view_26 tbody input[type=checkbox]:checked').each(function() { var id = $(this).closest('tr').attr('id'); $.ajax({ url: 'https://api.knackhq.com/v1/objects/object_1/records/' + id, type: 'PUT', data: {field_1: 'Closed'}, success: function (response) { success+=1; if(success==calls) alert('updated!'); } }); Maybe you should also catch unsuccessful calls.
accepted answer of: http://stackoverflow.com/q/29053773
type: Answer

http://stackoverflow.com/a/28907469
has comment: http://stackoverflow.com/comment/46074472
type: Answer
has comment: http://stackoverflow.com/comment/46074877
score: 4
accepted answer of: http://stackoverflow.com/q/28907256
has comment: http://stackoverflow.com/comment/46074913
answers question: http://stackoverflow.com/q/28907256
has comment: http://stackoverflow.com/comment/46074496
upvote count: 4
has comment: http://stackoverflow.com/comment/46074585
has body: That's an immense amount of code for a relatively simple problem. You should encode the distances as data tables instead of logic, and put the vehicle speeds directly into the form as the value attribute of the individual option elements: The code below does the whole thing: var distances = { amstelveen: { ameer: 14500, groning: 183000, einbest: 11400 }, badhoevedorp: { ameer: 13000, groning: 40000, zwolle: 600000 } }; document.getElementById('calculate').addEventListener('click', function () { var from = document.getElementById('woonplaats').value; var to = document.getElementById('bestemming').value; var speed = +document.getElementById('vervoer').value; var distance = distances[from][to]; var time = distance / speed; document.getElementById('div2').innerHTML = "your travel time will be: &lt;b&gt;" + time + "&lt;/b&gt;"; }, false); Demo at http://jsfiddle.net/alnitak/cwdhbk2x/
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28939664
has body: I think that the main problem comes from your way you count the frames. There doesn't seem to be a reliable way to go through an html5 video frame by frame but chrome and Firefox do provide some statistics infos. By checking webkitDecodedFrames || mozParsedFrames, you will have a more reliable info about the number of frames the browser actually demuxed and extracted out of the media. Firefox also has a mozPresentedFrames counter that allows you to check the number of frames been presented to the rendering pipeline. $('#video').on('ended', function(e){ $("#realDur>span").text(this.mozParsedFrames||this.webkitDecodedFrameCount); }); $("#video").on( "timeupdate", function(event){ onTrackedVideoFrame(this.currentTime, this.duration, this.mozPresentedFrames ); } ); function onTrackedVideoFrame(currentTime, duration, rCur, rDur){ $("#currentTime>span").text(currentTime); $("#currentFrame>span").text(currentTime*25+1); $("#duration>span").text(duration); $("#durationFrame>span").text(duration*25+1); $("#realCur>span").text(rCur); }; span{float: right; margin-right: 6em;} browser's current Time browser's video duration in Time script calculated current frame script calculated duration in frames browser calculated current frame browser calcutated duration in frames Play
answers question: http://stackoverflow.com/q/28936755
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28936755
score: 3
upvote count: 3

http://stackoverflow.com/a/28958017
upvote count: 8
type: Answer
score: 8
has comment: http://stackoverflow.com/comment/46168878
has comment: http://stackoverflow.com/comment/46169369
has body: Bijay Rai's statement is correct but not full answer. ngOption has rather complicated expressions and you should bother to examine documentation. If you change the way the option's object is being tracked you can avoid using same object by reference as stated. For example, use select as pattern &lt;select ng-model="selected2" ng-options="v.id as v.name for v in prop.values"&gt; &lt;/select&gt; Then you can simply assign selected like this: $scope.selected2 = 3; Updated plunkr
has comment: http://stackoverflow.com/comment/46169250
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28957570
accepted answer of: http://stackoverflow.com/q/28957570

http://stackoverflow.com/q/28991541
answer count: 1
has comment: http://stackoverflow.com/comment/46231982
has answer: http://stackoverflow.com/a/28992095
has comment: http://stackoverflow.com/comment/46231484
has comment: http://stackoverflow.com/comment/46232116
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46231885
accepted answer: http://stackoverflow.com/a/28992095
has comment: http://stackoverflow.com/comment/46233097
has body: I am trying to output all the values from the array with 'title element' There are 10 values - titles. PROBLEM: The for loop output all 10 values but it does this 10 times again. Title 1 Title 2 Title 3 Title 4 Title 5 Title 6 Title 7 Title 8 Title 9 Title 10 (OUTPUT AGAIN 10 TIMES) How can I solve this cannot get my head around it, the code: This function add the data in the array p_marker.push(marker);. function placesToVisitMarker(results, status) { image = 'pin56.png'; console.log(results); for (var i = 0; i &lt; results.length; i++) { var marker = new google.maps.Marker({ position: results[i].geometry.location, map: map, title: results[i].name, icon: image }); distanceService.getDistanceMatrix({ origins: [currentLocation], destinations: [results[i].geometry.location], travelMode: google.maps.TravelMode.WALKING }, callback); p_marker.push(marker); } } This function is were I suppose to output the title and distance into the #list div function callback(response, status) { if (status = "OK") { for (var i = 0; i &lt; p_marker.length; i++) { $("#list").append(p_marker[i].title + "&lt;/br&gt;"); } //$("#list").append( +" "+ response.rows[0].elements[0].duration.text + "&lt;/br&gt;") } else { $("#list").append("ERROR" + status); } }
type: Question
has title: Why it keeps iterating through the array elements multiple times?
tagged with: arrays
tagged with: javascript
tagged with: jquery
tagged with: google-maps-api-3
score: 0
has comment: http://stackoverflow.com/comment/46231749

http://stackoverflow.com/a/28923422
has body: You Are using Knockout to bind Json. Can you Post your Knockout Code? or Use On body load $(document).ready(function(){ var records = {packageId:'',packageName'' }; ko.applyBindings(records); }); and on ajax Success event just use records = JSON.parse(data.packages); where records is global variable of javascript.
has comment: http://stackoverflow.com/comment/46103715
has comment: http://stackoverflow.com/comment/46103823
has comment: http://stackoverflow.com/comment/46103604
has comment: http://stackoverflow.com/comment/46103739
has comment: http://stackoverflow.com/comment/46103883
answers question: http://stackoverflow.com/q/28916918
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46103648

http://stackoverflow.com/comment/46195945
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28972006
has text: no, try to wrap it like this `[{"line":etc....}]`
score: 0

http://stackoverflow.com/a/29031108
answers question: http://stackoverflow.com/q/29030944
score: 0
type: Answer
has body: You could use JQueries AJAX like below: $("#send").click(function(e){ e.preventDefault; var val1 = $("campoA").val(); var val2 = $("campoB").val(); $.ajax({ method: "POST", url: "url", data: { value1: val1, value2: val2 } }).done(function(){ // do something }); });
has comment: http://stackoverflow.com/comment/46303598

http://stackoverflow.com/comment/46349342
type: QuestionComment
type: Comment
has text: you can append the whole div to #play_again and then you won't need to intercept the change. you could also use css to scoot the buttons up instead of cloning or moving them.
score: 0
comment on: http://stackoverflow.com/q/29055783

http://stackoverflow.com/comment/46327482
comment on: http://stackoverflow.com/q/29043712
has text: Have you read up on [Buffer](https://nodejs.org/api/buffer.html)? That should get you started.
type: QuestionComment
type: Comment
score: 2

http://stackoverflow.com/q/29008440
tagged with: arrays
tagged with: javascript
score: 0
upvote count: 1
answer count: 1
has body: This is my data: $scope.data = [ { "top":"2", "status":"1", "name":"Anna", }, { "top":"2", "status":"1", "name":"Jodie", }, { "top":"2", "status":"1", "name":"susan", } ]; Now I want to convert the objects to arrays. When I run my program I get this following output in console log: { "1":{ "2":"3" } } But I need them to output as an array not object. Someone told me to use map function but I need to do them without using map function because it will cause a conflict in the process of my project. Is there any other way to do it without using map function? The 1 in output means status object. 2 means top object and 3 means the number of students who's top is in 2. This is the code I have so far: http://jsfiddle.net/DharkRoses/sjz5aLv1/ Any suggestions? TIA Update: I want the output which looks like this: ( [1] =&gt;Array ( [2] =&gt; 3 ) )
downvote count: 1
has comment: http://stackoverflow.com/comment/46265737
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29011208
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46262528
has comment: http://stackoverflow.com/comment/46262671
type: Question
has title: Angularjs: Convert objects to arrays
has comment: http://stackoverflow.com/comment/46262649
has comment: http://stackoverflow.com/comment/46263052

http://stackoverflow.com/q/29016658
has body: I'm trying to dig into a nested javascript array to grab the first instance of an object. Here's the code: var utils = require('utils'); var casper = require('casper').create(); casper.start('http://en.wikipedia.org/wiki/List_of_male_tennis_players', function() { this.echo(this.getTitle()); // Get info on all elements matching this CSS selector var tennis_info_text = this.evaluate(function() { var nodes = document.querySelectorAll('table.sortable.wikitable tbody tr'); return [].map.call(nodes, function(node) { // Alternatively: return Array.prototype.map.call(... return node.textContent; }); }); // Split the array into an array of object literals var tennis_data = tennis_info_text.map(function(str) { var elements = str.split("\n"); var data = { name : elements[1], birth : elements[2], death : elements[3], country : elements[4] }; return data; }); // Dump the tennis_names array to screen utils.dump(tennis_data.slice(1,5)); }); casper.run(); The result of stdout is this: { "name": "Acasuso, JoséJosé Acasuso", "birth": "1982", "death": "–", "country": " Argentina" }, { "name": "Adams, DavidDavid Adams", "birth": "1970", "death": "–", "country": " South Africa" },... For the name element, I'm getting everything from the tr row, which matches 2 elements when you look at the target url source. What I want is just the second part of the name element with class "fn"; for instance: "David Adams", "José Acasuso". I'm thinking something like name:elements[1].smtg should work, but I've had no luck. Additionally, how would I print the available object keys from the elements object?
tagged with: associative
has answer: http://stackoverflow.com/a/29017057
score: 1
has comment: http://stackoverflow.com/comment/46285551
type: Question
has comment: http://stackoverflow.com/comment/46283035
tagged with: arrays
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29017057
has title: Get value from nested JavaScript object in CasperJS
tagged with: casperjs
has comment: http://stackoverflow.com/comment/46278490
upvote count: 1
tagged with: object
type: AnsweredQuestion

http://stackoverflow.com/q/29017494
score: 2
tagged with: hyperlink
has comment: http://stackoverflow.com/comment/46279674
has title: Replace HREF with what's in between tags (with expressions for emails)
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/46279175
has body: So in a previous question, I was helped out to learn that you can grab what is in between the link tags and place it inside the HREF: $('a').attr('href', function () { return 'http://' + $(this).text()}) However, I need a bit more help: I need to identify when the text between the tags is an email to make it into a mailto: href instead. I don't have much experience with reg expressions, so any advice &amp; direction would be awesome. Thanks!
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46279220
linked to: http://stackoverflow.com/q/201323
has comment: http://stackoverflow.com/comment/46279852
has answer: http://stackoverflow.com/a/29017594
tagged with: http://stackoverflow.com/tag/html
tagged with: regex
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46279165

http://stackoverflow.com/comment/46197698
type: Comment
comment on: http://stackoverflow.com/a/28972392
type: AnswerComment
has text: LOL . . . he gave it a good shot . . . figured that I would help him out a bit. ;)
score: 0

http://stackoverflow.com/comment/46226587
type: Comment
type: QuestionComment
has text: Without using regex you cannot do **replace-all**
comment on: http://stackoverflow.com/q/28988988
score: 0

http://stackoverflow.com/comment/46147384
comment on: http://stackoverflow.com/q/28944871
type: Comment
has text: Because in fact label markers do already work, they work in embed maps, i suppose there should be a way to use them in custom maps as well. And if I want something fancy I'd rather create a custom marker.
type: QuestionComment
score: 0

http://stackoverflow.com/q/28915000
answer count: 2
has answer: http://stackoverflow.com/a/28915080
upvote count: 1
downvote count: 1
has body: I want to use element-loops to create a table. I put one for every row and put a around it all, like this: HTML: Some text Some text Some text Some text CSS: .tableEmulator { width: auto; height: auto; border: 1px solid; border-color: blue; } .trEmulator { clear:both; border: 1px solid; border-color: red; with:auto; } .trEmulator li { list-style:none; float:left; position: relative; padding: 5px 10px; border: 1px solid #eee; } However I´m stuck in css trying to make to outer border of my table. I expected width/height: auto; would do the trick, but it doesn´t. Any suggestions? Thanks in advance! Fiddle: http://jsfiddle.net/AsleG/baLhx3v0/
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46088127
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46089225
has title: CSS styling of as table
type: Question
has answer: http://stackoverflow.com/a/28915161
accepted answer: http://stackoverflow.com/a/28915161
possible better answer: http://stackoverflow.com/a/28915080
score: 0

http://stackoverflow.com/q/28944635
answer count: 3
has answer: http://stackoverflow.com/a/28944892
accepted answer: http://stackoverflow.com/a/28944892
tagged with: jquery
favorite count: 0
tagged with: operators
tagged with: logic
has answer: http://stackoverflow.com/a/28944704
has answer: http://stackoverflow.com/a/28944677
has title: Logical operators and their behavior in JavaScript
has body: Why does this fail? The way I read this code is "if either a or b or c equals three, then the statement is true". But apparently JavaScript disagrees. Why? function test() { var a = 'one'; var b = 'two'; var c = 'three'; return ( ( a || b || c ) === 'three' ); } EDIT: am aware of the fact that i need to evaluate each expression separately, but was looking for a quicker way to write it. any suggestions will be welcome.
upvote count: 1
downvote count: 1
type: Question
type: AnsweredQuestion
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28944677
score: 0
tagged with: logical-operators

http://stackoverflow.com/comment/46300500
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28975730
has text: I don't have a good example of how to listen to clipboard changes in some other language (you need to look it up), but if you do have a program ready (outside Chrome) that can, you can hook it up with Chrome using [Native Messaging](https://developer.chrome.com/extensions/nativeMessaging). Read that documentation to get an idea; sorry, I can't be more specific.

http://stackoverflow.com/q/29018770
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29019447
downvote count: 0
score: 1
type: Question
has title: Jquery + css transition only works properly when console.log(...css("left")); is called
tagged with: javascript
tagged with: jquery
answer count: 2
upvote count: 1
has body: I'm making a carousel using Jquery, Javascript, and using CSS to handle the transitions of each item, but the sliding direction only works correctly when console.log($tipToAnimate.css("left:)); is added right after the conditional statement to assign the direction. I thought at first that this might be an issue of things firing too fast, so I added a timeout before adding the .current class (which controls when a slide should appear) but that yielded no change in behavior. I was using classes to handle all of this and moved to using Jquery to set the CSS, but that too has yielded the same behavior. Here's what I have: var TIPS = TIPS || {}; TIPS.animateTips = function(arrow) { var $arrow = $(arrow.target), direction = $arrow.data("direction"), $tip = $arrow.parent(); animateTip($tip, direction); }; function animateIn(self, direction) { if (direction == "left") { var $tipToAnimate = self.prev(); // find previous tip if going left } else if (direction == "right") { var $tipToAnimate = self.next(); // find next tip if going right } if ($tipToAnimate.length == 0) { // if there is no previous or next tip if (direction == "left") { $tipToAnimate = $(self).nextAll(".tip").last(); // find last tip if on first tip } else if (direction == "right") { $tipToAnimate = $(self).prevAll(".tip").last(); // find first tip if on last } } positionTip($tipToAnimate, direction); //this is the function that defines left revealTip($tipToAnimate, direction); $tipToAnimate.addClass("current"); } function animateOut(self, direction) { self.addClass("exiting"); if (direction == "left") { self.css("left", "-1400px"); } else if (direction == "right") { self.css("left", "1300px"); } self.removeClass("current"); $(".exiting").one("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function(){ $(this).css("left", ""); $(this).addClass("hidden").removeClass("exiting"); $(this).off("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"); }); } function animateTip(self, dir…
has answer: http://stackoverflow.com/a/29019045
favorite count: 0

http://stackoverflow.com/comment/46318280
type: AnswerComment
comment on: http://stackoverflow.com/a/29024408
score: 0
type: Comment
has text: Does your server-side code even get to the second callback? Maybe you should also throw an error if creating a customer fails.

http://stackoverflow.com/comment/46306343
score: 0
type: Comment
has text: I posted first, but James posted a better explanation.
type: AnswerComment
comment on: http://stackoverflow.com/a/29032562

http://stackoverflow.com/q/29018618
has answer: http://stackoverflow.com/a/29072443
type: Question
has comment: http://stackoverflow.com/comment/46310281
possible better answer: http://stackoverflow.com/a/29072443
has answer: http://stackoverflow.com/a/29018970
has comment: http://stackoverflow.com/comment/46281161
tagged with: javascript
has comment: http://stackoverflow.com/comment/46284271
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/46281148
tagged with: netsuite
has comment: http://stackoverflow.com/comment/46281504
has title: How do I make my code faster?
has comment: http://stackoverflow.com/comment/46281485
has answer: http://stackoverflow.com/a/29019049
has comment: http://stackoverflow.com/comment/46281248
accepted answer: http://stackoverflow.com/a/29019049
type: AnsweredQuestion
has body: The following code works great to accomplish what I want to achieve in netsuite, but I am having trouble finding ways to make it faster. I tried not using the system nlapi as frequently, but I couldn't seem to make it work without submitting the record. Any guidance would be appreciated. function WonLost(type, name) { if (name == 'custbody138') { var recordid = nlapiGetRecordId(); var record = nlapiLoadRecord('estimate', recordid); if ((nlapiGetFieldValue('custbody138')) == 'T') { var itemsall = ""; var lineCount = parseInt(record.getLineItemCount('item')); var x = 1; while (x &lt;= lineCount) { nlapiSelectLineItem('item', x); nlapiSetCurrentLineItemValue('item', 'custcol55', 'T', 'false'); nlapiCommitLineItem('item'); x++; } } else { var itemsall = ""; var lineCount = parseInt(record.getLineItemCount('item')); var x = 1; while (x &lt;= lineCount) { nlapiSelectLineItem('item', x); nlapiSetCurrentLineItemValue('item', 'custcol55', 'F', 'false'); nlapiCommitLineItem('item'); x++; } } } }
has comment: http://stackoverflow.com/comment/46281350

http://stackoverflow.com/q/28987568
type: Question
linked to: http://stackoverflow.com/q/14591063
has comment: http://stackoverflow.com/comment/46225249
answer count: 1
score: 0
has comment: http://stackoverflow.com/comment/46224905
tagged with: extjs4.1
has title: How to change "valueField" of extjs Combobox from controller
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28990058
has body: I am totally new to Extjs, Following is part of structure of my app View - contain combobox xtype: 'combobox', itemId: 'myCombo', fieldLabel: 'myLabel', queryMode: 'local', store: Ext.create('Ext.data.ArrayStore', { fields: [{ name: 'key1' }, { name: 'key2' }], storeId: 'myStore', autoLoad: false }), displayField: 'key1', valueField: 'key2', Controller - Contain reference to combobox Ext.define('MyApp.controller.myController', { extend: 'Ext.app.Controller', views: ['MyApp.view.MyView'], refs: [{ ref: 'myComboRef', selector: '#myCombo' }], this.control({ '#myCombo': { change: this.getData }), . . . getData: function(currFeild, newValue, oldValue, eOpts){ // I can get "valueField" of myCombo by var valueFieldData = this.getMyComboRef().valueField; // I want to change "valueField" to "key3" // ???????? }); So can anybody please tell me, how can I set new valueField for "myCombo" ? I already visited this link. But, it didn't helped much
tagged with: extjs
has comment: http://stackoverflow.com/comment/46225463
tagged with: extjs4
has comment: http://stackoverflow.com/comment/46224792

krpano
type: Tag
tag name: krpano
tags question: http://stackoverflow.com/q/28939433

middleware
tags question: http://stackoverflow.com/q/28998749
type: Tag
tags question: http://stackoverflow.com/q/28933981
tag name: middleware

http://stackoverflow.com/a/28981550
answers question: http://stackoverflow.com/q/28981495
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46216086
type: Answer
has comment: http://stackoverflow.com/comment/46213128
upvote count: 1
has body: You cannot use + operator between a jQuery object and a string. The correct way to do it is this: $(".win1", onePlane).css("height", parseInt(baseHeight*1)); $(".win2", onePlane).css("height", parseInt(baseHeight*2)); $(".win3", onePlane).css("height", parseInt(baseHeight*3)); Each of these queries translates to: select all elements with .winX that are inside the jQuery object onePlane.
accepted answer of: http://stackoverflow.com/q/28981495
score: 1

http://stackoverflow.com/a/29082217
answers question: http://stackoverflow.com/q/29035717
has body: If your ajax response doesn't have id and text attributes you should fix them client side This is a requirement on version 4.0 (don't know why) ajax: { processResults: function (data, params) { params.page = params.page || 1; // you should map the id and text attributes on version 4.0 var select2Data = $.map(data.result.data, function (obj) { obj.id = obj._id.$id; obj.text = obj.name; return obj; }); return { results: select2Data, pagination: { more: data.result.more } }; } }
accepted answer of: http://stackoverflow.com/q/29035717
upvote count: 70
type: AcceptedAnswer
downvote count: 0
score: 70
type: Answer

http://stackoverflow.com/q/28965798
has answer: http://stackoverflow.com/a/28967171
type: UnansweredQuestion
has title: Pass parameters to dynamically created div element?
has body: I have a page where I'm creating several divs dynamically inside a div of my parent page. for (i = 0; i &lt; pages.length; i++) { var e = document.createElement("div"); var eid = "dynamicdiv-" + i; e.id = eid; e.style.cssText = 'position:absolute; left: ' + left + 'px; color: #0000bb;'; maindiv.appendChild(e); $('#' + eid).load(pages[i]); } My pages variable is an array of strings of urls. They are all html pages and have their own parameters. The problem I'm having is with jquery load(). It does not appear to be passing the parameters I need to create the page. Instead, it's passing the parameters from my parent page. The CSS on these pages are also not loading. I'm fairly new to javascript, any help would be greatly appreciated. Example url: http://example.com/index.html?param1=value Any ideas? Thanks!
tagged with: css
has comment: http://stackoverflow.com/comment/46183541
has comment: http://stackoverflow.com/comment/46183383
linked to: http://stackoverflow.com/q/2090551
type: Question
linked to: http://stackoverflow.com/q/14757691
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28966181
has comment: http://stackoverflow.com/comment/46183336
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28966002
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/46191554
comment on: http://stackoverflow.com/q/28958362
score: 0
type: Comment
has text: So I figured out that on my macbook (chrome) the input that I am trying to focus on ng-click IS getting focus... but for some reason on my desktop (Ubuntu 14.04 Chrome) it's not? This is super bizarre... same code on both but different results?
type: QuestionComment

http://stackoverflow.com/q/28956414
answer count: 0
has comment: http://stackoverflow.com/comment/46166726
score: 1
type: Question
has title: draggable() containment within 2 divs
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46166795
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/46166747
favorite count: 0
has body: Is it possible to restrict draggable() within 2 divs? $('#drg').draggable({ containment: $('#divb') // how do I say $('#diva') &amp; $('#divb') });
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/comment/46236400
comment on: http://stackoverflow.com/q/28993778
has text: Can you put together a Fiddle with what you currently have? Set it up at http://jsfiddle.net/, save it, and then put the link in your post so we have a reference to what you have. That will make it easier.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46253314
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29002435
has text: @Barmar thanks, yes when I use json_encode() its give same value which I want like [[0.2,0.1],[0.4,0.21],[0.6,0.45],[0.8,0.75]] when I print data1 but when I pass this value in dataTable.addRows(data1) its gave same error message Uncaught Error: Argument given to addRows must be either a number or an array but when I used hadcode value like that dataTable.addRows([[0.2,0.1],[0.4,0.21],[0.6,0.45],[0.8,0.75]] ) it working corectlly please tell me where I am wrong

http://stackoverflow.com/q/28991995
has body: I've recently switched markup in few of the forms to use angularJS ui Tabs component. The markups looks like this: and the controller's code to select a view is the following: $scope.selectView = function (viewName) { if ($scope.isNew) { $state.go('new.' + viewName); } else { $state.go('edit.' + viewName); } }; All seems to work well except for this change in behavior comparing with the original implementation - if I make invalid input in one of the controls, switch to another tab, then back, that bad input is gone. The valid input is preserved. I am wondering if it's possible to keep the invalid input this way or not?
linked to: http://stackoverflow.com/q/21345987
tagged with: javascript
has comment: http://stackoverflow.com/comment/46239415
has comment: http://stackoverflow.com/comment/46241042
has comment: http://stackoverflow.com/comment/46240002
has comment: http://stackoverflow.com/comment/46240566
has comment: http://stackoverflow.com/comment/46241267
has answer: http://stackoverflow.com/a/28996309
score: 0
possible better answer: http://stackoverflow.com/a/29016109
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29016109
has comment: http://stackoverflow.com/comment/46237046
tagged with: angular-ui
tagged with: angularjs
linked to: http://stackoverflow.com/q/19393559
accepted answer: http://stackoverflow.com/a/28996309
has comment: http://stackoverflow.com/comment/46238142
has comment: http://stackoverflow.com/comment/46237255
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46242181
has comment: http://stackoverflow.com/comment/46240248
has comment: http://stackoverflow.com/comment/46241000
has comment: http://stackoverflow.com/comment/46243867
has title: Using ui-views and angularjs ui Tabs and invalid input
tagged with: uiview
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46233058

http://stackoverflow.com/q/28933756
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46123728
tagged with: wordpress
type: Question
accepted answer: http://stackoverflow.com/a/28934150
tagged with: javascript
score: 0
has body: I'm having a lot of trouble getting PowerTip plugin to work on a new WP site. The site is closed for development, but I'll try to be as specific as possible. Hopefully I missed something simple because this seems like a great plugin. The script jquery.powertip.js was uploaded to my theme's JS directory. The css file jquery.powertip.css was uploaded to my theme's css directory. I call the script in the header directly above: &lt;link rel="stylesheet" href="css/jquery.powertip.css"&gt; &lt;script src="js/jquery.powertip.js"&gt;&lt;/script&gt; &lt;/head&gt; I've also tried the direct http link instead or a relative one, but that didn't make a difference. Here's an example of an img snippet I'm testing the plugin on. &lt;img class="productImage" src="/wp-content/uploads/2015/03/cow.png" title="This is a test"&gt; I've added the following funtion to my main.js file as follows: $('.productImage').powerTip({ placement: 'ne' // north-east tooltip position }); I also add this to my main css file as recommended by the plugin documentation: #powerTip { position: absolute !important; display: none !important; z-index:2147483647 !important; } If anyone could help me out I'd really appreciate it. Here's a link the github plugin: jQuery PowerTip: GitHub
answer count: 1
tagged with: jquery
has title: jQuery PowerTip Trouble W/ Wordpress
has answer: http://stackoverflow.com/a/28934150

http://stackoverflow.com/q/29037658
tagged with: ajax
has comment: http://stackoverflow.com/comment/46316369
has comment: http://stackoverflow.com/comment/46319738
has comment: http://stackoverflow.com/comment/46316284
tagged with: xmlhttprequest
has comment: http://stackoverflow.com/comment/46316053
has comment: http://stackoverflow.com/comment/46316140
has comment: http://stackoverflow.com/comment/46316031
answer count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/14801320
type: Question
tagged with: parameters
has comment: http://stackoverflow.com/comment/46316107
has comment: http://stackoverflow.com/comment/46316630
has comment: http://stackoverflow.com/comment/46315970
has body: I realize that this a variant of Issue with retrieving a parameter from a $.ajax call but I'd like to try and solve this with JavaScript or jQuery alone. The above question's solution uses PHP $_REQUEST to convert the parameters from a PHP variable to a JS variable. Ugly and not well-written uniform code! When issuing a $.GET, if the target script is not a PHP file (say an HTM, instead), there should be a method to retrieve the query parameters. However, every solution I've come across for pulling them is not meant for a $.GET, as the XHR URL may be http://mysite/forms/form.processScript.htm, the actual WINDOW URL is http://mysite/index.php. Each solution, including PURL and the various getUrlVars scripts, only pull query parameters from the WINDOW URL, resulting in undefined variables. If I were more familiar with the internal XHR process, I could probably work through this on my own. Unfortunately, until now, that has not been a high priority.
score: 0
has title: Retrieving query parameters from a $.GET
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/46192900
score: 0
type: AnswerComment
type: Comment
has text: @user3633970 change it after you include html.
comment on: http://stackoverflow.com/a/28970613

http://stackoverflow.com/comment/46250231
comment on: http://stackoverflow.com/q/29001157
type: Comment
type: QuestionComment
has text: If you think **map** is not a loop, why do you think **forEach** is a loop.
score: 1

http://stackoverflow.com/a/28918549
score: 0
type: Answer
has body: Try WebcamJS. One of the demo pages - test it on my android 4.4 phone minute ago - works fine :-) This library allows you to: display preview; capture image; upload captured image to server; fallback to flash if HTML5 getUserMedia() is not supported;
answers question: http://stackoverflow.com/q/28917960

http://stackoverflow.com/q/29035639
score: 0
has comment: http://stackoverflow.com/comment/46313526
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/46320791
tagged with: javascript
has body: I am new with anglarjs and I am working on ng-view example which is available here, actually the problem is that when I run application in firefox it show me only text in index.page, not shown any result related to angularjs. index.html Choose: Moby | Moby: ch1 | Gatsby | Gatsby: ch4 | Scarlet Letter $location.path() = {{main.$location.path()}} $route.current.templateUrl = {{main.$route.current.templateUrl}} $route.current.params = {{main.$route.current.params}} $routeParams = {{main.$routeParams}} app.js The controller is define here. var myApp = angular.module('ngviewExample',['ngRoute']) .config(['$routeProvider','$locationProvider', function ($routeProvider,$locationProvider){ $routeProvider .when('/Book/:bookId', { templateUrl: 'book.html', controller: 'BookCtrl', controllerAs: 'book' }); $locationProvider.html5Mode({ enabled : true, requireBase : false }); }]) .controller('MainCtrl', ['$route', '$routeParams', '$location', function($route, $routeParams, $location) { this.$route = $route; this.$location = $location; this.$routeParams = $routeParams; }]) .controller('BookCtrl', ['$routeParams', function($routeParams) { this.name = "BookCtrl"; this.params = $routeParams; }]); All the angularjs files are loading fine but it's not showing any error in Firebug console. But when I debug this code I don't know why it go inside the following code on accessing the url http://localhost:8383/TestingDirective/index.html .when('/Book/:bookId', { templateUrl: 'book.html', controller: 'BookCtrl', controllerAs: 'book' }); Also shown in the snap-shot. Can anyone please tell me what I am missing here, only text of index.html page show on the page and nothing else. Any help would be appreciated.
has comment: http://stackoverflow.com/comment/46312078
has title: Unable to understand the flow of angularjs?

http://stackoverflow.com/a/29011790
score: 2
has body: I would remove 'hover' Javascript part and let CSS do its job. Run JS just to prepare the field and than let the browser relax. Here is a sample code (also a Fiddle): $(function () { $('img[data-hover]').each(function () { var thisImage = $(this); var hoverSrc = thisImage.data('hover'); var hoverImage = $('&lt;img class="bw_image" src="' + hoverSrc + '" /&gt;'); thisImage.after(hoverImage); }) }); .hovering { display: inline-block; position: relative; } .hovering img { display: block; } .bw_image { position: absolute; left: 0; top: 0; opacity: .01; transition: opacity ease-in-out .2s; } .bw_image:hover { opacity: 1; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;a class="hovering" href="url"&gt; &lt;img src="http://lorempixel.com/200/200/sports/1/" data-hover="http://lorempixel.com/g/200/200/sports/1/" /&gt; &lt;/a&gt; &lt;a class="hovering" href="url"&gt; &lt;img src="http://lorempixel.com/200/200/sports/2/" data-hover="http://lorempixel.com/g/200/200/sports/2/" /&gt; &lt;/a&gt; &lt;a class="hovering" href="url"&gt; &lt;img src="http://lorempixel.com/200/200/sports/3/" data-hover="http://lorempixel.com/g/200/200/sports/3/" /&gt; &lt;/a&gt;
upvote count: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29011001
accepted answer of: http://stackoverflow.com/q/29011001

http://stackoverflow.com/comment/46241658
score: 0
has text: Safari Version 8.0.3 (10600.3.18). I just checked in Chrome and it does work, however.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28996480

http://stackoverflow.com/comment/46165684
comment on: http://stackoverflow.com/a/28954929
score: 0
has text: Without using a `Promise constructor` can I send a reject on the catch? I tried reject() on the else block in catch but promise still acted as resolved.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46400674
score: 0
comment on: http://stackoverflow.com/q/29031149
type: QuestionComment
type: Comment
has text: Is requirement to call `error` if response from server > 20s , or _not_ call `error` if response from server > 20s ?

http://stackoverflow.com/q/29006600
type: Question
has answer: http://stackoverflow.com/a/30055514
tagged with: javascript
tagged with: ng-grid
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has title: unable to move the cursor inside the edit field in the row in ng grid
tagged with: angularjs
has answer: http://stackoverflow.com/a/64800100
type: UnansweredQuestion
has body: I am using nggrid 2.x version ,I want to move the cursor inside the text field in the rows but the arrow keys has no effect on the edit field.

http://stackoverflow.com/comment/46214069
comment on: http://stackoverflow.com/q/28980686
has text: The JS for @BlackDevil is useless here...
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29038564
has body: Sorry if the title is so vague, I'm not sure how to explain it better. Why does using an anonymous function call work in this case: Team .findAll() .then(function(teams) { res.send(teams); }); But passing res.send directly into the .then(), it doesn't work: Team .findAll() .then(res.send); This results in this error: Possibly unhandled TypeError: Cannot read property 'method' of undefined at res.send (/opt/web/projects/node_modules/express/lib/response.js:83:27) at Promise._settlePromiseAt (/opt/web/projects/node_modules/sequelize/lib/promise.js:76:18) at process._tickCallback (node.js:442:13) Aren't these two equal to each other? res.send only accepts one parameter, so it's not like it's passing some weird unknown argument into the function.
type: Question
has answer: http://stackoverflow.com/a/29038578
has title: Why are these two function calls not equal to each other?
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: express
accepted answer: http://stackoverflow.com/a/29038578
type: AnsweredQuestion
tagged with: anonymous-function
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/46318039

http://stackoverflow.com/comment/46216853
type: QuestionComment
comment on: http://stackoverflow.com/q/28983926
has text: or look at a solution like [debounce](http://underscorejs.org/#debounce)
score: 1
type: Comment

http://stackoverflow.com/q/28937525
has title: Expects aren't working in Chai as Promised results
answer count: 1
has comment: http://stackoverflow.com/comment/46134261
tagged with: chai
tagged with: chai-as-promised
tagged with: javascript
has comment: http://stackoverflow.com/comment/46262922
tagged with: mocha.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46134975
score: 2
has body: I'm new to Promises in JavaScript, and whilst it seems to be working for me to an extent, I'm unable to test the 'reject' value. I'm passing through an Error, and want to ensure that it is an error and more importantly, that the error code matches what I'm expecting. return new Promise(function(resolve, reject){ tableService.deleteEntity(config.azureTable.tableName, visitor.azureEntity(), function (error, response) { // If successful, go on. if (!error) { resolve(response); } // If unsuccessful, log error. else { /* If we know it's a resourceNotFound that's causing the error, return that. */ if (error.code === 'ResourceNotFound') { reject(new Error('Record not found')); } // For unexpected errros. else { reject(new Error('Table service error (delete): ' + error)); } } }); }); The test, in Mocha - using chai and chai-as-promised. Everything else is working (I have 24 passing tests) - but this one has me stuck! it('return an error when the lookup fails', function (done) { storage.delete(globalUUID).then(function(sucess) { done(sucess); }, function(error) { expect(error).to.be.an(Error); done(); }); }); Any help would be greatly appreciated.
downvote count: 0
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/46214710
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/46130987
has comment: http://stackoverflow.com/comment/46262804
has comment: http://stackoverflow.com/comment/46132367
has comment: http://stackoverflow.com/comment/46135146
has answer: http://stackoverflow.com/a/49335782

http://stackoverflow.com/comment/46230318
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28990868
has text: Thank you! This is what I am looking for except I want it to be a little more universal. So it can work with any tag dynamically. In this case you know it is a UL tag. Lets pretend we don't know what tag the element is. in other words in a function where the element is passed in how can I get the element itself and its children into a html collection.

http://stackoverflow.com/comment/46116081
type: Comment
score: 1
type: QuestionComment
has text: I've cleaned up your code formatting. Looking at the result, I suspect you have a misplaced pair of `{}` (at least, there seem to be other issues as well).
comment on: http://stackoverflow.com/q/28930156

http://stackoverflow.com/comment/46303986
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29031405
has text: One other thing, remove the `%` characters surrounding the database name variable. Why do you have all of those quotes?
score: 0

asp.net-mvc-4
tags question: http://stackoverflow.com/q/28935733
tags question: http://stackoverflow.com/q/28945990
tag name: asp.net-mvc-4
tags question: http://stackoverflow.com/q/28907713
tags question: http://stackoverflow.com/q/28918159
type: Tag
tags question: http://stackoverflow.com/q/29048400
tags question: http://stackoverflow.com/q/28962178
tags question: http://stackoverflow.com/q/28977445
tags question: http://stackoverflow.com/q/28942792
tags question: http://stackoverflow.com/q/29051742
tags question: http://stackoverflow.com/q/28961224
tags question: http://stackoverflow.com/q/28988623
tags question: http://stackoverflow.com/q/28959362
tags question: http://stackoverflow.com/q/28970746
tags question: http://stackoverflow.com/q/28930330

http://stackoverflow.com/comment/46278383
has text: Are you receiving any console errors? I would set a break point inside your loop and make sure json is actually formatted the way you think it is.
type: QuestionComment
comment on: http://stackoverflow.com/q/29015723
score: 0
type: Comment

http://stackoverflow.com/comment/46318965
type: Comment
comment on: http://stackoverflow.com/a/29038048
score: 3
type: AnswerComment
has text: The documentation on Firebase's website is fairly complete and quite readable. Turning off listeners is done through `off`: https://www.firebase.com/docs/web/guide/retrieving-data.html#section-detaching-callbacks

http://stackoverflow.com/comment/46318853
type: Comment
has text: Do you mean you want to remove the form elements from the DOM? Or from the array?
comment on: http://stackoverflow.com/q/29038981
score: 0
type: QuestionComment

http://stackoverflow.com/comment/46329035
type: AnswerComment
has text: @lina Then does this works? `alert( window.socialAuth.accessFacebook(function success() {}, function error() {}));`
comment on: http://stackoverflow.com/a/29044674
type: Comment
score: 0

http://stackoverflow.com/comment/46373203
comment on: http://stackoverflow.com/a/29027293
has text: @JoeyHipolito with this condition `i >= points.length` you are trying to fetch elements out of array bounds.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46193885
has text: At what line, exactly? That error often means that jQuery isn't loaded.
comment on: http://stackoverflow.com/q/28970605
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46191272
type: Comment
type: QuestionComment
has text: @j08691 no, unfortunately is a private site I'm working on so I can't provide a link to it.
comment on: http://stackoverflow.com/q/28969361
score: 0

http://stackoverflow.com/q/28932921
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28932975
tagged with: animation
has body: I am having difficulty getting my pages to fadeout on clicking new page links, the pages fade in fine but for some reason the fadeOut is bypassed on existing pages where a link is clicked, I even tried adding a delay before the fadeout and as you can see there is also event.preventDefault yet the default is still initiated. Any help much appreciated.. See example js here: $(function() { $('body').css('display', 'none'); $('body').fadeIn(1000); $('.link').click(function() { event.preventDefault(); newLocation = this.href; $('body').delay(1500).fadeOut(1000, newpage); }); function newpage() { window.location = newLocation; } });
tagged with: transition
type: Question
tagged with: javascript
has title: fadeIn page fadeOut page
tagged with: fade
score: 0
answer count: 1

date
tags question: http://stackoverflow.com/q/28933292
tags question: http://stackoverflow.com/q/28916127
tags question: http://stackoverflow.com/q/29004501
tags question: http://stackoverflow.com/q/29016596
tags question: http://stackoverflow.com/q/28989484
tag name: date
tags question: http://stackoverflow.com/q/28979928
tags question: http://stackoverflow.com/q/28954317
tags question: http://stackoverflow.com/q/28948875
tags question: http://stackoverflow.com/q/28986007
tags question: http://stackoverflow.com/q/28915522
tags question: http://stackoverflow.com/q/29050827
tags question: http://stackoverflow.com/q/29027470
tags question: http://stackoverflow.com/q/28955905
tags question: http://stackoverflow.com/q/29020363
type: Tag
tags question: http://stackoverflow.com/q/29047991
tags question: http://stackoverflow.com/q/28933950
tags question: http://stackoverflow.com/q/28941249
tags question: http://stackoverflow.com/q/28941491
tags question: http://stackoverflow.com/q/29042911
tags question: http://stackoverflow.com/q/28979959
tags question: http://stackoverflow.com/q/29027367
tags question: http://stackoverflow.com/q/29016034

http://stackoverflow.com/comment/46147582
score: 2
comment on: http://stackoverflow.com/q/28946512
type: Comment
type: QuestionComment
has text: Well I'm no expert with that framework but it looks like it stops at the first route that matches the path. I would try to determine whether that plain "/" matches anything. It's pretty common for routing mechanisms like that to split your paths into "/app/..." and "/statics/..." for this very reason.

http://stackoverflow.com/a/28948650
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46151308
answers question: http://stackoverflow.com/q/28948413
downvote count: 0
has body: I recommend using a modal window to this, http://jqueryui.com/dialog/#modal-confirmation. &lt;script&gt; $(function() { $( "#dialog-confirm" ).dialog({ resizable: false, height:140, modal: true, buttons: { "Delete all items": function() { $( this ).dialog( "close" ); //$.ajax(... }, Cancel: function() { $( this ).dialog( "close" ); //$.ajax(... } } }); }); &lt;/script&gt;
type: Answer

http://stackoverflow.com/a/28975207
has body: Another way to do this, albeit un-semantically is to position the main checkbox outside the table, then reposition over the table head. Business Name Contact Name Address City State Then the CSS .checkbox-boss { position: relative; top: 42px; left: 12px; width: 100px; background: red; }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28974680

http://stackoverflow.com/q/29042357
has answer: http://stackoverflow.com/a/29042568
has title: adding style to a javascript form error
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I am using an hubspot form in an external website: I am unable to change the css attributes of the javascript body. My code is as below: How do i add style to this? e.g.: background to it? Thanks in advance!
tagged with: css
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46324893
type: Question

http://stackoverflow.com/q/28974438
possible better answer: http://stackoverflow.com/a/28974604
has answer: http://stackoverflow.com/a/28974604
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I believe that this should be quite simple, and I thought that I was on to something, but its just not working. Forgive me, as Javascript is not my forte. I just want the main button (Get Your New Rate) to do one of two things, based on whether the user selects YES or NO to the last of the 3 questions (these are styled radio buttons). Thanks in advance for your time! Here is the page in progress: http://atomcrayon.com/mediaforce/refinance_go_v3.1/go.html YES NO Get Your New Rate function CheckLicense() { var licenseYes = document.getElementById("radioLicenseYes"); var licenseNo = document.getElementById("radioLicenseNo"); if(licenseYes.checked) { $(".getRate").click(function() { $("#questions").fadeOut(500); $("#loadingAnim").delay(500).fadeIn(1).delay(7000).fadeOut(500); $("#loading1").delay(500).fadeIn(500).delay(1500).fadeOut(500); $("#loading2").delay(3000).fadeIn(500).delay(1500).fadeOut(500); $("#loading3").delay(5500).fadeIn(500).delay(1500).fadeOut(500); $("#qualify").delay(8000).fadeIn(500); $("#redirecting").delay(8800).fadeIn(1); $("#loadingAnim2").delay(8800).fadeIn(1); }); } else if(licenseNo.checked) { $(".getRate").click(function() { $("#questions").fadeOut(500); $("#noQualify").delay(500).fadeIn(500); }); } }
accepted answer: http://stackoverflow.com/a/28974593
type: AnsweredQuestion
has title: JQuery actions depending on which radio button is selected - if/else
has answer: http://stackoverflow.com/a/28974593
type: Question
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/46265752
score: 0
type: Comment
type: AnswerComment
has text: The search feature is part of the DataTable and is auto generated when table is built... Thanks for the heads up on the links
comment on: http://stackoverflow.com/a/28998011

http://stackoverflow.com/comment/46329719
comment on: http://stackoverflow.com/a/29024501
has text: No, jquery doesn't come with a "full library", nor should it. Jquery is broken up into components, to keep it smaller, more modular and more maintainable. But the beauty of it all is, that you can pick and choose what components of it you need, based on what you need at the time. Think of it like a new car. Some people just need it to get from point a to b. They don't need a V8 engine, spoilers, digital speedometer etc, they just need 4 wheels an engine and seats. jQuery works on this same concept. You (the driver) decide what you need, and go from there.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28978248
tagged with: reactjs
downvote count: 0
has title: Which event to use for emitting change from inputs?
answer count: 1
tagged with: javascript
tagged with: reactjs-flux
has answer: http://stackoverflow.com/a/28980641
favorite count: 0
has body: I have a React component that has many &lt;TextInput&gt; components, which are just simple wrappers around text &lt;input&gt; elements. Example: &lt;div&gt; &lt;TextInput value={person.FirstName} ... /&gt; &lt;TextInput value={person.LastName} ... /&gt; &lt;/div&gt; I also have some state represented by a person object. For example: { "FirstName": "Buster", "LastName": "Posey" } Each &lt;TextInput&gt; component manages it's own internal state, which is the value of the text &lt;input&gt; at a given time. When I click on a Save button, I want to make sure the person object has the most recent values from all of the &lt;TextInput&gt; components. I can think of two ways to do this: Events (onKeyDown, onChange, onBlur). An event inside the &lt;TextInput&gt; will create an action, it goes through the dispatcher, and the store updates the person object one field at a time. Refs. I know this is an anti-pattern, but it really does seem so much simpler. I can iterate over refs when Save is clicked and pull out the state and fire an action. What is the idiomatic way of doing this?
upvote count: 1
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28980641
type: Question

http://stackoverflow.com/a/29161641
has body: If you aren't opposed to using jQuery to solve this issue, here is another not so elegant option that doesn't force you to always show a scroll bar: JS - Apply concrete values for centering page $(window).load(function() { var margin = $(".container").offset().left; $(".container").css("margin", "0 0 0 " + margin + "px"); }); CSS - Nothing new. You should already have something functionally like this in your code. .container { max-width: 1080px; margin: 0 auto; } HTML - Nothing new, just for reference. LEFT SIDE When the scroll bars appear, they cause shifting because it functionally changes the width of the container, so the auto margins has to be reset. When you load your page, you can check what value was calculated and just set that value as a hard margin. Note: Doing this will require a window resize handler or your centering won't adjust properly. $(window).on("resize", function() { var container = $(".container"), margin = container.css("margin", "0 auto").offset().left; container.css("margin", "0 0 0 " + margin + "px"); });
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/46553823
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28989174

http://stackoverflow.com/q/28914081
score: 4
tagged with: loopbackjs
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28923736
favorite count: 0
tagged with: angularjs
tagged with: node.js
has title: Strongloop Loopback: Filter by id of related Model
tagged with: strongloop
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28923736
has body: I have a Strongloop Loopback Node.js project with some models and relations. The problem at hand My problem relates how to query only those Media instances that have a relation to a certain Tag id, using the Angular SDK - while not querying Tags.media (which return Tag instances), but instead making a query somehow that returns plain Media instances. Please read below for specific information.. Spec Basically, I have a Model Media which has many 'tags' (model Tag). Think of a image file (Media) having various EXIF tags (Tag). Here is the relation spec (this all works as expected): Media (media.json): { "name": "media", "base": "PersistedModel", "properties": { "id": { "type": "string", "id": true } }, "relations": { "tags": { "type": "hasAndBelongsToMany", "model": "tag" } } Tag (tag.json): { "name": "tag", "base": "PersistedModel", "idInjection": true, "properties": { "name": { "type": "string", "required": true } }, "relations": { "medias": { "type": "hasAndBelongsToMany", "model": "media" } }, "acls": [], "methods": [] } Solutions Now, I know I could do a query like this (using Angular SDK in my example, but the syntax is the same): injector.get('Tag').find({ 'filter': { 'include': 'medias', 'where': {'id': &lt;mytagid&gt;} } }); My problem with this approach is, that I receive 1 (one) Tag instance with attached Media instances. This disrupts why whole workflow as I deal only with Media instances.. i just want to filter by Tag id, not bother about Tag at all. Bottom line If I see the API explorer (/explorer/), the return value of GET /api/tags/&lt;myTagID&gt;/medias is exactly what I need - an array of Media objects - but how to query them exactly like this using the Angular SDK (lb_services)?
type: Question
upvote count: 4
tagged with: javascript

http://stackoverflow.com/comment/46321987
type: QuestionComment
has text: So, build it! ;-) Now, what's the question?
comment on: http://stackoverflow.com/q/29040819
score: 0
type: Comment

http://stackoverflow.com/comment/46306001
has text: `JSON.parse(req[mandrill_events])[0].event` will return `"inbound"`.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29032525

handlebars.js
tags question: http://stackoverflow.com/q/28989664
tags question: http://stackoverflow.com/q/29046003
type: Tag
tags question: http://stackoverflow.com/q/28931908
tags question: http://stackoverflow.com/q/28911698
tags question: http://stackoverflow.com/q/29056161
tag name: handlebars.js
tags question: http://stackoverflow.com/q/28993723
tags question: http://stackoverflow.com/q/29011155
tags question: http://stackoverflow.com/q/29000342

http://stackoverflow.com/comment/46328171
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29042497
score: 0
has text: Thanks Teemu, it turned out to be a combination of name issues. It didn't like "history" as an object name, but apparently it also didn't like the function name which was "evaluate". It's working fine now.

http://stackoverflow.com/a/28987650
accepted answer of: http://stackoverflow.com/q/28987543
has comment: http://stackoverflow.com/comment/46223940
has comment: http://stackoverflow.com/comment/46223802
answers question: http://stackoverflow.com/q/28987543
has comment: http://stackoverflow.com/comment/46223974
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46224221
type: Answer
has comment: http://stackoverflow.com/comment/46223746
has body: I haven't created any local variables inside Person constructor name is a local variable, declared by the name parameter of your function. This variable is used in the setter and getter of the .name property.
has comment: http://stackoverflow.com/comment/46224124
score: 1
upvote count: 1

http://stackoverflow.com/comment/46332792
score: 0
comment on: http://stackoverflow.com/a/29047076
type: Comment
type: AnswerComment
has text: Don't delete it, it's a good idea. IE always tends to be different from everyone else.

http://stackoverflow.com/q/29013654
has comment: http://stackoverflow.com/comment/46272431
has comment: http://stackoverflow.com/comment/46272340
has answer: http://stackoverflow.com/a/29013844
accepted answer: http://stackoverflow.com/a/29013844
type: Question
type: AnsweredQuestion
answer count: 1
tagged with: javascript
has title: How can I delay an action until after the $apply is finished?
score: 0
tagged with: angularjs
has body: Given this code: &lt;body ng-keydown="key($event);"&gt; $scope.key = function ($event) { if (key == 13) { document.getElementById("aButton").click(); } } When I run the code I am getting a message saying there is: $apply already in progress Can someone give me some advice on how I can fix my problem.

http://stackoverflow.com/q/28987543
accepted answer: http://stackoverflow.com/a/28987650
has title: Can someone explain how Object.defineProperty work in constructor function in javascript
has body: I create a very simple object Person and calling constructor with a name parameter, as i haven't created any local variables inside Person constructor, then how name property gets set. function Person(name) { Object.defineProperty(this, "name", { get: function() { return name; }, set: function(newName) { debugger; name = newName; }, enumerable: true, configurable: true }); this.sayName = function() { console.log(this.name); }; } var p1 = new Person("mike"); how name property get set ?
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28987650
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28987825
score: 0
has answer: http://stackoverflow.com/a/28987825
answer count: 3
has comment: http://stackoverflow.com/comment/46223533
has answer: http://stackoverflow.com/a/28987947
has comment: http://stackoverflow.com/comment/46223786
favorite count: 0

http://stackoverflow.com/comment/46227570
type: Comment
comment on: http://stackoverflow.com/a/28989591
has text: Any idea how I can fix it? Thanks.
type: AnswerComment
score: 0

d3.js
tags question: http://stackoverflow.com/q/28921147
tags question: http://stackoverflow.com/q/28946247
tags question: http://stackoverflow.com/q/29010458
tags question: http://stackoverflow.com/q/28909128
tags question: http://stackoverflow.com/q/28962237
tags question: http://stackoverflow.com/q/29018116
tags question: http://stackoverflow.com/q/28925393
tags question: http://stackoverflow.com/q/29009566
tags question: http://stackoverflow.com/q/28937520
tags question: http://stackoverflow.com/q/28912858
tags question: http://stackoverflow.com/q/28946081
tags question: http://stackoverflow.com/q/28950578
tags question: http://stackoverflow.com/q/28972342
tags question: http://stackoverflow.com/q/28942864
tags question: http://stackoverflow.com/q/28966678
tags question: http://stackoverflow.com/q/28918691
tags question: http://stackoverflow.com/q/28927790
tags question: http://stackoverflow.com/q/28962729
tags question: http://stackoverflow.com/q/28960955
tags question: http://stackoverflow.com/q/28914794
tags question: http://stackoverflow.com/q/29014888
tags question: http://stackoverflow.com/q/29061016
tags question: http://stackoverflow.com/q/28919781
tags question: http://stackoverflow.com/q/29054677
tags question: http://stackoverflow.com/q/28981375
tags question: http://stackoverflow.com/q/28946525
tags question: http://stackoverflow.com/q/29008618
tags question: http://stackoverflow.com/q/28959187
type: Tag
tags question: http://stackoverflow.com/q/29061211
tags question: http://stackoverflow.com/q/28924238
tags question: http://stackoverflow.com/q/29040118
tags question: http://stackoverflow.com/q/29054231
tags question: http://stackoverflow.com/q/28994900
tags question: http://stackoverflow.com/q/29024589
tags question: http://stackoverflow.com/q/29060208
tags question: http://stackoverflow.com/q/28976442
tags question: http://stackoverflow.com/q/28947450
tags question: http://stackoverflow.com/q/28987300
tags question: http://stackoverflow.com/q/28987690
tags question: http://stackoverflow.com/q/28950743
tags question: http://stackoverflow.com/q/28987434
tags question: http://stackoverflow.com/q/28962968
tags question: http://stackoverflow.com/q/29000730
tags question: http://stackoverflow.com/q/28914653
tags question: http://stackoverflow.com/q/29041214
tags question: http://stackoverflow.com/q/28947964
tags question: http://stackoverflow.com/q/28968928
tags question: http://stackoverflow.com/q/29001510
tags question: http://stackoverflow.com/q/28948692
tags question: http://stackoverflow.com/q/28952297
tags question: http://stackoverflow.com/q/28941915
tags question: http://stackoverflow.com/q/29020339
tag name: d3.js
tags question: http://stackoverflow.com/q/28954039
tags question: http://stackoverflow.com/q/28984489
tags question: http://stackoverflow.com/q/28922246
tags question: http://stackoverflow.com/q/29010928
tags question: http://stackoverflow.com/q/28990025
tags question: http://stackoverflow.com/q/28957741
tags question: http://stackoverflow.com/q/28992005
tags question: http://stackoverflow.com/q/28948461
tags question: http://stackoverflow.com/q/28913954
tags question: http://stackoverflow.com/q/28979255
tags question: http://stackoverflow.com/q/29017476
tags question: http://stackoverflow.com/q/28948480
tags question: http://stackoverflow.com/q/29022198
tags question: http://stackoverflow.com/q/28935312
tags question: http://stackoverflow.com/q/29045011
tags question: http://stackoverflow.com/q/28934702
tags question: http://stackoverflow.com/q/28998464
tags question: http://stackoverflow.com/q/28954327
tags question: http://stackoverflow.com/q/28919529
tags question: http://stackoverflow.com/q/28954880
tags question: http://stackoverflow.com/q/28958905
tags question: http://stackoverflow.com/q/29001816
tags question: http://stackoverflow.com/q/28910362
tags question: http://stackoverflow.com/q/29042544
tags question: http://stackoverflow.com/q/29017389
tags question: http://stackoverflow.com/q/29003615

http://stackoverflow.com/a/28980851
score: -1
has body: We can use Javascript for this Remove option : $("#selectBox option[value='option1']").remove(); Add option : $("#selectBox").append(' option5 '); Hope this will help!
downvote count: 1
has comment: http://stackoverflow.com/comment/46211810
answers question: http://stackoverflow.com/q/28980686
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/46213031
has comment: http://stackoverflow.com/comment/46213913
has comment: http://stackoverflow.com/comment/46212306

http://stackoverflow.com/comment/111925534
type: Comment
comment on: http://stackoverflow.com/a/50427028
score: 1
has text: Take care of case sensitivity on "jquery". In my webpack.config externals, I had "jquery: 'jQuery'". I had "import $ from 'jQuery'" in my script. Changing to "import $ from 'jquery'" solved my problem :)
type: AnswerComment

http://stackoverflow.com/q/28909075
tagged with: javascript
type: AnsweredQuestion
tagged with: google-chrome-app
tagged with: angularjs
type: Question
has title: Factory not passing $http.get based object array to controller in angular.js
has answer: http://stackoverflow.com/a/28909252
has body: I am just starting out in Angular, and I have been stuck for some time on an issue. My factory is properly creating an array containing objects, RSS feed data, and will load to the console. The issue is that I cannot seem to get the array to return to the controller. Any help would be appreciated. Please pardon the rough and sloppy code. Main.js function FeedCtrl($scope, GetFeed) { $scope.itemId = 0; //$scope.items = []; console.log('Get episodes in ctrl'); $scope.items = function() { return GetFeed.getEpisodes(); }; console.log('display items from ctrl'); console.log($scope.items()); $scope.itemId = function(index) { $scope.itemId = index; console.log($scope.itemId); console.log($scope.itemNames[$scope.itemId].title); }; }; function EpisodeCrtl($scope, GetFeed) { //getFeed.pullFeed(); }; function GetFeed($http){ var episodeArray = []; function items(){ console.log('Firing pullFeed'); return $http.get('assets/feed.xml').then(function(response) { var x2js = new X2JS() var itemDef = x2js.xml_str2json(response.data); itemsObj = itemDef.rss.channel.item; var numOfItems = itemsObj.length; episodeArray.length = 0; for (var i = 0; i &lt; numOfItems; i++) { episodeArray.push({ title: itemsObj[i].title, link: itemsObj[i].link, author: itemsObj[i].author, pubDate: new Date(itemsObj[i].pubDate), summary: itemsObj[i].summary, duration: itemsObj[i].duration, description: itemsObj[i].description }); } console.log(episodeArray); return episodeArray; }) }; return { getEpisodes: function(){ console.log(episodeArray); episodeArray.length = 0; items(); console.log(episodeArray); return(episodeArray); } } }; var app = angular.module('ctApp', ['ngMaterial', 'ngAnimate', 'ngRoute']) .config(function($routeProvider) { $routeProvider .when('/', { templateUrl: 'list.html', controller: 'FeedCtrl' }) .when('/about', { templateUrl: 'about.html', controller: 'EpisodeCrtl' }); }) .config( [ '$compileProvider', function( $compileProvider ) { var currentImgSrcSanitizationWhitelist = $compileProvid…
score: 0
answer count: 1
tagged with: angularjs-directive
accepted answer: http://stackoverflow.com/a/28909252

http://stackoverflow.com/q/29001080
type: Question
has answer: http://stackoverflow.com/a/29001107
has comment: http://stackoverflow.com/comment/46250535
tagged with: javascript
has body: var bar = function foo() { foo = 1; return foo; }; bar(); // returns function foo() Why is this happening? I expect this to return 1.
has answer: http://stackoverflow.com/a/29001188
accepted answer: http://stackoverflow.com/a/29001188
has answer: http://stackoverflow.com/a/29001135
answer count: 3
downvote count: 1
linked to: http://stackoverflow.com/q/3854141
linked to: http://stackoverflow.com/q/15057649
favorite count: 0
has comment: http://stackoverflow.com/comment/46249966
has comment: http://stackoverflow.com/comment/46249948
upvote count: 4
type: AnsweredQuestion
score: 3
has title: Javascript function returning global assigned to itself, then assigned to something else
has comment: http://stackoverflow.com/comment/46250000
possible better answer: http://stackoverflow.com/a/29001107

http://stackoverflow.com/q/29005610
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29006015
tagged with: mysql
type: Question
answer count: 1
tagged with: javascript
has body: Hi i was able to implement infinite scroll when the data is static. But when the data is dynamic in nature, let us say i have a table TABLE with fields Name, Last_modified. My requirement is to load the results batch by batch sorted on the decreasing order of Last_modified column in a web page. Let us say my page-size is 10, if i load the recently modified 10 items in the web page and if the user scrolls down to the bottom of the web page then i am supposed to load the next recent 10 items. If the data is static, then it is easy to implement but as my table data is dynamic in nature i.e Last_modified column can change dynamically so there is a possibility that a row which is already served to the user may be a recently updated row or a row which was not updated previously may be modified/updated by the time when we do the subsequent request. I thought, i can solve the problem by intimating the server about the already served rows so that the server can filter the already served rows and give the recently updated rows for the rest of the data. But this is not scalable as the number of already served rows to the users eventually pile up and i will have to send this huge amount of already served row id's to the server which hits the network! Is there any cleaner way of solving this issue?
score: 0
tagged with: infinite-scroll
tagged with: dynamic-data
has title: Infinite scroll with dynamic data sorted on last modified status

http://stackoverflow.com/q/28946447
type: Question
linked to: http://stackoverflow.com/q/9513736
has comment: http://stackoverflow.com/comment/46147244
tagged with: javascript
tagged with: jquery
score: 4
has body: I am using .net MVC in my website and I need to get the URL in javascript, but only the controller and action name, for instance if i have: http://stackoverflow.com/questions/9513736/current-url-without-parameters-hash-https I need: http://stackoverflow.com/questions/9513736/ I have found some solutions such as: urlBase = location.href.substring(0, location.href.lastIndexOf("/")+1) -&gt;http://stackoverflow.com/questions/9513736/ However if my URL does not have any parameters I the action name is cut off like so: http://stackoverflow.com/questions/ Does anyone have a solution for this?
has comment: http://stackoverflow.com/comment/46147471
has answer: http://stackoverflow.com/a/28946631
answer count: 2
favorite count: 0
has comment: http://stackoverflow.com/comment/46147411
upvote count: 6
accepted answer: http://stackoverflow.com/a/28946631
possible better answer: http://stackoverflow.com/a/28946615
tagged with: model-view-controller
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28946615
downvote count: 2
has title: How to get only the Controller name and action name from URL with jQuery

http://stackoverflow.com/a/28933589
has body: As far as I know,it's a same order of html structure. So if you want to change the order, change html. If you can't or You can't avoid the issue by changing the html file for some reason such as complicated html structure causing the issue or something. Below code is how to disable &lt;prev&gt; &lt;next&gt; buttons of IOS keyboard. html &lt;input type="text" /&gt; &lt;input type="number" /&gt; &lt;input type="date" /&gt; &lt;input type="time" /&gt; &lt;input type="tel" /&gt; javascript(jquery) $("input").on("touchstart",function(e){ _$activeElem = $(this); //readonly disables next/prev buttons. so when user tap input field,turns any other input into readonly //You cannot use focus here because keyboard shows up before focus fired,you need to use touchstart instead. $("input").each(function(){ if($(this).get(0) === _$activeElem.get(0)){ _$activeElem.removeAttr("readonly"); $(this).one("blur",function(){ $(this).attr("readonly","readonly"); }); return; }else{ $(this).attr("readonly","readonly"); } }); //remove readonly property on blur $("input").on("blur",function(){ if($("input:not([readonly])").length === -1){ $("input").removeAttr("readonly"); } }); }); and make readonly input look like normal input field by CSS.
answers question: http://stackoverflow.com/q/28932648
type: Answer
score: 0

http://stackoverflow.com/comment/46115015
comment on: http://stackoverflow.com/q/28929303
has text: I don't know your api... for thing you described it is enough, may be to check if errorMsg is array... do you have a problem with this code ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46232517
comment on: http://stackoverflow.com/q/28991697
score: 0
type: QuestionComment
has text: You really just have two choices. 1) Break groups of related functions into separate PHP files and change the client to call those other files or 2) Organize the code cleaner in file X so you branch early in the file to different functions within that file which just makes the implementation feel cleaner.
type: Comment

http://stackoverflow.com/q/29009244
has title: How to request dynamically created JS files using AngularJS
tagged with: angularjs
has answer: http://stackoverflow.com/a/29009447
tagged with: php
type: AnsweredQuestion
type: Question
tagged with: api
answer count: 1
tagged with: javascript
has body: We have a lot of these small sets of data that populates our select dropdowns in our view. For example, gender, countries, shirt sizes, country contact codes, etc.. These data sets don't normally change so I'm thinking what would be the best option to retrieve these data to our views. Create endpoints for them. So I would have something like below http://dom.com/countries http://dom.com/genders http://dom.com/shirt_sizes Problem is I would make several "expensive" http requests just to retrieve these information. Create a module and hardcode these values in a service angular.module('OptionsModule') .factory('options', function() { return { genders: ['M','F'], // others } } Problem is some options I still need to load from the database. For example, the countries list. So I need a way to dynamically create this module from the server I kinda prefer option #2. But how do you generate js files dynamically from php and how do I request for it using angularjs?
score: 0
accepted answer: http://stackoverflow.com/a/29009447

http://stackoverflow.com/q/28968716
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/28968850
has comment: http://stackoverflow.com/comment/46189010
upvote count: 2
tagged with: angularjs-ng-repeat
has comment: http://stackoverflow.com/comment/46189148
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28968850
has answer: http://stackoverflow.com/a/28970690
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28970690
score: 2
has body: I've seen so many ways to do this, but most are pretty old and I want to make sure I'm doing this correctly. Right now, the way I'm using isn't working and I feel like I'm missing something. I'm getting the JSON back fine, I just need to get it to display in a table after I click the button. Here is the JSON. This is how I'm going to get it from our server, I can't add any "var JSON =" or add any scope like "$scope.carrier" to the data, unless there's a way to add it after I've fetched the data. { "carrier": [ { "entity": "carrier", "id": 1, "parentEntity": "ORMS", "value": "Medica" }, { "entity": "carrier", "id": 2, "parentEntity": "ORMS", "value": "UHG" }, { "entity": "carrier", "id": 3, "parentEntity": "ORMS", "value": "Optum" }, { "entity": "carrier", "id": 4, "parentEntity": "ORMS", "value": "Insight" }, { "entity": "carrier", "id": 5, "parentEntity": "ORMS", "value": "Insight" } ] } Here is the app.js file to bring back the JSON data: var app = angular.module('myTestApp', []); app.controller('myController', ['$scope', '$http', function($scope, $http) { var url = 'test.json'; $scope.clickButton = function() { $http.get(url).success(function(data) { console.log(data); }); } }]); And then of course the HTML: Click! {{ module.entity }} {{ module.id }} {{ module.parentEntity }} {{ module.value }} I'm also wondering if I can use the ng-grid to put this in a table. I know they just upgraded it to ui grid so I'm not sure if this is still a feasible approach. Also, I'm not getting errors, the data just won't display in the table right now. All I know is its returning the data properly, just not displaying in the table. Any help is appreciated.
downvote count: 0
tagged with: http://stackoverflow.com/tag/json
type: Question
has title: trying to display json data with angularjs ng-repeat not working

http://stackoverflow.com/a/28927267
type: Answer
upvote count: 3
score: 3
has body: The problem is that the td isn't there when you are trying to bind the click event. So you'll need event delegation. You were close. Change $("#table_tran td").on("click",function(){... To $("#table_tran").on("click","td",function(){... This will trigger the event every time your table is clicked. And will check the "td" argument to see if it was a match, and if so will fire your callback as desired.
answers question: http://stackoverflow.com/q/28927236
downvote count: 0

http://stackoverflow.com/comment/46211949
comment on: http://stackoverflow.com/a/28979828
type: Comment
score: 0
has text: When I replace the setupControler function with a model function, links stop working. Am I missing something? Also this.controllerFor('project').get('model'); is not returning a promise. Thanks.
type: AnswerComment

http://stackoverflow.com/comment/46309233
type: Comment
has text: I've posted the second question. http://stackoverflow.com/questions/29034208/extra-javascript-code-posting-under-form-after-ajax-rails-form-submit-n-n-e
type: AnswerComment
comment on: http://stackoverflow.com/a/29013342
score: 0

http://stackoverflow.com/q/28966592
has answer: http://stackoverflow.com/a/28966627
type: AnsweredQuestion
has body: Looking into Underscore.js code and more specifically into _.indexOf() function (find code with comments here) _.indexOf = function(array, item, isSorted) { var i = 0, length = array &amp;&amp; array.length; if (typeof isSorted == 'number') { i = isSorted &lt; 0 ? Math.max(0, length + isSorted) : isSorted; } else if (isSorted &amp;&amp; length) { i = _.sortedIndex(array, item); return array[i] === item ? i : -1; } if (item !== item) { return _.findIndex(slice.call(array, i), _.isNaN); } for (; i &lt; length; i++) if (array[i] === item) return i; return -1; }; I noticed the if(item !== item){...} statement, but I don't get its purpose. items is a parameter and it's not changed inside the function. When would a variable differ from itself? Am I missing something?
score: 1
favorite count: 0
type: Question
upvote count: 2
accepted answer: http://stackoverflow.com/a/28966627
answer count: 2
has title: _.indexOf() `item !== item` - what is its purpose?
linked to: http://stackoverflow.com/q/1565164
has comment: http://stackoverflow.com/comment/46189135
possible better answer: http://stackoverflow.com/a/28966626
has answer: http://stackoverflow.com/a/28966626
tagged with: underscore.js
downvote count: 1
linked to: http://stackoverflow.com/q/10034149
tagged with: indexof
tagged with: javascript

http://stackoverflow.com/comment/46079526
score: 0
comment on: http://stackoverflow.com/a/28910062
type: Comment
type: AnswerComment
has text: When I use this code, it does not change the background. It only changes the background of the actual options thing.

http://stackoverflow.com/a/28958522
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46169774
has comment: http://stackoverflow.com/comment/46169844
answers question: http://stackoverflow.com/q/28958506
upvote count: 1
type: Answer
has body: $(this).find("p") returns the jquery object of dom element. you can not use javascript methods on them directly. 1) Either convert the object to javascript $('.category').on('click', function() { alert($(this).find("p")[0].innerHTML); }); 2) or use .text() or .html() methods of jquery $('.category').on('click', function() { alert($(this).find("p").text()); });

http://stackoverflow.com/comment/46077559
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28908445
has text: are you using this with node.js or io.js?
score: 0

http://stackoverflow.com/q/28974106
tagged with: jquery
has comment: http://stackoverflow.com/comment/46199645
score: 0
has title: Exclude specific # from scrollTo Animation in jquery
answer count: 3
accepted answer: http://stackoverflow.com/a/28974237
tagged with: scrollto
tagged with: css
type: AnsweredQuestion
tagged with: hashtag
possible better answer: http://stackoverflow.com/a/28974230
has answer: http://stackoverflow.com/a/28988362
has answer: http://stackoverflow.com/a/28974230
has answer: http://stackoverflow.com/a/28974237
type: Question
has body: the jquery code below let me scroll to a link like #link inside my page. But now I have a three special links, #tab-1 #tab-2 #tab-3 that shall not be included in this scrollto script, just do nothing. I can't figure out how to exclude specific # from this script. Thank you for your help! $('a[href^="#"]').on('click',function (e) { e.preventDefault(); var target = this.hash; var $target = $(target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top-80 //offset -80 for navigation height }, 900, 'swing'); });
tagged with: javascript

http://stackoverflow.com/comment/46159123
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28952598
has text: can you please accept my answer then ?:) -> you have to check the checkmark to the left of my answer.
score: 0

http://stackoverflow.com/comment/46125763
comment on: http://stackoverflow.com/a/28933033
has text: @vol7ron Hi, thanks for the pointers - no constraint matching necessary, only issue with `.+` so far is that I need this wildcard applied to both paths and the full domain names e.g. `example.*/about` matches `example.com/about` and `example.co.uk/about`, also `www.example.com/*/example` and `http://www.*.com` to work as expected kinda thing.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46362084
type: Comment
type: QuestionComment
has text: i was trying on .ready function also but its not returning any result as you can see i've set the value = 1
comment on: http://stackoverflow.com/q/29061862
score: 0

http://stackoverflow.com/q/28969586
possible better answer: http://stackoverflow.com/a/28969791
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28969785
has answer: http://stackoverflow.com/a/28970284
accepted answer: http://stackoverflow.com/a/28969785
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/46190914
has answer: http://stackoverflow.com/a/28969791
has answer: http://stackoverflow.com/a/28970832
has body: After looking for about an hour, I can't find anyone who has shared their way of filling input fields on an HTML page from a JSON array with corresponding values. For example, the name of the input box is the first element of the array, then the value that should go inside is the second. More example: input form is as follows... &lt;input type="text" id="123111" data-inline="true" class="firstclass" name="xx3111" data-theme="b" style="color: red;"&gt; and the JSON array is: 000001: "firstValue" 000002: "secondValue" 000003: "thirdValue" 000004: "fourthValue" etc, etc What I want to do is fill the corresponding input box with the value in the array. Another example: input with id 000123 is filled with the string in the array that has the number 000123 &lt;input type="text" id="000001"&gt; is filled with the string firstValue
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/46191121
favorite count: 0
answer count: 5
tagged with: http://stackoverflow.com/tag/html
has title: Filling input fields with a JSON Array
has comment: http://stackoverflow.com/comment/46190779
has answer: http://stackoverflow.com/a/28972365
upvote count: 3

http://stackoverflow.com/q/28927843
has comment: http://stackoverflow.com/comment/46112529
has comment: http://stackoverflow.com/comment/46111893
has body: The below code works fine, when I try to append a directive as element through the $compile method restrict: "A", link: function(scope, elem, attrs) { $reader.$().$call = function(bookDefaults) { var PageFrames = angular.element(document.getElementById(frameSelector)).children(); _.each(PageFrames, function(frame) { var iframeParent = angular.element(frame); iframeParent.append($compile("&lt;iframe-binder&gt;&lt;/iframe-binder&gt;")(scope)); }); }; } But the following doesn't fire up [I'm trying to add directive as attribute to a dynamically created element]: restrict: "A", link: function(scope, elem, attrs) { console.log(elem.parent()); $reader.$().$call = function(bookDefaults) { var PageFrames = angular.element(document.getElementById(frameSelector)).children(); _.each(PageFrames, function(frame) { var iframe = angular.element(frame).find('iframe'); $compile(iframe.attr("iframe-binder", ""))(scope); }); }; } In the second code the attribute seems to be added when I check the DOM tree, but the directive iframe-binder does not run. Iframe-Binder Directive: .directive("iframeBinder", [function() { return { restrict: "AE", link: function(scope, elem, attrs) { console.log(elem); } }; }]); Is this a right approach or am I doing something wrong here?
type: Question
has title: Add AngularJS directives as Attributes to dynamically added elements
tagged with: angularjs-directive
tagged with: javascript
upvote count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
answer count: 0
downvote count: 0
score: 1

http://stackoverflow.com/q/28945975
has title: AngularJS click anywhere but here with HTML5Mode
has comment: http://stackoverflow.com/comment/46183230
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46146494
has comment: http://stackoverflow.com/comment/46146177
answer count: 0
has comment: http://stackoverflow.com/comment/46146402
linked to: http://stackoverflow.com/q/12931369
score: 1
has comment: http://stackoverflow.com/comment/46186210
upvote count: 1
has body: I'm using the following directive: app.directive("ngOutside", function($document, $rootScope){ return { restrict: "A", link: function(scope, elem, attr, ctrl){ elem.bind("click", function(e){ e.stopPropagation(); }); $document.bind("click", function(){ $rootScope.$apply(function(){ $rootScope.nav = false; $rootScope.aside.on = false; }); }); } } }); Now I apply this in my HTML like so: Home Dashboard Originally I was using hashbang mode and the directive worked fine. Now I am using HTML5 mode and the e.stopPropagation is stopping Angular working out the routing when one of the nav links is clicked. Instead, the browser now treats the link normally and does a full page reload to the location. If I remove the following, it solves the problem but the directive no longer does it's job: elem.bind("click", function(e){ e.stopPropagation(); }); How can I implement the 'click anywhere but here' type directive without breaking links in HTML5 mode?
type: Question
tagged with: angularjs-directive
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46185378
has comment: http://stackoverflow.com/comment/46150945
has comment: http://stackoverflow.com/comment/46146590

http://stackoverflow.com/q/28960651
tagged with: javascript
has comment: http://stackoverflow.com/comment/46174497
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I am making a HTML5 game using Phaser-framework. I need to create a sprite that has one color and its alpha is set to below 1 so it can be seen through. Is there any performance difference between the two ways I thought of doing this? Option 1: Creating a BitmapData with size 1x1, creating a sprite from this BitmapData object and then scaling the sprite to correct size: var bitmapData = game.add.bitmapData(1, 1); bitmapData.fill(0, 0, 0, 0.7); var sprite = game.add.sprite(0, 0, bitmapData); sprite.width = 1024; sprite.height = 768; Option 2: Creating BitmapData to the exact size it will be used and then creating a sprite from it: var bitmapData = game.add.bitmapData(1024, 768); bitmapData.fill(0, 0, 0, 0.7); game.add.sprite(0, 0, bitmapData); The purpose of this would be to color the whole game area with one color and be able to see what is behind.
favorite count: 0
has title: Creating BitmapData and a sprite from it and possible performance differences
tagged with: phaser-framework
type: AnsweredQuestion
tagged with: performance
score: 1
has answer: http://stackoverflow.com/a/29509820
upvote count: 1
accepted answer: http://stackoverflow.com/a/29509820
type: Question
tagged with: canvas
downvote count: 0

http://stackoverflow.com/q/28994564
downvote count: 0
favorite count: 0
tagged with: ajax
tagged with: zombie.js
has answer: http://stackoverflow.com/a/28995785
tagged with: node.js
type: AnsweredQuestion
score: 1
upvote count: 1
has body: So I have a webpage which uses knockout and I have a click handler. Once clicked it fires off an ajax request to an API server which returns a contextual HttpStatus result. So for example if I was unauthorised I would get a 401 response, if it was ok I would get 200. So the question is based around how can I capture the error in Zombie as the .click("#some-button", function(error) { /* No Error */ }) is returning no error from the callback, so is there some other way to try and catch the http status codes?
type: Question
accepted answer: http://stackoverflow.com/a/28995785
tagged with: javascript
has title: Get Http error from Ajax triggered by async click event with ZombieJS
answer count: 1

http://stackoverflow.com/q/28966440
type: Question
has comment: http://stackoverflow.com/comment/46185849
has body: I have a modal popup that I want to use some cascading drop down lists in. The drop downs work fine when I render the page as a regular view but when I render it as a partial in a modal popup I lose the functionality. The script doesn't seem to run at all now. Here is the code that should run when a drop down value is selected: $("#artistSelect").change(function () { if ($(this).val() != "") { $("#pieceSelect").empty(); $("#productSelect").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetMasterImages")', dataType: 'json', data: { artistId: $(this).val() }, success: function (masterImages) { $(masterImages).each(function (i, masterImage) { $("#pieceSelect").append(' ' + masterImage.Text + '</option'); }); $("#productSelect").append(' -- Select Piece -- '); }, error: function (ex) { alert('failed to get piece list.' + ex); } }); } else { $("#pieceSelect").empty(); $("#productSelect").empty(); $("#productSelect").append(' -- Select Artist -- '); $("#pieceSelect").append(' -- Select Artist -- '); } return false; }); $("#pieceSelect").change(function () { if ($(this).val() != "") { $("#productSelect").empty(); $.ajax({ type: 'POST', url: '@Url.Action("GetProducts")', dataType: 'json', data: { imageMasterId: $(this).val() }, success: function (products) { $(products).each(function (i, product) { $("#productSelect").append(' ' + product.Text + '</option'); }); }, error: function (ex) { alert('failed to get product list.' + ex); } }); } else { $("#productSelect").empty(); $("#productSelect").append(' -- Select Piece -- '); } return false; }); The scripts are located in my main scripts file. and my now partial view: @Html.DropDownList("Artist", Model.Dropdowns.ArtistItems, new { @id = "artistSelect", @class = "form-control" }) @Html.DropDownList("Piece", new List<SelectListItem> { new SelectListItem { Text = "-- Select Artist --", Value = "" } }, new { @id = "pieceSelect", @class = "form-control" }) @Html.DropDownListFor(m => m.CustomerItem.ItemID, new List<SelectListIt…
upvote count: 2
has comment: http://stackoverflow.com/comment/46184726
has comment: http://stackoverflow.com/comment/46184660
tagged with: asp.net-mvc
tagged with: javascript
type: UnansweredQuestion
has title: Jquery not working in modal popup ASP.NET MVC
score: 2
downvote count: 0
answer count: 0
tagged with: jquery
tagged with: asp.net
favorite count: 0

django
tags question: http://stackoverflow.com/q/28954124
tags question: http://stackoverflow.com/q/29002963
tags question: http://stackoverflow.com/q/28921837
type: Tag
tags question: http://stackoverflow.com/q/28919044
tags question: http://stackoverflow.com/q/28997887
tags question: http://stackoverflow.com/q/29059065
tags question: http://stackoverflow.com/q/29040972
tag name: django
tags question: http://stackoverflow.com/q/29047056
tags question: http://stackoverflow.com/q/28992064
tags question: http://stackoverflow.com/q/28974269
tags question: http://stackoverflow.com/q/28923124
tags question: http://stackoverflow.com/q/29038873
tags question: http://stackoverflow.com/q/29015257
tags question: http://stackoverflow.com/q/28986594
tags question: http://stackoverflow.com/q/28986688
tags question: http://stackoverflow.com/q/28975497

http://stackoverflow.com/comment/46126648
comment on: http://stackoverflow.com/q/28935640
score: 0
type: Comment
type: QuestionComment
has text: What do you actually want the program to do?

http://stackoverflow.com/comment/46217884
has text: Clearly it's not about the ravioli, but what you try to eat it with. The ravioli is my php output, the spoon is ajax, the fork is some kind of revolutionary javascript function. I don't even like dumplings anyway.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28984206

http://stackoverflow.com/comment/46095820
comment on: http://stackoverflow.com/q/28917824
type: Comment
has text: @Teepeemm No, it won't work. Suppose 2 `onCreated` trigger rapidly. Then first 2 `get` happen, and then 2 `set`. State becomes wrong.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28959086
accepted answer: http://stackoverflow.com/a/28960760
has body: I'm working with Canvas and JS, I have a simple physics sim where a ball is added to the canvas and reacts to gravity, collisions and drag. Currently it can be fired around by dragging (like an elastic band). function drawSlingshot() { if (mouse.isDown) { ctx.beginPath(); ctx.moveTo(ball.position.x, ball.position.y); ctx.lineTo(mouse.x, mouse.y); ctx.stroke(); ctx.closePath(); } } Here's my function for drawing a line indicating where the ball will go. It's unfortunately doing the opposite of what's intended. The ball should travel WITH the line and not against it. Currently I fetch the location of the X and Y of the ball and the X and Y of the cursor. if one was to mirror the line through the ball, the point I'm looking for would the the x,y of the mirrored line. (see pic below) Any idea on how I might do this?
type: AnsweredQuestion
has title: Co-ordinate math in javascript
type: Question
has answer: http://stackoverflow.com/a/28960760
tagged with: javascript
has comment: http://stackoverflow.com/comment/46171902
has comment: http://stackoverflow.com/comment/46171559
has comment: http://stackoverflow.com/comment/46172978
score: 0
tagged with: canvas
has comment: http://stackoverflow.com/comment/46172070
tagged with: html5-canvas
answer count: 1

http://stackoverflow.com/a/28949522
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28948739
has comment: http://stackoverflow.com/comment/46194278
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28948739
has body: The tabcontainer can only fully initialize if it's visible in the DOM. You can work around this: Hide the tabcontainer after the tabcontainer is fully initialized. You could do this setting display:none on the tabcontainer inside a dojo/ready function.
has comment: http://stackoverflow.com/comment/46171921

http://stackoverflow.com/comment/46237879
type: Comment
has text: You know what, now that I have this in JSBin - everything should just work if you have your `{{outlets}}` set up correct. Ember should just wait for the project to resolve before loading the `FileRoute`. Here's another JSBin that is simplified: http://emberjs.jsbin.com/bofegedifu/1/edit?html,js and http://emberjs.jsbin.com/bofegedifu/1#/project/2/file/text2-1.txt
comment on: http://stackoverflow.com/a/28979828
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46315516
has text: @JamesThorpe Yes, this solved my problem, when I used the jquery '$.when' it became synchronous, but it wasn't before, thanks
comment on: http://stackoverflow.com/q/29037260
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28930744
type: AcceptedAnswer
has body: If your scripts are being loaded synchronously, then each script will be the last script in the DOM at the time that it initially runs. So you should be able to do this: var param = $('script').last().data('myparm'); or equivalently: var scripts = document.getElementsByTagName('script'); var param = scripts[scripts.length - 1].getAttribute('data-myparm'); Note that you would do this outside of any document ready handlers or anything that would execute after the script is initially loaded. Edit: The HTML5 spec says that data-* attributes should be treated as all lowercase, and it looks like jQuery's .data(...) will only work if the provided string is all lowercase, so I suggest using all lowercase data-* attributes throughout.
has comment: http://stackoverflow.com/comment/46124082
type: Answer
has comment: http://stackoverflow.com/comment/46123146
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28930639
answers question: http://stackoverflow.com/q/28930639
has comment: http://stackoverflow.com/comment/46119843
upvote count: 1

http://stackoverflow.com/q/28940738
tagged with: constructor
type: UnansweredQuestion
tagged with: properties
has title: javascript access "this" in function constructor
answer count: 4
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/46137065
has answer: http://stackoverflow.com/a/28940796
tagged with: function
tagged with: javascript
has answer: http://stackoverflow.com/a/28940783
has answer: http://stackoverflow.com/a/28940849
score: 0
upvote count: 1
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28941010
has body: I'm trying to create a function constructor: var obj = function() { this.num = 2; this.func = function() { // need to access the **instance** num variable here }; }; var instance = new obj(); I need to access the instance properties from a propery (which is the function func) of the object. But it doesn't work, since this is always the current function..

http://stackoverflow.com/q/28914172
type: Question
upvote count: 0
tagged with: javascript
answer count: 2
has title: Winner Detection in TicTacToe
favorite count: 0
score: -1
has answer: http://stackoverflow.com/a/28914316
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1056316
has answer: http://stackoverflow.com/a/28914348
tagged with: tic-tac-toe
downvote count: 1
has body: How to get winner detection? My code isn't working right now i only need the winner detection if someone can help me then do this . $(document).ready(function() { var xoro = 1; $('#reset').on("click", function() { $('img').attr("src", "blank.png"); }); $('img').on("click", function() { var tmp = $(this).attr("src"); if (tmp == "blank.png" &amp;&amp; xoro == 1) { $(this).attr("src", "x.png"); xoro = 0; } else if (tmp == "blank.png" &amp;&amp; xoro == 0) { $(this).attr("src", "o.png"); xoro = 1; } }); });

http://stackoverflow.com/comment/46335939
has text: Yes this is related to security. This must be resilient to user hacks for instance is not a solution as anyone could direct access to http://.../js.php?callMethod=src in the browser navigation bar and fool the system making it believes that we are calling through a script src="..." inclusion.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29048740
score: 0

http://stackoverflow.com/comment/46177541
comment on: http://stackoverflow.com/q/28962721
score: 0
type: QuestionComment
type: Comment
has text: nested ajax calls work fine, you must have an error

http://stackoverflow.com/q/28913495
has answer: http://stackoverflow.com/a/28913573
has comment: http://stackoverflow.com/comment/46087332
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28913552
tagged with: twitter-bootstrap
has body: I have this registration form and when Submit button is clicked will pop up using bootstrap modal. together will the value i input on the form. i already know how to get those value from the input fields. i just wanna to pop up the result using modal viewReg.php i tried http://getbootstrap.com/2.3.2/javascript.html#modals but it doesn't have guide for external link using Forms. edit There are two pages.. Registration.html and viewReg.php I'm new to coding. USN First Name Last Name Email Birthday Place of Birth Manila Course BS in Information Technology
has comment: http://stackoverflow.com/comment/46086119
upvote count: 1
has comment: http://stackoverflow.com/comment/46087021
has title: opening new window using bootstrap modal
type: Question
score: 1

http://stackoverflow.com/a/29007691
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46260924
answers question: http://stackoverflow.com/q/29007623
upvote count: 1
has body: newField.find('input[type="hidden"]').each(function(i){ $(this).attr('name', replaceNumbersinStringTo($(this).attr('name'), i+1); }); I'm not sure how you use "index" or i in my example, so that might need to be modified a bit to fit your needs. Alternatively I would say consider using a template and rendering elements that way if you are going to be doing this cloning operation a lot. You could essentially put tokens into your template where the name attribute goes, and then just pass the appropriate value in when you render the template. Examples here: http://handlebarsjs.com/
has comment: http://stackoverflow.com/comment/46261510
type: Answer

http://stackoverflow.com/a/28917687
has comment: http://stackoverflow.com/comment/46093724
has comment: http://stackoverflow.com/comment/46094737
downvote count: 0
answers question: http://stackoverflow.com/q/28917528
score: 3
has body: The issue is in your jQuery version (2.x edge). And the print script uses: if ($.browser.opera || (/chrome/.test(navigator.userAgent.toLowerCase()))) mainOptions["printMode"] = 'popup'; So you change the jQuery version to an older one, that still uses $.browser support. This was later discouraged as x-browser and x-device support doesn't work very well when conditionally program against the user agent string. The whole idea changer started somewhere around jQuery version 1.8. Now it's advised to use support detection regardless which browser/device you're on.
accepted answer of: http://stackoverflow.com/q/28917528
upvote count: 3
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/29037417
has title: Angularjs email form field not clearing/resetting after model binding reset
score: 0
answer count: 2
has body: Hey so I have a form which has three fields name,email and phone. Name Email Phone Submit Cancel As you can see the cancel button calls a Nerd.load() function in the controller. The controller basically resets the view and resets all the binded data to the model. Nerd.load = function () { Nerd.editing = false; Nerd.adding = false; Nerd.nerd = []; nerdResource.query( function (data) { Nerd.nerds = data; } ); }; You can see that I am setting Nerd.nerd equal to an empty array. This should empty out the form fields data. It works fine for Name and Phone. But when I go back to the page it still shows what was last typed. There is no page reload as I am showing and hiding divs based on controller variables. EG . Can anyone help me out with this? I am on angularjs version 1.3.14. Any help on this would be great. Thanks.
has comment: http://stackoverflow.com/comment/46316481
has answer: http://stackoverflow.com/a/29038826
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46317114
has answer: http://stackoverflow.com/a/34716200
has comment: http://stackoverflow.com/comment/46318550
type: Question
tagged with: angular-ngmodel
tagged with: javascript
has comment: http://stackoverflow.com/comment/46348144

http://stackoverflow.com/comment/46329746
type: Comment
type: QuestionComment
has text: That is true however it has no effect. I was experimenting and forgot to change it back. Sorry about that and am editing that now.
score: 0
comment on: http://stackoverflow.com/q/29045024

http://stackoverflow.com/comment/46174786
score: 0
comment on: http://stackoverflow.com/a/28961094
type: Comment
type: AnswerComment
has text: This works. But it feels like I'm doing the same thing twice. I've thought the point of object.create is to be an efficient way to add new value to an existing string. Maybe I've just been missinformed :)

http://stackoverflow.com/q/28919380
has body: Hey guys i'm trying to create an interactive app whereby users can select the shape they want and then click anywhere on the canvas and the shape appears at that position. I've been able to do it for one shape only so far. Here's the code: Circle When i click on the button for the rectangle it works fine but i can't seem to draw the circle when i click on its button. Is there any mistake in my codes? What i created so far is only for trying purposes so please disregard the look of the page. Any help will be much appreciated. Thanks.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28919444
type: UnansweredQuestion
score: 1
tagged with: mouselistener
upvote count: 1
has title: Trying to draw shapes which are selected from toolbar at the mouse position-HTML5 CANVAS
type: Question
tagged with: javascript
tagged with: canvas
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/28910688
accepted answer: http://stackoverflow.com/a/28911167
score: 0
answer count: 1
has title: Knockout js add a new list
has body: I am trying to create a form with a list which adds a list dynamically! However I just can't get my add function working and it keep complains that my list is not defined. Here is my viewmodel in jave script function DeliveryCategoryViewModel() { var self = this; self.DeliveryCategory = ko.observable(new DeliveryCategory(1, "new Name", [new DeliveryOption("first"), new DeliveryOption("second")])); self.addDeliveryOptions = function () { self.DeliveryOptions.push(new DeliveryOption("new Option")); } self.removeDeliveryOptions = function (option) { self.DeliveryCategory.remove(option); } } and these are actual model which holds the data function DeliveryCategory(id, name, option) { this.Id = id; this.Name = name; this.DeliveryOptions = ko.observableArray(option); } function DeliveryOption(name) { this.Id = "2"; this.Name = name; } $(document).ready(function () { ko.applyBindings(new DeliveryCategoryViewModel()); }); This is my form New delivery category name: +Add delivery option New delivery option name: Remove When I try to click click:addDeliveryOptions, it return on Firebug console. TypeError: self.DeliveryCategory.DeliveryOptions is undefined self.DeliveryCategory.DeliveryOptions.push(new DeliveryOption("new Option")); I tried different things such as click:$root.addDeliveryOptions, and also tried to add addDeliveryOptions function as a prototype (e.g. DeliveryCategory.prototype.addDeliveryOptions(...)) and still getting Typeerror... Is it because DeliveryOptions is not initialised? I expected that it would be when DeliveryCategory is initialised from the DeliveryCategoryViewModel() ... Any idea? Thanks!
type: AnsweredQuestion
tagged with: knockout.js
type: Question
has answer: http://stackoverflow.com/a/28911167
tagged with: javascript
tagged with: jquery

angular-amd
tag name: angular-amd
type: Tag
tags question: http://stackoverflow.com/q/28922629

http://stackoverflow.com/a/28915309
has body: You need to bind your paths to your data, so you can call valueLine with the correct data for the path when zooming. Use d3 data and enter functions when adding a new path: // choose all .line objects and append a path which is not already binded // by comparing its data to the current key svg.selectAll(".line").data([d], function (d) { return d.key; }) .enter().append("path") .attr("class", "line") Then when you zoom, change the d attribute path by calling valueLine with the path's correct values: svg.selectAll('path.line') .transition().duration(500) .attr('d', function(d) { return valueline(d.values) }); Plunker
accepted answer of: http://stackoverflow.com/q/28914653
type: Answer
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/28914653
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29017670
has answer: http://stackoverflow.com/a/29018743
accepted answer: http://stackoverflow.com/a/29018743
type: AnsweredQuestion
tagged with: angularjs-controller
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/46279538
has body: With following: ng-click="show_login=!show_login;count=count+1">INSPIRE Username Password {{count}} My form works fine but when i assign name to ng-app module , form is not working. ng-click="show_login=!show_login;count=count+1">INSPIRE Username Password {{count}} Does that means if i give a module name , i have to do all manipulation and variable initialization through controllers or my interpretation is wrong?
has comment: http://stackoverflow.com/comment/46283447
has comment: http://stackoverflow.com/comment/46280696
answer count: 1
has title: initializing ng-app with name disables varibles initialization
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46280101
tagged with: angularjs

http://stackoverflow.com/q/29059285
has answer: http://stackoverflow.com/a/29059615
tagged with: string
has comment: http://stackoverflow.com/comment/46517532
favorite count: 0
tagged with: cut
tagged with: regex
tagged with: trim
type: AnsweredQuestion
score: 3
has body: I'm looking for an answer to trim a string to a certain length of chars without cutting words. I searched the questions and found this: javascript shorten string without cutting words I wanted to use @Hamish s answer with the regex replacement but encountered problems with multiline texts. @Hamish s answer: "this is a longish string of test".replace(/^(.{11}[^\s]*).*/, "$1"); //"this is a longish" I searched for similar questions and found out that the dot '.' does not include newlines \n. Normally one could end an 's' at the end to have the dot also matching newlines, but in javascript that's obviously not working. I read in other threads that I should use [\s\S] to match any character. So I tried using @Hamish s regex expression like this: infotext = infotext.replace(/^([\s\S]*{10}[^\s]*).*/, "$1"); But then I get an error message which says: Uncaught SyntaxError: Invalid regular expression: /^(\[\s\S\]*{10}[^\s]*).*/: Nothing to repeat. Can somebody help me out with that. I really can't find a solution to match any character... Thx in advance. M
downvote count: 0
possible better answer: http://stackoverflow.com/a/29061735
has comment: http://stackoverflow.com/comment/46355465
type: Question
has title: Javascript trim multiline string without cutting words
has answer: http://stackoverflow.com/a/29059309
accepted answer: http://stackoverflow.com/a/29059309
has comment: http://stackoverflow.com/comment/46509521
tagged with: javascript
has comment: http://stackoverflow.com/comment/46355189
upvote count: 3
answer count: 3
linked to: http://stackoverflow.com/q/5454235
has answer: http://stackoverflow.com/a/29061735

http://stackoverflow.com/comment/46289285
score: 0
type: Comment
type: QuestionComment
has text: Ill post an example of how to load pages in hiddenDOMWindow below a little later :)
comment on: http://stackoverflow.com/q/29016485

http://stackoverflow.com/a/60450401
has body: You can create variable in component for regex. myReg = /'/g; and reference the variable in replace method as below &lt;span&gt;{{element.configMetadata.replace(myReg , "\"")}}&lt;/span&gt;
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29031157
upvote count: 4
score: 4

http://stackoverflow.com/q/29009964
has comment: http://stackoverflow.com/comment/46270043
has comment: http://stackoverflow.com/comment/46270766
answer count: 1
tagged with: javascript
has title: Inconsistent file contents on uploading through Dropbox API
tagged with: dropbox-api
has comment: http://stackoverflow.com/comment/46265112
score: 0
has body: I am using the Dropbox Core API to upload and download files via a chrome extension. When I upload text files such as with extensions .txt, .js, .json or .c the files get uploaded successfully but when I upload files with extensions .pdf, .jpg etc (media files) then the contents are disfigured or absent, though the file size is non-zero, sometimes even larger than the original file. This clearly means that the data that is read is being written as well but I guess there is some problem with the way I am reading or writing the data. The code is posted below for reference. $(document).on("click", "#id_submit",uploadProcess); function uploadProcess() { var file = $("#upload_file")[0].files[0]; console.log(file); if (!file){ alert ("No file selected to upload."); return false; } var reader = new FileReader(); //reader.readAsText(file, "UTF-8"); reader.readAsBinaryString(file); reader.onload = function (evt) { uploadFile(file.name, evt.target.result, file.size, file.type); //console.log(evt.target.result); var control = $("#upload_file"); control.replaceWith( control = control.clone( true )); } } //function to upload file to folder function uploadFile(filepath,data,contentLength,contentType){ var url = "https://api-content.dropbox.com/1/files_put/auto/"+filepath; var headers = { Authorization: 'Bearer ' + getAccessToken(), contentLength: contentLength } var args = { url: url, headers: headers, crossDomain: true, crossOrigin: true, type: 'PUT', contentType: contentType, data : data, dataType: 'json', success: function(data) { console.log(data); }, error: function(jqXHR) { console.log(jqXHR); } }; $.ajax(args); }
has comment: http://stackoverflow.com/comment/46288428
type: UnansweredQuestion
tagged with: filereader
tagged with: dropbox
has comment: http://stackoverflow.com/comment/46280374
has answer: http://stackoverflow.com/a/29068498
type: Question

http://stackoverflow.com/a/28992035
upvote count: 12
downvote count: 0
answers question: http://stackoverflow.com/q/28991875
has comment: http://stackoverflow.com/comment/46232837
has comment: http://stackoverflow.com/comment/46232460
score: 12
has comment: http://stackoverflow.com/comment/46235229
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46236118
has body: As far as I know ul / li is are typography specific tags, intended to format text as a list (while search engines love semantic tags). They are not. They are semantic elements that say the content is a set of list items where the order is not of particular importance. My big question here is why Web Masters prefer to use lists solution (ul/li) where is an obvious case of a layout (div) solution Divs are not related to layout. Layout is the job of CSS. The elements used should be selected based on the semantics they convey, then CSS should be applied to them to give the desired rendering. A div element is an element of last resort. It has no semantics and should be used when HTML doesn't have an element with appropriate semantics for the content.
type: Answer
accepted answer of: http://stackoverflow.com/q/28991875

storage
tag name: storage
tags question: http://stackoverflow.com/q/28952599
tags question: http://stackoverflow.com/q/28919532
type: Tag

http://stackoverflow.com/comment/46103641
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28923284
score: 1
has text: Fixed typos, Fixed formatting, Touched up grammar. Don't forget to include an actual question!

http://stackoverflow.com/q/28931908
answer count: 0
type: UnansweredQuestion
tagged with: handlebars.js
tagged with: requirejs
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46136561
tagged with: hapi.js
downvote count: 0
tagged with: javascript
has title: Use handlebars template helpers in hapijs
has comment: http://stackoverflow.com/comment/46129527
has comment: http://stackoverflow.com/comment/46131521
has comment: http://stackoverflow.com/comment/46138832
score: 1
has body: I'm using jquery's typeahead in hapijs using a handlebar view. It works with static source data. I want to use data from a postgresql-database but I don't know how to include the pg-bluebird npm module. I've done a similar jquery typeahead in meteorjs where I get the source from a mongodb collection using the template name and then call a template event from javascript like: html: ... html form input etc. ... javascript: Template.participantItem.events({ 'click .edit': function (e) { e.preventDefault(); $("#club").autocomplete({ /* query remote source */ }); } }); When I try to add to my html file in hapijs it loads the content but the page is not rendered except for the header and footer. I like the way meteorjs is using helper templates and events and would like to do it the same way in hapijs. I ended up including javascript to test typeahead with static data in the html file but it does not appear to be very elegant. ... content using some json data ... I call the view like this from index.js: var Pgb = require('pg-bluebird'); var pg = new Pgb(); var db = "postgresq://claus@localhost/karusellrenn"; exports.register = function (plugin, options, next) { plugin.route([ { method: 'GET', path: '/participants', handler: function (request, reply) { .then(function (result) { cnn.done(); reply.view('participants', { p: result.rows}); .catch(function (error) { console.log(error); }); } } ]); next(); }; Can I use handlebars in hapijs the same way I use handlebars in meteorjs like and then make use of a javascript helper like Template.foo.events({});? And if not, can I use pg-bluebird included in index.js in my handlebars view inside in the handlebars view?
favorite count: 0

http://stackoverflow.com/q/28965514
tagged with: javascript
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28965555
has comment: http://stackoverflow.com/comment/46182739
has title: Regular expression to match multiple words with and without whitespace
tagged with: regex
favorite count: 0
type: Question
upvote count: 1
has answer: http://stackoverflow.com/a/28965836
has comment: http://stackoverflow.com/comment/46214001
answer count: 3
has body: I have such object in JavaScript: ['abc def ghi', 'abcdef ghi', 'abc DEFghi'] I want to match all elements with a regular expression. I have so far: /(abc def ghi)/ig I know about the white space expression such as \s*, but is there a way to use it without having to inject it to every whitespace of every element of my object?
has answer: http://stackoverflow.com/a/28966137
has comment: http://stackoverflow.com/comment/46209904
downvote count: 0

http://stackoverflow.com/comment/46275462
type: Comment
type: QuestionComment
has text: Yeah, I'm not sure why that is. When I test it out outside of JSF it is defined and works fine. Using the console to test in JSF doesn't work, or at least I'm not sure how to get to the working code.
score: 0
comment on: http://stackoverflow.com/q/29014976

http://stackoverflow.com/q/28917447
score: 0
has comment: http://stackoverflow.com/comment/46092836
has comment: http://stackoverflow.com/comment/46092643
possible better answer: http://stackoverflow.com/a/28918752
has title: Populating fields depending the json content
has comment: http://stackoverflow.com/comment/46092657
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28917630
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/28917630
has answer: http://stackoverflow.com/a/28918752
answer count: 2
tagged with: javascript
has body: I do not want to use jQuery. If possible I would like to keep my . I have this type of json: { "datas": [ { "id": "hotel_name", "value": "My hotel name" }, { "id": "hotel_description", "value": "My description" } ] } From this json, I would like to set the contents the following html tags: To: My hotel name My description What I have tried already: function createElements(elements) { elements.datas.forEach(function (element) { var div = document.getElementById(element.id); div.innerHTML = element.value; }); } var request = new XMLHttpRequest(); request.onload = createElements; request.responseType = "json"; request.open("GET", "datas.json", true); request.send();

http://stackoverflow.com/comment/46417429
comment on: http://stackoverflow.com/a/29071841
type: AnswerComment
score: 0
type: Comment
has text: @MarcRasmussen try putting a console.log($scope.selectedComponent) in the onCompleteItem function, and check if the value has been updated. and also post the errors if there's any in the logs?

http://stackoverflow.com/a/28939297
has comment: http://stackoverflow.com/comment/46134555
score: 0
has body: You cannot have the same id for form and input. Change or remove id attribute from school input, add method='post' to the form and change your function setSchool to: function setSchool() $('input[name="school"]).val("&lt;?php echo json_encode($_POST["school"]); ?&gt;"); $("#school").submit(); }
has comment: http://stackoverflow.com/comment/46133710
type: Answer
has comment: http://stackoverflow.com/comment/46134211
has comment: http://stackoverflow.com/comment/46134120
answers question: http://stackoverflow.com/q/28939168

http://stackoverflow.com/comment/47577099
has text: Uh, `setTimeout` still has a callback… And passing a callback directly to `animate` is recursive neither, see TrueBlueAussie's excellent answer.
type: AnswerComment
comment on: http://stackoverflow.com/a/28915435
score: 0
type: Comment

http://stackoverflow.com/comment/46219057
score: 0
has text: Hi Jacob, that's correct when I click on the element, the "data-toggle" element is never invoked, in reality nothing happens, not sure how to enforce this, as I said it only works when page is loaded; my suspicious is that when page loads it reads the data-toggle="notify" and after injecting this its never re-read again.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28977289

http://stackoverflow.com/q/28954368
type: Question
has comment: http://stackoverflow.com/comment/46162890
has comment: http://stackoverflow.com/comment/46162402
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28954513
has answer: http://stackoverflow.com/a/28954513
answer count: 2
has title: Multiple background images, one cover the other
downvote count: 0
has comment: http://stackoverflow.com/comment/46163137
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28954777
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/20872806
tagged with: css
has body: My ultimate goal is to have a webpage that looks something like this. Here is what I currently have. My question is how to get the background to stick so that when the user scrolls, the rest of the text covers up the image. I saw this post and tried to play around with background-attachment: fixed but couldn't get anything to work, mainly because I have two backgrounds I'd like to use: the main picture (the kitten), and the texture I use for the background. I'm open to JavaScript or JQuery solutions if that's what it takes since I'm already using it for other features. Here's the HTML: Home Wedding Info Direcitions Registry RSVP Wedding Info Paragraph 1: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Directions Paragraph 2: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Registry Paragraph 3: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa…
type: AnsweredQuestion
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/28954777

http://stackoverflow.com/q/28996727
tagged with: meteor
favorite count: 0
has comment: http://stackoverflow.com/comment/46250073
tagged with: promise
has title: Wrapping MongoDB calls within a Promise
tagged with: node-fibers
has comment: http://stackoverflow.com/comment/46250413
has body: I'm using Meteor (1.0.3) in general, but for one particular case I'm using a raw server side route to render a file -- so I'm outside a Meteor method. I'm using node fs.writeFile/fs.readFile and exec commands to call out to Linux command-line utilities too. My only point in brining this up is that the node calls are async of course. And so I'm opted to use the node Q library in order to manage async callbacks. This all worked until I added a line to call out to the MongoDB database. A call like so: var record_name = Mongo_Collection_Name.findOne({_personId: userId}, {fields: {'_id': 0}}); Produces the following error: [Error: Can't wait without a fiber] The error only occurs when I wrap the function in a Promise. For example, something like this will throw: getRecordExample = function () { var deferred = Q.defer(); var record_name = Mongo_Collection_Name.findOne({_personId: userId}, {fields: {'_id': 0}}); // do something // if no error deferred.resolve(record_name); return deferred.promise; } If I use the Meteor Fibers library I don't get the error: getRecordExample = function () { var deferred = Q.defer(); Fiber = Npm.require('fibers'); var record_name Fiber(function () { record_name = Mongo_Collection_Name.findOne({_personId: userId}); }).run() // do something // if no error deferred.resolve(record_name); return deferred.promise; } but, the record_name variable is undefined outside the fiber, so I don't have a way to pass the variable outside of the Fiber scope as far as I can tell. A More Precise Example This is a little long, so you have to scroll down to see it all. I'm basically building a workflow here so there are processes and subprocesses. // both/routes.js Router.route('/get-route', function(req, res) { // get the userId then start the workflow below // using Promises here because these were firing concurrently Q(userId) .then(process_1) .then(process_2) .done(); }, { name: 'server-side-ir-route', where: 'server' } // server.js process_1 = function (userI…
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29002581
accepted answer: http://stackoverflow.com/a/29002581
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46262918
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/46262632
tagged with: javascript
has comment: http://stackoverflow.com/comment/46262883
upvote count: 1
answer count: 1

polymer
tags question: http://stackoverflow.com/q/29010590
tags question: http://stackoverflow.com/q/28978974
tags question: http://stackoverflow.com/q/28912064
tags question: http://stackoverflow.com/q/28978843
tags question: http://stackoverflow.com/q/28960695
tag name: polymer
tags question: http://stackoverflow.com/q/28973421
tags question: http://stackoverflow.com/q/28926980
tags question: http://stackoverflow.com/q/28951078
tags question: http://stackoverflow.com/q/29002437
tags question: http://stackoverflow.com/q/29038648
tags question: http://stackoverflow.com/q/28997769
tags question: http://stackoverflow.com/q/28993429
tags question: http://stackoverflow.com/q/28998153
tags question: http://stackoverflow.com/q/28961164
tags question: http://stackoverflow.com/q/28972262
type: Tag
tags question: http://stackoverflow.com/q/28953336

http://stackoverflow.com/q/29060696
upvote count: 6
tagged with: angularjs
type: UnansweredQuestion
score: 6
type: Question
has title: AngularJS and UI-Select multiple with data
answer count: 1
downvote count: 0
tagged with: javascript
has body: Good afternoon! I'm trying to use UI-Select to populate the form, associated with model. Model data is received from server using the controller in the following way: {{$item.value}} WorkPlanController is a simple REST-service: application .controller("WorkPlanController", [ '$scope', 'WorkPlan', function($scope, workPlanFactory){ $scope.workplan; $scope.workplan = { profiles: [] }; $scope.init = function($id){ workPlanFactory.get({id: $id}, function(data){ $scope.workplan = data; }); }; $scope.save = function(){ $scope.workplan.$save(); } }]); application .factory('WorkPlan', function($resource){ return $resource(web_root + "_modules/_corriculum/workplans.php", { model: "CWorkPlan", type: "json" }, { get: { method: "GET", params: { id: '@id', action: "get" } } }); }); Server takes WorkPlan object in the following way: {"id":"5","title":"title","department_id":"0","approver_post":"","approver_name":"","discipline_id":"402","corriculum_discipline_id":"566","direction_id":"79","qualification_id":"220","education_form_id":"0","year":"2015","author_id":"311","profiles":[]} Also I use a LookupController which is the same: application .factory("LookupCatalog", function($resource){ return $resource(web_root + "_modules/_search/", { }, { query: { method: "GET", isArray: true, params: { catalog: '@catalog', action: "NgLookupViewData" } } }); }) .controller("LookupController", [ '$scope', 'LookupCatalog', function ($scope, lookupCatalog) { $scope.items; this.initLookup = function (glossary) { lookupCatalog.query({catalog: glossary}, function(data) { $scope.items = data; }); } } ]); LookupController receives data in the following form: [{"key":429,"value":"data1"},{"key":430,"value":"data2"},{"key":1743,"value":"data3"},{"key":1744,"value":"data4"},{"key":1852,"value":"data5"}] And everything looking good then ng-model workplan.profiles property is empty: http://joxi.ru/n2YR57wS4jwOA6 Then I save data to the server, Angular send POST with the following data: {"id":"5","title":…
tagged with: ui-select2
favorite count: 0
has answer: http://stackoverflow.com/a/33246302
tagged with: angularjs-ng-repeat

http://stackoverflow.com/q/29058823
tagged with: meteor
favorite count: 0
accepted answer: http://stackoverflow.com/a/29058907
tagged with: iron-router
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29058907
has title: What's the correct way to create a global iron:router subscription?
tagged with: javascript
answer count: 1
has body: I need a particular subscription for every route in my app, this works but I'm unsure if it is correct? Router.onBeforeAction(function() { Meteor.subscribe('locations'); this.next(); }); Also, is there a way to waitOn() globally?
downvote count: 0

http://stackoverflow.com/q/29046254
answer count: 1
tagged with: backbone.js
tagged with: mvp
has answer: http://stackoverflow.com/a/29086254
type: UnansweredQuestion
has body: So I am writing a Backbone.js application. I have opted to use the MVP pattern with Passive Views. Now my arch so far is: Application Page Presenter Layout View Header Presenter Layout View Logo View User View Content Presenter Layout View Footer Presenter Layout View Now I am very new to the concept of MVP (had a lot of experience with MVC). So say I want to render the header's layout and then attach it to the Page Presenter's layout view, who's responsibility is it to do so?
type: Question
has title: Backbone MVP - Who attaches the view?
tagged with: javascript
score: 0

http://stackoverflow.com/comment/46249336
type: QuestionComment
score: 2
has text: You can’t do this. To know whether it’s the right approach, we’d have to know what you’re approaching. Why do you need to it programmatically?
type: Comment
comment on: http://stackoverflow.com/q/29000772

http://stackoverflow.com/a/29047371
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29047248
type: Answer
answers question: http://stackoverflow.com/q/29047248
has body: Take a look at documentation. You need to pass a formData object. var formData = { source: fs.createReadStream(__dirname + '/pedestrian.jpg'), model: 'pedestrian' }; request.post({ url:'http://localhost:3350/dpm/detect.objects', formData: formData }, function (err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log('Upload successful! Server responded with:', body); } );
score: 4
upvote count: 4

http://stackoverflow.com/q/28938961
has answer: http://stackoverflow.com/a/28939034
tagged with: dom
type: Question
downvote count: 0
tagged with: javascript
answer count: 2
possible better answer: http://stackoverflow.com/a/28939034
has body: How do I force Javascript to refresh onload only once? My take: $(window).ready(function(res){ var hash = '#refreshed'; if(window.location.hash != hash) window.location.replace(window.location + hash) }); But this doesn't refresh the page. Any ideas why?
favorite count: 0
has answer: http://stackoverflow.com/a/28939024
accepted answer: http://stackoverflow.com/a/28939024
upvote count: 2
has title: Forcing JavaScript to refresh once
score: 2
type: AnsweredQuestion

http://stackoverflow.com/q/29051867
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46341555
has answer: http://stackoverflow.com/a/29051895
has body: Here goes two same ways to achive something. They both should do the same thing, but they don't. Code: http://jsfiddle.net/8vjctofs/ a1 = function(str) { return str.replace(new RegExp("[^a-zA-Z0-9\s]", "gi"), ""); } a2 = function(str) { return str.replace(/[^a-zA-Z0-9\s]/gi, ""); } var string = "abc abc"; console.log(a1(string)); console.log(a2(string)); output: abcabc abc abc Please, tell me why? Code is the same, except that first function creates regex, by new operator, second not.
has title: Regex, two ways, different results.
answer count: 2
possible better answer: http://stackoverflow.com/a/29051895
has answer: http://stackoverflow.com/a/29051890
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46341533
tagged with: regex
linked to: http://stackoverflow.com/q/28910934
accepted answer: http://stackoverflow.com/a/29051890
score: 2
upvote count: 2

http://stackoverflow.com/q/28970812
tagged with: facebook-javascript-sdk
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28971095
tagged with: facebook-sharer
has title: How to share my own website on facebook with image from website
type: Question
tagged with: javascript
tagged with: facebook-like
has body: I added share and like button on my website. http://5.135.145.154/product?id=1 But I have got problem, I can share the website but how can I set my own image on this share frame? I have one main image of product and I want to share this image and description, but on facebook there is different image (I think random image from website?) This code shares my image:
tagged with: facebook-share
score: 0
answer count: 1

http://stackoverflow.com/comment/46089471
score: 0
type: AnswerComment
type: Comment
has text: Hi aideroxylon, just wanted to thank you first of all. Also can you more indepth and explain what you mean by ?v=3 and split = s.split('=') and how would I add content Thanks again - y.c
comment on: http://stackoverflow.com/a/28915186

http://stackoverflow.com/comment/46091552
comment on: http://stackoverflow.com/q/28916828
score: 0
type: Comment
type: QuestionComment
has text: @charlietfl https to https on localhost, client and server are on different ports

image
tags question: http://stackoverflow.com/q/29039602
tags question: http://stackoverflow.com/q/28944413
tags question: http://stackoverflow.com/q/28992432
tags question: http://stackoverflow.com/q/28920599
tags question: http://stackoverflow.com/q/28911351
tags question: http://stackoverflow.com/q/28932435
tags question: http://stackoverflow.com/q/28943338
tags question: http://stackoverflow.com/q/29040497
tags question: http://stackoverflow.com/q/28909557
tags question: http://stackoverflow.com/q/28970203
tags question: http://stackoverflow.com/q/28936682
tags question: http://stackoverflow.com/q/28942549
tags question: http://stackoverflow.com/q/29022536
tags question: http://stackoverflow.com/q/29006910
tags question: http://stackoverflow.com/q/28999829
tags question: http://stackoverflow.com/q/28917366
tags question: http://stackoverflow.com/q/28956293
tags question: http://stackoverflow.com/q/29027630
tags question: http://stackoverflow.com/q/28926740
tags question: http://stackoverflow.com/q/29028739
tags question: http://stackoverflow.com/q/29016710
tags question: http://stackoverflow.com/q/28979270
tags question: http://stackoverflow.com/q/29024456
tags question: http://stackoverflow.com/q/29001887
tags question: http://stackoverflow.com/q/29005660
tags question: http://stackoverflow.com/q/29060622
tags question: http://stackoverflow.com/q/28921903
tags question: http://stackoverflow.com/q/28957908
tags question: http://stackoverflow.com/q/29002585
tags question: http://stackoverflow.com/q/29048041
tags question: http://stackoverflow.com/q/29043619
tag name: image
tags question: http://stackoverflow.com/q/29056757
tags question: http://stackoverflow.com/q/29017817
tags question: http://stackoverflow.com/q/29012913
tags question: http://stackoverflow.com/q/28952668
tags question: http://stackoverflow.com/q/29009393
tags question: http://stackoverflow.com/q/28986872
tags question: http://stackoverflow.com/q/28919351
tags question: http://stackoverflow.com/q/29025846
type: Tag
tags question: http://stackoverflow.com/q/29003054
tags question: http://stackoverflow.com/q/28929106
tags question: http://stackoverflow.com/q/29021606
tags question: http://stackoverflow.com/q/28998541
tags question: http://stackoverflow.com/q/29054274

http://stackoverflow.com/comment/46206402
has text: @JoeEnzminger it meas that `{{'label()'}}` creates a watch :) so you aren't removing it anyways. But `my-dir="::item.label` also does create just one only to be removed, with that you could as well have `{{ '::label' }}` as well so ultimately you end up with no watchers. `& bindings are ideal for binding callback functions to directive behaviors.` according to me there isn't any need to (ab)use it inorder to remove a watch, when there are already ways.
comment on: http://stackoverflow.com/a/28977223
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46195720
has text: @Robert Try adding `contentType:"application/json"` at `$.ajax()` settings; `function(result, textStatus, jqxhr)` , `console.log(result, textStatus, jqxhr.responseJSON)` at `success` handler.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28972006

http://stackoverflow.com/comment/52379929
has text: I would like to see this feature too, I want to display the date in local UK format (dd/mm/yyyy) but it needs to be parsed as yyyy-mm-dd due to a piece of software I'm using. Also I think "data-date-format" and "format" are the same thing just one is attached via HTML and the other via JS.
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29021207

http://stackoverflow.com/q/29048932
has comment: http://stackoverflow.com/comment/46387484
has comment: http://stackoverflow.com/comment/46352267
has comment: http://stackoverflow.com/comment/46366807
accepted answer: http://stackoverflow.com/a/29131030
has comment: http://stackoverflow.com/comment/46474657
has comment: http://stackoverflow.com/comment/46403592
type: AnsweredQuestion
score: 2
has body: Lately i have been trying to make communication between minecraft server (running with Java) and scratch (running with JavaScript). I have written the code in java already: package me.yotam180; import java.io.IOException; import java.io.OutputStream; import java.net.InetSocketAddress; import java.util.HashMap; import java.util.Map; import org.bukkit.Bukkit; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; public class HttpProcessor { public MainClass plugin; public HttpProcessor (MainClass plug) throws IOException { plugin = plug; plugin.getLogger().info("CREATED HTTTP PROCESSOR"); HttpServer server = HttpServer.create(new InetSocketAddress(9090), 0); server.createContext("/pollplayer", new PollPlayerHandler()); server.createContext("/killplayer", new KillPlayerHandler()); plugin.getLogger().info("STARTED HTTTP SERVER"); server.setExecutor(null); // creates a default executor server.start(); } static class PollPlayerHandler implements HttpHandler { @SuppressWarnings("deprecation") @Override public void handle(HttpExchange httpExchange) throws IOException { // TODO Auto-generated method stub Map &lt;String,String&gt;parms = HttpProcessor.queryToMap(httpExchange.getRequestURI().getQuery()); StringBuilder response = new StringBuilder(); response.append(Bukkit.getPlayer(parms.get("name")).getLocation().toString()); HttpProcessor.writeResponse(httpExchange, response.toString()); } } static class KillPlayerHandler implements HttpHandler { @SuppressWarnings("deprecation") @Override public void handle(HttpExchange httpExchange) throws IOException { // TODO Auto-generated method stub Map &lt;String,String&gt;parms = HttpProcessor.queryToMap(httpExchange.getRequestURI().getQuery()); Bukkit.getPlayer(parms.get("name")).setHealth(0); HttpProcessor.writeResponse(httpExchange, "SUCCESS"); } } public static void writeResponse(HttpExchange httpExchange, String response) throws IOException { httpExchange…
upvote count: 3
tagged with: java
tagged with: bukkit
has comment: http://stackoverflow.com/comment/46448233
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46427716
linked to: http://stackoverflow.com/q/17285895
tagged with: minecraft
tagged with: javascript
has answer: http://stackoverflow.com/a/29131030
tagged with: mit-scratch
has title: Communication Java-Javascript with http requests
answer count: 1
has comment: http://stackoverflow.com/comment/46367963
favorite count: 0

http://stackoverflow.com/comment/46134360
has text: yes, `ng-class` will not remove your existing class
type: Comment
comment on: http://stackoverflow.com/q/28939647
score: 0
type: QuestionComment

http://stackoverflow.com/a/29015620
accepted answer of: http://stackoverflow.com/q/29015391
score: 1
answers question: http://stackoverflow.com/q/29015391
has comment: http://stackoverflow.com/comment/46276468
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46276402
has comment: http://stackoverflow.com/comment/71047606
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/46276269
has body: Why don't you use a result variable that you update after a succesful AJAX request? &lt;script&gt; $("#abc_form_submit").click(function(e) { e.preventDefault(); // avoid to execute the actual submit of the form if not succeded var result = false; //........ $.ajax({ type: "POST", url: url, dataType: 'json', async: false, data: $("#abc_form").serialize(), // serializes the form's elements. success: function(data) { if(data.success == 'false') { // show errors } else { // SUBMIT NORMAL WAY. $("#abc_from").submit() doesnt work. result = true; } } }); return result; }); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/46276460

http://stackoverflow.com/a/28973610
has comment: http://stackoverflow.com/comment/46200285
has comment: http://stackoverflow.com/comment/46198717
type: Answer
has comment: http://stackoverflow.com/comment/46199321
has comment: http://stackoverflow.com/comment/46200838
has comment: http://stackoverflow.com/comment/46204541
has comment: http://stackoverflow.com/comment/46204635
has comment: http://stackoverflow.com/comment/46200244
accepted answer of: http://stackoverflow.com/q/28973176
score: 0
answers question: http://stackoverflow.com/q/28973176
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46199939
has body: At the top, add an element that you will use to display the count. Then in your script, set the innerHTML for the new element: var randomOtherNames = ["Jamie", "Shannon", "Kelly", "Aeron", "Shain", "Kasey", "Jordan", "Jesse / Jessie", "Sage", "Evan", "Alex", "Stephen", "Renee", "Tracy", "Avery", "Dallas", "Denver", "Taylor", "Elliot", "Terry", "Jeri", "Percy", "Raven", "Jean", "Jan", "Christian", "Adrian", "Jude", "Quinn", "Piper", "Harper", "Payton", "Walker", "Cameron", "Terran", "Riley", "River", "Andren", "Camden", "Jiles", "Pax", "Rayne", "Skylar", "Kalin", "Justice", "July", "Kensington", "Kendall", "Grey", "Genesis", "Hollis", "Keagan", "Kai", "Bristol", "Angel", "Azure", "Bailey", "Carmen", "Echo", "Embry", "Ember", "Gale", "Freedom", "Haven", "Kyler", "Kylan", "Miracle", "Myka", "Peace", "Zene", "Winter", "Xannon", "Valor", "Urban", "Valentine", "Storm", "Tai", "Shae", "Sailor", "Red", "Reign", "Ramsey", "Reed", "Reggie", "Ocean", "Nalo", "Neo", "London", "Ash", "Brook", "Crane", "Crimson", "Corin", "Cresant", "Indigo", "Jazz", "Cassidy", "Kin", "Monroe", "Moral", "Poet", "Ryder", "Saxton", "Sidney", "Tanner", "Torrance", "Torrin", "Lex / Lexi", "Zane", "Zanas", "Ari", "Brynn", "Greer", "Kennedy", "Lyle", "Lonnie", "Rune", "Rylan", "Sparrow", "Sunny", "Emerald", "Cloud", "Star", "Kensey"]; var other_string = randomOtherNames.length; var other_div = document.getElementById("other_name"); var other_count_div = document.getElementById("other_name_count"); //populate the innerHTML of "other_count_div" on page load: other_name_count.innerHTML = randomOtherNames.length; var findName = function() { randomIndex = Math.ceil((Math.random() * randomOtherNames.length - 1)); newText = randomOtherNames[randomIndex]; other_div.innerHTML = newText; other_name_count.innerHTML = randomOtherNames.length; }; document.getElementById("other_button").addEventListener("click", findName); &lt;button Onclick="click" id="other_button" style="font-size: 25px;"&gt; Click Me &lt;/button…

http://stackoverflow.com/q/28944163
tagged with: transfer
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28947427
has title: Can somebody help me with a web application for a simulation of transfer of images
type: Question
has body: I am trying to simulate a transfer of images by showing an image disappearing from the originating device and after a delay appearing on the target device. The application is for an experiment to design gestures I have done the following that shows how an image appears and disappears when hovered upon #pic3 { max-width: 800px; max-height: 500px; width:500px; height:800px; position:absolute; } #pic3 { max-width: 800px; max-height: 500px; width:500px; height:800px; position:absolute; } #pic4 { width:500px; height:800px; position:absolute; max-width:800px; max-height: 500px; opacity:0; -webkit-transition: opacity 1s; } #pic3:hover ~ #pic4, #pic4:hover { opacity:1; } &lt;div class="maps1"&gt; &lt;img id="pic3" src="http://wallpapersfor.me/wp-content/uploads/2012/02/cute_cat_praying-1280x800.jpg" /&gt; &lt;img id="pic4" src="http://www.garageservicesruislip.co.uk/communities/5/004/008/507/645/images/4586026183.jpg /&gt; &lt;/div&gt;
has answer: http://stackoverflow.com/a/28944484
has answer: http://stackoverflow.com/a/28946957
tagged with: javascript
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/46150101
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: simulation

http://stackoverflow.com/q/29057517
type: AnsweredQuestion
has body: I am trying to load up a Google spreadsheet in my application, but I am not managing to make it work. I've tried different ways of accessing the tree structure (via the controller and/or via the html), but none of them worked. Any idea what may be wrong? Here is my controller: app.controller('SuperCtrl', ['$scope', '$http', function($scope,$http) { $http.get("https://spreadsheets.google.com/feeds/list/1lZWwacSVxTD_ciOsuNsrzeMTNAl0Dj8SOrbaMqPKM7U/od6/public/values?alt=json-in-script&amp;callback=x") .success(function(response) { $scope.items = response; }); }]); And here is the HTML: &lt;ul ng-controller="SuperCtrl"&gt; &lt;li ng-repeat="item in items.feed.entry"&gt; {{ item.title.type }} &lt;/li&gt; &lt;/ul&gt;
favorite count: 0
score: 4
tagged with: angularjs
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/29058018
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46352153
upvote count: 4
tagged with: google-sheets
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/34420493
has answer: http://stackoverflow.com/a/29058018
has answer: http://stackoverflow.com/a/34420493
has title: Load JSON in AngularJS App (loading google spreadsheet)

http://stackoverflow.com/a/28996889
downvote count: 0
type: AcceptedAnswer
has body: You need to include jQuery in your page. Most browsers nowadays include a $() function in their console by default for easy element selection, but this simply maps to document.getElementById(). The value returned will not have a .children() method. Additionally, if you load an HTML page directly from your file system, you need to include the http:// for CDN script URLs. Otherwise, your browser will try to find the .js file on your local system.
upvote count: 25
has comment: http://stackoverflow.com/comment/46241930
type: Answer
answers question: http://stackoverflow.com/q/28996811
score: 25
accepted answer of: http://stackoverflow.com/q/28996811

http://stackoverflow.com/comment/46326219
score: 0
comment on: http://stackoverflow.com/q/29043135
type: Comment
type: QuestionComment
has text: Nested ternary operator is what you are describing. Looks like this answers the question: http://stackoverflow.com/questions/10526739/a-somewhat-painful-triple-nested-ternary-operator

http://stackoverflow.com/q/28989472
has comment: http://stackoverflow.com/comment/46228058
has answer: http://stackoverflow.com/a/28991464
upvote count: 0
has answer: http://stackoverflow.com/a/28991139
tagged with: javascript
answer count: 3
has title: javascript Spell Checker
favorite count: 0
has answer: http://stackoverflow.com/a/28990207
type: UnansweredQuestion
downvote count: 6
score: -6
has body: We have a input field in which the user will type text and there should be mechanism to check the basic spelling mistakes(general English terms) and highlight the same to the user. The following is the simple example to highlight the issue. Ex: apply leavds today Spell checker: Do you mean: leave leaves etc.. Please suggest a feasible solution to achieve the same. Thanks vijay
type: Question

http://stackoverflow.com/a/28908267
has body: http://jsfiddle.net/p08ayvv8/ this fiddle shows you how jQuery can deal with (deep) extending objects. See http://api.jquery.com/jquery.extend/ for a detailed explaination. It is mentionable though that when preforming the second extension jQuery will prepend the old value of test to the array, thats why I added o1.test = o1.test[0];
downvote count: 0
answers question: http://stackoverflow.com/q/28906836
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/29020175
accepted answer of: http://stackoverflow.com/q/29020061
score: 2
has body: $("button").on("click", function() { var selectedClass = $(this).attr("class"); $("option[value="+ selectedClass + "]").attr("selected", true); });
answers question: http://stackoverflow.com/q/29020061
downvote count: 0
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28973731
has answer: http://stackoverflow.com/a/28996385
accepted answer: http://stackoverflow.com/a/28996385
answer count: 1
favorite count: 0
has title: jquery plugin - chosen - multiple selection not listing in a row but a column
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: jquery-chosen
has body: I am trying to configure my ListBox to use the jquery plugin, chosen 1.4. I get the values for the ListBox from the database and add each item to the ListBox in the code behind that works fine: //Populate the Recipient ListBox DataTable tdtRecipients = new DataTable(); tstrXmlTableData = m_pagingClient.GetRecipientList(m_strUserID); tdtRecipients = ParseXML(tstrXmlTableData); // string tstrRecipientLst = string.Empty; foreach (DataRow row in tdtRecipients.Rows) { lstBoxTo.Items.Add(row["Name"].ToString()); } The ListBox is styled to be long and to add vertical scroll bars if needed. This is from the style sheet: #lstBoxTo { width: 620px; height: 40px; overflow: scroll; } The control is set within a panel: &lt;asp:Panel ID="pnlTo" runat="server" CssClass="basicRow" ClientIDMode="Static"&gt; &lt;asp:Label ID="lblTo" runat="server" CssClass="labelText" Text="To: " ClientIDMode="Static"&gt;&lt;/asp:Label&gt; &lt;asp:ListBox ID="lstBoxTo" runat="server" SelectionMode="Multiple" ClientIDMode="Static" &gt;&lt;/asp:ListBox&gt; &lt;/asp:Panel&gt; This is the javascript to use and configure the chosen plugin: &lt;script type="text/javascript"&gt; $(window).load(function () { $("#lstBoxTo").data("placeholder", "Choose recipient(s)...").chosen(); }); &lt;/script&gt; The ListBox is not displayed as wide as the stylesheet indicates but only as wide as the longest selection. The list is in a bulleted format and when you make multiple selections they are not in a row but a bulletted column. The placeholder, 'Choose recipient(s)' is not shown but the default placeholder 'Select option'. I would like the list box to display as on the web site, http://harvesthq.github.io/chosen/, for Multiple Selections. But I don't know what options to set or how to set them. Any help would be greatly appreciated. Thanks. UPDATE After removing the ClientIDMode attribute and adding Height and width to the attributes, the ListBox displays correctly. But in the demo, the ListBox should start with 'Choos…
type: Question
tagged with: javascript
tagged with: jquery-plugins
upvote count: 1

http://stackoverflow.com/comment/46192686
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/28970546
has text: `this` in an event handler is the target of the event.
type: Comment

http://stackoverflow.com/comment/46639833
has text: server side script should not take ~50s to load. where is that rule written, then we couldn't change the server timeout and just set it as 50s. again, the OP isn't complaining about the performance here, he just want help with a problem encountered at client side.
type: AnswerComment
comment on: http://stackoverflow.com/a/29160266
type: Comment
score: 1

http://stackoverflow.com/q/28968231
tagged with: teaspoon
tagged with: phantomjs
tagged with: javascript
has title: Visit pages using PhantomJS directly when writing specs with TeaSpoon - Jasmine
linked to: http://stackoverflow.com/q/18739354
tagged with: specs
score: 3
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28992382
favorite count: 0
accepted answer: http://stackoverflow.com/a/28992382
type: AnsweredQuestion
upvote count: 3
tagged with: ruby-on-rails
has body: I'm trying to write a Javascript spec for my Rails 3.2 application using Teaspoon (the Jasmine version). I'm trying to write a spec that does something like this describe("Fun", function() { var page = require('webpage').create() //ERROR it("should be so much fun", function() { page.open('/pageToTest/') expect($('#HereIsTheParty')).not.toBe( undefined ); }); }); However, require('webpage') doesn't run (Error: Module name "system" has not been loaded yet for context) even though the Requirejs gem has been installed and can be accessed from the Chrome console. My question is, can I easily get require('webpage') to run using Rails or should I be using something else? Is it maybe easier to just use Capybara since so far I've been using describe "Fun", :type =&gt; :feature do it "should be so much fun" do visit '/pageToTest/' expect(page).to have_content 'Success' end end without any problems. I would however prefer using pure Javascript since in this case it's more convenient. What do you guys think? Thanks!
type: Question

http://stackoverflow.com/q/28954659
has body: When the dropdown is loaded the items are populated correctly. But when I click the Refresh button the Dropdown items are not refreshed. The data binding isn't working on clicking the Refresh button. After clicking the Refresh button I am expecting to see 'Mary' and 'Sandra'. Here's the JavaScript: $(function () { function viewModel() { var self = this; self.persons = ko.observableArray([]); self.persons.push({ id: 1, name: 'John' }); self.persons.push({ id: 2, name: 'Paul' }); self.refreshPersonList = function () { self.persons = ko.observableArray([]); self.persons.push({ id: 3, name: 'Mary' }); self.persons.push({ id: 4, name: 'Sandra' }); }; } ko.applyBindings(new viewModel()); }); And HTML: Refresh Person List
answer count: 1
has answer: http://stackoverflow.com/a/28954925
tagged with: knockout.js
type: AnsweredQuestion
has title: With knockout.js how to refresh observable array in a Select element
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28954925
type: Question
tagged with: http://stackoverflow.com/tag/html
score: 0

http://stackoverflow.com/q/29061814
answer count: 1
has body: I have a code: First Line If you hover mouse over the first line,then the second one appears. If you put mouse out of the first line (and do that slowly enough), then the second line disappears. What do I need: after you have hovered over the first line and the second line has appeared, then the second line must disappear only if the cursor is outside the first OR second line. Which means, that if move mouse from the first line to the second line, the latter should not disappear. At the moment it does. I have tried the following: First Line and was advised to do the following: Untitled First Line Second Line No help. All those variants do not work. What is the solution?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29062185
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: Question
tagged with: javascript
has title: How to make 'onmouseout' event "understand", that the "span" height was increased?
score: 0

http://stackoverflow.com/a/29001669
type: Answer
has body: In your fiddle tabulous plugin are missing, If you remove the below lines from your code it work fine or install tabulous plugin properly. $('#tabs2').tabulous({ effect: 'slideLeft' }); Hope this will help you.
upvote count: 0
has comment: http://stackoverflow.com/comment/46251222
score: -2
has comment: http://stackoverflow.com/comment/46252664
answers question: http://stackoverflow.com/q/29001604
downvote count: 2

http://stackoverflow.com/comment/46096240
type: Comment
comment on: http://stackoverflow.com/a/28919225
has text: Thank it's working if files in same directory,but problem if i call the file in another directory like : var file = 'files/'+data+'.html';
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46284273
score: 1
has text: Thanks a lot for taking the time help. The labels was my next task to tackle, but you guys sorted that too!
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29020194

http://stackoverflow.com/q/28926584
has answer: http://stackoverflow.com/a/28926722
has body: I am trying to create a twitter clone with angularjs. For now the data is mocked in arrays. How can I reach the nested array? the only error I found was "Cannot read property '#' of undefined" The array is named users, which contains all of the data about a user, including the tweets in a nested array Or is there a way to reach a certain item using something like user[x].name where x is the array index The HTML looks like this: S0 {{user.name}} S2 Details Name: {{user.name}} Location: {{user.location}} Web: {{user.web}} Bio: {{user.bio}} S1 Tweets {{user.name}} {{user.tweet.date}} {{users[1].tweet.text}} S3 S4 Following The data/array is stored like this: angular.module('myApp.tweets', ['ngRoute']) .config(['$routeProvider', function ($routeProvider) { $routeProvider.when('/tweets', { templateUrl: 'tweets/tweets.html', controller: 'tweetsCtrl' }); }]) .controller('tweetsCtrl', ['$scope', function ($scope) { $scope.users[ {id: "1", name: "userAbc", location: "hugecity", web: "www.abc.nl", bio: "Hey welcome on my profile", image: "http://upload.wikimedia.org/wikipedia/commons/a/ac/No_image_available.svg", tweets: [ {date: "08/03/2015", text: "bericht 4"}, {date: "07/03/2015", text: "bericht 3"}, {date: "06/03/2015", text: "bericht 2"}, {date: "05/03/2015", text: "bericht 1"} ]}, {id: "2", name: "userDef", location: "hugecity", web: "www.abc2.nl", bio: "Hey welcome to my profile", image: "http://upload.wikimedia.org/wikipedia/commons/a/ac/No_image_available.svg", tweets: [ {date: "08/03/2015", text: "bericht 4"}, {date: "07/03/2015", text: "bericht 3"}, {date: "06/03/2015", text: "bericht 2"}, {date: "05/03/2015", text: "bericht 1"} ]} ]; }]);
favorite count: 0
possible better answer: http://stackoverflow.com/a/28926729
tagged with: angularjs
has answer: http://stackoverflow.com/a/28926729
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28926722
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
score: 0
answer count: 2
has title: angularjs nested array undefined
tagged with: arrays
tagged with: nested

http://stackoverflow.com/q/29043329
has body: In my Backbone project, I have a router which creates a View, viewA. viewA creates a subview, viewA2 as part of its render process. viewA2 has a collection which contains Card models, but I also declare another Collection of Tag models in viewA2 's initialize() function. Like so: initialize: function() { this.tagCollection = new tagModels.TagCollection(); this.tagCollection.fetch({ reset: true }); this.listenTo(this.collection, 'change:tags', this.updateContentList); this.listenTo(this.collection, 'reset remove', this.updateContentList); this.listenTo(this.tagCollection, 'reset', this.resetTags); this.listenTo(this.tagCollection, 'add', this.addTag); this.listenTo(this.tagCollection, 'remove', this.removeTag); } Now at some point the router switches pages in the app, gets rid of viewA and replaces it with viewB. Before switching to viewB I do: viewA2.tagCollection.reset(); viewA2.remove(); viewA.remove(); According to the Backbone extension in Chrome, both viewA and viewA2 are destroyed, but viewA2.tagCollection still exists, even though it has been reset and contains no models. Every time I switch views, another Collection is added. Why doesn't the empty Collection die? The View which it was a property of no longer exists. I've also tried viewA2.stopListening() before removing viewA2. I realise that one way of bypassing this problem is to create the tagCollection further up the chain, for example in the router, and pass a reference to it to viewA, and from there to viewA2. This might be a better design for my app., but it feels clumsy passing references up and down the chain of views. Should I be taking that approach anyway? Finally. I'm aware that listening to two Collections in one View may not be best practice. If that is deemed to be a major issue I can give more details as to why I've done it that way.
tagged with: javascript
has answer: http://stackoverflow.com/a/29048280
has comment: http://stackoverflow.com/comment/46332319
answer count: 1
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/46335179
has title: Can't kill a zombie Collection in Backbone project
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46326563
has comment: http://stackoverflow.com/comment/46334972
tagged with: collections
tagged with: zombie-process
has comment: http://stackoverflow.com/comment/46334308
has comment: http://stackoverflow.com/comment/46326759
type: Question

http://stackoverflow.com/a/29062377
upvote count: 3
has comment: http://stackoverflow.com/comment/46361567
has comment: http://stackoverflow.com/comment/46364861
answers question: http://stackoverflow.com/q/29062088
type: Answer
has comment: http://stackoverflow.com/comment/46361237
accepted answer of: http://stackoverflow.com/q/29062088
has body: If you want to do it on load you should probably do something like this $('.item').each(function(){ var itemNumber = $(this).attr('class').split(" "); itemNumber.splice( itemNumber.indexOf("item"), 1 ); var sumElement = $(".sum_" + itemNumber); var sum = (sumElement.val() == "") ? 0 : parseInt(sumElement.val()); sum += parseInt($(this).val()); sumElement.val(sum); }); Here is a demo to calculate local sums If you want to calculate a global sum (sum of local sums) here is a demo 2 If you have multiple of such group of inputs then you have to add a class to each of these inputs so that you know which input elements you need to consider to calculate the sum for. &lt;input type="text" class="item 1" value="1" /&gt; &lt;input type="text" class="item 2" value="2" /&gt; &lt;input type="text" class="item 2" value="3" /&gt; &lt;input type="text" class="item 2" value="4" /&gt; &lt;input type="text" class="item 3" value="5" /&gt; &lt;input type="text" class="item 3" value="6" /&gt; &lt;input type="text" class="item 3" value="7" /&gt; &lt;br&gt; &lt;br&gt; &lt;input type="text" class="sum_1" value="" /&gt; &lt;input type="text" class="sum_2" value="" /&gt; &lt;input type="text" class="sum_3" value="" /&gt; $(document).on("change", ".item", function () { var sum = 0; var itemNumber = $(this).attr('class').split(" "); itemNumber.splice( itemNumber.indexOf("item"), 1 ); $('.'+itemNumber).each(function () { sum += parseInt($(this).val()); }); $(".sum_" + itemNumber).val(sum); }); In the above script, $(this).attr('class') will looks like "item 1" $(this).attr('class').split(" ") will be an array ["item", "1"] Then i'm removing the word item and using that "1" Here is a demo Hope this helps.
downvote count: 0
has comment: http://stackoverflow.com/comment/46361258
has comment: http://stackoverflow.com/comment/46365136
has comment: http://stackoverflow.com/comment/46361407
score: 3
has comment: http://stackoverflow.com/comment/46361235
has comment: http://stackoverflow.com/comment/46360903
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46361055
has comment: http://stackoverflow.com/comment/46361863
has comment: http://stackoverflow.com/comment/46361610

http://stackoverflow.com/comment/46084984
score: 0
has text: @Madusudanan is it working ?? as for testing, try removing the erroneous code and running this function
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28913046

http://stackoverflow.com/comment/46162009
has text: Try to do all your stuff once ajax call has been done in a promise way for example. `$.ajax({ ... }).then(function() { // check length });`
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28954106
score: 1

http://stackoverflow.com/q/28954855
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28977397
has answer: http://stackoverflow.com/a/28955098
answer count: 2
has body: Here is a JSFiddle: http://jsfiddle.net/5Lz3zd9y/7/ HTML: dog CSS: .givenLettersMobile { width: 40px; height: 40px; text-align:center; font-style:italic; font-weight:bold; text-decoration:underline; line-height: 50%; } .blankLettersMobile { width: 40px; height: 40px; text-align:center; font-style:italic; line-height: 50%; } In regards to the JSFiddle using JQuery Mobile, I'm trying to figure out how to get all the text input boxes aligned left to right instead of stacked top to bottom while also trying to reduce the width of the text input boxes (without affecting the width of other input boxes like username, password, etc...). Something more like how these text input boxes behave from the desktop version of the website: Any thoughts on how to accomplish this?
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has title: JQuery Mobile CSS Text Input
tagged with: css
linked to: http://stackoverflow.com/q/8606298
score: 0
has comment: http://stackoverflow.com/comment/46163382
type: Question
tagged with: jquery-mobile

http://stackoverflow.com/comment/46181318
type: Comment
comment on: http://stackoverflow.com/a/28964778
score: 0
type: AnswerComment
has text: Thank you! Could you also tell me how to set the div container invisible as standard?

android-viewpager
tag name: android-viewpager
type: Tag
tags question: http://stackoverflow.com/q/29017163

http://stackoverflow.com/a/28932536
score: 0
type: AcceptedAnswer
type: Answer
has body: Look at the reywood:publish-composite package. I'm doing something similar in my app and am using this package to essentially perform a join. In your case people are following people so when creating a publication that returns the set of users that a person is following you can at the same time return the union of all their posts.
accepted answer of: http://stackoverflow.com/q/28932188
answers question: http://stackoverflow.com/q/28932188

http://stackoverflow.com/q/28920912
score: 3
downvote count: 0
has title: angular ngMock $httpBackend: split mocks into multiple files
favorite count: 0
has answer: http://stackoverflow.com/a/30151131
has comment: http://stackoverflow.com/comment/55759395
has comment: http://stackoverflow.com/comment/57512550
has answer: http://stackoverflow.com/a/28972706
tagged with: angularjs
type: Question
tagged with: angularjs-ngmock
upvote count: 3
answer count: 2
tagged with: file
has comment: http://stackoverflow.com/comment/55599062
has comment: http://stackoverflow.com/comment/55557089
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/55768120
has comment: http://stackoverflow.com/comment/73787784
has comment: http://stackoverflow.com/comment/55800562
has body: I am working on a big angular application which needs to mock entire API in the browser (also called backend-less development). I will have lots of different sections and views in my application, each of them will have its own mock definitions. I do know that I may use the ngMock module's $httpBackend service which enables me to mock an AJAX call. That's what I want. And I've found a working snippet at jsfiddle. But the thing that I'm missing is how to split this into multiple files? As I said, my app will have hunderds of pages and possibly even more RESTful resources and I can't simply put this into one source file. This in as architectural question: what is the best approach (that is working, scalable and easy to maintain) to divide thousands of whenGET and whenPOST calls into different files that will simply mock the same API? How to separate mocks in terms of project file structure? Shall there be a separate .run() method for each module in the app? Can I load mocks from JSON files? I would appreciate an explanation as well as a demo To make answering easier, below is the relevant part of the fiddle: myApp.run(function ($httpBackend) { var phones = [{name: 'phone1'}, {name: 'phone2'}]; $httpBackend.whenPOST('/phones').respond(function (method, url, data, headers) { console.log('Received these data:', method, url, data, headers); phones.push(angular.fromJson(data)); return [200, {}, {}]; }); $httpBackend.whenGET('/phones').respond(function (method, url, data) { console.log("Getting phones"); return [200, phones, {}]; }); $httpBackend.whenGET(/\.html$/).passThrough(); });
tagged with: mocking

http://stackoverflow.com/q/28979959
tagged with: datetime
answer count: 1
has body: I am new to javascript. I used following method to get date time. function getDateTime() { var now = new Date(); var year = now.getFullYear(); var month = now.getMonth()+1; var day = now.getDate(); var hour = now.getHours(); var minute = now.getMinutes(); var second = now.getSeconds(); if(month.toString().length == 1) { var month = '0'+month; } if(day.toString().length == 1) { var day = '0'+day; } if(hour.toString().length == 1) { var hour = '0'+hour; } if(minute.toString().length == 1) { var minute = '0'+minute; } if(second.toString().length == 1) { var second = '0'+second; } var dateTime = day+'-'+month+'-'+year+' '+hour+':'+minute; return dateTime; } I want output like : day+'-'+month+'-'+year+' '+hour+':'+minute; What is the best method for this
accepted answer: http://stackoverflow.com/a/28980126
favorite count: 0
duplicate of: http://stackoverflow.com/q/3552461
tagged with: time
downvote count: 2
has comment: http://stackoverflow.com/comment/46210155
type: AnsweredQuestion
tagged with: date
type: Question
has answer: http://stackoverflow.com/a/28980126
linked to: http://stackoverflow.com/q/25275696
upvote count: 0
has title: Need to reduce javascript method code for geting date format
score: -2
linked to: http://stackoverflow.com/q/3552461
tagged with: javascript
has comment: http://stackoverflow.com/comment/46210025
tagged with: datetime-format
has comment: http://stackoverflow.com/comment/46210187
has comment: http://stackoverflow.com/comment/46210117

http://stackoverflow.com/a/28988581
has comment: http://stackoverflow.com/comment/46225657
score: 4
has body: Your number isn't being changed, rather it's exactly what you've defined it as -- an 'octal' number. When you begin a number with 0, it will actually represent that value as base-8 (as opposed to base-10 -- decimal -- which you're used to). If you just want to output the string literal '0211', simply put quotes around it: &lt;body onLoad="printPage('0211')"&gt; and if you want to show the number 211, just remove the 0: &lt;body onLoad="printPage(211)"&gt; One other obvious thing I didn't catch on my first answer: you don't need to redeclare your var, if you're already passing it in as a parameter. Remove that var school_number; from your function.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28988529
answers question: http://stackoverflow.com/q/28988529
type: Answer
upvote count: 4
downvote count: 0

http://stackoverflow.com/q/29016485
tagged with: javascript
score: 1
favorite count: 0
type: Question
tagged with: firefox-addon
linked to: http://stackoverflow.com/q/8355316
has title: Close a tab after submitting a form
tagged with: firefox-addon-sdk
tagged with: tabs
upvote count: 1
has comment: http://stackoverflow.com/comment/46285464
has comment: http://stackoverflow.com/comment/46289285
tagged with: onsubmit
has body: The goal of my addon is to do the following: open a new tab to the specified url insert content into a form submit that form close the opened tab The addon is able to do steps 1 and 2 just fine. However it runs into issues doing steps 3 and 4 in a proper sequence together. Main.js var data = require("sdk/self").data; var tabs = require("sdk/tabs"); console.log("Step 1: addon started"); // Creates the button require("sdk/ui/button/action").ActionButton({ id: "make-post", label: "Make post", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onClick: handleClick }); function handleClick(state) { console.log("Step 9: handleClick started"); tabs.open(sites.urls[0]); handleTab(0); } //this is our cargo. var Cargo = { Title: "Sample Title!", Content: new Date() }; //this is in an array for a good reason. don't worry about it. var sites = { urls: ["http://pastebin.com/"], scripts: ["postPB.js"] }; function handleTab(X) { //I tried tabs.on('load'.. and that didn't fix the problem tabs.on('ready', function RunPostScript(tab) { console.log("The tab is ready"); worker = tab.attach( { contentScriptFile: sites.scripts[X], contentScriptOptions: { Cargo } }); worker.port.once("myMessage", function handleMyMessage() { console.log("Shuttin down!"); tab.close(); worker.destroy(); }); tabs.removeListener("ready", RunPostScript); }); } PostPB.js //the listener that should close the tab after submit document.addEventListener("submit", function(event) { console.log("Unloading now"); self.port.emit("myMessage"); }, false); //this inserts the post title var titlePort = function(x) { var zA = document.querySelector(".post_input"); //this sets the paste to expire in 10 minutes document.querySelector("div.form_frame:nth-child(2) &gt; div:nth-child(2) &gt; select:nth-child(1) &gt; option:nth-child(1)").value="10M"; zA.value = x; console.log("Title inserted"); }; //this inserts the post content var contentPort = function(x) { var zA = document.querySelector("#paste_c…
has comment: http://stackoverflow.com/comment/46281650
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46282489
has comment: http://stackoverflow.com/comment/46283993
answer count: 0
downvote count: 0

http://stackoverflow.com/comment/46149828
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28946282
score: 1
has text: That's impossible to answer. "SEO Bots" do not *always* do anything, they do whatever they were programmed to do. Each one is different.

http://stackoverflow.com/comment/46232626
type: AnswerComment
has text: Thanks ! I thought that since I'm calling hover on the ` ` element, `this` was going to point to the ` ` element.
score: 0
comment on: http://stackoverflow.com/a/28992019
type: Comment

http://stackoverflow.com/a/29000405
has comment: http://stackoverflow.com/comment/46278063
has comment: http://stackoverflow.com/comment/46271296
has comment: http://stackoverflow.com/comment/46252791
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46281084
answers question: http://stackoverflow.com/q/28996103
has comment: http://stackoverflow.com/comment/46283703
has comment: http://stackoverflow.com/comment/46278498
has comment: http://stackoverflow.com/comment/46277928
has comment: http://stackoverflow.com/comment/46279334
has comment: http://stackoverflow.com/comment/46279079
type: Answer
has comment: http://stackoverflow.com/comment/46278067
has body: I looked at your Fiddle and noticed a couple things: Your "fixed" class was not represented in the CSS. When I looked into the CSS I saw a span element wrapping a ".fixed" reference with a position property set. You are styling the mapContainer div using the ID. This is a very rigid selector as the order of CSS selectors goes. The hierarchy of CSS selectors is specifid and IDs will override types and classes. See: http://htmlhelp.com/reference/css/structure.html The when scrolling, I am seeing the console logging in my dev tools. Also, when inspecting the element, I am seeing it add and remove the class name. Based on my observations, modifying the CSS selector for your container should do the trick. Adding the ID to the class will keep the CSS rule specific enough: #mapContainer.fixed { position: fixed; } Refer to this updated Fiddle for an example with these changes in place: http://jsfiddle.net/pmurst8e/4/ Update: For demonstration purposes of what I was referring to with the resize I modified your example a bit. It isn't the prettiest, but it conveys the point: http://jsfiddle.net/pmurst8e/6/ Update: There are a couple issues with the latest Fiddle (v12): The sidebar will always go fixed the moment you scroll because "top" is never calculated. It's being set to zero, and the offset calculation is commented out. Absolute positioning is relative to the closest positioned parent. If no parent is positioned, it's relative to the window. To constrain an absolute positioned element, set the constraining parent to "position:relative;". Instead of using a percentage and left position rule, consider positioning the sidebar to the right, relative to the "contentContainer", by a set number of pixels. When the fixed position takes effect, we also need to set the sidebar fixed left position. Otherwise, it will use the positioning in the CSS. In contrast to absolute positioning, Fixed positioning is relative to the window, meaning an absolute element "right: 10px" will be 10p…
downvote count: 0
has comment: http://stackoverflow.com/comment/46279351
has comment: http://stackoverflow.com/comment/46253136
has comment: http://stackoverflow.com/comment/46278890

http://stackoverflow.com/comment/46108278
comment on: http://stackoverflow.com/q/28925925
has text: Is the API yours and something you can change? Returning unsanitized output wrapped in HTML is really something you should avoid.
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/28931216
type: Answer
score: 0
has body: Simply push each value into a new array: var values = []; for (var i in myJson){ values.push(myJson[i]) }
answers question: http://stackoverflow.com/q/28921114

http://stackoverflow.com/q/28957367
type: UnansweredQuestion
has title: how to check radiobuttonlist is checked or not in javascript
linked to: http://stackoverflow.com/q/1541160
has comment: http://stackoverflow.com/comment/46169481
has comment: http://stackoverflow.com/comment/46170089
type: Question
has comment: http://stackoverflow.com/comment/46167576
tagged with: c#
has body: I have tried using the following code for checking radiobutton selection but it shows alert even after selection &lt;script type="text/javascript"&gt; function validate() { if (!document.getElementById('&lt;%= Radiobuttonlist1.ClientID %&gt;').checked) { alert("Please select type"); return false; } } &lt;/script&gt; &lt;asp:radiobuttonlist ID="Radiobuttonlist1" runat="server" RepeatDirection="Horizontal" &gt; &lt;asp:ListItem&gt;Text&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;Number&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;Character&lt;/asp:ListItem&gt; &lt;/asp:radiobuttonlist&gt; &lt;asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return validate();" onclick="Button1_Click"/&gt;
tagged with: javascript
has comment: http://stackoverflow.com/comment/46168646
score: 0
has comment: http://stackoverflow.com/comment/46167557
tagged with: asp.net
answer count: 0
has comment: http://stackoverflow.com/comment/46167651

http://stackoverflow.com/q/28963726
tagged with: javascript
score: 0
has title: How to manage tracking events google analytcs (code and dashboard)
answer count: 1
has answer: http://stackoverflow.com/a/28968619
has body: I'd like to understand more about google analytics and I am study more about data analytcs to improve results in my websites and I saw about tracking events to track perfomance about my website, so I do not know if my code it works correctly and how can I see the results of clicks in dashboard analytcs ? Anybody Help me ? This link contain the code track event (http://pastebin.com/5E9Jhdbw)
type: UnansweredQuestion
tagged with: tracking
type: Question
tagged with: google-analytics
has comment: http://stackoverflow.com/comment/65046698

http://stackoverflow.com/comment/46275793
comment on: http://stackoverflow.com/q/29005239
has text: Post the solution as an answer, not an edit : http://stackoverflow.com/help/self-answer
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46315247
comment on: http://stackoverflow.com/a/29035151
type: AnswerComment
score: 0
type: Comment
has text: Here is an example for converting binary response to data URL. http://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri

http://stackoverflow.com/q/28926261
tagged with: javascript
has comment: http://stackoverflow.com/comment/46113471
tagged with: get
tagged with: angularjs
answer count: 0
has comment: http://stackoverflow.com/comment/46109354
type: UnansweredQuestion
score: 0
has title: How to pass AngularJS checkbox model to $http.get?
tagged with: checkbox
has comment: http://stackoverflow.com/comment/46140728
has body: How can I send an AngularJS checkbox model to the $http.get service successfully? The standard way of sending an array in get parameters is like so: http://hostname.com/app?keyword=value1&amp;fields[]=checkbox1&amp;fields[]checkbox2 Here's the AngularJS checkbox markup I'm using... HTML: &lt;input ng-model="filters.fields.checkbox1" type="checkbox" /&gt; &lt;input ng-model="filters.fields.checkbox2" type="checkbox" /&gt; Here's the controller code that sets up the model and then sends it to $http.get... XHR: $scope.filters = { keyword: '', fields:{} }; $scope.url = 'http://hostname.com/app/'; $http.get($scope.url,$scope.filters).then( ... ); This is producing a URL that doesn't match the above standard format: http://hostname.com/app?keyword=test&amp;&amp;fields=%7B%7D
type: Question

http://stackoverflow.com/a/28933458
has comment: http://stackoverflow.com/comment/46124466
upvote count: 1
has comment: http://stackoverflow.com/comment/46122728
downvote count: 0
has comment: http://stackoverflow.com/comment/46123338
answers question: http://stackoverflow.com/q/28933317
has comment: http://stackoverflow.com/comment/46122811
type: AcceptedAnswer
has body: The component requires an associated DOM element, but it doesn't require that the DOM element be visible on the page, just accessible within the DOM. You could create a place to put your invisible components like this: $("body").append('&lt;div id="invisbleComponents" style="display:none"&gt;&lt;/div&gt;'); Then you can create a method to start your components and dump them in your invisible div automatically: var startComponent = function(c) { $('&lt;div data-aura-component="' + c + '" id="' + c + 'Options"&gt;&lt;/div&gt;').appendTo("#invisibleComponents); app.start([{ name: c, options: { el: '#' + c + 'Options' } }]); }; So to start a component called "myComponent" you just make a call: startComponent('myComponent');
accepted answer of: http://stackoverflow.com/q/28933317
type: Answer
has comment: http://stackoverflow.com/comment/46122885
score: 1

http://stackoverflow.com/comment/46235318
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28985934
has text: probably yes, btw I just found one case when it may be usefull, if you need to allow your methods to make instance of itself (`var myInstance=new (Object.getPrototypeOf(this).constructor)()`)
score: 0

http://stackoverflow.com/q/29030903
has comment: http://stackoverflow.com/comment/46448278
tagged with: lodash
has comment: http://stackoverflow.com/comment/46303177
has answer: http://stackoverflow.com/a/29031968
upvote count: 1
has comment: http://stackoverflow.com/comment/46307813
has body: Say I have an array, [1, 2, 3, 4, 5, 3, 4, 6, 3, 7, 4]. I want to swap the values of 3 and 4 iff they are adjacent an in the order [3, 4] (i.e. [4, 3] remain intact). The result of the example would be [1, 2, 4, 3, 5, 4, 3, 6, 3, 7, 4]. Is there an elegant way to do this in Lodash without the use of for loops? Edit: How about _.sortBy(arr, function(value, index) { if (value === 3) { return index + 0.75; } else if (value === 4) { return index - 0.75; } else { return index } }); Edit 2: Went with the following (it's not actually 3 and 4). return _.reduce(tags, function(out, tag) { var word = tag[0]; if (out[0] &amp;&amp; unitPowerSuffixes.hasOwnProperty(word)) { out.splice(-1, 0, { type: 'unit-power', value: unitPowerSuffixes[word] }); // Insert one from end } else { out.push(tag); } return out; }, []);
has answer: http://stackoverflow.com/a/29033168
has title: Lodash swap adjacent items if condition is met
has comment: http://stackoverflow.com/comment/46308651
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46307740
tagged with: functional-programming
downvote count: 0
score: 1
favorite count: 0
type: Question
answer count: 2

http://stackoverflow.com/a/28986507
has body: $('input[name=\'product_attribute[' + attribute_row + '][name]\']').catcomplete({ delay: 0, source: function(request, response) { $.ajax({ url: 'index.php?route=catalog/attribute/autocomplete&amp;token=&lt;?php echo $token; ?&gt;', type: 'POST', dataType: 'json', data: 'filter_name=' + encodeURIComponent(request.term), success: function(data) { response($.map(data, function(item) { return { category: item.attribute_group, label: item.name, value: item.attribute_id } })); } }); }, select: function(event, ui) { $('input[name=\'product_attribute[' + attribute_row + '][name]\']').attr('value', ui.item.label); $('input[name=\'product_attribute[' + attribute_row + '][attribute_id]\']').attr('value', ui.item.value); return false; } }); You Can map your json something like this
type: Answer
answers question: http://stackoverflow.com/q/28985363
score: 0

http://stackoverflow.com/q/29028166
tagged with: css
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29028209
score: -1
type: Question
accepted answer: http://stackoverflow.com/a/29028209
has title: Dropdown list contains Image
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I want to create dropdown list with image or icon for each option *Image1 TextOption1 *Image2 TextOption2 . . *ImageN TextOptionN Can somebody please show me how to do this?
tagged with: asp.net
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/59132177
comment on: http://stackoverflow.com/a/29002017
has text: It's worth mentioning that this would be an ideal candidate for a [mixin](https://lodash.com/docs#mixin) if this was going to be reused regularly throughout an app. It would also improve readability. [fiddle](https://jsfiddle.net/nwayve/9m9bcrtc/)
type: Comment
score: 3
type: AnswerComment

http://stackoverflow.com/q/28997500
type: AnsweredQuestion
tagged with: google-chrome-devtools
has answer: http://stackoverflow.com/a/29010053
type: Question
accepted answer: http://stackoverflow.com/a/29010053
tagged with: javascript
has title: How does google play music hides stream requests?
answer count: 1
tagged with: xmlhttprequest
has body: When playing media from https://play.google.com/music/listen using chrome, in Dev Tools Network page there is no request for the stream. All other requests are visible. When opened in Firefox, I see all requests including chrome-hidden one /videoplayback?... with the stream. In Firefox, requests seems to be initiated via flash (if disabled, app fails play any stream). In Chrome though, if you disable all plugins (no flash at all, no native client, etc.) you can still play streams, but they are somehow hidden in DevTools network tab. The question is - what the heck is going on? How does this pure web-app hides selected requests from dev tools?
score: 0
tagged with: google-play
tagged with: google-chrome

http://stackoverflow.com/comment/46224659
has text: @dandavis no problem. I hadn't looked much at the Set stuff until this question :) I went ahead and added a couple lines of the Set API to my sample code because you were right that it should be there to clearly illustrate what I was saying.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28967616

http://stackoverflow.com/a/28966354
downvote count: 0
has comment: http://stackoverflow.com/comment/46199347
score: 1
answers question: http://stackoverflow.com/q/28953220
has comment: http://stackoverflow.com/comment/46203530
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/46194857
has comment: http://stackoverflow.com/comment/46278403
has comment: http://stackoverflow.com/comment/46271140
has comment: http://stackoverflow.com/comment/46188982
has comment: http://stackoverflow.com/comment/46186472
has comment: http://stackoverflow.com/comment/46195655
has body: As far as I am able to tell the panel has no "ready" event of sorts that I can listen to for emitting the message. I think it does, at least internally it seems to but I'm not sure whether they're exposed. But even if it doesn't you can simply fire your own port message from the content script once it has been attached and registered its own listeners. Upon receiving that message in the addon you can then resume using the port on that side.

http://stackoverflow.com/a/28951710
score: 2
has comment: http://stackoverflow.com/comment/46165963
has body: You can attach an onchange event to the original select. Bootstrap is tied into that select. So if you select an option from the bootstrap select it will allow you to retrieve the selected value. $(this).find("option:selected").attr("value"); This line seeks the selected option and returns the attribute value. See this example: $(function() { $('.selectpicker').on('change', function(){ var selected = $(this).find("option:selected").attr("value"); alert(selected); }); }); option 1 option 2 option 3
upvote count: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28951142
answers question: http://stackoverflow.com/q/28951142
type: Answer

http://stackoverflow.com/q/29001977
has answer: http://stackoverflow.com/a/29002028
linked to: http://stackoverflow.com/q/15273098
downvote count: 0
tagged with: ios
has answer: http://stackoverflow.com/a/40878198
upvote count: 98
has title: Safari in ios8 is scrolling screen when fixed elements get focus
favorite count: 0
has answer: http://stackoverflow.com/a/41451666
has comment: http://stackoverflow.com/comment/46251816
accepted answer: http://stackoverflow.com/a/44506266
has answer: http://stackoverflow.com/a/35675094
has answer: http://stackoverflow.com/a/38959088
has comment: http://stackoverflow.com/comment/46354874
has comment: http://stackoverflow.com/comment/79050205
tagged with: css
tagged with: safari
type: AnsweredQuestion
answer count: 12
has answer: http://stackoverflow.com/a/44506266
linked to: http://stackoverflow.com/q/10659891
has answer: http://stackoverflow.com/a/29013189
has answer: http://stackoverflow.com/a/29002731
score: 98
has answer: http://stackoverflow.com/a/32389421
linked to: http://stackoverflow.com/q/7808110
type: Question
has body: In IOS8 Safari there is a new bug with position fixed. If you focus a textarea that is in a fixed panel, safari will scroll you to the bottom of the page. This makes all sorts of UIs impossible to work with, since you have no way of entering text into textareas without scrolling your page all the way down and losing your place. Is there any way to workaround this bug cleanly? #a { height: 10000px; background: linear-gradient(red, blue); } #b { position: fixed; bottom: 20px; left: 10%; width: 100%; height: 300px; } textarea { width: 80%; height: 300px; }
tagged with: ios8
has answer: http://stackoverflow.com/a/29064810
possible better answer: http://stackoverflow.com/a/35675094
has answer: http://stackoverflow.com/a/30950376
tagged with: javascript
has answer: http://stackoverflow.com/a/44699411
has comment: http://stackoverflow.com/comment/46251915
linked to: http://stackoverflow.com/q/38987153
linked to: http://stackoverflow.com/q/9038625

http://stackoverflow.com/comment/46235414
comment on: http://stackoverflow.com/q/28993242
type: QuestionComment
has text: You're trying to copy the dropdown from another row in the table?
type: Comment
score: 0

http://stackoverflow.com/q/28928042
has comment: http://stackoverflow.com/comment/46112224
has title: Send push notification in parse cloud code after matching two different classes
favorite count: 0
tagged with: parse-cloud-code
tagged with: parse-platform
type: UnansweredQuestion
has body: I am trying to send a push notification after a user's status update has changed (status update is managed in the submission class in parse core data) but I'm using cloud code to match users phone numbers in the User and submission classes so that the push notification only targets the one specific user. Parse.Cloud.afterSave("submission", function(request) { var statusText = request.object.get('status'); var phoneNumber = request.object.get('Phone'); Parse.Cloud.afterSave("User", function(request) { var userPhone = request.object.get('Phone'); var pushQuery = new Parse.Query(Parse.submission); pushQuery.matchesQuery(userPhone, phoneNumber); Parse.Push.send({ where: pushQuery, // Set our Installation query data: { alert: "Status Change: " + statusText } }, { success: function() { }, error: function(error) { throw "Got an error " + error.code + " : " + error.message; } }); });
has comment: http://stackoverflow.com/comment/46113020
answer count: 0
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46113280
type: Question
tagged with: ios
tagged with: javascript
has comment: http://stackoverflow.com/comment/46113074
upvote count: 1

http://stackoverflow.com/q/29017788
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/46279858
accepted answer: http://stackoverflow.com/a/29018071
has body: I am Trying to use jQuery.one() to disable a button that shows an image of a tree after it is clicked. The showImage function works fine, but not .one. Can I not use javascript inside of a jquery event handler? html: Plant Orange Tree Tree Name etc... css: .display-tree-big{ background: url('../images/tree_big.jpg'); background-repeat: no-repeat; height:1000px; width:1000px; border: solid black 2px; } #orange-tree-template { visibility: hidden; } javascript function showImage() { var img = document.getElementById('orange-tree-template'); img.style.visibility = 'visible'; } $(document).ready(function() { $("#plant").one( "click", function() { document.getElementById("#plant").disabled = true; }); });
has comment: http://stackoverflow.com/comment/46280242
upvote count: 1
has title: jQuery.one() event handler is not executing
has comment: http://stackoverflow.com/comment/46280035
type: AnsweredQuestion
downvote count: 2
type: Question
has answer: http://stackoverflow.com/a/29018071
has comment: http://stackoverflow.com/comment/46280000
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/46279744

http://stackoverflow.com/q/28950643
type: UnansweredQuestion
has body: I am using Google's URL structure for a directions links. The links automatically open the Google Maps app on iOS, but it only shows a route preview - "start navigation" never appears. I can get the start navigation link to appear by clicking the address destination and choosing the address from a drop down, but I don't understand why the exact same address won't trigger Google's navigation by default. Here is an example of one of the links: https://www.google.com/maps?saddr=My+location&amp;daddr=142+Berkeley+Street,+Boston,+MA+02116 Any ideas on what I am doing wrong?
has answer: http://stackoverflow.com/a/28952007
type: Question
tagged with: google-maps
tagged with: ios
tagged with: javascript
has title: Google Maps directions link only shows route preview in iOS
score: 0
answer count: 1

http://stackoverflow.com/q/28937788
linked to: http://stackoverflow.com/q/28418601
has comment: http://stackoverflow.com/comment/46150570
has comment: http://stackoverflow.com/comment/46134782
has comment: http://stackoverflow.com/comment/46134809
has comment: http://stackoverflow.com/comment/46165700
has comment: http://stackoverflow.com/comment/46134109
has title: Would there be any benefit to writing synchronous code using the syntax of promises
tagged with: monads
type: AnsweredQuestion
has body: Is there such a concept as a synchronous promise? Would there be any benefit to writing synchronous code using the syntax of promises? try { foo(); bar(a, b); bam(); } catch(e) { handleError(e); } ...could be written something like (but using a synchronous version of then); foo() .then(bar.bind(a, b)) .then(bam) .fail(handleError)
has comment: http://stackoverflow.com/comment/46150519
downvote count: 0
has comment: http://stackoverflow.com/comment/46142360
favorite count: 0
has answer: http://stackoverflow.com/a/28947696
tagged with: promise
upvote count: 8
type: Question
linked to: http://stackoverflow.com/q/23803743
has comment: http://stackoverflow.com/comment/46150366
has comment: http://stackoverflow.com/comment/46149677
has comment: http://stackoverflow.com/comment/46371225
has comment: http://stackoverflow.com/comment/46133977
has comment: http://stackoverflow.com/comment/46142344
has comment: http://stackoverflow.com/comment/46149718
answer count: 2
possible better answer: http://stackoverflow.com/a/29103303
accepted answer: http://stackoverflow.com/a/28947696
has comment: http://stackoverflow.com/comment/46133735
has answer: http://stackoverflow.com/a/29103303
has comment: http://stackoverflow.com/comment/46171797
linked to: http://stackoverflow.com/q/44965
score: 8
has comment: http://stackoverflow.com/comment/46130667
has comment: http://stackoverflow.com/comment/46171416
has comment: http://stackoverflow.com/comment/46130755
tagged with: javascript

http://stackoverflow.com/comment/46127776
score: 0
comment on: http://stackoverflow.com/a/28935997
type: AnswerComment
has text: increase the _time limit_ in **php.ini** file and then test again. i think it will help you
type: Comment

http://stackoverflow.com/a/28931739
answers question: http://stackoverflow.com/q/28931707
score: 0
has body: You could do $(".menu-toggle").on("click", function(){ $(this).parent("#primary-menu").toggleClass("active"); }); NOTE : .on() requires jQuery v1.7+
type: Answer

http://stackoverflow.com/comment/46132772
score: 0
type: Comment
type: QuestionComment
has text: check my answer may be u need that
comment on: http://stackoverflow.com/q/28938628

http://stackoverflow.com/a/28997258
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/46243158
score: 1
has body: What you have is a string. You need to declare a regex literal: var validator = /^(?=.*?[A-Z])(?=.*?[0-9]).{8,}$/; Better performing regex will be: var validator = /^(?=[^A-Z]*[A-Z])(?=\D*\d).{8,}$/;
has comment: http://stackoverflow.com/comment/46243228
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46242989
accepted answer of: http://stackoverflow.com/q/28997213
downvote count: 0
answers question: http://stackoverflow.com/q/28997213
has comment: http://stackoverflow.com/comment/46242894

http://stackoverflow.com/comment/46336338
has text: And i cannot use example you provided because all form id from are generated from xml file. And if i change form id or add new input field I will get errors. So then i have to update js file. which is not possible so the function should be dynamic and js file cannot have any static form ids specified
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29048456
type: Comment

http://stackoverflow.com/q/28917468
tagged with: javascript
has comment: http://stackoverflow.com/comment/46098391
answer count: 3
possible better answer: http://stackoverflow.com/a/40308298
has comment: http://stackoverflow.com/comment/46097707
tagged with: setinterval
has comment: http://stackoverflow.com/comment/46093392
has comment: http://stackoverflow.com/comment/46093480
favorite count: 0
tagged with: tampermonkey
has answer: http://stackoverflow.com/a/56235971
accepted answer: http://stackoverflow.com/a/56235971
has comment: http://stackoverflow.com/comment/46093319
has comment: http://stackoverflow.com/comment/46097690
score: 6
has answer: http://stackoverflow.com/a/72767001
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/46097618
type: Question
has body: I've used setInterval() plenty of times in typical scripts, but not with userscripts. For some reason, console.log() isn't working, but only inside of the setInterval. The alert, however, is working. Any ideas..? Should I not be using console.log? To clarify, the first console.log("Started!"); does in fact print started. (function() { console.log("Started!"); setInterval(function(){ findAndReplace();}, 3000); })(); function findAndReplace() { alert("hi"); console.log("Hey"); }
has title: Console.log not working inside of setInterval for Tampermonkey
has answer: http://stackoverflow.com/a/40308298
upvote count: 6

http://stackoverflow.com/comment/46107183
score: 0
comment on: http://stackoverflow.com/q/28925393
type: Comment
type: QuestionComment
has text: Fixed indenting and removed excessive use of bold.

http://stackoverflow.com/q/28915053
score: 0
answer count: 1
tagged with: jquery
has body: I want find top position of rotated div from element, I can able find top position of element but I want top(Y pos) position from left(x) position. I am used this var degree = degree; if (degree &lt; 0) { var sign = -1; } else { var sign = 1; } var numY = Math.abs(myElem.position().top + sign * ((myElem.outerHeight() / 2) - Math.sin(degree))); var numX = 0 var bottom = myElem.position().top + myElem.outerHeight(true); y = numY; Thanks in Advance Slope:20 deg, height: 20px,width:400px, left 150px i want find top position I want to re arrange dragged items after rotation for that I am finding top position. Please find the jsbin link drop weights into plank.
has comment: http://stackoverflow.com/comment/46089224
linked to: http://stackoverflow.com/q/10810857
has answer: http://stackoverflow.com/a/28922780
tagged with: position
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28922780
type: AnsweredQuestion
has title: Find rotated div top position from left
type: Question
tagged with: rotation
tagged with: javascript
has comment: http://stackoverflow.com/comment/46088390

http://stackoverflow.com/q/28915336
has comment: http://stackoverflow.com/comment/46088885
upvote count: 2
has comment: http://stackoverflow.com/comment/46089293
has title: create jquery infinite animation not using recursion?
has body: How to use jquery to create infinite animation, BUT NOT using recursion way? The recursion solution I found: jQuery .animate() callback infinite loop The problem of using recursion is: while animating, the browser tab of currrent page will take MORE and MORE memory.
tagged with: recursion
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46088833
type: Question
answer count: 2
score: 2
has answer: http://stackoverflow.com/a/28915435
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47444791
possible better answer: http://stackoverflow.com/a/29630350
linked to: http://stackoverflow.com/q/6461945
has answer: http://stackoverflow.com/a/29630350
linked to: http://stackoverflow.com/q/29456460
has comment: http://stackoverflow.com/comment/46089391
has comment: http://stackoverflow.com/comment/46088856
favorite count: 0
has comment: http://stackoverflow.com/comment/46089262
has comment: http://stackoverflow.com/comment/46089345
accepted answer: http://stackoverflow.com/a/28915435

http://stackoverflow.com/comment/46117124
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28930727
has text: Where is the example? Have you done any research because I'm sure this question has been asked many times before "how to open external window"

http://stackoverflow.com/a/30027515
has body: Here is what I got for my code: for ( i = 0; i &lt; text.length; i++) { if ( text[i] === "E") { for( var j = i; j &lt; (myName.length + i ); j++) { hits.push(text[j]); } } }; It looks like you were missing the " + i " part in your second for loop. That seems to make sure that the first loop will be included. I tried it without the "+ i" and it does not work. I tried continuing directly from the second for loop using a "+ j" and that only crashes the browser.
answers question: http://stackoverflow.com/q/28930987
score: 0
type: Answer

http://stackoverflow.com/q/29004344
tagged with: jquery
has title: jquery datatable column search filter not working if i fix header
upvote count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: datatable
answer count: 0
downvote count: 0
score: 1
type: Question
has body: We are using jquery datatables.If i search text is not appering in text filters when onkeyup and aslo in select boxes.Would you help to find solution? My table has following code. var dTable= $("table#tableid").dataTable({ "bStateSave":true,"bDeferRender": true,"sPaginationType":"full_numbers","iDisplayLength":25, "fnStateSaveParams": function (oSettings, oData) { if($('#enquerydata_range_from_5').val()){ oData.from = $('#enquerydata_range_from_5').val(); }else{ oData.from = ''; } if($('#enquerydata_range_to_5').val()){ oData.to = $('#enquerydata_range_to_5').val(); }else{ oData.to = ''; } }, "fnStateLoadParams": function (oSettings, oData) { setTimeout(function(){ if(oData.from || oData.to){$('#enquerydata_range_from_5').val(oData.from); $('#enquerydata_range_to_5').val(oData.to); dTable.fnDraw(); }},500); }, }).columnFilter({sPlaceHolder: "head:before", aoColumns: [ null, { type: "c-name" }, { type: "contact" }, { type: "project-name" }, null, { type: "date-range" }, { type: "ptype-select" }, { type: "ptype-select" }, null, { type: "ptype-select" }, ] }); new FixedHeader(dTable,{"alwaysCloneTop": true,"bStateSaveParams":false});
tagged with: javascript

http://stackoverflow.com/q/28909908
has body: I have a project right now that basically compiles several typescript files as modules to javascript using commonjs. Then I browserify the entry file which in turn also includes all its modules to a bundle as per the norm. Well this has been going A-OK until I finally started making more use of Typescript and now I'm getting this weird error during script loading. Uncaught TypeError: Cannot read property 'step' of undefined "step" is a particular variable in one of the typescript classes I laid out. And it baffles me as to why I'm getting this error. browserify nor typescript produce any errors and and any attempt at trying to use console.log doesnt work because its almost like this happens during loading and before execution of the code. The entire project is open source and available here on github https://github.com/wiseguy12851/wiseguy12851.github.io, the website where you can find the problem live is hosted here http://wiseguy12851.github.io/index-dev#/glyph Any help would be greatly appreciated, thanks in advance
has title: Typescript and Browserify - Uncaught TypeError: Cannot read property 'step' of undefined
tagged with: typeerror
accepted answer: http://stackoverflow.com/a/28909958
type: AnsweredQuestion
score: 0
type: Question
tagged with: typescript
tagged with: javascript
has answer: http://stackoverflow.com/a/28909958
tagged with: browserify
answer count: 1

http://stackoverflow.com/q/28963167
has title: js function to go back in browser history to last browsed page of specific domain?
tagged with: cross-domain
answer count: 3
upvote count: 0
tagged with: webbrowser-control
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28964796
has body: I need the js function to go back in history to the last pages used in a specific domain. reason: I send people to a subdomain to see specific content-galleries (gallery.mydomain.xyz/#1etc). I need them to return to the last page where they left of from the specific tld (mydomain.xyz/pageX) after having clicked through a number of images/videos there at subdomain... is this possible? any ideas? thx!
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28963315
tagged with: javascript
score: -1
tagged with: browser-history
linked to: http://stackoverflow.com/q/33957477
has answer: http://stackoverflow.com/a/28963295

http://stackoverflow.com/comment/46156260
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28950687
has text: So long as you have a reference to the handle returned by `setInterval`/`setTimeout`, yes - that can be passed around and passed to `clearInterval`/`clearTimeout` anywhere in your code.
score: 0

http://stackoverflow.com/q/29020120
has comment: http://stackoverflow.com/comment/46285137
score: 0
has body: I am building an angular web application and I am wanting to send any javascript exceptions and callstacks from the client to the server for logging. In chrome and firefox I am able to get the callstack by looking at the exception.stack property, but this value is not available when using IE. Here is a code example from my angular controller: function LogTestController($scope) { $scope.TestError = function () { callError1(); } function callError1() { callError2(); } function callError2() { var x = y; } }; And here is the exception.stack from chrome: "ReferenceError: y is not defined at callError2 (http://localhost:85/App/Offer/OfferController.js:16:17) at callError1 (http://localhost:85/App/Offer/OfferController.js:12:9) at Scope.LogTestController.$scope.TestError (http://localhost:85/App/Offer/OfferController.js:8:9) at $parseFunctionCall (http://localhost:85/Scripts/angular.js:12345:18) at ngEventDirectives.(anonymous function).compile.element.on.callback (http://localhost:85/Scripts/angular.js:21435:17) at Scope.$get.Scope.$eval (http://localhost:85/Scripts/angular.js:14401:28) at Scope.$get.Scope.$apply (http://localhost:85/Scripts/angular.js:14500:23) at HTMLButtonElement.&lt;anonymous&gt; (http://localhost:85/Scripts/angular.js:21440:23) at HTMLButtonElement.jQuery.event.dispatch (http://localhost:85/Scripts/jquery-1.9.1.js:3074:9) at HTMLButtonElement.jQuery.event.add.elemData.handle (http://localhost:85/Scripts/jquery-1.9.1.js:2750:46)" Which is very helpful in debugging. But IE does not have the extension.stack property when the error occurs inside of the angular controller. However if I force the same error in IE when it is not inside an angular controller then there is a value for exception.stack. Here is an example of that code: &lt;script type="text/javascript"&gt; try { first(); } catch (exception) { var trace = exception.stack; }; function first() { second(); }; function second() { var x = y; } &lt;/script&gt; In IE the exception.trace is as follows: …
tagged with: javascript
tagged with: angularjs
tagged with: printstacktrace
has comment: http://stackoverflow.com/comment/46284847
answer count: 0
type: UnansweredQuestion
has title: Not getting javascript exception.stack in IE inside of angular controller
has comment: http://stackoverflow.com/comment/46284127
tagged with: stack-trace
tagged with: exceptionhandler
type: Question

http://stackoverflow.com/q/28964304
has title: JQuery SlideDown() is delaying second half of a word
tagged with: javascript
tagged with: jquery
has body: I have a simple JQuery thing that activates when the page is ready. Two strings would slide down at different times. The problem is that in the first string, only the first half of the word slides down but the second half is delayed for a split second. Can someone tell me why? Here is my code: The KGV Connection Congratulations! Your account has been successfully activated!
accepted answer: http://stackoverflow.com/a/28964695
score: 0
has comment: http://stackoverflow.com/comment/46180604
has answer: http://stackoverflow.com/a/28964736
has answer: http://stackoverflow.com/a/28964674
answer count: 4
tagged with: slidedown
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28964695
has comment: http://stackoverflow.com/comment/46180478
possible better answer: http://stackoverflow.com/a/28964702
type: Question
has answer: http://stackoverflow.com/a/28964702

http://stackoverflow.com/comment/46440042
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29030685
has text: @MaciejPaprocki i want to change the attribute indeed but when i do the value inside the number is gone and the value of the text is just like it's in js `""`

http://stackoverflow.com/comment/46126977
score: 1
has text: @Ashim I suggest to write wrapper methods to access array data and keep your code readable. I think it make sense to work with arrays if someone care about traffic regarding to high traffic in sense of high frequenced requests and\or large amount of JSON data.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28935516

http://stackoverflow.com/comment/46236494
type: AnswerComment
comment on: http://stackoverflow.com/a/28993075
type: Comment
has text: where can i find the Wordpress Shortcode ? and I changed the post to be more clear about the problem please review it and tell me what i should do.
score: 0

http://stackoverflow.com/comment/46298823
score: 0
has text: Yes I tried your answer...still getting undefined or [object object]
comment on: http://stackoverflow.com/q/29025780
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28954746
upvote count: 1
has answer: http://stackoverflow.com/a/28955502
type: Question
answer count: 2
has title: Input of Information into Javascript using terminal
accepted answer: http://stackoverflow.com/a/28955502
has comment: http://stackoverflow.com/comment/46164104
tagged with: javascript
has body: I want to take the output of a c++ program and input it into the stdin of a javascript file. However I have been unable to push anything into the stdin using the method... node example.js &lt; test.txt because I get the following errors. example.js:35 stdin.setRawMode( true ); TypeError: undefined is not a function at Object. (example.js:35:7) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:501:10) at startup (node.js:129:16) at node.js:814:3 The offending code appears to be as below. It works fine during normal input, however crashes in the above scenario. var stdin = process.stdin; stdin.setRawMode( true ); stdin.resume(); stdin.setEncoding( 'utf8' ); stdin.on( 'data', function( key ){ //do stuff based upon input Has anyone encountered this, or any ideas about how to fix it? Or another way of going about this problem?
downvote count: 0
possible better answer: http://stackoverflow.com/a/28955476
has answer: http://stackoverflow.com/a/28955476
favorite count: 0
tagged with: terminal
has comment: http://stackoverflow.com/comment/46164160
tagged with: node.js
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/46163890

http://stackoverflow.com/comment/46153559
comment on: http://stackoverflow.com/q/28949704
has text: Still how would rivets know that countdown is decreasing?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46203429
has text: what do you think I have to do with the toggle magic? it is not right what I did first ? ```$scope.toggleSportSelection = function(sport) { sport.checked = !sport.checked; };```
comment on: http://stackoverflow.com/a/28976152
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29044427
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/76924050
possible better answer: http://stackoverflow.com/a/29044467
has comment: http://stackoverflow.com/comment/46328587
has body: JavaScript: function getValue(){ var num1 = document.getElementById("firstNum").value; var num2 = document.getElementById("secondNum").value; return (num1, num2); } function add(){ getValue(); var result = parseFloat(num1) + parseFloat(num2); return result; } What I'm creating is a calculator that gets the values from input boxes. What I'm having trouble with is how am I supposed to call the variables I declare in the getValue(); function in my add(); function to create a value. I appreciate the help.
type: Question
has answer: http://stackoverflow.com/a/29044467
has answer: http://stackoverflow.com/a/47383938
has answer: http://stackoverflow.com/a/29044481
tagged with: function
has answer: http://stackoverflow.com/a/29044539
has answer: http://stackoverflow.com/a/29044443
has title: JavaScript: How do I return two values from a function and call those two variables in another function?
has answer: http://stackoverflow.com/a/29044450
tagged with: javascript
has answer: http://stackoverflow.com/a/47565814
downvote count: 0
tagged with: parsing
favorite count: 0
tagged with: return
accepted answer: http://stackoverflow.com/a/29044443
score: 13
answer count: 10
has comment: http://stackoverflow.com/comment/46328723
has answer: http://stackoverflow.com/a/29044484
upvote count: 13
has answer: http://stackoverflow.com/a/29044476

http://stackoverflow.com/a/28968895
type: Answer
answers question: http://stackoverflow.com/q/28967957
has body: I found the short answer (but it does not address the larger security issues, and doesn't completely solve my problem). Add the '$location' dependency, then do this: $location.path() So, this: console.log(":) " + $location.path()); console.log(":( " + window.location.pathname); outputs this: :) myapp.com/record/497/ :( myapp.com/records/ For some reason, it provides the correct URL, even though the angular documentation actually says it is "...based on window.location...". https://docs.angularjs.org/guide/$location Thanks everyone. I will take up the larger security issue with my team.
score: 0

http://stackoverflow.com/comment/46281707
type: Comment
comment on: http://stackoverflow.com/a/29018413
score: 0
type: AnswerComment
has text: @HatemAhmend you solved it! Thank you. But is there a way I could do this with ordinary javascript? Also I am confused then about where these form elements are in the overall DOM? Is it possible to have 2 docs or what's going on? Also if you update your response/answer, I'll select as the answer. Thanks again!

http://stackoverflow.com/comment/46693442
type: Comment
comment on: http://stackoverflow.com/a/28952381
has text: can we give a unique id to the checkboxes created at runtime ?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46281468
comment on: http://stackoverflow.com/q/29018776
has text: Split and compare each?
type: Comment
type: QuestionComment
score: 0

logging
tags question: http://stackoverflow.com/q/28921967
tag name: logging
tags question: http://stackoverflow.com/q/28981303
type: Tag

http://stackoverflow.com/comment/66592602
comment on: http://stackoverflow.com/a/28925479
score: 0
has text: @Grigory You're completely right. I wonder how nobody noticed this.
type: AnswerComment
type: Comment

clientid
tags question: http://stackoverflow.com/q/28950693
type: Tag
tag name: clientid

http://stackoverflow.com/comment/46174152
comment on: http://stackoverflow.com/a/28960576
score: 0
type: Comment
has text: You may add the zero as a comment, e.g.: `my_table[/*0*/1]` (january)
type: AnswerComment

http://stackoverflow.com/comment/46106392
type: QuestionComment
has text: whatsapp has its own api. they use something like this `href="whatsapp://send" data-text="visit our website:"`. Better to research the api of the platforms you want to share to
comment on: http://stackoverflow.com/q/28924907
score: 0
type: Comment

http://stackoverflow.com/q/28994086
favorite count: 0
upvote count: 2
tagged with: css
has answer: http://stackoverflow.com/a/28998113
score: 2
type: AnsweredQuestion
type: Question
tagged with: jstree
has body: I see that jstree 3 put class jstree-leaf for li element of leaf nodes(so it recognize them automatically). How can I configure types plugin to show jstree-icon jstree-file icon for them. is there anything like this for it: 'types' : { 'file' : { 'icon': 'jstree-icon jstree-file' } },
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28998113
downvote count: 0
answer count: 1
has title: how show file-like icon for leaf nodes in jstree 3

http://stackoverflow.com/a/53913811
answers question: http://stackoverflow.com/q/29020722
has comment: http://stackoverflow.com/comment/103066593
has comment: http://stackoverflow.com/comment/132904966
has comment: http://stackoverflow.com/comment/132519832
score: 41
has comment: http://stackoverflow.com/comment/107675161
has comment: http://stackoverflow.com/comment/132895750
has comment: http://stackoverflow.com/comment/103030493
downvote count: 0
has comment: http://stackoverflow.com/comment/107682847
has body: Here's the simplified solution: const recursiveCall = (index) =&gt; { return new Promise((resolve) =&gt; { console.log(index); return resolve(index) }).then(idx =&gt; { if (idx &lt; 3) { return recursiveCall(++idx) } else { return idx } }) } recursiveCall(0).then(() =&gt; console.log('done'));
upvote count: 41
type: Answer

http://stackoverflow.com/q/29025546
has comment: http://stackoverflow.com/comment/46293418
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29026080
tagged with: http://stackoverflow.com/tag/html
score: 0
type: UnansweredQuestion
tagged with: iframe
has body: I am opening an iframe on click of print button and need to close that iframe on click of cancel or print button. On click of cancel or print button iframe getting disappear but still I can see the same iframe in DOM so need to remove the same. Is there any callback event like onclick on print or cancel button in printpreview in javascript??? Thanks in advance.....
has title: Need to close iframe on click of cancel and print button in printpreview dialog

http://stackoverflow.com/q/29015046
tagged with: jquery-mobile
tagged with: javascript
score: 0
tagged with: radio-button
tagged with: jquery
has body: In my jquery mobile app, I add a row to a listview, and the entire row has a click event which changes the page. In the row there is many columns and one of the columns is a checkbox. This is how I initialize it after dynamically adding to the DOM listview. var checkBoxes = $(context).find("#search-table").find(".custom-radio"); checkBoxes.checkboxradio().prop("checked", false).checkboxradio( "refresh" ); checkBoxes.parent().click(function(event) { event.stopPropagation(); //return false; }); The problem is that if I click the checkbox, then it triggers the row click event. I want it so that it does not do that. Whatever I try doesn't work. Results were like if I click the checkbox, it doesn't even change state, but the row click doesn't trigger. Does anyone know how to fix this? Thanks
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: How to stop click propagation when clicking checkbox in jquery mobile?
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/46277362
has comment: http://stackoverflow.com/comment/46281440

http://stackoverflow.com/q/29054312
has body: Anybody know what the first pseudo-property is in my error object on a faulty query? When I console.log('' + error); it grabs the text within the brackets to display. Other than that, I'm not sure how to reference that property. { [error: function XXXXXXXXXX does not exist] name: 'error', length: 226, severity: 'ERROR', code: '42883', detail: undefined, hint: 'No function matches the given name and argument types. You might need to add explicit type casts.', position: '8', internalPosition: undefined, internalQuery: undefined, where: undefined, file: 'parse_func.c', line: '306', routine: 'ParseFuncOrColumn' }
tagged with: postgresql
type: UnansweredQuestion
tagged with: node.js
has title: First 'property' of node-postgres error object
type: Question
tagged with: javascript
tagged with: node-postgres
has answer: http://stackoverflow.com/a/29858325
score: 0
answer count: 1

http://stackoverflow.com/comment/46115520
has text: @Myut can you provide a bit more your code?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28929025
score: 0

http://stackoverflow.com/q/29028813
has comment: http://stackoverflow.com/comment/85465288
downvote count: 0
has title: Throw multiple exceptions in JavaScript
favorite count: 0
has answer: http://stackoverflow.com/a/53269891
tagged with: exception
type: UnansweredQuestion
score: 11
answer count: 4
upvote count: 11
has body: I'm wondering if there is a way to throw multiple errors and catch all of them in JavaScript. I'm looking for specific fields, and when I find a missing one I would like to throw an error. The problem is that if I throw a single error, like: throw "you are missing field: " xxxxxx I'm not telling the user all of the other fields which he/she is missing. I would also not like to combine everything into a single string, since the error message might be too long. Any ideas? Thanks.
tagged with: error-handling
has answer: http://stackoverflow.com/a/75537099
type: Question
has comment: http://stackoverflow.com/comment/46299283
has answer: http://stackoverflow.com/a/53124951
tagged with: javascript
has comment: http://stackoverflow.com/comment/46299116
has answer: http://stackoverflow.com/a/29028846

http://stackoverflow.com/comment/46191053
type: QuestionComment
comment on: http://stackoverflow.com/q/28969592
score: 0
has text: dont give same id to element first fix that.
type: Comment

http://stackoverflow.com/q/28960828
type: Question
has body: (Sorry for my aplogize, I got some mistake, just updated the new code again.) I have the following code，and Chome throws"Uncaught TypeError: Cannot read property 'style' of null" to the console： function gen_mainTable(){ var code = ""; code +=' '; code +=' SELECT AA BB '; code +=' TYPE_AA: '; code +=' TYPE_BB: $("mainTable").style.display = ""; $("mainTable").innerHTML = code;} js part: function change_mode(){ var mode = get_checked_value(get_by_name("type_group")); if (mode == "0"){ get_by_id("aa_field").style.display = ""; get_by_id("bb_field").style.display = "none"; get_by_id("type_bb").disabled = true; get_by_id("type_aa").disabled = false; }else{ get_by_id("aa_field").style.display = "none"; get_by_id("bb_field").style.display = ""; get_by_id("type_aa").disabled = true; get_by_id("type_bb").disabled = false; } } Update the "get_by_id" function: function get_by_id(id){ with(document){ return getElementById(id); } } I'll appreciate if anybody can help, thx :-)
answer count: 1
has comment: http://stackoverflow.com/comment/46173868
tagged with: javascript
has comment: http://stackoverflow.com/comment/46174199
score: 0
has comment: http://stackoverflow.com/comment/46175927
accepted answer: http://stackoverflow.com/a/28961509
has comment: http://stackoverflow.com/comment/46173866
has title: JS: Cannot read property 'style' of null
has comment: http://stackoverflow.com/comment/46174806
has answer: http://stackoverflow.com/a/28961509
tagged with: styles
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46174444
has comment: http://stackoverflow.com/comment/46173871

http://stackoverflow.com/q/28976963
has comment: http://stackoverflow.com/comment/46238571
tagged with: ajax
score: 2
linked to: http://stackoverflow.com/q/15005500
tagged with: curl
favorite count: 0
has body: I'm trying to mimic this curl command to an ajax call. curl -H 'X-Auth-Id' 'someid' http://someurl.com/api/posts I've tried using $.ajax({ url: 'http://someurl.com/api/posts', type: 'get', headers: { 'X-User-Id': userId }, success: function(data) { console.log(data); } }); But I seem to be getting an Invalid status code error, which I do not get when using curl from bash.
answer count: 0
type: Question
upvote count: 2
has title: Mimic Curl Headers in Ajax
downvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/a/28909340
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28909303
score: 1
answers question: http://stackoverflow.com/q/28909303
has body: There is no sKey property, if you want to use a variable containing a property name, you have to use bracket notation teamCountsJson[index][sKey]
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46077969
type: Answer

http://stackoverflow.com/comment/46241365
comment on: http://stackoverflow.com/q/28996517
type: Comment
score: 0
type: QuestionComment
has text: @somethinghere , using it as a textarea was from a previous solution I had found on how to recognize a multiline textbox in jquery. I'm open to other suggestions though.

http://stackoverflow.com/q/29044497
has answer: http://stackoverflow.com/a/29044651
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46328768
score: 1
accepted answer: http://stackoverflow.com/a/29044651
upvote count: 1
has title: How do i change the value of an input with javascript
type: Question
has comment: http://stackoverflow.com/comment/46328962
tagged with: javascript
has body: JSFIDDLE I am having trouble letting a user enter their name into a text box and when they click continue it changes another input value for testing reeaons its a textbox but when I put it in my website when its working the input it will be changing will be a hidden value current javascript function enterUsername(){ document.getElementById("ign").value = 'test'; };
has comment: http://stackoverflow.com/comment/46328939
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0

http://stackoverflow.com/q/28948461
tagged with: d3.js
tagged with: choropleth
type: AnsweredQuestion
has body: I'm trying to display an SVG of alabama's counties taken from Wikipedia. For some reason the paths seperating out the counties aren't displaying, just the red fill for the Autauga county. I'm using the following code to display the SVG. I've already tried setting stroke="black" stroke-width="5px" fill="yellow" on individual path elements to see if they would appear but without any success. Any idea what I need to do to make it display properly? SVG Test
accepted answer: http://stackoverflow.com/a/28948787
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46151160
has title: SVG path not displaying
score: 0
has comment: http://stackoverflow.com/comment/46151398
answer count: 1
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/28948787

http://stackoverflow.com/comment/46266666
score: 0
type: AnswerComment
has text: Tested, it seems to work sometimes but if I insist, clicking fast on the NEXT button, I still get through.
type: Comment
comment on: http://stackoverflow.com/a/29010624

http://stackoverflow.com/a/29028750
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/29028459
downvote count: 0
has body: The trick is to start the loading icon immediately when the page is unloaded. Then when the new page is loaded, the loading icon must be shown immediately again, only then when the new page is fully loaded the icon can be hidden. // Show the icon immediatly when the script is called. $('#loading').show(); // show the icon when the page is unloaded $(window).on('beforeunload', function(event) { $('#loading').show(); }); // hide the icon when the page is fully loaded $(window).on('load', function(event) { $('#loading').hide(); });
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29028459

http://stackoverflow.com/a/29101364
answers question: http://stackoverflow.com/q/29014463
score: 0
type: Answer
has body: Which platform for cordova are you testing on ? Tried on android and seems to work fine. On a side note HERE does provide a SDK of their which might be more optimal for mobile devices. Documentation is available on the following link https://developer.here.com/documentation

http://stackoverflow.com/comment/46561324
comment on: http://stackoverflow.com/q/28920050
score: 0
type: QuestionComment
has text: A single string could consist of multiple `[user=]` tags with some wrapped in `[nocode]`s unfortunately.
type: Comment

http://stackoverflow.com/comment/46302624
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29030021
type: Comment
has text: @gpopoteur http://stackoverflow.com/questions/11520116/calling-coffescript-super-methods

http://stackoverflow.com/comment/46209580
comment on: http://stackoverflow.com/q/28979519
type: Comment
type: QuestionComment
score: 0
has text: not necessarily, they just get instantiate so i can call the `methodOnHide` methods

http://stackoverflow.com/comment/46073832
type: Comment
has text: You are welcome! Because WebStorage values are strings, to store objects and arrays we use JSON.stringify to get a string and then save it.
type: AnswerComment
comment on: http://stackoverflow.com/a/28907114
score: 0

http://stackoverflow.com/a/28947287
has comment: http://stackoverflow.com/comment/46148626
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46148996
has comment: http://stackoverflow.com/comment/46149252
accepted answer of: http://stackoverflow.com/q/28947106
has body: its looks like you are requesting an array with no objects from your server. try this in your html code: {{client}}
type: Answer
answers question: http://stackoverflow.com/q/28947106
upvote count: 1
has comment: http://stackoverflow.com/comment/46149045
has comment: http://stackoverflow.com/comment/46148540
has comment: http://stackoverflow.com/comment/46148807
score: 1
has comment: http://stackoverflow.com/comment/46148905

http://stackoverflow.com/q/28973118
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28973392
score: 0
possible better answer: http://stackoverflow.com/a/28973564
answer count: 2
has answer: http://stackoverflow.com/a/28973564
tagged with: javascript
has body: I'm trying to figure out how to get the second slash or page of a website using the document.referrer javascript for example the website is www.mysite.com/page1/subpage/subpage2/ I only need to get www.mysite.com/page1/ var url = document.referrer; var referrer = url.match(/:\/\/(.[^/]+)/)[1]; this only gets me the domain. I need the second page. Any help would be great. Thanks
has title: Getting Parent URL using document.referrer
accepted answer: http://stackoverflow.com/a/28973392
tagged with: regex

http://stackoverflow.com/q/28990268
has answer: http://stackoverflow.com/a/28990372
upvote count: 0
has title: jquery how to select the next element after the current element
has comment: http://stackoverflow.com/comment/46228955
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28991194
answer count: 3
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28991360
downvote count: 1
has comment: http://stackoverflow.com/comment/46230427
has body: needs to be selected How can I select, using jquery, only the first div inside the main div? Or How can I select, using jquery, only the first div after ? I tried doing this but didn't work: $('#main ul').next('div:first').addClass('my_class');
score: -1
type: Question

http://stackoverflow.com/q/28978103
type: Question
has body: async.eachSeries(nameArr, function(val, callback) { http.get('http://www.google.com/s?wd=' + val, function(response) { var stack = ''; response.on('data', function(chunk) { stack += chunk; }); response.on('end', function(err) { if (err) { console.log(err); } var $ = cheerio.load(stack); var googleUrl = $('#1 .t').find('a').eq(0).attr('href'); http.get(googleUrl, function(res) { collection.update({ name: val }, { $set: { job_url: res.headers.location } }, function(err, result) { callback(); }); }) }); }) }, function() { console.log('done'); }) As u can see nameArr is an array contains about 3000 data. first step, I request to get an googleurl. second setp,I use that googleurl to get some data to store in my mongoDB. but after every 5 request it will hold a few minutes to continue. how to solve this? Or is there any better way to achieve my goal? Plz help!!!
tagged with: javascript
tagged with: web-crawler
tagged with: mongodb
upvote count: 1
has title: I write a cralwer in nodejs,it contains 2 http requests in a big loop,i use async but why it will hold a few minutes after send 5 requests?
tagged with: asynchronous
favorite count: 0
tagged with: node.js
answer count: 0
downvote count: 0
type: UnansweredQuestion
score: 1

http://stackoverflow.com/comment/46252963
type: AnswerComment
comment on: http://stackoverflow.com/a/29001761
type: Comment
score: 1
has text: Thank you so much! I have been working on this for days, much learned!

http://stackoverflow.com/a/29042771
score: 1
has comment: http://stackoverflow.com/comment/46326042
has body: If you want to keep calling the icons from an array like the way you currently are, you can use something like this. However, like @lwalden said, you don't need to use an array. function icon(){ var img = new Array(); img[0] = {img: "img/icon1.gif"}; var icon = img[0]; for(var i=0; i &lt; 30; i++){ document.getElementById("answer").innerHTML += i+1 + ' ' + icon + '&lt;br /&gt;'; } } function icon2(){ var img = new Array(); img[0] = {img: "img/icon1.gif"}; img[1] = {img: "img/icon2.gif"}; for(var i=0; i &lt; 30; i++){ if(i % 2 == 0) icon = img[0]; else icon = img[1]; document.getElementById("answer").innerHTML += i+1 + ' ' + icon + '&lt;br /&gt;'; } } // Prints the specified icon 30 times icon(); // Alternates icon 1 and 2 30 times icon2(); The output will also display which increment you're on. The second function is fairly similar except it just checks whether the current increment is even or odd with the modulus(%) operator. It will print icon 1 on the first increment (starting at 0) and icon 2 on the second increment and alternate respectively.
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/46326322
accepted answer of: http://stackoverflow.com/q/29042443
downvote count: 0
answers question: http://stackoverflow.com/q/29042443

http://stackoverflow.com/q/28936867
tagged with: javascript
type: AnsweredQuestion
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46128802
has comment: http://stackoverflow.com/comment/46128832
tagged with: object
possible better answer: http://stackoverflow.com/a/28936904
has answer: http://stackoverflow.com/a/28936904
score: 0
has answer: http://stackoverflow.com/a/28936903
has body: I know, that not every browser will output object items in the order they were added when you loop through. But if I loop through an object a second time, can I be sure, that it will output the items in the same order as before, keeping in mind, that it must not be in the order as they were added?
tagged with: loops
accepted answer: http://stackoverflow.com/a/28936903
has title: Javascript object multiple loop, same order?

http://stackoverflow.com/q/28988887
type: UnansweredQuestion
downvote count: 1
tagged with: internet-explorer-8
score: -1
linked to: http://stackoverflow.com/q/22073479
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: Basically my bootstrap navbar is missing from IE 8 and below, it's collapsed so to speak. From what I have gather this should fix it: <!--[if lt IE 9]> <![endif]--> Yet nothing happens. Get Access is denied on respond.js line in IE8 emulator! If anything I need some guidance.
favorite count: 0
has title: Script5: access is denied ie8. Using IE8 emulator in IE11
has answer: http://stackoverflow.com/a/29013170
tagged with: twitter-bootstrap

http://stackoverflow.com/q/28930557
has answer: http://stackoverflow.com/a/28943035
accepted answer: http://stackoverflow.com/a/28943035
upvote count: 3
has body: My code is here on codepen I am trying to count the characters and wrap those that exceed a certain limit in a &lt;span&gt; which I've styled as red. The code mostly works with the exception of the function that moves the caret to the end, on Firefox the ranges I create there lose all their whitespaces so that 'abcd abcd' becomes 'abcdabcd' Here is the code for the function: function placeCaretAtEnd(el) { el.focus(); if (typeof window.getSelection != "undefined" &amp;&amp; typeof document.createRange != "undefined") { // Modern browsers var range = document.createRange(); range.selectNodeContents(el); range.collapse(false); var sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(range); } else if (typeof document.body.createTextRange != "undefined") { // IE var textRange = document.body.createTextRange(); textRange.moveToElementText(el); textRange.collapse(false); textRange.select(); } } Has anybody faced this before and found a solution ?
favorite count: 0
tagged with: range
tagged with: css
type: AnsweredQuestion
score: 3
has title: Javascript range loses whitespace on Firefox?
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29030731
answer count: 1
tagged with: javascript
tagged with: jasmine
favorite count: 0
has body: Very new to Javascript TDD, and working with Jasmine at the moment. I have a problem comparing two objects. The function I am testing is being assigned an object as passed as a define ( I'm using require ) - define( ['jquery', 'src/frameManager'], function($,FrameManager){ return { // OBJECTS frameManager : FrameManager, .... } And here's my test: define(['init', '../../../src/frameManager'], function (init, frameManager) { ... it("Init to contain property frameManager with type frameManager", function() { console.log(init.frameManager) console.log(frameManager) expect(init.frameManager).toEqual(jasmine.any(frameManager)); }); .... }); The two console logs show me exactly the same objects, but I am getting this error: TypeError: Expecting a function in instanceof check, but got #&lt;Object&gt; I have also tried the above without the jasmine.any: expect(init.frameManager).toEqual(frameManager); But still no joy. I get the following error in this case: Error: Expected Object({ iframe: ({ context: HTMLNode, selector: '#preview-frame' }), frameContents: false, parent: false, templateBody: false, parsedTemplate: false, services: Object({ url: false, type: false, data: false, dataType: false, callback: false, call: Function, set: Function, ajaxService: Function, isEmpty: Function }), init: Function, setOptions: Function, parseIframe: Function, registerEvents: Function, getParsedTemplate: Function, populateIframe: Function }) to equal Object({ iframe: ({ context: HTMLNode, selector: '#preview-frame' }), frameContents: false, parent: false, templateBody: false, parsedTemplate: false, services: Object({ url: false, type: false, data: false, dataType: false, callback: false, call: Function, set: Function, ajaxService: Function, isEmpty: Function }), init: Function, setOptions: Function, parseIframe: Function, registerEvents: Function, getParsedTemplate: Function, populateIframe: Function }). As you can see, both objects are exactly the same... Does anyone have any suggestions…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46303742
upvote count: 1
has answer: http://stackoverflow.com/a/36509870
downvote count: 1
tagged with: unit-testing
type: Question
has comment: http://stackoverflow.com/comment/46303289
has title: Javascript tests - How to compare two objects in Jasmine
tagged with: tdd
score: 0

http://stackoverflow.com/comment/76013687
type: AnswerComment
comment on: http://stackoverflow.com/a/32970148
type: Comment
has text: Thank you so much, I've been searching for a solution for a week now!, I want to say that this will not work if you have `letterRendering:true`, remove it and this will work :D
score: 0

http://stackoverflow.com/comment/46340085
type: QuestionComment
type: Comment
has text: Create a $scope variable for it and set it there. `$scope.date = new Date();` You can then use a date filter to specify the format - https://docs.angularjs.org/api/ng/filter/date
comment on: http://stackoverflow.com/q/29050996
score: 0

http://stackoverflow.com/comment/46206930
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28977602
type: AnswerComment
has text: This will return the value for any parameter **ending** in `query`, such as `xquery`, which is probably not a good thing.

http://stackoverflow.com/comment/46076426
type: QuestionComment
has text: instead of `Page.GetType()` it should be `typeof(Page)` I think
score: 1
comment on: http://stackoverflow.com/q/28908376
type: Comment

http://stackoverflow.com/comment/46105843
score: 0
type: AnswerComment
type: Comment
has text: How can I build with underscore a single object like this : `myobject = {"iPad" : 0,"iPhone3": 0,"iPhone6" :0 ,"iPad Mini" :0, "Galaxy S6": 0,"Galaxy S4" :0, "BlackBerry3" : 0}`
comment on: http://stackoverflow.com/a/28924571

http://stackoverflow.com/q/28973269
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/542938
tagged with: momentjs
has answer: http://stackoverflow.com/a/28973316
score: 0
type: Question
has comment: http://stackoverflow.com/comment/46197849
has body: I am trying set up a booking page where the user can pick a arrival date and and departure date and then have a function calculate the number of nights a person is staying. I am having a vary hard time doing this. At the moment I am using moment js and pikaday to get the users input, but then can I just get the number of days they are staying and subtract one or is this logic flawed? and is there a simple way of finding the number of days?
tagged with: javascript
answer count: 1
has title: finding the number of nights between two dates with js
tagged with: angularjs

http://stackoverflow.com/comment/46226805
type: Comment
has text: The div send to the link even if there's another link in a element, so it's not working :/
comment on: http://stackoverflow.com/a/28988602
type: AnswerComment
score: 0

http://stackoverflow.com/a/32826951
answers question: http://stackoverflow.com/q/29034349
has body: Had the same problem. But fixed it :) Idea is to change to the URL, wait a halfsecond and than jump to the anchor. HTML: Links Controller: angular.module('exampleApp').controller('NavbarCtrl', function ($scope, $location, $timeout, $anchorScroll) { $scope.goToAnchor = function(path, anchor){ $location.path('/'); $timeout(function() { $anchorScroll(anchor); }, 500); }; });
score: 0
type: Answer

http://stackoverflow.com/a/28975730
has comment: http://stackoverflow.com/comment/46220864
type: Answer
has comment: http://stackoverflow.com/comment/46293741
has comment: http://stackoverflow.com/comment/46220590
score: 1
has body: In general, you cannot. There is no event that indicates that SOMEWHERE in the system the clipboard was updated. An imperfect solution would be to inject content scripts in all pages and listen to events in them. This will only work for copy/cut of the content of the pages themselves.
has comment: http://stackoverflow.com/comment/46300500
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28964764
answers question: http://stackoverflow.com/q/28964764

http://stackoverflow.com/comment/46294325
has text: I'm sorry. I completely forgot to do so. Here's a link to the current header: http://thoseleftbehind.jcink.net/index.php?act=idx
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29026062

http://stackoverflow.com/comment/46153490
comment on: http://stackoverflow.com/q/28949178
score: 0
type: QuestionComment
has text: @idbehold , I'm thinking you would need to actually create and return a new Promise explicitly (assuming using Bluebird here), and manually call call the resolve/rejects. I'll see if I can get a gist to explain it better. The other option is to probably rewrite Superagent to be Promise based.
type: Comment

http://stackoverflow.com/q/29018435
tagged with: closures
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46280914
downvote count: 0
has answer: http://stackoverflow.com/a/32633094
tagged with: javascript
tagged with: ajax
tagged with: iife
has title: function inside of IIFE not recognized
has answer: http://stackoverflow.com/a/29018646
favorite count: 0
has comment: http://stackoverflow.com/comment/46281250
upvote count: 2
has comment: http://stackoverflow.com/comment/46280958
has body: I have an IIFE that I am trying to make into a bookmarklet. I would like to have the modal the bookmarklet will pop up have some buttons that will call a function. However, when I have a structure like this: (function(){ var __myFn = function(str){ //also have tried function __myFn(){..} alert(str); } //some AJAX that builds HTML with the `result`s document.getElementById("resultDiv").innerHTML = "test }()); I get Uncaught ReferenceError: __myFn is not defined How can I make this function recognized? Is there another way?
type: UnansweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/46281423

http://stackoverflow.com/a/29020675
answers question: http://stackoverflow.com/q/29019092
upvote count: 2
type: AcceptedAnswer
has body: After some puzzling, I found a way to get it done using an aggregate pipeline. Here is the result: db.games.aggregate([{ $project: { isHome: { $literal: [true, false] }, home: true, away: true } }, { $unwind: '$isHome' }, { $group: { _id: { $cond: { if: '$isHome', then: '$home', else: '$away' } }, totalGames: { $sum: 1 } } } ]); As you can see it consists of three stages. The first two are meant to duplicate each document into one for the home team and one for the away team. To do this, the project stage first creates a new isHome field on each document containing a true and a false value, which the unwind stage then splits into separate documents containing either the true or the false value. Then in the group phase, we let the isHome field decide whether to group on the home or the away field. It would be nicer if we could create a team field in the project step, containing the array [$home, $away], but mongo only supports adding array literals here, hence the workaround.
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29019092

http://stackoverflow.com/a/29135764
has body: You can use this plugin: https://github.com/carhartl/jquery-cookie And make something like this: $(document).ready(function(){ var url = window.location.href; var rnd = url.split('rnd=')[1]; var cookie = $.cookie("rnd"); var newRnd = Math.round(Math.random() * 100000); $.cookie("rnd", newRnd); if(rnd == cookie || !cookie) { window.location.href = 'http://www.website.com/?rnd=' + newRnd; } }); This is just a quick draft, i haven't test it but should be close, hope this helps you.
score: 0
has comment: http://stackoverflow.com/comment/80038388
answers question: http://stackoverflow.com/q/28986159
type: Answer

http://stackoverflow.com/q/28943691
possible better answer: http://stackoverflow.com/a/28943898
has title: Jquery loaded image not reacting on class
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28943790
score: 0
has comment: http://stackoverflow.com/comment/46141685
has answer: http://stackoverflow.com/a/28943898
has comment: http://stackoverflow.com/comment/46141667
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28943790
has body: In a html page I load manual 3 images in a div. By jquery I load all images from a dir in the same div. By clicking on the image the manual added react on the class and insert them self in a textbox (a contenteditable div) The jquery added will not react at all. All code of the images is the same.(f12) I guess it's something with time of load. but can anybody help me with this. My code (script) &lt;script&gt; $(function () { loadicon('#mydiv', "../images/ico", "25px", "25px"); $('.InsertEmo').click(function () { var img = " &lt;img src=\"" + $(this).attr('src') + "\" width=\"" + $(this).attr('width') + "\" height=\"" + $(this).attr('height') + "\" /&gt; "; $('#divMessage').html($('#divMessage').html() + " " + img + " "); }); }); function loadicon(tab, dir, imgWidth, imgHeight) { var fileextension = [".gif", ".png", ".jpg", ".ico"]; var filename; $.ajax({ //This will retrieve the contents of the folder if the folder is configured as 'browsable' url: dir, success: function (data) { //Lsit all png file names in the page $(data).find("a:contains(" + (fileextension[0]) + "), a:contains(" + (fileextension[1]) + "), a:contains(" + (fileextension[2]) + "), a:contains(" + (fileextension[3]) + ")").each(function () { filename = this.href.replace(window.location.host, "").replace("http:///", ""); $(tab).append($("&lt;img type='image' src=" + "../" + filename + " width=\"" + imgWidth + "\" height=\"" + imgHeight + "\" class='InsertEmo' /&gt;")); }); } }); } &lt;/script&gt; Mycode HTML &lt;div class="messageBar" style="min-height: 30px; width:800px;"&gt; &lt;div id="divMessage" contenteditable="true" class="textbox single-line" style="float:left; border: 1px solid black; width: 300px "&gt;&lt;/div&gt; &lt;/div&gt; &lt;br/&gt; &lt;div id="mydiv"&gt; &lt;img type="image" src="../Images/checkmark.ico" width="25px" height="25px" class="InsertEmo" /&gt; &lt;img type="image" src="../Images/folder.ico" width="25px" height="25px" class="InsertEmo" /&gt; &lt;img type="image" src="../Imag…

function
tags question: http://stackoverflow.com/q/29014908
tags question: http://stackoverflow.com/q/28955828
tags question: http://stackoverflow.com/q/28943618
tag name: function
tags question: http://stackoverflow.com/q/29035913
tags question: http://stackoverflow.com/q/29000451
tags question: http://stackoverflow.com/q/29019173
tags question: http://stackoverflow.com/q/29038874
tags question: http://stackoverflow.com/q/28912744
tags question: http://stackoverflow.com/q/28978108
tags question: http://stackoverflow.com/q/29038543
tags question: http://stackoverflow.com/q/28934016
tags question: http://stackoverflow.com/q/29020100
tags question: http://stackoverflow.com/q/28918093
tags question: http://stackoverflow.com/q/28968752
tags question: http://stackoverflow.com/q/28950578
tags question: http://stackoverflow.com/q/28931983
tags question: http://stackoverflow.com/q/29048354
tags question: http://stackoverflow.com/q/29007736
tags question: http://stackoverflow.com/q/29039094
tags question: http://stackoverflow.com/q/29047619
tags question: http://stackoverflow.com/q/28953045
tags question: http://stackoverflow.com/q/28932647
tags question: http://stackoverflow.com/q/28932072
tags question: http://stackoverflow.com/q/28940738
tags question: http://stackoverflow.com/q/29042810
tags question: http://stackoverflow.com/q/29023436
type: Tag
tags question: http://stackoverflow.com/q/29024476
tags question: http://stackoverflow.com/q/29044264
tags question: http://stackoverflow.com/q/28924429
tags question: http://stackoverflow.com/q/28961013
tags question: http://stackoverflow.com/q/29024536
tags question: http://stackoverflow.com/q/29051011
tags question: http://stackoverflow.com/q/28934477
tags question: http://stackoverflow.com/q/29041036
tags question: http://stackoverflow.com/q/28975328
tags question: http://stackoverflow.com/q/28947357
tags question: http://stackoverflow.com/q/28994260
tags question: http://stackoverflow.com/q/28950051
tags question: http://stackoverflow.com/q/28918435
tags question: http://stackoverflow.com/q/29019079
tags question: http://stackoverflow.com/q/28963562
tags question: http://stackoverflow.com/q/29044427
tags question: http://stackoverflow.com/q/28929326
tags question: http://stackoverflow.com/q/28949335
tags question: http://stackoverflow.com/q/28914561
tags question: http://stackoverflow.com/q/28958155
tags question: http://stackoverflow.com/q/28994842
tags question: http://stackoverflow.com/q/29004728
tags question: http://stackoverflow.com/q/28992764

http://stackoverflow.com/q/29049761
answer count: 2
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29050502
has answer: http://stackoverflow.com/a/29050502
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29050031
type: AnsweredQuestion
has title: Changing background image - javascript
has body: I would like to change a background image with JavaScript. JS: &lt;head&gt; &lt;script type="text/javascript"&gt; // Ta funkcja odpowiedzialna jest odpowiedzialna za zmiane obrazow w tle $(window).load(function(){ var i = 0; var images = ['images/1.jpg','images/2.jpg','images/3.jpg','images/4.jpg','images/5.jpg']; var image = $('#slideit'); image.css('background-image', 'url(images/1.jpg)'); image.css('background-size', 'cover'); setInterval(function(){ image.css('background-image', 'url(' + images [i++] +')'); // image.fadeOut(1500, function (){ // image.fadeIn(1000); // }) if(i == images.length) i = 0; }, 6000); }); &lt;/script&gt; &lt;/head&gt; HTML: &lt;body id="slideit" style="width:100%;height:100%;"&gt; The problem is in making the images change smoothly. The commented out code makes everything in the website fade in and fade out except the background. Why is this happening? This code works but does not change the image smoothly. How can I fade the images in and out?
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29050031
score: 0

http://stackoverflow.com/q/28975035
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/46202586
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: opacity of figcaption is mysteriously changing
has body: I am trying to use jquery.caption (https://github.com/louisbros/jquery.caption). I want the caption to be in a black rectangle with white text. When I mouse over my images, some of them display the caption correctly, but others don't display it at all, and others display it very lightly and hard to see. As I mouse over the images, some that were displaying it stop displaying it. If I look at the HTML I can see that the opacity changes and that is why the caption are sometimes not visible. When I first bring up the page, most of the elements have opacity=1, but others will have a very small number like 0.00301952217705548. As I mouse around, elements that started with opacity=1 will change to a very small number. Here is my code that creates the elements: $image_div = $('&lt;div /&gt;') .addClass('gImage-row') .appendTo($preview); $image_div.append($('&lt;a /&gt;') .addClass('no-highlight') .attr('href', "{{ IMAGE_DIR }}"+image.image.replace(/thumbnail/,'jpg')) .attr('rel', "superbox[image]") .append($('&lt;img /&gt;') .addClass('gImage') .attr('alt', 'some text') .attr('src', "{{ IMAGE_DIR }}"+image.image) .attr('onerror', "noimage(event)"))); This is in a loop and it creates 30-40 images. In my window.onload function I do this: $('.gImage-row img').caption(); Here is my CSS: .figure{ position:relative; margin:0; padding:0; } .figcaption{ position:absolute; left:0; bottom:0; width:100%; height:20px; background-color: black; foreground-color: white; opacity:1.0; } a:hover.no-highlight { background: transparent; } .gImage-row { float: left; text-align: center; } .gImage { width: 150px; height: 100px; margin-right: 1px; background-color: transparent; } .label { float: left; } I cannot figure out what is making the opacity change or how to fix this. Anyone have any ideas?
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29049346
score: 0

http://stackoverflow.com/q/29040499
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/32566859
has body: Have a problem. Have this code: response = bytearray(unichr(int(code)), 'UTF-8') It returns byte array from code, where code = int Need similar code for javascript. I've tried: var arr = new Uint8Array(1); arr[0]=(+code).toString(16); Tried var arr = new Uint8Array(1); arr[0]=String.fromCharCode(code); Could you help me? Thanks a lot.
tagged with: python
has comment: http://stackoverflow.com/comment/46325420
has comment: http://stackoverflow.com/comment/46321669
type: Question
has comment: http://stackoverflow.com/comment/46325385
tagged with: javascript
has title: Python and Javascript
score: 0
tagged with: arrays
answer count: 1

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/28948361
tags question: http://stackoverflow.com/q/29036164
tags question: http://stackoverflow.com/q/29049077
tags question: http://stackoverflow.com/q/28998586
type: Tag
tags question: http://stackoverflow.com/q/28993157

http://stackoverflow.com/comment/46351947
comment on: http://stackoverflow.com/a/29057552
score: 0
type: AnswerComment
type: Comment
has text: You need tp address the wrongly assigned event handler too. Your fiddle - is event available in all browsers?

http://stackoverflow.com/comment/46189566
type: QuestionComment
comment on: http://stackoverflow.com/q/28968987
score: 3
has text: Even if it's a string doesn't mean that it's valid JSON. The main lesson here is that you should *never* build JSON by hand. If you have to generate JSON in JavaScript, use `JSON.stringify()`.
type: Comment

http://stackoverflow.com/a/30339707
has comment: http://stackoverflow.com/comment/49074930
answers question: http://stackoverflow.com/q/29058368
has comment: http://stackoverflow.com/comment/49075634
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/49075720
has body: Thanks for sharing the code. I seem to have got it working with 3.3! :) I don't get the error you get. Try adding debug code at the beginning: after ini_set('display_errors', 'On'); I found that full day absence wasn't showing so I edited the code by removing the comment at line 137: } else // echo "full abs "; return "absence_full"; not sure why I had to leave in semicolon though - thus: } else ; return "absence_full";

http://stackoverflow.com/comment/46168878
type: Comment
score: 1
type: AnswerComment
has text: Thanks for the response. But I need the selected object. I mean I need ``{'id': 3, 'name': 'Service 3'}`` not just 3. How do i do that ?. Btw I did read documentation, but its not a easy syntax to understand, more example will help.
comment on: http://stackoverflow.com/a/28958017

http://stackoverflow.com/comment/46098931
comment on: http://stackoverflow.com/a/28920765
score: 0
type: Comment
has text: He was missing parenthesis "(" and ")", not brackets "[" or "]" :)
type: AnswerComment

http://stackoverflow.com/q/29007997
has comment: http://stackoverflow.com/comment/46261810
has body: I have an assignment to make a program that can calculate the area beneath a graph in a certain area. My function is f(x)=3+(tan(x))^2 I have turned this into javascript so it looks like this: var y = 3 + Math.pow(Math.tan((x)*(180/Math.PI)), 2) This is giving the right result at certain x-values. But sometimes, eg. at x = 3.4, it gives a strange number like 16 where I expected something around 3 or 4. I have read that it can be caused by the problem with floating point behavior, but it should not give that big a difference? I don't understand it. :( I use a for loop to change the x value and and array to store the values.
type: UnansweredQuestion
downvote count: 0
score: 1
tagged with: math
has title: JavaScript math gives completely wrong results
tagged with: floating-point
type: Question
has comment: http://stackoverflow.com/comment/46261406
has comment: http://stackoverflow.com/comment/46261960
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: floating-accuracy
favorite count: 0
has answer: http://stackoverflow.com/a/29015244

http://stackoverflow.com/comment/46089359
type: Comment
has text: doctype i added simple, just ignore that.
comment on: http://stackoverflow.com/a/28914355
type: AnswerComment
score: 0

http://stackoverflow.com/a/28945030
has comment: http://stackoverflow.com/comment/46175100
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28943450
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28943450
type: Answer
has body: In the first example you create APP object and define the public methods to this object. It doesn't necessary pollute the global namespace, since all members are wrapped inside APP but in my view it pollutes the APP context itself (more logic - more public functions for each). I don't know how big is the project going to be, but the second example gives you bigger robustness. It allows you to define private methods inside each "sub object". Still, all layers of MVC should be separated and communicate using notifications. You could create a module for each, since it's quite common that particular parts of MVC consists of more sub-mechanisms, for example for Model it could be observers which check for changes in data and invoke refresh to view var Model = (function(){ var data = []; var Observer = function(){ // some internal definition.. this.queue = []; }; var getData = function(){ // some logic here return data; }; var addData = function(object){ data.push(object); } return { addData: addData, getData: getData, getObserver: new Observer(); } })(); Similarlly with View which handles the presentation layer and expose a refresh functionality. var Views = (function(){ // whatever.. var parts = []; var refresh = function(){ for (var i = 0; i &lt; parts.length; i++){ // render view.. } } return { refresh: refresh } })(); ..and Controller which would be just a "bridge" between model and controller. Alternativelly, as your project grows, you could introduce a namespaces and perhaps some AMD framework to handle larger amounts of JS files. As I said, depends how big is your project really going to be..what should it be capable of etc. It all depends. Hope it helps you a bit.

webbrowser-control
type: Tag
tags question: http://stackoverflow.com/q/28963167
tag name: webbrowser-control

http://stackoverflow.com/q/29053209
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29053636
favorite count: 0
tagged with: angularjs
has title: AngularJS binding only updating after change
score: 2
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/29053636
type: Question
tagged with: firebase
tagged with: javascript
has body: Hi I have created a factory to get the current amount of users online from my Firebase database. When I first load the page it works great and displays all the current users but then if I go to another page and come back it will display as 0 until a new user connects or disconnects or if I refresh. I followed this guide: http://www.ng-newsletter.com/advent2013/#!/day/9 App.js angular.module('myApp', ['ngRoute', 'firebase', 'ui.bootstrap']) .factory('PresenceService', ['$rootScope', function($rootScope) { var onlineUsers = 0; // Create our references var listRef = new Firebase('https://my-db.firebaseio.com/presence/'); // This creates a unique reference for each user var onlineUserRef = listRef.push(); var presenceRef = new Firebase('https://my-db.firebaseio.com/.info/connected'); // Add ourselves to presence list when online. presenceRef.on('value', function(snap) { if (snap.val()) { onlineUserRef.set(true); // Remove ourselves when we disconnect. onlineUserRef.onDisconnect().remove(); } }); // Get the user count and notify the application listRef.on('value', function(snap) { onlineUsers = snap.numChildren(); $rootScope.$broadcast('onOnlineUser'); }); var getOnlineUserCount = function() { return onlineUsers; } return { getOnlineUserCount: getOnlineUserCount } } ]); mainController.js angular.module('myApp') .controller('mainController', function($scope, authService, PresenceService, $http, $routeParams, $firebaseObject, $firebaseAuth, $location) { $scope.totalViewers = 0; $scope.$on('onOnlineUser', function() { $scope.$apply(function() { $scope.totalViewers = PresenceService.getOnlineUserCount(); }); }); // login section and auth var ref = new Firebase("https://my-db.firebaseio.com"); $scope.authObj = $firebaseAuth(ref); var authData = $scope.authObj.$getAuth(); if (authData) { console.log("Logged in as:", authData.uid); $location.path( "/user/"+authData.uid ); } else { console.log("Logged out"); $location.path( "/" ); } // user ref var userRef = new Firebase("https:…

http://stackoverflow.com/comment/46255152
has text: @Barmar : No. I havent used any preventDefault in my JS.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29004077

http://stackoverflow.com/q/29047182
score: 1
has body: I am having trouble animating a spritesheet using css every example i see contain a sprite sheet with only 1 line of sprite or 1 column like this : and they animate it using the keyframes @keyframes play { 100% { background-position: -1900px; } } but for me the spritesheet is a grid with 10x8 Is their anyway to achieve an animation using css for this particular spritesheet ? or i should use HTML5 canvas instead ? Every frame is 90x96 px this is my image
has answer: http://stackoverflow.com/a/29047568
favorite count: 0
has comment: http://stackoverflow.com/comment/46333231
type: Question
answer count: 2
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29047769
has comment: http://stackoverflow.com/comment/46333087
has title: Animating a spritesheet using css
upvote count: 1
has comment: http://stackoverflow.com/comment/46333043
has comment: http://stackoverflow.com/comment/46335059
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29047769
linked to: http://stackoverflow.com/q/22571983
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/29047568

time
tags question: http://stackoverflow.com/q/28949911
tags question: http://stackoverflow.com/q/28907256
tags question: http://stackoverflow.com/q/28952550
tag name: time
tags question: http://stackoverflow.com/q/29041555
tags question: http://stackoverflow.com/q/28986280
tags question: http://stackoverflow.com/q/29016223
tags question: http://stackoverflow.com/q/28979959
tags question: http://stackoverflow.com/q/28917387
type: Tag
tags question: http://stackoverflow.com/q/28979928

http://stackoverflow.com/comment/46174173
has text: Thanks Fokke I will try that out.
comment on: http://stackoverflow.com/a/28958807
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46122145
has text: that's too much to read, simplify it down to the smallest part of the code that still reproduces the problem. and format the php.
type: QuestionComment
comment on: http://stackoverflow.com/q/28932702
type: Comment
score: 1

http://stackoverflow.com/q/28954124
tagged with: javascript
has title: how to access popup's cookie in chrome extension development?
linked to: http://stackoverflow.com/q/1439377
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/28955629
tagged with: google-chrome-extension
favorite count: 0
has body: I need to post some data to a django server using popup's js.because of the csrf, I should post data with csrftoken in cookie, how can i get the the value in the cookie. I have tried the following ways which do not work: document.cookie chrome.cookies.get({url: "chrome-extension://igmgfjnbghncmhbobdpjblokohejackc", name: "csrftoken"}, function(cookie){}) request infomation: Request Method:POST Status Code:403 FORBIDDEN Request Headersview source Accept:*/* Accept-Encoding:gzip, deflate Accept-Language:zh-CN,zh;q=0.8 Connection:keep-alive Content-Length:3 Content-Type:application/x-www-form-urlencoded; charset=UTF-8 Cookie:csrftoken=V6OTh2NdwnomqLbkfh24qRwT8C0kESIV Host:127.0.0.1:8000 Origin:chrome-extension://igmgfjnbghncmhbobdpjblokohejackc User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4 X-CSRFToken:null
type: UnansweredQuestion
tagged with: django
score: 2
downvote count: 0
tagged with: cookies
tagged with: google-chrome
type: Question
has answer: http://stackoverflow.com/a/30506867

twilio
tag name: twilio
tags question: http://stackoverflow.com/q/29054679
type: Tag

http://stackoverflow.com/comment/46355787
has text: It needs to be `$.getJSON('/Search/GetMatchingResults', ..` (leading slash). You should always use `'@Url.Action("GetMatchingResults", "YourControllerName")'` to generate the correct url
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29059719
type: QuestionComment

http://stackoverflow.com/comment/46333888
type: Comment
type: QuestionComment
has text: Isn't it `echo "PHP a= " . $_GET["a"] . " b= " . $_GET["b"];`?
score: 0
comment on: http://stackoverflow.com/q/29047611

http://stackoverflow.com/comment/46140012
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28922780
type: Comment
has text: To get the rotated position you have to do some trigonometry to determine the radius: `var radius = (offset.left - xCenter) / Math.cos(degreesToRadians(19));` I've updated the jsfiddle above. To revert, take the weight out of the rotated div and put it back in it's original parent. You can do something similar for dragging, or only allow dragging within the rotated area.

http://stackoverflow.com/q/29030766
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46302790
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46302628
tagged with: css
has body: After I updated my sources codes, my carousel doesn't work anymore. The images that I click, supposedly open with images slider (Carousel), but now open a new link to new image. Included all stylesheets Included all javascripts There is not errors in my javascript file. Below is my configuration toward owl-carousel... /* screenshot slider */ var owl = $("#owl-carousel-works"); owl.owlCarousel({ itemsCustom: [ [0,1], [900,2], [1800,3], [2700,4], [3600,5], [4500,6] ], navigation: false }); // Nivo Lightbox $('#screenshots a').nivoLightbox({ effect: 'fadeScale' }); // team carousel var owl = $("#owl-carousel-team"); owl.owlCarousel({ itemsCustom: [ [0,1], [900,2], [1800,3], [2700,4], [3600,5], [4500,6] ], navigation: false });
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/46302614
has comment: http://stackoverflow.com/comment/46302778
has title: Owl carousel doesn't work

http://stackoverflow.com/a/29026836
has body: Rather than using the 'Style.Visibility' attribute, I suggest you to use 'Style.display' attribute to hide/display buttons as mentioned by @balaG previously. This is because, the button once you set as, Style.Visibility=false; you will not be able to find it again in DOM by using, document.getElementByID('some_id'); Hope this helps!!
answers question: http://stackoverflow.com/q/29026515
score: 0
has comment: http://stackoverflow.com/comment/46296954
type: Answer
has comment: http://stackoverflow.com/comment/46297023

http://stackoverflow.com/comment/46251595
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29000683
has text: Added functionality to let a user gain external promise fulfillment from queued promises.
score: 0

http://stackoverflow.com/comment/46262245
comment on: http://stackoverflow.com/a/29006514
type: AnswerComment
score: 0
type: Comment
has text: By the way jqGrid 4.7.1 is not more free for commercial usage. I posted recently **free jqGrid 4.8** [here](https://github.com/free-jqgrid/jqGrid), see [wiki](https://github.com/free-jqgrid/jqGrid/wiki). You can try it later after you will find the main reason of the current problem.

http://stackoverflow.com/comment/66587748
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28925479
has text: @ArtjomB. in your example `if (typeof window.callPhantom == "Function") {` suppose to be `if (typeof window.callPhantom === "function") {`, so lower case "function".

http://stackoverflow.com/q/28969243
tagged with: arrays
tagged with: javascript
tagged with: sorting
has answer: http://stackoverflow.com/a/28969553
has comment: http://stackoverflow.com/comment/46190243
accepted answer: http://stackoverflow.com/a/28969553
has comment: http://stackoverflow.com/comment/46190874
has title: Rearranging javascript array / object
favorite count: 0
possible better answer: http://stackoverflow.com/a/28969459
has comment: http://stackoverflow.com/comment/46190122
type: AnsweredQuestion
tagged with: object
upvote count: 0
has comment: http://stackoverflow.com/comment/46190219
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46190384
has body: I'm trying to re-arrange: [ {"Appointment":"6","Converted":"0","Lead":"9","Qualified":"0","Dead":"0"}, {"Appointment":"1","Converted":"0","Lead":"1","Qualified":"0","Dead":"0"}, {"Appointment":"1","Converted":"0","Lead":"0","Qualified":"0","Dead":"0"} ] To: [ {"name":"Appointment", "data":[6,1,1]}, {"name":"Converted", "data":[0,0,0]}, {"name":"Lead", "data":[9,1,0]}, {"name":"Qualified", "data":[0,0,0]}, {"name":"Dead", "data":[0,0,0]} ] I've managed to get the 5 array's with the correct name in, by doing for(var prop in obj) loop, but I'm wondering how to achieve converting the data part. Wishful thinking perhaps, but is there an easier way than looping within loops!? The solution would have to be dynamic... there could be 3 arrays like in my example or more or less. The number of properties will always by 5 however, as is in the example.
type: Question
answer count: 2
downvote count: 2
has answer: http://stackoverflow.com/a/28969459
score: -2

http://stackoverflow.com/comment/46231416
type: Comment
type: QuestionComment
has text: @BillyW did you try my answer? if you are taking out only script then do not forget to add id to you controls.
score: 0
comment on: http://stackoverflow.com/q/28988114

object-literal
tag name: object-literal
tags question: http://stackoverflow.com/q/29056147
type: Tag

http://stackoverflow.com/q/28992650
has comment: http://stackoverflow.com/comment/46234692
has comment: http://stackoverflow.com/comment/46233997
has comment: http://stackoverflow.com/comment/46234772
has comment: http://stackoverflow.com/comment/46234151
has comment: http://stackoverflow.com/comment/46233464
favorite count: 0
tagged with: angularjs
has title: Success callback in $http promise isn't happening
upvote count: 2
has comment: http://stackoverflow.com/comment/46234563
has body: I'm doing an angular app that consumes a RESTful API. I'm handling the authentication of the user this way: // in services.js app.factory('authService', ['$http', '$q', 'localStorageService', function ($http, $q, localStorageService) { var login = function (loginData) { var data = "grant_type=something&amp;username=" + loginData.userName + "&amp;password=" + loginData.password; var deferred = $q.defer(); $http.post(serviceBase + 'token', data). success(function (response) { localStorageService.set('authorizationData', { token: response.access_token }); localStorageService.set('personaData', { username: response.username }); deferred.resolve(response); }). error(function(err, status) { deferred.reject(err); }); return deferred.promise; }; And the controller // controller.js app.controller('LoginCtrl', ['$scope', '$state', 'authService', function ($scope, $state, authService) { $scope.loginData = { userName: '', password: '' }; $scope.alert = {type: '',msg: ''}; $scope.login = function () { authService.login($scope.loginData). then(function (response) { $state.go('index'); // when the service verify that the auth data is correct, the controller redirects to the principal state }, function (err) { $scope.alert = { type: 'danger', msg: 'non' }; }); }; } ]); The problem is when the user sends the correct auth info (meaning username and password), the service does not go through the .success callback when the response is 200 OK. And yes, this behaviour is only expected when the response isn't 200 OK. The exact response of the resource is: HTTP/1.1 200 OK Cache-Control: no-cache Pragma: no-cache Content-Length: 851 Content-Type: application/json;charset=UTF-8 Expires: -1 Server: Microsoft-IIS/8.5 X-Powered-By: ASP.NET Date: Wed, 11 Mar 2015 16:20:12 GMT {"access_token":"...","token_type":"...","expires_in":"...","username":"...","role":"...","display_name":"..."} What's happening here? How can I solve this? Thanks.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46234252
has comment: http://stackoverflow.com/comment/46233620
has answer: http://stackoverflow.com/a/28993736
score: 1
has comment: http://stackoverflow.com/comment/46234582
has comment: http://stackoverflow.com/comment/46233746
has comment: http://stackoverflow.com/comment/46234191
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46233639
answer count: 1
has comment: http://stackoverflow.com/comment/46234247
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28993736

http://stackoverflow.com/a/28920637
downvote count: 0
answers question: http://stackoverflow.com/q/28919529
has comment: http://stackoverflow.com/comment/46098771
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46098937
type: Answer
has body: Here's a JSFiddle with your solution: http://jsfiddle.net/ee2todev/z73u6mro/ I called the nested dataset arrayOfDatasets so the changes become more clear. First you have to call stack() for each of the datasets: arrayOfDatasets.forEach(function (dataset) {stack(dataset); }); Then you have to retrieve the max for xScale: var xScale = d3.scale.linear() .domain([0, d3.max(arrayOfDatasets, function (dataset) { return d3.max(dataset, function (d) { return d3.max(d, function (d) { return d.y0 + d.y; }); }) })]) .range([0, w]); Finally, you just have to access the data properly and translate the datasets so they don't overlap: var groupOfGroups = svg.selectAll("g.toplevel") .data(arrayOfDatasets) .enter() .append("g") .attr("class", "toplevel") .attr("transform", function(d, i ) {return "translate(0, " + (-i * 55) + ")"; }); // Add a group for each row of data var groups = groupOfGroups.selectAll("g.dataset") .data(function(d) {return d; }) .enter() .append("g") .attr("class", "dataset") .style("fill", function (d, i) { return color(i); }); You might still store your datasets differently since it's not clear why you have the x values in them.
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46098829
accepted answer of: http://stackoverflow.com/q/28919529

http://stackoverflow.com/comment/46206217
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28977223
type: Comment
has text: PSL, why would you use = here instead of &? Seems like that sets up an unnecessary watch.

http://stackoverflow.com/comment/46233419
type: Comment
comment on: http://stackoverflow.com/q/28990869
score: 0
type: QuestionComment
has text: well it says 'failed to load ressource' in the console. maybe your svg is in another folder? what does your .svg file look like?

http://stackoverflow.com/comment/46260483
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29006917
has text: ok @briosheje but i really appreciate the good idea on `keystroke`
score: 0

http://stackoverflow.com/comment/46231507
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28988563
has text: Thanks for the answer! It doesn't seem to be working for me though. It is a simple multiple choice question with one option presented on the left and one on the right.

http://stackoverflow.com/comment/46220026
type: Comment
type: QuestionComment
has text: There are no errors in your code. http://jsfiddle.net/DvtMC/57/
comment on: http://stackoverflow.com/q/28985656
score: 0

http://stackoverflow.com/comment/46159555
comment on: http://stackoverflow.com/a/28952144
score: 0
type: AnswerComment
type: Comment
has text: This is a great answer, however im not sure it will quite fit what i need - Every item i have on the page is it's own separate module, and the provider i have the maybe about 50 different things to listen to. So with this I would have to set a listener for each one individually. The root idea is exactly what I am looking for, however im trying to set it to be kind of a "black box" that will decide where to send it when it comes in. So if there are 40 objects in the url and 3 change, it would know to send out. to those 3 controllers in individual modules, hence the first callback idea

http://stackoverflow.com/comment/46258177
type: QuestionComment
type: Comment
score: 0
has text: @empiric hide(100) . this will work only if jquery-ui added to page
comment on: http://stackoverflow.com/q/29005798

http://stackoverflow.com/comment/46342230
comment on: http://stackoverflow.com/q/29050092
type: Comment
type: QuestionComment
has text: duplicate of http://stackoverflow.com/questions/28547970/typescript-require-with-type-checking ?
score: 0

http://stackoverflow.com/a/28980350
has body: Please check that you injected ngResource module as a dependency to your application, i.e. var app=angular.module("myApp", ["ngResource"]);
answers question: http://stackoverflow.com/q/28980310
upvote count: 0
type: Answer
downvote count: 1
score: -1

http://stackoverflow.com/q/28999354
has answer: http://stackoverflow.com/a/28999407
has body: Example HTML: TEXT 1 TEXT 2 TEXT 3 When onclick TEXT 1, TEXT 2, TEXT 3 then I want to replace link1 with linkother1, link2 with linkother2, link3 with linkother3. How can I do that in jquery javascript? (sorry my english is very bad) SOLUTION: Thank's Jony-Y, $('a[href="link1"]').attr("href", "linkother1") $('a[href="link2"]').attr("href", "linkother2") $('a[href="link3"]').attr("href", "linkother3")
has answer: http://stackoverflow.com/a/28999435
accepted answer: http://stackoverflow.com/a/28999435
type: Question
tagged with: javascript
tagged with: jquery
has title: how to replace a href link in text using jquery
linked to: http://stackoverflow.com/q/179713
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28999445
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28999407
type: AnsweredQuestion

http://stackoverflow.com/comment/46247877
comment on: http://stackoverflow.com/q/28999878
type: Comment
type: QuestionComment
has text: @ChaosClown sure! Post with updated with "old" and "new" body of html
score: 0

http://stackoverflow.com/comment/46102182
has text: the hash is tied to the name of the list (left hand). Right side corresponds with the left side. I want to be able to share the lists that are made. Does that answer you?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28922470

http://stackoverflow.com/comment/46092059
has text: @Pointy I don't think so because i'm using the callback function, wait a minute, I'll check it again
type: QuestionComment
comment on: http://stackoverflow.com/q/28917038
type: Comment
score: 0

http://stackoverflow.com/q/29010664
upvote count: 1
has comment: http://stackoverflow.com/comment/46266335
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46266412
answer count: 1
downvote count: 0
has body: In what scenario do we need to implement Singleton Class in javascript as below var Singleton = (function () { var instance; function createInstance() { var object = new Object("I am the instance"); return object; } return { getInstance: function () { if (!instance) { instance = createInstance(); } return instance; } }; })(); function run() { var instance1 = Singleton.getInstance(); var instance2 = Singleton.getInstance(); alert("Same instance? " + (instance1 === instance2)); }
has answer: http://stackoverflow.com/a/29010884
has title: In what situation do we need to implement singleton class in javsacript
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/228164
score: 1
duplicate of: http://stackoverflow.com/q/228164

http://stackoverflow.com/comment/46273117
has text: Strategy 2 is not possible in this case as the UI needs to update with each response for perceived performance reasons. I will try out item 1 though and see how it works out. Thanks!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29014021
type: Comment

http://stackoverflow.com/comment/46295564
type: Comment
type: QuestionComment
has text: Well, only safari iPad has this issue. Other browsers do not have this problem so far on ipad.
comment on: http://stackoverflow.com/q/29000589
score: 0

http://stackoverflow.com/comment/46136567
type: Comment
type: QuestionComment
score: 1
has text: The **calls** are synchronous, but the functions can be **asynchronous**, e.g. if `first()` is async, `second()` **could** be completed first. If `first()` is synchronous, than `second()` executes **after** `first()` is completed.
comment on: http://stackoverflow.com/q/28941020

http://stackoverflow.com/comment/46248673
score: 3
comment on: http://stackoverflow.com/q/29000451
type: Comment
type: QuestionComment
has text: Make the function return a value, then you can call it and assign the result to different variables. This is basic programming technology.

http://stackoverflow.com/comment/46162376
has text: Why would you want both MQs and Javascript to detect the breakpoint for tablet?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28954292

http://stackoverflow.com/a/29031884
has comment: http://stackoverflow.com/comment/46306168
score: 1
has body: As you are using paragraph so you would see the error on the next line EITHER do not use the para or put them in table to avoid formatting effort like this : Firstname: ! ; and so on..
has comment: http://stackoverflow.com/comment/46306387
upvote count: 1
answers question: http://stackoverflow.com/q/29031827
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29031827
has comment: http://stackoverflow.com/comment/46306226
type: Answer
downvote count: 0

http://stackoverflow.com/a/28931235
score: 0
answers question: http://stackoverflow.com/q/28931092
has body: If you were to allocate each array at each index in a breadth-first pattern before accessing any of it, then this would work without any special handling. However, as you've correctly recognized, if you want to be able to access indexes that may not have been allocated yet, this won't work. Actually, to be more specific, you are allowed to attempt to read an index outside the length of an array, in which case you'll get undefined. The problem is that if you get undefined for the first or second depth, then an attempt to index that undefined value will fail. Thus, to prevent this error, you must guard against undefined first- or second-depth indexes. The best way to do this is to write a class that provides a getter and setter that automatically take care of the special handling requirements. Here's an example of such a class, defined using the prototype pattern: (function() { var Array3D = function() { this.data = []; }; Array3D.prototype.get = function(r,c,z) { if (this.data.length &lt;= r) return undefined; if (this.data[r].length &lt;= c) return undefined; return this.data[r][c][z]; }; Array3D.prototype.set = function(r,c,z,v) { if (this.data.length &lt;= r) this.data[r] = []; if (this.data[r].length &lt;= c) this.data[r][c] = []; this.data[r][c][z] = v; return this; }; window.Array3D = Array3D; })(); var a = new Array3D(); alert(a.get(0,0,0)); // undefined, no error a.set(0,0,0,'x'); alert(a.get(0,0,0)); // 'x' a.set(234,1234,342,'y'); alert(a.get(234,1234,342)); // 'y' alert(a.get(0,1,0)); // undefined, no error alert(a.get(12341234,243787,234234)); // undefined, no error
type: Answer

http://stackoverflow.com/q/29003462
type: AnsweredQuestion
has title: Find all input of td inside a TR in jquery
upvote count: 2
accepted answer: http://stackoverflow.com/a/29003485
type: Question
has comment: http://stackoverflow.com/comment/46253762
has body: How we can find all the inputs of a td inside a tr in jquery. I have tr that will have multiple td in that td i have inputs and select so i want to get the values of the input types Code : $('div#divid tbody.tbodyClass tr.trClass').each(function() { $(this td).find("input:text,select").each(function() { textVal = this.value; inputName = $(this).attr("name"); formData+='&amp;'+inputName+'='+textVal; }); InsideCount++ }); I am trying to use this td's with each but i am not able to get the values and name of the inputs.
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29003485
possible better answer: http://stackoverflow.com/a/29003500
answer count: 3
has answer: http://stackoverflow.com/a/29003500
has answer: http://stackoverflow.com/a/29003521
score: 2

http://stackoverflow.com/q/29007400
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46260424
tagged with: javascript
has body: We are using DataTables which is a plug-in for the jQuery Javascript library... > https://datatables.net/ "...it is a highly flexible tool, based upon the foundations of progressive enhancement, and will add advanced interaction controls to any HTML table..." To populate the tables we are pulling data from a JSON file. Here's my question and hopefully you guys can offer a possible solution....why is it that the data when called is NOT visible in the Source Code? It just isn't there yet the data and the tables are populated? The problem with this is that when the table has been populated with several rows it hides behind my footer - which I am sure is a result of the data not being parsed like 'normal' Any idea how I can force the data produced by this Jquery plugin to be written and parsed normally? Thanks for all pointers and things to look for since I am basically totally new to this...
score: 0
has comment: http://stackoverflow.com/comment/46260432
answer count: 1
has title: Why is there no mark-up yet data is visible (using JSON)
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/46261145
has answer: http://stackoverflow.com/a/29008019
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
upvote count: 1

http://stackoverflow.com/q/29012888
tagged with: extjs5
has answer: http://stackoverflow.com/a/50141575
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/46272908
tagged with: extjs4
has comment: http://stackoverflow.com/comment/46276432
accepted answer: http://stackoverflow.com/a/29414650
has comment: http://stackoverflow.com/comment/46314486
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11782856
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46271722
has title: ExtJS 5 - Download file from POST servlet request
has body: I have trying to implement the export functionality in ExtJS 5 using form submit method. And I had look at the following stackoverflow link, it helps but not fully. Extjs 4 (with a code for 3.4 below) downloading a file returned from a post request In my case i facing an issue after the request response is successful, getting invalid JSON encoding error.Even i tried to change the reader from JSON reader to some other string reader(mentioned in link), but it is quite successful for some reason. http://www.sencha.com/forum/showthread.php?86704-handling-xml-response-on-form-submit Code:- var form = Ext.create('Ext.form.Panel',{ timeout: 60000 }); var basicForm = form.getForm(); basicForm.errorReader= new String(); basicForm.submit({ url : GRID_EXPORT_URL, method : 'POST', headers : { "USER": user, "SERVERSESSIONID": serverSessionId, "Content-Type":"application/x-www-form-urlencoded" }, params : { gridId:"dummyGrid", colDescs:"col1,Name" }, scope : this, success : function(responseText){ }, target: '_blank' }); Error Message:- [E] Ext.JSON.decode(): You're trying to decode an invalid JSON String: Code Output response from Java servlet(CSV):- Id,Name 13092,Thiru 12767,Arasu 117,Vinod I think because of this encoding issue,even after the request returns 200 success status; the browser download window is not getting poped up! You help is much appreciated, thanks in advance! I have modified the code something like below, but still the browser download is not happening event though the response is 200. Modified code with Iframe/Form:- onClickExport : function(){ var body = Ext.getBody(); var downloadFrame = body.createChild({ tag: 'iframe', cls: 'x-hidden', id: 'app-upload-frame', name: 'uploadframe' }); var downloadForm = body.createChild({ tag: 'form', cls: 'x-hidden', id: 'app-upload-form', target: 'app-upload-frame' }); Ext.Ajax.request ({ url : EXPORT_URL, method : 'POST', form : downloadForm, timeout : 30 * 60 * 1000, // 30 Minutes should be OK. scope : this, headers :…
downvote count: 0
has answer: http://stackoverflow.com/a/29414650
tagged with: javascript
has answer: http://stackoverflow.com/a/29020512
tagged with: ria
tagged with: extjs
answer count: 3
has comment: http://stackoverflow.com/comment/46271919
has comment: http://stackoverflow.com/comment/46317729
possible better answer: http://stackoverflow.com/a/29020512

http://stackoverflow.com/comment/46293865
type: Comment
type: QuestionComment
score: 0
has text: try text-shadow:none;
comment on: http://stackoverflow.com/q/29025789

http://stackoverflow.com/a/28915020
score: 0
type: Answer
has body: You could have a js code inject this into the dom where it is required and they can add it by placing a script tag. &lt;script src="feedback-form.js"&gt;&lt;/script&gt; and the feedback form would inject the html content.
answers question: http://stackoverflow.com/q/28914914

http://stackoverflow.com/comment/46147063
comment on: http://stackoverflow.com/a/28946078
has text: boot2docker is the recommended way for OS X. Since you are using docker containers, you do not need to have the same environment on the dev machine and on production (where you run the containers). Ubuntu or whatever will be inside the containers. So if you run the same nginx container on ubuntu and for example red hat, it would be the same system inside the container. That's kind of the point of containers.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46199386
has text: Edited with one possible solution.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28973815
type: AnswerComment

http://stackoverflow.com/q/28979417
type: Question
has comment: http://stackoverflow.com/comment/46209810
upvote count: 1
tagged with: javascript
favorite count: 0
answer count: 1
has title: Execute code from one textbox and display the output in another textbox in HTML
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28979807
downvote count: 0
score: 1
has body: Having two textbox, in first text box i have to write my JAVASCRIPT code and when i click button, want my output in my second text box. I had used the following method its executing the code but the entire page is getting reload and output is getting displayed. &lt;script&gt; function doIt() { var headID = document.getElementsByTagName("head")[0]; var newScript = document.createElement("script"); newScript.type = "text/javascript"; newScript.innerHTML = document.getElementById("textarea").value; headID.appendChild(newScript); } &lt;/script&gt;

http://stackoverflow.com/a/50727296
answers question: http://stackoverflow.com/q/28915645
score: 1
downvote count: 0
has body: It seems there's no way to catch the problem on instantiation, even though the magical JavaScript black box somehow seems to know the problem occurs on the new WebSocket. To detect this error, use the following: ws = new WebSocket(server); ws.onerror = function (evt) { if (ws.readyState == 3) { //Connection closed. } }
type: Answer
upvote count: 1

orangehrm
tags question: http://stackoverflow.com/q/29058368
type: Tag
tag name: orangehrm

http://stackoverflow.com/comment/46171218
comment on: http://stackoverflow.com/a/28958747
score: 0
type: AnswerComment
has text: Im using this on some wierd buisnessplatform and it already loads jquery, So i dont need to link in that library. Will try the updated code!
type: Comment

http://stackoverflow.com/comment/46356990
type: Comment
comment on: http://stackoverflow.com/q/29058053
score: 0
has text: FYI: Facebook doesn’t allow “like gating” any more. To see if a user is a fan of a specific page, you’d need `user_likes` permission – and Facebook will not grant you usage of that in review for this purpose.
type: QuestionComment

http://stackoverflow.com/comment/46213857
type: Comment
comment on: http://stackoverflow.com/a/28982094
has text: how does it answer the question about the `video`?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46323851
type: AnswerComment
comment on: http://stackoverflow.com/a/29041054
type: Comment
has text: Although this "works", it is hacking into selectmenu plugin. Better to just do $("#database-vendor").selectmenu("enable") or ("disable").
score: 0

http://stackoverflow.com/a/28986495
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28986361
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28986361
type: Answer
has body: thisImgurl = $("#myImgurl")val(); There is a point missing.

http://stackoverflow.com/q/29061278
has comment: http://stackoverflow.com/comment/46359004
tagged with: append
possible better answer: http://stackoverflow.com/a/29061372
has answer: http://stackoverflow.com/a/29061372
score: 0
accepted answer: http://stackoverflow.com/a/29061368
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46358901
answer count: 2
has title: jQuery append div on click
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29061368
has body: So I'm making this thing in jQuery where if the user clicks a button a div appears and asks the user to enter some notes(basically a sticky note feature). The HTML and CSS are done correctly, the only problem is that the jQuery won't work: $(document).ready(function() { $("#top-tabs ul li").hover(function() { $(this).find("ul>li").stop().fadeToggle(400); }); $("#submitpnote").on("click", function() { $("body").append(" confirm note "); $("#pnote-prompt").fadeTo(100, 1); }); $("#confirmpnote").on("click", function() { var $pnotetitle = document.getElementById("input-pnote").value; var $pnotep = document.getElementById("input-pnote-p").value; $("#pnotes-list").append(" " + $pnotetitle + " " + $pnotep + " "); $("#pnoteprompt").remove(); }); }); The js jQuery file is linked properly. It's just that in the submitpnote function(the second on), the div doesn't append. I click the button and nothing appears on my screen. I've tried putting some prompt() debuggers and the method is running but the div doesn't seem to be appending. Does anyone know why this is happening? Thanks!
has comment: http://stackoverflow.com/comment/46358816
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28996103
type: Question
linked to: http://stackoverflow.com/q/29016656
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46248294
score: 0
tagged with: element
has comment: http://stackoverflow.com/comment/46241835
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Fixed placed element within certain area
has answer: http://stackoverflow.com/a/29000405
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46242878
has comment: http://stackoverflow.com/comment/46242037
has comment: http://stackoverflow.com/comment/46240462
tagged with: fixed
has body: I have a page where I display a long list of results from a DB query.. and I also show a Google Map to the RIGHT of this long list. Map is roughly 240px wide and maybe 600px long/height. This MAP is inside a container DIV (#mapContainer).. that contains the map, and a dropdown box above the map canvas. Currently, the mapContainer scrolls along with the page itself.. what I would like to do is have it be static/fixed element. So it starts/displays/is placed where I have it currently on the page.... if I scroll the page.. the map should stay fixed.. until the end (bottom) of the results are scrolled to.. (I dont want the mapContainer to scroll and cover the footer element/div) Following this tutorial: http://www.webgeekly.com/tutorials/jquery/a-simple-guide-to-making-a-div-static-as-you-scroll-past-it/ It doesnt stay fixed.. //sticky map placement $(function () { var msie6 = $.browser == 'msie' && $.browser.version < 7; if (!msie6) { console.log("NOT IE 6"); var top = $('#mapContainer').offset().top; $(window).scroll(function (event) { console.log("scrolling......."); var y = $(this).scrollTop(); if (y >= top) { $('#mapContainer').addClass('fixed'); console.log("class added"); }else { $('#mapContainer').removeClass('fixed'); console.log("class removed"); } }); } }); The first console.log() outputs fine.. but nothign in the window.scroll() portion fires ever. Rest of code used: #mapContainer{ display:table; width:240px; float:right; /* sticky map */ position: absolute; top: 458px; left: 50%; /* width: 100px; */ margin-left: 339px; } #mapContainer.fixed { position: fixed; } On the tutorials page itself.. he has a toolbar on the left side.. that stops 'being fixed' when you scroll all the way to the top.. (it will start to move with the rest of the page scroll at a certain point).. and it doesnt go all the way down to cover the footer either. I'm not clear why the jQuery portion isnt firing.. and I'm not clear what that last style is for? (seems odd looking) All this abs…
has comment: http://stackoverflow.com/comment/46242776
has comment: http://stackoverflow.com/comment/46241643

http://stackoverflow.com/q/29005855
tagged with: javascript
answer count: 1
tagged with: email
downvote count: 0
has comment: http://stackoverflow.com/comment/46259638
favorite count: 0
accepted answer: http://stackoverflow.com/a/36306672
tagged with: letters
linked to: http://stackoverflow.com/q/5796718
type: AnsweredQuestion
has body: I sometimes have to send emails in a German and I need to use ö ä ß etc... I have text written containing these letter and using alert() they appear just fine. I have code to send an email : var link = "mailto:" + SendTo + "&amp;cc= " + "&amp;subject=" + escape(subjectLine) + "&amp;body=" + escape(BodyText); window.location.href = link; When I click a button to send the email, the text is missing these foreign letters e.g gruß comes out as gru. Do I need to put anything in here to make sure these letter don't disappear? Thank you in advance
score: 1
upvote count: 1
linked to: http://stackoverflow.com/q/10715801
has comment: http://stackoverflow.com/comment/46257918
has title: Foreign letters failing when sending emails
type: Question
has answer: http://stackoverflow.com/a/36306672

datepicker
tags question: http://stackoverflow.com/q/29004806
tags question: http://stackoverflow.com/q/28938628
tags question: http://stackoverflow.com/q/29051378
tags question: http://stackoverflow.com/q/28991147
tags question: http://stackoverflow.com/q/29011828
tags question: http://stackoverflow.com/q/28984542
tag name: datepicker
tags question: http://stackoverflow.com/q/28929081
type: Tag
tags question: http://stackoverflow.com/q/29030385
tags question: http://stackoverflow.com/q/28969541
tags question: http://stackoverflow.com/q/28920839
tags question: http://stackoverflow.com/q/28992064
tags question: http://stackoverflow.com/q/29021207
tags question: http://stackoverflow.com/q/28978154
tags question: http://stackoverflow.com/q/28986007

http://stackoverflow.com/comment/46296863
comment on: http://stackoverflow.com/a/29020442
has text: use var Data=$("#formID").serialize(); then send the Data Var through Ajax call , it will do what you want :)
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/28995270
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28997864
tagged with: http://stackoverflow.com/tag/json
score: -1
has title: how to use json on twitter typeahead
type: Question
tagged with: typeahead.js
answer count: 2
has body: I have a json like this: {"num": ["test", "test group event"]} I want to use typeahead.js, but their json is like this: ["Andorra","United Arab Emirates"] How can I use my json for the example below? &lt;script type='text/javascript'&gt;//&lt;![CDATA[ $(window).load(function(){ var countries = new Bloodhound({ datumTokenizer : Bloodhound.tokenizers.obj.whitespace('name'), queryTokenizer : Bloodhound.tokenizers.whitespace, limit : 10, prefetch : { url : 'http://127.0.0.1:8000/mysearch/', filter : function(list) { return $.map(list, function(country){ return { name : country }; }); } } }); countries.initialize(); $('#prefetch .typeahead').typeahead(null, { name : 'countries', displayKey : 'name', source : countries.ttAdapter() }); });//]]&gt; &lt;/script&gt; Update: My json is coming from the server(http://rroyales.webfactional.com/mysearch/1.json) so if possible I think we have to use prefetch to get json from the server. I don't want to use getjson to capture it in a variable or is there an easier way to capture it in a variable? Update 2: what is wrong with my json coming from haystack - created a new question related to this
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28997864
linked to: http://stackoverflow.com/q/29002963
has answer: http://stackoverflow.com/a/28998002
possible better answer: http://stackoverflow.com/a/28998002
downvote count: 2
upvote count: 1

http://stackoverflow.com/comment/46217084
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28983926
has text: @A.Wolff : I do not want to disable the element. I have updated the question containing a sample code

http://stackoverflow.com/a/28933440
downvote count: 0
score: 1
upvote count: 1
type: Answer
has body: I figured it out after hours of research online. Simple and powerful. $(document).ready(function(){ $('div').not('#home').hide(); // show home first $('a').click(function() { var target = $(this).attr('href'); $('div').not(target).hide(); $('div').filter(target).show(); }); }); JSFiddle Solution
answers question: http://stackoverflow.com/q/28932919

http://stackoverflow.com/comment/46157709
type: Comment
has text: Yes, clearly. Which leads to my opinion that it would be nice if the parser automatically set properties to null when 'declared' but not set.
type: AnswerComment
comment on: http://stackoverflow.com/a/28951683
score: 0

http://stackoverflow.com/q/28992199
has comment: http://stackoverflow.com/comment/46240409
has title: How to Enable and Disable Form Controls based on values in selected dropdown list
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46261891
tagged with: asp.net
has comment: http://stackoverflow.com/comment/46261093
has comment: http://stackoverflow.com/comment/46262314
score: 0
has answer: http://stackoverflow.com/a/29020668
has comment: http://stackoverflow.com/comment/46260834
has body: I have 3 drop down list that are dependent on one another. @Html.LabelFor(model => model.StatusId, "StatusId", htmlAttributes: new { @class = "control-label col-md-2" }) @Html.DropDownList("StatusId", null, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StatusId, "", new { @class = "text-danger" }) @Html.LabelFor(model => model.DeclineReasonId, "DeclineReasonId", htmlAttributes: new { @class = "control-label col-md-2" }) @Html.DropDownList("DeclineReasonId", null, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.DeclineReasonId, "", new { @class = "text-danger" }) @Html.LabelFor(model => model.PendingReasonsId, "PendingReasonsId", htmlAttributes: new { @class = "control-label col-md-2" }) @Html.DropDownList("PendingReasonsId", null, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.PendingReasonsId, "", new { @class = "text-danger" }) The values that populates in the dropdownlist with the label StatusId is "Pending", "Declined", "Approved". if i choose "Pending", "DeclineReasonId" should be disabled . if i choose "Declined", "PendingReasonsId" should be disabled. if i choose "Approved", Both DeclineReasonId and PendingReasonsId should be disabled. If after choosing any of the three and before submitting i decide to change the StatusId, I want it to be able to adjust such that If i change from Pending to Declined - PendingReasonsId should be disabled and DeclineReasonId should be enabled if i change from Pending to Approved - PendingReasonsId and DeclineReasonsId should be disabled if i change from Declined to Pending - DeclineReasonId should be disabled and PendingReasonsId be enabled if i change form Declined to Approved - Both DeclineReasonId and PendingReasonsId be disabled if i change from Approved to Pending - PendingReasonsId should be enabled and DeclineReasonsId be disabled if i change from Approved to Declined - DeclinedReasonId sho…
has comment: http://stackoverflow.com/comment/46236137
has comment: http://stackoverflow.com/comment/46262673
accepted answer: http://stackoverflow.com/a/29020668
type: AnsweredQuestion
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/46261983
type: Question

http://stackoverflow.com/q/29039983
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/46320642
has comment: http://stackoverflow.com/comment/46320481
possible better answer: http://stackoverflow.com/a/31204260
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/31204260
tagged with: javascript
tagged with: angularjs
has title: AngularJS : Updating scope in ng-repeat
type: Question
tagged with: angularjs-ng-repeat
has comment: http://stackoverflow.com/comment/46321577
has answer: http://stackoverflow.com/a/29040482
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46320769
has comment: http://stackoverflow.com/comment/46320532
has comment: http://stackoverflow.com/comment/46320916
has body: I have an Angular app with several nested controllers and views. I implemented infinite scrolling in it closely based on this tutorial for ngInfiniteScrolling: http://binarymuse.github.io/ngInfiniteScroll/demo_async.html So I have a service that loads items into an array at $scope.content.items. Then there's an ng-repeat element that shows each result. $scope.content = new Content() $scope.content.loadMore( $scope.currentStream, 2 ) // this part is actually called in the HTML, but while debugging I've just done it in the controller Now I want to implement search, and instead of making another search page, just have the items load in place of the current list of items. Basically to take the place of $scope.content.items. So I built an identical controller, but now calling my search API. I use ng-change to see if someone has typed in the search box, then within the function that calls, do $scope.search = function() { $scope.content = new Search() $scope.content.load( $scope.query ) } I can see that this works in the console, that it replaces $scope.content.items, by doing this in the browser console: var scope = angular.element($('[ng-controller=HomeController]')).scope() scope.content.items That shows me the array of objects I expect in each case (either before triggering ng-change="search()" or after). But the page itself does not update. It just shows the stuff from the Content() service. Likewise, if I replace the above two lines from my controller with these below, it shows the content from the Search() service: $scope.content = new Search() $scope.content.load( 'thom' ) Long story short, I feel like the services and API work, but the page is not updating when I change the $scope.content.items array used by ng-repeat. Here is the HTML // ...
accepted answer: http://stackoverflow.com/a/29040482

http://stackoverflow.com/q/28955429
has comment: http://stackoverflow.com/comment/46164287
score: 0
accepted answer: http://stackoverflow.com/a/28955475
linked to: http://stackoverflow.com/q/10000083
has answer: http://stackoverflow.com/a/28955851
duplicate of: http://stackoverflow.com/q/10000083
possible better answer: http://stackoverflow.com/a/28955851
type: AnsweredQuestion
has body: OK I have: JavaScript index Hello I am Sam My main question is with regards to: element.addEventListener( "click", function(color){ this.style.backgroundColor = color; }, false ); Is there a way to dynamically pass in a color or does it have to be hard coded?
has title: JavaScript DOM addeventlistener pass paramater
type: Question
has answer: http://stackoverflow.com/a/28955475
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/46330146
type: QuestionComment
has text: I deleted it already.. Actually, I just copied it in my reference. And when I tried to delete, it doesn't affect the table.. So now, I won't include it in the js.. @NathanTuggy
comment on: http://stackoverflow.com/q/29045352
score: 0
type: Comment

http://stackoverflow.com/q/29030714
linked to: http://stackoverflow.com/q/20798294
tagged with: timing
type: Question
has body: I've got a WebGL scene, and a set of parameters I can use to balance render quality versus speed. I'd like to display the scene to the user in as high as I can make the quality, as long as the frame rate doesn't drop below some threshold due to this. To achieve this, I have to somehow measure “current” frame rate in response to changes in quality. But the scene is static as long as the user doesn't interact with it (like rotating camera using the mouse). I don't want to have a loop re-rendering the same scene all the time even if nothing changes. I want to stop rendering if the scene stops moving. Which means I can't simply average the time between successive frames, since I can't distinguish between the renderer being slow and the user just moving his mouse more slowly. I thought about rendering the scene a number of times at start up, and judge the frame rate from this. But the complexity of the scene might change over time, due to the portion of the scene visible from the current camera position, or due to user interaction outside the canvas. So I have to adapt the quality as the scene changes complexity. Running a calibration loop after every mouse release would perhaps be an option. I also thought about using the finish call instead of the flush call to accurately measure render time. But while I wait for GL to finish rendering, my application will essentially be unresponsive, in particular won't be able to queue mouse events. Since I envision the rendering to ideally take up all the time between two frames at the target threshold frame rate, that would probably be rather bad. I might get away with using finish instead of flush only on some occasions, like after a mouse release. What's the best way to achieve a desired frame rate in a WebGL application, or to measure render time on a regular basis?
has answer: http://stackoverflow.com/a/29043816
tagged with: javascript
has title: Measure render time
downvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46338234
has comment: http://stackoverflow.com/comment/46332328
tagged with: performance
tagged with: frame-rate
score: 1
tagged with: webgl
upvote count: 1

http://stackoverflow.com/comment/46415486
score: 0
type: Comment
has text: awesome boss thanks a lot : ) i never realised sourcemaps was not there : )
comment on: http://stackoverflow.com/a/29080080
type: AnswerComment

http://stackoverflow.com/comment/46239289
score: 0
type: Comment
has text: Thanks for the quick response. By the way, can you recommend me some book/tutorial for something more that "starting with D3"? Some reference with good practices and design patters?
comment on: http://stackoverflow.com/a/28995145
type: AnswerComment

http://stackoverflow.com/comment/70572816
type: Comment
score: 13
has text: This does not work on IE11. It does not support this constructor. I would avoid it unless you know which browsers your users are going to use.
type: AnswerComment
comment on: http://stackoverflow.com/a/28965567

http://stackoverflow.com/a/28946257
has body: You need to append the form to the document before you submit it. $('&lt;form method="post"&gt;&lt;input type="hidden" name="message" value="' + ciphertext + '"&gt;&lt;/form&gt;') .appendTo("body") .submit();
score: 1
accepted answer of: http://stackoverflow.com/q/28946025
answers question: http://stackoverflow.com/q/28946025
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/46158421

http://stackoverflow.com/a/29048802
score: 1
type: AcceptedAnswer
has body: You do not re-declare init it is called twice successively and your original config object gets written over each time when init is called. You could assign all need varibales for init to local variables and check for when they are not passed fallback back on your original defined configuration: init: function(config) { var originalConfig = FX.scrollTop.config; var obj = config.obj ? config.obj : originalConfig.obj; var from = config.from ? config.from : originalConfig.from; var activeClass = config.activeClass ? config.activeClass : originalConfig.activeClass; var scrolledFromtop = $(window).scrollTop(); //console.log(this.config.obj+'=&gt;'+this.config.from); if(scrolledFromtop &gt; from){ obj.addClass('fixed'); setTimeout(function(){ obj.addClass(activeClass); }, 90); }else{ obj.removeClass(activeClass); setTimeout(function(){ obj.removeClass('fixed'); }, 90); } }
has comment: http://stackoverflow.com/comment/46342018
upvote count: 1
answers question: http://stackoverflow.com/q/29048091
accepted answer of: http://stackoverflow.com/q/29048091
type: Answer
downvote count: 0

http://stackoverflow.com/a/29016812
has body: You have to pass as parameter an variable that represents your text. For example: myApp.filter('myfilter',function(){ return function(txt){ return txt = 'a'; } }) :)
score: 0
answers question: http://stackoverflow.com/q/29016596
type: Answer
has comment: http://stackoverflow.com/comment/46278011

http://stackoverflow.com/a/28985880
score: 0
type: Answer
has body: Try This with "keyup".. $("#visit_adults_number").keyup(function(){ var textinput = $('#visit_adults_number').val().substring(0,8); alert("Adult age") }); &lt;input type="number" name="visit_adults_number" id="visit_adults_number" class="form-control"&gt; Demo is Here
answers question: http://stackoverflow.com/q/28985651

http://stackoverflow.com/a/28956057
upvote count: 1
score: 1
downvote count: 0
has body: Regex Replacement Replace with a regex looking for a comma followed by your specific character, and replace them with the special character (e.g., ",:" =&gt; ":"). var x = "This is as,] sent,}encee:. Doo} youu: likei} i,:t."; x = x.replace(/,([\]:}])/g, "$1"); alert(x); String Replacement You could also use the following string replacement method, chaining replacements, but it's important to note that the global replace flag ("g") won't work in v8 JS engine, like Chrome (and I think Safari), so use this method with caution: var x = "This is as,] sent,}encee:. Doo} youu: likei} i,:t."; x = x.replace(',]', ']', "g") .replace(',}', '}', "g") .replace(',:', ':', "g"); alert(x);
answers question: http://stackoverflow.com/q/28955442
type: Answer

http://stackoverflow.com/comment/46139729
type: AnswerComment
comment on: http://stackoverflow.com/a/28942745
type: Comment
has text: Wouldn't `$("#" + key)[0]` have to be `$("#" + key).get(0)`? Also, that would be a problem if you are looking for an element that doesn't exist as the `get` function wouldn't exist for a non-existing jquery object, and the array would be empty as well when the element does not exist.
score: 0

http://stackoverflow.com/a/28959918
type: Answer
has comment: http://stackoverflow.com/comment/46197611
has comment: http://stackoverflow.com/comment/46194786
answers question: http://stackoverflow.com/q/28958663
score: 0
has comment: http://stackoverflow.com/comment/46203154
has comment: http://stackoverflow.com/comment/46176589
has comment: http://stackoverflow.com/comment/46176086
has body: You can solve this issue also using pure CSS3 animations. Though it might not be supported on every platform Here is a working example (quickly hacked together &amp; tested in chrome): html, body { min-width: 400px; min-height: 300px; height: 100%; width: 100%; padding: 0; margin: 0; } .container { position: relative; height: 100%; width: 100%; background: #efefef; overflow: hidden; } .image { background-size: cover; background-repeat: no-repeat; position: absolute; top: 0; left: 0; right: 0; bottom: 0; -webkit-animation-name: zoom; animation-name: zoom; -webkit-animation-duration: 10s; animation-duration: 10s; -webkit-animation-direction: normal; animation-direction: normal; -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; -webkit-animation-fill-mode: forwards; animation-fill-mode: forwards; } .image-1{ background-image: url(http://www.chip.de/ii/917741674_393fa282fa.jpeg); } .image-2{ -webkit-animation-delay: 5s; animation-delay: 5s; background-image: url(http://www.chip.de/ii/917741714_fe3259c85e.jpeg); } @keyframes zoom { 0% {transform: scale(1,1); z-index: 2;} 49% {transform: scale(2,2);} 50% {opacity: 0} } @-webkit-keyframes zoom { 0% {-webkit-transform: scale(1,1); z-index: 2;} 49% {-webkit-transform: scale(2,2);} 50% {opacity: 0} } &lt;div class="container"&gt; &lt;div class="image image-1" style=""&gt;&lt;/div&gt; &lt;div class="image image-2" style=""&gt;&lt;/div&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/46195537

http://stackoverflow.com/comment/46252243
has text: Thank you for your help. I can't get this to work though. I used your code exactly as you said to. Here it is on a live test server. Please take out the spaces in the following domain: hop in it.com
type: AnswerComment
comment on: http://stackoverflow.com/a/29002318
score: 0
type: Comment

http://stackoverflow.com/comment/46148758
type: AnswerComment
comment on: http://stackoverflow.com/a/28943712
type: Comment
has text: I found it out its the onPagerEvent: i posted it on my answer if you wanted to see the function it called
score: 0

http://stackoverflow.com/comment/46240882
type: Comment
has text: Yes I tried that and when I preview the animation in browser it works. But as soon as I place it in Muse as a .oam file its does absolutely nothing.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28995931

http://stackoverflow.com/comment/46184971
has text: @A.Wolff — Keep reading. The contents of that file are described later in the question. It contains the code that depends on jQuery, not jQuery itself.
comment on: http://stackoverflow.com/a/28966694
type: AnswerComment
type: Comment
score: 4

http://stackoverflow.com/comment/46160804
has text: What path does `require.resolve('express')` give you? Does that file resemble [the project's source](https://github.com/strongloop/express/blob/4.12.2/index.js) (adjust the "tag" as needed)?
type: Comment
comment on: http://stackoverflow.com/q/28953359
score: 0
type: QuestionComment

http://stackoverflow.com/comment/46206622
score: 0
type: QuestionComment
type: Comment
has text: Actually I need to edit the question, but thanks for the support so far, I'm on the right path I think
comment on: http://stackoverflow.com/q/28977701

http://stackoverflow.com/comment/46195207
has text: There's a checkbox in the alert window (not in IE though), by checking it you can prevent the alerts from that page untill refreshed.
score: 0
comment on: http://stackoverflow.com/a/28971795
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28941354
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/34254641
tagged with: angularjs
type: UnansweredQuestion
tagged with: node.js
upvote count: 3
has body: I am using AngularJS in a MEAN stack based on DaftMonk’s generator (https://github.com/DaftMonk/generator-angular-fullstack). I am fairly new to pretty much everything Angular/JS/Node (and stackoverflow so please feel free to point out if I need to reword my question!). I am aiming to produce a multipage PDF report for a user from an Angular page that contains six graphs, images and text. There are a number of questions on stackoverflow and Google that relate to potential solutions to this, but having checked these exhaustively, they do not help with what I need to achieve (or I do not understand how I can use them in my scenario..). Currently, when the user navigates to the ‘report page’, an http request is sent to Node/Express from the Angular controller, which checks the user role/group ID, queries the database, anaylses the data and sends it back to the browser for rendering into graphs (currently using angular-chartjs and flot). The user selects graph type and can choose a maximum of six graphs to display from a possible list of 20+. These six graphs are what need to be exported to a PDF report (with other information). I need to make this (within reason) as browser compatible as possible (at least IE8+) although my current solution is IE10+ with PDF export disabled for older browsers using Modernizr. From stackoverflow and Google, possible solutions include using PhantomJS in Node to capture the screen or using a client-side PDF renderer (e.g. jsPDF). Out of these, my feeling is that PhantomJS would provide the most flexibility/browser compatibility. Also, I need to produce several different reports depending on the user role, so having all the code to produce the reports within the browser is not desirable. But I am totally stuck as to how to access ‘what the client sees’ using the MEAN stack. PhantomJS would need to effectively be logged in as the client, and have access to the six choices for graphs that the client has made. From my research, using PhantomJ…
type: Question
tagged with: phantomjs
score: 3
tagged with: javascript
has title: Export a PDF report with charts from Node/Express/Angular/PhantomJS
tagged with: http://stackoverflow.com/tag/pdf
answer count: 1

internet-explorer-11
tags question: http://stackoverflow.com/q/28952920
type: Tag
tags question: http://stackoverflow.com/q/28968841
tag name: internet-explorer-11
tags question: http://stackoverflow.com/q/28980383
tags question: http://stackoverflow.com/q/28909182

http://stackoverflow.com/comment/46191348
type: Comment
has text: I know facebook chat uses it so it is possible I'm just unsure as to how exactly they do it
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28969803

http://stackoverflow.com/q/28912090
has title: passing javascript value into html link
tagged with: javascript
answer count: 1
tagged with: variables
has comment: http://stackoverflow.com/comment/46082851
tagged with: text
type: UnansweredQuestion
score: 0
has body: I assume this is just a beginners issue, I would like to add the value of my variable urlvar1 into a link. However it looks like this is not working. document.write(' Your browser does not seem to handle frames properly, but you can go directly to the survey here')
has answer: http://stackoverflow.com/a/28912193
type: Question

http://stackoverflow.com/q/28920801
accepted answer: http://stackoverflow.com/a/28953904
has comment: http://stackoverflow.com/comment/46099243
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46099081
has comment: http://stackoverflow.com/comment/46099263
tagged with: mysql
upvote count: 1
downvote count: 1
has title: Returning javascript results for use in php
type: Question
has comment: http://stackoverflow.com/comment/46099004
has answer: http://stackoverflow.com/a/28953904
has comment: http://stackoverflow.com/comment/46099340
tagged with: javascript
has body: I have a database that stores clients and employees. The front end for that database uses very old software (coded in vb6 from the late 90s so I can't simply geocode the addresses for insertion upon entry, unless i wanna do some fancy sql work). I am building some more robust reporting software for the data. I want to include google map features in the software that shows where clients and employees live. When a roster of current employees or clients is generated, I also want it to check for new additions and then geocode their addresses into a database table so that I can reference them in later reports. I have no problem with recognizing the new entries or geocoding their locations. The way the php script works is it checks to see if clients have latitude and longitude information populated already, and if not, get the lat/lng, and then insert it into the database. If there are several new clients/employees, i want it to loop through the result set and insert the relative information. The issue is the google api gets the lat/lng via javascript, so I can't pass that information back into the php script to store it into the database, and I don't really want to use javascript to insert it. So i'm wondering the best way to go about this. I have been researching and testing for a couple hours now. I figured I could probably pass the variables through ajax techniques, but isn't that going to cause an issue when doing it in the middle of a loop? Here's some sample code, and I apologize for such a drawn out question! Javascript snippet of geocode: function codeAddress(address) { geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var newlat = results[0].geometry.location.lat(); var newlng = results[0].geometry.location.lng(); alert(results[0].geometry.location); } else { alert('Geocode was not successful for the following reason: ' + status); } }); php snippet: $address = ""; $num = 0; //Google geocode limits…
has comment: http://stackoverflow.com/comment/46099527
score: 0
tagged with: google-maps
answer count: 1
favorite count: 0

http://stackoverflow.com/q/28910321
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28910377
type: Question
has answer: http://stackoverflow.com/a/28910415
accepted answer: http://stackoverflow.com/a/28910415
answer count: 2
tagged with: javascript
tagged with: jquery
has body: I have a form that I have iframe that I have to use from another company that I have no control of changing. My visitors are having a hard time understanding the form, and I want to add instructions, but It is hard cause the form had different "pages" or steps and I want to show a paragraph of instructions for that specific step only. I know it might be a long shot but below is an example of the form and what I want to do. My Content My Content My Content My Content Page 1 questions Page 2 questions Page 3 questions Page 4 questions When I go to the next page, it changes the class of the div so page 2 is not the current page and new content is displayed. I want my divs to ONLY show when the div class is "current-page" for that page.
possible better answer: http://stackoverflow.com/a/28910377
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46079660
has title: Display content if there is a div with a specific class

http://stackoverflow.com/a/28983463
upvote count: 2
has comment: http://stackoverflow.com/comment/46812388
has comment: http://stackoverflow.com/comment/46216721
has body: To answer your first question: You could make a new object called Box that simulates a taken grid-location function Box (row,col) { this.row = row; this.col = col; this.color = "#000000"; } Just declare a variable for your boxes: var boxes = new Array(); and add some boxed to your game: boxes[boxes.length] = new Box(3,5); boxes[boxes.length] = new Box(5,8); Here is how to draw the boxes: for (var b = 0; b &lt; boxes.length; b++) { ctx.fillStyle = boxes[i].color; ctx.fillRect(boxes[b].row*50, boxes[b].col*50, 50, 50); } Whenever the player is moving a box you keep track on which row and column the player is. if the player's is holding the box at x=321, y=48 it would mean row 1 and column 5. In order to check if that grid is free, you can use this function function checkAvailability(playerX, playerY) { var playerRow = playerY%50; var playerCol = playerX%50; var available = true; for (var b = 0; b &lt; boxes.length; b++) { if (playerRow == boxes[i].row &amp;&amp; playerCol == boxes[i].col) { available = false; break; } } return available; } In regards to your second question about the dot. Everything painted on the canvas is painted by you and therefore you should know the location of the dot, just use that information in your code however you want.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46216214
downvote count: 0
has comment: http://stackoverflow.com/comment/46804294
answers question: http://stackoverflow.com/q/28978454
has comment: http://stackoverflow.com/comment/46811783
type: Answer
accepted answer of: http://stackoverflow.com/q/28978454
score: 2

http://stackoverflow.com/comment/46248925
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29000484
has text: I want to understand what's happening.

http://stackoverflow.com/q/29054274
tagged with: image
type: Question
linked to: http://stackoverflow.com/q/2104949
has comment: http://stackoverflow.com/comment/46346115
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29054452
answer count: 3
has title: Refresh an arbitrary image with a button
has body: I have an auto-generated form that also handily displays thumbnails. I want to add a button beside the image that will refresh it if it is updated. I want to take cached images into account. I add a button easily enough: // add a refresh button to image previews $('a[href*="/thumbs/"]').after(' Refresh '); And since I'm okay if the refresh button refreshes all of the stale images I try to append a query string to the image src (deleting an old query string if it exists): // attach refresher to button $(".refresh-image-button").click(function() { $('img[src*="/thumbs/"]').attr("src", $(this).attr("src").split('?',1)+'?'+Date.now()); }); However, I can't really do this because here $(this) doesn't refer to the matched image, and I can't do a split operation within this jquery match anyway. How do I do it? As a bonus if anyone has a ref to decent auto refresh image code, that would be helpful. This builds on a simpler SO inquiry here.
has answer: http://stackoverflow.com/a/29054351
accepted answer: http://stackoverflow.com/a/29054351
has answer: http://stackoverflow.com/a/29054452
has answer: http://stackoverflow.com/a/29093014
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/q/28958639
tagged with: php
has title: How to load Ajax content from Url with out using hash
type: AnsweredQuestion
score: 1
type: Question
downvote count: 0
has body: I have tried looking for many topics but none of them fixes my problem. I'm currently developing my portfolio site but this is my first time using Ajax. I stuck on this for many days. I used source code from html5.gingerhost.com and tweak the php part a little bit because I'm not used to php. It only loads [title] of the page into index.html's title and get all the content from html file (only html elements, no js, no css) with the same name as href. here's the js. $(document).ready(function(){ $('.nav a').click(function(e) { href = $(this).attr("href"); loadContent(href); // HISTORY.PUSHSTATE history.pushState('', 'New URL: '+href, href); e.preventDefault(); }); }); // THIS EVENT MAKES SURE THAT THE BACK/FORWARD BUTTONS WORK AS WELL window.onpopstate = function(event) { console.log("pathname: "+location.pathname); loadContent(location.pathname); }; function loadContent(url){ // USES JQUERY TO LOAD THE CONTENT $.getJSON("content.php", {cid: url, format: 'json'}, function(json) { // THIS LOOP PUTS ALL THE CONTENT INTO THE RIGHT PLACES $.each(json, function(key, value){ $(key).html(value); }); }); // SUBTRACT '/' url = url.substr(1); if(url == ""){ url = "home" } // ADD '.html" url = url.concat(".html") // REPLACE CONTENT INTO THE DIV $.ajax({ url: url }) .done(function(html) { $(".content-box").html(html); }); } This is working fine when I hit back and forward buttons. The problem is I'm trying to find how to load Ajax content from the specific Url. For example, I want to go directly to www.mysite.com/about but in my directory there's no such directory name 'about', so it returns 'Not found' page to me. In http://html5.gingerhost.com/ if I type http://html5.gingerhost.com/seattle It shows the Seattle page instead of 'Not found' page like mine. Please suggest me how to achieve that or give me the keywords of the technique to do these things. Thank you in advance, Puck
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28958877
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28958877
upvote count: 1

http://stackoverflow.com/comment/46161329
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28953374
score: 1
has text: @Russell - This bug and fix is pretty clearly targeted at the exact same symptoms and the exact same ASSERT that is triggering for you. While the proof would be in actually applying the fix and seeing the message go away, this bug and associated fix certainly looks like the smoking gun. Per the [node.js changelog](https://nodejs.org/changelog.html), it does not appear that there has been a public release since this bug fix. I can't tell from any node.js public resources if there is yet a planned release timing for v0.12.1.

http://stackoverflow.com/q/29035329
tagged with: jquery
tagged with: php
tagged with: twitter-bootstrap
has title: Loading different image in bootstrap modal window
has body: I have gallery with small images and when user click on thumbnail open modal with the image. I have image stored in two folders /uploads/ where is real size image and thumb where is small image. When modal is open should load big image but instead is loading small image now. They are with same name but in different pages. This is how I load the gallery <?php error_reporting(E_ALL); ini_set('display_errors', 1); $pdo = Database::connect(); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); foreach($pdo->query("SELECT * FROM images ORDER BY image_id") as $row) { echo ' '; } Database::disconnect(); ?> × Heading Close And the javascript part $('.thumbnail').click(function(){ $('.modal-body').empty(); var title = $(this).parent('a').attr("title"); $('.modal-title').html(title); $($(this).parents('div').html()).appendTo('.modal-body'); $('#myModal').modal({show:true}); });
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/29036010
type: Question
accepted answer: http://stackoverflow.com/a/29036010
score: 0
answer count: 1

http://stackoverflow.com/q/28978076
downvote count: 0
favorite count: 0
has body: I have this function that makes text cycle through a series of letters before it spells out the actual word. At the moment, it does this on hover - but I would like it to do it only when the page loads. (function($){ $.fn.charcycle = function( options ){ var settings = { target:"", sender:$(this), id:$(this).attr('id'), timer_is_on:1, quoteDis : "", quoteLoc : 0, speed:90, quotePic : "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", quotePic2 : "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", quotePic3 : "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", quoteStr : "", targetElement :"" } //var quoteStr; //var targetElement; var quoteLen; var quoteMax; var rndRange; var t; return this.each(function(){ if ( options ) { $.extend( settings, options ); } $(this).addClass('cycling'); settings.targetElement=$(this).find(settings.target); settings.quoteStr=settings.targetElement.text(); startQuote(); function padQuote(){ for (var i = settings.quoteStr.length; i &lt; quoteMax; i++) { settings.quoteStr= "" + settings.quoteStr + " "; } } function disQuote() { settings.quoteDis = settings.quoteStr.substring(0, settings.quoteLoc); for (var i = settings.quoteLoc; i &lt; quoteMax; i++){ var charone; charone = settings.quoteStr.substring(i, i + 1); var rdnum; rdnum = Math.floor(Math.random() * rndRange) if(i&lt; quoteMax &amp;&amp; i&gt;quoteMax-3){ settings.quoteDis = "" + settings.quoteDis + settings.quotePic3.substring(rdnum, rdnum + 1); } else if (i &gt; settings.quoteLoc+7 &amp;&amp; i &lt; settings.quoteLoc+14){ settings.quoteDis = "" + settings.quoteDis + settings.quotePic.substring(rdnum, rdnum + 1); } else { settings.quoteDis = "" + settings.quoteDis + settings.quotePic2.substring(rdnum, rdnum + 1); } } settings.quoteLoc = settings.quoteLoc + 1; if(settings.quoteLoc == quoteLen+2){ //$("#"+settings.id).removeClass('cycling'); settings.sender.removeClass('cycling'); clearTimeout(t); settings.timer_is_on=0; } } function loopQuote(target) { settings.targetElement.text(settings.quoteDis); disQuote(); if (settings.timer_is_on==1){ t…
has answer: http://stackoverflow.com/a/28978354
has title: jquery function needs run on page load
accepted answer: http://stackoverflow.com/a/28978354
has comment: http://stackoverflow.com/comment/46206909
type: AnsweredQuestion
score: 1
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 1
answer count: 1

http://stackoverflow.com/q/28921539
has comment: http://stackoverflow.com/comment/46100266
favorite count: 0
has comment: http://stackoverflow.com/comment/46100554
has body: I've made a function in Javascript to encrypt/encode a string before passing it to another page. The problem is that it isn't able to handle (editing, passing, returning etc...) large strings. Is there a way to do this in Javascript? Note: At the moment I do not use jQuery because I think it's too complicated. Here's some example code: function replaceAt(str, index, character) { return str.substr(0, index) + character + str.substr(index+character.length); } function EncryptURL(inputstring) { var output = inputstring; for(var i=0; i&lt;output.length; i++) { output = replaceAt(output, i, String.fromCharCode(output.charCodeAt(i) + 5)); } return output; } The function simply shifts each character 5 characters to the right. Ex: A -> F Example input: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA Output: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFKKKKKKKKKKKKKKKKKKK When inputting a large string the characters are getting messed up somewhere around index 58. No errors. EDIT: The page language is HTML by the way. More code: function DoubleEncryptURLToURLBox() { var namesarraystr = document.varreciever.variab.value; //Names separated by '_'. Example: Vincent_Jack_Felix_Simon_Jonathan_Monica_Eva_Tony_Anna var output = ""; output = namesarraystr; var i = 0; if(output.indexOf("?") != -1) { i = output.indexOf("?") + 1; output = output.substring(output.indexOf("?")); for(i = i; i&lt;output.length; i++) { output = replaceAt(output, i, String.fromCharCode(output.charCodeAt(i) + 5)); } output = "http://www.[website].com/redirect.html?" + EncryptURL(("nrc" + output)); //+ EncryptURL("?true"); } document.getElementById("SettingsDiv").style.height = "auto"; document.getElementById("CopyURLBox").style.visibility = "visible"; document.getElementById("CopyURLBox").value = output; } Sorry about it being long.
accepted answer: http://stackoverflow.com/a/28921729
tagged with: parameter-passing
has comment: http://stackoverflow.com/comment/46100300
has comment: http://stackoverflow.com/comment/46100435
tagged with: parameters
type: AnsweredQuestion
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46100378
has answer: http://stackoverflow.com/a/28921729
tagged with: javascript
has comment: http://stackoverflow.com/comment/46100391
has comment: http://stackoverflow.com/comment/46100312
has title: Handling large strings in Javascript
has comment: http://stackoverflow.com/comment/46100290
answer count: 1
downvote count: 0
score: 1
tagged with: string

http://stackoverflow.com/a/28977078
answers question: http://stackoverflow.com/q/28957018
score: 0
type: Answer
has body: The answer was pretty simple here, thanks to Phil. First off I should not have been using ng-repeat at the bottom of my code as a way of testing to see if my values were there, it is much better to use something like: &lt;pre&gt;&lt;/pre&gt; This spits out (in a code view) the actual json object that is being held in vm.search and the | json appended after the variable name just helps to format the json out on the page. If you did not use it you would just see everything on one line. So again @Phil, thank you for the tip! One thing I wasn't realizing is that my result from the http.get call which I was stuffing into the vm.search variable. Is actually an array. OBVIOUSLY you say, but it didn't dawn on me to only grab the first item from that array and stuff that in my variable named vm.search instead I was doing this: $http.get("/api/favorites") .success(function (result) { vm.searches = result; }) When in fact I should have been doing this: $http.get("/api/favorites") .success(function (result) { vm.searches = result[0]; }) Now to look at the difference let's save out the result that we get from &lt;pre&gt;&lt;/pre&gt; using each method, first without targeting the first array element, we get: [ { "searchId": 91, "userId": "fec87a96-22d7-4e8c-8991-fa01df60c5c0", "name": "xxx123", "description": "123xxx", "created": "2015-03-11T01:12:37.32", "searchString": "/?" } ] Now if we extract the result using the latter method, going straight for the first element result[0] we get the results as an object, not an object contained within an array of only one item. { "searchId": 91, "userId": "fec87a96-22d7-4e8c-8991-fa01df60c5c0", "name": "xxx123", "description": "123xxx", "created": "2015-03-11T01:12:37.32", "searchString": "/?" } I know this seems tedious to explain all of this, but for someone like me who overlooked it, this is the difference between your model binding or not binding to the input values for each text field and ev…

http://stackoverflow.com/comment/46257776
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29005798
has text: which library you use to perform hide/show with microseconds?

http://stackoverflow.com/comment/46338738
has text: @floor, quite right. It was a copy from another eleswhere and I should have used JQuery.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29050295
score: 0

http://stackoverflow.com/q/28968263
tagged with: video-streaming
linked to: http://stackoverflow.com/q/27960366
has comment: http://stackoverflow.com/comment/46211389
tagged with: javascript
has comment: http://stackoverflow.com/comment/46212703
score: 0
has comment: http://stackoverflow.com/comment/46212169
has comment: http://stackoverflow.com/comment/46195072
has body: I've been looking for to long for a HTML video player which can load stream url's via Angular, and play them on IE9 ( via flash or whatever) on Chrome, FF, Mobile, ... via HTML5 I tried: videogular videoJS video-for-everyone sublimevideo ... and looked on way to many pages for a working sollution. But couln't find any wich worked, I know this isn't the place to ask for a resource, documentation, file, ... But after searching for this long, this is prorbably the only place someone may know what I'm looking for But for still asking a question for the player I got the most working: that was the configuration on this page: http://www.realeyes.com/blog/2013/02/06/cross-browser-video-players/ this plays some videos but some uploaded videos (.mp4) won't play on chrome and FF
has comment: http://stackoverflow.com/comment/46216266
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46216546
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/27798605
has title: HTML video player in IE9 with Angular
answer count: 0
has comment: http://stackoverflow.com/comment/46213618
type: Question

http://stackoverflow.com/comment/46252381
type: Comment
score: 0
has text: The table contains the rows with the given data as in the question.
type: QuestionComment
comment on: http://stackoverflow.com/q/29002492

http://stackoverflow.com/comment/46171504
comment on: http://stackoverflow.com/q/28959416
score: 0
type: Comment
type: QuestionComment
has text: I would guess the last cell of each row right?

http://stackoverflow.com/comment/46198079
comment on: http://stackoverflow.com/a/28971614
has text: If you mean you can't change the page's javascript, then yes you would want to use jSoup since you just load the HTML after the page has been fully loaded then you can just pull the results without having to do any javascript on the page.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46229150
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28983440
has text: sgpalit Well the traditional way would be to display only 1000 entries per page, only one page gets sent to user, and other pages only get sent if requested but user, having said that I do like your idea.
score: 0

http://stackoverflow.com/q/28978628
has answer: http://stackoverflow.com/a/28978725
accepted answer: http://stackoverflow.com/a/28978842
favorite count: 0
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/46208048
answer count: 3
has title: jquery .change inside loop
has answer: http://stackoverflow.com/a/28978842
has body: Let say i have this code HTML a b c a b c a b c Javascript var i; for (i = 1; i <= 3; i++) { $('#id'+[i]).change(function(){ $("#result"+[i]).html(' Number '+[i]); }); } JS Fiddle Different id and different result id through loop I just want, each tag change, show the result through the div based on the id Like this: id1 change to b, then div1 show b id2 change to c, then div2 show c id3 change to a, then div3 show a In my example fiddle, the code i write is not working, can you please help me? Thank you in advance
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28979067
has answer: http://stackoverflow.com/a/28979067
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/q/29039866
tagged with: javascript
answer count: 1
has body: I've looked up the ng-show directive but none of the examples seemed to fit my case. I have a certain amount of divs with the class 'foo' which is dynamically generated based on some logic. I want to hide all the divs with that class when a checkbox is selected. edit: I solved it with this &lt;input type="checkbox" ng-model="hideClosed" checked&gt; &lt;div ng-show="{{location.isOpen}}" ng-hide="hideClosed &amp;&amp; "&gt;&lt;/div&gt; Only problem now is that the checkbox does not start initially checked. I tried adding ng-checked="true" to the checkbox, but it didn't hide the closed ones until it was un-checked and checked again.
favorite count: 0
tagged with: angularjs
has title: angularjs Hide objects with certain class when checkbox is checked
has answer: http://stackoverflow.com/a/29041200
has comment: http://stackoverflow.com/comment/46321460
upvote count: 1
has comment: http://stackoverflow.com/comment/46321591
has comment: http://stackoverflow.com/comment/46322731
type: AnsweredQuestion
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/29041200
downvote count: 0
has comment: http://stackoverflow.com/comment/46320431

jquery-mobile
tags question: http://stackoverflow.com/q/28939893
tags question: http://stackoverflow.com/q/28935402
tags question: http://stackoverflow.com/q/29041314
type: Tag
tags question: http://stackoverflow.com/q/29058845
tags question: http://stackoverflow.com/q/29040651
tags question: http://stackoverflow.com/q/28954855
tags question: http://stackoverflow.com/q/28990558
tags question: http://stackoverflow.com/q/28951518
tags question: http://stackoverflow.com/q/28994375
tags question: http://stackoverflow.com/q/28934411
tags question: http://stackoverflow.com/q/29051496
tags question: http://stackoverflow.com/q/29015046
tags question: http://stackoverflow.com/q/29021700
tags question: http://stackoverflow.com/q/28981994
tags question: http://stackoverflow.com/q/29059573
tags question: http://stackoverflow.com/q/29035410
tags question: http://stackoverflow.com/q/29038399
tags question: http://stackoverflow.com/q/29030385
tags question: http://stackoverflow.com/q/29008312
tags question: http://stackoverflow.com/q/29059588
tags question: http://stackoverflow.com/q/29007727
tag name: jquery-mobile
tags question: http://stackoverflow.com/q/28942549

http://stackoverflow.com/q/29049413
favorite count: 0
has answer: http://stackoverflow.com/a/29049644
upvote count: 0
type: UnansweredQuestion
has body: I have created a script, which holds a div-container. The moment i move the mouse quickly left and right on the container, it does not work anymore. Google Chrome does not process it properly either, why? move container text Thank you for your response!
type: Question
tagged with: javascript
score: -1
has title: Javascript and onMouseOver
answer count: 1
downvote count: 1
tagged with: eventhandler

http://stackoverflow.com/a/29001110
has body: Add an event handler to the form submit that appends the string to the input before it's POSTed. From another StackOverflow article: window.onload = function() { document.getElementById('theForm').onsubmit = function() { var txt = document.getElementById('txtSearch'); txt.value = "updated " + txt.value; }; };​ You'd obviously have to modify the id selects to match your HTML for this to work. If you want to do it in JQuery: $('#theForm').submit(function() { var txt = $('#txtSearch'); txt.val("updated " + txt.val()); });
accepted answer of: http://stackoverflow.com/q/29001057
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29001057
has comment: http://stackoverflow.com/comment/46262852
type: Answer
has comment: http://stackoverflow.com/comment/46250322
upvote count: 2
score: 2

http://stackoverflow.com/q/29039424
has answer: http://stackoverflow.com/a/29039624
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29039624
type: Question
tagged with: javascript
has body: I am at my wits end. I cannot figure out how to add the value of the radio button to the equation. Can someone give me a clue at least on this?? If I don't have the radio button function included, this works fine. &lt;input type="radio" class="InternetCost" name="int" id="no_int" value="0"&gt;None&lt;br&gt; &lt;input type="radio" class="InternetCost" name="int" id="ten" value="10"&gt;10&lt;br&gt; &lt;input type="radio" class="InternetCost" name="int" id="twenty" value="20"&gt;20&lt;br&gt; &lt;input type="radio" class="InternetCost" name="int" id="thirty" value="30"&gt;30&lt;br&gt; //Try to select radio button var values = document.getElementsByName("int"); function getValue() { for(var i = 0; i &lt; values.length; i++) { if(values[i].checked == true) { selectedValue = values[i].value; console.log('value=' + selectedValue); } } } function calculate() { //get selectedValue - this is where I am lost! var radioValue = getValue()*1; //Package var pkgCost = document.getElementById("pkg").value*1; //Package - Static var equipPkg = document.getElementById("pep").value*1; //Additional amount var addBox = document.getElementById("addtl").value*1; //Additional Box cost - static var totalNum = document.getElementById("add_cost").value*1; //Service amount var dvrSvc = document.getElementById("dvr_svc").value*1; //Service cost - static var dvrCost = document.getElementById("dvr_cost").value*1; // Sum everything var SumAll = pkgCost + equipPkg + (addBox*totalNum) + (Svc*Cost) + radioValue; // print the total document.getElementById("Sum").innerHTML = SumAll.toFixed(2) }
score: 0
tagged with: radio-button
answer count: 1
has title: Adding value of selected radio button to an equation

typeahead
type: Tag
tags question: http://stackoverflow.com/q/29042989
tag name: typeahead
tags question: http://stackoverflow.com/q/29029704
tags question: http://stackoverflow.com/q/29006108

http://stackoverflow.com/q/28996989
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29013776
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29042055
possible better answer: http://stackoverflow.com/a/29013776
tagged with: google-apps-script
answer count: 2
has title: Google Apps Script json data becomes undefined in javascript
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/29042055
has body: I'm trying to use javascript to display data, but when I get the data from a server function, the data becomes undefined. The data passes jsonlint and trying to use JSON.parse results in an unexpected token error. Why does the type change when it is accessed from javascript, and how do I access the data? code.gs: function getAppMenus(appID) { var files = DriveApp.getFilesByName("Json.json"); var file = files.next(); data = file.getAs("json").getDataAsString() data = JSON.stringify(data); //data = JSON.parse(data); Logger.log(typeof(data)); return data; } The logger says that the type is string $('document').ready(function() { var menuData = google.script.run.getAppMenus("123"); alert("type is:"+typeof(menuData)); //menuData = JSON.stringify(menuData); //menuData = JSON.parse(menuData); //$("#main").append(menuData); alert(menuData); alert("fin"); }); alert says the type is undefined. log: string "{\r\n \"options\": {\r\n \"option\": [\r\n {\r\n \"name\": \"asdf\",\r\n \"stuff\": \"true\"\r\n },\r\n {\r\n \"name\": \"fdsa\",\r\n \"stuff\": \"false\"\r\n }\r\n ]\r\n }\r\n}" Json.json: { "options": { "option": [ { "name": "asdf", "stuff": "true" }, { "name": "fdsa", "stuff": "false" } ] } }

http://stackoverflow.com/comment/46169166
type: Comment
type: QuestionComment
has text: Yes, you don't need of javascript or Jquery to reset and clear the fields. HTML inputs are enough to do that. Go through these link http://www.w3schools.com/tags/tag_input.asp
comment on: http://stackoverflow.com/q/28957802
score: 0

http://stackoverflow.com/comment/66225693
has text: In addition to this problem, `isLoggedIn` doesn't update properly either. Some frontend elements rely on it with ng-show/hide. After login, the function still returns false, until I refresh the page. Any clue?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28966023

http://stackoverflow.com/a/29048563
has comment: http://stackoverflow.com/comment/46336632
answers question: http://stackoverflow.com/q/29048041
upvote count: 2
has body: This could be done easily with the GD library and some class for easy work with it like PHPImageWorkshop. GD library is a base for php above a certain version (not remember which one), and does not need installation. Class could be download from here - http://phpimageworkshop.com/ &lt;?php require_once 'lib/WideImage.php'; $text = mysql_escape_string($_POST['text']); $image = WideImage::load('image.jpg')-&gt;resize(500); if ($text != Null || $text != "" ) { $canvas = $image-&gt;getCanvas(); $canvas-&gt;useFont('someFont.ttf', 55, $image-&gt;allocateColor(255, 255, 255)); $canvas-&gt;writeText("center", "bottom", "$text"); } $image = $image-&gt;saveToFile('newImage.jpg'); ?&gt;
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/46337264
has comment: http://stackoverflow.com/comment/46340727

datetimepicker
type: Tag
tag name: datetimepicker
tags question: http://stackoverflow.com/q/28962037
tags question: http://stackoverflow.com/q/28933819
tags question: http://stackoverflow.com/q/28965470

http://stackoverflow.com/q/29000364
has comment: http://stackoverflow.com/comment/46248501
has comment: http://stackoverflow.com/comment/46248683
has comment: http://stackoverflow.com/comment/46248742
has comment: http://stackoverflow.com/comment/46248792
has comment: http://stackoverflow.com/comment/46248569
has comment: http://stackoverflow.com/comment/46248686
has comment: http://stackoverflow.com/comment/46254920
possible better answer: http://stackoverflow.com/a/29000453
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/46248457
has answer: http://stackoverflow.com/a/29000453
downvote count: 0
has comment: http://stackoverflow.com/comment/46248570
tagged with: glsl
tagged with: webgl
tagged with: http://stackoverflow.com/tag/c
has body: I'm having trouble figuring out a good way to structure my code. I am writing a shader in GLSL. I'm using WebGL. So I have a sprite sheet with 22 items. The sheet is 640 X 640. Except for the last each row has 5 sprites. So I used the following code just to test things out. float positionInTime = (currentAge / duration); positionInTime /= 0.04545; positionInTime = sign(positionInTime)*floor(abs(positionInTime)+0.5); vec2 TextureCoord = vec2( 0.0, 0.0 ); if ( positionInTime == 22.0) { TextureCoord = vec2( 0.0, 0.0 ); } if ( positionInTime == 21.0) { TextureCoord = vec2( 0.2, 0.0 ); } if ( positionInTime == 20.0) { TextureCoord = vec2( 0.4, 0.0 ); } if ( positionInTime == 19.0) { TextureCoord = vec2( 0.6, 0.0 ); } if ( positionInTime == 18.0) { TextureCoord = vec2( 0.8, 0.0 ); } if ( positionInTime == 17.0) { TextureCoord = vec2( 0.0, 0.2 ); } if ( positionInTime == 16.0) { TextureCoord = vec2( 0.2, 0.2 ); } if ( positionInTime == 15.0) { TextureCoord = vec2( 0.4, 0.2 ); } if ( positionInTime == 14.0) { TextureCoord = vec2( 0.6, 0.2 ); } if ( positionInTime == 13.0) { TextureCoord = vec2( 0.8, 0.2 ); } if ( positionInTime == 12.0) { TextureCoord = vec2( 0.0, 0.4 ); } if ( positionInTime == 11.0) { TextureCoord = vec2( 0.2, 0.4 ); } if ( positionInTime == 10.0) { TextureCoord = vec2( 0.4, 0.4 ); } if ( positionInTime == 9.0) { TextureCoord = vec2( 0.6, 0.4 ); } if ( positionInTime == 8.0) { TextureCoord = vec2( 0.8, 0.4 ); } if ( positionInTime == 7.0) { TextureCoord = vec2( 0.0, 0.6 ); } if ( positionInTime == 6.0) { TextureCoord = vec2( 0.2, 0.6 ); } if ( positionInTime == 5.0) { TextureCoord = vec2( 0.4, 0.6 ); } if ( positionInTime == 4.0) { TextureCoord = vec2( 0.6, 0.6 ); } if ( positionInTime == 3.0) { TextureCoord = vec2( 0.8, 0.8 ); } if ( positionInTime == 2.0) { TextureCoord = vec2( 0.0, 0.8 ); } if ( positionInTime == 1.0) { TextureCoord = vec2( 0.2, 0.8 ); } vec2 TextureSize = vec2(.2, .2); mediump vec2 realTexCoord = TextureCoord + (gl_PointCoord * Textur…
has answer: http://stackoverflow.com/a/29000584
type: Question
accepted answer: http://stackoverflow.com/a/29000584
has comment: http://stackoverflow.com/comment/46248626
answer count: 2
has comment: http://stackoverflow.com/comment/46249695
has comment: http://stackoverflow.com/comment/46248815
has comment: http://stackoverflow.com/comment/46248507
has comment: http://stackoverflow.com/comment/46248511
has title: Simplify code by finding a way to remove many if statements
has comment: http://stackoverflow.com/comment/46248486
tagged with: javascript
has comment: http://stackoverflow.com/comment/46248640
upvote count: 2
has comment: http://stackoverflow.com/comment/46248612
has comment: http://stackoverflow.com/comment/46248525
has comment: http://stackoverflow.com/comment/46248519
favorite count: 0
has comment: http://stackoverflow.com/comment/46248867
tagged with: c++
has comment: http://stackoverflow.com/comment/46248545

http://stackoverflow.com/q/28984095
tagged with: csom
has comment: http://stackoverflow.com/comment/46220284
has comment: http://stackoverflow.com/comment/46220207
score: 0
has answer: http://stackoverflow.com/a/28989250
accepted answer: http://stackoverflow.com/a/28989250
answer count: 1
tagged with: ecmascript-5
tagged with: javascript
tagged with: sharepoint
type: AnsweredQuestion
has title: Add Button in SharePoint List Ribbon Button Using JSOM
has body: I have to add a button in Sharepoint List Ribbon button &amp; in ECB Menu. here is the code to add ECB menu in Sharepoint List using JSOM. function AddCustomActions() { var listTitle = 'mylist Title'; var clientContext = new SP.ClientContext(); var oWebsite = clientContext.get_web(); var oList = oWebsite.get_lists().getByTitle(listTitle); var UserCustomActions = oList.get_userCustomActions(); var newUserCustomAction = UserCustomActions.add(); newUserCustomAction.set_location('EditControlBlock'); newUserCustomAction.set_url("javascript:archieveItem('{ListId}','{ItemId}');"); newUserCustomAction.set_sequence(3); newUserCustomAction.set_title('Archive Item'); newUserCustomAction.set_description(''); newUserCustomAction.update(); clientContext.executeQueryAsync(onQuerySucceed, onQueryFail); } function onQuerySucceed(sender, args) { alert('New custom action added to Site.\n\nRefresh the page.'); } function onQueryFail(sender, args) { alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace()); } function archieveItem(aListId, aItemId) { try { var flag1 = confirm('Are you sure want to archive the Item? Click Ok to Archive and Cancel to Unarchive'); var clientContext = SP.ClientContext.get_current(); var oWeb = clientContext.get_web(); var id = aItemId; var listId = aListId; var oList = oWeb.get_lists().getByTitle(listTitle); var oListItem = oList.getItemById(id); if (flag1 == true) { oListItem.set_item('Archive', true); } else if (flag1 == false) { oListItem.set_item('Archive', false); } oListItem.update(); clientContext.executeQueryAsync(onArchiveSucceeded, onArchiveFailed); } catch (e) { alert(e.message); } } Can anyone help how to add button in Ribbon Button using JSOM?
type: Question

http://stackoverflow.com/comment/46106226
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28924312
score: 1
has text: I'm not an angular developper but you should try instead: `$scope.load = function () { alert(parseInt($('#navbar').css("height"))); });` inside your controller. I edited your question to include `angularjs` tag because there is maybe better way and so an angularjs developper could check it

http://stackoverflow.com/comment/46305852
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29032500
type: Comment
has text: **Note:** [`jQuery.parseJSON`](http://api.jquery.com/jquery.parsejson/) - *"Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string."* This is a suitable replacement if you are already using jQuery in the case where `JSON.parse` does not exist in a browser.

http://stackoverflow.com/a/28974830
score: 2
downvote count: 0
upvote count: 2
type: Answer
has body: You are looking for x in x * 0.75 = 2062. So solving for x that should be x = 2062 / 0.75. To ensure that the number is the closest whole number less than or equal to x, you can use Math.floor: Math.floor(2062 / 0.75) = 2749
answers question: http://stackoverflow.com/q/28974770

http://stackoverflow.com/q/28928383
has comment: http://stackoverflow.com/comment/46112939
has title: How to repeat a Javascript program
has body: I want to repeat a javascript and I cannot find any way to do it I want to repeat the statement infinite number of times till now i was copying it and pasting it again and again can any body help me out to do so the statement or command I want to repeat is window.scrollTo(0,document.body.scrollHeight); can any body call me how to repeat it without pasting it again and again
has comment: http://stackoverflow.com/comment/46112697
downvote count: 5
type: UnansweredQuestion
score: -4
has comment: http://stackoverflow.com/comment/46112719
has answer: http://stackoverflow.com/a/28928505
has comment: http://stackoverflow.com/comment/46112558
type: Question
answer count: 1
tagged with: javascript
upvote count: 1
favorite count: 0

http://stackoverflow.com/q/29059716
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/46355771
accepted answer: http://stackoverflow.com/a/29060008
tagged with: javascript
score: 0
has title: Parsing JSON string from python to Javascript
answer count: 2
has answer: http://stackoverflow.com/a/29059783
possible better answer: http://stackoverflow.com/a/29059783
has body: I am working on a terrarium controller project, at this moment I want to get the timeperiod of the lighting. In python I have a function called: getStatus() it returns a JSON string to Javascript, which will handle the data further. But it doesn't work. Here's my python code: def getStatus (): data=[["HOUR_ON", HOUR_ON],["MINUTE_ON", MINUTE_ON], ["HOUR_OFF", HOUR_OFF], ["MINUTE_OFF", MINUTE_OFF]] return json.dumps(data) And overhere the Javascript: var alertFunction = function macroCallback(macro, args, light) { alert(macro + " returned with " + light); var obj = JSON.parse(light); document.getElementById("testSection").innerHTML="Light turns on at: "+ obj[0].HOUR_ON+":"+obj[0].MINUTE_ON + "\n"+"Light goes out at: "+obj[1].HOUR_OFF+":"+obj[1].MINUTE_OFF; alert("after parsing: "+obj[0]); document.getElementById("testSection").innerHTML=light; } The string seems to be send back from the server and will be parsed correctly, only accessing the string doesn't work I get four times undefined in the innerHTML section. I hope someone can help me out! Greetings and thanks! Marco
has answer: http://stackoverflow.com/a/29060008
tagged with: python
type: AnsweredQuestion

http://stackoverflow.com/comment/46226767
score: 0
comment on: http://stackoverflow.com/a/28987992
type: AnswerComment
has text: The previous error is gone.There is new error that says: events.js:85 throw er; // Unhandled 'error' event ^ Error: connect ECONNREFUSED at exports._errnoException (util.js:746:11) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:983:19)
type: Comment

http://stackoverflow.com/a/28981875
accepted answer of: http://stackoverflow.com/q/28981393
answers question: http://stackoverflow.com/q/28981393
has body: Try something like this jsFiddle, I hope this is what you're looking for: $(document).ready(function() { $('ul').scroll(function(event) { if (this.scrollWidth - this.clientWidth - this.scrollLeft < 50) { $(this).append(' 1 2 3 4 ') } }); });
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/46270040
score: 0
has text: Is there a way to load all of the sections but prevent some from showing in the main scroll or is that not possible? Thanks!
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28976475

http://stackoverflow.com/q/29012133
tagged with: carousel
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has body: I have weird problem with my carousel. I'm using carouFredSel to make an unusual slider for my page. It almost works but with one problem. After a page has loaded, the carousel shows the first image and the first title. But when the carousel scrolls to the next picture, it misses the second picture and shows the third one but with the second picture's title. This problem also appeared with my hover effect. When I hover the thumb it shows good title but wrong picture. I don't know how to explain this better. If I make myself unclear, please let me know and I will try to describe the problem differently. How can I synchronize pictures with titles? Working fiddle: jsfiddle Here is my code: HTML: Bacon ipsum Bacon ipsum dolor amet kevin short ribs ham, tenderloin picanha biltong rump ribeye tail leberkas. Lorem ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec lacus velit,... Veggie ipsum Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion... Tuna ipsum Snook peamouth crocodile shark collared dogfish weever trout cod slender mola Modoc Yippiyo ipsum Yippiyo ipsizzle i'm in the shizzle sizzle amizzle, consectetuer adipiscing... Beer ipsum degrees plato krausen, mash ipa bacterial pint glass. krug cask conditioned... JS: $('#sliderBigPhotoWrapper').carouFredSel({ responsive: false, circular: false, auto: { fx: 'crossfade', duration: 500, timeoutDuration: 6000, pauseOnHover: true }, scroll: { fx: 'crossfade', duration: 500, pauseOnHover: true }, items: { visible: 1, width: '460px', height: '360px' } }); $('#sliderTextWrapper').carouFredSel({ responsive: false, circular: false, synchronise: ['#sliderBigPhotoWrapper', true, true], auto: { fx: 'crossfade', duration: 500, timeoutDuration: 6000, }, scroll: { fx: 'crossfade', duration: 500, }, items: { visible: 1, width: '460px', height: 'auto' } }); $('#sliderThumbsWrapper').on('mouseenter', 'a', function () { console.log('hover start'); n = $(this).attr('id').split('_').pop(); consol…
answer count: 0
score: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Multiple carousel doesn't want to synchronize

http://stackoverflow.com/q/29035185
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/46311408
has title: how to dynamically insert character in middle input text with JS
type: Question
upvote count: 2
tagged with: keypress
has comment: http://stackoverflow.com/comment/46311111
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29036058
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I have an input text box to fill in with hours from 00:00 to 23:59 I'd like to dynamically insert the double point ":" after the 2 first characters, something like in http://www.railtime.be/website/home-fr which is even giving an error message when wrong hours are given like 30:66... I can't figure out how it has been done, any idea? &lt;input type="text" name="time" id="time" placeholder="00:00" maxlength="5" value=""&gt; I think a keypress function has been used but what with? Thanks in advance! Resolved with dfsq solution: $('input#time').on('keyup', function(e) { if (e.which &amp;&amp; this.value.length === 2 &amp;&amp; e.which !== 8) { this.value += ':'; } });
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29035992
has answer: http://stackoverflow.com/a/29035750
has comment: http://stackoverflow.com/comment/46311883

http://stackoverflow.com/comment/46252186
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29002275
score: 1
has text: Could you please clarify what it is exactly you're trying to do here? You've printed the same array object twice saying this is the way it is and this is the way you want it. From what I can see, they're exactly the same. What are you trying to do?

http://stackoverflow.com/comment/46204541
type: AnswerComment
score: 0
type: Comment
has text: It works perfectly! Thank you so much! I am going to scour this thing and learn where I messed up. Thanks again!!
comment on: http://stackoverflow.com/a/28973610

http://stackoverflow.com/a/29005889
accepted answer of: http://stackoverflow.com/q/29005373
has comment: http://stackoverflow.com/comment/46258058
answers question: http://stackoverflow.com/q/29005373
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46258206
has body: To access provide in config phase, we need to append 'Provider' to the name of the provider. module.config(function ($provide, $injector) { $provide.provider("testservice", function () { this.$get = function () { this.property = 777; }; }); var s = $injector.get("testserviceProvider"); console.log(s) });
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/a/29019784
has body: function changeValue(val){ if(val &gt; 5){ }; else if(val &lt; 1){ }; } Can you get the rest?
answers question: http://stackoverflow.com/q/29019718
score: 0
type: Answer

http://stackoverflow.com/q/28972060
downvote count: 0
has comment: http://stackoverflow.com/comment/46198137
favorite count: 0
tagged with: promise
has answer: http://stackoverflow.com/a/28976663
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
has title: Organise javascript webdriver promises code idiomatically
has comment: http://stackoverflow.com/comment/46202721
has answer: http://stackoverflow.com/a/28973529
tagged with: webdriver
type: Question
linked to: http://stackoverflow.com/q/21999178
has comment: http://stackoverflow.com/comment/46202774
has answer: http://stackoverflow.com/a/28972420
tagged with: protractor
tagged with: javascript
has body: I am asserting on the contents of a particular row from an html table using webdriver via protractor. I have the following code which works correctly, but looks horrible. I want advice on how to better organise this code idiomatically with promises; in particular, I'd like to make it more obvious that there are 3 parts to this code: Find the rows with a td containing the specified matchText on the page Check that only one row matched, and handle the error cases with useful debug info Check that the text content of the tds in this matched row is as expected Is there a way I can organise this better to make this more readable, perhaps by chaining the promises or something? browser.findElements(by.xpath("//td[text() = '" + matchText + "']/..")).then(function(trs) { if (trs.length == 0) { throw 'Unable to find td element equal to ' + matchText } else if (trs.size &gt; 1) { protractor.promise.all(trs.map(function(tr){return tr.getInnerHtml()})).then(function(trsInnerHtml) { throw 'Matched multiple td elements for ' + matchText + ':' + trsInnerHtml; }) } else { trs[0].findElements(by.tagName('td')).then(function(tds) { protractor.promise.all(tds.map(function(td) {return td.getText()})).then(function(tdContent){ expect(tdContent).toEqual(expectedContent); }) }); } });
answer count: 3
score: 2

http://stackoverflow.com/comment/46305834
type: QuestionComment
score: 1
has text: http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags
comment on: http://stackoverflow.com/q/29032499
type: Comment

angularjs-directive
tags question: http://stackoverflow.com/q/29038406
tags question: http://stackoverflow.com/q/28924798
tag name: angularjs-directive
tags question: http://stackoverflow.com/q/28909075
tags question: http://stackoverflow.com/q/29017670
tags question: http://stackoverflow.com/q/29023950
tags question: http://stackoverflow.com/q/28914135
tags question: http://stackoverflow.com/q/29053833
tags question: http://stackoverflow.com/q/29033286
tags question: http://stackoverflow.com/q/28967723
tags question: http://stackoverflow.com/q/28908115
tags question: http://stackoverflow.com/q/29000086
tags question: http://stackoverflow.com/q/28943598
tags question: http://stackoverflow.com/q/28994513
tags question: http://stackoverflow.com/q/28960720
tags question: http://stackoverflow.com/q/29016222
tags question: http://stackoverflow.com/q/29043003
tags question: http://stackoverflow.com/q/29062212
tags question: http://stackoverflow.com/q/29005509
tags question: http://stackoverflow.com/q/28995826
tags question: http://stackoverflow.com/q/28951291
tags question: http://stackoverflow.com/q/29001946
tags question: http://stackoverflow.com/q/28934870
tags question: http://stackoverflow.com/q/28986403
tags question: http://stackoverflow.com/q/29028609
tags question: http://stackoverflow.com/q/28926902
tags question: http://stackoverflow.com/q/28999825
tags question: http://stackoverflow.com/q/28927843
tags question: http://stackoverflow.com/q/28929081
type: Tag
tags question: http://stackoverflow.com/q/29061262
tags question: http://stackoverflow.com/q/28913666
tags question: http://stackoverflow.com/q/28975650
tags question: http://stackoverflow.com/q/28977158
tags question: http://stackoverflow.com/q/29031833
tags question: http://stackoverflow.com/q/28988547
tags question: http://stackoverflow.com/q/29010089
tags question: http://stackoverflow.com/q/28927028
tags question: http://stackoverflow.com/q/29008231
tags question: http://stackoverflow.com/q/28997254
tags question: http://stackoverflow.com/q/28939784
tags question: http://stackoverflow.com/q/28968035
tags question: http://stackoverflow.com/q/28945975
tags question: http://stackoverflow.com/q/29037895
tags question: http://stackoverflow.com/q/29027557
tags question: http://stackoverflow.com/q/28966169
tags question: http://stackoverflow.com/q/28906899
tags question: http://stackoverflow.com/q/28962995

http://stackoverflow.com/comment/46208164
type: Comment
comment on: http://stackoverflow.com/a/28978864
type: AnswerComment
has text: Thanks for the reply, I've got a solid grasp of the capture phase, but the only problem is that the click event continues past the parent all the way down to the lowest level child - which I what I hope to prevent. The eventPropogation interrupts the bubble phase, but is there a function that interrupts the capture phase?
score: 0

http://stackoverflow.com/comment/139980645
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29044520

http://stackoverflow.com/a/28998931
answers question: http://stackoverflow.com/q/28998586
has body: You need to refer to the correct window. It would be easiest to have the same id on each separate page you want to click on, then include the following script through the src attribute of the &lt;script&gt; tag. function openInNewTab(clickElement, url){ clickElement.onclick = function(){ var win = open(url); win.focus(); var prm = win.prompt('Enter a Date: ', 'March 11, 2015'); if(prm){ console.log('The Date You Entered was: '+prm); } return win; } } var pre = onload; // previous onload onload = function(){ // window is implicit if(pre)pre(); var newWin = openInNewTab(document.getElementById('click_input_id'), 'https://www.google.com') }
score: 0
type: Answer

http://stackoverflow.com/a/29003044
score: 1
has comment: http://stackoverflow.com/comment/46254304
type: AcceptedAnswer
has body: may be you should use querystring variable while redirecting. if($_POST['Action'] == "DELETE") { $file_to_delete = $_POST['CodeList']; if(unlink($directory.'/'.$file_to_delete)) { header('Location: http:/mysite.com/evo/codesaveindex.php?deleted=1&amp;file='.$file_to_delete); } else { header('Location: http:/mysite.com/evo/codesaveindex.php?deleted=0&amp; file='.$file_to_delete); } } In codesaveindex.php: if(isset($_GET['deleted'])&amp;&amp; $_GET['deleted']==1) { echo $file_to_delete." deleted."; } elseif(isset($_GET['deleted'])&amp;&amp; $_GET['deleted']==0) { echo "Error deleting file ".$file_to_delete; }
downvote count: 0
answers question: http://stackoverflow.com/q/28987693
has comment: http://stackoverflow.com/comment/46256502
type: Answer
has comment: http://stackoverflow.com/comment/46253667
upvote count: 1
has comment: http://stackoverflow.com/comment/46254123
accepted answer of: http://stackoverflow.com/q/28987693

http://stackoverflow.com/a/29017842
score: 3
has body: Since you are in desperate need of an HTML templating solution (at the very least), I'll give you a nudge into the right direction. The following depends on gkindel/CSV-JS for CSV parsing and Handlebars for HTML creation: $(function () { var csvTemplateSrc = $('#csvTemplate').html(), csvTemplate = Handlebars.compile(csvTemplateSrc); $("#upload").click(function () { var filename = $("#fileUpload").val().toLowerCase(), reader; if (typeof (FileReader) === "undefined") { alert("This browser does not support HTML5."); return; } if (!/^[a-zA-Z0-9\s_\\.:-]+\.(csv|txt)$/.test(filename)) { alert("Please upload a valid CSV file."); return; } reader = new FileReader(); reader.onload = function (e) { var rows; try { rows = CSV.parse(e.target.result); } catch (ex) { alert("Your CSV is has errors.\n\n" + ex.message); return; } $("#dvCSV").html(csvTemplate(rows)); }; reader.readAsText($("#fileUpload")[0].files[0]); }); $(".export").click(function (event) { exportTableToCSV($('#dvCSV>table'), 'export.csv'); $('a.export').css({"background-color": "#ddd"}); }); }); Handlebars.registerHelper('first', function(context, options) { return options.fn(context[0]); }); Export Data to CSV Notes I think you can drop the filename check. If the CSV parser succeeds in parsing the file content that's proof enough that the file is OK. Note the use of {{@index}} to create uniqe HTML IDs. Your code created duplicate IDs, which defies the point of having IDs in the first place (and it's not allowed in HTML) You should think about switching to an MVVM framework for the whole application. Frameworks like knockout handle all HTML templating and DOM manipulation (you could drop Handlebars and almost all of your jQuery) and you would not need any "convert HTML to CSV" functionality anymore, either. Give it a look.
answers question: http://stackoverflow.com/q/29014976
accepted answer of: http://stackoverflow.com/q/29014976
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/46286054

http://stackoverflow.com/comment/46200124
comment on: http://stackoverflow.com/q/28973176
score: 0
type: QuestionComment
has text: I'm confused to what is it you want. Are you wanting to display the amount of names in your array or display a name at random because one minute you ask to display at random and now you're talking about getting the amount?
type: Comment

free-jqgrid
tags question: http://stackoverflow.com/q/29046843
tag name: free-jqgrid
tags question: http://stackoverflow.com/q/28972507
type: Tag

http://stackoverflow.com/q/28943507
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28944066
favorite count: 0
downvote count: 1
tagged with: asp.net
has title: I am not able to 'set checked' in dynamically added check box in asp.net
upvote count: 0
type: AnsweredQuestion
score: -1
accepted answer: http://stackoverflow.com/a/28944066
has comment: http://stackoverflow.com/comment/46141373
type: Question
has comment: http://stackoverflow.com/comment/46165514
has body: I have added a few checkboxes dynamically via jQuery in my ASPX page and I have tried to checked some checkbox default based on condition. It throws the following error: Uncaught TypeError: undefined is not a function I have tried below methods: $('#chl3388').setAttribute('checked', 'checked'); and document.getElementById("chl3388").checked = true;
answer count: 1

http://stackoverflow.com/comment/46287869
type: QuestionComment
comment on: http://stackoverflow.com/q/29019376
has text: Are you trying to grab a certain amount of items? Or just limit how many items get evaluated? DynamoDB's Scan API has a parameter (Limit), which will do the latter.
score: 1
type: Comment

http://stackoverflow.com/comment/46164102
type: QuestionComment
score: 0
has text: You need to write server-side code.
comment on: http://stackoverflow.com/q/28955330
type: Comment

http://stackoverflow.com/comment/137124465
type: Comment
score: 1
has text: Yes. The reason why most people don't explain in detail is partly because they've never actually needed to write the low-level code to do all this in C/C++ instead relying on higher lever blog articles on how things like node.js work. Secondly those who actually want to know the low level detail mostly know how to program in C/C++ and can just either reat the API documentation or read the source code of node.js or Chrome.
type: AnswerComment
comment on: http://stackoverflow.com/a/56713809

http://stackoverflow.com/q/28955170
tagged with: node.js
type: AnsweredQuestion
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/138506843
type: Question
linked to: http://stackoverflow.com/q/8549145
possible better answer: http://stackoverflow.com/a/28955201
accepted answer: http://stackoverflow.com/a/28955245
tagged with: javascript
has answer: http://stackoverflow.com/a/28955201
answer count: 2
has title: How to run a script when starting the Node.js console?
downvote count: 0
favorite count: 0
has body: Is there a way to configure the Node.js console window (node.exe) to run a script on startup? I'd like to do some minor initialization automatically each time, such as setting variables and colors. It's not sufficient to just run node.exe myinitscript.js. That will run the script and then exit. I'd like to run the script, and then remain in in the console environment.
linked to: http://stackoverflow.com/q/9781218
has answer: http://stackoverflow.com/a/28955245
has comment: http://stackoverflow.com/comment/46163915

http://stackoverflow.com/comment/46270991
type: AnswerComment
has text: This does not exactly what OP asks, but I am nitpicking here :). It executes opacity and height simultaneously.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29012951

http://stackoverflow.com/q/29038406
has title: dd-collapse-text with emoji filter
has body: I'm using dd-collapse-text directive to collapse descriptions in my webpage and works fine. Result example (not for 350 characters): Lorem Ipsum ... (more) But, now I want to use it for the comments; and they are filtered with emoji filter for the icons. And this is not working.: The result is the same that this code... All the comment text, with emoji icons. What I need to change or do in my code? Any idea? Thank you. Below I put the dd-collapse-text directive. (function () { 'use strict'; angular .module('core') .directive('ddCollapseText', collapseText); collapseText.$inject = ['$compile']; /* @ngInject */ function collapseText($compile) { return { restrict: 'A', replace: true, link: function(scope, element, attrs) { // start collapsed scope.collapsed = false; // create the function to toggle the collapse scope.toggle = function() { scope.collapsed = !scope.collapsed; }; // get the value of the dd-collapse-text attribute attrs.$observe('ddCollapseText', function(maxLength) { // get the contents of the element var text = element.text(); if (text.length > maxLength) { // split the text in two parts, the first always showing var firstPart = String(text).substring(0, maxLength); var secondPart = String(text).substring(maxLength, text.length); // create some new html elements to hold the separate info var firstSpan = $compile('' + firstPart + '')(scope); var secondSpan = $compile('' + secondPart + '')(scope); var moreIndicatorSpan = $compile('...')(scope); var toggleButton = $compile('{{collapsed ? "less" : "more"}}')(scope); // remove the current contents of the element // and add the new ones we created element.empty(); element.append(firstSpan); element.append(secondSpan); element.append(moreIndicatorSpan); element.append(toggleButton); } }); } }; } })();
answer count: 1
has comment: http://stackoverflow.com/comment/46422844
has comment: http://stackoverflow.com/comment/46317992
tagged with: angularjs-directive
tagged with: mean-stack
accepted answer: http://stackoverflow.com/a/29335781
tagged with: javascript
type: AnsweredQuestion
tagged with: angularjs-filter
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/29335781
score: 0

http://stackoverflow.com/comment/46326420
comment on: http://stackoverflow.com/a/29043136
has text: It was hard to tell if he needed a string or not. If he does, then just drop the `.clone()` and save the `.html()` in a variable and you're good to go! :-)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28912232
has comment: http://stackoverflow.com/comment/46083427
upvote count: 6
has comment: http://stackoverflow.com/comment/46083300
has comment: http://stackoverflow.com/comment/80205791
has comment: http://stackoverflow.com/comment/46083299
has comment: http://stackoverflow.com/comment/80207203
has comment: http://stackoverflow.com/comment/46083264
downvote count: 0
has comment: http://stackoverflow.com/comment/46083207
answers question: http://stackoverflow.com/q/28912097
has body: Currying is just technique, that can make use of any language feature (e.g. closures) to achieve the desired result, but it is not defined what language feature has to be used. As of that currying does not require to make use of closures (but in most of the cases closures will be used) Here a little example of the usage of currying, with and without the usage of closure. With the use closure: function addition(x,y) { if (typeof y === "undefined" ) { return function (y) { return x + y; } } return x + y; } var additionRemaining = addition(3); // Currying additionRemaining(5);//add 5 to 3 With the use of new Function instead of closure (partial evaluation): function addition(x,y) { if (typeof y === "undefined" ) { return new Function('y','return '+x+' + y;'); } return x + y; } var additionRemaining = addition(3); // Currying additionRemaining(5);//add 5 to 3
has comment: http://stackoverflow.com/comment/46083082
type: Answer
has comment: http://stackoverflow.com/comment/80207869
has comment: http://stackoverflow.com/comment/46083186
score: 6
has comment: http://stackoverflow.com/comment/46083066

http://stackoverflow.com/q/28917363
has comment: http://stackoverflow.com/comment/46092534
has comment: http://stackoverflow.com/comment/46092628
has answer: http://stackoverflow.com/a/47587167
tagged with: javascript
has body: So I've been having some issues trying to get the 'Particle.JS' to work. When checking the console, it says "ParticleJS is not defined", but I defined the id as 'particles'. Very grateful for the help, in future ref. We Love Simple, Responsive, Minimal, Fun .wrapper h1 { font-size: 55px; font-weight: 100; margin-top:15%; } .canvas{ width:100%; height:95%; background:url(../img/banner.jpg) center; background-size:cover; position:relative; overflow:hidden;} #particles {z-index: 4;height: 100%;height: 100vh;} particlesJS('particles', { particles: { color: '#fff', color_random: false, shape: 'triangle', // "circle", "edge" or "triangle" opacity: { opacity: 1, anim: { enable: true, speed: 1.5, opacity_min: 0, sync: false }
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46092977
tagged with: http://stackoverflow.com/tag/html
has title: ParticleJS is not defined
tagged with: css
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/46107233
has text: thanks! im just a beginner at this so its hard but thanks for the help!
type: AnswerComment
comment on: http://stackoverflow.com/a/28925167
score: 0
type: Comment

http://stackoverflow.com/comment/46347623
comment on: http://stackoverflow.com/q/29055032
score: 0
type: QuestionComment
has text: Are you starting the server using port 80? Have you set `+x` permissions to `bin/www`?
type: Comment

http://stackoverflow.com/comment/46144336
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28945014
has text: What is “messy” about using two loops to go through an appropriate data structure?
score: 1

http://stackoverflow.com/comment/46275510
comment on: http://stackoverflow.com/q/29015391
score: 3
has text: Why do you want to submit the form twice? If you're going to submit the form "the normal way" then don't bother with AJAX in the first place.
type: Comment
type: QuestionComment

prototypejs
tags question: http://stackoverflow.com/q/28986717
type: Tag
tag name: prototypejs
tags question: http://stackoverflow.com/q/29033913

http://stackoverflow.com/a/29040001
type: Answer
has comment: http://stackoverflow.com/comment/46322542
has comment: http://stackoverflow.com/comment/46321482
answers question: http://stackoverflow.com/q/29039606
has comment: http://stackoverflow.com/comment/46320554
score: 0
has body: I have created the menu only using css please check the following fiddle https://jsfiddle.net/dwgpqncw/2/ also the code for the same is posted below css menu Home Home link 1 Home link 2 Home link 3 A Empressa Empressa link 1 Empressa link 2 Empressa link 3 Empressa link 4 Protfolio Protfolio link 1 Protfolio link 2 Contato Contato link 1 Contato link 2 Contato link 3 Contato link 4

http://stackoverflow.com/q/29003673
type: AnsweredQuestion
has title: Check if the form elements is visible or not using javascript
score: 1
type: Question
has comment: http://stackoverflow.com/comment/46254078
has answer: http://stackoverflow.com/a/29003827
downvote count: 0
tagged with: javascript
has body: Below is the JavaScript function to check the if the all the elements present in the form is filled by the user. var frm_elements = envelopes.elements; for (i = 0; i &lt; frm_elements.length; i++) { field_type = frm_elements[i].type.toLowerCase(); switch (field_type) { case "text": if(frm_elements[i].value == "" || frm_elements[i].value == null) { if(frm_elements[i].style.display == "block") { alert("Enter All Text Box details"); return false; break; } } case "select-one": case "select-multi": if(frm_elements[i].selectedIndex == -1) { if(frm_elements[i].style.display == "block") { alert("Select Any Field From Drop Down"); return false; break; } } default: break; } the problem is I am using JavaScript method to hide some fields. Below is the code which I am using it to achieve. document.getElementById('stTxtMapName1').style.display = 'none'; For making it viewable, below piece of code is being used by me. document.getElementById('stTxtMapName1').style.display = 'none'; So I have to check the fields only which is visible to the user ... So I am using this condition to check if it is visible. if(frm_elements[i].style.display == "block") { alert("Enter All Text Box details"); return false; break; } The above code is not working. Please provide any alternate way of checking this.
accepted answer: http://stackoverflow.com/a/29003827
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29003928
favorite count: 0
has answer: http://stackoverflow.com/a/29003806
upvote count: 1
possible better answer: http://stackoverflow.com/a/29003806
has comment: http://stackoverflow.com/comment/46254042
has comment: http://stackoverflow.com/comment/46254088

http://stackoverflow.com/comment/46076635
comment on: http://stackoverflow.com/q/28908527
score: 2
has text: I was about to ask the same question, would you share a jsfiddle?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29003475
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46254022
score: 0
has comment: http://stackoverflow.com/comment/46253844
type: Answer
has body: Okay, your html looks like this: &lt;img id="img1" src="image1.jpg" /&gt; It shows the phone. Your JS looks like this: var img = document.getElementById("img1"); img.addEventListener("mouseenter", function( event ) { //replace the imagesource with the second image }, false); https://developer.mozilla.org/en-US/docs/Web/Events/mouseover https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
answers question: http://stackoverflow.com/q/29003054
has comment: http://stackoverflow.com/comment/46254104
accepted answer of: http://stackoverflow.com/q/29003054
has comment: http://stackoverflow.com/comment/46254375
has comment: http://stackoverflow.com/comment/46254240
has comment: http://stackoverflow.com/comment/46253978

http://stackoverflow.com/q/28998201
type: Question
score: -1
tagged with: tinymce-4
has body: I'm using wiris plugin to enter equation. However, when i save the editor and refresh the page the equation is replaced with plain text. Anyone else having this issue? any other equation plugin for tiniMCE?
upvote count: 0
answer count: 1
tagged with: javascript
has title: wiris plugin is working in tinymce on equation save
favorite count: 0
tagged with: tinymce
has answer: http://stackoverflow.com/a/29007591
type: UnansweredQuestion
downvote count: 1

http://stackoverflow.com/q/28924086
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46104815
accepted answer: http://stackoverflow.com/a/28924175
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28924219
possible better answer: http://stackoverflow.com/a/28924362
score: 0
has comment: http://stackoverflow.com/comment/46104750
has answer: http://stackoverflow.com/a/28924362
answer count: 3
has title: How to use Radio button to open local HTML pages?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28924175
tagged with: php
has body: I am developing a webpage which has radio buttons and pertaining options. On selecting a radio button, I would like to open the corresponding html page. The only solution I found to this problem contained URLs to external webpages, which is something that I don't want. The HTML code I have right now is: Welcome! Select your user classification below: Admin HOD Teaching Staff Non Teaching Staff CR Student An example: If I select admin and click on submit, I would like to open "admin.html" which is in the same folder as "index.html" Solutions using Javascript, JQuery and PHP will be appreciated.

http://stackoverflow.com/q/28911052
has answer: http://stackoverflow.com/a/28911168
has comment: http://stackoverflow.com/comment/46081182
accepted answer: http://stackoverflow.com/a/28911182
tagged with: css
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/28109129
has body: Adding what seems to be an innocuous class to an element having a class containing :first-letter causes the first letter, under some circumstances, to be rendered incorrectly. An element originally has class "unindent", and then class "menuitemon" is added. The fiddle http://jsfiddle.net/pgf3reyt/4/ shows this working on one element, and not working on another. Works OK in Firefox. p.unindent { color: #555555; background-color: #e6e6e6; border-bottom: 1px solid #d3d3d3; border-left: 1px solid rgba(0,0,0,0); /* so things are the same size so we don't develop scroll bars*/ border-right: 1px solid rgba(0,0,0,0); border-top: 1px solid rgba(0,0,0,0); padding-top: 2px; padding-bottom: 2px; padding-left: 25px; padding-right: 5px; margin-top: 0; margin-bottom: 0; } p.unindent:first-letter { margin-left: -20px; } p.unindent.menuitemon { color: #e6e6e6; background: #555555; border: 1px solid #222222; border-radius: 4px; } Can someone point out what I might be doing wrong that's causing this?
upvote count: 2
tagged with: google-chrome
tagged with: pseudo-element
type: Question
has comment: http://stackoverflow.com/comment/46081090
tagged with: javascript
has answer: http://stackoverflow.com/a/28911182
has answer: http://stackoverflow.com/a/50287934
has comment: http://stackoverflow.com/comment/46081009
answer count: 3
score: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/50287934
favorite count: 0
has title: Odd behavior of :first-letter in Chrome

http://stackoverflow.com/q/29024178
has answer: http://stackoverflow.com/a/29024205
tagged with: javascript
tagged with: jquery
has title: traversing in jquery DOM failed?
score: 0
has answer: http://stackoverflow.com/a/29024188
favorite count: 0
upvote count: 1
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29024188
has comment: http://stackoverflow.com/comment/46291048
type: Question
has body: I want to remove the inputs when I click the button. Below is my DOM I tried but didn't work. $('#changePassword').click(function(){ $(this).find('.modal-body .inputWrap input').remove(); }); I also tried $(this).find('.modal-body .inputWrap input').remove();
answer count: 2
possible better answer: http://stackoverflow.com/a/29024205

http://stackoverflow.com/q/29006462
has title: $_SESSION lost on AJAX request
type: Question
tagged with: session
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I've got a Smarty project which works with jQuery as well, where I struggled about an issue some days ago. index.php session_start(); require_once 'controller.php'; *//nothing else happens here* I load my controllers and templates then controller.php &lt;?php isset($_GET[controller]) ? $controller="/".$_GET[controller] : $controller = "/index"; isset($_GET[department]) ? $department="/".$_GET[department] : $department = "/index"; require_once "controller".$department.$controller.".php"; $smarty-&gt;display("templates" . $department . $controller . ".tpl"); on page load my jQuery auto loads different sub-templates and I've echoed the $_SESSION content at the beginning of each controller file Here's my JS autoload_subtemplate = function(data) { var target = data.target; var id = data.id; *//fill target container* var page2load = data.page.split("_"); $.get("http://"+GLOB_ENV+"MYDOMAIN/"+page2load[0]+"/"+page2load[1]+"?" + "import=1" + "&amp;data=" + JSON.stringify(data),function(content){ $("#"+target).html(content); *//searching for content to autoload* if( $('#'+target).parent().attr("id")=="content" ){ $("a.auto.loadsubtpl").each(function(){ var load = $(this).attr("loadtarget"); var page = $(this).attr("loadpage").split("_"); //**************************************************** //the file, loading now, returns an empty $_SESSION //NOTE: it's the same action, as the $.get some lines above //where the SESSION is NOT lost!!! //**************************************************** $.get("http://"+GLOB_ENV+"MYDOMAIN/"+page[0]+"/"+page[1] +"?import=1" +"&amp;data=" + JSON.stringify(data),function(details){ $("#"+load).append(details); $(this).addClass("active"); $("#"+load).show(); }); }); } } ); return false; }; Now the weird thing: If I put an echo "whatever"; into my root/index.php, right after the session_start(); the $_SESSION is still there. As this workaround is kinda stupid i'm wondering if there is someone out there, who has a explanation for this. I simply ca…
has answer: http://stackoverflow.com/a/29006623
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46258986
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/46258807
has comment: http://stackoverflow.com/comment/46258880
score: 1

http://stackoverflow.com/comment/46322466
has text: Sorry for the sloppiness with putting up that code!
type: Comment
comment on: http://stackoverflow.com/a/29039650
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46168536
has text: As suggested by you in the question's comment, I added Header set Access-Control-Allow-Origin "*" to .htaccess. I created this .htaccess file and placed it in my site's root directory and it started to work. Then, I removed the .htacess file from that folder but my app continued to work. Not sure what happened there. Will try what you have suggested here and let you know. Thanks !
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28929494

http://stackoverflow.com/a/29003500
has body: check updated code. move td inside find() selector. $('div#divid tbody.tbodyClass tr.trClass').each(function() { $(this).find("td input:text,select").each(function() { textVal = this.value; inputName = $(this).attr("name"); formData+='&amp;'+inputName+'='+textVal; }); InsideCount++ });
answers question: http://stackoverflow.com/q/29003462
score: 5
upvote count: 5
downvote count: 0
type: Answer

http://stackoverflow.com/comment/46264160
type: QuestionComment
comment on: http://stackoverflow.com/q/29008618
has text: by the way, do you know a local web server for ubuntu 14.04?
score: 0
type: Comment

http://stackoverflow.com/q/29026388
tagged with: angularjs
has body: I am trying to inject uppercase filter as dependency injection to controller , I tried injecting the orderByFilter and it worked flawlessly. you can refer to my sample Plunker project PlunkerLink var app = angular.module("myApp", []) .controller('HomeController',function($scope,orderByFilter,uppercaseFilter) { $scope.sortOrder = '-id'; $scope.upperCase = 'fName'; $scope.users = [ { id: 1, fName: 'Hege', lName: "Pege" }, { id: 2, fName: 'Kim', lName: "Pim" }, { id: 3, fName: 'Jack', lName: "Jones" }, { id: 4, fName: 'John', lName: "Doe" }, { id: 5, fName: 'Peter', lName: "Pan" } ]; $scope.users = orderByFilter($scope.users, $scope.sortOrder); $scope.users = uppercaseFilter($scope.users, $scope.upperCase); });
has answer: http://stackoverflow.com/a/29026545
type: AnsweredQuestion
tagged with: javascript
score: 4
type: Question
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/29026912
accepted answer: http://stackoverflow.com/a/29026545
has comment: http://stackoverflow.com/comment/46294793
downvote count: 0
has title: how to inject uppercaseFilter in angular?
favorite count: 0
possible better answer: http://stackoverflow.com/a/29026912

http://stackoverflow.com/q/29014208
tagged with: javascript
tagged with: jquery
answer count: 3
has answer: http://stackoverflow.com/a/29014329
score: 1
favorite count: 0
has title: Convert input field clearing from jQuery to Javascript
has answer: http://stackoverflow.com/a/29014258
upvote count: 1
has comment: http://stackoverflow.com/comment/46273298
type: AnsweredQuestion
has body: My trouble is not with the action of clearing the input field - I know the elem.value = "" I am having more trouble getting the right selector in Javascript. While my jQuery works fine on the site - all other function are in Javascript, so I would like to keep consistency since it isn't that difficult. Here is the jQuery: function clearShipToFields(){ $('input.ship_to_value').each(function(){ this.value = ""; }); } what I was trying to do in Javascript but wasn't working: var shipTo = document.getElementsByClassName('ship_to_value'); //This is where I am stuck - I don't know how to single out input fields only I may need to go a different direction and get the input fields first and then filter by class? var inputFields = document.getElementsByTagName('input'); For Loop inputFields[i].getElementsByClassName('ship_to_value').value = ""; End For There are multiple fields with the class ship_to_value but I would only like to select the input field. Must also support pre-IE8
has answer: http://stackoverflow.com/a/29014296
has comment: http://stackoverflow.com/comment/46273363
accepted answer: http://stackoverflow.com/a/29014258
type: Question
possible better answer: http://stackoverflow.com/a/29014296
has comment: http://stackoverflow.com/comment/46273577
downvote count: 0

http://stackoverflow.com/comment/90554306
has text: you found a solution ?
comment on: http://stackoverflow.com/q/28932353
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28971088
type: Question
tagged with: ios
tagged with: timeout
tagged with: javascript
has title: WKWebView does not finish/timeout when there is no internet access
linked to: http://stackoverflow.com/q/9521298
answer count: 2
has answer: http://stackoverflow.com/a/31222549
has answer: http://stackoverflow.com/a/29018626
downvote count: 0
upvote count: 23
tagged with: wkwebview
favorite count: 0
type: UnansweredQuestion
has body: There is a remote Javscript asset tag on a local HTML page I'm navigating to via WkWebView that never finishes downloading (in both the case that the iOS device is not connected to the internet, or the device's internet is too slow). Unfortunately, the WKWebView never aborts trying to download this asset nor does it ever move on to my WKNavigationDelegate (i.e. neither -webView:didFailNavigation:withError: nor -webView:didFinishNavigation: neither are called), so users are stuck with a blank HTML page that never fully resolves and never errors out. Thankfully in some scenarios I've debugged via the Safari remote iOS Javascript debugger, I've noticed we get the error Failed to load resource: The Internet connection appears to be offline logged to the console, but in others (like certain devices in Airplane Mode) the WKWebView never seems to timeout with this error or give up, so no WKNavigationDelegate callbacks get fired. You can reproduce this scenario on your own by using the iOS 8.2 simulator with any WKWebView iOS application, navigate to any locally served HTML file, then add a script tag with any remote URL, then throttle your Internet connection to "100% Loss" using Apple's Network Link Conditioner. What would be the best way to force a WkWebView to timeout/return via an error or success callback to its WKNavigationDelegate?
linked to: http://stackoverflow.com/q/30743408
score: 23

http://stackoverflow.com/comment/46220359
score: 0
has text: I have added the full software in its original form at the question as a link.
comment on: http://stackoverflow.com/a/28985600
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46417981
type: AnswerComment
has text: can i use submit button for that?
comment on: http://stackoverflow.com/a/29007510
score: 0
type: Comment

http://stackoverflow.com/a/29002257
score: 7
upvote count: 7
has comment: http://stackoverflow.com/comment/46292662
has comment: http://stackoverflow.com/comment/46293479
downvote count: 0
answers question: http://stackoverflow.com/q/29002220
type: Answer
has body: Probably browser can not find your external js file, because of wrong path. Try to put function inside the &lt;head&gt; section of the page and if worked, The problem is wrong path to js file.

http://stackoverflow.com/comment/46202890
has text: I have to say that working with JS seems more rewarding as far as developing cool features and functionality. Amazing what can be done with it now days!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28975704
type: Comment

http://stackoverflow.com/comment/46260782
score: 1
has text: Can you please provide us the current HTML and CSS? You may workaround that using the "RGBA" exploit, despite it is not supported in every browser.
comment on: http://stackoverflow.com/q/29007672
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29046466
has body: If you need to do multiply query against this array, I suggest you using the following code to convert the array to a json object: var newObj = yourArray.reduce(function(previousValue, currentValue, index, array) { return previousValue[currentValue.name] = currentValue; }, {}); You will get: {"Math":{"name": "Math", unit: "3"}, "Physics":{"name": "Physics", unit: "3"}, ...} You only loop once but you can reuse it later.
downvote count: 0
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29046343

http://stackoverflow.com/comment/46255423
score: 0
comment on: http://stackoverflow.com/q/28946553
has text: As the issue is of the date format only, I made a new post here on StackOverflow, where I specifically address this issue. Hopefully this will make it easier for both repliers and other people with the same issue. See: http://stackoverflow.com/questions/29004501/php-date-to-javascript-new-data-inside-array
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29024028
has title: Meteor Routing, Pub/Sub
tagged with: iron-router
tagged with: publish-subscribe
type: AnsweredQuestion
has body: I'm trying to make a publishment statement to publish ONLY the author(OP)'s profile avatar. I am thinking of grabbing the _id of the page. And from that page, I will grab the userId which is the author's _id and try to show the profile. However, I have been very unsuccessful, and currently, I am using the following. Publishing EVERY user's profile avatar. Publications.js //Need to filter this to show only OP. Meteor.publish("userPostAvatar", function() { return Meteor.users.find( {} , { fields: {'profile.avatar': 1} }) }); Meteor.publish('singlePost', function(id) { check(id, String); return Posts.find(id); }); Router.js Router.route('/posts/:_id', { name: 'postPage', waitOn: function() { return [ Meteor.subscribe('singlePost', this.params._id), Meteor.subscribe('userStatus'), Meteor.subscribe('userPostAvatar') ]; }, data: function() { return Posts.findOne({_id:this.params._id}); } });
accepted answer: http://stackoverflow.com/a/29024633
type: Question
tagged with: mongodb
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29024256
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29024256
linked to: http://stackoverflow.com/q/28969223
tagged with: meteor
has answer: http://stackoverflow.com/a/29024633

http://stackoverflow.com/q/28921638
accepted answer: http://stackoverflow.com/a/28922092
tagged with: javascript
tagged with: google-maps-api-3
upvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28922092
score: -1
type: AnsweredQuestion
tagged with: iframe
downvote count: 1
has title: Get Google Maps v3 corner coordinates from iFrame to parent page
has body: I have a Google Map with marker data pulled from my database on my website inside an iFrame. I know that with Maps v3 it is possible to get the new corner GPS coordinates when the map is moved in JavaScript. Is it possible to pass this map information from the map page inside the iFrame to the parent page so I can change the content on the parent page to match what the map is showing with JavaScript? Both pages are on my same server. I imagine that worst case scenario I can just have the JavaScript write the map corner info to a session variable and read that on the parent, but is there a simpler way?
type: Question

http://stackoverflow.com/q/28955410
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/46164233
has body: $('.Arrow').click(function(){ runFunc(); }); runFunc have multiple fadeOut and fadeIn to change images, if the user click too fast, some element forward faster and become inconsistent. I tried to prevent double click like $("*").dblclick(function(e){ e.preventDefault(); }); but it doesn't solved my problem. I tried on and off the click event but I have to put the runFunc within the handler, so I can't bind the click event. Assume runFunc is a image slider, how to prevent click too fast on the left and right arrows?
type: Question
tagged with: javascript
tagged with: jquery
has title: prevent default to stop too fast clicking
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46164305

http://stackoverflow.com/comment/46343078
type: AnswerComment
type: Comment
has text: i think he wants to sync the highlighting to the audio
score: 0
comment on: http://stackoverflow.com/a/29052700

http://stackoverflow.com/comment/46240647
type: Comment
has text: That should work, I think, but like I said, I pretend to put several templates in one file, to avoid too many http requests and having multiple tiny templates files, anyway I also have a similar code to replace an inline defined template the same way and that template works always.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28995826

http://stackoverflow.com/comment/46326625
score: 0
type: AnswerComment
type: Comment
has text: I was just inconsistent with the variable names. After both have been changed to accessCode the problem still remains.
comment on: http://stackoverflow.com/a/29023357

http://stackoverflow.com/comment/46275368
type: QuestionComment
comment on: http://stackoverflow.com/q/29015326
score: 2
has text: How are you currently doing it?
type: Comment

http://stackoverflow.com/q/28959313
accepted answer: http://stackoverflow.com/a/28959350
has comment: http://stackoverflow.com/comment/46171140
tagged with: javascript
tagged with: jquery
score: 0
possible better answer: http://stackoverflow.com/a/28960316
has body: I am having a few divs with some data : data1 data2 data3 I would like to allow the user ordering them the way he likes. What would be the best solution to do so ? I was thinking about adding two arrows buttons to every div with the possibility to move them up or down.
has title: Order div with jQuery
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28960316
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28959350

http://stackoverflow.com/comment/46203096
comment on: http://stackoverflow.com/q/28975874
score: 1
has text: Not sure I get what troubles you. Is this what you want to achieve https://jsfiddle.net/L9f10vq6/1/ ?
type: Comment
type: QuestionComment

asynchronous
tags question: http://stackoverflow.com/q/29060788
tags question: http://stackoverflow.com/q/28908788
tags question: http://stackoverflow.com/q/28978103
tags question: http://stackoverflow.com/q/28921181
tags question: http://stackoverflow.com/q/28910224
tags question: http://stackoverflow.com/q/29010354
tags question: http://stackoverflow.com/q/29050363
type: Tag
tags question: http://stackoverflow.com/q/29049873
tags question: http://stackoverflow.com/q/28997741
tag name: asynchronous
tags question: http://stackoverflow.com/q/28970570
tags question: http://stackoverflow.com/q/29008273
tags question: http://stackoverflow.com/q/28921127
tags question: http://stackoverflow.com/q/28908043
tags question: http://stackoverflow.com/q/28922744
tags question: http://stackoverflow.com/q/29047069
tags question: http://stackoverflow.com/q/29053448
tags question: http://stackoverflow.com/q/28977661
tags question: http://stackoverflow.com/q/28953720
tags question: http://stackoverflow.com/q/29000772
tags question: http://stackoverflow.com/q/28940040
tags question: http://stackoverflow.com/q/29042728
tags question: http://stackoverflow.com/q/28940153
tags question: http://stackoverflow.com/q/28927618
tags question: http://stackoverflow.com/q/28934526
tags question: http://stackoverflow.com/q/29062129
tags question: http://stackoverflow.com/q/28954237
tags question: http://stackoverflow.com/q/28993673
tags question: http://stackoverflow.com/q/28962328
tags question: http://stackoverflow.com/q/28967351
tags question: http://stackoverflow.com/q/28951617
tags question: http://stackoverflow.com/q/28908180
tags question: http://stackoverflow.com/q/28930034
tags question: http://stackoverflow.com/q/28972778

http://stackoverflow.com/comment/46170444
comment on: http://stackoverflow.com/a/28952491
has text: Looking up another entry with the same 'game type' ('A', 'B', 'C') could be done trough a hashtable or a hash index. The time that takes depends mostly on implementation details since it's asymptotically O(1). The constant time should be in the microseconds regime, so your network latency will be many orders larger than that. No need to worry...
score: 0
type: AnswerComment
type: Comment

ssl
tags question: http://stackoverflow.com/q/28967310
type: Tag
tag name: ssl
tags question: http://stackoverflow.com/q/29058557

http://stackoverflow.com/comment/46284305
type: Comment
has text: Hi Crowder thanks for your suggestion .but if the function contains jQuery inside it and I want to replace it then could it be possible using bookmarklet to change the function def?
type: AnswerComment
comment on: http://stackoverflow.com/a/29020134
score: 0

http://stackoverflow.com/comment/46138534
comment on: http://stackoverflow.com/q/28941449
type: QuestionComment
has text: so you know, I've tested this on my machine and the plugin is giving me an error: `TypeError: d.children(...).css(...).end(...).removeClass(...).addClass(...).attr(...).children(...).stop is not a function` using both your data and the example on the jstree site, so you might want to log an issue about this with the author because This isn't to do with your code as far as I can tell.
type: Comment
score: 0

http://stackoverflow.com/comment/47586552
comment on: http://stackoverflow.com/q/28956324
has text: There is a fork on npm here: https://www.npmjs.com/package/minimongo
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/29002364
answers question: http://stackoverflow.com/q/29002328
upvote count: 1
type: AcceptedAnswer
has body: This is an object inside an array. You can access the properties as: data[0].item1 data[0].item2 data[0].item3
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29002328
score: 1

http://stackoverflow.com/comment/46328696
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29044325
has text: So even the `spiderfyOnMaxZoom` option for markercluster isn't good enough for your needs?

http://stackoverflow.com/q/29003455
score: 0
has title: Move term to another Branch - JSOM
has body: I need to do something like this. Below image there are 3 Terms, I need to move My Term 3 , under My Term 1 ( Then My Term 3 will go as a sub-term for My Term 1. How can i achive this using JSOM, 2013 Sharepoint. Here i've used the code i used to reuse term, but reusing means just sharing. I though reuse the term and delete that later, but it does delete both.I just need to move, any idea? MSDN doesn't give method for moveTerm.. function reuseTerm() { alert('check reuse'); var sourceTermId = 'c0351a3d-5eec-454d-8bc6-4f3ac0992a84'; //Id of source Term var destTermId = '2085753f-2804-44c4-b16d-5b93cbbc989d'; //Id of Term below which a reused term will be created var ctx = SP.ClientContext.get_current(); var taxonomySession = SP.Taxonomy.TaxonomySession.getTaxonomySession(ctx); var sourceTerm = taxonomySession.getTerm(sourceTermId); var destTerm = taxonomySession.getTerm(destTermId); destTerm.reuseTerm(sourceTerm, true);//I need something like destTerm.moveTerm(sourceTerm, true); ctx.executeQueryAsync( function () { alert('Reused term has been created'); }, function (sender, args) { alert(args.get_message()); }); }
tagged with: sharepoint-online
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29005277
tagged with: git
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: sharepoint

http://stackoverflow.com/a/29060032
answers question: http://stackoverflow.com/q/29059714
score: 1
has body: &lt;li class='data' data-item="&lt;?=$row['name']?&gt;" data-item-id="&lt;?=$row['fk_module_id']?&gt;"&gt; jQuery(document).ready(function($){ url = " Your php file url/savelist.php"; var allVals = []; $('.btn').click(function(){ $('.data').each(function() { allVals.push($(this).val()); }); $.post(url,{ array : allVals }, function(response,status){ if(status == 'success'){ //ur stuffs return status; } }) }) }) it may help u ..
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29059714

http://stackoverflow.com/q/28914135
linked to: http://stackoverflow.com/q/15423955
tagged with: javascript
has answer: http://stackoverflow.com/a/28916876
has body: I have a custom directive myItems that is rendering a list of items using another directive myItem via ng-repeat: app.directive('myItems', function() { return { scope:{items:"="}, restrict:"E", template:" " }; }); Each item contains information (such as a color) that has be used for styling the elements. This works fine so far if I use the templating approach: app.directive('myItem', function() { return { restrict:"A", template:" myItem: {{item.name}} ", replace:true }; }); To support more involved features, I now want to rebuild the same functionality if my-item by manually creating all the needed stuff including the ng-style: app.directive('myItem', function($compile) { return { restrict:"A", compile: function(element) { element.removeAttr('my-item'); element.text('myItem: {{item.name}}'); element.attr('ng-style', '{color:item.color}'); // Why does it have no effect? var compileElement = $compile(element); return function link(scope, elem, attr) { compileElement(scope); // Why does binding with {{item.name}} even work without this statement? }; } }; }); Interestingly enough databinding using {{item.name}} works while ng-style does not. Here is a fiddle showing both approaches described above. I am aware of the similar question. But I think it does not apply here since I have no explicit statements about the scope of the my-item directive.
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28916876
type: AnsweredQuestion
has title: Custom directive in ng-repeat: Why does ng-style not apply?
type: Question
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/28914354
accepted answer: http://stackoverflow.com/a/28914354
score: 0
answer count: 2

http://stackoverflow.com/a/28993702
has comment: http://stackoverflow.com/comment/46235670
downvote count: 0
has comment: http://stackoverflow.com/comment/46235751
upvote count: 2
has body: Seems someone beat me to the punch with half of my solution while I was editing the fiddle, but I'll post this just because the second half should help you a bit with ensuring that only 2 of each card are posted. First off, to initialize the array, use the following: for(var c = 1; c &lt; 23; c++){ imgSources.push(c + ".png"); imgSources.push(c + ".png"); } This will iterate 22 times, adding files 1.png through 22.png twice each. Then, to ensure only two of each image are used: function getImage(){ var rand = Math.floor(Math.random() * imgSources.length); var str = imgSources[rand]; imgSources.splice(rand,1); return str; } What this will do is remove each array item as they are used, sort of like drawing cards from a deck, ensuring that only two of each image are used and avoiding the "keep trying until it works" approach you had. Fiddle
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28993275

http://stackoverflow.com/a/29000338
has body: You should use long instead. System.out.println(46022L*65535L); // = 3016051770 Java has ints and longs. System.out.println(Integer.MAX_VALUE); // = 2147483647 System.out.println(Long.MAX_VALUE); // = 9,223,372,036,854,775,807 As for the language difference, I can only attribute it to different precisions between the languages. If you see this question, you'll see the largest number in JS is 9,007,199,254,740,992. That's a guess, it might be for another reason.
score: 2
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29000317
upvote count: 2
has comment: http://stackoverflow.com/comment/46248385

http://stackoverflow.com/a/28946117
type: AcceptedAnswer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28945571
type: Answer
has body: I missed something obvious. The docs say: By default ReactTransitionGroup renders as a span So it was creating invalid markup within the table. I have set the component= property to "tr" which now works.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28945571

http://stackoverflow.com/comment/46143298
type: QuestionComment
comment on: http://stackoverflow.com/q/28943618
has text: OK so now I have the Pager class using the onClick="setCounter()" This works when i hard code the setCounter('Vertical') and gets the correct results. Now i need help figuring out a function to obtain the current slide from my sliders alt.
score: 0
type: Comment

http://stackoverflow.com/comment/46227711
comment on: http://stackoverflow.com/q/28978496
has text: The code is returning four li's in my code so I want to say if it's greater than four li's than create a div. THe problem I'm having is that my if statement doesn't work correctly.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28975156
favorite count: 0
type: UnansweredQuestion
has title: indexOf method in JavaScript
score: 1
type: Question
has comment: http://stackoverflow.com/comment/46201434
tagged with: indexof
has answer: http://stackoverflow.com/a/28975228
tagged with: javascript
has comment: http://stackoverflow.com/comment/46201484
has answer: http://stackoverflow.com/a/28975323
has body: So I have the line var a = document.cardform.cardnumber.value.toString; Then later: else if (a.indexOf(' ')!=0 ||a.indexOf('+')!=0 || a.indexOf('-')!=0){ This checks that the user hasn't entered any unwanted +'s, -'s, or ' 's. The line seems to raise an error that looks like this: Uncaught TypeError: undefined is not a function. I'm confused as to what it's telling me. Is it saying undefined isn't a function, or that 'a' is an incompatible data type? How do I fix this problem?
has comment: http://stackoverflow.com/comment/46201466
answer count: 2
has comment: http://stackoverflow.com/comment/46201433
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/28917366
has comment: http://stackoverflow.com/comment/46092942
has comment: http://stackoverflow.com/comment/46093806
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28918334
type: AnsweredQuestion
has body: Im trying to make drawing app where you can draw something on canvas and save your result as an image on the server by clicking "save" button. You can also put another image as background for your drawing. The problem is that when I put an image to the canvas using ctx.drawImage() I can't save the canvas as an image because nothing happens. Everything works ok until I use ctx.drawImage(). Why I can't save canvas as an image with another image in it? My ajax code: // it works until I use ctx.drawImage() $.ajax({ type: "POST", url: "save.php", data: {image: dataURL}, success: function() { alert('saved'); } }); Code for putting another image as background: //var ctx = can.getContext('2d'); var img = new Image; ctx.drawImage (img, 0, 0); My PHP code: &lt;?php $dataURL = $_POST["image"]; $parts = explode(',', $dataURL); $data = $parts[1]; $data = base64_decode($data); $fp = fopen('test.png', 'w'); fwrite($fp, $data); fclose($fp); ?&gt; This is the entire javascript code $(document).ready (function() { var color = $("#color").val(); $("#size").val("10"); var mouse = 0; var can = document.getElementById("canny"); var ctx = can.getContext('2d'); var offsetX = 158; var offsetY = 200; var img = new Image; var url = "http://i.imgur.com/fmAoxZ0.jpg"; img.src = url; function setBackground() { ctx.drawImage (img, 0, 0); } function setOpacity(newValue) { $("#canny").css ("opacity", newValue * 0.01); $("#txt-opacity").html(newValue + "%"); } $("body").mousedown(function(event) { color = $("#color").val(); var cordX = event.clientX - offsetX; var cordY = event.clientY - offsetY; var size = $("#size").val(); ctx.beginPath(); ctx.arc(cordX,cordY,size,0,2*Math.PI); ctx.fillStyle = color; ctx.fill(); document.getElementById("coords").innerHTML = "x: " + cordX + " y: " + cordY; mouse = 1; $("body").mousemove(function(event) { if (mouse == 1) { var cordX = event.clientX - offsetX; var cordY = event.clientY - offsetY; var size = $("#size").val(); ctx.beginPath(); ctx.arc(cordX,cordY,size,0…
score: 0
type: Question
has comment: http://stackoverflow.com/comment/46093122
has title: I can't save the canvas as an image when I use ctx.drawImage() to put another image in it
has comment: http://stackoverflow.com/comment/46093208
accepted answer: http://stackoverflow.com/a/28918334
tagged with: image
tagged with: canvas
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/46358722
type: Comment
has text: Yes, mine is the shorthand version :) So I agree with @Pointy post the code that fetches your javascripts, and where you are using the console.log at least
type: QuestionComment
comment on: http://stackoverflow.com/q/29061193
score: 0

python
tags question: http://stackoverflow.com/q/29040499
tags question: http://stackoverflow.com/q/28986594
tags question: http://stackoverflow.com/q/28911799
tags question: http://stackoverflow.com/q/29015257
tags question: http://stackoverflow.com/q/29056394
tags question: http://stackoverflow.com/q/28986688
tags question: http://stackoverflow.com/q/28909876
tags question: http://stackoverflow.com/q/29028747
tag name: python
tags question: http://stackoverflow.com/q/28928412
tags question: http://stackoverflow.com/q/29059716
tags question: http://stackoverflow.com/q/28975497
tags question: http://stackoverflow.com/q/28940894
tags question: http://stackoverflow.com/q/28989242
tags question: http://stackoverflow.com/q/28991578
tags question: http://stackoverflow.com/q/28957814
tags question: http://stackoverflow.com/q/29020988
tags question: http://stackoverflow.com/q/29015993
type: Tag
tags question: http://stackoverflow.com/q/28994871
tags question: http://stackoverflow.com/q/28923924
tags question: http://stackoverflow.com/q/29040118
tags question: http://stackoverflow.com/q/28974838
tags question: http://stackoverflow.com/q/29047056
tags question: http://stackoverflow.com/q/28987087
tags question: http://stackoverflow.com/q/28992064
tags question: http://stackoverflow.com/q/29024590
tags question: http://stackoverflow.com/q/28958975
tags question: http://stackoverflow.com/q/28956713

http://stackoverflow.com/a/29023049
has comment: http://stackoverflow.com/comment/46304597
score: 0
has comment: http://stackoverflow.com/comment/46309145
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/46307475
has comment: http://stackoverflow.com/comment/46304556
has comment: http://stackoverflow.com/comment/46303975
answers question: http://stackoverflow.com/q/29022850
has body: Here's the JSFiddle for this. I would suggest having one piece of code and fading in and out your images, as opposed to all of your HTML. This code puts a CSS transition on bootstrap's collapse class, and when that class is toggled, the images fade in by setting the opacity to 1. Use this HTML: &lt;div&gt; &lt;img class="togglingimage twosecondfade" src="http://i.imgur.com/mIi9fAs.jpg"/&gt; &lt;img class="togglingimage twosecondfade" src="http://i.imgur.com/LLh5tTS.jpg"/&gt; &lt;img class="togglingimage twosecondfade collapse" src="http://i.imgur.com/4x1yqLu.jpg"/&gt; &lt;img class="togglingimage twosecondfade collapse" src="http://i.imgur.com/v6ydmmQ.jpg"/&gt; &lt;/div&gt; With this Javascript: var timeUntilTransition = 1000; function toggleRows() { $(".togglingimage").toggleClass("collapse"); } window.setTimeout(function () { toggleRows(); }, timeUntilTransition); And this CSS: @import url('http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css'); .twosecondfade { -webkit-transition: opacity 2.00s linear; -moz-transition: opacity 2.00s linear; -o-transition: opacity 2.00s linear; transition: opacity 2.00s linear; } .togglingimage.collapse { opacity: 0; }
has comment: http://stackoverflow.com/comment/46289364
has comment: http://stackoverflow.com/comment/46304270
accepted answer of: http://stackoverflow.com/q/29022850
has comment: http://stackoverflow.com/comment/46295972

http://stackoverflow.com/comment/46183788
has text: @Veverke no, you can't say that. The order is _never_ guaranteed on an `Object`, although in a `Set` it's guaranteed to be in insertion order.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/28965112
type: QuestionComment

http://stackoverflow.com/q/28934766
type: UnansweredQuestion
type: Question
tagged with: responsive-design
has title: check to see if div is already showing, and hide it
score: 0
has comment: http://stackoverflow.com/comment/46125219
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I am working on the responsive design of my website for mobile phones. I have an "img" tag inside of an "a" tag for 3 icons, like this: &lt;a href="#"&gt;&lt;img src="images/webIcon.png" data-attr="webIcon"&gt;&lt;/a&gt; On all other screen sizes, when a user hovers over the icon, a description appears, and then disappears again when they mouse-off. But on mobile phones, by the time they scroll down to view the description, it's gone, so I'm changing it to a click event on the "a" tag. I've successfully added the content where I want it when the user clicks on the appropriate icon, but I'm having trouble hiding it when the next icon is clicked, or if they click the same one again. Here is what I have: $('#mobileServices a').hover(function(e) { e.preventDefault(); //Grab the corresponding description for the icon data = $(this).children('img').attr('data-attr'); section = $('#' + data + '').html(); //Plop in the new section containing the description below the icon $(this).after('&lt;section class=' + data + '&gt;' + section + '&lt;/section'); //So I figured perhaps I should store-off the new sections for later use newSection = $('section.' + data + ''); }); So then I thought: I'll use a simple if statement to check if the newSection is visible, and if it is, hide it (or slide it up, or slideToggle it), but that logic isn't working. I'm getting into the if statement, because I checked it with console.log(s). I tried something like: if('section:visible') { newSection.slideToggle(); } But obviously that doesn't work, because it just slides it down and then up right away. So, now I'm stuck... Any help is greatly appreciated!!!!!
has answer: http://stackoverflow.com/a/28934872

http://stackoverflow.com/comment/46081222
type: QuestionComment
comment on: http://stackoverflow.com/q/28911198
score: 0
has text: @Claies there is nothing wrong with the code. It's just I don't know how it works and hope to get the understanding here.
type: Comment

http://stackoverflow.com/comment/46601506
type: QuestionComment
comment on: http://stackoverflow.com/q/28947148
score: 0
has text: @gallifrey1212 Did you ever find an answer to this?
type: Comment

http://stackoverflow.com/q/29005065
answer count: 2
downvote count: 0
has title: Node.js cluster module doesn't release socket/port on http.Server.close()
tagged with: javascript
favorite count: 0
has body: In a Node.js script, I'm trying to open some ports/sockets and then close them again. I'm running into trouble when using Node.js Cluster module. It doesn't seem to close ports in the same way the same code does when not using the Cluster module. For example, take the following code which creates 5 http.Server's each on it's own port and then closes all but the last (5th) one. 'use strict'; var http = require('http'); function goGoGadget(i) { console.log('var i = ', i); var httpServer = http.createServer(); var nextPort = 4000 + i; console.log('about to listen on port', nextPort); httpServer.listen(nextPort); if (i &lt; 5) { httpServer.on('listening', function() { console.log('closing port:', nextPort); httpServer.close(function() { console.log('closed server on port:', nextPort); }); }); } } goGoGadget(1); goGoGadget(2); goGoGadget(3); goGoGadget(4); goGoGadget(5); As expected, only one port remains opened by node.js: dhcp50:test marco$ lsof -i -n -P | grep node node 20895 marco 16u IPv4 0xb242422d2e0e2bb1 0t0 TCP *:4005 (LISTEN) Then, the same code but run in workers using the Cluster module: 'use strict'; var cluster = require('cluster'); var http = require('http'); function goGoGadget(i) { console.log('var i = ', i); var httpServer = http.createServer(); var nextPort = 4000 + i; console.log('about to listen on port', nextPort); httpServer.listen(nextPort); if (i &lt; 5) { httpServer.on('listening', function() { console.log('closing port:', nextPort); httpServer.close(function() { console.log('closed server on port:', nextPort); }); }); } } if (cluster.isMaster) { var numWorkers = 5; for (var i = 0; i &lt; numWorkers; i += 1) { console.log ('forking ', i + 1); cluster.fork(); } } else { goGoGadget(cluster.worker.id); } This time, Node.js keeps holding onto ports of the first 4 http.Server's, even though they've been closed: dhcp50:test marco$ lsof -i -n -P | grep node node 20900 marco 17u IPv4 0xb242422d2d9682e1 0t0 TCP *:4004 (LISTEN) node 20900 marco 18u IPv4 0…
tagged with: sockets
possible better answer: http://stackoverflow.com/a/29005911
tagged with: node.js
has answer: http://stackoverflow.com/a/29113813
has answer: http://stackoverflow.com/a/29005911
score: 2
upvote count: 2
type: AnsweredQuestion
tagged with: phantomjs
accepted answer: http://stackoverflow.com/a/29113813
type: Question

http://stackoverflow.com/comment/46194308
type: Comment
score: 0
has text: Can also pass logged in username as variable in page load if it is already in session, and if not logged in get it during login process
type: QuestionComment
comment on: http://stackoverflow.com/q/28970305

http://stackoverflow.com/comment/46150248
type: QuestionComment
comment on: http://stackoverflow.com/q/28943931
score: 0
has text: Do you need to worry about "copying" events and properties when cloning the elements? Or is just copying attributes sufficient? If it is the latter, as element count goes up, it is almost *always* going to be more efficient to work with html strings (via getting and setting `innerHTML`) instead of working with actual DOM elements.
type: Comment

http://stackoverflow.com/a/29042817
type: Answer
has body: Try the following in your css .elementclassname { height:800px; Overflow-y: scroll; }
score: 0
answers question: http://stackoverflow.com/q/29042665

http://stackoverflow.com/q/29048594
upvote count: 4
has answer: http://stackoverflow.com/a/29048934
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/46361096
has comment: http://stackoverflow.com/comment/54103911
has body: I'm using ng-bind-html to render sanitized comment HTML. This is my html: &lt;span class="commentBody" ng-bind-html="comment.Text"&gt;&lt;/span&gt; It works - the HTML is rendered and displays correctly. But I get the following error in the Javascript console: TypeError: Object doesn't support property or method 'push' at $$addBindingInfo (http://localhost:2239/Scripts/angular.js:6869:9) at ngBindHtmlLink (http://localhost:2239/Scripts/angular.js:20460:9) at invokeLinkFn (http://localhost:2239/Scripts/angular.js:8219:9) at nodeLinkFn (http://localhost:2239/Scripts/angular.js:7729:11) at compositeLinkFn (http://localhost:2239/Scripts/angular.js:7078:13) at compositeLinkFn (http://localhost:2239/Scripts/angular.js:7081:13) at publicLinkFn (http://localhost:2239/Scripts/angular.js:6957:30) at boundTranscludeFn (http://localhost:2239/Scripts/angular.js:7096:9) at controllersBoundTransclude (http://localhost:2239/Scripts/angular.js:7756:11) at ngRepeatAction (http://localhost:2239/Scripts/angular.js:24553:15) &lt;span class="commentBody ng-binding" ng-bind-html="comment.Text"&gt; This is the code that causes the problem in angular.js: var bindings = $element.data('$binding') || []; if (isArray(binding)) { bindings = bindings.concat(binding); } else { bindings.push(binding); } The bindings variable ends up being the string comment.Text, which is why it doesn't support the method push, because it's not an array. What should I change to fix this?
has comment: http://stackoverflow.com/comment/46336367
tagged with: javascript
score: 4
has title: ng-bind-html working, but throwing error
has comment: http://stackoverflow.com/comment/46335686
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46336406
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/65821835
has comment: http://stackoverflow.com/comment/46336237
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/54091326

http://stackoverflow.com/comment/46123012
has text: Check your readystate, is it 0 ?
score: 0
comment on: http://stackoverflow.com/q/28933601
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46115164
type: Comment
comment on: http://stackoverflow.com/a/28928787
score: 0
type: AnswerComment
has text: I've noticed that the delay changes only after I click once on Button1. That is,, no click on button1 everything work fines.. click on button1 --> Function A starts loading every 2-3 seconds instead of every 60s.. any ideas why?

http://stackoverflow.com/comment/46198766
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28973685
has text: This could get complex - do you know that your user is in a timezone with daylight savings? I would think you would need to know the user's location and accommodate that. Also - what are you trying to accomplish? If it is elapsed time, then you want to ignore daylight savings, otherwise your numbers will be wrong.

http://stackoverflow.com/comment/47526480
has text: @BenRacicot why do you want to remove from style tags ?
type: QuestionComment
comment on: http://stackoverflow.com/q/28983735
score: 0
type: Comment

http://stackoverflow.com/comment/46081771
type: QuestionComment
comment on: http://stackoverflow.com/q/28910642
score: 0
has text: Uh, that is the definition of _avoiding_. I'll ask again, why not just use `eval()`? It is the thing you want for what you are trying to do.
type: Comment

http://stackoverflow.com/q/28959217
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28959271
has comment: http://stackoverflow.com/comment/46170968
type: Question
has comment: http://stackoverflow.com/comment/46171003
has answer: http://stackoverflow.com/a/28959287
tagged with: javascript
has comment: http://stackoverflow.com/comment/46171191
has comment: http://stackoverflow.com/comment/46170964
possible better answer: http://stackoverflow.com/a/28959275
tagged with: scope
has comment: http://stackoverflow.com/comment/46170925
has title: How to get around javascript variable scope
has answer: http://stackoverflow.com/a/28959333
score: 0
has comment: http://stackoverflow.com/comment/46170985
has answer: http://stackoverflow.com/a/28959275
accepted answer: http://stackoverflow.com/a/28959271
has body: Ok so I have divs on my webpage that when clicked are assigned a variable. I need to access these variables later on when another button is clicked to include them in the email I send. My var mailbody works as it is a local variable I think. But if I replace it with frameColour then it won't work as it isn't global. How can I get around this? $('#purple').click (function() { $(".border").css("fill", "#763d81"); var frameColour = "purple"; }); $("#button").click (function() { var mailbody = "hello world."; window.open('mailto:sales@beauxcadeaux.co.uk?subject=My Frame&amp;body=' + mailbody); });
has comment: http://stackoverflow.com/comment/46170974
answer count: 5
has answer: http://stackoverflow.com/a/28959364

http://stackoverflow.com/q/28971134
score: 0
has body: So I have an object tag &lt;object id ="video" data="immagini/trailer.png" onclick="trailer()"&gt;&lt;/object&gt; That I want to change data when I click on, I tried this in JavaScript but doesn't seem to work. function trailer() { var sites = ['https://www.youtube.com/embed/CawVaHxWvnA'] $('#video').src = sites; } I don't know if this is the right way to do it, if there is a better way just write it down.
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28971198
type: Question
answer count: 2
has title: How to change the object tag src with click
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/41072168

http://stackoverflow.com/q/29019718
possible better answer: http://stackoverflow.com/a/29019784
has answer: http://stackoverflow.com/a/29019784
answer count: 2
tagged with: javascript
has title: Is it possible to combine adding and subtracting into one function?
favorite count: 0
score: 0
accepted answer: http://stackoverflow.com/a/29020201
has comment: http://stackoverflow.com/comment/46283403
upvote count: 1
downvote count: 1
has body: I have these two buttons, one that calls minus(val) and the other calls plus(val) function. function minus(val) { val &lt;= 1 ? width = 1 : width = val - 1; } function plus(val) { val &gt;= 5 ? width = 5 : width = val + 1; } Is it possible to combine both these functions into one? So I can just call one function on each button, like changeValue(val); Thanks in advance.
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29020201

http://stackoverflow.com/q/29048400
answer count: 1
favorite count: 0
has body: I'm trying to create my own html helper. I need to add some javascript to the string I return. public static string ListCheckbox(this HtmlHelper helper, string actionName, int value) { return String.Format("&lt;input type='checkbox' value='{1}' onclick='Action_{0}()'&gt;&lt;/input&gt;", actionName, value); } How can I add this javascript, assuming that I want to keep this code in separate *.js file? In *.cshtml file I can do it like that: @Scripts.Render("~/Scripts/App/markSearched.js") But this doesn't work in c# file. HtmlHelper helper variable doesn't have anything like "Scripts" or "Render". Can I use those function in c# class?
has answer: http://stackoverflow.com/a/29049116
type: UnansweredQuestion
has title: Scripts.Render in c# class (creating html helper). Using functions from HtmlHelper in c# file
tagged with: asp.net-mvc-4
downvote count: 0
score: 1
type: Question
tagged with: c#
tagged with: asp.net-mvc
tagged with: javascript
upvote count: 1

http://stackoverflow.com/a/69854431
downvote count: 0
score: 1
has body: If you are here because you were just following the walk through documentation they leave off a key piece of information that is only available on the reference documentation for addJavascriptInterface(). Note that injected objects will not appear in JavaScript until the page is next (re)loaded. JavaScript should be enabled before injecting the object. For example: class JsObject { @JavascriptInterface public String toString() { return "injectedObject"; } } webview.getSettings().setJavaScriptEnabled(true); webView.addJavascriptInterface(new JsObject(), "injectedObject"); webView.loadData("", "text/html", null); webView.loadUrl("javascript:alert(injectedObject.toString())"); https://developer.android.com/reference/android/webkit/WebView#addJavascriptInterface(java.lang.Object,%20java.lang.String)
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29054152

http://stackoverflow.com/q/28949067
has body: I have a small script that detects window width and adjusts sub navigation list items if the screen is between 600px and 1200px. The script works within constraints, however when the browser resizes past 1200px or below 600px, the width declaration stays applied to each relevant list item. However, once the page is refreshed the width is what it's supposed to be. First time poster here so please let me know what I'm missing. Thanks $(window).resize(function() { var sub_menu_list_item = $('.current-menu-item .sub-menu li'); var sub_menu_list_item_count = sub_menu_list_item.length; var divisor = ( 1 / sub_menu_list_item_count ); var width = divisor * 100; var ww = $(window).width(); if ( ww &gt; 600 &amp;&amp; ww &lt; 1200 ){ if ( sub_menu_list_item_count % sub_menu_list_item_count === 0 ){ sub_menu_list_item.css('width', width + '%' ); } } });
answer count: 2
has title: Width of list item isn't adjusting past maximum pixel declaration
has answer: http://stackoverflow.com/a/28949165
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28949165
possible better answer: http://stackoverflow.com/a/28949163
has answer: http://stackoverflow.com/a/28949163
type: Question
tagged with: javascript
tagged with: responsiveness
score: 0

http://stackoverflow.com/q/28965210
tagged with: javascript
score: 4
answer count: 2
has comment: http://stackoverflow.com/comment/46182694
has comment: http://stackoverflow.com/comment/46183267
has answer: http://stackoverflow.com/a/28983937
has body: IIUC, when I create a WebSocket an HTTP request is sent to the specified URL, containing an upgrade request. Is it typicaly to pass authentication information along with this upgrade request, or should it be performed separately? var websocket = new WebSocket("ws://domain:port/foo"); // Can I include authentication headers with the initial upgrade HTTP request?
tagged with: websocket
favorite count: 0
possible better answer: http://stackoverflow.com/a/28967249
linked to: http://stackoverflow.com/q/4980912
has comment: http://stackoverflow.com/comment/46182211
upvote count: 4
has title: Configuring authentication headers for WebSocket connection
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46184338
has comment: http://stackoverflow.com/comment/46184132
downvote count: 0
tagged with: http
type: Question
has answer: http://stackoverflow.com/a/28967249
accepted answer: http://stackoverflow.com/a/28983937

http://stackoverflow.com/q/28950532
tagged with: javascript
score: 1
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/pdf
has title: Convert a office document on the client side
tagged with: ms-office
has answer: http://stackoverflow.com/a/28951789
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/28951789
type: AnsweredQuestion
has body: I have a project that I will be researching and hopefully implementing soon. One of the biggest hurdles, that I don't know can be overcome is that document conversion needs to be done through the browser on the client-side. The app must be able to take popular office document types and convert them to pdf, before being sent to the server. I have been having a hard time finding info on anyone trying to do this or having done this. So any Ideas, or examples? Note: The document must not leave the clients computer before conversion. Edit: The documents do not have to be previewed.
downvote count: 0

http://stackoverflow.com/q/29021523
type: Question
has comment: http://stackoverflow.com/comment/46313120
tagged with: jquery-ui
tagged with: javascript
has comment: http://stackoverflow.com/comment/46312742
has answer: http://stackoverflow.com/a/29081233
answer count: 1
downvote count: 0
has body: I am using a custom menu binding for the jquery ui menu widget. Inside the HTML for my menu, I am using a component. It looks something like this: &lt;ul data-bind="menu: {...}"&gt; &lt;!-- ko foreach: menuComponents --&gt; &lt;li&gt; &lt;div data-bind="component: $data"&gt;&lt;/div&gt; &lt;/li&gt; &lt;!-- /ko --&gt; &lt;/ul&gt; My custom binding is using applyBindingsToDescendents() to resolve the bindings inside the ul before initializing the menu. This is a simplified version of my binding. ko.bindingHandlers.menu = { init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { ko.applyBindingsToDescendants(bindingContext, element); $(element).menu(); return {controlsDescendantBindings: true}; } }; The problem is that components are loaded asynchronously. I am using a custom component loader, but I'm not sure if that matters. The side effect is that the component binding isn't resolved until the component is loaded. So the load order looks like this: Menu binding initialization is started Descendant bindings are applied by applyBindingsToDescendents jQuery menu widget is initialized Component is initialized and bound asynchronously Since the component isn't initialized until after bindings are applied, my menu isn't rendering properly. Is there any way I can force component descendant bindings to be applied synchronously? Or is there a way I can detect when they are applied and refresh the menu widget?
favorite count: 0
accepted answer: http://stackoverflow.com/a/29081233
has title: knockout.js - Apply custom binding after components are bound
has comment: http://stackoverflow.com/comment/46286994
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: knockout.js

http://stackoverflow.com/a/28939992
has comment: http://stackoverflow.com/comment/46135544
has comment: http://stackoverflow.com/comment/46134973
has comment: http://stackoverflow.com/comment/46134798
accepted answer of: http://stackoverflow.com/q/28939841
answers question: http://stackoverflow.com/q/28939841
score: 3
has comment: http://stackoverflow.com/comment/46134819
upvote count: 3
has comment: http://stackoverflow.com/comment/46134820
has comment: http://stackoverflow.com/comment/46134832
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46135597
has comment: http://stackoverflow.com/comment/46135578
has body: You need to use: $('#id_frame').contents().find('#queuedBetTotal').text(); You should also know that if the iframe source is pointing to a different domain, due to security reasons, you will not be able to access the contents of this iframe in javascript.
type: Answer

http://stackoverflow.com/a/29026752
has comment: http://stackoverflow.com/comment/46922229
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/29026688
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/46319588
has comment: http://stackoverflow.com/comment/46921417
has comment: http://stackoverflow.com/comment/46928767
has body: match is better than split for this kind of stuff var arr = [ 'find({ qty: { $lt: 20 } } )', 'limit(5)', 'skip(0)' ] var obj = {}; arr.forEach(function(x, n) { var m = x.match(/(\w+)\(\s*(.+?)\s*\)/); if(n == 0) { obj.action = m[1]; obj.value = m[2]; } else obj[m[1]] = m[2]; }); document.write("&lt;pre&gt;" + JSON.stringify(obj,0,3));

http://stackoverflow.com/a/43919993
score: 0
answers question: http://stackoverflow.com/q/29001565
type: Answer
has body: I don't get completely what you are trying to do but here are some tips: window.open("https://slackoverflow.com"); is used to open an entirely new window(can be used to open local files as well ofc) window.close(); window.close() Closes the tab. Page yada yada And this can be used to open a link or page in a new tab. If you play around with these for a little itll start to catch on. I hope some of these ideas help and will help you put together what you are trying to accomplish :)
has comment: http://stackoverflow.com/comment/74875232

http://stackoverflow.com/q/28933945
duplicate of: http://stackoverflow.com/q/6628639
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 2
has title: What is wrong with my code?
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/6628639
linked to: http://stackoverflow.com/q/8468607
has answer: http://stackoverflow.com/a/28933968
accepted answer: http://stackoverflow.com/a/28933968
has body: I'm having trouble with my code but can't seem to find what the problem is. I keep getting the same errors in browser but I don't see what the problem is? FVOM.js:16 Uncaught SyntaxError: Unexpected number FVOM.html:15 Uncaught ReferenceError: CheckSelection is not defined HTML code: &lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;Future Value Demo&lt;/title&gt; &lt;link rel="stylesheet" type="text/css" href="css/index.css"/&gt; &lt;script type="text/javascript" src="JScripts/FVOM.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;table&gt; &lt;tr&gt; &lt;td colspan="2"&gt; &lt;input type="radio" id="futVal" name="Money" checked onClick="FVOM:CheckSelection(1)"/&gt;Future Value &lt;input type="radio" id="preVal" name="Money" onClick="FVOM:CheckSelection(2)"/&gt;Present Value &lt;input type="radio" id="rate" name="Money" onClick="FVOM:CheckSelection(3)"/&gt;Rate of Interest &lt;input type="radio" id="time" name="Money" onClick="FVOM:CheckSelection(4)"/&gt;Years &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;br/&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Future Value (FV)&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="FV" disabled/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Present Value (PV)&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="PV" value = "1500" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Interest Rate [pa] (r)&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="R" value = "4.5"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Years (n)&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="N" value = "1"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Compounded&lt;/td&gt; &lt;td&gt; &lt;select id="compounded"&gt; &lt;option value="year"&gt;Yearly&lt;/option&gt; &lt;option value="quarter"&gt;Quarterly&lt;/option&gt; &lt;option value="month"&gt;Monthly&lt;/option&gt; &lt…
tagged with: javascript
score: -1
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/139757507

http://stackoverflow.com/comment/50653556
comment on: http://stackoverflow.com/a/31334457
score: 0
type: AnswerComment
has text: Thanks for the document title!
type: Comment

http://stackoverflow.com/comment/46325564
score: 0
has text: Thank you @WestLangley. What I'm struggling with is how to orient the mesh to a natural center so that the mesh is rotated to the same starting location, regardless of where the user is initially looking. I suppose I would describe it as an initial mesh rotation offset. I'm editing the original question with a crude drawing.
type: Comment
comment on: http://stackoverflow.com/a/29021718
type: AnswerComment

http://stackoverflow.com/a/68082305
score: 3
has body: You should try like this: document.getElementById("YOUR ID").scrollIntoView({ behavior: "smooth", block: "start", inline: "start" });
answers question: http://stackoverflow.com/q/28969592
downvote count: 0
upvote count: 3
type: Answer

http://stackoverflow.com/a/29031454
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46304127
has comment: http://stackoverflow.com/comment/46303786
has comment: http://stackoverflow.com/comment/46304191
upvote count: 1
has body: The same as JLRishe's answer but with the addition that you can pass in a list of those elements that you want to keep: var fruits = ["Banana", "Orange", "Apple", "Mango", "App", "Man"]; var list = 'Orange, Mango, App'; alert(strip(fruits, list)); // ["Orange", "Mango", "App"] function strip(arr, list) { list = list.split(', '); return arr.filter(function (el) { return list.indexOf(el) &gt; -1; }); }
type: Answer
answers question: http://stackoverflow.com/q/29031003

gmail
type: Tag
tags question: http://stackoverflow.com/q/29010954
tags question: http://stackoverflow.com/q/29061293
tag name: gmail
tags question: http://stackoverflow.com/q/29025493
tags question: http://stackoverflow.com/q/29026535

http://stackoverflow.com/q/28973766
score: 3
tagged with: javascript
has body: How can I stop this animation through JS/Jquery? .progressLoading::-webkit-progress-value { box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.4); border-radius: 10px; background: -webkit-linear-gradient(45deg, transparent, transparent 33%, rgba(0, 0, 0, 0.1) 33%, rgba(0, 0, 0, 0.1) 66%, transparent 66%), -webkit-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)), -webkit-linear-gradient(left, #963a2d, #832417); background-size: 25px 16px, 100% 100%, 100% 100%; -webkit-animation: move 5s linear 0 infinite; } @-webkit-keyframes move { 0% {background-position: 0px 0px, 0 0, 0 0} 100% {background-position: 100px 0px, 0 0, 0 0} } I've tried this with no success: $(".progressLoading::-webkit-progress-value").css({ '-webkit-animation-play-state': 'paused' });
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28973875
tagged with: jquery
favorite count: 0
has title: Stop ::-webkit-progress-value animation
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28973875
upvote count: 3
tagged with: pseudo-element
type: Question

http://stackoverflow.com/comment/46154200
comment on: http://stackoverflow.com/q/28950091
type: Comment
type: QuestionComment
has text: @MethodMan, i'm not using java
score: 0

http://stackoverflow.com/comment/46305805
has text: `"([^"]*)"` grab the string you want from index 1.
score: 0
comment on: http://stackoverflow.com/q/29032499
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46217151
has text: Which folder is your page in? And which folder is the 'jssor.slider.mini.js' in?
score: 0
comment on: http://stackoverflow.com/q/28966297
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46258814
type: Comment
type: QuestionComment
score: 0
has text: @empiric yes you are right sorry . i misunderstand document.
comment on: http://stackoverflow.com/q/29005798

http://stackoverflow.com/comment/46267546
has text: Woot ! You're right ! Indeed it's an native JS method ( my bad sorry ). But the case is same, call directly the property is more fastest than a method call because no verification/manipulation is done
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29011180
type: Comment

http://stackoverflow.com/q/29028739
has comment: http://stackoverflow.com/comment/46299020
has comment: http://stackoverflow.com/comment/46299233
favorite count: 0
has comment: http://stackoverflow.com/comment/46298980
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46299006
has comment: http://stackoverflow.com/comment/46298945
answer count: 0
has body: I want to print an image rendered by html2canvas (front) without opening a new window. So I used a hidden iframe that will display a window containing the image I want to print. This window prints the image in an onload event. Javascript Code html2canvas($('#front'), { onrendered: function (canvas) { front = canvas.toDataURL("image/png"); $("&lt;iframe&gt;") // create a new iframe element .hide() // make it invisible .attr("src", "../html/myid_print_page.html") // point the iframe to the page I want to print .appendTo("body"); } }); HTML Code (myid_print_page.html) &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body onload="print()"&gt; &lt;img id="front" src=""&gt;&lt;/img&gt; &lt;/body&gt; &lt;/html&gt; My problem is: No image has been printed. How will I pass rendered image(front) to "myid_print_page.html"?
type: UnansweredQuestion
tagged with: iframe
upvote count: 1
has title: Print an image in Javascript without opening a new window
type: Question
score: 1
tagged with: image
has comment: http://stackoverflow.com/comment/46299028
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/72615996
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28943528
has text: https://github.com/davidsulc/marionette-gentle-introduction/blob/master/assets/js/apps/contacts/contacts_app.js or good answer from danikoren in http://stackoverflow.com/questions/11410059/suggested-bootstrap-boilerplate-sample-for-backbone-marionette-application
score: 0

http://stackoverflow.com/a/29040992
answers question: http://stackoverflow.com/q/29036164
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29036164
has comment: http://stackoverflow.com/comment/46324047
has body: You could play around with attaching/detaching event handlers all day and never hit on a successful formula. If your event handler was idempotent (for a given input state), then you wouldn't need to worry about triggering it twice. If the handler is not naturally idempotent, then you can include a condition which ensures that a second successive call, with the same input value, does nothing. It's slightly contrived, but this can be regarded as "forced idempotence". To achieve this, the input element's "last state" (its value) needs to be stored, read back and tested. You could store the state in some outer/global javascript var but it's neater to use a '.data()' property of the element itself (which is actually 100% js, not pushed into the DOM). $(function() { $("#myInput").on("keyup input", function(e) { var $this = $(this), $lastState = $this.data('lastState') || '',//read back the element's previous state (or empty string if this is the first call) val = $this.val();//current state if(val !== $lastState) {//the all-important test. $this.data('lastState', val);//store current state to be read back at next call //here do whatever is required of your event handler. } }); });
type: Answer
has comment: http://stackoverflow.com/comment/46325318
score: 3
has comment: http://stackoverflow.com/comment/46323021
downvote count: 0
upvote count: 3

http://stackoverflow.com/q/29059490
has body: I'm trying to write a small Tetris clone to learn Canvas. I've got as far as having a single block fall. I'm simply having it fall down one column in a 'for' loop, redrawing in the grid square below and then erasing the square above using rectClear. (The clumsy alert() is to see progress). for (var y = 21; y &gt;= 0; y--) { drawSquare(3,y,'green'); clearSquare(3,(y+1)); alert(y); }; Interestingly, if I swap the "clearSquare" and "drawSquare" lines, none get erased at all. I'm not sure if this is a problem in my logic, or if I'm failing to grasp something in canvas. As you can see I've clumsily put in "context.save()" in case my changes weren't being "committed" or something, but I believe this is kind of irrelevant here. Here's a JSFiddle
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Erase rects in Canvas, but they come back
answer count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29059712
accepted answer: http://stackoverflow.com/a/29059712
type: Question
tagged with: canvas

http://stackoverflow.com/a/34716404
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28958875
upvote count: 1
has body: You can get required output by below changes, Date format and Timezone don't require double quotes instead enclose them only in single quotes as in below example. &lt;span class="pull-right"&gt; &lt;/span&gt; Hope this will solve your issue.

http://stackoverflow.com/a/29056828
has comment: http://stackoverflow.com/comment/46351122
has comment: http://stackoverflow.com/comment/46351073
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/46351228
has body: The CodePen you linked to utilizes jQuery; however, when using a text editor and writing to a blank HTML file, you need to link to the jQuery library - have you done this? If not, place an external source link to the Google-hosted jQuery script file in between &lt;head&gt; and &lt;/head&gt;, using the following: &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt; Let me know if that solves the issue for you! EDIT: To solve the CSS issue you are having, you need to follow the same procedure for the external sheet; in general, sandboxes allow functionality without linking different files, but when working in text editors, you must supply the connection between stylesheets, JS files and the HTML page. To link to your external CSS sheet, put the following in between &lt;head&gt; and &lt;/head&gt;: &lt;link type="text/css" rel="stylesheet" href="style.css" /&gt; This is the standard procedure for adding links to external CSS. If the sheet is open in the Brackets editor, it should provide you with 'style.css' when you start typing it in. Once you do the above, place the CSS from the CodePen into that CSS file, and then save all of the sheets you're working in. Everything should work - let me know if that solved your issues!
has comment: http://stackoverflow.com/comment/46351043
score: 6
has comment: http://stackoverflow.com/comment/46351486
has comment: http://stackoverflow.com/comment/46351865
has comment: http://stackoverflow.com/comment/46351055
accepted answer of: http://stackoverflow.com/q/29056779
answers question: http://stackoverflow.com/q/29056779
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/119968528
type: Comment
score: 2
comment on: http://stackoverflow.com/a/56220434
has text: Why @Anakin? CSS is far more efficient than JS timers.
type: AnswerComment

http://stackoverflow.com/comment/46111893
type: Comment
has text: `$compile` expects an element.
type: QuestionComment
comment on: http://stackoverflow.com/q/28927843
score: 1

http://stackoverflow.com/comment/46860024
score: 1
comment on: http://stackoverflow.com/a/28966545
has text: I added a working example based on your code to my answer. Please give that a try, this works for me in the Nexus 7 emulator and on a Nexus 7 1st gen tablet.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46168299
type: AnswerComment
comment on: http://stackoverflow.com/a/28957704
type: Comment
score: 0
has text: Thank you for your response. Can you give an example of how to convert an object to an array or to a string.

http://stackoverflow.com/comment/46087512
comment on: http://stackoverflow.com/q/28914181
score: 0
has text: See @Dr.Molle 's answer ..it will solve your issue ..
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46292425
has text: Almost, but the checkbox value is now at the end of the string and unchecking doesn't make the value go away...
type: Comment
comment on: http://stackoverflow.com/a/29024665
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46346182
comment on: http://stackoverflow.com/q/29054218
has text: You can embed snippets! I've removed the link and copy-pasted your code here as snippet ;)
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28920825
has comment: http://stackoverflow.com/comment/46099247
score: 0
has comment: http://stackoverflow.com/comment/46099075
has comment: http://stackoverflow.com/comment/46099226
has body: According to jsperf the fastest way to delete an array element is to use delete array[index]. Source: http://jsperf.com/object-delete-vs-array-splice-vs-array-delete A solution could be this: http://jsfiddle.net/no20bv5o/3/ But because of the overhead in the for loop and the second array it is slower as the before mentioned arr.filter() as shown by this jsperf: http://jsperf.com/filter-array-by-element-attribute
type: Answer
answers question: http://stackoverflow.com/q/28920721
has comment: http://stackoverflow.com/comment/46098978
has comment: http://stackoverflow.com/comment/46099191

http://stackoverflow.com/a/29057302
has comment: http://stackoverflow.com/comment/46351657
score: 0
has comment: http://stackoverflow.com/comment/46352031
answers question: http://stackoverflow.com/q/29057293
type: Answer
has body: You need to do this: $onclick="window.location.reload(true);setTimeout(function(){manage('$n')},3000);"; Edit window.location.reload reload the page and reinitialize javascript. So You can't wait for it to complete. Also this can't have any callback. So you need to run manage function on document.ready(). You can set a cookie before reload the page. After reload, check if cookie sets, run manage function: $onclick="document.cookie='reload=true';window.location.reload(true);" Now, add this code in the head of the page: $(document).ready(function(){ if (document.cookie.indexOf("reload") &gt;= 0) { manage('$n'); //set expires parameter to a passed date for deleting cookie document.cookie = "reload=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; } }); I think cookie is a good and possible solution for you. For reading more about javascript cookies, refer to this link.
has comment: http://stackoverflow.com/comment/46351663
has comment: http://stackoverflow.com/comment/46351757
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/46351743
has comment: http://stackoverflow.com/comment/46351655

http://stackoverflow.com/a/29036836
type: Answer
has comment: http://stackoverflow.com/comment/46316294
score: 3
upvote count: 3
has body: Here is a newer version using addEventListener window.addEventListener("DOMContentLoaded", () => { const sel = document.querySelector("[name=InquiryType]"), terms = document.getElementById("terms_target"), form = document.getElementById("myForm"), agree = form.checked; // checked is a poor name for a field toggleAgree = () => { const show = ["1", "2"].includes(sel.value); terms.hidden = !show; agree.required = show; }; sel.addEventListener("change", toggleAgree) toggleAgree(); // initialise }) Please Select Your Inquiry Type Option 1 Option 2 Option 3 I agree to the terms Older version window.onload=function() { var sel = document.getElementsByName("InquiryType")[0]; sel.onchange=function() { var selectedString = this.value, show = selectedString == "1" || selectedString == "2", terms = document.getElementById("terms_target"), checked=document.getElementsByName("checked")[0]; terms.style.display = show?"block":"none"; if (show) checked.setAttribute("required","required"); else checked.removeAttribute("required"); } sel.onchange(); // initialise } Please Select Your Inquiry Type Option 1 Option 2 Option 3 I agree to the terms
answers question: http://stackoverflow.com/q/29036718
downvote count: 0
has comment: http://stackoverflow.com/comment/46316024
accepted answer of: http://stackoverflow.com/q/29036718
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46319066

http://stackoverflow.com/a/28940750
has comment: http://stackoverflow.com/comment/46137248
has body: Try adding the count parameter into your request URL: cmdURL = 'https://api.instagram.com/v1/tags/' + tag + '/media/recent?count=10&amp;callback=?'; (edit) You could also only count to 10 in your for loop where you build your photos: for (_i = 0, _len &lt; 10; _i &lt; _len; _i++) { photo = _ref[_i]; _results.push(embedImage(photo));} Obviously this won't change the number of results you get back from Instagram but it will cap the number you output to screen...
score: 0
has comment: http://stackoverflow.com/comment/46142015
answers question: http://stackoverflow.com/q/28940581
type: Answer
has comment: http://stackoverflow.com/comment/46140707

http://stackoverflow.com/a/29026886
type: Answer
has body: For this reason, it is best to use local variables instead of instance variables in your partials. # your main view file: &lt;%= render partial: path_to_partial, locals: {bool: true} %&gt; # your partial: &lt;%= bool ? 1 : 2 %&gt; With those options, the partial will display 1. Also, an alternative to passing local variables as the locals option is to use render instead of render partial like so: # your main view file: &lt;%= render path_to_partial, bool: true %&gt; From the above, you can infer that you must change @node in your partial to node and specify {node: @node} wherever you are rendering the partial.
upvote count: 1
has comment: http://stackoverflow.com/comment/46296494
accepted answer of: http://stackoverflow.com/q/29026660
answers question: http://stackoverflow.com/q/29026660
score: 1
has comment: http://stackoverflow.com/comment/46297194
has comment: http://stackoverflow.com/comment/46295816
has comment: http://stackoverflow.com/comment/46295931
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46296638
has comment: http://stackoverflow.com/comment/46297132

http://stackoverflow.com/q/28911259
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46081328
tagged with: converters
has title: How to make this calculation and variables correct in this script code?
has comment: http://stackoverflow.com/comment/46081404
has comment: http://stackoverflow.com/comment/46081390
tagged with: degrees
has comment: http://stackoverflow.com/comment/46081353
type: Question
has comment: http://stackoverflow.com/comment/46081375
has comment: http://stackoverflow.com/comment/46081324
has comment: http://stackoverflow.com/comment/46081365
has body: I feel like I'm progressing a little, I still have difficulties figuring out what to do when I'm stuck with Javascript. It's very hard but I need to get this coding done urgently.. so any help is greatly appreciated. It's really simple, I want to make my own converter from Kelvin, Celsius and Fahrenheit. So I made these 3 variables, but I kind of realised they need their own formula, so do I need a different variable for the result? And if so where does it go? All these functions are so confusing. This is my code. Kelvin is Celsius is Fahrenheit is Dit is kelvin dit is celsius dit is fahrenheit and then the script document.getElementById('calculate').addEventListener('click', function() { var kel= document.getElementById("kelvin").value; var cel = document.getElementById("celsius").value; var far = document.getElementById("fahrenheit").value; var div = document.getElementById('calc'); if (( kel < 0 || cel < -273 || far < -459 || isNaN(kel) || isNaN(bev)) { div.innerHTML = "Not valid!"; return; } kel = parseInt(kelvin); cel = parseInt(celsius); far = parseInt (fahrenheit); var far = (cel * (9/5) + 35; var kel = cel + 273; var cel = kel - 273; var cel = (far -32)*(5/9); if (far = kel ) { var text = "hello? what to do here"; } div.innerHTML = "Het is " + kelvin+ " Kelvin en het is " + celcius + "" en het is " + fahrenheit + ""; }, false);
has answer: http://stackoverflow.com/a/28911396
tagged with: javascript
has answer: http://stackoverflow.com/a/28911425
score: 0
answer count: 2
tagged with: calculator
tagged with: cal

http://stackoverflow.com/q/28979519
possible better answer: http://stackoverflow.com/a/28981195
type: Question
has answer: http://stackoverflow.com/a/28981195
has comment: http://stackoverflow.com/comment/46209849
tagged with: javascript
score: 0
answer count: 2
tagged with: marionette
tagged with: backbone.js
has answer: http://stackoverflow.com/a/29055414
accepted answer: http://stackoverflow.com/a/29055414
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46209580
has comment: http://stackoverflow.com/comment/46211834
has comment: http://stackoverflow.com/comment/46209551
has title: Backbone view undefined is not a function conflict
has body: I have these 2 views: Show View define(['backbone', 'hbs!tmpl/show_tmpl', 'item/hide'], function (Backbone, Hide) { return Backbone.Marionette.ItemView.extend({ initialize: function () { console.log('initialize a UserLogin ItemView'); console.log(Hide); // this comes in as undefined }, ... Hide View define(['backbone', 'hbs!tmpl/hide_tmpl', 'item/hide', 'item/show'], function (Backbone, Hide, Show) { return Backbone.Marionette.ItemView.extend({ initialize: function () { console.log('initialize a UserLogin ItemView'); console.log(Hide); console.log(Show); }, ... The issue is that console.log(Hide); in the Show View comes in as undefined If I remove 'item/hide' from the Hide View, then it works fine. The idea is that I need to be able to do : var hide = new Hide(); hide.methodOnShow(); in Show View and var show = new Show(); show.methodOnHide(); in the Hide View addon: if this helps, the 2 views are each opening a modal, so from the show modal i click a lick and open the hide modal and vice versa. If i refresh the pages before opening each modal they work fine, but not opening them from inside a open modal. Any ideas on how to solve this?
has comment: http://stackoverflow.com/comment/46209784

http://stackoverflow.com/comment/46246101
score: 1
comment on: http://stackoverflow.com/a/28998693
type: AnswerComment
type: Comment
has text: Nice explanation of the concept here - thank you for the work!

http://stackoverflow.com/comment/46125899
type: QuestionComment
comment on: http://stackoverflow.com/q/28935110
has text: "but hopefully it's understandable" --- it's not :-S
score: 0
type: Comment

http://stackoverflow.com/a/28955951
type: Answer
accepted answer of: http://stackoverflow.com/q/28955908
has body: I assume it has something to do with this line in the docs BREAKING CHANGE: $cookies no longer exposes properties that represent the current browser cookie values. Now you must use the get/put/remove/etc. methods as described below. Which might mean that the previous version of angular didnt have those methods on $cookies. Your version might be that older version.
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28955908
has comment: http://stackoverflow.com/comment/46165137

http://stackoverflow.com/comment/46197576
comment on: http://stackoverflow.com/a/28971801
type: AnswerComment
score: 0
has text: Ah, I think I understand what you want. However, there isn't really a way to do that. If you want to use $match1 in multiple places throughout the page but only if a certain condition is met then you will need to check it each time: `if ($time < $expiration_date){echo $match1; }`. Or the only other way I can think of is `if ($time < $expiration_date){$match1 = 'Match 1 - April 1, 2015'; } else {$match1 = '';}` This way throughout the page $match1 will be either 'Match 1 - April 1, 2015' or '' depending on what the date is.
type: Comment

http://stackoverflow.com/comment/46228224
comment on: http://stackoverflow.com/q/28977946
score: 0
type: Comment
type: QuestionComment
has text: Anybody?? This seems like such a simple fix

http://stackoverflow.com/comment/58889027
has text: Returning `""` throws errors, safe to return `null`.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28993341

http://stackoverflow.com/comment/46156229
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28950936
has text: What is the difference between your non-working code and working code? Was the timeout length the only thing you changed, or did you use a different method, like simulating a button click?
score: 0

http://stackoverflow.com/q/29010011
tagged with: twitter-bootstrap
type: Question
has comment: http://stackoverflow.com/comment/46265141
has body: I have added following line in my aspx page &lt;link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"&gt; Following is my javascript code in default2.aspx window.showModalDialog('default1.aspx'); When i resize window its not working. Its working with window.open('default1.aspx'); NOTE : default1.aspx page is on another domain.
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46265179
has title: bootstrap css not works with window.showModalDialog
has comment: http://stackoverflow.com/comment/46265379
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46265238
answer count: 0

http://stackoverflow.com/q/29051888
answer count: 1
has answer: http://stackoverflow.com/a/29052271
score: 0
has body: Most of the time I will call in a Factory from my Angular controller, but I'll just leave it in the controller function and not in its own function. Like this for example: (function () { 'use strict'; angular.module("Dashboard") .controller("DashboardController", DashboardController); DashboardController.$inject = ["Interface"]; function DashboardController (Interface) { var vm = this; /** * Total Open Tickets */ Interface.openTickets().then(function (data) { vm.tickets = objCount(data); }); } })(); I'll always need to see the total amount of open tickets in my view so I don't really need to have another function for it. But would it be more effective and improve code readability to put the Interface call in another method and then initialize all the methods? Like this: function DashboardController (Interface) { var vm = this; vm.getTickets = getTickets(); /** * Total Open Tickets */ function getTickets() { Interface.openTickets().then(function (data) { vm.tickets = objCount(data); }); } } I'm thinking the second example is the cleaner way to do it, so I'm thinking about updating all of my code. Am I right in thinking this?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29052271
has title: Do I need to put Factory calls inside a function in my Controller?
type: AnsweredQuestion
tagged with: angularjs
type: Question

http://stackoverflow.com/q/28995826
upvote count: 1
has comment: http://stackoverflow.com/comment/46239939
answer count: 1
has comment: http://stackoverflow.com/comment/46240296
favorite count: 0
has comment: http://stackoverflow.com/comment/46240043
tagged with: partial-views
tagged with: angularjs
has title: Template not loading
accepted answer: http://stackoverflow.com/a/28997193
has comment: http://stackoverflow.com/comment/46240512
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28997193
type: Question
tagged with: angularjs-directive
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/46240647
has body: I have a problem that occurs sometimes, when the template entry is not defined in the template cache, it happens every once in a while after reloading the page. The related code: index.html &lt;div ng-include src="'Views/templates.html'"&gt;&lt;/div&gt; Views/templates.html &lt;script type="text/ng-template" id="customTemplate/spare-request-item.html"&gt; &lt;div&gt;..&lt;/div&gt; &lt;/script&gt; directive.js .directive("spare", function ($templateCache) { console.log($templateCache.info());, //return length 30 when it fails, 31 otherwise console.log($templateCache.get('customTemplate/spare-request-item.html'));//return undefined when it fails return { .. templateUrl: 'customTemplate/spare-request-item.html', Anyone else has experienced this or know how to assure that the template is loaded and parsed before the directive runs? It is a angular bug?

http://stackoverflow.com/comment/46264418
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28997354
has text: Have you tried to add `new Countdown ()` and `init` in a jQuery DomReady function? It probably runs too early.
score: 0

http://stackoverflow.com/q/29043619
tagged with: javascript
tagged with: image
linked to: http://stackoverflow.com/q/17887098
answer count: 2
has title: How do you upload an image using input and then render a view of it with img tags?
possible better answer: http://stackoverflow.com/a/29043926
tagged with: angularjs
has answer: http://stackoverflow.com/a/29043926
has answer: http://stackoverflow.com/a/29044219
linked to: http://stackoverflow.com/q/13734395
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/25811933
has body: I need to be able to upload an image and return the image to the screen for viewing not with an output tag but with an img tag that has a src element. One of the things that's throwing me off in the other tutorials I've seen is the # sign in as a place holder for the src element. I need more detail to implement this portion of it. I reference this from the solution to a similar question which I couldn't implement: HTML input type=file, get the image before submitting the form I'm using angular and I have no knowledge of jQuery so I'd prefer to avoid jQuery explanations. I'm using the following code to upload and view an image (if the following code includes jQuery, I wouldn't know it as I only understand some of it; I found a library for it and I've been trying to figure it out): HTML: &lt;input type="file" id="files" name="files[]" file-model="myFile"/&gt; &lt;output id="list" class="resize-image" alt="Image"&gt;&lt;/output&gt; Javacript: var handleFileSelect = function (evt) {//already set up for multiple files; not what i want to do. var files = evt.target.files; // FileList object // Loop through the FileList and render image files as thumbnails. for (var i = 0, f; f = files[i]; i++) { // Only process image files. if (!f.type.match('image.*')) { continue; } var reader = new FileReader(); // Closure to capture the file information. reader.onload = (function(theFile) { return function(e) { // Render thumbnail. var span = document.createElement('span'); span.innerHTML = ['&lt;img class="thumb" src="', e.target.result, '" title="', escape(theFile.name), '"/&gt;'].join(''); document.getElementById('list').insertBefore(span, null); }; })(f); // Read in the image file as a data URL. reader.readAsDataURL(f); } } document.getElementById('files').addEventListener('change', handleFileSelect, false); Long story short, I want to allow a user to upload a file from desktop, see the file uploaded and crop the image to fit my specifications. I've seen many libraries for this but…
score: 0
linked to: http://stackoverflow.com/q/5802580
type: Question
linked to: http://stackoverflow.com/q/16924082
accepted answer: http://stackoverflow.com/a/29044219

http://stackoverflow.com/comment/46142556
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28944164
type: Comment
has text: You should indeed use `return GetUserProfileInfo(myProfileProp)` and in your controller use `uploadAppService.getProfileInfo(var).then(function succes(data){ //code here }, function fail(error){ //code here })`

http://stackoverflow.com/comment/46118275
type: AnswerComment
comment on: http://stackoverflow.com/a/28931251
type: Comment
has text: Also should declare the `i` variable as local to the function.
score: 0

http://stackoverflow.com/comment/46175850
type: QuestionComment
has text: Could help: http://stackoverflow.com/questions/18827959/phonegap-navigator-notification-alert-doesnt-work and http://stackoverflow.com/a/18927028/1414562
comment on: http://stackoverflow.com/q/28961807
score: 0
type: Comment

http://stackoverflow.com/comment/127147768
has text: parseFloat will parse strings like ''123asd" => 123. What you actually need is Number. So it would be: val = Number(str); if (val > 0.0 ) { console.log('Correct'); } else { console.log('Wrong'); }
type: Comment
comment on: http://stackoverflow.com/a/28960947
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46397824
comment on: http://stackoverflow.com/q/29038950
has text: I only want the selected text, regardless of where in the nested diff structure it occurs.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/29005973
type: AnsweredQuestion
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29006058
tagged with: javascript
tagged with: jquery
score: -1
answer count: 2
possible better answer: http://stackoverflow.com/a/29006046
upvote count: 0
has answer: http://stackoverflow.com/a/29006046
has body: I wish to replace all divs with the class data-item with the attribute data-variable of the item with this class IE : Some Content Some Content Should become {{somevariable}}{{someothervariable}} Code I want to use: $( "div.data-item" , el ).replaceWith( get the data-variable attribute of this element); where el is a jquery object containing the html I wish to parse
favorite count: 0
has title: In Jquery get attribute of targeted element
has comment: http://stackoverflow.com/comment/46258072
has answer: http://stackoverflow.com/a/29006058

http://stackoverflow.com/comment/46075251
has text: The http GET request you're sending, how about mailing that code to the support team? Otherwise, check the API documentation of the server, if there is one. Its likely that you did not supply, or properly supply one or more parameters required on the query string.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28907894
type: Comment

http://stackoverflow.com/q/28989464
tagged with: javascript
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28989552
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/28989525
has answer: http://stackoverflow.com/a/28989525
has answer: http://stackoverflow.com/a/28989552
has body: I have a form with some input fields and radio buttons. On a specific input I want to enable the radio buttons. This is the html file: {{specialEnabled}} Value1 Value2 And here is the controller: SomeControllers.controller('participantCtrl', ['$scope', function($scope) { $scope.specialEnabled = "true"; var _name = ''; $scope.participant = { name: function(newName) { if (angular.isDefined(newName)) { _name = newName; if (_name == "Foo"){ $scope.specialEnabled = "false"; } } return _name; } }; }]); What I do is check the name if it's Foo and then change the disabled to false. Which happens. I am printing specialEnabled on top of the form and it changes from true to false as soon as the name matches but it doesn't enable the radio buttons. What am I doing wrong?
has title: Enable radio button on specific input
score: 0
answer count: 2

http://stackoverflow.com/a/29036113
downvote count: 0
type: Answer
upvote count: 2
has body: "Can I stop the execution of a function from outside that function?" No, you can't programmatically. JavaScript is single-threaded and if you run a piece of code that makes it infinitely busy, such as while(true);, then nothing else will ever be able to execute. Calling such a piece of code within setTimeout or setInterval will have the same result, since the callback of these gets executed in the only thread we have as well. However, you can create a timed recurring execution using setInterval or setTimeout, which can be stopped. var timerId = setInterval(function () { //Process an iteration of the loop in here //If you cause an infinite loop in here, you will have the same issue }, 50); //stop the timer after ~3 seconds setTimeout(clearInterval.bind(null, timerId), 3000); Notes: 4 is the lowest interval that could be honored as specified in the SPEC. setInterval will stack if the callback takes more time to execute than the specified interval. For that reason I never use setInterval and always use setTimeout. Timer intervals are not guaranteed to be accurate e.g. with setTimeout var stopProcessing = startProcessing(); //Stop processing after ~3 seconds setTimeout(stopProcessing, 3000); function startProcessing() { var timerId; !function process() { //Do some processing //Continue processing in ~50 ms timerId = setTimeout(process, 50); }(); return function () { clearTimeout(timerId); } }
score: 2
answers question: http://stackoverflow.com/q/29019831

http://stackoverflow.com/comment/46409800
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29059347
type: QuestionComment
has text: It didn't work. i still haven't found the event that triggers when somebody signs in on google maps

http://stackoverflow.com/comment/46100376
type: Comment
has text: If you use `.attr('ieflub')` you're setting the `ieflub` attribute, not the `data-ieflub` attribute. If you use `.data` both times (and leave off the `data-` prefix), or use `attr` both times (and include the `data-` prefix), you should be fine.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28920167

http://stackoverflow.com/comment/46118428
comment on: http://stackoverflow.com/a/28931326
has text: True, though it does still break you out of the `for` loop. If you remove the success variable then you should use `break` to exit the loop when a match is found.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29035153
has body: Unfortunately at this time there is no JavaScript API for detecting if the host OS uses the Ctrl key or the Cmd key for keyboard shortcuts. The only way to determine this is to use platform sniffing. This is usually done though the use of the navigator.platform property. In fact, the library you mention, Ace editor, actually does it this way. This property also has the advantage that it will not change if you change the user-agent string (at least not normally). On macOS, navigator.platform returns a string like MacProcessor, or MacIntel on an Intel-based Mac. It's technically deprecated though (but not likely to be removed any time soon), and some browsers have implemented a newer navigator.userAgentData.platform property in secure contexts only (takes the form of macOS on macOS). With this knowledge, we can craft a regular expression that will match whichever property is available. Something like the following should be safe and future-proof. /mac/i.test(navigator.userAgentData ? navigator.userAgentData.platform : navigator.platform); Now we just need to use the boolean return value from this statement, to determine if our shortcut key should be e.metaKey, or e.ctrlKey. Working Example: var isMac = /mac/i.test(navigator.userAgentData ? navigator.userAgentData.platform : navigator.platform); window.addEventListener('keydown', function(e) { if (e.keyCode === 67 && (isMac ? e.metaKey : e.ctrlKey)) { document.getElementById('textarea').value += 'Thanks ' + (isMac ? 'Mac' : 'Non-Mac') + '!\n'; } }); Press Cmd + C on Mac, or Ctrl + C on everything else. Alternately: You might also consider just allowing the user to use either shortcut on any platform. Working Example: window.addEventListener('keydown', function(e) { if (e.keyCode === 67 && (e.metaKey || e.ctrlKey)) { document.getElementById('textarea').value += 'Thanks!\n'; } }); Press Cmd + C or Ctrl + C.
type: AcceptedAnswer
upvote count: 9
type: Answer
downvote count: 0
score: 9
accepted answer of: http://stackoverflow.com/q/29033081
answers question: http://stackoverflow.com/q/29033081

http://stackoverflow.com/q/29042806
type: AnsweredQuestion
has title: Advantage of using Boomerang library vs Resource Timing API
tagged with: timing
type: Question
upvote count: 4
downvote count: 0
answer count: 1
tagged with: javascript
score: 4
favorite count: 0
tagged with: boomerang
has answer: http://stackoverflow.com/a/29078275
accepted answer: http://stackoverflow.com/a/29078275
linked to: http://stackoverflow.com/q/14657849
tagged with: angularjs
has body: I'm working on a project that is using Node.js on a back-end, and Angular.js as a front-end and I need to capture page load statistics for different resources of the app across different browsers. I was able to gather basic statistics by using Resource Timing API and storing the resulting JSON object on the server. But after reading this question on SO, I learned about Boomerang library and now I'm a bit confused. What would be the advantage of using Boomerang over Resource Timing API for a single page application (i.e. built in Angular)?
tagged with: node.js

http://stackoverflow.com/comment/46110515
type: Comment
comment on: http://stackoverflow.com/a/28925414
type: AnswerComment
score: 0
has text: Thanks, it worked. Just one thing: how can I do it so that I can actually modify those last items and not just return a copy of them? (That was something that I could do with my original code above.)

http://stackoverflow.com/comment/46096989
score: 0
comment on: http://stackoverflow.com/a/28916491
type: Comment
has text: Btw: below the second code it displays a coffee cup unicode symbol (U+2615)—for those who can’t see it.
type: AnswerComment

http://stackoverflow.com/comment/46175112
has text: Hi, I had this issue, it was related to my school internet firewall. Can you try the install from another internet point ?
comment on: http://stackoverflow.com/q/28961465
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/46358422
has text: Would you be ok with hiding the edit element on click?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29061023

http://stackoverflow.com/comment/46102857
has text: @camdixon Well the total cost part of the function requires information from the content i.e. The input from the #w_amount text field and it's then got to set the span id 'total_cost' to that variable. I am just struggling to know where I need to put the javascript code, to get the two to link with each other.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28922860

http://stackoverflow.com/a/30012450
upvote count: 15
downvote count: 0
answers question: http://stackoverflow.com/q/29051807
score: 15
type: Answer
has body: Ok, so let's start with your code. I've added a few comments to it, so now you can understand the source of the problem: var A = new XMLHttpRequest(); //You create an XMLHttpRequest object var B = new XMLHttpRequest(); //And an another A.open("GET", directory, true); /* Now you open a GET request to DIRECTORY, with async TRUE. The third parameter can make a request sync or async, but sync is not recommended as described below. */ A.onreadystatechange = function () { if (A.readyState === 4) { if (A.status === 200 || A.status == 0) { /* So you registered an event listener. It runs when the readyState changes. You can use it to detect if the request is finished or not. If the readyState is 4, then the request is finished, if the status code is 200, then the response is OK. Here you can do everythin you want after the request. */ } } } A.send(null); //Now you send the request. When it finishes, the event handler will // do the processing, but the execution won't stop here, it immediately goes to the // next function while(true){ // Infinite loop B.open("GET", another_directory, false); //Open request B to ANOTHER_DIRECTORY, // but now, request B will be synchronous B.overrideMimeType("application/document"); // Configure mime type B.send(null); // Send the request if (B.status == "404") continue; // If it's not found, then go to the next iteration // and do something else } I hope that now you can see the source of the problem. When you run this script, then your start an async request and then immediately start the next one. Now you can choose from 2 ways. Run next request from callback (recommended) It's the better way. So start your first (async) request and in the event listener (where you do the processing) you can start the next request. I've made a commented example here: http://jsfiddle.net/5pt6j1mo/1/ (You can do it without arrays - it was just an example) If you use this way then the GUI won't freeze until you are waiting for response. Everything will be respo…

http://stackoverflow.com/comment/46170021
type: Comment
type: QuestionComment
has text: Do you really need to ensure the selected item is visible on the listbox? Isn't this a default behaviour? The code looks fine to me on a first look
comment on: http://stackoverflow.com/q/28949986
score: 0

http://stackoverflow.com/comment/46265950
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29010462
has text: So, I want to make 2 requests: `recurs(2)`, that will actually fire the request 3 times, now.

http://stackoverflow.com/a/28968914
type: Answer
has comment: http://stackoverflow.com/comment/46191735
downvote count: 0
has comment: http://stackoverflow.com/comment/46193140
has comment: http://stackoverflow.com/comment/46190844
has comment: http://stackoverflow.com/comment/46190304
has comment: http://stackoverflow.com/comment/46192442
has comment: http://stackoverflow.com/comment/46191281
score: 1
has body: The easiest way is to add pointer-events: none; to the #second div CSS and position it above the #first div. pointer-events: none; In addition to indicating that the element is not the target of mouse events, the value none instructs the mouse event to go "through" the element and target whatever is "underneath" that element instead. (...) The element is never the target of mouse events; however, mouse events may target its descendant elements if those descendants have pointer-events set to some other value. In these circumstances, mouse events will trigger event listeners on this parent element as appropriate on their way to/from the descendant during the event capture/bubble phases. Reference $(document).ready(function(){ var slide = $("#second"); $("#first").hover(function(){ slide.stop().slideDown("slow"); },function(){ slide.slideUp("slow"); }); }); #first { width: 100px; height: 100px; background:red; } #second { position: absolute; display: none; width: 100px; height: 100px; background:blue; pointer-events: none; } Second First Another way is to insert these two elements inside another element and use hover for that element instead of div #first. This way, the whole area is sensitive: $(document).ready(function(){ var slide = $("#second"); $(".my-hover").hover(function(){ slide.stop().slideDown("slow"); },function(){ slide.slideUp("slow"); }); //for demo: $('.btn').click(function(){ alert('it works!'); }); }); #first { width: 100px; height: 100px; background:red; } #second { position: absolute; display: none; width: 100px; height: 100px; background:blue; } BUTTON First
upvote count: 1
has comment: http://stackoverflow.com/comment/46190203
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28967990
has comment: http://stackoverflow.com/comment/46193367
accepted answer of: http://stackoverflow.com/q/28967990

http://stackoverflow.com/a/29040392
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/29039760
upvote count: 1
has body: IMPORTANT: Check the last part of the answer, you NEED to change your PHP code in order to avoid SQL Injection. You are generating the corresponding promise for the POST request, but it never is executed because you are leaving the page before that happen. Simple call .done method with a callback as a parameter from your $.post() promise, that callback it's going to be executed after the post succeed, also yo can consider add a .fail() that it's going to be executed if the post fail. $.post( 'update-pending.php', { account_id: account_id, scrape_type: scrape_type }).done(function() { document.location.href="redirect.com"; }).fail(function() { //enter code here }; In the server you need return a response to the post request at the end of the process. If not you $.post will return error and execute .fail() always. If you can't / don't want to wait the php script finalize its execution to redirect the user to redirect.com consider to execute a secondary script in the background in the server. I updated your pending.php to use PDO: //update-pending.php /* Consider executing this in the background, (adapted) */ $account_id = $_POST['account_id']; $scrape_type = $_POST['scrape_type']; $params = array('account_id' =&gt; $account_id, 'scrape_type' =&gt; $scrape_type); $query = "UPDATE triggers SET pending='1' WHERE account_id = :account_id AND scrape_type = :scrape_type"; $stmt = $con-&gt;prepare($query); $stmt-&gt;execute($params); /* End of background script */ return true; // Return a response to the POST request. No tested (Can't now) but you get the idea.

http://stackoverflow.com/a/29022677
downvote count: 1
has body: My guess is that since the checkbox is dynamically generated, the line var isTodoListChecked = document.getElementById(i).checked; will not work. You will need to call the jquery .on() function the checkbox value. $(document).on('checked', '#'+i, function(e){
score: -1
answers question: http://stackoverflow.com/q/29022079
type: Answer
upvote count: 0

http://stackoverflow.com/q/28973734
has title: Adding variables and output to html
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28973811
score: 0
answer count: 2
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28990482
tagged with: twitter-bootstrap
has body: I am using Bootstrap buttons set with data-toggle="button" that toggles the active class on the button so I figured I would use hasClass to update the variables. As you can tell I am new to javascript/jquery. I then push the variables out to html and want it to update based on the buttons being selected or de-selected, I just can't quite what method I should use. Is AJAX necessary? Snippet: var priceA = 300; var priceB = 400; var imgBtn = 0; var mscBtn = 0; var outputPrice = priceA + imgBtn + mscBtn; $('#showPrice').html(outputPrice); $('.priceTable button').click(function() { $(this).toggleClass('active'); if ($(this).hasClass('active')) { imgBtn = 25; } else { imgBtn = 0; } $('#showPrice').html(outputPrice); }); .active {background-color:red;} Image Gallery Music Player
tagged with: toggle

http://stackoverflow.com/q/28940404
tagged with: summernote
has title: Summernote and Codemirror not working?
tagged with: codemirror
upvote count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28949287
type: Question
has answer: http://stackoverflow.com/a/31318992
tagged with: javascript
answer count: 2
score: 3
has body: I am currently trying to make codemirror and summernote work, I have followed a online tutorial but there seems to be a problem with the file dependencies. My code is. I have taken the online file urls from summernote's example page, so it should work. Code editor Descriptions Any help would be appreciated.... thanks
downvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/28908527
has comment: http://stackoverflow.com/comment/46076627
type: Question
tagged with: ecmascript-6
tagged with: javascript
has answer: http://stackoverflow.com/a/28908608
answer count: 1
has body: // Storing array and targeting HTML elements. var array = new Uint8Array(1), output = document.getElementById('output'), btn = document.getElementById('btn'); btn.onclick = function() { // Get random values from the array. number = window.crypto.getRandomValues(array); // Show value on the front-end. output.innerHTML = number[0]; }; h1, button { text-align: center; font-family: sans-serif; } button { padding: 20px; display: block; margin: 0 auto; width: 175px; border: solid 5px #000; border-radius: 2px; background: none; font-size: 20px; cursor: pointer; text-transform: uppercase; } Click to go random. Randomize I've been experimenting with UInt8Array() method in Javascript to create random number. When used with window.crypto.getRandomValues(), it works even better than Math.random(). However I would like to know what's the max value this method could generate, so I was wondering if someone more experienced could give this information and perhaps explain me how this works and how this maximum value is defined. Also, can I use these numbers and store them in a variable?
favorite count: 0
has title: What is UInt8Array() max value?
has comment: http://stackoverflow.com/comment/56386810
accepted answer: http://stackoverflow.com/a/28908608
tagged with: typed-arrays
score: 2
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/46076635
downvote count: 1

http://stackoverflow.com/comment/46263347
score: 0
type: Comment
type: QuestionComment
has text: No, this solution doesn't work: $('#image_picker option[value="54fdada12476"]').attr('selected','selected');
comment on: http://stackoverflow.com/q/28988478

http://stackoverflow.com/comment/46351285
score: 0
comment on: http://stackoverflow.com/q/29056789
has text: @mikeLspohn, afraid it doesn't help. I'm already using 'html, body' as mentioned in that answer.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46083858
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28912580
has text: You can simply hide or show `prev-next` button on `hover` and `hover-out` of particular `div`

http://stackoverflow.com/a/28984741
has body: You have .productgroup img { position: absolute; } it seems to be the reason of your problem.
answers question: http://stackoverflow.com/q/28984535
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28984535

http://stackoverflow.com/a/29630350
has comment: http://stackoverflow.com/comment/47600498
upvote count: 3
has comment: http://stackoverflow.com/comment/47578310
has comment: http://stackoverflow.com/comment/47444620
has comment: http://stackoverflow.com/comment/47577416
has body: You have actually made a mistake in assuming that the code is "recursive". It is not recursive. Your comment that "the browser tab of current page will take MORE and MORE memory." is not because of any recursion in that code. If you have a memory leak per second (as per your comments), then the problem lays elsewhere. The instances of the code actually run sequentially and not via nested stack calls (i.e. linear and not recursive). Using the most basic example you linked to: function start() { $('#element').animate({}, 5000, 'linear', start); } start(); here is what actually happens: A function called start is defined and then called once Inside start, an animation operation is started, then start immediately exits! The animate just adds information to a single animation queue for the element, then returns. The animation queue is processed step by step by a separate process (single timer etc). When the queued entry has met its expected end state, it calls the callback - The global start function stored in the queued entry. That simple adds another entry on the animation queue and exits. Basically the code looks recursive, but as the operations are async, via a queue, it is not recursive. I don't know if there is an official name for these, so I just call them chained callbacks.
score: 3
has comment: http://stackoverflow.com/comment/47444714
has comment: http://stackoverflow.com/comment/47578249
downvote count: 0
has comment: http://stackoverflow.com/comment/47577584
has comment: http://stackoverflow.com/comment/47444399
has comment: http://stackoverflow.com/comment/47577746
answers question: http://stackoverflow.com/q/28915336
has comment: http://stackoverflow.com/comment/47444474
type: Answer

http://stackoverflow.com/comment/46175306
comment on: http://stackoverflow.com/q/28961237
has text: no, you are wrong. the `js` not at all connected with this process. still no change...
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28927011
tagged with: nodes
has title: Adding node before sibling in Javascript
type: Question
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28927071
accepted answer: http://stackoverflow.com/a/28927071
has body: so I'm learning about manipulating Dom elements and adding nodes. I use this js code: var parent = document.getElementById('div2'); var newNode = document.createElement('p'); var text = document.createTextNode('Text Node!'); newNode.appendChild(text); parent.insertBefore(newNode, parent.childNodes[4]); This is my html within the usual vanilla setup: abc cde efg ghi The output is this: abc cde Text Node! efg ghi Isn't this the wrong spot? Isn't this insertBefore childNode[2] before it's inserted? For some reason, when I change the number after childNode, the text is not showing up where I expect it to be? Why is that? Aren't the nodes still starting at 0 ... like arrays? Another example, using childNode[6] places it after efg. I thought that should have been insertBefore childNode[3]. I know the question's probably basic but I can't figure out why. thanks!
type: AnsweredQuestion
tagged with: dom

http://stackoverflow.com/q/28916127
score: 2
has body: How can i make this code to give me a static date?Like if I post something on 10 december 2015 at 15:03 2015 to show that date,not the current date. var d = new Date(); var months = new Array ("Ianuarie","Februarie", "Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"); var day = d.getUTCDay(); var month = months[d.getUTCMonth()]; var hour = d.getUTCHours(); var year = d.getUTCFullYear(); if(hour &lt; 10) { hour = "0" + hour; } var minutes = d.getUTCMinutes(); if (minutes &lt; 10) { minutes = "0" + minutes; } document.getElementById("date").innerHTML = ("Postat pe " + day + " " + month + " la ora " + hour + ":" + minutes + " | " + year ).toString();
downvote count: 0
type: Question
tagged with: date
upvote count: 2
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28916164
favorite count: 0
tagged with: static
type: UnansweredQuestion
has title: Setting a javascript date to be static

http://stackoverflow.com/q/28946928
has comment: http://stackoverflow.com/comment/46147870
has comment: http://stackoverflow.com/comment/46148083
has comment: http://stackoverflow.com/comment/46148217
has comment: http://stackoverflow.com/comment/46148492
has title: Run setInterval immediately
has comment: http://stackoverflow.com/comment/46148183
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46148630
has answer: http://stackoverflow.com/a/28946994
has body: I am trying to execute a setInterval function immediately after a button is pressed, then run the function every 5 seconds. Why does this work: $(function () { $('button').on('mousedown', function () { var checkUser = setInterval(function () { }, 5000); checkUser(); }); }); But not this: $(function () { $('button').on('mousedown', function () { var checkUser = setInterval(function () { }(), 5000); }); });
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46148337
score: 0
accepted answer: http://stackoverflow.com/a/28946994
has comment: http://stackoverflow.com/comment/46148152

http://stackoverflow.com/comment/46218194
type: Comment
score: 0
type: QuestionComment
has text: please add more code.. we need the full html also.. the code which you are calling is on dom ready...that should be called on "div (button) click" also the fiddle link isn't helping.. the code (mentioned above) is not even there !
comment on: http://stackoverflow.com/q/28984511

http://stackoverflow.com/a/28955502
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28954746
answers question: http://stackoverflow.com/q/28954746
score: 4
type: AcceptedAnswer
type: Answer
upvote count: 4
has body: When running your program with redirected stdin, you're connected to a ReadStream, not a TTY, so TTY.setRawMode() isn't supported. setRawMode() is used to set a tty stream so that it does not process its data in any way, such as providing special handling of line-feeds. Such processed data is referred to as being "cooked". Standard node ReadStreams are, by definition, already "raw" in that there is no special processing of the data. So, refactor your code without the call to setRawMode() and it should work fine.

http://stackoverflow.com/q/29017476
answer count: 1
accepted answer: http://stackoverflow.com/a/29017837
has body: I've got nested array with entries like this assigned to variable persons: [ { "person": "test", "why": "why test", "third": "third entry" }, { "person": "test", "why": "why test", "third": "" } ] Normally I would use d3.ascending/descending to sort the array alphabetically. persons = persons.sort(function (a,b) { return d3.ascending(a[2], b[2]);}); However, this isn't suitable for sorting when the array contains undefined values. From the d3.js documentation: Unlike the built-in Math.min, this method ignores undefined values; What is another way I can sort the values? I want to put the undefined values at the end of the parent array and the defined values at the top.
has title: Alternative to d3.ascending(), d3.descending() for sorting undefined values to bottom
tagged with: arrays
has comment: http://stackoverflow.com/comment/46279504
tagged with: javascript
tagged with: sorting
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46279402
type: Question
tagged with: d3.js
has comment: http://stackoverflow.com/comment/46279447
has answer: http://stackoverflow.com/a/29017837
score: 0

http://stackoverflow.com/comment/46284858
comment on: http://stackoverflow.com/a/29004767
type: Comment
score: 0
type: AnswerComment
has text: If the HTML is in a Dialog Box, `getActiveSpreadsheet()` should work.

http://stackoverflow.com/q/28998743
tagged with: api
answer count: 1
has answer: http://stackoverflow.com/a/29004315
accepted answer: http://stackoverflow.com/a/29004315
has body: I want to create a button which shows my current location using geolocation. Here is my code which I took from the developers page. Geolocation I found a post here on these forums saying to use this code: var myloc = new google.maps.Marker({ clickable: false, icon: new google.maps.MarkerImage('//maps.gstatic.com/mapfiles/mobile/mobileimgs2.png', new google.maps.Size(22,22), new google.maps.Point(0,18), new google.maps.Point(11,11)), shadow: null, zIndex: 999, map: // your google.maps.Map object }); if (navigator.geolocation) navigator.geolocation.getCurrentPosition(function(pos) { var me = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude); myloc.setPosition(me); }, function(error) { // ... }); But it doesn't seem to work for me. I don't know why. Can anyone try to explain me and tell me where to put the code for get it work? I would rather use a "custom control" to show my current position, if someone can help me make one like that, this way I can put it wherever I want to.
favorite count: 0
type: AnsweredQuestion
has title: Creating a button that shows my current location using geolocation
score: 1
tagged with: geolocation
type: Question
tagged with: javascript
tagged with: google-maps-api-3
upvote count: 3
downvote count: 2

http://stackoverflow.com/q/29058259
favorite count: 0
has answer: http://stackoverflow.com/a/29058344
has title: about google maps + jquery
has answer: http://stackoverflow.com/a/29058337
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46353196
downvote count: 1
type: Question
score: -1
has comment: http://stackoverflow.com/comment/46353428
answer count: 2
has body: I found a tutorial about google maps using jquery. When I read the API documentation, they uses API_KEY, but the tutorial shows something like this what is the difference? the documentation uses "https://maps.googleapis.com/maps/api/js?key=API_KEY"> can someone explain me about this? I'm very new to maps by the way.
tagged with: google-maps
upvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28967074
accepted answer: http://stackoverflow.com/a/28967134
has comment: http://stackoverflow.com/comment/46186469
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46216395
has comment: http://stackoverflow.com/comment/46186374
has comment: http://stackoverflow.com/comment/46186118
has comment: http://stackoverflow.com/comment/46216614
type: Question
has comment: http://stackoverflow.com/comment/46200238
tagged with: ecmascript-6
has comment: http://stackoverflow.com/comment/46197724
has comment: http://stackoverflow.com/comment/46216850
has answer: http://stackoverflow.com/a/28967262
has title: What are the differences between javascript's Set and a regular plain object?
has answer: http://stackoverflow.com/a/28967616
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/7958292
score: 4
tagged with: specifications
linked to: http://stackoverflow.com/q/5525795
linked to: http://stackoverflow.com/q/28965112
answer count: 3
has comment: http://stackoverflow.com/comment/46216975
has body: In trying to solve this question, I learned about the existence of javascript's Set object. I then checked MDN's Set documentation, and the question I am asking here immediately popped up. This debate started in the aforementioned question's answers comments. I found that this thread also contributes to the debate. So far, what I myself could make out of the debate is: Set provides a "clear" method in its API, which is a nice-to-have feature Set ensures the order of the elements added is kept. A plain object does not. Can anyone provide a definite conclusion, if any? Perhaps I should not be comparing the two... but I still think it is a legitimate question and that it is pretty likely that others will ask the same upon learning about Set. In any case, what initially propelled me to ask this was to edit MDN's Set specs adding the conclusion obtained here. But after the development of the thread here I think I should not be doing it, and perhaps Set's specs should not indeed mention a thing about "what about plain objects ultimately providing similar functionality". At least whoever asks himself the question may still find it here in SO and enjoy the insights/contributions added here.
upvote count: 4
has comment: http://stackoverflow.com/comment/46218625
has comment: http://stackoverflow.com/comment/46217502
favorite count: 0
has comment: http://stackoverflow.com/comment/46185907
possible better answer: http://stackoverflow.com/a/28967616
has comment: http://stackoverflow.com/comment/46197676
has answer: http://stackoverflow.com/a/28967134

http://stackoverflow.com/q/29056227
has body: Using this code, I am trying to get the href attribute of a link and make a new link of that attribute. Why my link does not work, I don't know. It shows something like this: 404 - The page cannot be found Sorry, we cannot find the page. It might have been removed, had its name changed, or is temporarily unavailable. Please check that the Web site address is spelled correctly. Or go to our home page, and use the menus to navigate to a specific section. Here is my code: W3Schools.com Show href Value If I use: document.getElementById("demo").innerHTML = text; It shows http://www.w3schools.com. Why doesn't the link go to this site?
has title: jQuery DOM manipulation won't get the href attribute
tagged with: javascript
score: -1
answer count: 1
downvote count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/29056284
accepted answer: http://stackoverflow.com/a/29056284
type: Question

http://stackoverflow.com/q/29016436
upvote count: 1
type: Question
has title: Finding element in jquery ajax html answer
tagged with: javascript
has answer: http://stackoverflow.com/a/29016639
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/29016639
tagged with: http://stackoverflow.com/tag/html
has body: The following code: ajax_obj = $.ajax( { data: data, success: function(answer) { console.log(answer); console.log($('#table_conferences_tbody', answer).html()); console.log($(answer).find('tbody').html()); console.log($(answer).find('tr').length); } }); Console Result: &lt;div&gt;&lt;tbody id="table_conferences_tbody"&gt;&lt;tr id="conf26" class="darkrow"&gt;&lt;td&gt;&lt;span class="expand"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td class="cm_aln"&gt;20.03.26&lt;/td&gt;&lt;td class="no_border"&gt;13:00&lt;/td&gt;&lt;td class="cm_aln no_border"&gt;&amp;minus;&lt;/td&gt;&lt;td&gt;14:00&lt;/td&gt;&lt;td&gt;TEst&lt;/td&gt;&lt;td&gt;Test&lt;/td&gt;&lt;td&gt;Dr. Fariss Chegrani&lt;/td&gt;&lt;/tr&gt;&lt;tr id="conf25" class="lightrow"&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td class="cm_aln"&gt;20.02.26&lt;/td&gt;&lt;td class="no_border"&gt;12:00&lt;/td&gt;&lt;td class="cm_aln no_border"&gt;&amp;minus;&lt;/td&gt;&lt;td&gt;13:00&lt;/td&gt;&lt;td&gt;Test&lt;/td&gt;&lt;td&gt;Test&lt;/td&gt;&lt;td&gt; Petra Haubrich&lt;/td&gt;&lt;/tr&gt;&lt;tr id="conf27" class="darkrow"&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td class="cm_aln"&gt;20.03.20&lt;/td&gt;&lt;td class="no_border"&gt;12:11&lt;/td&gt;&lt;td class="cm_aln no_border"&gt;&amp;minus;&lt;/td&gt;&lt;td&gt;13:11&lt;/td&gt;&lt;td&gt;Test&lt;/td&gt;&lt;td&gt;TEst&lt;/td&gt;&lt;td&gt;Dr. Ariane Hähn&lt;/td&gt;&lt;/tr&gt;&lt;tr id="conf24" class="lightrow"&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td class="cm_aln"&gt;30.11.12&lt;/td&gt;&lt;td class="no_border"&gt;15:00&lt;/td&gt;&lt;td class="cm_aln no_border"&gt;&amp;minus;&lt;/td&gt;&lt;td&gt;17:00&lt;/td&gt;&lt;td&gt;Test&lt;/td&gt;&lt;td&gt;Test&lt;/td&gt;&lt;td&gt; Petra Haubrich&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/div&gt; undefined undefined 0 I don't understand why I can't find any elements within the answer. It works with others answers, so I'm really stuck here. I validated the html answer, it seems correct. What did I do wrong? Thank you very much...
has comment: http://stackoverflow.com/comment/46277394
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46277444
score: 1

http://stackoverflow.com/a/29046999
accepted answer of: http://stackoverflow.com/q/29046938
has comment: http://stackoverflow.com/comment/46332646
answers question: http://stackoverflow.com/q/29046938
has body: You can't pass a string to onclick listener. It should be a function. What you can do alternatively is to create a map of functions. Let's say you have these functions available: function oneFunc() { console.log('one'); function twoFunc() { console.log('two'); Then you can create a mapping: var map = { one : oneFunc, two : twoFunc }; So you can access oneFunc by calling map.one or map["one"]. Now solving your problem is straightforward var newInput = document.createElement('input'); var variable = "one"; // var variable = "two"; newInput.parameters = "xyz"; document.getElementById("element").appendChild(newInput); // You pass an actual function, but using a string parameter. newInput.onclick = map[variable]; When you click a button, you will see "one" in the console.
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46332667
type: Answer

http://stackoverflow.com/q/28941940
has answer: http://stackoverflow.com/a/28980430
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46139065
tagged with: selectize.js
has comment: http://stackoverflow.com/comment/46139202
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46139192
has title: Multiple using selectize, option removal when already selected
type: Question
has comment: http://stackoverflow.com/comment/46139169
tagged with: javascript
score: 0
has body: I'm new in using selectize.js, and this is the simplified version of my problem. Please see fiddle below. Fiddle What I want is not to select the item when it is already selected. Ex. click the Add button and then select the full name. click the Add again. Full name should not be selected in the second or should not be visible. How will I be able to do this? HTML Add JS var saveAsOptions = [ { value: 'full-name', text: 'Full Name' }, { value: 'first-name', text: 'First Name' }, { value: 'last-name', text: 'Last Name' } ]; var i = 1; var $selectSaveAs; $('button').on('click', function(){ $('#container').append(generateSaveAs(i)); $selectSaveAs = $('#saveAs' + i).selectize({ options: saveAsOptions, placeholder: '- Fields -' }); i++; }); function generateSaveAs(id){ return ' '; }
accepted answer: http://stackoverflow.com/a/28980430
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/46139095

http://stackoverflow.com/comment/46225605
score: 0
type: AnswerComment
has text: Redeclaring a variable within the same scope is not an issue in Javascript.
type: Comment
comment on: http://stackoverflow.com/a/28988561

permissions
tag name: permissions
type: Tag
tags question: http://stackoverflow.com/q/28987774

arrays
tags question: http://stackoverflow.com/q/28911523
tags question: http://stackoverflow.com/q/28945396
tags question: http://stackoverflow.com/q/29004501
tags question: http://stackoverflow.com/q/29003295
tags question: http://stackoverflow.com/q/29033406
tags question: http://stackoverflow.com/q/28996317
tags question: http://stackoverflow.com/q/28994203
tags question: http://stackoverflow.com/q/28923163
tags question: http://stackoverflow.com/q/28925142
tags question: http://stackoverflow.com/q/28996583
tags question: http://stackoverflow.com/q/28963562
tags question: http://stackoverflow.com/q/28992631
tags question: http://stackoverflow.com/q/28971901
type: Tag
tags question: http://stackoverflow.com/q/29003057
tags question: http://stackoverflow.com/q/28982592
tags question: http://stackoverflow.com/q/28973946
tags question: http://stackoverflow.com/q/29041710
tags question: http://stackoverflow.com/q/28965286
tags question: http://stackoverflow.com/q/29003671
tags question: http://stackoverflow.com/q/28924429
tags question: http://stackoverflow.com/q/28910866
tags question: http://stackoverflow.com/q/28942017
tags question: http://stackoverflow.com/q/28920721
tags question: http://stackoverflow.com/q/29014638
tags question: http://stackoverflow.com/q/28984333
tags question: http://stackoverflow.com/q/28958249
tags question: http://stackoverflow.com/q/29032525
tags question: http://stackoverflow.com/q/28925259
tags question: http://stackoverflow.com/q/28919036
tags question: http://stackoverflow.com/q/29014203
tags question: http://stackoverflow.com/q/29002435
tags question: http://stackoverflow.com/q/28965594
tags question: http://stackoverflow.com/q/29001706
tags question: http://stackoverflow.com/q/28935783
tags question: http://stackoverflow.com/q/28906718
tags question: http://stackoverflow.com/q/29046343
tags question: http://stackoverflow.com/q/29055551
tags question: http://stackoverflow.com/q/28934934
tags question: http://stackoverflow.com/q/29048201
tags question: http://stackoverflow.com/q/28934878
tags question: http://stackoverflow.com/q/28929159
tags question: http://stackoverflow.com/q/28968937
tags question: http://stackoverflow.com/q/28969586
tags question: http://stackoverflow.com/q/28916970
tags question: http://stackoverflow.com/q/29009012
tags question: http://stackoverflow.com/q/28921564
tags question: http://stackoverflow.com/q/29039036
tags question: http://stackoverflow.com/q/28944458
tags question: http://stackoverflow.com/q/29009022
tags question: http://stackoverflow.com/q/29002275
tags question: http://stackoverflow.com/q/28962478
tags question: http://stackoverflow.com/q/28974304
tags question: http://stackoverflow.com/q/28914662
tags question: http://stackoverflow.com/q/29008440
tags question: http://stackoverflow.com/q/28994260
tags question: http://stackoverflow.com/q/28923124
tags question: http://stackoverflow.com/q/29015665
tags question: http://stackoverflow.com/q/28994018
tags question: http://stackoverflow.com/q/29016681
tags question: http://stackoverflow.com/q/28948683
tags question: http://stackoverflow.com/q/29000189
tags question: http://stackoverflow.com/q/28935775
tags question: http://stackoverflow.com/q/29041659
tags question: http://stackoverflow.com/q/28991014
tags question: http://stackoverflow.com/q/28906775
tags question: http://stackoverflow.com/q/29015965
tags question: http://stackoverflow.com/q/28989330
tags question: http://stackoverflow.com/q/29060651
tags question: http://stackoverflow.com/q/28960458
tags question: http://stackoverflow.com/q/29047069
tags question: http://stackoverflow.com/q/29021749
tags question: http://stackoverflow.com/q/28981495
tags question: http://stackoverflow.com/q/29014492
tags question: http://stackoverflow.com/q/28980510
tags question: http://stackoverflow.com/q/29017383
tags question: http://stackoverflow.com/q/29019004
tags question: http://stackoverflow.com/q/29022964
tags question: http://stackoverflow.com/q/29009596
tags question: http://stackoverflow.com/q/29001762

http://stackoverflow.com/a/28974181
score: 2
downvote count: 0
has body: There are two things you need to fix - your code doesn't print rangeStop, but it does include a trailing comma. You can fix the former by changing your loop end condition to use &lt;=, and String.prototype.slice can do the latter. function printRange(rangeStart, rangeStop) { var text = ""; for (var i = rangeStart; i &lt;= rangeStop; i++) { text += i + ','; } return text.slice(0, -1); } document.write(printRange(20, 47));
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28974100
answers question: http://stackoverflow.com/q/28974100
type: Answer

http://stackoverflow.com/comment/46074877
comment on: http://stackoverflow.com/a/28907469
type: AnswerComment
has text: I'm sorry to be this annoying but somehow the calculation doesn't show up even if I copy paste your code.
score: 0
type: Comment

http://stackoverflow.com/q/28951224
tagged with: javascript
has comment: http://stackoverflow.com/comment/62199802
linked to: http://stackoverflow.com/q/16245767
answer count: 1
downvote count: 0
linked to: http://stackoverflow.com/q/695151
favorite count: 0
tagged with: download
has body: I know there's a lot of questions already existing on SO related to this kind of problem, for instance: Create a file in memory for user to download, not through server Using HTML5/Javascript to generate and save a file Data protocol URL size limitations Save file Javascript with file name Creating a Blob from a base64 string in JavaScript Failed to execute 'atob' on 'Window' This question is very specific to Safari on iOS 8.1.3 (Mobile, iPad 2+). We have an offline AngularJS web app using Application Cache and IndexedDB to store data. One kind of data is PDF documents that can be relatively large: about 25 megabytes max. We are storing these files in IndexedDB and when the user wants to download it, we have this file in-memory within the browser with JavaScript. The problem is really when the user wants to save it. Safari Mobile crashes maybe from a size limitation of Data URI or something else. this.save = function (file) { var mediaType = "application/pdf"; var link = document.createElement("a"); var blob = new Blob([this.fromBase64ToBinary(file.content)], { type: mediaType }); var blobUrl = URL.createObjectURL(blob); document.body.appendChild(link); link.download = file.name; link.href = blobUrl; link.click(); document.body.removeChild(link); }; In a service, we have a function save(file) where file is an object containing two properties: name: the filename; content: data of the file, which is base 64 encoded, then we transform it to binary. The atob() function can be the cause? When I do a step-by-step debugging on the iPad running this code, it crashes right there (ie: line with var byteCharacters = atob(b64Data);). this.fromBase64ToBinary = function (base64) { var byteCharacters = atob(base64); var byteNumbers = new Array(byteCharacters.length); for (var i = 0; i &lt; byteCharacters.length; i++) { byteNumbers[i] = byteCharacters.charCodeAt(i); } return new Uint8Array(byteNumbers); };
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/7717851
linked to: http://stackoverflow.com/q/22578530
has comment: http://stackoverflow.com/comment/98109894
linked to: http://stackoverflow.com/q/3665115
has answer: http://stackoverflow.com/a/56204884
tagged with: mobile-safari
upvote count: 26
has title: How to download data client-side with mobile Safari?
has comment: http://stackoverflow.com/comment/98109862
linked to: http://stackoverflow.com/q/2897619
linked to: http://stackoverflow.com/q/3092019
type: Question
linked to: http://stackoverflow.com/q/37277051
has comment: http://stackoverflow.com/comment/98110232
has comment: http://stackoverflow.com/comment/88981182
score: 26

http://stackoverflow.com/comment/46142467
has text: @dandavis, Even working with the `image.onload` method, this does not fix the issue. How am I supposed to do this with a hidden tag if the image is supposed to be rendered on the HTML5 canvas?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28932905

http://stackoverflow.com/a/29060881
has body: $('body').on('load', '.iThumbnail img', function() { var $this = $(this); if (($this.height() &gt; $this.width()) &amp;&amp; ($this.height() != 0) ) { $this.addClass('portraitView'); } });
type: Answer
has comment: http://stackoverflow.com/comment/46359090
has comment: http://stackoverflow.com/comment/46360339
has comment: http://stackoverflow.com/comment/46358981
upvote count: 1
answers question: http://stackoverflow.com/q/29060622
score: 1
has comment: http://stackoverflow.com/comment/46358644
downvote count: 0
has comment: http://stackoverflow.com/comment/46358368

http://stackoverflow.com/a/28914324
score: 2
downvote count: 0
has body: I'm not sure that what you have is working as you expect because you can only append whole elements. Your current code would end up with something like this: &lt;h2&gt; &lt;a href=''&gt;&lt;/a&gt; My name 1 &lt;a&gt;&lt;/a&gt; &lt;/h2&gt; Given that you want to effectively wrap the text of the h2 in an a element you can use wrapInner() with a handler function containing the logic to set the href. Try this: jQuery(".content h2").wrapInner(function() { var href = 'foo.php'; // your logic here return '&lt;a href="' + href + '"&gt;&lt;/a&gt;'; }); Example fiddle
answers question: http://stackoverflow.com/q/28914264
upvote count: 2
type: Answer

http://stackoverflow.com/comment/46156935
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28951337
has text: What is it used for?
score: 0

http://stackoverflow.com/a/29006252
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28986488
answers question: http://stackoverflow.com/q/28986488
score: 1
type: AcceptedAnswer
has body: According to this page JayData doesnt support firefox using webSql or sqLite though it should have worked with indexeddb I've tested it using chrome and it seems to be happy so yea little dodgy 2nd most popular browser on the planet but nm
upvote count: 1
type: Answer

http://stackoverflow.com/q/29003295
upvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/46253559
tagged with: arrays
has comment: http://stackoverflow.com/comment/46253494
tagged with: javascript
has answer: http://stackoverflow.com/a/29013462
score: -1
has title: Loop through array and append inside as
answer count: 1
downvote count: 1
tagged with: jquery
has body: I want the out put to be like this. When i loop through the array object i am getting the out put like this.where the First LI tags gets appeneded to the Next LI tags. Here is my array output: Object { AUSTRALIA: "http://au.com# AU,http://mcg.com# MCG", INDIA: "http://kp.com# KP,http://ap.com# AP,http://tg.com# TG", PAKISTAN: "http://PK.COM# PK,http://POL# POL", USA: "http://UU# UU,http://PHL.com# PHL" }. Below is the code for the same. for (var category in clientData) { var category_attr; category_attr = clientData[category]; category_attr = category_attr.split(","); html = "&lt;ul&gt;" + category.trim() + "&lt;/ul&gt;"; for(var i=0; i&lt;category_attr.length; i++) { var temp = category_attr[i].split("#"); var url = temp[0].trim(); var urldesc = temp[1].trim(); liHtml += "&lt;li&gt;"+ "&lt;a href='" +url +"'&gt;"+urldesc+""+"&lt;/a&gt;"+ "&lt;/li&gt;"; } html = html + liHtml; $("#tasksUL").append(html); } //$("#tasksUL").append(html); } }); } &lt;/script&gt; &lt;div id="tasksUL" &gt;&lt;/div&gt; Output Imagec
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/a/28983648
answers question: http://stackoverflow.com/q/28983477
upvote count: 1
has body: function validate() { if (!document.getElementById("Male").checked &amp;&amp; !document.getElementById("Female").checked) {alert("Please specify gender"); return;} if (!document.getElementById("Mem").checked &amp;&amp; !document.getElementById("NonMem").checked) {alert("Please specify member"); return;} if (!document.getElementById("Veg").checked &amp;&amp; !document.getElementById("NonVeg").checked) {alert("Please specify vegetarian"); return;} alert("successfully validated"); } Gender: &lt;input type="radio" id="Male" name="Gender"&gt; Male &lt;input type="radio" id="Female" name="Gender"&gt; Female &lt;br&gt; Member: &lt;input type="radio" id="Mem" name="Member"&gt; Yes &lt;input type="radio" id="NonMem" name="Member"&gt; No &lt;br&gt; Vegetarian: &lt;input type="radio" id="Veg" name="Veget"&gt; Yes &lt;input type="radio" id="NonVeg" name="Veget"&gt; No &lt;br&gt; &lt;input type='button' value='Validate' onclick='validate()'&gt; document.getElementByID to document.getElementById
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/29028747
tagged with: windmill
answer count: 0
downvote count: 0
score: 1
has title: Windmill in Python hanging when using getPageText()
type: Question
tagged with: javascript
upvote count: 1
has body: I'm trying to write a simple script with Windmill to open a page (which has javascript) and then download the entire html. My code is: from windmill.authoring import setup_module, WindmillTestClient from windmill.conf import global_settings import sys global_settings.START_FIREFOX = True setup_module(sys.modules[__name__]) def my_func(): url = "a certain url" client = WindmillTestClient(__name__) client.open(url=cur_url) html = client.commands.getPageText() This last line, with getPageText() just seems to hang. Nothing happens and it never returns. Also, is it necessary for windmill to open up the whole GUI every time? And if it is, is there a function in python to close it when I'm done (a link to any actual documentation would be helpful; all I've found are a few examples)? Edit: solved the problem by just using Selenium instead, took about 15 minutes vs 3 hours of trying to make Windmill work. A colleague of mine came up with an alternate solution, which was to actually watch the network traffic coming into the browser and scrape the GET requests. Not totally sure how he did it though.
favorite count: 0
type: UnansweredQuestion
tagged with: python

http://stackoverflow.com/q/28931791
possible better answer: http://stackoverflow.com/a/28932733
has title: Jquery-How to grey out the background while showing the loading icon over it
score: 26
tagged with: javascript
upvote count: 26
has answer: http://stackoverflow.com/a/28932733
linked to: http://stackoverflow.com/q/5829382
accepted answer: http://stackoverflow.com/a/28931864
has comment: http://stackoverflow.com/comment/46121365
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28931864
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to grey out the background when a user clicks on the submit button and show the loading icon over the greyed background. below is the icon im trying to show, however I'm not able to show the animation, the icon just stays still. Here is my html: Submit JS: $("#button").click(function() { $("#container").css("opacity",0.5); $("#loading-img").css({"display": "block"}); } I'm not sure how exactly to use the css for making the icon animate over the grey background. Any ideas please?? EDIT:::: Fiddle: http://jsfiddle.net/hnk6bLbt/1/ Thanks!
tagged with: css
has answer: http://stackoverflow.com/a/28932535
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46122461
type: Question

http://stackoverflow.com/a/28965688
answers question: http://stackoverflow.com/q/28965017
has comment: http://stackoverflow.com/comment/46183853
downvote count: 0
has body: There are two issues: Firstly, you are not resolving the promise. You need to resolve your promise with your data that is returned from the server. Second, the result is actually in the results property of the data that is returned from the server. Here as you are retrieving only name, you should use below code: function getSucceeded(data) { console.log('data:', data); deferred.resolve(data.results[0]); }
score: 1
has comment: http://stackoverflow.com/comment/46186047
has comment: http://stackoverflow.com/comment/46209031
type: Answer
has comment: http://stackoverflow.com/comment/46183176
upvote count: 1

http://stackoverflow.com/q/28929356
downvote count: 1
upvote count: 0
has title: How to make it so html link tags can work without tags
has answer: http://stackoverflow.com/a/28929545
score: -1
type: Question
tagged with: pug
has body: So, I'm trying to make it so html link tags can work with tags. Normally i would do: &lt;a href="google.ca"&gt; google &lt;/a&gt; How would i do it if I want to accomplish: [&lt;link&gt; &lt;label&gt;] so when I input, I will do [google.ca google] to get the same result as a tags? Thanks
tagged with: javascript
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28935777
has answer: http://stackoverflow.com/a/28929380
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/80207869
type: Comment
comment on: http://stackoverflow.com/a/28912232
has text: @t.niese Doh! You're right.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28923910
answers question: http://stackoverflow.com/q/28922288
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28922288
has comment: http://stackoverflow.com/comment/46113588
has comment: http://stackoverflow.com/comment/46114450
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46111818
type: Answer
has body: To understand more about css3 rotate3d, you can visit this link to learn more about it. To accomplish what you want to do to rotate your box diagonally, you can use: transform: rotate3d(90, -90, 0, 180deg); Here is the full source code how to do it: http://jsfiddle.net/yp6j5qem/15 Hope this helps!

http://stackoverflow.com/q/28969861
has answer: http://stackoverflow.com/a/39149318
upvote count: 504
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/60030506
has answer: http://stackoverflow.com/a/75019973
tagged with: amd
score: 504
has answer: http://stackoverflow.com/a/28989476
has answer: http://stackoverflow.com/a/47333184
type: Question
has answer: http://stackoverflow.com/a/30331983
tagged with: webpack
has answer: http://stackoverflow.com/a/50427028
downvote count: 0
linked to: http://stackoverflow.com/q/49370849
tagged with: javascript
has answer: http://stackoverflow.com/a/45971518
tagged with: jquery
has answer: http://stackoverflow.com/a/44142944
has title: Managing jQuery plugin dependency in webpack
has answer: http://stackoverflow.com/a/34354301
has body: I'm using Webpack in my application, in which I create two entry points - bundle.js for all my JavaScript files/codes, and vendors.js for all libraries like jQuery and React. What do I do in order to use plugins which have jQuery as their dependencies and I want to have them also in vendors.js? What if those plugins have multiple dependencies? Currently I'm trying to use this jQuery plugin here - https://github.com/mbklein/jquery-elastic. The Webpack documentation mentions providePlugin and imports-loader. I used providePlugin, but still the jQuery object is not available. Here is how my webpack.config.js looks like- var webpack = require('webpack'); var bower_dir = __dirname + '/bower_components'; var node_dir = __dirname + '/node_modules'; var lib_dir = __dirname + '/public/js/libs'; var config = { addVendor: function (name, path) { this.resolve.alias[name] = path; this.module.noParse.push(new RegExp(path)); }, plugins: [ new webpack.ProvidePlugin({ $: "jquery", jquery: "jQuery", "window.jQuery": "jquery" }), new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js', Infinity) ], entry: { app: ['./public/js/main.js'], vendors: ['react','jquery'] }, resolve: { alias: { 'jquery': node_dir + '/jquery/dist/jquery.js', 'jquery.elastic': lib_dir + '/jquery.elastic.source.js' } }, output: { path: './public/js', filename: 'bundle.js' }, module: { loaders: [ { test: /\.js$/, loader: 'jsx-loader' }, { test: /\.jquery.elastic.js$/, loader: 'imports-loader' } ] } }; config.addVendor('react', bower_dir + '/react/react.min.js'); config.addVendor('jquery', node_dir + '/jquery/dist/jquery.js'); config.addVendor('jquery.elastic', lib_dir +'/jquery.elastic.source.js'); module.exports = config; But in spite of this, it still throws an error in the browser console: Uncaught ReferenceError: jQuery is not defined Similarly, when I use the imports-loader, it throws an error, require is not defined' in this line: var jQuery = require("jquery") However, I could use the same plugin w…
accepted answer: http://stackoverflow.com/a/28989476
favorite count: 0
has answer: http://stackoverflow.com/a/45404761
answer count: 12
possible better answer: http://stackoverflow.com/a/34354301
has answer: http://stackoverflow.com/a/46937798
has answer: http://stackoverflow.com/a/46500027

http://stackoverflow.com/q/28986872
favorite count: 0
type: Question
has title: finding distance between two points on Image even when image is scaled
score: 1
has answer: http://stackoverflow.com/a/28988295
upvote count: 1
answer count: 1
has body: I have an Image loaded on canvas. I want to find the distance between to points on this image. But because the image can be bit small user can zoom in (scale image) and then click on two points find the distance. To get points clicked on any image is the easy part myImage.on('mousedown', function(e){ console.log(e.layerX + " "+e.layerY); } though I am not quite sure that layerX is the better messurment. What If the user has scaled the image. Won't that mean that the distance will be bigger? So what is the correct way? Is it to scale down the layerX and layerY before calculating the distance? myImage.on('mousedown', function(e){ var x, y; x = e.layerX / this.getScaleX(); y = e.layerY / this.getScaleY(); calculateDistance(x, y); }); Would the above calculate a more accurate distance? At a second level I want to to take this distance and then recalibrate another picture according to the distance I calibrated (doing the opposite thing). use case: Users wants to take two points but scales the image up. The destination is calculated and the image is scaled down to its original state. User add a new picture on canvas, which shows something that I know its physical width and height. So system re-calculates pixel width and height of the image based on the calibration done before. So correct procedure would be Take two points (on scaled up image) Find distance Divide distance with scale ratio Use the distance or Take two points (on scaled up image) divide layerX and layerY with scale ratio calculate distance Use the distance Which one is more correct?
tagged with: fabricjs
type: UnansweredQuestion
tagged with: image
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/33185715
type: Answer
has comment: http://stackoverflow.com/comment/96545719
upvote count: 7
answers question: http://stackoverflow.com/q/29051011
has comment: http://stackoverflow.com/comment/54178017
score: 7
has comment: http://stackoverflow.com/comment/54179094
downvote count: 0
has comment: http://stackoverflow.com/comment/96545541
has comment: http://stackoverflow.com/comment/54177950
has body: You cannot do it directly in the arguments, but you can extract the values afterward: function myFun(allVals) { const { val1, val2, val3 } = allVals; console.log("easy access to individual entries:", val2); console.log("easy access to all entries:", allVals); }

http://stackoverflow.com/q/29058365
type: Question
score: 0
answer count: 2
has body: I am trying to implement dynamically show hide columns in rails using dataTable plugin. The show Hide button is visible but when I uncheck a column it is not disappearing from the table. The column should appear only when I click on check mark true, if I uncheck it it should be not in the columns list. Please help me how to fix this!. _merchent.html.erb # partail file &lt;div id="merchant_list" class="panel-body"&gt; &lt;div class="table-success"&gt; &lt;table id = "table_id" class="table table-bordered"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Merchant&lt;/th&gt; &lt;th&gt;Bank Name&lt;/th&gt; &lt;th&gt;Payment Gateway&lt;/th&gt; &lt;th&gt;Status&lt;/th&gt; &lt;th&gt;Amount&lt;/th&gt; &lt;th&gt;Discount&lt;/th&gt; &lt;th&gt;Additional Charges&lt;/th&gt; &lt;th&gt;Added On&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody id="details"&gt; &lt;% @all_settlement_details.each do |sd| %&gt; &lt;tr&gt; &lt;td&gt;&lt;%= sd.merchantname %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= sd.bank_name %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= sd.payment_gateway %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= get_status(sd.status) %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= sd.amount %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= sd.discount %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= sd.additional_charges%&gt;&lt;/td&gt; &lt;td&gt;&lt;%= get_added_on_date sd.addedon %&gt;&lt;/td&gt; &lt;/tr&gt; &lt;% end %&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;div id="align"&gt; &lt;a href="" class="load-more" data-clicks="1"&gt;Load more...&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; merchant.js file $(document).ready(function(){ $('#table_id').DataTable({ "dom": 'C&amp;gt;"clear"&amp;lt;lfrtip', paging: false, searching: false }); Please see the corresponding image as well.
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29064184
has title: Datae Tables Dynamically show/hide columns is not working in Rails
tagged with: http://stackoverflow.com/tag/html
tagged with: datatables
has answer: http://stackoverflow.com/a/29059418
type: UnansweredQuestion
tagged with: ruby-on-rails

pipe
tags question: http://stackoverflow.com/q/29045173
tags question: http://stackoverflow.com/q/29058371
tag name: pipe
type: Tag

http://stackoverflow.com/q/29000730
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29002630
favorite count: 0
has body: I am trying to create a visualization to help students that I work with learn about measures of fit, such as r-squared. For R-squared, I want to have both the regression line and a line for the mean of Y on my graph. (My end goal is to have lines between the points and/or lines to represent ESS, TSS, and SSR that students can click to see or not see). My regression line is working fine, but when I try to add in my average line, it ends up with a strange start and end point and is noticeably NOT a flat line at the average (4.4). I also get the following error in my console: Error: Invalid value for &lt;path&gt; attribute d="M112,235.71428571428572L194,119.14285714285712L276,NaNL358,NaNL440,NaN" which corresponds to the line of code: .attr({ within my avg.append("path") for my avgline (at least, I think that's why I'm specifying there): svg.append("path") .datum(avgdataset) .attr({ d: avgline, stroke: "green", "stroke-width": 1, fill: "none", "stroke-dasharray": "5,5", }); I've tried playing around with how avgline is specified to no end (this playing around normally ends up producing no line at all). I've also tried using data instead of datum, to no avail. I'm likely making a really basic mistake, since I'm new to javascript and D3. Here's all of my code thus far, to put it in context: //Width and height var w = 500; var h = 300; var padding = 30; var dataset = [ [1, 1], [2, 5], [3, 4], [4, 7], [5, 5] ]; //Create scale functions var xScale = d3.scale.linear() .domain([0, d3.max(dataset, function(d) { return d[0]; })]) .range([padding, w - padding * 2]); var yScale = d3.scale.linear() .domain([0, d3.max(dataset, function(d) { return d[1]; })]) .range([h - padding, padding]); var rScale = d3.scale.linear() .domain([0, d3.max(dataset, function(d) { return d[1]; })]) .range([2, 5]); //Define X axis var xAxis = d3.svg.axis() .scale(xScale) .orient("bottom") .ticks(5); //Define Y axis var yAxis = d3.svg.axis() .scale(yScale) .orient("left") .ticks(5); //Create SVG element…
possible better answer: http://stackoverflow.com/a/29003163
tagged with: d3.js
score: 2
type: AnsweredQuestion
has title: Creating an average Y line for D3 visualization?
accepted answer: http://stackoverflow.com/a/29002630
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/29003163
answer count: 2

http://stackoverflow.com/q/28919171
answer count: 1
accepted answer: http://stackoverflow.com/a/28919225
type: AnsweredQuestion
has body: I want to change the url according to the menu pages, so to easily share a link to someone else, since each page has its own url name. So, I have a function that loads the file content. But how to implement it with the url change also into the function? Here is the navigation using onclick function. Profile About Contact
type: Question
has answer: http://stackoverflow.com/a/28919225
has title: How to get and change url when using jQuery.load
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29030193
upvote count: 1
answers question: http://stackoverflow.com/q/29026149
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46306743
has comment: http://stackoverflow.com/comment/46307457
type: Answer
has comment: http://stackoverflow.com/comment/46304423
has body: If I understand your question correctly, you want to send multiple options to the data option of ajax. According to Backbone collection fetch documentation, jQuery.ajax options can also be passed directly as fetch options, so to fetch a specific page of a paginated collection: Documents.fetch({data: {page: 3}}) In your case, maybe you can do something like: territories.fetch({ data: { status: 1, anotherParam: "another param value" // or whatever you want it to be }, processData: true, reset: true }); We can pass as many parameters as we want, just like jQuery.ajax. ( Read about data option )
accepted answer of: http://stackoverflow.com/q/29026149
score: 1

http://stackoverflow.com/comment/46210815
type: QuestionComment
has text: without using [HttpPost] in mehtod decalred is working but one problem it is not redirect a page..
score: 0
comment on: http://stackoverflow.com/q/28980278
type: Comment

http://stackoverflow.com/q/29031981
tagged with: css
has comment: http://stackoverflow.com/comment/46308324
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46305324
type: Question
has answer: http://stackoverflow.com/a/29032219
has body: var carouselitems = $("#bestselling .carousel-inner .product"); for(var i = 0; i < carouselitems.length; i+=count) { carouselitems.slice(i, i+count).wrapAll(" "); } $('#bestselling .carousel-inner .item').first().addClass('active'); I need this part of the script to wrap every count number of elements in a .item div, but since I'm using breakpoints for my website (responsive), I must reset the count number depending on breakpoint, so that would work as: setCarouselSlides(3); for example. If I do this, everytime my divs get wrapped, they get wrapped in +1 layer of .item divs so that if at first it's then after a breakpoint it's How can I force it to add that .item wrapping only once when I fire up setCarouselSlides(); function?
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29032083
has comment: http://stackoverflow.com/comment/46305285
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/46306987
favorite count: 0
type: UnansweredQuestion
has title: How to wrap elements with jquery, but only once

http://stackoverflow.com/comment/46271162
score: 0
has text: Your *client* make web requests. So it is a client from socket point of view.
comment on: http://stackoverflow.com/q/29012945
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29034997
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46310995
type: Question
has answer: http://stackoverflow.com/a/29035173
accepted answer: http://stackoverflow.com/a/29035173
tagged with: javascript
has comment: http://stackoverflow.com/comment/46319989
score: 0
answer count: 1
tagged with: jquery
has body: I'm trying to prevent the form being submitted if the validation fails, however its not working at the moment. The onclick method is used for hidden input, but its the onsubmit method that is failing. Any ideas? &lt;input type="submit" class="btn ccm-input-submit" id="register" name="register" value="Register" onsubmit="return validation(this)" onclick="copytextbox()"/&gt; &lt;?php echo $form-&gt;hidden('rcID', $rcID); ?&gt; &lt;script&gt; function copytextbox() { var textToCopy = document.getElementById('school').value; var whereToCopy = document.getElementById('&lt;?php echo $school ?&gt;'); whereToCopy.value += textToCopy; } function validation(f) { var schoolText = document.getElementById('school').value; if (schoolText == '') { alert('Please Choose a value from the dropdown box.'); return false; // stop submission until textbox is not '' } else { f.submit(); return false; } } &lt;/script&gt; Also, im attempting to see if that value is a member of an array, I tried using indexOf(schoolText) etc but this also failed, kind regards
has title: Javascript/PHP Validation

dom-events
tags question: http://stackoverflow.com/q/28993157
tags question: http://stackoverflow.com/q/28998586
tags question: http://stackoverflow.com/q/29004449
tags question: http://stackoverflow.com/q/28997983
tags question: http://stackoverflow.com/q/29017375
tags question: http://stackoverflow.com/q/29038664
tags question: http://stackoverflow.com/q/28948361
tags question: http://stackoverflow.com/q/29040779
type: Tag
tags question: http://stackoverflow.com/q/29055221
tags question: http://stackoverflow.com/q/28994260
tag name: dom-events
tags question: http://stackoverflow.com/q/29049077
tags question: http://stackoverflow.com/q/29009938

http://stackoverflow.com/a/28921276
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46117993
has comment: http://stackoverflow.com/comment/46130384
has comment: http://stackoverflow.com/comment/46099885
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28920681
has body: I haven't peeked into the SO menu, so I don't know how they did it. But this seems to work nicely. A click on one of the buttons opens the dropdown. The dropdown is not closed by a 'mouseout', like in your code, but only when another menu is hovered. If you hover outside of the menu area, the lastly hovered menu remains open. Clicking anywhere closes the menu. So showing the menu is not directly done by using a :hover pseudo element in CSS, but by adding a class, which remains there even when the menu is unhovered. I think the net result behaves pretty close to Stack Overflow's. $(function(){ // The event to handle clicks outside of the menu. This will close the menu. var offEvent = function(event){ $('.menu-bar').removeClass('active'); $(document).off('click', offEvent); }; // The click event on the menu buttons, to toggle 'menu mode' as it were. $(document).on('click', '.menu-bar .menu', function(event){ event.preventDefault(); $('.menu-bar').addClass('active'); $(this).addClass('active'); // Leave menu mode by clicking anywhere of the menu. $(document).on('click', offEvent ); }); // Hover toggles between the dropdowns of the separate menus. $('.menu-bar .menu').hover( function(event){ var $current = $(this); $('.menu').each( function(index, element){ var $element = $(this); if ($element.get(0) == $current.get(0)) { $element.addClass('active'); } else { $element.removeClass('active'); } }); }); }); ul { margin: 0; padding: 0; } ul li { display: inline-block; padding: 10px 20px; background: #333; color: #eee; } ul li ul { display: none; position: absolute; border: 2px solid #555; } ul li ul li { display: block; } .menu .dropdown { display: none; } .menu-bar.active .menu.active .dropdown { display: block; } .menu { display: inline-block; position: relative; border: 1px solid grey; } .menu .dropdown { position: absolute; top: 100%; left: 0; border: 2px solid #555; } button 1 sub button 1 sub button 2 button 2 sub button 1 sub button 2 button 3 sub button 1 sub button…
accepted answer of: http://stackoverflow.com/q/28920681
upvote count: 2

http://stackoverflow.com/a/29035173
score: 3
has body: Move your onsubmit="return validation(this)" attribute from the &lt;input&gt; tag to the &lt;form&gt; tag. Test an array like this: // global array var fruits = ["Banana", "Orange", "Apple", "Mango"]; function findFruit(val) { if(fruits.indexOf(val) == -1 { alert('not found'); } else { alert('Found!') } } findFruit('Peach'); // not found
type: AcceptedAnswer
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/29034997
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29034997
has comment: http://stackoverflow.com/comment/46311183
has comment: http://stackoverflow.com/comment/46319046

http://stackoverflow.com/q/29035930
score: 0
has body: have an application which uses spring MVC. I have a method in the controller class which checks for a condition and set a variable value accordingly. if(!dataMap.isEmpty()) { flag =0; } else { flag = 1; } I am calling this method as an ajax call. Now I am trying to check the value of this flag from inside the success function of my ajax, and display alerts accordingly. success:function(data){ if(flag == 0) { $("#myAlert").show(); } else { $("#myAlert1").show(); } }, This doesn't seem to be working.
has comment: http://stackoverflow.com/comment/46315547
has title: How to set a condition in the controller class of spring mvc and display an alert based on that condition in an ajax succes function
has comment: http://stackoverflow.com/comment/46314716
type: UnansweredQuestion
answer count: 0
type: Question
tagged with: javascript
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/comment/46677678
comment on: http://stackoverflow.com/a/29018040
score: 0
type: AnswerComment
type: Comment
has text: I need to have the same values of 'items' when I call: var itemList = sessionManage.retreiveAllData(); but I don't have it. This is my problem :(

http://stackoverflow.com/comment/46305717
has text: @emackey Chrome and Chromium fails to load Cesium on my system. I get `RuntimeError: The browser supports WebGL, but initialization failed. Error` However, in Firefox in DevTools and "Network tab" i can see some GET requests and images with `Could not load the image` message. Here are response headers: `Cache-Control: "max-age=1179" Connection: "Keep-Alive" Content-Length:"8302" Content-Type:"image/png" Date:"Fri, 13 Mar 2015 12:30:05 GMT" Etag:"b2b9d8dd83e7f7f3bf22b6267e44c390" Expires:"Fri, 13 Mar 2015 12:49:44 GMT" Keep-alive:"timeout=5, max=98" Server:"Apache/2.4.7 (Ubuntu)"`
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28946739
type: QuestionComment

http://stackoverflow.com/a/28959058
has body: You will have to create a separate file with functions you want to use globally. import this file in any other python file and you should be good to go. Is there a specific reason you want to mimic the exact functionality? If not this should suffice.
answers question: http://stackoverflow.com/q/28958975
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46170791

http://stackoverflow.com/comment/46276710
comment on: http://stackoverflow.com/q/29009566
score: 0
type: Comment
type: QuestionComment
has text: yes, you can help others by writing down your solution. You can answer your own question, validate it, and we will vote for it

http://stackoverflow.com/q/29029611
has title: $_SESSION variables showing unexpected behaviour
has comment: http://stackoverflow.com/comment/46300713
tagged with: php
has comment: http://stackoverflow.com/comment/46300541
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46301081
has comment: http://stackoverflow.com/comment/46301155
has comment: http://stackoverflow.com/comment/46300558
type: Question
has answer: http://stackoverflow.com/a/29030014
has comment: http://stackoverflow.com/comment/46300549
tagged with: session
has body: I'm currently working on a table with onclick() &lt;td&gt; elements that send info to a PHP page. The basic idea is that if a course is clicked (e.g.French, Maths, English, ...) the PHP page retrieves the value and afterwards executes the SQL code to give me all of the tutors for that specific course. &lt;script&gt; function courseToTutor(id) { var courseClicked = document.getElementById("course" + id).value; $.post('loadDivs/loadTutors.php', {postname: courseClicked}); $('#divTutors').load('loadDivs/loadTutors.php'); } &lt;/script&gt; When a &lt;td&gt; is clicked, it sends its id (generated in php) as a parameter. Inside the function I use that parameter to find the values within the &lt;td&gt; (stored inside an input type="hidden"). I have a single PHP page that both gets the posted value, like this: if (isset($_POST['postname'])) { $course = $_POST['postname']; $_SESSION['clickedCourse'] = $course; echo $course; } The other part of the page is else { //generate table with tutors for a specific course (with SQL) } This works about 85% of the time. Yes, I use correct session_start();s, I have a proper database connection and so on. When I click a &lt;td&gt;, I have an alert on the loadTutors.php that always triggers, it alerts my $_SESSION['clickedCourse];. 85% of the time this alert show the correct info, the other 15% of the time, it is empty. It's not my other code on the page, because I trigger the alert before I execute that code. Thanks in advance EDIT This is the php I use to generate the WHOLE table of courses. &lt;?php $counter = 1; if (!$res = $link-&gt;query($sqlSelectCourses)) { trigger_error('Error in query ' . $link-&gt;error); } else { while ($row = $res-&gt;fetch_assoc()) { ?&gt; &lt;tr&gt; &lt;td onclick="courseToTutor(this.id);" id="&lt;?php echo $counter; ?&gt;"&gt; &lt;?php echo $row["course"]; ?&gt;&lt;input type="hidden" value="&lt;?php echo $row["course"]; ?&gt;" id="course&lt;?php echo $counter; ?&gt;"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php $c…
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46301116
score: 0
has comment: http://stackoverflow.com/comment/46300978
answer count: 1
accepted answer: http://stackoverflow.com/a/29030014

http://stackoverflow.com/comment/46153752
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28948433
has text: You do realize that if you are getting new data, you have to do a *partial postback* right? Thats what ajax is, partial postbacks, not full postbacks.

http://stackoverflow.com/comment/46340891
comment on: http://stackoverflow.com/q/29051421
has text: I've posted an example of how such a postThrob function could be written. It's not a bad idea per se. I just don't see too much value in doing it IMHO.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28956082
upvote count: 1
has body: I am wondering how to reference jquery in html. To my understanding there has to be 2 links: To the library To the external file. here is my reference that does not seem to work.. ps. 1st time here, I know the question sounds stupid, I'm just going crazy with that
has answer: http://stackoverflow.com/a/28956448
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28956133
has answer: http://stackoverflow.com/a/28956126
has answer: http://stackoverflow.com/a/28956125
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46165362
favorite count: 0
has comment: http://stackoverflow.com/comment/46165757
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46165379
has title: html reference to jquery library + external file
answer count: 4
tagged with: reference
has comment: http://stackoverflow.com/comment/46165409

http://stackoverflow.com/a/28991910
answers question: http://stackoverflow.com/q/28990307
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46233374
has body: Your fiddle illuminates the actual issue: content = "&lt;input type='button' value='Add' onclick='addme(\"" + addedTitle + "\")' /&gt;" document.getElementById("display").innerHTML = content; The problem is that the above code will generate the following: &lt;input type='button' value='Add' onclick='addme("some'string")' /&gt; You'll notice this has a single quote inside of your onclick which is single quoted. This is what is breaking. You can escape the single quote with \. However, a better approach would be to get rid of the inline onclick and do it this way: var input = $("&lt;input type='button' value='Add'/&gt;").click(function(){ addme(addedTitle); }); $("#display").append(input); http://jsfiddle.net/bxxmhe03/6/
downvote count: 0

http://stackoverflow.com/q/28967876
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46188522
type: Question
possible better answer: http://stackoverflow.com/a/28968030
answer count: 2
accepted answer: http://stackoverflow.com/a/28968105
has body: I have a html table which I'm sorting with javascript. The table can easily have more than a +1000 rows. This is what I currently have and the html looks similar to this: id name total cost 1 Jack 101 $5 5 Zoe 5 $10 3 Adam 21 $7 My javascript looks like this: function testSort(s) { var column = s; var parent = document.getElementById('mycollection'); var rows = parent.children; // NodeList rows = Array.prototype.slice.call(rows, 0); // change NodeList to array var top = rows.shift(); // remove title row // sort rows.sort(function(a, b) { if(a.getElementsByClassName(column)[0].textContent < b.getElementsByClassName(column)[0].textContent) return -1; if(a.getElementsByClassName(column)[0].textContent > b.getElementsByClassName(column)[0].textContent) return 1; return 0; }); // recreate div parent.innerHTML = ''; // clear parent.appendChild(top); // add title row for(var i=0, l=rows.length; i<l; i++) { // add rows parent.appendChild(rows[i]); } } testSort('D'); I've set up a jsfiddle here: http://jsfiddle.net/rotaercz/f6p377au/ *Additionally is there a way to make the C and D column sort correctly? It's currently sorting only alphabetically.
has title: Using Javascript (or JQuery if it's faster) is there a way to sort this more quickly?
tagged with: javascript
tagged with: jquery
tagged with: sorting
score: 0
has answer: http://stackoverflow.com/a/28968105
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28968030
has comment: http://stackoverflow.com/comment/46187805

http://stackoverflow.com/comment/46238963
type: QuestionComment
comment on: http://stackoverflow.com/q/28989142
score: 0
has text: Thanks for all your help. @JackieChiles - you were right on point...I totally missed the css. I can't believe it. As usual, I missed something completely simple.
type: Comment

http://stackoverflow.com/q/28931591
downvote count: 4
upvote count: 0
tagged with: arrays
answer count: 1
has comment: http://stackoverflow.com/comment/46118871
tagged with: javascript
tagged with: sorting
favorite count: 0
type: UnansweredQuestion
score: -4
has body: I need to create a JavaScript program, that has an array of strings which also sorts in O(nlog n) time. Any help would be appreciated...
has title: Create a JavaScript program, that has an array of strings and the program sorts in O(nlog n) time
type: Question
has answer: http://stackoverflow.com/a/28932063

http://stackoverflow.com/q/28944111
favorite count: 0
has answer: http://stackoverflow.com/a/28944314
has comment: http://stackoverflow.com/comment/46142454
has body: MyValue = [name:"myValue", apple:3, banana:2]; ListValue = [ {name:"value1", apple:1, banana:2]}, {name:"value2", apple:3, banana:2]}, {name:"value2", apple:5, banana:1]}, {name:"value4", apple:3, banana:3]}, {name:"value5", apple:3, banana:5]} ] Could you help me to find a solution to sort a NewListValue with this condition : if each fruit of MyValue is less than or equal to each fruit of each array of ListValue I would like to have this result : NewListValue = [ {name:"value1", apple:1, banana:2]}, {name:"value2", apple:0, banana:1]} ] Thank you so much !
type: AnsweredQuestion
upvote count: 3
type: Question
accepted answer: http://stackoverflow.com/a/28944314
tagged with: javascript
tagged with: sorting
has title: compare arrays and sort a list of arrays with a condition
score: 3
answer count: 1
tagged with: arrays
downvote count: 0

http://stackoverflow.com/q/28988551
type: Question
tagged with: php
score: 0
upvote count: 1
answer count: 1
downvote count: 1
has body: I need to send an Order Details via custom PDF to a Contact's Email Id where Order is my custom module. I want to use DocuSign Integration for sending PDF documents in SugarCRM. But by default Docusign provides facility to send documents from only Opportunity, Account, Contract, or Quote modules. How can I send custom PDFs with DocuSign Integration from a custom module in sugarcrm 7.5.0.1?
has title: docusign for custom modules in sugarcrm 7.5.0.1
tagged with: javascript
type: UnansweredQuestion
tagged with: docusignapi
tagged with: sugarcrm
has comment: http://stackoverflow.com/comment/46225547
has answer: http://stackoverflow.com/a/29219535
has comment: http://stackoverflow.com/comment/46226255
favorite count: 0
tagged with: backbone.js

http://stackoverflow.com/comment/46260015
type: Comment
has text: You should delete the last entered key if it is not a number, else if you type "a" and then 1 it will still tell you that it is not a number, because it matches the "a".
type: AnswerComment
comment on: http://stackoverflow.com/a/29006917
score: 0

http://stackoverflow.com/comment/46302158
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29022698
type: AnswerComment
has text: The way arrays and objects work in JS is quite specific. It is worthy to point out that `foo["name"]` and `foo.name` have *exactly* the same meaning. The only real difference is that former syntax allows using variable as name of attribute, and using attribute names which are not correct identifiers (e.g. containing spaces or dashes), while the latter is a bit shorter and prettier.

http://stackoverflow.com/comment/46257259
comment on: http://stackoverflow.com/q/29005373
type: Comment
type: QuestionComment
has text: Show what is `$injector`?
score: 0

http://stackoverflow.com/comment/46138944
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28942072
type: QuestionComment
has text: @Sukima http://www.manpagez.com/man/5/crontab/

http://stackoverflow.com/a/29000707
score: 0
has body: header( 'Location: ' . site_url('th') ); You can't set headers after output has been rendered. Remember ajax is called from the frontend and obviously output has already started. heres an way of doing this (untested): function preference_language() { $language = $_POST['language']; if($language == 'th') { echo site_url('th'); } else { return; } exit; } js jQuery(document).ready(function($) { var language = localStorage.getItem('language'); var data = { action: 'preference_language', language: language }; $.post( ajax_object.ajax_url, data, function(response) { window.location = response; }); });
answers question: http://stackoverflow.com/q/28978756
type: Answer

http://stackoverflow.com/q/29015790
tagged with: angularjs
type: UnansweredQuestion
tagged with: seo
has comment: http://stackoverflow.com/comment/46276392
score: 0
type: Question
has body: I'd like to create a site with Angular (I'm new), but also want to be able to have different "views" be cachable in the search engines and have their own URL routes. How would I achieve this with Angular, or is best not to use it?
has answer: http://stackoverflow.com/a/29015971
tagged with: javascript
has title: Angular.js and SEO
has answer: http://stackoverflow.com/a/29015980
answer count: 2

http://stackoverflow.com/comment/46186212
type: AnswerComment
comment on: http://stackoverflow.com/a/28967134
type: Comment
has text: @Pointy: has() does not return the element, it returns a boolean indicating whether the element was/was not found
score: 0

http://stackoverflow.com/comment/46112345
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28926146
has text: Maybe this helps: [Closing/Opening Events for a Select Option](http://stackoverflow.com/questions/20321553/jquery-events-for-closing-and-opening-select-drop-down-and-not-on-change)
score: 0

http://stackoverflow.com/q/28975481
tagged with: loops
tagged with: coordinates
has body: I have an array with coordinates in and want to add them up to determine a total distance (not just from point A to point B). My array is structured as latitude1, longitude1, latitude2, longitude2 and so on. I have to code to actually work out the distance (shown below), but don't know how to do the loop needed to get the coordinates. function distance(lat1, lon1, lat2, lon2) { var R = 6371; var a = 0.5 - Math.cos((lat2 - lat1) * Math.PI / 180)/2 + Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) * (1 - Math.cos((lon2 - lon1) * Math.PI / 180))/2; return R * 2 * Math.asin(Math.sqrt(a)); } How should the loop be done? Thanks.
type: Question
has comment: http://stackoverflow.com/comment/46282327
tagged with: arrays
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28975602
tagged with: geolocation
accepted answer: http://stackoverflow.com/a/28975602
type: AnsweredQuestion
has title: Loop structure for adding up coordinates in an array

http://stackoverflow.com/comment/51191004
comment on: http://stackoverflow.com/q/29034855
has text: "Now send function should add MyHTML in picture."? Maybe you mean "add picture to my html"?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29021340
has answer: http://stackoverflow.com/a/29021421
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46286038
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/29021421
has comment: http://stackoverflow.com/comment/46286007
has title: Returned object undefined from module function
has body: This has to be a scope issue that I'm not familiar with. I have a small module I've written as so: (function () { var getPlanInfo = function (id, conn) { conn.query('SELECT * FROM `items` WHERE `id` = ?', [id], function (error, result) { if (error) console.error('Query error: ' + error.stack); console.log(result[0]); // Everything is great return result[0]; }); }; modules.exports.getPlanInfo = function (id, conn) { return getPlanInfo(id, conn); // Typo } })(); Here comes the problem. When I call it from anywhere (inside the module itself or another file), the return value is always undefined. I checked from within the function, the query returns the result as expected. var backend = require('./module.js'); var t = backend.getPlanInfo(); t is undefined. This is the same if I call that method from inside the module itself (another function within that module). I'm familiar with the callback principle in javascript and how objects and functions have to be passed around as an argument to remain in scope. Is this the issue here or is this a node.js particularity? I tried in in the Developer Console (Chrome), works as expected.
has answer: http://stackoverflow.com/a/29021413
tagged with: node.js
possible better answer: http://stackoverflow.com/a/29021413
type: AnsweredQuestion

http://stackoverflow.com/q/28921484
has body: I am working with the same code on two different sites however on the second site (its on a backend system - looking in to the different scripts) the data values {{}} are not displaying, if anyone has any suggestions as to why this might be happening I would greatly appreciate it. Working: jiggs.alexgibsondesign.com Not Working: reflectresources.com script: angular.module('app', [ 'ui.bootstrap', 'ngAnimate' ]).factory('sortable', [ '$filter', '$rootScope', function($filter, $rootScope) { return function(scope, data, itemsPerPage, initSortingOrder) { scope.sortingOrder = initSortingOrder; scope.reverse = false; scope.filteredItems = []; scope.groupedItems = []; scope.itemsPerPage = itemsPerPage; scope.pagedItems = []; scope.currentPage = 1; scope.items = data; scope.maxSize = 5; var searchMatch = function(haystack, needle) { if (!needle) { return true; } return haystack.toLowerCase().indexOf(needle.toLowerCase()) !== -1; }; scope.search = function() { scope.filteredItems = $filter('filter')(scope.items, $rootScope.query); if (scope.sortingOrder !== '') { scope.filteredItems = $filter('orderBy')(scope.filteredItems, scope.sortingOrder, scope.reverse); } scope.currentPage = 1; scope.groupToPages(); scope.totalItems = scope.filteredItems.length; }; scope.groupToPages = function() { scope.pagedItems = []; for (var i = 0; i < scope.filteredItems.length; i++) { if (i % scope.itemsPerPage === 0) { scope.pagedItems[Math.floor(i / scope.itemsPerPage)] = [scope.filteredItems[i]]; } else { scope.pagedItems[Math.floor(i / scope.itemsPerPage)].push(scope.filteredItems[i]); } } }; scope.range = function(start, end) { var ret = []; if (!end) { end = start; start = 0; } for (var i = start; i < end; i++) { ret.push(i); } return ret; }; scope.search(); scope.sort_by = function(newSortingOrder) { if (scope.sortingOrder == newSortingOrder) scope.reverse = !scope.reverse; scope.sortingOrder = newSortingOrder; scope.search(); }; scope.sort_by(initSortingOrder); scope.totalItems = scope.f…
type: Question
has comment: http://stackoverflow.com/comment/46100923
score: 1
has comment: http://stackoverflow.com/comment/46100876
upvote count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46100790
tagged with: http://stackoverflow.com/tag/html
has title: angularjs data values not displaying
answer count: 0
downvote count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/29048314
type: AnsweredQuestion
has title: Reloading Javascript on site after pressing an image (function)
downvote count: 0
score: 1
has body: I am making an mp3 player that selects random song from a list of variables. There is the code: Title: Album: Your outdated browser does not support HTML5. Get Mozilla Firefox >HERE< Is there an option, that after pressing a specifed image the code will refresh (it will again choose a song and show its specifics) without refreshing the whole page?
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29048330
accepted answer: http://stackoverflow.com/a/29048330
upvote count: 1
has comment: http://stackoverflow.com/comment/46334956
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/46260993
type: AnswerComment
comment on: http://stackoverflow.com/a/29006914
type: Comment
has text: well..this is strange :(
score: 0

http://stackoverflow.com/q/28944874
has body: I am writing a small parser to process some log files using node streams (io.js, actually, but I dont think that matters). I am following the example in the docs for unshift to parse out the header. I can successfully split the buffer and grab the header, but as soon as I call stream.unshift it seems to concatenate the header string and the remaining string. In setting up some example code for this question I found out that this behavior occurs when I am looking at a file based stream. Whenever I use a string based stream, the issue does not happen, even though file has the exact same text as the string. Here is what the file looks like in my text editor with whitespace chars turned on, (for comparison): I need some assistance understanding why this is happening. var StringDecoder = require('string_decoder').StringDecoder; // setup string based stream in fake_stream var Stream = require('stream'); var fake_file = 'FILE_TYPE:SOME-HEADER-DATE\r\n' + 'HEADER_END\r\n' + '1234|logged data|1|2|3|4|5|some other logged data\x1E\r\n' + '1235|logged data|1|2|3|4|5|some other logged data\x1E\r\n' + '1236|logged data|1|2|3|4|5|some other logged data\x1E\r\n' var fake_stream = new Stream.Readable(); fake_stream.push(new Buffer(fake_file, 'utf8')); fake_stream.push(null); // setup file based stream in file_stream // the file minimal_test_log.glf has the text shown above (with the control characters unescaped) var fs = require('fs'); var file = 'C:\\Some\\Path\\To\\minimal_test_log.glf'; var file_stream = fs.createReadStream(file); // WHY AM I GETTING DIFFERENT RESULTS HERE? parseHeader(file_stream, function(err, header, stream) { console.log('processing file_stream: ' + header.length); // RESULTS: processing file_stream: 184 // this results in the both parts concatenated without the HEADER_END/r/n }); parseHeader(fake_stream, function(err, header, stream) { console.log('processing fake_stream: ' + header.length); // RESULTS: processing fake_stream: 28 // these results are what i …
type: Question
has answer: http://stackoverflow.com/a/28946561
tagged with: arrays
answer count: 1
tagged with: javascript
score: 0
has title: Parsing header from file based stream yields unexpected results
tagged with: node.js-stream
type: UnansweredQuestion
tagged with: node.js

http://stackoverflow.com/comment/46244053
score: 1
comment on: http://stackoverflow.com/q/28997270
has text: I think it has to do with when different scripts get evaluated. Generally, you shouldn't put event handlers in the HTML like that. You're manipulating `theButton` in a separate script anyway. Might as well set the click handler there.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29028751
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29030064
possible better answer: http://stackoverflow.com/a/29028990
has comment: http://stackoverflow.com/comment/46299038
has answer: http://stackoverflow.com/a/29028990
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46299246
has title: Creating an effect wherever mouse goes
has answer: http://stackoverflow.com/a/29029040
has body: So I have been trying endlessly to try and do something similar too what this site is doing (http://whois.domaintools.com/). I'm trying to get a webpage, so wherever the mouse moves over the webpage, that kind of effect follows it (I'm sorry I don't know what I would call the effect). I've read how to ask questions on here, but I don't know what too look for so it's difficult for me to attempt this. So far this link (http://p5js.org/learn/demos/Hello_P5_Drawing.php) I've used the code from this and played around with it but i'm just puzzled as too how I would go about doing this. Thanks for any help, I've been banging my head against a brick wall for a good couple of days now.
accepted answer: http://stackoverflow.com/a/29030064
tagged with: css
linked to: http://stackoverflow.com/q/4847726
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/46299298

http://stackoverflow.com/a/28931925
answers question: http://stackoverflow.com/q/28929944
has comment: http://stackoverflow.com/comment/46126249
score: 0
type: Answer
has body: Here is a working example In your code, change your handleCardDrop() function like this: function handleCardDrop( event, ui ) { if( $(this).children('.drag').length &lt;2){ $(ui.draggable).css({"top": "1px" ,"left": 0 }).appendTo(this); var apptValue = dataAppt.attr("data-appt"); apptValue -= 1; dataAppt.attr("data-appt", apptValue); if( ($(this).attr("data-appt")) == 1){ $(this).attr("data-appt","2"); } else{ $(this).attr("data-appt","1"); } ui.draggable.draggable( 'option', 'revert', false ); // move this outside the if/else so it gets applied in all cases resetAppointment(); } else{ alert('Only Two allowed!!!'); } } Also, change your resetAppointment() function like this: function resetAppointment(){ $('td[data-appt="2"] .drag').css("width", "45%"); // 45% not 50% since your full witdh elements are only 90% not 100% var width = $('td[data-appt="2"] .drag').first().width(); $('td[data-appt="2"] .drag').last().css({"left": width}); // wrap your selector string with single quotes and use double quotes inside where needed so you dont have to escape the quotes $('td[data-appt="1"] div.drag').css({"width": "90%", "left" : "0px"}); // i use px explicitly here because if I dont, I'll always forget to add it later when I change this to 10 or something }
accepted answer of: http://stackoverflow.com/q/28929944
has comment: http://stackoverflow.com/comment/46126783
type: AcceptedAnswer

http://stackoverflow.com/comment/46159677
has text: @Elad That looks right. If `http/https` and `www` is not specified by user, then just target all (I am only targeting `http/https` protocols, and `www` sometimes not necessary e.g. `https://stackoverflow.com` has no `www`)
type: Comment
comment on: http://stackoverflow.com/a/28933033
score: 0
type: AnswerComment

http://stackoverflow.com/a/29038970
upvote count: 2
type: Answer
has body: last_payment_date is of type Array. You need to index it first: Date.parse(last_payment_date[0])
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29038781

http://stackoverflow.com/a/28987308
has comment: http://stackoverflow.com/comment/46223434
has comment: http://stackoverflow.com/comment/46224019
has comment: http://stackoverflow.com/comment/46224149
upvote count: 4
downvote count: 0
score: 4
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28987087
answers question: http://stackoverflow.com/q/28987087
has body: You can't do an ajax file upload with $.post, you have to use $.ajax (or raw XMLHttpRequest) and a FormData object. Using a formdata object as the data parameter in $.ajax requires you to set contentType and processData to false var $form = $('form'); $form.submit(function(){ $.ajax({ url: $(this).attr('action'), type: $(this).attr('method'), data: new FormData(this), contentType: false, processData: false, success: function(response){ // do something here on success }, dataType: 'json' }); return false; });
type: Answer
has comment: http://stackoverflow.com/comment/46223023

http://stackoverflow.com/a/29040926
has comment: http://stackoverflow.com/comment/46322494
upvote count: 3
has comment: http://stackoverflow.com/comment/46324507
has comment: http://stackoverflow.com/comment/46322297
has comment: http://stackoverflow.com/comment/46322234
downvote count: 0
answers question: http://stackoverflow.com/q/29040651
score: 3
type: Answer
has body: Instead of messing with prop("disabled"), do $dbVendor.selectmenu("enable"); http://jsfiddle.net/r3977gy7/30/ Documentation http://api.jquerymobile.com/selectmenu/#method-enable

http://stackoverflow.com/comment/46352385
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29057717
type: Comment
has text: @Urahara Hi they are very big files,should i still include them.What is unclear with the code that I have written? I can provide more information if you need any

http://stackoverflow.com/comment/46228512
comment on: http://stackoverflow.com/a/28989355
type: AnswerComment
score: 0
type: Comment
has text: updated answer & please make sure you update the `FOOTER_SELECTOR`. Should you want more help, you have to provide more info / `code`

position
tags question: http://stackoverflow.com/q/28942224
tags question: http://stackoverflow.com/q/28915053
type: Tag
tags question: http://stackoverflow.com/q/28909128
tag name: position

http://stackoverflow.com/q/29040497
has answer: http://stackoverflow.com/a/29040578
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I'm programming an image slideshow and for some reason it isn't working. Below I have the HTML: &lt;div id = "images"&gt; &lt;img id = "imageSrc" /&gt; &lt;/div&gt; Here is my JavaScript which is what I'm using to change my images: var images = document.getElementById("imageSrc"); var x = 0; var imagesArray = ["image.png", "anotherImage.png", "yetAnotherImage.png"]; function changeImages() { images.src = imagesArray[x]; if (x &lt; 2) { x++; } else { x = 0; } alert(images.src); } setInterval(changeImages(), 3000); Demo Why am I not getting an alert every 3 seconds with my image code? The images aren't switching so where is my mistake? Thanks in advance for your help!
score: 1
has title: Why is my image slideshow not working?
answer count: 2
has answer: http://stackoverflow.com/a/29040575
upvote count: 1
has comment: http://stackoverflow.com/comment/46321373
tagged with: image
accepted answer: http://stackoverflow.com/a/29040575
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/xhtml
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29040578
favorite count: 0

http://stackoverflow.com/q/28945571
has title: ReactJS error when using animations
accepted answer: http://stackoverflow.com/a/28946117
tagged with: reactjs
downvote count: 0
answer count: 1
favorite count: 0
tagged with: animation
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28946117
has body: I have a working ReactJS app and I am attempting to use animations (https://facebook.github.io/react/docs/animation.html) I am trying to apply the transition animation to table rows as they are added. The existing working render looks like this: return React.DOM.tbody({ valign: 'top' }, rows); I have tried switching to this: return React.DOM.tbody({ valign: 'top' }, React.createElement(ReactCSSTransitionGroup, {transitionName: "example"}, rows)); But I am now getting a warning and an error in the console: React attempted to use reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server. Error: Invariant Violation: ReactMount: Root element ID differed from reactRootID. Any ideas?
score: 1
upvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/a/29021778
answers question: http://stackoverflow.com/q/29021472
score: 3
upvote count: 3
type: AcceptedAnswer
has body: In your Plunkr, you had a few errors, such as the &lt;script&gt; tags around the wrong way (you need to have Angular first, so your code can then use angular.module). You also had the wrong attribute of ng-app-data instead of data-ng-app. The key problem was with the JS code, the first parameter to the success handler for the $http.get() call is an object with a data property, which is the actual data returned. So you should resolve your promise with that property instead. Then in the controller, like Michael P. said, getData is undefined, you should use the data parameter passed in. app.service("tickrService", function($http, $q) { var deferred = $q.defer(); $http.get('jobs.json').then(function(response) { deferred.resolve(response.data); }); this.getjobs = function() { return deferred.promise; } }) .controller('tickCtrl', function($scope, tickrService) { var promise = tickrService.getjobs(); promise.then(function(data) { $scope.jobs = data; console.log($scope.jobs); }); }); See forked Plunkr.
has comment: http://stackoverflow.com/comment/46286805
type: Answer
accepted answer of: http://stackoverflow.com/q/29021472
downvote count: 0

http://stackoverflow.com/comment/46309575
type: Comment
type: QuestionComment
has text: Have you measured it and found it to be slow? The bottleneck in your code would surely be the request itself, which you cannot do much about.
score: 1
comment on: http://stackoverflow.com/q/28977449

http://stackoverflow.com/comment/46147621
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28946481
type: Comment
has text: 1) if the sql select is inside the sendRequest function then yes, it will be delayed. 2) Any kind of CSS transition is a good solution. @Xufox: Thanks, forgot to add it!

http://stackoverflow.com/q/29056415
tagged with: if-statement
score: -2
has title: if statement does not work on javascript
tagged with: javascript
answer count: 2
downvote count: 2
favorite count: 0
has answer: http://stackoverflow.com/a/29056537
upvote count: 0
has comment: http://stackoverflow.com/comment/46350364
type: UnansweredQuestion
has body: here is my trouble: $scope.Right = function () { if ($scope.SerialNumber &lt; 5) { $scope.SerialNumber = $scope.SerialNumber + 1 } else { $scope.SerialNumber = $scope.SerialNumber }; alert($scope.SerialNumber &lt;5); (I've been trying to use angularjs). so on alert it shows me 'false', but in real it does $scope.SerialNumber + 1 so basic if statement does not work (it works only if I use '===' statent, but I need here a '&lt;'
has comment: http://stackoverflow.com/comment/46349963
type: Question
has answer: http://stackoverflow.com/a/29056467

http://stackoverflow.com/comment/46371908
score: 0
type: AnswerComment
has text: Documented [here](http://emberjs.com/guides/components/sending-actions-from-components-to-your-application/). You would do something like `my-component logoutAction='invalidateSession'` and inside it `sendAction('logoutAction', <optional params>)`. I think if you just define `action='something'` then `this.sendAction()` will default to that. If you have multiple levels of components currently you need to pass it up through each one.
comment on: http://stackoverflow.com/a/29063248
type: Comment

http://stackoverflow.com/comment/46089701
type: Comment
comment on: http://stackoverflow.com/a/28915534
has text: @charlietfl yes that was my bad, its related to `C#` side
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46204824
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28976604
has text: Thanks a lot I figure it out)))))

http://stackoverflow.com/comment/46244010
type: Comment
has text: I guess the question is what you are trying to achieve. You can call this concept a type if it helps you for your understanding or for explaining it to others, regardless of what the interpreter does. If you want to know what textbooks say - why not consulting one? ;)
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28997643

http://stackoverflow.com/q/28928073
tagged with: slider
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: i want to make pictures load when viewed?
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46112376
has answer: http://stackoverflow.com/a/28928286
tagged with: javascript
score: -1
has body: Hello I Have A File That Contains A Lot Of Images I Want To Insert Them All In A Slider But I Don't Want To Make The Website Load Slow, How Can I Make Them Load When Viewed On The Slider
upvote count: 0
answer count: 1
tagged with: load
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/46309005
has text: Putting a word boundary inside a lookaround is useless since it is a zero-width assertion. if you want to negate it, use `\B`
comment on: http://stackoverflow.com/q/29034062
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28929159
tagged with: jquery
has body: I'm making a Food Drop game so black squares are falling down from the top of the screen and the player uses a platter to collect them. I'm doing this with an array so every time a new square is created program puts it on a certain position in array food[].(all of this happen in move() function). The problem is that after some time there are too many squares in array and it's too much to handle for the computer. I probably need to clear both intervals after some time, but I'm not really sure when. Any solution for this problem? The code also clears both intervals when the game reloads and it throws away old squares from food[] array. There is a live example below. var main = function () { //Global variables var food = []; //Interval var interval; var interval2; //Radius size var size; var Xpos; var speed = 15; //Color var color; var score = 0; $('.btn').hover(function() { $('.btn').addClass('btn-hover'); }, function() { $('.btn').removeClass('btn-hover'); }); $('.btn2').hover(function() { $('.btn2').addClass('btn-hover'); }, function() { $('.btn2').removeClass('btn-hover'); }); $('.score').text("SCORE: " + score); var lives_left = 3; //Function that checks if two elements collide function collision($div1, $div2) { var x1 = $div1.offset().left; var y1 = $div1.offset().top; var h1 = $div1.outerHeight(true); var w1 = $div1.outerWidth(true); var b1 = y1 + h1; var r1 = x1 + w1; var x2 = $div2.offset().left; var y2 = $div2.offset().top; var h2 = $div2.outerHeight(true); var w2 = $div2.outerWidth(true); var b2 = y2 + h2; var r2 = x2 + w2; if (b1 < y2 || y1 > b2 || r1 < x2 || x1 > r2) return false; return true; } //Create a random circle var circleCreate = function () { if (interval) clearInterval(interval); food.push($(' ')); var num = food.length - 1; size = 6; //1. Create a circle and append it to .container //2. Give it a random position //3. Color it //4. Give it a moving path food[num].appendTo('.food').addClass('circle').css('height', size + '%').css('width', size / …
tagged with: clearinterval
tagged with: intervals
downvote count: 0
has comment: http://stackoverflow.com/comment/46114364
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/46114432
upvote count: 1
has title: When to clear interval in jQuery?
type: Question
tagged with: arrays
has comment: http://stackoverflow.com/comment/46114379
tagged with: javascript

http://stackoverflow.com/q/28978756
has answer: http://stackoverflow.com/a/29000707
score: 1
linked to: http://stackoverflow.com/q/19370223
favorite count: 0
type: Question
has title: Wordpress AJAX in plugin response 0
upvote count: 1
tagged with: php
has answer: http://stackoverflow.com/a/29014224
answer count: 3
tagged with: wordpress
has body: I create plugin for Wordpress and use AJAX in plugin but AJAX response 0. I try to solve this problem by following this answer but can't solve my problem. This is my handler function if( is_admin()) { add_action( 'admin_menu', 'language_redirect_add_config_page' ); } else { add_action( 'plugins_loaded', 'preference_language' ); add_action( 'wp_enqueue_scripts', 'enqueue' ); add_action( 'wp_ajax_preference_language', 'preference_language' ); add_action( 'wp_ajax_nopriv_preference_language', 'preference_language' ); } function language_redirect_config_page() { add_options_page( __( 'Language Redirect Setting' ), __( 'Language Redirect' ), 'manage_options', basename( __FILE__ ), '' ); } function enqueue() { wp_enqueue_script( 'ajax-script', plugins_url( '/js/plugin-script.js', __FILE__ ), array('jquery') ); wp_localize_script( 'ajax-script', 'ajax_object', array( 'ajax_url' =&gt; admin_url( 'admin-ajax.php' ) ) ); } // Handler function... function preference_language() { $language = $_POST['language']; if($language == 'th') { header( 'Location: ' . site_url('th') ); } else { return; } die; } And this my AJAX script jQuery(document).ready(function($) { var language = localStorage.getItem('language'); var data = { action: 'preference_language', language: language }; $.post( ajax_object.ajax_url, data, function(response) { console.log(response); }); });
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/28981622

http://stackoverflow.com/comment/46123640
has text: yes, that is i get the same result everytime. the value is correct after changing the type from 'hidden' to 'text' to make sure. but i get the same result for all values with div class 'rate'
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28933728

http://stackoverflow.com/q/28948648
has comment: http://stackoverflow.com/comment/46154459
has comment: http://stackoverflow.com/comment/46163028
has comment: http://stackoverflow.com/comment/46174318
tagged with: handsontable
has answer: http://stackoverflow.com/a/29052422
type: Question
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has body: I have some pretty simply jQuery that runs inside a dialog jquery ui popup box $.ajax({ url: 'json.php?supplier_id=' + supplier_id, dataType: 'json', type: 'GET', success: function(res){ $("#hot").handsontable({ data: res.data, minSpareRows: 1, startCols: 1, minRows: 1, minCols: 3, columns: [ {data: 1}, {data: 2}, {data: 3} ], colWidths: [160, 495, 60], rowHeaders: false, colHeaders: false, contextMenu: false }); } }); the above code runs in the "complete" callback of the jquery ui dialog and visually works fine, however I cannot change anything! When I try to edit the cells I can only "delete" the information in the grid fields, one character at a time, I cannot edit it positively only negatively, it's almost as if my entire keyboard is key press disabled. Has anyone ever seen this bug before and know a way around it?
has comment: http://stackoverflow.com/comment/46185251
score: 0
has comment: http://stackoverflow.com/comment/46160673
answer count: 1
has comment: http://stackoverflow.com/comment/46180467
has comment: http://stackoverflow.com/comment/46178044
has comment: http://stackoverflow.com/comment/70577991
type: UnansweredQuestion
has title: handsontable bug: when launched inside jquery ui dialog boxes are unedittable

http://stackoverflow.com/q/29000003
has comment: http://stackoverflow.com/comment/46248101
tagged with: properties
has comment: http://stackoverflow.com/comment/46247878
has title: JavaScript - Object property inconsistency
score: 0
has comment: http://stackoverflow.com/comment/46248161
upvote count: 1
downvote count: 1
type: Question
tagged with: object
linked to: http://stackoverflow.com/q/4057440
tagged with: javascript
answer count: 1
favorite count: 0
has body: i am having a problem that i am finding difficult to find information about as i am unaware of the underlying issue. I am trying to set a property inside an object, and when i console.log the property it gives the anticipated result but when i console.log the entire object, the property inside is different. defaults:{ uid:undefined, createSphere:function(uid,coordinates) { this.uid = uid; console.log(this.uid); console.log(uid); console.log(this); console.log(this.uid); I run the createSphere function in a simple for loop. Here you can see how i assign the uid for the function. for(i = 0;i&lt;n;i++) { coordinates = {x:0,y:5,z:0} coordinates.x = 0+ (40*Math.sin(Math.PI*(i/2))) coordinates.z = 0+ (40*Math.cos(Math.PI*(i/2))) spheres.defaults.createSphere((i+1),coordinates); } Here you can see the resulting log when creating the first sphere with the code from the first block. The console.logs are executed directly after eachother, so nothing is able to change the value between the logging. I wanted to upload it in an image for better clarity but i unfortunately cannot. 1 1 Object action: function (order,impulseVector){ createSphere: function (uid,coordinates) uid: 2 __proto__: Object 1 So the problem is; when taking the value directly from the property it differs from when using the entire object.
has comment: http://stackoverflow.com/comment/46249100
has answer: http://stackoverflow.com/a/29001198
type: UnansweredQuestion

http://stackoverflow.com/a/28918162
has body: Please see the below link http://jqueryvalidation.org/documentation/ http://jqueryvalidation.org/files/demo/ This is a validation plugin and easy to use.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28918093
has comment: http://stackoverflow.com/comment/46093939

3d
tags question: http://stackoverflow.com/q/28941758
type: Tag
tags question: http://stackoverflow.com/q/28942837
tags question: http://stackoverflow.com/q/28912303
tag name: 3d

http://stackoverflow.com/comment/46224916
score: 0
has text: How do I make the text-transform in css when the link is clicked. I have NO knowledge of JavaScript.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28988114

http://stackoverflow.com/comment/46269518
type: Comment
comment on: http://stackoverflow.com/a/29011670
score: 0
type: AnswerComment
has text: The most important message I am trying to tell you: 1) we talk about the `resolve: {}`, almost the resolve phase of the **state** 2) you want to read the current state in this phase ... while we are not there yet! So - We do resolve stuff to get to state... and make it current. This is my message.. Hope it helps a bit

http://stackoverflow.com/q/28957783
has comment: http://stackoverflow.com/comment/46168484
answer count: 3
tagged with: wordpress
linked to: http://stackoverflow.com/q/737022
has title: how to disable right click on wordpress website
upvote count: 1
has answer: http://stackoverflow.com/a/28959254
downvote count: 5
tagged with: javascript
type: UnansweredQuestion
score: -4
has comment: http://stackoverflow.com/comment/46168386
favorite count: 0
has answer: http://stackoverflow.com/a/30119918
has answer: http://stackoverflow.com/a/28957895
type: Question
has body: I am working on a Whatsupjokes.com which is a jokes sharing website. I want to disable right button, so they will not copy my content. How can I achieve this using JavaScript?
tagged with: http://stackoverflow.com/tag/html
tagged with: plugins

http://stackoverflow.com/q/29059589
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29059661
tagged with: touchstart
type: Question
score: 1
has title: Why is the touchstart event not firing in Firefox?
upvote count: 1
has body: I am trying to use the touchstart event to detect touches in a web application. It's working fine in Chrome, but in Firefox 36.0.1 (Desktop version) on Windows 8.1, the event is not fired at all. Am I doing something wrong or is this a bug? A minimal working example can be found here.
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46355705

http://stackoverflow.com/comment/46269473
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29005691
has text: @majidarif I tried to use Google's Batch request, but still doesn't work :(

http://stackoverflow.com/comment/116346022
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/65803810
has text: The person is using a windows computer not a Linux computer so please make references to the appropriate windows commands as well, thanx

http://stackoverflow.com/comment/46390205
type: Comment
type: QuestionComment
score: 0
has text: Stupid question, but I have to ask: Did you try "resources/images/some_image.png" or "/resources/images/some_image.png" or "../resources/images/some_image.png" or using the .pbi extension as well? I don't know anything about pebble, but just wanted to make your paths conclusion airtight.
comment on: http://stackoverflow.com/q/28971979

http://stackoverflow.com/comment/46123530
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28933721
has text: xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = handleServerResponseForDesignations(ele, xmlhttp); xmlhttp.open("GET", url, true); xmlhttp.send(); // Don't forget to open and send as above.
score: 0

http://stackoverflow.com/q/28947186
has comment: http://stackoverflow.com/comment/46148396
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: what's the meaning of the master process creates the listen socket and sends it to interested workers in node?
tagged with: sockets
tagged with: node.js
type: UnansweredQuestion
upvote count: 1
score: 1
has answer: http://stackoverflow.com/a/28947482
has comment: http://stackoverflow.com/comment/46184205
has body: nodejs cluster api says :The second approach is where the master process creates the listen socket and sends it to interested workers. The workers then accept incoming connections directly. I ' M fused about what is the listen socket and how it can send to workers.moreever. what the relationship between the listen socket and the incomming connections.
type: Question

http://stackoverflow.com/a/28988250
answers question: http://stackoverflow.com/q/28988149
score: -1
has body: Try this: [0-9]+((px{1}|%{1})) i usually test my regexp in the following site: https://www.debuggex.com/
upvote count: 0
has comment: http://stackoverflow.com/comment/46225096
type: Answer
has comment: http://stackoverflow.com/comment/46225383
downvote count: 1

http://stackoverflow.com/comment/46241665
type: AnswerComment
has text: @Andrus: I tested the case `iconsOverText: true`. One need to set `font-weight: normal;` additionally. See [the demo](http://www.ok-soft-gmbh.com/jqGrid/OK/tougleButton1_iconOver.htm). It has no problems in my tests for zoom 100% or 200%.
comment on: http://stackoverflow.com/a/28976051
type: Comment
score: 1

http://stackoverflow.com/q/29053643
tagged with: bookmarklet
answer count: 1
tagged with: javascript
has body: Goal: Create a bookmarklet to quickly apply settings via dropdown menus on a particular website, batchgeo.com. Issue: Certain functions are triggered by the dropdown menus and I cannot figure out how to activate them via my bookmarklet. Current bookmarklet: javascript:(function(){ document.getElementById('validate_button').click(); document.getElementById('group_sel').value = 'City'; document.getElementById('advanced_button').click(); document.getElementById('labeltype_sel').value = 'none'; document.getElementById('geocode_button').click(); })(); Website Source: $("#group_sel").bind("change",function({ per.group_col=rS(this); updatePreview(0); updateStylingOptions(); updateColorOptions() }); Specific hangup: The 'group_sel' menu has a ".bind" function that seems to be activated when on "change". While I can change the value of the menu, I cannot figure how how to impersonate this "change" to call the additional necessary functions. Any assistance would be appreciated, Thanks, Mitch
has title: Activate ".bind" functions with bookmarklet
score: 0
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29090226

http://stackoverflow.com/comment/46261257
type: Comment
type: QuestionComment
has text: Nope wont do the trick this is from 2010. Thats like to tackle a Football pro with a ice bear. Today I have a 12" notebook with a 12" ipad. Wont do the trick. I need a good solution.
comment on: http://stackoverflow.com/q/29007883
score: 0

http://stackoverflow.com/comment/46313277
type: Comment
has text: I tried `.trigger` but it doesnt help. When I manually go change the months field, it does obviously get the on change event and gives me the dropdown for Days
comment on: http://stackoverflow.com/a/29036225
type: AnswerComment
score: 0

google-chrome-extension
tags question: http://stackoverflow.com/q/28910985
tags question: http://stackoverflow.com/q/28952599
tags question: http://stackoverflow.com/q/29043454
tags question: http://stackoverflow.com/q/28953282
tags question: http://stackoverflow.com/q/29061293
tags question: http://stackoverflow.com/q/28915790
tags question: http://stackoverflow.com/q/28945220
tag name: google-chrome-extension
tags question: http://stackoverflow.com/q/28985562
tags question: http://stackoverflow.com/q/28934761
tags question: http://stackoverflow.com/q/29056704
tags question: http://stackoverflow.com/q/28939739
tags question: http://stackoverflow.com/q/28980582
tags question: http://stackoverflow.com/q/28979237
tags question: http://stackoverflow.com/q/28954124
tags question: http://stackoverflow.com/q/29050303
tags question: http://stackoverflow.com/q/28995079
tags question: http://stackoverflow.com/q/29055555
tags question: http://stackoverflow.com/q/28990123
tags question: http://stackoverflow.com/q/29049384
tags question: http://stackoverflow.com/q/28930209
tags question: http://stackoverflow.com/q/29057519
tags question: http://stackoverflow.com/q/28924635
type: Tag
tags question: http://stackoverflow.com/q/28954811
tags question: http://stackoverflow.com/q/28971862
tags question: http://stackoverflow.com/q/28950071
tags question: http://stackoverflow.com/q/28917824
tags question: http://stackoverflow.com/q/29017213
tags question: http://stackoverflow.com/q/29056607
tags question: http://stackoverflow.com/q/28913964
tags question: http://stackoverflow.com/q/28960773
tags question: http://stackoverflow.com/q/28955781
tags question: http://stackoverflow.com/q/29048465
tags question: http://stackoverflow.com/q/28907152
tags question: http://stackoverflow.com/q/29022338
tags question: http://stackoverflow.com/q/29053229
tags question: http://stackoverflow.com/q/28932232
tags question: http://stackoverflow.com/q/28969814
tags question: http://stackoverflow.com/q/28948929
tags question: http://stackoverflow.com/q/29022079
tags question: http://stackoverflow.com/q/28977611
tags question: http://stackoverflow.com/q/29039036
tags question: http://stackoverflow.com/q/28912875
tags question: http://stackoverflow.com/q/28964764
tags question: http://stackoverflow.com/q/28906943
tags question: http://stackoverflow.com/q/29021564

http://stackoverflow.com/comment/46121054
comment on: http://stackoverflow.com/q/28932653
has text: Are you using jQuery? If so classes have a dot `$(".addBtn")` and you can just use `.hide()` and `.show()`. For example: `$(".addBtn").show()` other than `$(".addBtn").style.visibility = "visible"`.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28967656
has title: How to run a jquery script on radio button check
type: Question
score: 0
tagged with: radio-button
has comment: http://stackoverflow.com/comment/46187658
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28968887
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46187248
has body: I'm am trying to run 2 comparison scripts when the radio button of each flight is clicked. The //Compare airports part will compare whether the passenger will return to the same airport he departed from when clicking the equivalent booking radio button and show an alert in case he will be returning to a different airport. And in the same way the //Compare Dates part will check whether his flight will arrive the next day and if yes show an alert stating just that. I made a bare bones mockup of my code in codepen so you can have a clearer view of what i'm trying to do. Thanks for taking the time to help! http://codepen.io/JohnD/pen/myGZKP //Compare airports var a1 = $(".flight-1_1 &gt; .departing-IATA").text(); var a2 = $(".flight-2_1 &gt; .departing-IATA").text(); if (a1 != a2) { $('.da-alert').toggle(); }; //Compare dates var day1 = $(".flight-1_1 &gt; .date").text(); var day2 = $(".flight-2_1 &gt; .date").text(); if (day1 != day2) { $(".dd-alert").toggle(); }

http://stackoverflow.com/comment/46330730
comment on: http://stackoverflow.com/a/29045504
has text: Please level me up if the other answer was helpful, and good luck with your development! :)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46211640
type: Comment
has text: Can you amend your fiddle to use an xTemplate as you do in your application?
type: QuestionComment
comment on: http://stackoverflow.com/q/28979652
score: 0

http://stackoverflow.com/a/28955863
has comment: http://stackoverflow.com/comment/46165535
has comment: http://stackoverflow.com/comment/46165066
has comment: http://stackoverflow.com/comment/46165031
answers question: http://stackoverflow.com/q/28955797
downvote count: 0
has body: Based on the Coffeescript file, I think your best bet would be to fork the library and then remove the cards you don't want to support from the cardTypes array so that all other numbers would show up as undefined. https://github.com/jessepollak/card/blob/master/src/coffee/card.coffee Or the following line in card.js: https://github.com/jessepollak/card/blob/master/lib/js/card.js#L1134 Card.prototype.cardTypes = ['jp-card-amex', 'jp-card-dankort', 'jp-card-dinersclub', 'jp-card-discover', 'jp-card-jcb', 'jp-card-laser', 'jp-card-maestro', 'jp-card-mastercard', 'jp-card-unionpay', 'jp-card-visa', 'jp-card-visaelectron']; You'll also probably want to modify the cardTemplate variable to remove the DOM nodes that no longer apply: https://github.com/jessepollak/card/blob/master/src/coffee/card.coffee#L36
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/a/29045373
has comment: http://stackoverflow.com/comment/46330035
score: 0
type: Answer
has body: You can use a constant to achieve the same as Lucas suggested it. However, instead of creating a constant service for every value you can group then together like this : angular.module("myModule") .constant("CONST", { "KEY1" : "VALUE1", "KEY2" : "VALUE2"}); This way you can gather a bunch of constants together and use it like: CONST.KEY1 CONST.KEY2 EDIT: Your problem seems to be very different. First of all you should use the AngularJS flavour of Firebase. Its called AngularFire. You can find out more about it here. I will answer the question of rendering the UI based on Model changes. AngularJS promotes the MVC pattern. You need objects of Service, Controller and View (HTML page) to achieve the functionality you want. In the example I am providing below, everything is clubbed into one file (index.html) but ideally, the code should be separated. {{post}} To learn the basics of AngularJS you can go through codeschool tutorials. They are interactive and start from the basics.
accepted answer of: http://stackoverflow.com/q/29045231
answers question: http://stackoverflow.com/q/29045231
type: AcceptedAnswer

http://stackoverflow.com/comment/46103886
type: QuestionComment
score: 0
has text: Have you tried `this.textContent`? Please show the click handling function.
comment on: http://stackoverflow.com/q/28923573
type: Comment

http://stackoverflow.com/comment/46141949
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28943742
has text: Thanks. Please can you confirm the following: are monads essentially objects used as return values that implement specific interfaces that enable the definition of a sequence of function invocations?

http://stackoverflow.com/comment/46166462
comment on: http://stackoverflow.com/q/28955862
has text: Template is not evaluated as DOM element. I think you didn't bind your template using knockout before querying the DOM.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46155572
type: AnswerComment
type: Comment
has text: The Javascript Direction service doesn't have 2,500 quota limit. According to the developer console the quota has 1,000,000 limit
comment on: http://stackoverflow.com/a/28950623
score: 0

http://stackoverflow.com/comment/46212141
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28980624
type: QuestionComment
has text: Are you getting any kind of network errors in the console like maybe the path to `schoolFormItem.php` is not correct?

deserialization
type: Tag
tag name: deserialization
tags question: http://stackoverflow.com/q/28949629

http://stackoverflow.com/q/28922057
has comment: http://stackoverflow.com/comment/46101232
has title: Uncaught RangeError: Invalid string length when appending to a string in JavaScript
score: 16
type: Question
has comment: http://stackoverflow.com/comment/46101237
has comment: http://stackoverflow.com/comment/46101222
upvote count: 16
tagged with: javascript
has answer: http://stackoverflow.com/a/37193319
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28922103
accepted answer: http://stackoverflow.com/a/28922103
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/37193319
has body: So basically I've been working on a small personal project of mine in Javascript, and I've hit a snag. I'm trying to generate a list in HTML from a 2D array using Javascript. Here is my code: function generatePageFromArray(page, array){ var entry, i, j; for (i = 0; i < array.length; ++i) { entry = array[i]; for (j = 0; j < entry.length; j = j + 2) { page = page + ' '+ ' '; page = page + ' ' + entry[j,0] + ' '; page = page + ' '; if (entry[j,1].indexOf("|") > 0){ var spanishTerms = entry[j,1].split("|"); var strLength = spanishTerms.size; for (i = 0; i < strLength; i++){ page = page.concat(spanishTerms[i] + ' '); } } else{ page = page + entry[j,1]; } page = page + ' ' page = page + ' '; } } return page;} It keeps throwing a Uncaught RangeError: Invalid string length on this line: page = page + ' '+ ' '; I have no idea why. I've also tried using .concat() to append, but nothing.

http://stackoverflow.com/comment/46170134
comment on: http://stackoverflow.com/a/28944302
score: 1
has text: Try theses [falsey](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) and [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). they'll make the whole thing a bit clearer Re: the logic in if (value1) etc
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28955490
has title: A JSONObject text must begin with '{' at 1 [character 2 line 1]
has body: I am trying to show emails from gmail using javaapi. When user clicks on the message row,the mail will open with its message body.For this I have written a javascript function: function viewMail() { $('#table tbody').unbind().on( 'click', 'tr td:not(.email-select)', function() { var messageNumber = $(this).parent().children('td:eq(0)') .children().val(); var from = $(this).parent().children('td:eq(1)').text(); var subject = $(this).parent().children('td:eq(2)').text(); var dateAndTime = $(this).parent().children('td:eq(3)').text(); var seen = $(this).parent().children('td:eq(4)').text(); var folderName = $(this).parent().children('td:eq(5)').text(); /* * $.post("/Webclient/getMail", {messageId:messageId}, * function(data){ */ var data = {"messageNumber":messageNumber, "seen":seen, "folderName":folderName }; $.ajax({ type : "GET", url : "/Webclient/showMail", contentType : "application/json; charset=utf-8", data : JSON.stringify(data), success : function(result) { $('#email_subject').text(subject); $('#sender_name').text(from); $('#date_and_time').text(dateAndTime); $('#messageBody').empty(); $('#messageBody').append(result.content); $('#emailModal').modal('show'); } }); }); } And this in my method in controller: @RequestMapping(value = "/showMail", method = RequestMethod.GET) public @ResponseBody String showMail(HttpServletRequest request) throws IOException{ JSONObject result = new JSONObject(); StringBuilder buffer = new StringBuilder(); BufferedReader reader = request.getReader(); String line; while ((line = reader.readLine()) != null) { buffer.append(line); } String emailInfo = buffer.toString(); //This is the line I am getting error JSONObject jsonObject = new JSONObject(emailInfo); System.out.println(emailInfo); User authUser = (User) SecurityContextHolder.getContext() .getAuthentication().getPrincipal(); String userName = authUser.getUsername(); String password = SecurityContextHolder.getContext() .getAuthentication().getCredentials().toString(); String messa…
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28956168
has answer: http://stackoverflow.com/a/28961423
score: 3
downvote count: 0
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: jakarta-ee
tagged with: javascript
tagged with: jquery
upvote count: 3
answer count: 3
has answer: http://stackoverflow.com/a/59452485
favorite count: 0

http://stackoverflow.com/comment/46250244
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29000772
score: 0
has text: @jfriend00 My point is, doesn't non-blocking IO in C/C++ use `fork`/`join`? If so, wouldn't the C/C++ function handle the asynchronicity internally and appear to be synchronous to the JavaScript code?

http://stackoverflow.com/q/28978168
answer count: 2
downvote count: 0
score: 1
tagged with: jquery
tagged with: meteor
favorite count: 0
possible better answer: http://stackoverflow.com/a/28990085
has title: Byte counting in javascript
has answer: http://stackoverflow.com/a/28990085
has body: I am making a word count, more specifically btye count for my text editor. However, I'm making it so that it counts Korean as well (as 2 bytes). But I need to make it so that it does not count characters such as ` # = { } ( ) etc... I've gotten this far, but I do not know how to get further from here. Right now it does everything but what I want it to do. Thank you! var limit_length = 1000; var msg_length = 0; //String bytes() Function String.prototype.bytes = function() { var msg = this; var cnt = 0; //Korean 2, English 1 count increment for( var i=0; i&lt; msg.length; i++) cnt += (msg.charCodeAt(i) &gt; 128 ) ? 2 : 1; return cnt; } //#submit-content Key up activation $("#submit-content").keyup(function( e ){ msg_length = $.trim($(this).val()).bytes(); //to trim whitespaces if( msg_length &lt;= limit_length ) { $("#type_num").css("color", "#474646"); $("#type_num").html( msg_length ); } else { $("#type_num").css("color", "#E55451"); $("#type_num").html( msg_length ); } });
has answer: http://stackoverflow.com/a/28979296
type: AnsweredQuestion
upvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28979296

http://stackoverflow.com/comment/46091876
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28917038
has text: @Pointy it didn't work because i checked the results after the loop.
type: Comment

http://stackoverflow.com/comment/46224075
comment on: http://stackoverflow.com/q/28987741
score: 0
type: Comment
type: QuestionComment
has text: Try disabling scripts one by one until it no longer scrolls.

http://stackoverflow.com/comment/46352777
comment on: http://stackoverflow.com/a/29027039
type: AnswerComment
type: Comment
has text: but i can't do this when the body is large (a groceries list), since the URL size is limited
score: 1

http://stackoverflow.com/comment/46277262
has text: `$(this).val()` is a massive overhead of `this.value`.
comment on: http://stackoverflow.com/q/29016422
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46269904
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29011670
type: Comment
has text: Your messages are very helpful. But last question I posted is about `$stateParams`, with string, I always get an empty object, but with function, I can get the params obejct, is there something I miss?

http://stackoverflow.com/comment/88767417
type: AnswerComment
has text: can you believe this.... this was just what I was looking for. JS/Mongo can behave so strange...
type: Comment
comment on: http://stackoverflow.com/a/28930523
score: 0

http://stackoverflow.com/comment/46129361
type: Comment
comment on: http://stackoverflow.com/a/28937141
has text: Yes, it's good. But I want to keep all code in one function like an object from the class. ANd to delete this object after closing
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46074346
type: Comment
comment on: http://stackoverflow.com/q/28907346
type: QuestionComment
score: 0
has text: Don't think it's a CORS issue, because I've given the extension permission to access anything in the dclibrary.org domain (added that to the post) and am successfully getting other dclibrary.org resources not in the overdrive.dclibrary.org subdomain. Then again, this is my first javascript outing.

http://stackoverflow.com/q/28997003
has comment: http://stackoverflow.com/comment/46242697
type: Question
has body: I have two pages. The first is a form that allows the user to customize an image. In this example, they are selecting the color Orange: var color = "ff6600"; $.get("page2.php?color=" + color, function(data) { } My second page uses Javascript to generate new images by creating a new canvas and adjusting each pixels rgb value to match the color they selected on the first page. That page includes code somewhat like this: $(window).load(function() { generateCanvas(); $(".imageChoices").each(function() { changeColor(color); } }); If I take the url from the first page: page2.php?color=ff6600and open the link in a new tab. Everything works fine! However, if I use the jQuery $.get function, then the javascript on my second page will never get triggered. My question is, is this suppose to work this way? And, is there anyway that I can get the first page to trigger the second pages javascript functions? I tried this with PHP file_get_contents and I got the same result. I am looking for a way to make this work. My backup plan is to use header("location: page2.php?color=ff6600"); and then window.location.href= "page1.php"; when page2 is complete. I am refraining from using this approach because they user will know they are being redirected to page2.
has comment: http://stackoverflow.com/comment/46242849
answer count: 1
has comment: http://stackoverflow.com/comment/46242463
has comment: http://stackoverflow.com/comment/46242572
tagged with: javascript
has comment: http://stackoverflow.com/comment/46242965
tagged with: jquery
has comment: http://stackoverflow.com/comment/46242929
has comment: http://stackoverflow.com/comment/46242727
has comment: http://stackoverflow.com/comment/46242774
has comment: http://stackoverflow.com/comment/46242370
tagged with: php
has answer: http://stackoverflow.com/a/29167415
score: 0
has comment: http://stackoverflow.com/comment/46242382
has comment: http://stackoverflow.com/comment/46242763
has comment: http://stackoverflow.com/comment/46242841
accepted answer: http://stackoverflow.com/a/29167415
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46242611
has title: Can jQuery $.get trigger javascript code on second page?
has comment: http://stackoverflow.com/comment/46242818
has comment: http://stackoverflow.com/comment/46242771
has comment: http://stackoverflow.com/comment/46242253

http://stackoverflow.com/q/29023823
has body: So, I am currently removing and adding a class to an anchor with this: $('#link a').removeClass('btn').addClass('scroll'); But I also need to remove the href in the '#link a' anchor tag too. What's the cleanest/neatest way to accomplish it all?
has answer: http://stackoverflow.com/a/29023845
tagged with: javascript
tagged with: jquery
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/29023845
has title: Cleanest way to remove href from anchor with jQuery
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/29024043
tagged with: anchor
possible better answer: http://stackoverflow.com/a/29024043
tagged with: hyperlink
type: AnsweredQuestion
score: 2
downvote count: 0

http://stackoverflow.com/a/29024501
has comment: http://stackoverflow.com/comment/46329719
has body: Without seeing all the files you've included, my guess is that your code is using a jQuery dependency that the tooltipsy plugin includes, thus why it's working when you're including the plugin, but not working when it's not. I'd use the console view of your browser to inspect what scripts are, and aren't being included when you enable/disable the plugin. Do keep in mind, jquery doesn't come with all of it's components by default. A lot of it is packed into smaller packages, such as the UI etc. This might explain why your script is failing, because it's missing a dependency. Edited converted comment to answer the toggle() command is part of the jquery ui, which as described above is an external component of jquery. You can easily hook in the jquery ui yourself, and this will fix your issue. You will want to load the component AFTER you load jquery, and it can be done the same way you'd load the jquery library. Ref: http://api.jquery.com/toggle/ As for question #2, try using ./js/ as the path. Honestly though, don't use hard-coded links like that, because when you transition to a live server, it will likely break :)
has comment: http://stackoverflow.com/comment/46329733
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29021007
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46303288
type: Answer
answers question: http://stackoverflow.com/q/29021007

http://stackoverflow.com/q/29022413
favorite count: 0
type: UnansweredQuestion
upvote count: 4
tagged with: conventions
has body: I am a C# developer trying to get into javascript. I am starting with the Aurelia project, which uses ECMAScript 6. Part of my learning a new language is understanding its naming conventions. In this question I am asking about the naming conventions for Properties (ES6 allows the use of properties.) In C# I would define a property with a backing field like this: private string firstName; public int FirstName { get {return firstName;} set {firstName = value;} } My javascript constructor looks like this: constructor() { this.firstName = 'John'; } I want to take this field and put a setter on it (so I can do some other things when the first name is set.) However, if I setup my property like this: set firstName(name) { this.firstName = name; } Then I rightly get a stack overflow exception (because the setter calls the setter (they are both lower case)). So, should I capitalize the java script property like I do in C#? Like this: constructor() { this.FirstName = 'John'; } set FirstName(name) { this.firstName = name; } get FirstName() { return this.firstName; } That fits my C# style of coding, but all the java script examples I see only use caps for Class names. How does Java Script/ECMAScript 6 differentiate backing fields from properties? Note: My code example comes from the Aurelia getting started guide.
downvote count: 0
type: Question
tagged with: ecmascript-6
tagged with: naming-conventions
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/29027968
answer count: 1
has title: Property and Backing value naming conventions for Javascript ES6

http://stackoverflow.com/q/28972684
has comment: http://stackoverflow.com/comment/46197225
has body: I am sending data from jquery via AJAX Post with all the form fields serialized (In WordPress). $('#SendEmail').click(function () { jQuery.post( the_ajax_script.ajaxurl, { 'action': 'the_ajax_hook_SendEmailWithCalculatorContent', 'calculatorFormContent': $("#CalculatorForm input").serialize() }, function (response_from_the_action_function) { $("#G1").val(response_from_the_action_function); } ); }); Here are the post paramters from firebug POST: action the_ajax_hook_SendEmailWithCalculatorContent calculatorFormContent ZIPCodeTextBox=01915&amp;G1=PhoneNumber+%3A++ZipCode+%3A+&amp;G2=&amp;G3=&amp;G4=&amp;G5=&amp;G6=&amp;G7=&amp;G8=&amp;G9=&amp;G10=&amp;G11=&amp;G12=&amp;G13=&amp;G14=&amp;G15=&amp;G16=&amp;G17=&amp;G18=&amp;G19=&amp;G20=&amp;G21=&amp;G22=&amp;G23=&amp;G24=&amp;G25=&amp;G26=&amp;G27=&amp;fullname=&amp;email=&amp;phone=7324211531 Need to access these parameters in PHP, when I try to access them echo "PhoneNumber : ".$_POST['phone']." ZipCode : ".$_POST['ZIPCodeTextBox']." IndexValue : ".$_POST['0']; I get the output as "PhoneNumber : ZipCode : IndexValue : ", so all the form data is coming as blanks. When I try: echo $_POST; i see value "Array" come across. How do I access the array value? Saw multiple posts here that answer by using the parameter name, one can fetch data from $_POST['name']. (Similar link: jQuery AJAX form data serialize using PHP) But apparently it is not working in my case.
tagged with: javascript
has answer: http://stackoverflow.com/a/28973928
has comment: http://stackoverflow.com/comment/46197658
has title: Unable to access parameters in PHP, Posted values from jQuery with Serialize
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/46196687
score: 2
linked to: http://stackoverflow.com/q/24007780
upvote count: 2
tagged with: wordpress
type: Question
has comment: http://stackoverflow.com/comment/46196681

http://stackoverflow.com/comment/46274827
type: Comment
score: 1
has text: Are you including jQuery anywhere? Also your javascript code needs to go inside of tags or it won't be executed.
type: QuestionComment
comment on: http://stackoverflow.com/q/29015017

http://stackoverflow.com/a/29035151
type: Answer
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/46317531
has comment: http://stackoverflow.com/comment/46324844
has body: The server should indicate error or success through a HTTP status code (e.g. 200 = OK, 500 = error). This you can catch in your REST client, with JQuery $.ajax({ url: 'service/generatedPDF', error: function(jqXHR, textStatus, errorThrown) { ... // show error message }, ).done(function(data) { // data contains the PDF } It would be better to just create the PDF on the server, put it in a temporary store and send the URL to this PDF in the response. Once the client downloads the file, or after a certain download, the PDF is removed from the store. In that case you would just open a new window with the URL you received from the server. If the server provides the PDF in the initial request, you can convert it to a Data URI and open that data URI in a new window.
has comment: http://stackoverflow.com/comment/46311528
has comment: http://stackoverflow.com/comment/46328937
has comment: http://stackoverflow.com/comment/46315247
has comment: http://stackoverflow.com/comment/46315555
score: 4
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29018505
answers question: http://stackoverflow.com/q/29018505

http://stackoverflow.com/comment/46286371
type: Comment
comment on: http://stackoverflow.com/a/29021535
has text: This adds class on all slides when they come to the center. I would like to only add it to slide #2, and then remove it when slide is changed.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46120452
type: AnswerComment
type: Comment
has text: You are right, wrong link: http://jsfiddle.net/w49rcp40/2/. Seems like its browser dependant. They are both excellent ;)
comment on: http://stackoverflow.com/a/28930020
score: 0

http://stackoverflow.com/comment/46329302
type: QuestionComment
has text: Are you using Ruby or ASP.net for your server-side scripting? If you inspect the output in the Chrome Console or Firebug, is <%= click_path %> replaced with the expected URL?
score: 1
comment on: http://stackoverflow.com/q/29044805
type: Comment

http://stackoverflow.com/q/28912302
has comment: http://stackoverflow.com/comment/46083328
accepted answer: http://stackoverflow.com/a/28912669
has comment: http://stackoverflow.com/comment/46083236
has body: I have a rate button on my page, created using PHP and jQuery. When the button is clicked, a message is shown and hidden after a while "#num voted including you" HTML: div class="voting_wrapper" id="1001"&gt; &lt;div class="voting_btn"&gt; &lt;div class="up_button"&gt;&amp;nbsp;&lt;/div&gt; &lt;span class="up_votes"&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; jQuery: $(document).ready(function() { //####### on page load, retrive votes for each content $.each( $('.voting_wrapper'), function(){ //retrive unique id from this voting_wrapper element var unique_id = $(this).attr("id"); //prepare post content post_data = {'unique_id':unique_id, 'vote':'fetch'}; //send our data to "vote_process.php" using jQuery $.post() $.post('vote_process.php', post_data, function(response) { //retrive votes from server, replace each vote count text $('#'+unique_id+' .up_votes').text(response.vote_up +' user has voted'); },'json'); }); //####### on button click, get user vote and send it to vote_process.php using jQuery $.post(). $(".voting_wrapper .voting_btn").click(function (e) { //get class name (down_button / up_button) of clicked element var clicked_button = $(this).children().attr('class'); //get unique ID from voted parent element var unique_id = $(this).parent().attr("id"); if(clicked_button==='up_button') { //user liked the content //prepare post content post_data = {'unique_id':unique_id, 'vote':'up'}; //send our data to "vote_process.php" using jQuery $.post() $.post('vote_process.php', post_data, function(data) { //replace vote up count text with new values $('#'+unique_id+' .up_votes').text(data); //thank user for liking the content dataModified = data+' users has voting including you'; $('#message-status').hide().html(dataModified).fadeIn('slow').delay(5000).hide(1); }).fail(function(err) { //alert user about the HTTP server error alert(err.statusText); }); } }); //end }); It works fine, but placement of the message is incorrect. When I click the button, that message status…
score: 0
linked to: http://stackoverflow.com/q/21111256
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28912669
has title: How to show a message status below the rate button in jquery?
has comment: http://stackoverflow.com/comment/46083348
has comment: http://stackoverflow.com/comment/46083329
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28912518
tagged with: php
has answer: http://stackoverflow.com/a/28912518

http://stackoverflow.com/a/29045496
has body: Use //Bind change event $("input[name*='answer_id']").change(function() { //If condition if ($(this).data('correct') === true && $(this).is(':checked')) { $(this) .closest('li') //Find parent li .find('div.question_explanation') //find your div .addClass('correct_answer_green'); } }).trigger('change'); //Trigger on page load $(document).ready(function() { $("input[name*='answer_id']").change(function() { if ($(this).data('correct') === true && $(this).is(':checked')) { $(this).closest('li').find('div.question_explanation').addClass('correct_answer_green'); } }).trigger('change'); }); div.question_explanation { background-color: LightGray; } div.correct_answer_green { background-color: LightGreen; } A) I am the correct answer! Correct. This is an explanation of the correct answer. B) I am an incorrect answer. Incorrect. This is an explanation why the answer is incorrect.
answers question: http://stackoverflow.com/q/29045448
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29045448

http://stackoverflow.com/a/29040951
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29040868
has body: When you call ajax_fetch, it is performing the ajax call at that time. You are not passing the function as a callback, you are calling that function here: ajax_fetch("RemoveStatus", $("#header.container"), step, ajax_fetch("/StepIndex", $(".replaceable"), step, // this makes the call function () { window.alerts.warning("Step Re-Opened"); }) );
downvote count: 0
type: Answer

http://stackoverflow.com/q/29037383
has title: How to Add HTML5 Video controls dynamically
type: Question
tagged with: video
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29037654
has comment: http://stackoverflow.com/comment/46315848
has comment: http://stackoverflow.com/comment/46315814
tagged with: html5-video
answer count: 2
tagged with: javascript
tagged with: jquery
has body: I have a video slider which does not include controls in the 'video' tags. I am using a custom play button to initiate videos. However, once the video has begun playing, I am fading out my custom play button and would like the standard html5 video controls to take over. Is there a way to append the controls to html5 video only if the video is playing. Any help is much appreciated.
has answer: http://stackoverflow.com/a/29037654
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29037616
has comment: http://stackoverflow.com/comment/46315454
has answer: http://stackoverflow.com/a/29037616
score: 0

http://stackoverflow.com/a/28928738
has comment: http://stackoverflow.com/comment/46113457
has body: UPDATE Updated the jQuery function to make the master checkbox override child checkbox states. How does something like this sound? I wasn't sure which classes were your checkboxes so you'll have to tweak this a bit: HTML: Select All Regular Regular CSS: div.spacer { display: block; } JS: $('.selectallAO').click(function() { this.checked ? $('.checkboxAO').prop('checked', true) : $('.checkboxAO').prop('checked', false); }); jsFiddle
has comment: http://stackoverflow.com/comment/46113216
score: 0
answers question: http://stackoverflow.com/q/28928636
has comment: http://stackoverflow.com/comment/46113417
has comment: http://stackoverflow.com/comment/46113652
type: Answer

http://stackoverflow.com/a/29044872
answers question: http://stackoverflow.com/q/28962647
type: Answer
has body: Figured out the answer. To put it simply, I wasn't checking diagonals when I was finding the neighbors. You can find a working version here The part that I changed var look=[[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]];
score: 0

http://stackoverflow.com/a/28995543
has comment: http://stackoverflow.com/comment/46239293
has body: http://selenium-python.readthedocs.org/en/latest/locating-elements.html can you not use CLASS_NAME driver.find_elements(By.CLASS_NAME, 'edit-one') or driver.find_element_by_class_name('edit-one')
score: 0
answers question: http://stackoverflow.com/q/28995415
type: Answer

http://stackoverflow.com/comment/46368122
type: Comment
has text: If you want to reuse the initial markup from the server, you *have to* pass the same props.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29060912

http://stackoverflow.com/comment/46087245
comment on: http://stackoverflow.com/a/28913841
type: AnswerComment
score: 0
has text: I have gone through with this. Sample:
type: Comment

http://stackoverflow.com/q/29061724
has body: I wanted to turn this: [ 'para', 'this is a paragraph'] into this (picking the first tree words of the second string of the array, then put them inside a nested array with an additional em). [ 'para', [ 'em', 'this is a' ], 'paragraph' ] So I tried the following: var para = tree[1] var firstTreeItems = para[1].split(' ', 3).join(' ') para[1] = _.without(para[1].split(' '), firstTreeItems.split(' ')).join(' ') para.splice(1, 0, ['em', res]) console.log(para) But it didn't work, _.without isn't excluding this is a in the last part of the array: [ 'para', [ 'em', 'this is a' ], 'this is a paragraph' ] What I'm a doing wrong?
tagged with: underscore.js
has answer: http://stackoverflow.com/a/29061972
accepted answer: http://stackoverflow.com/a/29061972
has comment: http://stackoverflow.com/comment/46359823
score: 0
has comment: http://stackoverflow.com/comment/46359695
has title: Underscore's _.without not excluding substring in the following array?
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46359754
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/28964573
tagged with: http://stackoverflow.com/tag/html
upvote count: 14
has title: Google Maps API v3 Highlight Country Border without using Polygons
score: 13
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28965069
accepted answer: http://stackoverflow.com/a/28965069
has body: I need to highlight the border of a country - let's say Switzerland. I achieved it with already with FusionTablesLayer like: var layer = new google.maps.FusionTablesLayer({ query: { select: 'geometry', from: '1N2LBk4JHwWpOY4d9fobIn27lfnZ5MDy-NoqqRpk', where: "ISO_2DIGIT IN ('CH')" }, styles: [ { polygonOptions: { strokeColor: "#FF0000", fillOpacity: "0" } } ] }); layer.setMap(map); The problem hereby is, that the drawn border is too straight Is there any possibility to use some kind of search request, because if I go to Google Maps and search for Switzerland the country borders are highlighted in a light pink. This would already fullfil my requirements. See Maps Thanks in advance
type: Question
linked to: http://stackoverflow.com/q/21302002
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/46181395
has comment: http://stackoverflow.com/comment/131271463

http://stackoverflow.com/comment/46105315
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28924402
has text: Thanks @hobbs. Is there any inmemory cache object that would let me do the above? I guess if I want to do search by # of rooms, then I'd have to create a separate object that is basically a clone of the data of the current collection?

http://stackoverflow.com/q/28916579
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29183504
score: 0
type: AnsweredQuestion
has body: using the Kango Framework, is there a communication between the foreground script and the content script? For example, there is a button in the foreground script that changes the background color of a web page. So if I clicked that button in popup.html, it will use the content script to change the background color of a website.
accepted answer: http://stackoverflow.com/a/29183504
type: Question
tagged with: kango-framework
has title: How to change the website's background when a button was clicked in the popup frame using Kango Framework?

http://stackoverflow.com/comment/46122482
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28925393
has text: Can you be more specific about your problem?
score: 0

http://stackoverflow.com/a/29040578
downvote count: 0
upvote count: 3
answers question: http://stackoverflow.com/q/29040497
type: Answer
score: 3
has body: Remove the curly braces when you are calling the function Change setInterval(changeImages(), 3000); to setInterval(changeImages, 3000);
has comment: http://stackoverflow.com/comment/46322104

http://stackoverflow.com/a/29061536
type: Answer
has comment: http://stackoverflow.com/comment/46398230
accepted answer of: http://stackoverflow.com/q/29061016
answers question: http://stackoverflow.com/q/29061016
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46379117
has body: The likely bottleneck is DOM manipulation (adding / removing nodes, editing attributes etc), so d3 will have the same problem. Using canvas instead of SVG (particularly with a WebGL context) will be much faster if you have a lot of things to draw. Ways you could speed things up while sticking with SVG: Reuse DOM nodes instead of removing them and adding new ones Define the animations ahead of time using CSS.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46202103
has text: please try... even without conversion it fail var ccc=10206229832728593; alert("saveme.php?id="+ccc ) ;
type: Comment
comment on: http://stackoverflow.com/q/28975472
type: QuestionComment
score: 1

http://stackoverflow.com/comment/46140433
type: QuestionComment
has text: I only added what I though was relevant code but I have updated with full browserify code for building my libraries.js file. Note there is no entry point for the bundle since it just contains the core libraries, file that don't change very often, so I manually add them with `require()`.
score: 0
comment on: http://stackoverflow.com/q/28939762
type: Comment

http://stackoverflow.com/a/28993678
type: Answer
accepted answer of: http://stackoverflow.com/q/28993019
upvote count: 1
answers question: http://stackoverflow.com/q/28993019
score: 1
type: AcceptedAnswer
downvote count: 0
has body: What you are trying is to concatenate a list inside a paragraph and then splitting it again at run-time, this is not the best way to hide and show a dom element and also semantically incorrect since is not valid to have a list inside a paragraph on the HTML specification. The following example is a cleaner way to achieve the results you are looking (try it here https://jsfiddle.net/p8gkvtkj/): CSS: #moreInfo1, #moreInfo2, #moreInfo3 { display: none; } JS: function showOrHideMore(id) { if(document.getElementById(id).style.display==='none'){ document.getElementById(id).style.display = 'block' } else { document.getElementById(id).style.display = 'none' } } HTML: Cheap table X800 ID: 201 Name: Cheap table X800 Description: This is the cheapest table you can find that still meets its goal. 4 people max. Luxury table Z2100 ID: 202 Name: Luxury table Z2100 Description: This is the cheapest table you can find that still meets its goal. 4 people max. Chair 101 ID: 203 Name: Chair 101 Description: This is the cheapest table you can find that still meets its goal. 4 people max.

http://stackoverflow.com/q/28980624
has answer: http://stackoverflow.com/a/28981123
tagged with: jquery
has comment: http://stackoverflow.com/comment/46211328
tagged with: ajax
type: UnansweredQuestion
has title: Unable to call Ajax function from php in server
has body: I am having a problem to call the ajax function from the php after I clicked submit button to submit the form. Everything is working fine on Localhost, but when I transfer all of the php to FTP server, all the function can't work already. In Localhost, I'm able to submit the file upload to filesystem which I name it "uploads" folder and then insert the data of the form into database with query. But when I try on the FTP server, where I also create a uploads folder to store the uploaded file, it can't work. Anything I did wrong in my code or any configuration I need to set? Please point me out. Here is my php code where I use to submit form : schoolform.php Upload New Form Here Only PDF Form Name Form Description File input You file must not more than 1MB. (Only PDF allowed) Add Here is where I used to call the ajax function to insert the data: //File and text upload with formDATA function $("#form").submit(function(){ var formData = new FormData($(this)[0]); $.ajax({ url:'schoolFormItem.php', type: 'POST', data: formData, async: false, beforeSend: function(){ if(confirm('Are you sure?')) return true; else return false; }, cache: false, contentType: false, processData: false }).done(function () { //do something if you want when the post is successfully if(!alert('Form Had Successfully Inserted.')){document.getelementbyclassname('form').reset()} }); return false; }); Here is my query function to insert data into database and also filesystem : <?php include 'dbConnection.php'; global $dbLink; $path = "uploads/"; $valid_formats = array("PDF", "pdf"); if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST") { $name = $_FILES['uploaded_file']['name']; $size = $_FILES['uploaded_file']['size']; $fName = $dbLink->real_escape_string($_POST['formName']); $fDescription = $dbLink->real_escape_string($_POST['formDescription']); if(strlen($name)) { list($txt, $ext) = explode(".", $name); if(in_array($ext,$valid_formats)) { if($size<(1024*1024)) { $actual_image_name = time().subs…
tagged with: php
has comment: http://stackoverflow.com/comment/46212066
has answer: http://stackoverflow.com/a/28981079
tagged with: mysql
has comment: http://stackoverflow.com/comment/46211573
has comment: http://stackoverflow.com/comment/46212141
type: Question
has comment: http://stackoverflow.com/comment/46211268
has comment: http://stackoverflow.com/comment/46211729
tagged with: javascript
has comment: http://stackoverflow.com/comment/46212317
has comment: http://stackoverflow.com/comment/46211634
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46211186
has comment: http://stackoverflow.com/comment/46211494
has comment: http://stackoverflow.com/comment/46211241

http://stackoverflow.com/comment/46548819
score: 0
type: Comment
has text: @plondon Clear now :)
type: QuestionComment
comment on: http://stackoverflow.com/q/28908616

http://stackoverflow.com/q/29002853
type: Question
has comment: http://stackoverflow.com/comment/46253038
upvote count: 0
linked to: http://stackoverflow.com/q/24987938
has title: Is this possible
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29003457
answer count: 3
tagged with: popupwindow
tagged with: http://stackoverflow.com/tag/html
tagged with: modalviewcontroller
favorite count: 0
has comment: http://stackoverflow.com/comment/46252780
has body: My question is, if I open a particular web site (HTML website), another Particular web site should be popped up in that same website. But the popup shouldn't come in a new window or another window. I have tried using HTML, Java Script, J query and even Modal view. But I couldn't find a solution for this. Can anyone please suggest me whether is this possible or not? If so possible, Can u please suggest that way with an example? And in that particular web site in code level, they gave same origin. So I can’t use i frame, object and embedded.So, please don’t say these 3 options [i frame, object, embedded]. It will be so helpful, if I get a solution as soon as possible. Thanks in advance. Thanks &amp; Regards, Hariharan
has answer: http://stackoverflow.com/a/29002941
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/46252794
has comment: http://stackoverflow.com/comment/46252799
has comment: http://stackoverflow.com/comment/46253206
downvote count: 3
has answer: http://stackoverflow.com/a/29002916

http://stackoverflow.com/a/28963339
has body: You can use jquery remove() function and apply to the div children element. Add div.children().remove(); right after var div = $(" not good "); and you will get only "good" content
type: Answer
score: -1
downvote count: 1
upvote count: 0
has comment: http://stackoverflow.com/comment/46179089
has comment: http://stackoverflow.com/comment/46178432
answers question: http://stackoverflow.com/q/28962995

http://stackoverflow.com/comment/46380602
type: QuestionComment
type: Comment
has text: The Problem seems to be the WebGLRenderer. When using CanvasRenderer all is working fine. But Canvasrenderer sometimes suck, and the performance is ugly on firefox.
comment on: http://stackoverflow.com/q/29034194
score: 0

http://stackoverflow.com/comment/46128714
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28936742
has text: both files are php file?
score: 0

http://stackoverflow.com/comment/46201864
type: Comment
has text: Yup, that was it... That's thoroughly embarrassing. Thanks for your help!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28975365

http://stackoverflow.com/comment/46337578
type: Comment
comment on: http://stackoverflow.com/q/29049704
type: QuestionComment
score: 1
has text: Why not just use an object with the id as the key?

http://stackoverflow.com/a/28920148
score: 4
upvote count: 4
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28920134
downvote count: 0
has body: You are passing some undeclared (looks like) variable cb1, while based on how you are using it in CheckboxDisable function, you want to pass the string cb1: &lt;input type="text" id="tb1" onFocus="CheckboxDisable('cb1');" /&gt; &lt;input type="checkbox" id="cb1" data-ieflub=""/&gt; Also in the function you need to construct selector with variable: function CheckboxDisable(id) { document.getElementById(id).disabled = true; $('#' + id).data('ieflub', 'yes'); } Note, that there is a convenient method to deal with data-attributes $.fn.data. Of course you could also go with attr method, but in this case you should have used full attribute name .attr('data-ieflub', 'yes'). With data method, prefix data- should be dropped. Finally, it makes sense to use jQuery fully and change from document.getElementById(id).disabled = true; to $() method. The final function after additional optimization will become: function CheckboxDisable(id) { $('#' + id).prop('disabled', true).data('ieflub', 'yes'); } New methods used: $.fn.prop to get/set DOM element properties, like disabled, checked, etc. $.fn.data to get/set data properties, read data-attributes.
answers question: http://stackoverflow.com/q/28920134
has comment: http://stackoverflow.com/comment/46097970
has comment: http://stackoverflow.com/comment/46097853
type: Answer
has comment: http://stackoverflow.com/comment/46097915
has comment: http://stackoverflow.com/comment/46097993
has comment: http://stackoverflow.com/comment/46097850
has comment: http://stackoverflow.com/comment/46097880

http://stackoverflow.com/comment/46307318
type: QuestionComment
comment on: http://stackoverflow.com/q/29033118
score: 0
has text: Because if i use async: true nothing returns from the server...
type: Comment

http://stackoverflow.com/q/29061037
favorite count: 0
has comment: http://stackoverflow.com/comment/46358636
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46358521
has comment: http://stackoverflow.com/comment/46358757
type: AnsweredQuestion
has title: Create an UL-list with a text input and button
has answer: http://stackoverflow.com/a/29061288
has comment: http://stackoverflow.com/comment/46358592
has body: I want to write some text, click a button and the text added has to make a list. This is what I have at the moment : 3-2 geef een tekst in waarde And the Javascript code : function a() { var ingevoerd = document.getElementById("waarde").innerHTML; document.getElementById("waarden").add(ingevoerd); } I can understand it doesnt make much sence but I have not really a clue how to do this. Enter some text, click the button and the text has to be in a not numbered list. Can annyone help me out? Would be much appreciated! Kind regards!
upvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29061288
has comment: http://stackoverflow.com/comment/46358500
answer count: 1
downvote count: 0
score: 1

http://stackoverflow.com/q/29055035
score: 2
has title: change inline html image "src" with jQuery
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29055049
has answer: http://stackoverflow.com/a/29055657
answer count: 4
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/29055144
accepted answer: http://stackoverflow.com/a/29055049
has body: I have two inline HTML images. For sake of brevity, let's just say this particular mark-up is really difficult to get to, where these two images live. One image has an ID, the other image does not, but it has a parent div with an ID. What I would like to do is, update / change the src="" of each, with raw JS or preferably smaller jQuery. Image #1 &lt;img id="log_im" src="./wp-content/uploads/2015/01/old_logo.png"&gt; Image #2 &lt;div id="txt_left"&gt; &lt;img style="max-width: 300px; margin-left: -14px;" src="./wp-content/uploads/2015/01/outdatedimage.png"&gt; &lt;/div&gt;
type: Question
possible better answer: http://stackoverflow.com/a/29055060
has answer: http://stackoverflow.com/a/29055060
tagged with: javascript

http://stackoverflow.com/q/28926272
has title: function inside document.ready won't work
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28926310
has comment: http://stackoverflow.com/comment/46108727
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28926310
tagged with: javascript
has body: I have the following function: $(document).ready(function(){ function fav(type){ switch(type){ case "radius":if(radius_fav.indexOf(rad)== -1){ radius_fav.push(rad); } break; case "transform":if(transform_fav.indexOf(final_transformation) == -1){transform_fav.push(final_transformation);} break; default:if(bshadow !== none &amp;&amp; box_fav.indexOf(bshadow) == -1){box_fav.push(bshadow);} break; } }//end of switch statement }); Inside $(document).ready().This function won't work unless it is put outside document.ready().Any ideas?Jquery tag in html page is included CONSOLE: Uncaught ReferenceError: fav is not defined
tagged with: jquery

http://stackoverflow.com/q/28966023
accepted answer: http://stackoverflow.com/a/28966325
downvote count: 1
has comment: http://stackoverflow.com/comment/46183740
type: Question
tagged with: mongodb
tagged with: javascript
has title: Angular-fullstack get current user ID
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28966325
favorite count: 0
has comment: http://stackoverflow.com/comment/46183820
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/66225910
has comment: http://stackoverflow.com/comment/46183834
has comment: http://stackoverflow.com/comment/66225693
has comment: http://stackoverflow.com/comment/46183982
tagged with: node.js
type: AnsweredQuestion
has body: I'm using https://github.com/DaftMonk/generator-angular-fullstack. I have 2 schemas: charts title: String datasets: Array _creator: logged in user ID users name email _id When I console.log the current user returns $scope.getCurrentUser = Auth.getCurrentUser(); console.log($scope.getCurrentUser); But when I try to console log the _id: $scope.getCurrentUser = Auth.getCurrentUser(); console.log($scope.getCurrentUser._id); Returns undefined Can someone explain what I'm doing wrong?
score: 1

http://stackoverflow.com/comment/46330648
type: AnswerComment
has text: net::ERR_INVALID_URL - means that your picture url is messed up. This is about injecting the 'style="max-height:25px; max-width:25px;" ' into your code, be very care full with " " and ' '
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29045504

http://stackoverflow.com/comment/46159984
has text: By the way, this is best practice to put the scripts at the end of the body.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28950071

http://stackoverflow.com/comment/46351104
comment on: http://stackoverflow.com/q/29057022
type: Comment
has text: console.log is an example here
score: 0
type: QuestionComment

http://stackoverflow.com/q/29044002
has comment: http://stackoverflow.com/comment/46328619
tagged with: javascript
has comment: http://stackoverflow.com/comment/46327917
has comment: http://stackoverflow.com/comment/46328192
tagged with: onsen-ui
score: 0
has comment: http://stackoverflow.com/comment/46327973
tagged with: jquery
has comment: http://stackoverflow.com/comment/46328037
has comment: http://stackoverflow.com/comment/46327932
has title: Cannot use jQuery append with onsenui CSS and Angular
tagged with: angularjs
tagged with: css
has comment: http://stackoverflow.com/comment/46328072
answer count: 0
type: UnansweredQuestion
has body: I am trying to create an app using PhoneGap. I want to make a list view of lots of news. I came across this problem when trying to making a new piece of data in the list. Currently when I use the tags provided in an online example in my HTML, it works fine. I then try to insert the tags using jQuery, and they don't work properly. Here is a screenshot showing you what's going wrong: http://cl.ly/image/1k063m2y3V3B The first two pieces of data are just normal HTML and then the last piece of data was inserted with jQuery. I am inserting the same code so it might be Angular and jQuery clashing that's the problem. Relevant HTML: Rorem Ipsum 5h Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Rorem Ipsum 5h Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </ons-page> </ons-navigator> </ons-template> JQuery: $(function() { $("#data").append(" Rorem Ipsum 5h Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "); });
type: Question

http://stackoverflow.com/comment/46103621
comment on: http://stackoverflow.com/q/28923453
type: QuestionComment
type: Comment
score: 0
has text: For $5 you get a mini vps at digital ocean which isn't even comparable to the free hosting plans. AFAIC if it isn't worth $5 it isn't worth it at all.

http://stackoverflow.com/a/28971459
has comment: http://stackoverflow.com/comment/46194519
has body: Without seeing your HTML it's hard to present the solution. But you could access the name of the input-tag by calling checked.name.
score: 0
answers question: http://stackoverflow.com/q/28971382
type: Answer
has comment: http://stackoverflow.com/comment/46194382

http://stackoverflow.com/comment/48152356
type: AnswerComment
score: 0
type: Comment
has text: I had some problems with this at first, but I named `$rootScope` just `$scope`, which doesn't work with angular's name-DI-detection. I hope this helps someone
comment on: http://stackoverflow.com/a/29001827

http://stackoverflow.com/comment/46293680
type: QuestionComment
type: Comment
has text: refer http://stackoverflow.com/questions/4295782/how-do-you-extract-post-data-in-node-js
comment on: http://stackoverflow.com/q/29025559
score: 0

http://stackoverflow.com/q/29020026
has answer: http://stackoverflow.com/a/29375115
type: Question
type: AnsweredQuestion
tagged with: c#
has comment: http://stackoverflow.com/comment/46431500
has comment: http://stackoverflow.com/comment/46634686
has comment: http://stackoverflow.com/comment/46494418
has title: Virtual Console for Web App Using Websockets
tagged with: javascript
linked to: http://stackoverflow.com/q/6024172
linked to: http://stackoverflow.com/q/15267435
score: 0
answer count: 2
has body: I have a WCF Service which is hosted by a Windows Service. It can also run as a console program when a command argument is present. It has one interface that employs MSMQIntegrationBinding, and another that binds to HTTP for service utility methods. This works well. I have a web application (written for IE 11) that lets the user monitor the service, and perform the utility methods. There are many Console.WriteLines in the code that obviously don't display if the code is running as a service. My boss has now requested that he be able to view the service in action in a console, like it were running as a console app. I would like to add a new virtual console window to my web app that would just display new Console.WriteLines as they occur on the server. I was thinking I could write a function in my wcf service that would accept the message as a string, do a Console.WriteLine, and then push out the message to any listening clients like my web app console window. I'm thinking of using javascript on the client. I've read about using Websockets with netHttpBinding for a WCF service and that's the approach I would like to take. However, the examples I see seem to be bi-directional, like chat windows (http://www.codeproject.com/Articles/619343/Using-WebSocket-in-NET-4-5-Part-3) that just echo back a message to the client. I want one way server-to-client messaging. Can somebody help? Here's my latest code try: IWMLogger.VB &lt;ServiceContract(CallbackContract:=GetType(IWMLogger_MessageCallback))&gt; Public Interface IWMLogger_ClientListener &lt;OperationContract(IsOneWay:=True)&gt; Function ListenForServerMessages() As Task End Interface &lt;ServiceContract&gt; Interface IWMLogger_MessageCallback &lt;OperationContract(IsOneWay:=True)&gt; Function SendMessageToClient(ByVal msg As String) As Task End Interface WMLogger.VB &lt;ServiceBehavior(InstanceContextMode:=InstanceContextMode.Single)&gt; _ Public Class WMLogger_Service Implements IWMLogger_Service, IWMLogger_Service_MSMQ,…
has comment: http://stackoverflow.com/comment/46450192
has comment: http://stackoverflow.com/comment/46427217
favorite count: 0
linked to: http://stackoverflow.com/q/29256738
has answer: http://stackoverflow.com/a/29209632
tagged with: wcf
has comment: http://stackoverflow.com/comment/46511047
tagged with: vb.net
accepted answer: http://stackoverflow.com/a/29209632
has comment: http://stackoverflow.com/comment/46309787
possible better answer: http://stackoverflow.com/a/29375115
has comment: http://stackoverflow.com/comment/46452443
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/46264430
has text: `$scope.defaultObject = $scope.allObjects[0]` if the model is an object you should pass it by reference
comment on: http://stackoverflow.com/q/29009611
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29042665
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: Can someone please help me with finding out how to set my tabs widget to a set height, so when more content is added, it will then revert to a scrollbar to see more information. Currently it just keeps expanding as I add more content. I tried looking through the css and js and can't figure it out. I need to contain this widget so that my homepage does not expand for miles. Here is the site I got the tabs widget from: http://jqueryui.com/tabs/ Here is the CSS file: http://code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css Thanks!
tagged with: css
has answer: http://stackoverflow.com/a/29042957
type: Question
has title: Fixed height on tabs navigation widget
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/29042817
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2

http://stackoverflow.com/comment/46306812
type: QuestionComment
comment on: http://stackoverflow.com/q/29032841
has text: You need to use lower jquery version and then use live function of jquery. May be it's not the perfect answer but it may help you.
score: 0
type: Comment

http://stackoverflow.com/a/28940321
has body: You can use .css('top'): $(".ms-acal-item").css('top'); and for setting new value: $(".ms-acal-item").css('top',function(i,oldtop){ return oldtop+20; });
accepted answer of: http://stackoverflow.com/q/28940297
answers question: http://stackoverflow.com/q/28940297
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46135579
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/46157565
type: AnswerComment
comment on: http://stackoverflow.com/a/28951836
score: 0
has text: Glad to help! Now that you have an ID tag you could use `getElementById('submit')` or `querySelector('#submit')` to make the code a little bit simpler, but good to see it working. A tip on using Stack Overflow in general: You should probably have posted this as a comment instead of an answer.
type: Comment

http://stackoverflow.com/comment/67320221
type: QuestionComment
comment on: http://stackoverflow.com/q/28973603
has text: You could always try `document.body.removeAttribute('data-foo')`.
score: 0
type: Comment

http://stackoverflow.com/comment/46112239
has text: @MukeshAgarwal: Thank you! So you think that this is something that can be used in a production environment?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28927618
score: 0

http://stackoverflow.com/a/29003899
has comment: http://stackoverflow.com/comment/46254876
has comment: http://stackoverflow.com/comment/46254697
type: Answer
accepted answer of: http://stackoverflow.com/q/29003860
has comment: http://stackoverflow.com/comment/46254789
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29003860
has comment: http://stackoverflow.com/comment/46254449
has comment: http://stackoverflow.com/comment/46254477
has comment: http://stackoverflow.com/comment/46254981
upvote count: 1
has body: Try to use map method: var data = [{ 0: 'a', 1: 'b', 2: 'c' }, { 0: 'd', 1: 'e', 2: 'f', 3: 'g' }]; var result = data.map(function (obj) { var subArr = Object.keys(obj).slice(1).map(function(key) { return obj[key]; }); return [obj[0], subArr]; }); alert(JSON.stringify(result, null, 4)); Above function use the element at index 0 as the first item of the nested arrays, and everything else in the subarray.
type: AcceptedAnswer

http://stackoverflow.com/comment/46239151
comment on: http://stackoverflow.com/q/28953645
type: QuestionComment
has text: My latest version of the controller function is: cntrl.input.countrySelected = function initialCountry( getUserGeolocateService ){return getUserLocation[country];} It does not have Console errors and does not set an initial value for countrySelected. I've tried a lot of things and have hit a wall.
type: Comment
score: 0

http://stackoverflow.com/q/28977925
accepted answer: http://stackoverflow.com/a/28978650
has body: Script : Jquery I am new to jquery, and I found this piece of code which I tried but didn't succeed. It uses jquery validator plugin. Here is the code : How do I achieve this ? here is the link http://jsfiddle.net/cMhQ7/
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28978397
tagged with: javascript
tagged with: jquery
score: 0
possible better answer: http://stackoverflow.com/a/28978397
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/46206726
has title: Show error message for controls using Jquery
has answer: http://stackoverflow.com/a/28978650
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46206827

http://stackoverflow.com/q/29034768
tagged with: twitter-bootstrap
type: UnansweredQuestion
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/46310993
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29035127
type: Question
has body: I'm working with a design team to redesign my website, and my lead developer told me to tell them I wanted to use AngularJS instead of JQuery for my HTML pages since it is clean code and has the most modern libs; which they agreed to use. I guess since AngularJS is newer than JQuery they don't have as much experience with it. In the project scope, we agreed that they would do just the "front-end" work (e.g. templated bootstrap, css/html and animations of the site) for the redesign, but they told me that someone from their team said that AngularJS is also "back-end" programming work too...is this accurate? If they are creating my HTML pages will they have to do "back-end" programming work if they use AngularJS or will this be only "front-end" work? They say they have to use JQuery because this is all "front-end" work. Also, they are telling me for specific animation effects such as fading in and out of elements etc. that they want to use jQuery and Bootstrap. They tell me that AngularJS is not the best solution for animations, but it's better for manipulating dynamic and real time information for the website...is this accurate? It seems to me they are just trying to find ways to not use AngularJS and use JQuery instead which they are more comfortable with.
has answer: http://stackoverflow.com/a/29035061
has answer: http://stackoverflow.com/a/29035631
tagged with: jquery
has title: Is AngularJS a "front-end" language that can be used for animations instead of JQuery?
linked to: http://stackoverflow.com/q/14994391
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29035295
tagged with: http://stackoverflow.com/tag/html
answer count: 4

http://stackoverflow.com/comment/46322901
has text: ...and just found getUTCHours instead of getHours for that
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29040719

http://stackoverflow.com/q/28971420
upvote count: 0
downvote count: 3
possible better answer: http://stackoverflow.com/a/28975578
type: Question
has comment: http://stackoverflow.com/comment/46201454
has answer: http://stackoverflow.com/a/28971801
accepted answer: http://stackoverflow.com/a/28971801
has comment: http://stackoverflow.com/comment/46194422
has answer: http://stackoverflow.com/a/29170876
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/46201383
tagged with: jquery
has answer: http://stackoverflow.com/a/28975578
favorite count: 0
has comment: http://stackoverflow.com/comment/46194360
score: -3
has comment: http://stackoverflow.com/comment/46194203
tagged with: php
has comment: http://stackoverflow.com/comment/46201421
has body: I am trying to figure out how to NOT echo a var if the date has expired. My PHP below shows: Match 1 - April 1, 2015 Match 2 - April 8, 2015 So what I need is that, IF the Current date is, April 2, 2015, Match 1 will not echo. If April 30th, nothing will echo. Here is the php &lt;?php $match1 = "Match 1 - April 1, 2015"; $match2 = "Match 2 - April 8, 2015"; ?&gt; &lt;?=$match1?&gt; &lt;?=$match2?&gt; I have looked at several codes and tried a few myself, but nothing works. Thanks.
has title: php if specific date expires do not echo vars
type: AnsweredQuestion

http://stackoverflow.com/comment/46244086
comment on: http://stackoverflow.com/q/28998007
score: 0
type: Comment
type: QuestionComment
has text: Check if your code is loaded in page.

http://stackoverflow.com/comment/46276269
has text: I dont know why, result variable isn't getting TRUE. if I put console.log("debug") to else{ ... } statement it prints out, but "result" isnt changing to true...
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29015620
type: Comment

http://stackoverflow.com/a/28934483
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28934413
has body: There are multiple reasons binding to the document (called event delegation) is better: There are fewer instances of the event handler in memory. If you have very large numbers of items, this will save memory There is a smaller chance of memory leaks for event handlers that do not get unregistered properly when elements are deleted There is less work that has to happen every time you add a new element of the type that should respond to the event handler - hence less CPU usage Depending on the application, the delegated event handler might have to do more work to figure out how to process the event properly for each individual instance, whereas the individual handlers can use the scope to store values for use inside the handler itself - this might be quicker. So the answer depends on your application
answers question: http://stackoverflow.com/q/28934413
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/28952481
has body: I've been developing my first AngularJS application for while, and I just realized that anyone could simply get/copy all the information from my JSON files at once. Therefore I ask: Is is safe to use AngularJS - i.e. should I be worried about people copying all the content of my app at once and then simply pasting somewhere else? Is there a way I can make it unreadable for people to read the JSON file? I do know that there are some tools and websites that could make Javascript scripts unreadable, but as I pass it to the view it makes the json unreadable by the browser. There's a website called Udemy, that uses Angular in part of it. I have tried by all means to see the classes titlebut still I can't find/read the Json file that contains the content. How is such thing possible? Many thanks.
has answer: http://stackoverflow.com/a/28952557
has answer: http://stackoverflow.com/a/28952593
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46158760
has comment: http://stackoverflow.com/comment/46158763
linked to: http://stackoverflow.com/q/2669690
type: Question
possible better answer: http://stackoverflow.com/a/28952516
has answer: http://stackoverflow.com/a/28952516
tagged with: javascript
has answer: http://stackoverflow.com/a/28952827
upvote count: 1
has comment: http://stackoverflow.com/comment/46159107
downvote count: 7
has comment: http://stackoverflow.com/comment/46158992
has comment: http://stackoverflow.com/comment/46158714
accepted answer: http://stackoverflow.com/a/28952557
score: -6
answer count: 4
favorite count: 0
has title: Is it safe to use AngularJS?
tagged with: angularjs

http://stackoverflow.com/comment/46192823
comment on: http://stackoverflow.com/a/28970619
has text: Correct me if I'm wrong, but won't that break statement cause it to only return the first match in the second array?
type: AnswerComment
type: Comment
score: 0

unobtrusive-validation
tags question: http://stackoverflow.com/q/29051742
type: Tag
tag name: unobtrusive-validation

http://stackoverflow.com/comment/46200072
has text: What error do you encounter with the first method?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28974269

http://stackoverflow.com/a/28907945
score: 0
has body: I think your JSON is messed up. I ran it through JSONLint, and having the undefined at the beginning causes things to break.
type: Answer
answers question: http://stackoverflow.com/q/28907765

http://stackoverflow.com/q/28976460
has comment: http://stackoverflow.com/comment/57402078
has title: React.js: how to make inline styles automatically update progress bar on state change
has comment: http://stackoverflow.com/comment/46204052
score: 7
has comment: http://stackoverflow.com/comment/46204117
upvote count: 7
has comment: http://stackoverflow.com/comment/46204102
type: Question
tagged with: reactjs
tagged with: javascript
has comment: http://stackoverflow.com/comment/46204060
has comment: http://stackoverflow.com/comment/46204024
has answer: http://stackoverflow.com/a/29620026
tagged with: zurb-foundation
answer count: 1
downvote count: 0
has body: I have a progress bar that I am building in React.js and Zurb Foundation that I would like to reflect the current state. I understand that in the beginning I can set the width with something like this: render: function() { var spanPercent = (this.props.a - this.props.b)/this.props.a + '%'; var spanStyle = { width: spanPercent }; return ( &lt;div className="progress"&gt; &lt;span className="meter" style={spanStyle}&gt;&lt;/span&gt; &lt;/div&gt; ); } however, when the value of props changes due to a state change, the inline style doesn't update even though the props value changes. Is there a best practice for doing this, such as using a callback, or placing the code somewhere else? I would appreciate any help!
favorite count: 0
has comment: http://stackoverflow.com/comment/46204436
type: UnansweredQuestion

ember-data
tags question: http://stackoverflow.com/q/29046477
type: Tag
tag name: ember-data
tags question: http://stackoverflow.com/q/29052574

http://stackoverflow.com/q/29018451
tagged with: jquery
favorite count: 0
tagged with: ajax
linked to: http://stackoverflow.com/q/29174776
has answer: http://stackoverflow.com/a/29175264
type: Question
tagged with: php
upvote count: 2
tagged with: wordpress
accepted answer: http://stackoverflow.com/a/29175264
has title: How to integrate ajax to Wordpress theme?
has comment: http://stackoverflow.com/comment/46281931
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46283975
has comment: http://stackoverflow.com/comment/46285235
linked to: http://stackoverflow.com/q/28962049
has comment: http://stackoverflow.com/comment/46568314
type: AnsweredQuestion
score: 2
has body: I am trying to use ajax in wordpress I have two files, php and js this is my php code combo_check-out.php function iRange($first, $last, $format = 'm/d/Y' ) { $dates = array(); $current = strtotime($first); $i=1; while( $i &lt;= $last ) { $dates[] = date($format, $current); $current = strtotime('+1 day', $current); $i++; } $time = date("m/d/Y",$current); return $time; } if($_REQUEST) { $id = $_REQUEST['parent_id']; ?&gt; &lt;select name="check-out" id="check-out-date"&gt; &lt;option value="&lt;?php echo iRange($id, 1, $format = 'm/d/Y' ) ?&gt;"&gt;"1 Day (Same Day)"&lt;/option&gt; &lt;option value="&lt;?php echo iRange($id, 2, $format = 'm/d/Y' ) ?&gt;"&gt;"2 Days"&lt;/option&gt; &lt;option value="&lt;?php echo iRange($id, 3, $format = 'm/d/Y' ) ?&gt;"&gt;"3 Days"&lt;/option&gt; &lt;option value="&lt;?php echo iRange($id, 4, $format = 'm/d/Y' ) ?&gt;"&gt;"4 Days"&lt;/option&gt; &lt;/select&gt; &lt;?php}?&gt; and here it is my js code combo_checkout_iRange.js $(document).ready(function() { $('#loader').hide(); $('#check-in-date').change(function(){ $('#check-out-date-wrap').fadeOut(); $('#loader').show(); $.post("combo_check-out.php", { parent_id: $('#check-in-date').val(), }, function(response){ setTimeout("finishAjax('check-out-date-wrap', '"+escape(response)+"')", 400); }); return false; }); }); //JQuery to hide Loader and return restults function finishAjax(id, response){ $('#loader').hide(); $('#'+id).html(unescape(response)); $('#'+id).fadeIn(); } function alert_id() { if($('#check-out-date').val() == '') alert('Please select a sub category.'); else alert($("#check-out-date").val()); return false; } they work fine outside wordpress how to integrate them in wordpress theme Note: this should work in post type called "meetings" so this is what i wrote on function.php add_action("wp_enqueue_scripts", function() { if (is_single()) { if (get_post_type() == 'meetings') { wp_enqueue_script('combo_checkout_iRange', get_template_directory_uri() . '/js/combo_checkout_iRan…
downvote count: 0

http://stackoverflow.com/comment/46330827
type: Comment
has text: Thanks @dclowd9901 : but it is not working for my code...as there is specific constraints that only something@smthng.gov.au or something@smthing.ac.au, or something@smthing.govt.nz or something@smthing.edu.au or something@csiro.au email format will allowed only. Other all are working fine but it is showing something@csiro.au as a invalid email id. I need to allow this also.
comment on: http://stackoverflow.com/a/29045827
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46334199
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29046846
type: Comment
has text: It seems that your problem is not with javascripts array accessing, as the question seems to be about, but rather some issue with your GUI=>Code connection. Either edit your question, so that we can actually answer, knowing what the issue is, or accept an answer that answers the given question (which all three current answers does).

http://stackoverflow.com/q/29037193
upvote count: 1
tagged with: css
tagged with: drag
type: AnsweredQuestion
score: 1
has body: I have a HTML page that contains 2 tables, each table has 6 rows and each row holds 6 (90px by 90px) image. All images are .PNG and ideally I want to be able to drag one image, and have it drop into the other table and overlay the other image. The HTML looks like this: </t and the CSS for the tables... .gametray { background-color: black; border: 3px solid black; display: inline-block; margin-left: 20px; } .gametray td { background-color: #003399; border: 1px solid black; } .gametray img { display: block; height: 90px; width: 90px; } .piecetray { background-color: #0052CC; border: 3px solid black; display: inline-block; margin-right: 20px; } .piecetray td { border: 1px solid transparent; } .piecetray img { display: block; height: 90px; width: 90px; } In JavaScript I have pulled all the images in as follows: Perfection.view = { timer : currentTime = document.getElementById("timer"), **dragPieces : document.querySelectorAll(".piecetray td img"), **targetPieces : document.querySelectorAll(".gametray td img"), updateTime : function(count) { this.timer.innerHTML = count; } I have played around with creating functions to handle the: allowDrop (preventDefault()) Handle drag event and Handle drop event. The code I am using isn't working. In the web console there are no errors. I was using a function something like function handleDrop(event) { event.preventDefault(); var piece = event.dataTransfer.getData("text", event.target); There was also a line in the code to appendChild. The reason I have not posted the actual code yet is because I have posted this from my phone. I set up my event handlers to test one of the images by doing something like Perfection.view.dragPieces[1].ondrop = handleDrop; The closest I got was that the piece image I was testing on would drag and when I drop, it would disappear from the original location, and a random location (square) on the destination table would turn black, unfortunately that's not what I'm going for Can anyone help me? Cheers
type: Question
has comment: http://stackoverflow.com/comment/46315573
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29089718
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/29089718
favorite count: 0
has title: Drag and Drop a .PNG image overtop another one in JavaScript

http://stackoverflow.com/q/28935640
has answer: http://stackoverflow.com/a/28935688
tagged with: javascript
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/46126859
has comment: http://stackoverflow.com/comment/46126687
has title: How do I finish this loop? Concatenate two previous characters
accepted answer: http://stackoverflow.com/a/28935688
has comment: http://stackoverflow.com/comment/46126648
has answer: http://stackoverflow.com/a/28935702
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28935683
has comment: http://stackoverflow.com/comment/46126708
has answer: http://stackoverflow.com/a/28935683
type: Question
has body: I'm making a function that when you give it a string, it will return the uppercase of the even numbered chars and the lower case of the odd numbered ones. So if you give it "HELLO" it will give you "HeLlO". This is obviously wrong since it only works for the first two characters. How do I complete the loop so that it doesn't keep concatenating the strings together? function evenOddChange(source) { var i; var result; i = 0; result = ""; while ( i &lt; (source.length)) { result = result + source.toUpperCase().charAt(i) + source.toLowerCase().charAt(i + 1); i = i + 1; } return result; }

http://stackoverflow.com/comment/46232752
has text: You're emitting them instantly, which is pretty much sending them all at once and locking up the browser.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28992060

http://stackoverflow.com/q/28972778
tagged with: asynchronous
has answer: http://stackoverflow.com/a/28973786
has comment: http://stackoverflow.com/comment/46197808
type: Question
has body: I'm relatively new to Javascript and I am having trouble understanding how to use a MongoDB callback with an ExpressJS get. My problem seems to be if it takes too long for the database search, the process falls out of the app.get() and gives the webpage an "Error code: ERR_EMPTY_RESPONSE". Currently it works with most values, either finding the value or properly returning a 404 - not found, but there are some cases where it hangs for a few seconds before turning the ERR_EMPTY_RESPONSE. In the debugger, it reaches the end of the app.get(), where it returns ERR_EMPTY_RESPONSE, and after that the findOne callback finishes and goes to the 404, but by then it is too late. I've tried using async and introducing waits with no success, which makes me feel like I am using app.get and findOne incorrectly. Here is a general version of my code below: app.get('/test', function (req, res) { var value = null; if (req.query.param) value = req.query.param; else value = defaultValue; var query = {start: {$lte: value}, end: {$gte: value}}; var data = collection.findOne(query, function (err, data) { if (err){ res.sendStatus(500); } else if (data) { res.end(data); } else{ res.sendStatus(404); } }); }); What can I do to have the response wait for the database search to complete? Or is there a better way to return a database document from a request? Thanks for the help!
has comment: http://stackoverflow.com/comment/46197179
has title: Waiting for MongoDB findOne callback to complete before finishing app.get()
tagged with: javascript
score: 0
tagged with: mongodb
answer count: 2
has answer: http://stackoverflow.com/a/29133571
tagged with: callback
tagged with: express
has comment: http://stackoverflow.com/comment/46198397
type: UnansweredQuestion

http://stackoverflow.com/comment/46255061
comment on: http://stackoverflow.com/q/29004245
type: QuestionComment
type: Comment
score: 1
has text: Binding events on current or future elements using the `.on()` Method should not cost you in performance, cause there's no event until your element is the initiator of such event. What is sluggish? the toggling?

http://stackoverflow.com/comment/46355694
type: Comment
comment on: http://stackoverflow.com/a/29059661
has text: Nope, touch events should work properly on FF Mobile. They are behind the flags since version 24 on Desktop, but on FF Mobile they should work properly.
type: AnswerComment
score: 0

http://stackoverflow.com/q/29011526
type: Question
has title: Backbone collect reset not triggering event
tagged with: backbone.js
upvote count: 2
has body: I have a method in my collection that performs a filter. filterByCategory: function() { this.collection.reset(this.collection, {silent: true}); var filterCategory = this.filterCategory; var filtered = _.filter(this.collection.models, function (item) { return Date.parse(item.get("category")) &lt; filterCategory; }); this.collection.reset(filtered); } In my initialise function I then have listen to the reset event but this never gets called. this.collection.on("reset", this.render, this); I've checked and made sure that my collection is definitely being filter correctly. Also if I add this.render underneath this.collection.reset(filtered) that also doesn't work. One thing I can think of is that with the collection I'm currently working with my filters either return every item in the collection or none of the items in the collection. Could it be that the reset event only gets fired if you pass it a subset of your collection that is has at least one item in it but not every item in it? Can anyone see what I'm doing wrong?
tagged with: backbone.js-collections
score: 2
downvote count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/46268995
tagged with: javascript
type: UnansweredQuestion
favorite count: 0

http://stackoverflow.com/q/29031917
answer count: 1
has comment: http://stackoverflow.com/comment/46305872
has answer: http://stackoverflow.com/a/29032166
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
type: Question
has title: Have any other way in php to stop return undefined value for json_encode
accepted answer: http://stackoverflow.com/a/29032166
score: 0
has comment: http://stackoverflow.com/comment/46304763
has body: I am sent many dynamic post ids from a page and a php server side page(server.php) make a query with those id to find out newly added data in mysql. If it not found any newly added data in mysql, it's return a undefined value. So I added this if (msg.id !== undefined &amp;&amp; msg.detail !== undefined &amp;&amp; msg.name !== undefined) { //do here } to hide undefined. But after added the above line, my script hide undefined value well but return only for 1st CID's newly added value. That means If CID sent ids(100, 101, 102, 103 ect.) to php, It's return only 100 id's newly added value and append it. So without use above method, Have any others way to php server side to remove undefined values? N.B. Without above line its returned all CID's value well but return also undefined value a time interval if no newly added data found, So I need to stop return undefined. my javascript: var CID = []; // Get all dynamic ids of posts (works well) $('div[data-post-id]').each(function(i){ CID[i] = $(this).data('post-id'); }); function addrep(type, msg){ CID.forEach(function(id){ if (msg.id !== undefined &amp;&amp; msg.detail !== undefined &amp;&amp; msg.name !== undefined) { $("#newreply"+id).append("&lt;div class='"+ type +""+ msg.id +"'&gt;&lt;ul&gt;&lt;div class='newkochi'&gt;"+ msg.name +"&lt;/div&gt;&lt;div class='cdomment_text'&gt;"+ msg.detail +"&lt;/ul&gt;&lt;/div&gt;"); } }); } function waitForRep(){ $.ajax({ type: "GET", url: "server.php", cache: false, data: {CID : CID}, timeout:15000, success: function(data){ addrep("postreply", data); setTimeout(waitForRep, 15000 ); }, error: function(XMLHttpRequest, textStatus, errorThrown){ setTimeout(waitForRep, 15000); } }); } $(document).ready(function(){ waitForRep(); }); server.php while (true) { if($_GET['CID']){ //cid got all dynamic post id as: 1,2,3,4 etc. foreach($_GET['CID'] as $key =&gt; $value){ $datetime = date('Y-m-d H:i:s', strtotime('-15 second')); $res = mysqli_query($dbh,"SELECT * FROM reply WHERE qazi_id=".$_GE…
tagged with: php

http://stackoverflow.com/q/28987280
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29014803
has title: LinkedIn verify user auth token server side
score: 9
type: Question
has answer: http://stackoverflow.com/a/40398427
upvote count: 9
tagged with: javascript
answer count: 3
tagged with: linkedin-api
possible better answer: http://stackoverflow.com/a/39462022
has body: after 1 day of research, I've ended with the following issue. I'm building an web app with ember.js and currently I'm implementing LinkedIn login, using linkedin javascript sdk. The problem that I have is that after I recieve user information (token, email, first name and etc) I need to verify this token on server side in order to grand session. Unfortunately, the documentation is not very clear for me. I can access token ( or kind of a token ) using IN.ENV.auth, but when I try to validate one from both of them, I recieve "invalid request". On the server side I'm using node and a sample code look like that: var request = require('request'); var options = { url: 'https://www.linkedin.com/uas/oauth2/accessToken?grant_type=authorization_code&amp;code=TOKEN_RECIEVED_THROUGH_IN.ENV.auth&amp;redirect_uri=my-domain&amp;client_id=API_CLIENT_ID&amp;client_secret=API_SECRET_KEY' }; request(options,function(err,res,body){ console.log(body); }); The response from the sdk is like that: anonymous_expires_in: 1800 anonymous_token: "4u948tas123asfK9DJx9HFYJgcsBFlhIFu93gG" api_key: "API_KEY" is_set_client_auth_cookie: false member_id: "4a13sdasFeD" oauth_expires_in: 1800 oauth_token: "66Dy9V123lL7H823ddl-5L-KVmg184k0dhAaS" Thanks in advance.
downvote count: 0
has answer: http://stackoverflow.com/a/39462022
favorite count: 0
tagged with: node.js
has answer: http://stackoverflow.com/a/29014803

http://stackoverflow.com/comment/61590556
comment on: http://stackoverflow.com/a/29014803
type: Comment
score: 2
has text: URL not found , need to add some details answer also . this answer is not useful now
type: AnswerComment

http://stackoverflow.com/q/28916325
tagged with: safari
type: AnsweredQuestion
has title: Javascript .Focus causing safari 8.1.3 to crash only on IPad
has answer: http://stackoverflow.com/a/28942288
type: Question
tagged with: ios
tagged with: javascript
score: 0
has body: Web App Technology: Asp.Net 4.5 The following snippet of javascript causes Safari (update 8.1.3) to crash. However it worked fine on the previous safari version. The code just resets focus to control after server request. Note: this works fine in Chrome, IE, and FF. var TFoc_Id function EndRequestHandler() { try { //Maintain vertical scroll pos in panel var panel = document.getElementById("ContentPlaceHolder1_InputPanel1"); if (panel != null) { if (typeof yPos == "number") { panel.scrollTop = yPos; } } //Reset focus to control after server request if (TFoc_Id != null) { var id = TFoc_Id; //Below causes Safari crash if (id.indexOf("ContentPlaceHolder1_") != -1) { document.getElementById(TFoc_Id).focus(); } } } catch (err) { } }
answer count: 1
tagged with: ipad
has comment: http://stackoverflow.com/comment/46090859
accepted answer: http://stackoverflow.com/a/28942288
has comment: http://stackoverflow.com/comment/46090717

http://stackoverflow.com/a/29012578
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/46270761
downvote count: 0
answers question: http://stackoverflow.com/q/29012205
has body: I don´t think I completely understood your question, but to me it looks like you are using jQuery to get the containers at the top of your code. If this is the case you are probably just missing the ID selector. Try to change the code to this.waitlist_ = $('#sntq-waitlist'); this.daily_status_ = $('#sntq-daily_status'); //[...] (note the "#" selector if you want to look for elements by ID, which seems to be the case in your example).
type: Answer

http://stackoverflow.com/q/28916777
tagged with: regex
has title: .split() maintaining splitting character
has body: I need to split a string like this var val = "$cs+55+mod($a)"; into an array arr = val.split( /[+-/*()\s*]/ ); The problem is to keep the splitter character as an array element like arr = [ '$cs', '+', '55', 'mod', '(', '$a', ')' ] and not like arr = [ '$cs', '55', 'mod', '$a' ]
has comment: http://stackoverflow.com/comment/46091451
has comment: http://stackoverflow.com/comment/46091596
upvote count: 1
possible better answer: http://stackoverflow.com/a/28920951
has comment: http://stackoverflow.com/comment/46092817
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46092082
has comment: http://stackoverflow.com/comment/46091626
linked to: http://stackoverflow.com/q/12001953
score: 1
type: Question
tagged with: split
answer count: 2
accepted answer: http://stackoverflow.com/a/28917010
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28920951
favorite count: 0
has answer: http://stackoverflow.com/a/28917010

http://stackoverflow.com/q/29002369
has answer: http://stackoverflow.com/a/29002449
has title: Simple javascript counter no frills, just count
upvote count: 1
accepted answer: http://stackoverflow.com/a/29002449
downvote count: 1
type: AnsweredQuestion
tagged with: counter
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: persistence
favorite count: 0
has comment: http://stackoverflow.com/comment/46252093
has body: I have the number 3,453,500 it needs to increase by +1 every 4 seconds. Need to keep the formatting the same (commas in the right place) (also is there a way that this can count continuously without the refreshing to the lowest number on page refresh?)

http://stackoverflow.com/a/29038826
score: 0
answers question: http://stackoverflow.com/q/29037417
has body: You need to attach these variables to your $scope like so: $scope.Nerd.load = function () { $scope.Nerd.editing = false; $scope.Nerd.adding = false; $scope.Nerd.nerd = []; nerdResource.query( function (data) { $scope.Nerd.nerds = data; } ); }; Also, I think you should set $scope.Nerd to an empty object like: $scope.Nerd = {}; instead of setting it to an empty array. You need to use $scope when interacting with the view. This code doesn't look the angular the way it is currently written.
type: Answer
has comment: http://stackoverflow.com/comment/46348188

http://stackoverflow.com/q/29011865
has answer: http://stackoverflow.com/a/29327194
type: UnansweredQuestion
tagged with: selectize.js
has comment: http://stackoverflow.com/comment/82709337
has answer: http://stackoverflow.com/a/33378290
has answer: http://stackoverflow.com/a/47856504
downvote count: 0
has title: Selectize.js: onItemAdd event triggered when silently adding an item
has comment: http://stackoverflow.com/comment/46268714
type: Question
score: 10
tagged with: javascript
tagged with: jquery
has body: Using Selectize.js, I'm trying to initialize the dynamically pre-select one of the item of the list without triggering the onItemAdd event. In the following code, the event is triggered even if the silent parameter is truthy: $(function () { $('select').selectize({ onItemAdd: function () { alert("Add item"); } }); // this triggers an the event $('select')[0].selectize.addItem('2', true); }); JSFiddle: http://jsfiddle.net/zuzat0dc/1/ According to the documentation: addItem(value, silent): "Selects" an item. Adds it to the list at the current caret position. If "silent" is truthy, no change event will be fired on the original input. Any idea how to avoid triggering the onItemAdd event? Is the silent parameter b0rked or should I use the change event instead?
answer count: 3
has comment: http://stackoverflow.com/comment/82676997
upvote count: 10
favorite count: 0

http://stackoverflow.com/comment/46082328
type: Comment
has text: can you paste the code in your angular code? it's relaetd to some dependency mentioned in your module
score: 0
comment on: http://stackoverflow.com/q/28911613
type: QuestionComment

http://stackoverflow.com/q/28977498
has body: I'm trying to smoothly scroll a page using setInterval() and window.scrollBy() I would use jQuery's animate function, but the animation needs to be continuous and loop infinitely (the page contents will be infinite). The idea is fairly simple: var x = 1; var y = 1; setInterval(function() { window.scrollBy(0, x); }, y); How can I increase the scroll speed without making the animation appear jumpy? I'm experience two problems: setInterval() can't take a Y value less than 1 (or probably closer to 30, depending on browser limits) Increasing the value of X causes the animation to be jumpy (due to pixels being skipped altogether) Here's a fiddle to experiment with: http://jsfiddle.net/eoojrqh6/2/ Thanks!
downvote count: 0
has answer: http://stackoverflow.com/a/28978543
favorite count: 0
answer count: 5
tagged with: animation
has title: Smooth Scroll Using window.scrollBy
has comment: http://stackoverflow.com/comment/46207086
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/65145347
accepted answer: http://stackoverflow.com/a/28978543
has answer: http://stackoverflow.com/a/33451146
type: Question
has answer: http://stackoverflow.com/a/69150824
upvote count: 12
possible better answer: http://stackoverflow.com/a/61682020
tagged with: javascript
has answer: http://stackoverflow.com/a/61682020
score: 12

http://stackoverflow.com/q/29028192
has title: how to add numeric value to for loop
has comment: http://stackoverflow.com/comment/46298106
answer count: 0
has comment: http://stackoverflow.com/comment/46297957
type: Question
has comment: http://stackoverflow.com/comment/46298003
has comment: http://stackoverflow.com/comment/46298485
has comment: http://stackoverflow.com/comment/46298090
tagged with: javascript
score: 0
has body: i have pass numeric value to javascript function.i want to check it in for loop.val is amount of checkboxes.in this thime there is two checkboxes.then val is 2 function cal(val, id){ // val =2 var sum = 0; var gn, elem; var l = 1 * val; //l=1*2 var b = parseInt(l) + 1; // b=2+1 for (i = 1; i &lt; b; i++) { //this is not working.but b to replace 3,it's working alert(i); gn = 'testw' + i; //checkboxes ids elem = document.getElementById(gn); if (elem.checked == true) { sum += Number(elem.value); //calculate checkboxes values } } document.getElementById("rp").value = sum.toFixed(2); // display total in textfield }
type: UnansweredQuestion

http://stackoverflow.com/q/29053247
upvote count: 15
has comment: http://stackoverflow.com/comment/46412232
downvote count: 0
has comment: http://stackoverflow.com/comment/46344167
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/40869830
answer count: 3
has title: step back to previous line in script with devtools debugger
has comment: http://stackoverflow.com/comment/46344186
linked to: http://stackoverflow.com/q/17498159
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/66074412
has answer: http://stackoverflow.com/a/38417072
has body: I am working with devtools debugger provided by google chrome. In terms of execution control, it allows you to add breakpoints anywhere in script and even allows you to attach breakpoints to events. You can step line by line in a script. You can step over functions to remain in the same function or step into functions. And when you go into functions, you can step out of the function to go back to the caller. One problem I have is sometimes when I step over a function call, I want to go back to it, in order to step into that function call. I read over https://developer.chrome.com/devtools/docs/javascript-debugging and I cannot find a way to do this. Am I overlooking anything or is there a way to "step back"?
score: 15
type: Question

http://stackoverflow.com/q/29039387
accepted answer: http://stackoverflow.com/a/29039947
has title: How do I split Angular UI Bootstrap accordions into multiple columns?
linked to: http://stackoverflow.com/q/21644493
tagged with: angularjs
upvote count: 3
has body: I am trying to split accordion directives into multiple columns. This is what I have so far: &lt;accordion&gt; &lt;accordion-group ng-repeat="d in dimensions" heading="{{d.name}}"&gt; {{d.description}} &lt;/accordion-group&gt; &lt;/accordion&gt; Right now, it displays the accordions in a line straight down the page, like so: Acc1 Acc2 Acc3 Acc4 Acc5 Acc6 I would like it to be split up like so into N columns (3 in this case): Acc1 Acc2 Acc3 Acc4 Acc5 Acc6 Right now I am looking at a filter approach, but I am curious if there is a better way. The controller logic right now is essentially limited to populating $scope.dimensions. Here is a plunker showing the basics
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29039947
type: Question
has comment: http://stackoverflow.com/comment/46319824
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: angular-ui-bootstrap
favorite count: 0
tagged with: accordion

http://stackoverflow.com/a/29006917
score: 2
has comment: http://stackoverflow.com/comment/46260376
has comment: http://stackoverflow.com/comment/46260425
has comment: http://stackoverflow.com/comment/46259849
has comment: http://stackoverflow.com/comment/46260483
has comment: http://stackoverflow.com/comment/46261236
has comment: http://stackoverflow.com/comment/46259971
upvote count: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46260271
has comment: http://stackoverflow.com/comment/46260096
answers question: http://stackoverflow.com/q/29006667
has comment: http://stackoverflow.com/comment/46260342
has comment: http://stackoverflow.com/comment/46260200
has comment: http://stackoverflow.com/comment/46260135
has body: @Rias has the answer above, but, you could also do the following. $("#number").bind('keyup change click', function() { //Check only if the text box is not empty if ( $.trim($(this).val()) != "") { if ($(this).val().match(/^\d+$/)) { } else { alert("Not a number"); } } }); Demo@Fiddle Update: In case you wanted to remove any the non-number characters, try the following. $("#number").bind('keyup change click', function() { if ( $.trim($(this).val()) != "") { if ($(this).val().match(/^\d+$/)) { } else { alert("Not a number"); $(this).val( $(this).val().replace(/[^0-9]+/gi, "") ); } } });
accepted answer of: http://stackoverflow.com/q/29006667
has comment: http://stackoverflow.com/comment/46260015
type: Answer
has comment: http://stackoverflow.com/comment/46261207
has comment: http://stackoverflow.com/comment/46261157
has comment: http://stackoverflow.com/comment/46261286

http://stackoverflow.com/q/28960141
favorite count: 0
has body: I have number of rows in a table fetched from database. I need to display output of each row beside dat table only. output data also fetching from database. Example: If i click first row means i want detail information about that row next to that table. PHP Code: First Table(Displaying Data) $query = "select * from orders_list"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); if($num_rows >= 1) { echo " "; echo " Select order_id customer_name no_of_pack price Weight payment mode "; while($row = mysql_fetch_array($result)) { $order_id = $row['order_id']; echo " ".$row['order_id']." ".$row['customer_name']." ".$row['number_of_pack']." ".$row['price']." ".$row['weight']." ".$row['payment']." "; echo " "; } echo " "; echo " "; } code for output to display in same page: $_SESSION['order_id'] = $order_id; echo $_SESSION['order_id']; $query = "select * from orders_details where order_id=$order_id"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); if($num_rows >= 1) { echo " "; echo " Product Quantity Sku Price Total "; while($row = mysql_fetch_array($result)) { echo " ".$row['product']." ".$row['quantity']." ".$row['sku']." ".$row['price']." ".$row['total']." "; echo " "; } echo " "; echo " "; } Pls help me out..
has title: Need to display input and output in one page of php?
has comment: http://stackoverflow.com/comment/46172689
has answer: http://stackoverflow.com/a/28962369
accepted answer: http://stackoverflow.com/a/28961448
possible better answer: http://stackoverflow.com/a/28962369
upvote count: 1
tagged with: php
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46172751
has comment: http://stackoverflow.com/comment/46172746
has comment: http://stackoverflow.com/comment/46173122
type: Question
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46173324
has answer: http://stackoverflow.com/a/28961448
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46172900

http://stackoverflow.com/q/28946307
tagged with: javascript
has comment: http://stackoverflow.com/comment/46147171
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46148766
favorite count: 0
has comment: http://stackoverflow.com/comment/46148037
tagged with: drag-and-drop
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/58158139
has comment: http://stackoverflow.com/comment/46148195
score: 2
has title: Drag And Drop problems in Firefox with labels
answer count: 0
downvote count: 0
type: Question
has body: I have the following markup content.... × I need to drag and drop such elements. The implementation of D'n'D that I uses works correct in Chrome, but in FF the drag events don't fire. After a few hours I have figured out that the reason in the mark up, particular in the label. Labels bind with the checkboxes and instead of doing drag and drop they try to check the checkbox. If I try to drag text in label it the element drags, but if I try to drag outside the text in the label it won't work. This works in FF content.... × http://jsfiddle.net/hhyaw53t/ Shorted version. It doesn't replace the elements but shows the pseudo-dragged element http://jsfiddle.net/ut1pyf3x/
tagged with: firefox

http://stackoverflow.com/q/28951681
linked to: http://stackoverflow.com/q/28868108
has answer: http://stackoverflow.com/a/29105496
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46158246
tagged with: dust.js
type: Question
has comment: http://stackoverflow.com/comment/46158550
tagged with: javascript
score: 0
has title: How to switch context in a dust.js helper
answer count: 1
has body: I have a model that gets sent to dust in the form of: { "name": "Build Name", "date": "03/09/2015", "modules": [ { "name": "Cyber Strength", "module_group": "Standard", "module_type": "Training Modules" }, { "name": "Phil", "module_group": "Games", "module_type": "Training Modules" }, ... ] } I'd like to be able to make a dust helper function in the form of.... {@getModules module_group="Standard" module_type="Training Modules"} &lt;li&gt;{name}&lt;/li&gt; {/getModules} I can't simply iterate through the modules doing {#modules}{/modules} becuase I want to only show modules that match my criteria (module_group and module_type). Can anyone help me come up with a helper function that can switch to the correct context of modules where {name} will print the module name and not the build name?

http://stackoverflow.com/q/29017039
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29105685
tagged with: regex
has comment: http://stackoverflow.com/comment/46286983
tagged with: node.js
has comment: http://stackoverflow.com/comment/46281840
has comment: http://stackoverflow.com/comment/46291376
downvote count: 2
has comment: http://stackoverflow.com/comment/46278418
type: Question
score: -2
has comment: http://stackoverflow.com/comment/46286462
has comment: http://stackoverflow.com/comment/46287702
has title: How to know if a found word is part of a string or is a function call in JavaScript
tagged with: javascript
has body: Sorry! I couldn't think about a better title to my question My problem is this: I've a javascript ... script, read from a data base. Now, this script have al sorts of ifs, whiles, function calls etc. Before executing the script, I want to replace some specific function names, so I need to do a replace in the script looking for that word. My problem is that when that word IS NOT an intended function call, but a text contained in a wider string, it is replaced nonetheless. Let me give an example to be more clear: var actualFunction = function(){ return 1; } console.log(myfunction); var s = "I was talking about myfunction with my colleagues..."; In this example, I want to replace "myfunction" when used as a function (or object), but don't replace "myfunction" when it is inside another string. The desired result will be this: var actualFunction = function(){ return 1; } console.log(actualFunction); var s = "I was talking about myfunction with my colleagues..."; So I only want to replace "console.log(myfunction);" with "console.log(actualFunction", and leave alone the text inside the "s" variable. The find method will find two occurences of "myfunction", but it must recognize that the second occurence is inside a longer string, and leave it alone. I hope that I made myself clear :) and thanks for your help!
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46278838

http://stackoverflow.com/a/28923953
downvote count: 0
score: 1
has body: $(function(){ $defaultValue=$('#total').val(); $("input[type=checkbox]").click(function(event) { var total = 0; $("input:checked").each(function() { total += parseInt($(this).parent().find('.inv-total').text().substring(1)); }); if (total == 0) { $('#total').val($defaultValue); } else { $('#total').val('$' + total); } }); }) $100
answers question: http://stackoverflow.com/q/28923816
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28923816
type: Answer

http://stackoverflow.com/comment/46247082
has text: Just tried moving the route to app.js, still get a 404. I originally had the route in a separate drink.js file, and tried sticking it into index to solve the problem, so that wasn't it.
type: Comment
comment on: http://stackoverflow.com/q/28999365
score: 0
type: QuestionComment

http://stackoverflow.com/a/28986228
has body: Hover the mouse pointer over this paragraph. Try this . On hover img is displaying .
downvote count: 0
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28986045
upvote count: 2
has comment: http://stackoverflow.com/comment/46221007

http://stackoverflow.com/comment/46188761
type: QuestionComment
type: Comment
has text: yes that's what i am looking for, the url is changing everytime I refresh so I want the script to catch that url.
score: 0
comment on: http://stackoverflow.com/q/28968436

http://stackoverflow.com/q/28947344
tagged with: javascript
has answer: http://stackoverflow.com/a/28947486
type: AnsweredQuestion
has title: When adding AMD support to a library, should it also list its dependencies in define()
type: Question
tagged with: requirejs
accepted answer: http://stackoverflow.com/a/28947486
score: 0
tagged with: amd
answer count: 1
has body: I am looking to add AMD support to a library although don't fully understand it. I have the following code that adds AMD support: if (typeof define === "function" &amp;&amp; define.amd) { define(["imagesloaded", "hammer"], defineSequence); } else { sequence = defineSequence(imagesLoaded, Hammer); } The library depends on third-party libraries imagesLoaded and Hammer. I have listed them as dependencies in define() but I am concerned as to whether this limits a developer who uses my plugin to a specific file structure and naming convention whereby imagesloaded, hammer, and sequence all have to exist at the same directory level. Is the above code correctly enabling AMD support and is this restriction to be expected? Update: An example of my paths config as explained in the correct answer: require.config({ baseUrl: 'scripts', paths: { imagesLoaded: 'imagesloaded.pkgd.min', Hammer: 'hammer.min' } });

http://stackoverflow.com/comment/46170230
has text: so u mean toggle() is only for hiding and showing elements ??
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28958740
type: Comment

http://stackoverflow.com/q/28946190
has comment: http://stackoverflow.com/comment/46147743
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28948591
favorite count: 0
has comment: http://stackoverflow.com/comment/46146838
has comment: http://stackoverflow.com/comment/46147005
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/46146866
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28946493
downvote count: 1
has title: How to combine two images diagonally using CSS/JavaScript?
has answer: http://stackoverflow.com/a/28947124
has body: Is it possible to make this with CSS and maybe JavaScript if necessary? I want content inside that triangle div (image1/2.jpg) to be 2 different divs since I want to make them into links to 2 different pages.
score: 1
has comment: http://stackoverflow.com/comment/46147495
type: Question

http://stackoverflow.com/a/28954755
answers question: http://stackoverflow.com/q/28953841
has body: If you want to reload just the div, you can use innerHTML. document.getElementById(target).innerHTML = '&lt;img src="image.jpg"&gt;';
type: Answer
has comment: http://stackoverflow.com/comment/46189964
score: 0

http://stackoverflow.com/q/29008231
has body: I have used Slide up/down effect with ng-show and ng-animate as a base for my issue. However, the directive only allow for one element to be hidden/displayed. When there are 2, only the first shows: Here's a plunker: http://plnkr.co/edit/YtPgcUcnapiQfAR5hxiE?p=preview If you click on Link 2, it'll show the first content. angular.module('app', []) .directive('sliderToggle', function() { return { restrict: 'AE', link: function(scope, element, attrs) { var target = element.parent()[0].querySelector('[slider]'); attrs.expanded = false; element.bind('click', function() { var content = target.querySelector('.slideable_content'); if(!attrs.expanded) { content.style.border = '1px solid rgba(0,0,0,0)'; var y = content.clientHeight; content.style.border = 0; target.style.height = y + 'px'; } else { target.style.height = '0px'; } attrs.expanded = !attrs.expanded; }); } } }) .directive('slider', function () { return { restrict:'A', compile: function (element, attr) { // wrap tag var contents = element.html(); element.html('&lt;div class="slideable_content" style="margin:0 !important; padding:0 !important" &gt;' + contents + '&lt;/div&gt;'); return function postLink(scope, element, attrs) { // default properties attrs.duration = (!attrs.duration) ? '1s' : attrs.duration; attrs.easing = (!attrs.easing) ? 'ease-in-out' : attrs.easing; element.css({ 'overflow': 'hidden', 'height': '0px', 'transitionProperty': 'height', 'transitionDuration': attrs.duration, 'transitionTimingFunction': attrs.easing }); }; } }; });
possible better answer: http://stackoverflow.com/a/29008565
tagged with: ng-show
tagged with: ng-hide
has answer: http://stackoverflow.com/a/29008565
accepted answer: http://stackoverflow.com/a/29008474
type: AnsweredQuestion
type: Question
tagged with: angularjs-directive
has title: Angularjs Directive to slide show and hide content
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46262312
answer count: 2
has answer: http://stackoverflow.com/a/29008474
linked to: http://stackoverflow.com/q/16677304
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46262693

http://stackoverflow.com/comment/46375476
score: 0
comment on: http://stackoverflow.com/a/29029472
type: AnswerComment
type: Comment
has text: nop nop ..... i need to ask a thing ...... at your link code the controller part of your code ..... where should i write that ..... in which file .... ???

http://stackoverflow.com/comment/46124185
score: 0
type: Comment
type: QuestionComment
has text: Hi Thanks for quick reply, what is the logic?, can you get me 25% of the #00B0F0; (rgb 0, 176, 240)?
comment on: http://stackoverflow.com/q/28932836

http://stackoverflow.com/q/28948931
type: Question
has comment: http://stackoverflow.com/comment/65250712
upvote count: 6
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/34882641
tagged with: parse-platform
type: UnansweredQuestion
tagged with: facebook
has title: You must initialize FacebookUtils before calling logIn
score: 6
has comment: http://stackoverflow.com/comment/62142878
has body: I have attempted to integrate Facebook with Parse. I have followed the following guide, https://parse.com/docs/js_guide#fbusers but is still experiencing issues. In a nutshell, there is a login button with facebook. When the user is non-existant it redirect the user to the signup page, and when its an existing user it redirects them to the city page of their selection in the account creation page. If user cancels the signup process, upon login, it takes the existing user to the account signup page. However, the facebook screen only appears when the user is non existant and haven't finalize the signup process. Below are the warnings I get when attempting to login: On Console Warnings/Errors The 'status' flag passed into FB.init, when set to true, can interfere with Parse Facebook integration, so it has been suppressed. Please call FB.getLoginStatus() explicitly if you require this behavior. FB.init has already been called - this could indicate a problem sdk.js:61 Setting authResponse is not supported You must initialize FacebookUtils before calling logIn. FB.login() called when user is already connected. Below is the Javascript code: // Initialize Parse Parse.initialize("ID", "ID"); window.fbAsyncInit = function() { Parse.FacebookUtils.init({ // this line replaces FB.init({ appId : '433936150095453', // Facebook App ID status : true, // check Facebook Login status cookie : true, xfbml : true, // initialize Facebook social plugins on the page version : 'v2.2' // point to the latest Facebook Graph API version }); // Run code after the Facebook SDK is loaded. }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); function fbLogin(){ Parse.FacebookUtils.logIn(null, { success: function(user) { if (!user.existed()) { window.open("accountCreate.html", "_self"); } …
downvote count: 0
has comment: http://stackoverflow.com/comment/50233536

http://stackoverflow.com/comment/46145842
score: 0
type: Comment
type: QuestionComment
has text: What's the actual name of your module directory? Is it `modules/filters/filters.js`? So does the directory name match the file name?
comment on: http://stackoverflow.com/q/28945212

http://stackoverflow.com/comment/58532870
type: Comment
score: 2
comment on: http://stackoverflow.com/a/34761061
type: AnswerComment
has text: This is not necessarily "better". In a real-world project, your exclude list would grow enormously (i.e. I regularly have to exclude `node_modules`, `dist`, `bower_components`, `typings` etc.). I am desperately waiting for `filesGlob` to land in core TS.

http://stackoverflow.com/a/28921961
answers question: http://stackoverflow.com/q/28921322
score: 0
type: Answer
has body: The solution to this is a slight alteration to Xufox's solution &lt;script type="text/javascript"&gt;$(document).ready(function () { if(window.location.href.indexOf("mc=") &gt; -1) { location.href = location.href.replace('mc=', 'MediaCode=') }}); Many thanks to Xufox

http://stackoverflow.com/q/28980796
accepted answer: http://stackoverflow.com/a/28980840
has answer: http://stackoverflow.com/a/32222081
tagged with: javascript
has answer: http://stackoverflow.com/a/28980840
has title: How does this JavaScript hack work?
answer count: 2
downvote count: 0
favorite count: 0
has body: I've encountered a strange hack of a website that doesn't belong to me, and I'm trying to help the web admin out by identifying the source of the issue. Here's the diagnosis: Google flags the website with a "This website may be hacked" notice. When following the link from Google, you are redirected to a different, completely unrelated page. If I cancel the page load before redirection and then view the source html, I see that there is a little JavaScript snippet inserted at the very beginning of the document, which apparently is causing the redirection. Now here's the strange bit: The malicious JavaScript only appears when navigating to the page from certain search engines like Google or Bing. If you go to the page directly, nothing is wrong, and even if I go to this page from another search engine like DuckDuckGo, nothing is wrong. The malicious script itself reads &lt;script type="text/javascript" src="http://www.enternote.fr/superfly.js"&gt;&lt;/script&gt;. Here is what is at the src link: (with additional tabs and line breaks to make it easier to look at, hopefully) eval( function(p,a,c,k,e,r){ e=function(c){ return c.toString(a) }; if(!''.replace(/^/,String)){ while(c--) r[e(c)]=k[c]||e(c); k=[function(e){return r[e]}]; e=function(){return'\\w+'}; c=1 }; while(c--) if(k[c]) p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]); return p }('4 1=5.6;7(1.2("8")&gt;0||1.2("9")&gt;0||1.2("a")&gt;0||1.2("b")&gt;0){d.e.f=\'g://h.i.j/3-k-3-l-m-n-c-o.p\'}', 26, 26, '|s|indexOf|nike|var|document|referrer|if|google|bing|yahoo|aol||window|location|href|http|www|soccerxp|com|shoes|mercurial|superfly|fg|1_176|html'.split('|'), 0, {}) ) I haven't analyzed this in detail, but from the document|referrer|if|google|bing|yahoo|aol||window|location|href... part it seems obvious that this is doing the redirection, and moreover the fact that the redirection only occurs for search traffic is a deliberate act on behalf of the hacker. However, I'm not sure why the script only appears in th…
possible better answer: http://stackoverflow.com/a/32222081
tagged with: http-redirect
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/comment/46315490
type: Comment
has text: possible duplicate of [symfony2 chained selectors](http://stackoverflow.com/questions/10186185/symfony2-chained-selectors)
type: QuestionComment
comment on: http://stackoverflow.com/q/29037184
score: 0

http://stackoverflow.com/q/28943812
has body: I have this javascript code function editRerenderFix() { console.log("edit render start"); textAreaFix(); console.log("edit render middle"); setupDates(); console.log("edit render end"); } /** Function to auto expand out the text area to hold all content **/ function textAreaFix() { jQuery('textarea').on( 'change keyup keydown paste cut', function (event){ jQuery(this).height(100); jQuery('textarea').each(function() { jQuery(this).height(jQuery(this).prop('scrollHeight')); }); }); return null; } /** Function to fix and set the custom date/time picker **/ function setupDates() { jQuery('.dateFormat').remove(); var inputs = jQuery('.inputDate'); jQuery(inputs).each(function() { var input = jQuery(this).val().split('/')[2]; if(input.length &gt; 4) { input = input.split(" ")[0]; } if(input &lt; '2015') { jQuery(this).val(""); } }); console.log("Setup Dates function ran"); jQuery('.inputDate').datetimepicker(); } This function is called using the onComplete ajax method. The problem is that when it runs only textAreaFix() is called. In the console only "edit render start" and "edit render middle" show up. The reason that "Setup Date function ran" first is because I have this function, jQuery(document).ready(function() { jQuery.material.init(); textAreaFix(); setupDates(); tourStep(); easterEgg(); }); How can I get the setupDates() function called? EDIT: I added more debugging to setupDates(), /** Function to fix and set the custom date/time picker **/ function setupDates() { jQuery('.dateFormat').remove(); var inputs = jQuery('.inputDate'); console.log(inputs); jQuery(inputs).each(function() { var input = jQuery(this).val().split('/')[2]; console.log(input); if(input.length &gt; 4) { console.log("Input &gt; 4"); input = input.split(" ")[0]; console.log(input); } if(input &lt; '2015') { console.log("Fix 2015 dates"); jQuery(this).val(""); } }); console.log("Setup Dates function ran"); jQuery('.inputDate').datetimepicker(); } When I run this I get, I am not sure where the "…
has comment: http://stackoverflow.com/comment/46142135
type: Question
has comment: http://stackoverflow.com/comment/46143024
has comment: http://stackoverflow.com/comment/46142083
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46141927
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/46142366
answer count: 1
has comment: http://stackoverflow.com/comment/46141974
has comment: http://stackoverflow.com/comment/46142044
has comment: http://stackoverflow.com/comment/46144404
has comment: http://stackoverflow.com/comment/46142644
has comment: http://stackoverflow.com/comment/46141792
has answer: http://stackoverflow.com/a/28945126
has comment: http://stackoverflow.com/comment/46141774
accepted answer: http://stackoverflow.com/a/28945126
has title: Function never calls the second function
has comment: http://stackoverflow.com/comment/46144269
has comment: http://stackoverflow.com/comment/46142803
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46143971
has comment: http://stackoverflow.com/comment/46142098
has comment: http://stackoverflow.com/comment/46141936

http://stackoverflow.com/comment/46212306
has text: thank you for the clarification on the code, input it just as you have it both in the head and beneath my form and trying to delete the selected file still returns the unlink error.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28980851
score: 0

http://stackoverflow.com/comment/46216614
type: Comment
type: QuestionComment
has text: @Veverke - it sounds like you want more of a community wiki kind of answer - I'm not really familiar with how that is supposed to work - though have occasionally seen it. Some description of it [here](http://meta.stackexchange.com/questions/11740/what-are-community-wiki-posts). Some people who have invested in answers might not appreciate you just copying their content into a new answer though. I'm not sure what you're trying to achieve or what the right way to get there is. I'm more familiar with the question/answer mode. Keep in mind that not everything fits in the framework here too.
comment on: http://stackoverflow.com/q/28967074
score: 0

http://stackoverflow.com/q/29003057
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 2
tagged with: arrays
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29003211
tagged with: lodash
has title: any lodash functions for removing array that is matching from main array
has body: I have two array available, selected which is having some values. I am having another array named finalAvailable in which I want all those from the available array at the same time also to remove those which are present in selected array. An example is shown below var available = ["A", "B", "C", "D", "E"]; var selected = ["B", "C"]; so the finalAvailable array will be like var finalAvailable = ["A", "D", "E"]; I have written a code for achieving this and its working fine, but the problem is since I am using Lo-dash within my project my team lead ask whether there is any function available to achieve this using Lo-dash, I searched but could find anything, I don't know whether I am missing anything. Can anyone tell me whether there is anything similar available in Lodash My code is as given below var available = ["A", "B", "C", "D", "E"]; var selected = ["B", "C"]; var finalAvailable = []; for (var i = 0; i &lt; available.length; i++) { var flag = true; for (var j = 0; j &lt; selected.length; j++) { if (available[i] == selected[j]) { flag = false; } } if (flag) { finalAvailable.push(available[i]) } }
upvote count: 1
accepted answer: http://stackoverflow.com/a/29003211
possible better answer: http://stackoverflow.com/a/46286806
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/46286806
score: 1

http://stackoverflow.com/comment/46345555
type: Comment
comment on: http://stackoverflow.com/q/29052005
type: QuestionComment
score: 1
has text: since you can't manipulate css pseudo elements via javascript you might have to do manually insert and remove styles on events http://pankajparashar.com/posts/modify-pseudo-elements-css/

http://stackoverflow.com/q/28989047
has body: How can i listen every alphabet which typed into input-field dynamically? For example i would like to listen two input-fields same time and after every entry,take the label "body" and add pre and post chars to it and change the "change me"? example : pre-chars+body+post-chars (needs to be dynamically) body change me ! https://jsfiddle.net/x6ozddg6/ thanks !
answer count: 1
favorite count: 0
downvote count: 2
has answer: http://stackoverflow.com/a/28989291
type: AnsweredQuestion
has title: How can i listen an input field for every alphabet
type: Question
has comment: http://stackoverflow.com/comment/46227037
upvote count: 0
score: -2
accepted answer: http://stackoverflow.com/a/28989291
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29057667
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29054508
has comment: http://stackoverflow.com/comment/46357181
answers question: http://stackoverflow.com/q/29054508
has body: Where you get your element values, try changing them to like this: var u = _("username").value ? _("username").value : ''; This uses a Ternary Operator to set the value of u. The syntax is: condition ? result-if-True : result-if-False; Basically, this says, if _("username").value returns a value, assign that value to u, if not, set the value of u to "" (an empty string) Below is a contrived example using regular jQuery method $("#username").val() I imagine it will also work with _("username").value though Im not sure what the benefit of doing _("username").value is having never seen this before myself. var u = $("#username").val() ? $("#username").val() : 'not found'; alert(u); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"&gt;&lt;/script&gt;

http://stackoverflow.com/comment/46152073
type: QuestionComment
comment on: http://stackoverflow.com/q/28918565
has text: What's the `;(function($){` bit about?
score: 0
type: Comment

http://stackoverflow.com/a/29031968
score: 1
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/46448515
answers question: http://stackoverflow.com/q/29030903
has body: Is there an elegant way to do this in Lodash without the use of for loops? Yes, you can use reduce as follows: var array = [1, 2, 3, 4, 5, 3, 4, 6, 3, 7, 4]; var result = _.reduce(array, swapAdjacentInOrder(3, 4), []); alert(JSON.stringify(result)); function swapAdjacentInOrder(a, b) { return function (result, element) { var length = result.length; if (length &gt; 0 &amp;&amp; element === b) { var last = length - 1; if (result[last] === a) { result[last] = b; element = a; } } result[length] = element; return result; }; } &lt;script src="https://rawgit.com/lodash/lodash/master/lodash.min.js"&gt;&lt;/script&gt; However, the swapAdjacentInOrder function also has the following property: var array = [3, 4, 4, 4]; var result = _.reduce(array, swapAdjacentInOrder(3, 4), []); alert(JSON.stringify(result)); // [4, 4, 4, 3] function swapAdjacentInOrder(a, b) { return function (result, element) { var length = result.length; if (length &gt; 0 &amp;&amp; element === b) { var last = length - 1; if (result[last] === a) { result[last] = b; element = a; } } result[length] = element; return result; }; } &lt;script src="https://rawgit.com/lodash/lodash/master/lodash.min.js"&gt;&lt;/script&gt; If you don't want that then you can do the following updated swapAdjacentInOrder function: var array = [3, 4, 4, 4]; var result = _.reduce(array, swapAdjacentInOrder(3, 4), []); alert(JSON.stringify(result)); // [4, 3, 4, 4] function swapAdjacentInOrder(a, b) { return function (result, element) { var length = result.length; if (length &gt; 0 &amp;&amp; element === b) { var last = length - 1; if (result[last] !== a || last &gt; 0 &amp;&amp; result[last - 1] === b); else { result[last] = b; element = a; } } result[length] = element; return result; }; } &lt;script src="https://rawgit.com/lodash/lodash/master/lodash.min.js"&gt;&lt;/script&gt; Hope that helps.
type: Answer

http://stackoverflow.com/comment/46327133
comment on: http://stackoverflow.com/a/29043520
has text: Exactly. Think of it as if you defined the function earlier and now are calling it like `function()`
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28932564
type: Answer
accepted answer of: http://stackoverflow.com/q/28932541
has comment: http://stackoverflow.com/comment/46150533
score: 0
type: AcceptedAnswer
has body: Modify the following lines and it'd look good to me, semi-colonwise. var person1 = prompt("Please name one of your best friends."); return subject[Math.floor(subject.length * Math.random())]; alert("What a plonker!"); The semi-colon is only required in JavaScript when two statements are on the same line, like this: i=0;j++ Therefore, the semi-colon can be happily omitted when statements are separated by a line break, like this: i=0 j++ However, ending each statement with a semi-colon may be considered a more disciplined approach (this way all statements will end the same way) and could help you avoid mysterious bugs later. More information can be found here, here, and here. See also, this SO question.
answers question: http://stackoverflow.com/q/28932541
has comment: http://stackoverflow.com/comment/46151561

http://stackoverflow.com/q/28962478
type: Question
answer count: 2
tagged with: arrays
has answer: http://stackoverflow.com/a/28962619
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28962611
accepted answer: http://stackoverflow.com/a/28962611
has body: I want to use the init() method to initiate objects taken from an associative array by a for..in loop: var person = {name: null, id: null} person.init = function(name){ this.name = name; this.id = "##" + this.name; } var pers1 = Object.create(person); var pers2 = Object.create(person); var personArray = {pers1: "John", pers2: "Alice"}; for (var i in personArray){ console.log(i); console.log(personArray[i]); console.log(i.name); i.init(personArray[i]); } Output: pers1 John undefined // pers1.name TypeError: i.init is not a function //But not pers1.init() ? Why can I call the .name attribute but not the .init() method? And more importantly, is there a way to call the methods of objects in an array? I am a beginner at JS so I'm sorry if the code looks a bit weird.
has comment: http://stackoverflow.com/comment/46176921
tagged with: initialization
tagged with: object
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28962619
has title: Initiate objects from associative array

http://stackoverflow.com/comment/46251639
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28987820
has text: Looking up and reading about output buffers, I've tried numerous examples of starting the buffer and attempting to flush it but cannot seem to get it to work.

http://stackoverflow.com/comment/46267907
type: AnswerComment
comment on: http://stackoverflow.com/a/29011148
type: Comment
has text: @Constantino p.s. whilst completely numeric IDs are permitted in HTML5, they're _not_ permitted in CSS3, so you could never add an ID-specific style to your content like this.
score: 0

http://stackoverflow.com/comment/46272344
score: 0
type: Comment
has text: Thanks. I have read through a lot of mapbox tutorials, but I think reading the more detailed leaflet documentation is probably what I need to do to take things to the next level.
type: AnswerComment
comment on: http://stackoverflow.com/a/29008387

http://stackoverflow.com/comment/46380729
type: AnswerComment
has text: Didn't help. Here is the jsfiddle : http://www.bootply.com/p9Bp7UurpP After the modal is closed, the button remains in focus.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29063109

google-oauth
type: Tag
tags question: http://stackoverflow.com/q/29045985
tag name: google-oauth

http://stackoverflow.com/q/28986710
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29019047
score: 1
tagged with: windows-phone-8
type: Question
tagged with: c#
answer count: 2
has comment: http://stackoverflow.com/comment/46221990
has comment: http://stackoverflow.com/comment/46233248
downvote count: 0
has answer: http://stackoverflow.com/a/29006376
tagged with: javascript
has comment: http://stackoverflow.com/comment/46221956
has comment: http://stackoverflow.com/comment/46230015
has body: I've added a WebView into my project. If I navigate to the html file that contains external javascript files they don't work. Bit if I write the javascript code hardcoded into the html file it works properly. Here is the html portion: hello! this is a simple html block. Here is the javascript portion: document.getElementById("abcd").innerHTML = "New text!"; When I open the webview it shows hello! this is a simple html block., but if the javascript code worked it would show New Test! hello! this is a simple html block. Here is the folder structure:
has comment: http://stackoverflow.com/comment/46222113
favorite count: 0
accepted answer: http://stackoverflow.com/a/29006376
has title: External scripts not working in Windows Phone App 8.1
tagged with: webview
upvote count: 1
possible better answer: http://stackoverflow.com/a/29019047

http://stackoverflow.com/a/29006610
answers question: http://stackoverflow.com/q/29006507
has comment: http://stackoverflow.com/comment/46262029
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/46263575
has comment: http://stackoverflow.com/comment/46259375
has comment: http://stackoverflow.com/comment/46264006
type: Answer
has comment: http://stackoverflow.com/comment/46263343
upvote count: 0
has body: first of all change html like this " "; then use $(document).ready function and add onclick event in jquery .on function like this: $(document).ready(function(){ $(document).on("click",".your_button_class",function() { //your code here }); });
has comment: http://stackoverflow.com/comment/46260649
has comment: http://stackoverflow.com/comment/46259426
has comment: http://stackoverflow.com/comment/46296707
has comment: http://stackoverflow.com/comment/46263674
accepted answer of: http://stackoverflow.com/q/29006507
score: -1
has comment: http://stackoverflow.com/comment/46263880
has comment: http://stackoverflow.com/comment/46293173

http://stackoverflow.com/q/28962160
score: 1
upvote count: 1
type: Question
has title: gridify.js only lays out after the page changes size
has answer: http://stackoverflow.com/a/28963392
accepted answer: http://stackoverflow.com/a/28963392
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has body: Having this issue with gridify - the images only get layed out after I either zoom in or zoom out on the page. This doesn't happen on any of the example pages. This is my code: $(document).ready(function(){ var albumId = "xxxxxxxxxxxxx"; $.ajax({ dataType:"json", url:'http://graph.facebook.com/' + albumId + '?fields=photos.fields%28images,source,picture,link,name%29,photos.limit%2840%29&amp;_=1425840156371', success:function(incomming){ var photos = incomming.photos.data; for (var key in photos){ $("#photos").append("&lt;img src='" + photos[key].source + "' class='image'&gt;"); } }, error:function(err){ console.log("Error collecting photos: " + JSON.stringify(err, null, 2)); } }); }); $(window).load(function() { var options = { items:3, srcNode: 'img', margin: '20px', width: '250px', resizable: true, transition: 'all 0.5s ease' } $('.grid').gridify(options); }); My .grid element starts out as an empty div.
tagged with: css
type: AnsweredQuestion
tagged with: gridify

http://stackoverflow.com/comment/47706351
score: 0
type: Comment
has text: Can you edit the question with this info because it's a part of it :)
comment on: http://stackoverflow.com/a/28966166
type: AnswerComment

http://stackoverflow.com/q/28955368
has title: PHP function is storing random values into database
has answer: http://stackoverflow.com/a/28980877
tagged with: javascript
tagged with: forms
has body: I have been looking the solution for long time that why does my added fields are not stored in database properly and concluded that jquery is not adding html field properly that is why it is not submitted to render php program to add the fields data in database. for proper demonstration please have a look at the code My HTML form code is written as &lt;table id="additional_item_numbers"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Item&lt;/th&gt; &lt;th&gt;&amp;nbsp;Delete&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt;&lt;td&gt;&lt;input type="text" class="form-control form-inps" size="50" name="additional_item_numbers[]" value="123" /&gt;&lt;/td&gt;&lt;td&gt; &lt;a class="delete_item_number" href="javascript:void(0);"&gt;Delete&lt;/a&gt; &lt;/td&gt;&lt;tr&gt; &lt;/tbody&gt; &lt;/table&gt; and jquery function is defined to add a new field in form on ENTER key press &lt;script type="text/javascript" language="javascript"&gt; $("#additional_item_numbers").keyup(function(event){ if(event.keyCode == 13){ $("#additional_item_numbers tbody").append('&lt;tr&gt;&lt;td&gt;&lt;input type="text" class="form-control form-inps" size="40" name="additional_item_numbers[]" value="" /&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;'); //document.getElementById("form-inps").focus(); $("#additional_item_numbers").find("input[type='text']").last().focus(); } }); &lt;/script&gt; This function perfectly add a new field in the html form but upon submission of this form the fields are added into database randomly. sometimes not a single value is added to database and some time random values are added and some time all values are added upon submission. If I check the source code of the page after adding new fields with jquery function. it does not show those newly added fields in source code. I think it is due to client side functionality but it should add all the values to database after submission. but it does not. and if I go to edit an item and add some further additi…
score: 0
has answer: http://stackoverflow.com/a/28965708
tagged with: jquery
has answer: http://stackoverflow.com/a/28955584
accepted answer: http://stackoverflow.com/a/28980877
has answer: http://stackoverflow.com/a/28955747
answer count: 5
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28955492
tagged with: php
has answer: http://stackoverflow.com/a/28955492
type: AnsweredQuestion
type: Question

http://stackoverflow.com/a/28956133
has body: link from file link from source internal script
score: 0
has comment: http://stackoverflow.com/comment/46169235
type: Answer
answers question: http://stackoverflow.com/q/28956082

http://stackoverflow.com/a/28953904
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28920801
has comment: http://stackoverflow.com/comment/46223526
type: Answer
has body: Here is the code to convert address into geocoordinates (lat, lang): <?php $Address = urlencode($Address); $request_url = "http://maps.googleapis.com/maps/api/geocode/xml?address=".$Address."&sensor=true"; $xml = simplexml_load_file($request_url) or die("url not loading"); $status = $xml->status; if ($status=="OK") { $Lat = $xml->result->geometry->location->lat; $Lon = $xml->result->geometry->location->lng; $LatLng = "$Lat,$Lon"; } ?> You can store these Lat Lng in Database with a simple SQL query and then retrieve it back to display on the map. For that you have to display the Map. See the following code to doo that: Google Maps Example Places to check out in Zagreb To get the data from the Database: <?php $server = 'localhost'; $username = 'root'; $password = 'YOUR_PASSWORD'; $database = 'YOUR_DATABASE'; $dsn = "mysql:host=$server;dbname=$database"; Now Create your own file that will return the actual data. <?php require 'config.php'; try { $db = new PDO($dsn, $username, $password); $db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); $sth = $db->query("SELECT * FROM locations"); $locations = $sth->fetchAll(); echo json_encode( $locations ); } catch (Exception $e) { echo $e->getMessage(); } To display locations on the map you have to make AJAX requests: function makeRequest(url, callback) { var request; if (window.XMLHttpRequest) { request = new XMLHttpRequest(); // IE7+, Firefox, Chrome, Opera, Safari } else { request = new ActiveXObject("Microsoft.XMLHTTP"); // IE6, IE5 } request.onreadystatechange = function() { if (request.readyState == 4 && request.status == 200) { callback(request); } } request.open("GET", url, true); request.send(); } Define your init() function which will have the JSON response: var map; // Ban Jelačić Square - City Center var center = new google.maps.LatLng(45.812897, 15.97706); var geocoder = new google.maps.Geocoder(); var infowindow = new google.maps.InfoWindow(); function init() { var mapOptions = { zoom: 13, center: center…
answers question: http://stackoverflow.com/q/28920801

http://stackoverflow.com/comment/46119256
has text: handy - worth putting those settings in your own, answer too!
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28907662

http://stackoverflow.com/a/29051976
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29051820
answers question: http://stackoverflow.com/q/29051820
type: Answer
has body: Couldn't you do this with CSS? body { text-align: center; } .pic { display: inline-block; margin: 25px; border: 1px solid red; position:relative; } .pic img { display: block; opacity: 0.4; transition: opacity 0.5s ease; } .text { opacity: 1; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); transition: opacity 0.5s ease; } .pic:hover img { opacity: 1; } .pic:hover .text { opacity: 0; } text here

http://stackoverflow.com/q/28980686
has comment: http://stackoverflow.com/comment/46214069
type: Question
has body: I have a dropdown list populated with files pulled from a directory using the PHP listed below and am trying to figure out how I can delete them using a delete button in the form when they're selected. EDIT Unlink function error resolved. Still getting error when trying to delete: Error.array(1) { ["Action"]=> string(6) "Delete" } Below is the list of your saved codes. To edit your codes, select it from the list. <?php $directory = $directory = 'users/' . $_SESSION['username']; $filesContents = Array(); $files = scandir( $directory ) ; foreach( $files as $file ) { if ( ! is_dir( $file ) ) { $filesContents[$file] = file_get_contents($directory , $file); echo ' ' . $file . ' '; } } ?> delete php script. <?php session_start(); $directory = $directory = $_SERVER['DOCUMENT_ROOT'] . '/users/' . $_SESSION['username']; $file_to_delete = $_POST['CodeList']; if(is_file($directory .'/'. $file_to_delete) && is_writable($directory .'/'. $file_to_delete)) { if ( unlink ($directory.'/'.$file_to_delete) ) { echo $file_to_delete . " deleted."; } else { echo "Error."; } } ?> <?php var_dump($_POST) ?>
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28980851
has comment: http://stackoverflow.com/comment/46216668
has answer: http://stackoverflow.com/a/28982358
has answer: http://stackoverflow.com/a/28980851
upvote count: 1
tagged with: php
has title: PHP delete error
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46213957
score: 1
accepted answer: http://stackoverflow.com/a/28982358

http://stackoverflow.com/q/28958290
type: AnsweredQuestion
score: 13
type: Question
possible better answer: http://stackoverflow.com/a/28984512
tagged with: javascript
has body: We have recently switched over to React + Flux from Angular to build a rather complex business application. Taking the approach of having one container component that passes all state as properties down the component tree isn't a practical way to develop the app for us as the app makes use of large page-like modals. Enough state does get passed down to the modals for them to load their data into their stores. The problem I have is I need to get some initial state (passed down as props) into the modal component's store. In this post the good guys over at Facebook say it's ok to use props for initial state when synchronization is not the goal. This is how I get the initial state into my store currently: var ABC = React.createClass({ ... getInitialState: function() { return ABCStore.getInitialABCState(this.props.initialA); }, ... var ABCStore = Reflux.createStore({ ... init: function() { _state = { a: null, b: 'B init', c: 'C init' }; }, getInitialABCState: function(initialA) { _state.a = initialA; return _state; }, getABCState: function() { return _state; } ... I am unsure what the best practice is to do this, or whether this is a Flux anti-pattern?
tagged with: reactjs
answer count: 3
accepted answer: http://stackoverflow.com/a/28972390
downvote count: 0
tagged with: refluxjs
has answer: http://stackoverflow.com/a/47241909
tagged with: reactjs-flux
favorite count: 0
has comment: http://stackoverflow.com/comment/46172030
has answer: http://stackoverflow.com/a/28972390
has answer: http://stackoverflow.com/a/28984512
has comment: http://stackoverflow.com/comment/46171209
has title: React + Flux: Getting initial state into a store
upvote count: 13

http://stackoverflow.com/q/28989228
score: 1
has body: I have a webpack project wired with the jshint-loader which is defined like so: postLoaders: [ { test: /\.js$/, exclude: /node_modules/, loader: 'jshint-loader' } ], and when I run webpack-dev-server I get the following warning in all of my files: WARNING in ./js/main.js jshint results in errors Use the function form of "use strict". @ line 1 char 1 "use strict"; I tried using the "strict": false option in my config file under jshint but it did not help. Adding 'use strict' in the files also did not help. The only solution that I found was adding /*jshint globalstrict: true*/ in each js file in my project... Does someone have a solution for it in the global scope? Thanks.
has answer: http://stackoverflow.com/a/29145353
tagged with: jshint
type: Question
has answer: http://stackoverflow.com/a/29902162
tagged with: webpack
downvote count: 0
tagged with: javascript
favorite count: 0
answer count: 4
has answer: http://stackoverflow.com/a/37902709
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28989307
upvote count: 1
tagged with: use-strict
has title: How to get rid of use-strict warning when using webpack and jshint-loader?

http://stackoverflow.com/comment/46227247
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28989301
score: 0
has text: Oh, between **var x** .... **console.log('checking...')** I put some code where I print the last document inside the collection. It's visible on the screen under attached url

http://stackoverflow.com/comment/46206907
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28977937
has text: You should use `.toggle() ` to fix second click, checks some examples [here](http://api.jquery.com/toggle-event/)

http://stackoverflow.com/comment/46258041
has text: @genius : check now... Any specific reason to convert to IST ?? As this will work perectly fine.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28987248

http://stackoverflow.com/comment/46121984
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28932978
has text: I think i cannot reproduce the issue in jsfiddle as my images are in my local filesystem and all my code is in Ajax... is there any other way ?

http://stackoverflow.com/q/28950578
tagged with: d3.js
type: UnansweredQuestion
has body: I am trying to filter to get value by nested data so if my input is ... currently I use the code below to get b from maximum a for each name ( christine, smiths, aaron ) . But I am trying to get value b where a = 2 for each name ( christine, hannah, jeannie) var names = d3.nest() .key(function(d) { return d.name; }) .entries(data); names.forEach(function(n) { n.maxAValue = d3.max(n.values, function(d) { return d.b; }); }); the above works fine, but I was trying to get value where a == 2 with something like this below. Is there a way I could do something like this in javascript ? names.forEach(function(n) { n.values, function(d) { if(d.a == 2) { return d.b; } } }); ======Edit====== data = [ { "name":"apple", "a":1, "b":"jame" }, { "name":"apple", "a":2, "b":"christine" }, { "name":"orange", "a":1, "b":"nick" }, { "name":"orange", "a":2, "b":"hannah" }, { "name":"orange", "a":3, "b":"smiths" }, { "name":"peach ", "a":1, "b":"boo" }, { "name":"peach ", "a":2, "b":"jeannie" }, { "name":"peach ", "a":3, "b":"aaron" } ]
has title: How to filter d3.nested data in javascript - nested function
has comment: http://stackoverflow.com/comment/46155449
type: Question
has comment: http://stackoverflow.com/comment/46155906
tagged with: function
has answer: http://stackoverflow.com/a/28951005
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46155727
answer count: 1
has comment: http://stackoverflow.com/comment/46155211
has comment: http://stackoverflow.com/comment/46155329

http://stackoverflow.com/a/28983952
score: 0
has comment: http://stackoverflow.com/comment/46256794
type: Answer
has comment: http://stackoverflow.com/comment/46236357
has comment: http://stackoverflow.com/comment/46218365
has comment: http://stackoverflow.com/comment/46304272
has comment: http://stackoverflow.com/comment/46293451
has comment: http://stackoverflow.com/comment/46265883
has comment: http://stackoverflow.com/comment/46255393
has comment: http://stackoverflow.com/comment/46236397
answers question: http://stackoverflow.com/q/28983558
has comment: http://stackoverflow.com/comment/46255374
has comment: http://stackoverflow.com/comment/46262077
has comment: http://stackoverflow.com/comment/46220856
has comment: http://stackoverflow.com/comment/46253631
has comment: http://stackoverflow.com/comment/46255167
has comment: http://stackoverflow.com/comment/46223192
has comment: http://stackoverflow.com/comment/46266088
has body: I have edited the code to get the objects to be stored into the bday scope variable var app=angular.module("birthdayToDo",[]); app.controller('main', function($scope){ $scope.screens = [{scrnid: "1"}]; $scope.scrnid = 1; $scope.createScreen = function(){ $scope.screens.push({scrnid: "" + ($scope.screens.length + 1)}); console.log($scope.screens); }; $scope.bdays = []; $scope.newBirthday = function(){ for(i=0;i&lt;$scope.screens.length;i++){ $scope.bdays.push($scope.screens[i]) } console.log($scope.bdays); }; $scope.remove=function(item){ var index=$scope.bdays.indexOf(item) $scope.bdays.splice(index,1); } });
has comment: http://stackoverflow.com/comment/46224442

http://stackoverflow.com/q/28977798
type: UnansweredQuestion
score: 1
has body: This is my form. I have divided it into 3 divs Name Mobile Next Email Password Next City College Branch These are the validations for my code that I have written. I have used validation.min.js plugin for validating the form var validator = $("#signForm").validate({ rules: { user_name: "required", user_email: { required: true, email: true }, mobile: { required: true, digits:true, maxlength:10, minlength:10 }, pass_word: { required: true }, user_city: { required: true }, college: { required: true }, branch: { required: true } }, messages: { user_name: "Please enter name.", user_email: { required: "please enter email", email: "please enter valid email" }, mobile: { required: "please enter mobile number", email: "please enter valid mobile number", maxlength: "mobile number contains 10 digits", minlength: "max 10 digits allowed" }, pass_word: "Please enter password.", user_city: "Please enter user city.", college: "Please enter college.", branch: "Please enter branch." }, submitHandler: function(form) { form.submit(); } }); I am trying to get the code where initially first only the div first-form must be active and the remaining two divs second-form and third-form must be inactive and when the next is clicked in div first-form it must check for the validation of all the input elements in first-form and if all the elements are valid then only the second div i.e, second-form must be active. The same with the second-form, until all the input elements in second-form are valid the third-form must be inactive and must be active only when all the input elements in second-form are valid. When I am trying to search for solution I found http://jsfiddle.net/c2y6r/1/. But in this example the jquery UI tabs are used, instead I do not want to use tabs. How can I do this with divs instead of tabs?
upvote count: 1
type: Question
tagged with: validation
downvote count: 0
has title: how to activate next div only when current div is valid using jquery?
tagged with: javascript
tagged with: jquery
tagged with: jquery-form-validator
answer count: 1
has answer: http://stackoverflow.com/a/28977874
favorite count: 0
tagged with: formvalidation-plugin

http://stackoverflow.com/comment/46294623
has text: as was mentioned in another answer, the data is passed as a parameter to the success function, and an http response object is passed to the failure function.
type: AnswerComment
comment on: http://stackoverflow.com/a/29025941
score: 0
type: Comment

http://stackoverflow.com/q/28977005
upvote count: 5
type: Question
tagged with: testing
score: 5
tagged with: protractor
downvote count: 0
tagged with: javascript
favorite count: 0
has title: protractor cannot locate element with css on ng-click element
has answer: http://stackoverflow.com/a/28977053
tagged with: css-selectors
answer count: 1
tagged with: angularjs
has body: html: × Select None trying to locate with: element(by.css('button[ng-click="select( \'none\', $event );"]')); get error: Failed: No element found using locator: By.cssSelector("button[ng-click=\"select( 'none', $event );\"]") this link provides a solution AngularJS Protractor - Finding an Element on a Page Using Ng-Click Binding but does not have details to the function its referencing. Any help would be appreciated.
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/24807702

http://stackoverflow.com/a/29056258
upvote count: 2
has comment: http://stackoverflow.com/comment/46361882
type: AcceptedAnswer
has body: It is unclear exactly what you're asking but here is my answer to what I understood. Server Side Organization: If you were to create a big project I highly advise you to use a PHP framework ( symphony, codeigniter, etc ), now if you're not then consider the following: 1. Follow MVC structure The MVC structure can be represented multiple different ways. However, keeping it simple, you can do this by creating 3 folders ( controller, model, view ). Each folder will consist of different php files with a specific job. Controller: A controller is the link between a user and the system. It provides the user with input by arranging for relevant views to present themselves in appropriate places on the screen. It provides means for user output by presenting the user with menus or other means of giving commands and data. The controller receives such user output, translates it into the appropriate messages and pass these messages on to one or more of the views. Think of a controller as the police. Checks to see if the client request is legit ( especially when it comes to form validation ). When a controller validates the request it calls upon a model (optional: depending if you need to get/set information and work with a database ) and then a view. Model: Models represent knowledge. A model could be a single object (rather uninteresting), or it could be some structure of objects. There should be a one-to-one correspondence between the model and its parts on the one hand, and the represented world as perceived by the owner of the model on the other hand. View: A view is a (visual) representation of its model. It would ordinarily highlight certain attributes of the model and suppress others. It is thus acting as a presentation filter. A view is attached to its model (or model part) and gets the data necessary for the presentation from the model by asking questions. It may also update the model by sending appropriate messages. All these questions and messages have to be in the ter…
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29055824
score: 2
answers question: http://stackoverflow.com/q/29055824
has comment: http://stackoverflow.com/comment/46378881

http://stackoverflow.com/comment/46310746
has text: *"After adding newDiv to DOM...I need to add style and child elements..."* Why not add them *before* appending it to the DOM? *"Can I use `style.cssText` property..."* Why would you use it *at all*? Use the `style` object's specific style properties, before appending to the DOM.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29034951

http://stackoverflow.com/q/29056370
type: Question
has answer: http://stackoverflow.com/a/29056591
tagged with: javascript
tagged with: inheritance
tagged with: canvas
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I was really struggling coming up with a title but basically I'm working on a game in the html5 canvas and have a class called player with a subclass aiPlayer for when playing against ai. The code for updating the players looks like this: var entitiesCount = this.entities.length; for (var i = 0; i &lt; entitiesCount; i++) { var entity = this.entities[i]; entity.update(); if (entity instanceof special &amp;&amp; entity.x &gt; WIDTH || entity.x + 200 &lt; 0) { this.entities.splice(i, 1); entitiesCount--; } } However, the aiPlayer never updates with the aiPlayer update function. I've printed out the constructor of each entity and there is one Player and one aiPlayer. However, when printing out the method they are calling, both of them are calling the Player update. Does anyone know why it would do this? Also, if it helps, the aiPlayer update looks like: aiPlayer.prototype.update = function() { if((this.game.timer.gameTime % this.moveTime) &gt; (this.moveTime * 0.9)) { this.chooseMove(); } Player.prototype.update.call(this); }; And ai constructor looks like: function aiPlayer (game, character, x, y, health) { Player.call(this, game, character, x, y, health, PLAYER2_CONTROLS, "left"); aiPlayer.prototype = new Player(this.game, this.character, this.x, this.y, this.health, this.control, this.facing); aiPlayer.prototype.constructor = aiPlayer; this.controls = PLAYER2_CONTROLS; this.attackLength = 50; this.fleeLength = 70; this.moveTime = 1; this.prevControl = "idle"; }
score: 1
has title: superclass function being called when subclass function is invoked
upvote count: 1

http://stackoverflow.com/a/63936254
score: 0
has body: Please check below example for Recursive Promise in javascript/typescript, It will not resolve the promise until number incremented to greater then 13. below code is suitable for typescript and modify it slightly for javascript. async iterate(number: number): Promise&lt;any&gt; { return new Promise((resolve, reject) =&gt; { let number = 0; if (number &gt; 13) { // recursive terminate condition resolve(number); return; } else { number = number + 1; // recursive call this.iterate(number).then(resolve); } }); } this.iterate().then((resolvedData: any) =&gt; { // wait until number is not greater than 13 console.log(resolvedData); });
type: Answer
answers question: http://stackoverflow.com/q/29020722

http://stackoverflow.com/comment/46078232
type: QuestionComment
has text: Presorting actually makes *more* sense if it's large. Otherwise the array is sorted on every digest, I believe
score: 0
comment on: http://stackoverflow.com/q/28909192
type: Comment

http://stackoverflow.com/a/29047834
has body: This is very common problem with ajax and modal windows.. on clicking next button you have to reset the form and load it new. for eg: If you are using form with id "myForm" then on clicking another button reset the form like $("#myForm").trigger('reset'); in jQuery. or any other way
has comment: http://stackoverflow.com/comment/46334334
has comment: http://stackoverflow.com/comment/46334642
score: 0
answers question: http://stackoverflow.com/q/29047318
type: Answer
has comment: http://stackoverflow.com/comment/46334452

http://stackoverflow.com/comment/46268042
has text: Ah -- sorry for not clarifying that! The "sync" event is fired whenever the Collection is synchronized with the server. That will happen whenever the `fetch()` completes asynchronously, so you do have to call fetch explicitly. If this answer is good enough, please consider accepting it. Have fun!
comment on: http://stackoverflow.com/a/28999721
type: Comment
score: 0
type: AnswerComment

firefox-addon
tags question: http://stackoverflow.com/q/29003125
tags question: http://stackoverflow.com/q/28953220
tags question: http://stackoverflow.com/q/29048163
type: Tag
tags question: http://stackoverflow.com/q/29037807
tags question: http://stackoverflow.com/q/29010258
tags question: http://stackoverflow.com/q/28985573
tag name: firefox-addon
tags question: http://stackoverflow.com/q/29016485
tags question: http://stackoverflow.com/q/29015027

http://stackoverflow.com/q/29030944
has comment: http://stackoverflow.com/comment/46303015
has body: I got this situation, this is my HTML page so far: DATI Campo A Campo B On button click I need to send to another html page the content (value) of those two text input. I took a look to many solutions that i found online, but I'm very new to this and i can't accomplish my task. Can anyone provide me whit the right, step-by-step code in javascript/jquery? Thanks in advance
tagged with: get
upvote count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29031191
has comment: http://stackoverflow.com/comment/46302971
has comment: http://stackoverflow.com/comment/46303353
linked to: http://stackoverflow.com/q/28237695
answer count: 4
has title: Send contents of fields in a form whit POST method jquery
downvote count: 0
has answer: http://stackoverflow.com/a/29031108
has comment: http://stackoverflow.com/comment/46302959
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/46303233
has comment: http://stackoverflow.com/comment/46302992
has comment: http://stackoverflow.com/comment/46304111
type: Question
has answer: http://stackoverflow.com/a/29031634
has answer: http://stackoverflow.com/a/29031244
has comment: http://stackoverflow.com/comment/46303156
tagged with: javascript

http://stackoverflow.com/comment/46087655
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28914741
has text: This will return Fairfield CT: http://promos.fling.com/geo/txt/location.php?testip=3.255.255.255 - What are you trying to achieve?

http://stackoverflow.com/comment/46335241
type: AnswerComment
comment on: http://stackoverflow.com/a/29048456
type: Comment
has text: this is why i need to set answer to true or false on .done and only then proceed
score: 0

http://stackoverflow.com/comment/46196101
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28954777
type: Comment
has text: @nicholas79171 that's cause you show multiple stuff on screen, meaning the script above is not perfect at all, it just looks for the one element match. You need to take in account all the visible elements and find the most-bottom one. You got the idea.

http://stackoverflow.com/q/29055046
type: UnansweredQuestion
score: 5
tagged with: mutation-observers
upvote count: 5
has comment: http://stackoverflow.com/comment/46350009
has comment: http://stackoverflow.com/comment/46348076
tagged with: dom
type: Question
has comment: http://stackoverflow.com/comment/46347965
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46348027
has comment: http://stackoverflow.com/comment/46350949
has body: So, say I'm looping through the DOM and hiding all &lt;img&gt; elements on a page that contain a specific ID/Class string e.g. var strings = ['[id*="example"]','[class*="example"]']; ... var MyObject = { "getAll": Array.prototype.slice.call(document.querySelectorAll(strings.join())), ... On pages like Facebook, content is loaded dynamically, so new images aren't automatically hidden. I'm trying to use a MutationObserver to check when there are any new elements that match this array, but there is a problem. var observe = new MutationObserver(function(mutations){ mutations.forEach(function(mutation) { // hide all these newly found imgs somehow }); }); var config = { attributes: true, childList: true, characterData: true }; observe.observe(MyObject.getAll, config); observe.disconnect(); For some reason, I receive the error: notfounderror: failed to execute 'observe' on 'mutationobserver': the provided node was null. Even though MyObject.getAll is an array with loads of nodes inside? Basically, I want to check if any newly loaded/visible element matches my documentSelectorAll('[id*="example"],[class*="example"]') array via MutationObserver and then I can take the appropriate action by hiding it etc.
favorite count: 0
answer count: 0
has title: MutationObserver on array of elements?

http://stackoverflow.com/comment/46261208
comment on: http://stackoverflow.com/a/29006840
has text: As VMAtm said, that won't work. Add it to the datePicker control itself and not the block element. Then utilise your On_Click event.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28987359
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46228619
type: Answer
accepted answer of: http://stackoverflow.com/q/28986594
answers question: http://stackoverflow.com/q/28986594
has body: You are not passing the name of your POST variable (ie file_name) to the page. Try changing that line to: $.post('/accounts/download/', {file_name: $(this).attr('id')}); It is also a good idea to use quotation marks for the id attributes: &lt;p id="{{ file.filename }}" class="file"&gt;{{ file.filename }}&lt;/p&gt; Then you can simply access the file_name using the request.POST dictionary. You don't have to instantiate a Django form: @csrf_exempt def download(request): ... print request.POST.get('file_name') ...
score: 0

http://stackoverflow.com/comment/46141792
has text: No errors at all. The function is just never called. I snipped the console. The first Setup Dates function is on page load and the edit render start is when I clicked the button that calls the ajax method.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28943812
type: QuestionComment

http://stackoverflow.com/comment/46344696
has text: Got it. I really appreciate your help.
type: AnswerComment
comment on: http://stackoverflow.com/a/29035836
score: 0
type: Comment

http://stackoverflow.com/comment/46260928
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29007716
type: Comment
has text: I like to use a 1px semi transparent png as the fallback

http://stackoverflow.com/comment/46585610
type: QuestionComment
comment on: http://stackoverflow.com/q/29061488
has text: it's already there, HTML + Javascript
score: 0
type: Comment

http://stackoverflow.com/a/28941770
answers question: http://stackoverflow.com/q/28925198
upvote count: 1
has comment: http://stackoverflow.com/comment/46214121
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46214248
type: Answer
has comment: http://stackoverflow.com/comment/46213973
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46296680
has comment: http://stackoverflow.com/comment/46214211
has body: Two date pickers Open at a time in angularjs in your code you have user same method to open date picker popup live code is here:http://jsfiddle.net/RLQhh/974/ $scope.open1 = function($event) { $event.preventDefault(); $event.stopPropagation(); $scope.opened1 = true; $scope.opened2 = false; }; $scope.open2 = function($event) { $event.preventDefault(); $event.stopPropagation(); $scope.opened1 = false; $scope.opened2 = true; };
accepted answer of: http://stackoverflow.com/q/28925198
has comment: http://stackoverflow.com/comment/46215792

http://stackoverflow.com/q/29061784
type: AnsweredQuestion
has body: I need help with my email order form. When someone selects the "Self-Collection" option, it will make the date and time selection active for the user. And I want to make the date and time selection a required field. How can I do it? And also please visit the link here. After adding the code below, the email cannot be sent. Delivery Methods... Register Mail Normal Mail Self-Collection QVOO Delivery (+$8) **WE will re-confirm your self collection date once your order arrives Self Collection Date... Monday After 7pm Wednesday After 7pm Friday After 7pm Saturday Day 9am-2pm Sunday 9am-2pm $(document).ready(function () { $("#select").change(function () { if ($(this).find("option:selected").val() == "Self-Collection") { $("#Self-Collection").removeAttr("disabled") } else { $("#Self-Collection").attr("disabled","disabled") } }); });
accepted answer: http://stackoverflow.com/a/29062660
type: Question
has title: activate a textbox on selecting other option from dropdown list
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29062660
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/a/28912012
score: 0
answers question: http://stackoverflow.com/q/28911928
type: Answer
has body: In your case: var doAnimate = $.support.transition &amp;&amp; animate; Only if $.support.transition truthy it will evaluate animate and assign animate to doAnimate. If $.support.transition is falsy. Then it will return value of $.support.transition. If both the values are truthy then it will take animate only. But what you really want is: var doAnimate = $.support.transition || animate; It checks for truthiness from left to right. If it comes across any first truthy value, it will store that to doAnimate.

http://stackoverflow.com/a/28954845
accepted answer of: http://stackoverflow.com/q/28951171
answers question: http://stackoverflow.com/q/28951171
upvote count: 5
has body: Just add in a search box above your tree: &lt;input id="plugins4_q" type="text" placeholder="search"&gt; Note that you'll also need to monitor the search box for text entry and pass the data to the jstree search function. Example javascript: var to = false; $('#plugins4_q').keyup(function () { if(to) { clearTimeout(to); } to = setTimeout(function () { var v = $('#plugins4_q').val(); $('#plugins4').jstree('search', v); }, 250); });
downvote count: 0
score: 5
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28927640
type: Question
has answer: http://stackoverflow.com/a/63501874
upvote count: 16
answer count: 3
has answer: http://stackoverflow.com/a/29976895
tagged with: javascript
type: UnansweredQuestion
score: 16
has title: javascript - read tab delimited file, line by line than split each line using tab delimited
has answer: http://stackoverflow.com/a/39007120
downvote count: 0
has comment: http://stackoverflow.com/comment/46111220
has comment: http://stackoverflow.com/comment/46111370
has body: I'm able to read a file line by line but I do not know how to split each lines using the tab delimited. here my code. Need some help on this issue Sum of a Column in JavaScript
favorite count: 0

http://stackoverflow.com/q/29041034
answer count: 6
possible better answer: http://stackoverflow.com/a/29041264
has answer: http://stackoverflow.com/a/29041264
has answer: http://stackoverflow.com/a/37378610
has comment: http://stackoverflow.com/comment/46333864
accepted answer: http://stackoverflow.com/a/37389433
favorite count: 0
has comment: http://stackoverflow.com/comment/46323977
has body: I'm trying to cache the rendered markup of the App component. I know that this is somehow "against the rules" but I'm in a server-less environment (chrome-extension). Upon page load i want to inject the cached App markup into the DOM. The expected result is similar to the experience of having the react-component rendererd on a server. Very much as described here: http://www.tabforacause.org/blog/2015/01/29/using-reactjs-and-application-cache-fast-synced-app/. To illustrate my usecase, I have updated the Thinking in react example: App FilterableProductTable SearchBar ProductTable (containing from reflux store in state) ProductCategoryRow ProductRow As is expected, neither componentDidUpdate nor componentWillUpdate are called in App. Is it possible to detect updated child components in the App component in a sane way? Preferably without modifying the child component classes? I would like to avoid moving props/state to App.
has answer: http://stackoverflow.com/a/32501269
downvote count: 1
has answer: http://stackoverflow.com/a/58833496
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/35211784
upvote count: 10
has answer: http://stackoverflow.com/a/37389433
type: Question
score: 9
has title: How to detect child renders in a parent component in react.js
tagged with: reactjs
tagged with: refluxjs
tagged with: javascript

http://stackoverflow.com/comment/46189577
comment on: http://stackoverflow.com/a/28968707
type: AnswerComment
score: 0
has text: Your algorithm seems to work, did you program it yourself or do you have it from somewhere?
type: Comment

http://stackoverflow.com/q/28985174
has comment: http://stackoverflow.com/comment/46223128
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/29064418
type: Question
tagged with: reactjs
tagged with: javascript
has comment: http://stackoverflow.com/comment/46221347
score: 0
answer count: 1
favorite count: 0
has body: I am about to build a small WebApp with react for personal use and for some experience :) I want to work with the users input -> depending on how many positions he will fill out, the amount of possible "tabs" or "buttons" will vary For this example I've created an array state called "data". I'd like to ask you if theres a better way to handle this situation, and how would you deal with the handling of an action if one of these buttons will be clicked ? simple vanilla event listener and then continue in react within that function or comepletly different ? Shall I create an onClick={this.someFunc} simultaniously to every button that gets created? Heres my tiny react code: http://pastebin.com/eseYdr3G
has title: Dynamic button output React.js
accepted answer: http://stackoverflow.com/a/29064418
type: AnsweredQuestion

http://stackoverflow.com/q/28967106
tagged with: jquery
answer count: 2
upvote count: 1
possible better answer: http://stackoverflow.com/a/28967169
accepted answer: http://stackoverflow.com/a/28967493
favorite count: 0
has answer: http://stackoverflow.com/a/28967493
has title: How to get dropdown value
type: AnsweredQuestion
downvote count: 0
score: 1
has body: 323 525 727 js function dd01change() { var a = $(this).val(); alert (a); }; Doesn't work. In console I get: Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
tagged with: select
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28967169

http://stackoverflow.com/comment/46333763
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29046846
type: AnswerComment
has text: If you feel that the answer was not an answer to the question, your question is quite unclear. Furthermore, you accepted an answer that said pretty much the same thing as the one I wrote, and the one that @marsh wrote, but answered almost twenty minutes after the first answer was posted. If we did not answer your question correctly, how could the (now marked correctly) answer be correct?

http://stackoverflow.com/q/29016921
score: 1
has comment: http://stackoverflow.com/comment/46278226
type: Question
accepted answer: http://stackoverflow.com/a/29017111
answer count: 1
downvote count: 0
tagged with: javascript
has body: I came across this snippet, and it seems quite unconventional to me, can anyone help me explain what's the purpose of it? Thanks in advance. image.onload = image.onerror = function () { entry[name] = image = image.onload = image.onerror = null; delete entry[name]; };
favorite count: 0
has title: What does this image onload function do?
has comment: http://stackoverflow.com/comment/46278146
upvote count: 1
has answer: http://stackoverflow.com/a/29017111
type: AnsweredQuestion

http://stackoverflow.com/q/29055828
has answer: http://stackoverflow.com/a/29055985
type: AnsweredQuestion
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/29055985
linked to: http://stackoverflow.com/q/37684
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/1732348
answer count: 2
downvote count: 0
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29055934
has comment: http://stackoverflow.com/comment/46349010
favorite count: 0
has answer: http://stackoverflow.com/a/29055934
has title: Regex to make links clickable (in only 'a href' and not 'img src')
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has body: I've been trying really hard to find a stable solution for a problem. I need to make all http/https links in a string as clickable links. But only those links that are in 'href' attribute of an 'a' tag, disregarding everything else. I've been using this simple function to linkify text - function linkify(text) { var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; return text.replace(exp, "$1"); } But the problem is that it converts links in 'src' attribute of any 'img' tag as clickable links too. Which I don't want. The string that I need to linkify can contain both 'a' as well as 'img' tags. I even referred this link - How to replace plain URLs with links? and used this - https://github.com/cowboy/javascript-linkify, but still no luck. Since I am using angular.js, I've also used the inbuilt 'linky' filter (https://docs.angularjs.org/api/ngSanitize/filter/linky) to linkify text but the problem still remains. All of the above mentioned solutions linkify text in both 'a' and 'img' tags. Looking for some help! Thanks.
tagged with: regex

http://stackoverflow.com/comment/46377125
has text: No you wrong understand my question. I need post table as html into google docs on submit
type: Comment
comment on: http://stackoverflow.com/a/29055476
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46205182
type: Comment
comment on: http://stackoverflow.com/a/28977053
has text: I tried button text but it has that strange x character and all those spaces that makes it not work.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28964099
score: 3
accepted answer of: http://stackoverflow.com/q/28961465
type: AcceptedAnswer
has body: the answer was git config --global url."https://".insteadOf http:// which means that you make git replace the protocol. I think that this configures git to use the https port and not the default git port which is 22 which is blocked or something. I would appreciate a much clearer explanation.
downvote count: 0
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/28961465

http://stackoverflow.com/q/28962769
has answer: http://stackoverflow.com/a/28963096
score: 1
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46177574
has answer: http://stackoverflow.com/a/28963059
answer count: 2
tagged with: validation
downvote count: 0
linked to: http://stackoverflow.com/q/24619437
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28963059
has body: In one of my application, I have a requirement to add a specific class when it has any data irrespective of it's input type (email, text) using AngularJS: In this plunk, just type any thing in the text box to change the border color. code for reference &lt;body ng-app=""&gt; &lt;input type='text' ng-model='Custom' ng-class="{red : Custom.length}"&gt; &lt;label ng-bind='Custom'&gt;&lt;/label&gt; &lt;/body&gt; In a similar way I want it for all the input types. In case of email field. When user typed wrong email, it's not working because model will not get value when it is invalid.
has title: Adding class dynamically based on condition in angular js app
possible better answer: http://stackoverflow.com/a/28963096
type: AnsweredQuestion

http://stackoverflow.com/comment/46187753
comment on: http://stackoverflow.com/q/28967581
score: 0
type: Comment
type: QuestionComment
has text: @epascarello I've tried to use jquery like this : window.opener.$(document).trigger('myEvent'); $(document, window.opener).trigger('myEvent'); but nothing works...

http://stackoverflow.com/comment/46345974
comment on: http://stackoverflow.com/q/28980185
type: Comment
has text: If you go this way you may want to go one step further and implement CMAC instead (which in turn can be build upon CBC-MAC). CBC-MAC has some weaknesses that are addressed by CMAC. Note that using CBC-MAC or CMAC is not such a good idea with an 8 byte block cipher such as DES or triple DES. Unless you are trying to accomplish backwards compatibility, opt for HMAC instead. If possible, differentiate between the encryption / MAC keys when using CBC-MAC.
type: QuestionComment
score: 1

http://stackoverflow.com/a/28921582
has body: As mentioned by Dhiraj and randombumper above, that did the trick - I tried calling just a .click, document.body on click worked superb. Thanks for the help chaps.
score: 0
answers question: http://stackoverflow.com/q/28921451
type: Answer

http://stackoverflow.com/a/29013935
has body: Looks like you need to run this from a server, with PHP enabled. If you're loading it locally from the filesystem, the PHP file you're requesting is unable to do its magic.
has comment: http://stackoverflow.com/comment/46283873
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29013703
has comment: http://stackoverflow.com/comment/46273013

http://stackoverflow.com/comment/46235390
score: 0
has text: note that the dependencies of minimongo are listed in the projects page, so from this sense it is a rather large codebase to include for this task only
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28993076

http://stackoverflow.com/comment/59574214
has text: the initial value `$q.dever().resolve()`did not work for me (Angular 1.4.3), `p` was `undefined` on the first call. But this did work: `$q(function(resolve) { resolve();})`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28983668
type: AnswerComment

http://stackoverflow.com/q/29045343
type: Question
tagged with: javascript
score: 0
answer count: 3
has body: For some odd reason, Backbone is trying to put my model object instead of posting it to the server. The error is an HTTP 500 error because Backbone is trying to put a model with no id (because I have made it undefined): PUT /api/teams/undefined 500 285ms - 135b Here's my code: this.model.id = undefined; this.model._id = undefined; teamCollection.add(this.model); this.model.save(null, { success: function (model) { $('.top-right').notify({ message: {text: ' New team added! '}, type: 'info', fadeOut: { delay: 3500 } }).show(); window.userHomeMainTableView.render(); } , error: function (model) { teamCollection.remove(model); $('.top-right').notify({ message: {text: ' Error adding team :( '}, type: 'danger', fadeOut: { delay: 3500 } }).show(); } }); even after "forcing" the model.id and model._id to be undefined, Backbone still tries to do an HTTP PUT. How can this be?
tagged with: backbone.js
linked to: http://stackoverflow.com/q/13384448
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29045568
has answer: http://stackoverflow.com/a/29045725
has title: Backbone trying a put instead of a post
has answer: http://stackoverflow.com/a/29045382

http://stackoverflow.com/comment/46268571
type: AnswerComment
type: Comment
has text: yes agree with you the query needs to start with 0. but not sure what you meant by async i. it is always here in sync even in your solution. i will be zero in first success and one in second success?
comment on: http://stackoverflow.com/a/29011151
score: 0

http://stackoverflow.com/q/28998696
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28998786
score: -1
has title: javascript function to create url using the parameter
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46245413
has comment: http://stackoverflow.com/comment/46245411
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28998786
tagged with: codeigniter
has body: Here is a js function i have in which I would like to make a xmlhttp.open call using the parameter value &lt;script&gt; function showStudents(str) { if (str == "") { document.getElementById("stuList").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("stuList").innerHTML = xmlhttp.responseText; } else if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 404) { document.getElementById("stuList").innerHTML = 'Invalid URL'; } } xmlhttp.open("POST", "&lt;?php echo site_url("/rhadmin/testing/"); ?&gt; + str ",true); xmlhttp.send(); } } &lt;/script&gt; If the value of the 'str' parameter is 6 - then the final url should be http://localhost/rhadmin/testing/6 What do I need to do to get this? Appreciate any help on this. Thank you.
tagged with: php

http://stackoverflow.com/comment/46164593
type: QuestionComment
comment on: http://stackoverflow.com/q/28955533
has text: You have to iterate through the array at least once. For example `.join` you used in your code does pass through the array once. I don't think you can reduce it any less than O(n). Using regex for this problem is an overkill and it can very well be computationally lot more expensive than doing it from first principles.
score: 3
type: Comment

http://stackoverflow.com/comment/46091956
has text: We have no idea what `a` is without seeing your code
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28917073

http://stackoverflow.com/comment/46271323
score: 0
type: Comment
has text: This is actually not what I meant. I tried to set a treshold were you could make a "bounce back event" but that one was really buggy.
comment on: http://stackoverflow.com/a/28939551
type: AnswerComment

http://stackoverflow.com/comment/46157768
score: 0
has text: `contentType` on a GET is meaningless - that's meant for POST values. If you add `dataType: "json"` to your ajax call, then the result you get back will already be a javascript object (assuming it's valid JSON), so you won't need to parse the JSON.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28949629

http://stackoverflow.com/a/29043161
has body: Sure, you can do nested ternary operators but they are hard to read. var variable = (condition) ? (true block) : ((condition2) ? (true block2) : (else block2))
type: Answer
has comment: http://stackoverflow.com/comment/125505127
has comment: http://stackoverflow.com/comment/46329274
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29043135
answers question: http://stackoverflow.com/q/29043135
upvote count: 271
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46326271
score: 271

http://stackoverflow.com/q/28916806
has comment: http://stackoverflow.com/comment/46091494
possible better answer: http://stackoverflow.com/a/28916920
type: Question
has answer: http://stackoverflow.com/a/28916920
answer count: 2
upvote count: 0
tagged with: javascript
has title: Login page with AngularJS
has answer: http://stackoverflow.com/a/28917277
has comment: http://stackoverflow.com/comment/46091435
has comment: http://stackoverflow.com/comment/46091801
favorite count: 0
tagged with: angularjs
score: -3
has comment: http://stackoverflow.com/comment/46091627
accepted answer: http://stackoverflow.com/a/28917277
has body: I have a problem: I need to check if the username typed into an input form is equal to the username that is in my array of users. I do the same thing for password. I want to make a login form. var app = angular.module('myApplication', []); app.controller('UserListCtrl', function ($scope) { $scope.usersList = [ { name: 'Alex', pass: 2200201 }, { name: 'Michael', pass: 1231215 }, { name: 'John', pass: 1232116 } ]; $scope.checkInputs = function () { $scope.searchUser = { name: $scope.yourName, pass: $scope.yourPass }; if ($scope.searchUser.name === $scope.usersList.name) { console.log($scope.searchUser.name); } else { console.log('You are not registered'); } }; }); And the HTML: &lt;form ng-submit="checkInputs()"&gt; &lt;input type="text" ng-model="searchUser.yourName"&gt;&lt;br&gt; &lt;input type="text" ng-model="searchUser.yourPass"&gt; &lt;input type="submit" class="button"&gt; &lt;/form&gt;
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46091455
has comment: http://stackoverflow.com/comment/46091531
has comment: http://stackoverflow.com/comment/46091351
downvote count: 3

http://stackoverflow.com/comment/46116182
has text: Actually I want drop down for multi category onchange behaviour .I want When I will select category list so onchange appear new drop down and when I will select category than appear new drop down of items list. .... sorry bro my English is very week but I done my best to explain what I required
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28929705
type: Comment

http://stackoverflow.com/comment/46236537
has text: We're glad to help. What have you tried?
comment on: http://stackoverflow.com/q/28994225
type: QuestionComment
type: Comment
score: 2

http://stackoverflow.com/a/29032863
answers question: http://stackoverflow.com/q/29032498
upvote count: 1
has comment: http://stackoverflow.com/comment/46308153
downvote count: 0
score: 1
has body: There is no built-in variable named args in JavaScript. The built-in variable is named arguments, as described here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments The arguments object is an Array-like object corresponding to the arguments passed to a function. I'm not sure where you got the idea that args should be defined (perhaps from another programming language?), but that is wrong.
type: Answer

http://stackoverflow.com/comment/46366738
score: 0
has text: @lesssugar there are many buttons with same class, this event can fire for each of them. $this will be clicked button
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29055013

http://stackoverflow.com/comment/46181259
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28956842
has text: Awesome! Thank you again. Now I'll do my work and try to solve my problem. You helped me a lot. I'll let you know when I have a solution. :)

http://stackoverflow.com/comment/46249191
comment on: http://stackoverflow.com/a/29000559
type: Comment
has text: Is that what you are saying? When i put the js in "// Your script goes here", the page is displaying button, "function onClickFunc() { " text and below that the script is executing without even the click. Pls clarify..
score: 0
type: AnswerComment

http://stackoverflow.com/q/28948384
tagged with: javascript
tagged with: sorting
score: 0
tagged with: angularjs
tagged with: angular-filters
has title: Can I configure the default angular filter to display strings so that those that start with the search term come first?
has body: In my project we are displaying a HUGE list of strings (17,000+ sometimes) With an input box for pairing down the list using a filter. I've been using angular's default filter until it was requested that i sort so that strings starting with the search query come before words that merely contain it. Say i have an array of strings $scope.array = ["aaa","abb","abc","bad","bcd","cool","cold"] Right now if i filter with the query string 'c', what will show up is 'abc','bcd,'cool','cold' in that order. However, when most people start searching with 'c' they probably want to see 'cool' and 'cold' show up first. I would like the array to be 'cool','cold','abc',bcd (or possibly cold then cool if alphabetical sorting is part of the package) I'm wary of writing my own filter because I'd rather use something tried and true with such a large collection of data. Is there a way to achieve this without writing my own custom filter? It seems like common enough functionality that there should be a config for it or possibly a common filter i can grab from github?
has answer: http://stackoverflow.com/a/28949082
accepted answer: http://stackoverflow.com/a/28949082
type: Question
type: AnsweredQuestion
answer count: 1

http://stackoverflow.com/comment/46089320
type: QuestionComment
has text: @AdrianCidAlmaguer Yes
comment on: http://stackoverflow.com/q/28915565
score: 0
type: Comment

http://stackoverflow.com/q/28929326
has answer: http://stackoverflow.com/a/28929359
has comment: http://stackoverflow.com/comment/46114572
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/444080
has comment: http://stackoverflow.com/comment/46114548
has title: How do I use functions where the parameter is a variable?
type: Question
has comment: http://stackoverflow.com/comment/46114669
tagged with: javascript
has body: I have been working a small project to learn the basics of javascript but I have come across an error that I cannot fix. I have done some research but to no avail. I want to have a program that generates offences (as a joke). It randomly selects one argument from the array 'people' and joins it with one from the array 'offence'. Everything went well until I decided to make the randomizer into a function. At this point it started doing weird things like stopping after asking a friend's name, assigning personGenerator to 'undefined'. Here is my code: &lt;script&gt; //this is plonker base //creates a variable that will start the game var start = confirm("Are you sure want to participate in plonker base alpha?") //starts and loops the game if(start==true){ //asks for another person's name var person1 = prompt("Please name one of your best friends.") } //creates a randomizer function var random = function (variable,subject){ variable = subject[Math.floor(subject.length * Math.random())] } while(start==true){ //creates array 'person' var person = ["You are ","Your mum is ","Your dad is ", "The world is ", (person1 + " is ")] var personGenerator random(personGenerator,person) //creates an array 'offence' var offence = ["an idiot!", "a complete pysco!!!", "a smelly, worthless peice of junk!", "a whale re-incarnated that looks like a squirrel!", "a dumb pile of dirt that has the misfortune of seeing itself in the mirror once in a while!", "a complete and utter plonker!", "a dumbo!", "a right dufus!!!", "a pile of rabbit dung!", "an intelligant, good looking king being... Did I mention - it's opposite day!", "a bum-faced rat!!!", "a fat, lazy oaf!", "a blobfish look-alike!!!!!", "a lump of toenail jelly!"] var offenceGenerator = offence[Math.floor(offence.length * Math.random())] //gives out the offence alert(personGenerator + offenceGenerator) } { alert("What a plonker!") } &lt;/script&gt; I am new to javascript so I do not know much about it. Please make your answers easy t…
score: 0
tagged with: function
tagged with: arrays
answer count: 1
tagged with: variables

http://stackoverflow.com/comment/46186525
type: QuestionComment
type: Comment
has text: @A.Wolff it is not. Angular only targets the body as its rootscope when calculating ripple effect. Once a page is been scrolled, the element will not apply ripple correctly. The page must be a single view.
score: 0
comment on: http://stackoverflow.com/q/28967155

http://stackoverflow.com/comment/46126825
comment on: http://stackoverflow.com/q/28935503
type: QuestionComment
type: Comment
has text: It should be possible in pure javascript. I would suggest you to use ECMA 6 feature to complete your requirement (If you are using a upgraded browser). ECMA 6 supports promise natively. @KingJames
score: 0

http://stackoverflow.com/q/28930265
linked to: http://stackoverflow.com/q/14350350
tagged with: meteor
favorite count: 0
has comment: http://stackoverflow.com/comment/46120347
type: UnansweredQuestion
tagged with: three.js
has answer: http://stackoverflow.com/a/28942429
score: 2
linked to: http://stackoverflow.com/q/28279776
upvote count: 2
type: Question
has title: How to restart a canvas without reload
has comment: http://stackoverflow.com/comment/46120382
has comment: http://stackoverflow.com/comment/46119660
has comment: http://stackoverflow.com/comment/46121087
tagged with: javascript
tagged with: webgl
has comment: http://stackoverflow.com/comment/46120430
linked to: http://stackoverflow.com/q/10823408
linked to: http://stackoverflow.com/q/27429799
tagged with: canvas
downvote count: 0
has body: I simply want to restart a canvas on a website. I do not want to reload the page, so the restart has to be done dynamically. Problem : after few restarts the animation gets slower and the memory increases. Actually i face a more complex situation : I use a javascript framework to load pages, MeteorJS with IronRouter. Changing the URL only changes the DOM (nodes are removed) but the 'page' is not really left. So i thought that coming back to my page with the canvas can be assimilated to a dynamic canvas restart, since i have no solution to that too. That is why i describe the problem from two points of view (same problem on both) : first a simple page where a button asks the canvas to restart then applying the solution to MeteorJS with IronRouter and try to come back on my page many times. Note : my canvas content is some WebGL (in ThreeJS). 1. Deleting and re-initializing canvas dynamically. In this case i face those two problems : animation not smooth memory increase. To be precise : (source: hostingpics.net) Page loaded, playing with canvas / 2. Restarting the canvas 30-40 times (i did not stop restarting so i do not know why the increase is not linear) / 3. Playing with canvas / 4. Closing the tab (reloading the page only frees a small fraction of what has been mobilized) Few questions on SO yet asked how to solve those issues, but reproducing the solutions partially solves the problem. I have read two main things : the canvas-related parts (nodes, variables, functions) have to be cleaned from the DOM (That is something Meteor does. But in this first part it stays relevant and yet is not enough to prevent the issues). if requestAnimationFrame has been called, it needs to get assigned to a variable so cancelAnimationFrame(variable) can stop it. That indeed seems to prevent the frame rate drop. While memory stays high, at least the movements remain fluent. With those solutions the memory problem still happens. Here is an example : http://codepen.io/Astrak/pen/RNYLx…
answer count: 1

http://stackoverflow.com/comment/46277075
has text: I've used requests library in my python program, and i've tried that too... but it didn't work. :/
comment on: http://stackoverflow.com/a/29016159
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28936725
answers question: http://stackoverflow.com/q/28936682
has body: object.onload=function(){ var width = $('img').width(); height = $('img').height(); }; You can try this onload function.
type: Answer
score: 0

http://stackoverflow.com/comment/46319274
has text: As I said: Use JSON. And store the JSON instead of the array.
comment on: http://stackoverflow.com/q/29039181
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28913570
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29920016
has title: Bootstrap tour with backdrop enabled acting strange
favorite count: 0
tagged with: bootstrap-tour
tagged with: twitter-bootstrap-3
has body: I am using Twitter Bootstrap Tour for a web tour. Here is the javascript to initialize it: var tour = new Tour({ backdrop: true, steps: [ { element: "#keyword-link", title: "Title of my step", content: "Content of my step" }, { element: "#keyword-dropdown", title: "Title of my step", content: "Content of my step" } ] }).init().start(true); Currently I am just using test content within each step. I am trying to get the backdrop effect as shown on their own website: http://bootstraptour.com/ However, here is the result I have achieved: Here is what it looks like without the backdrop: You can see that the non-shadow portion masks the HTML perfectly, but its opacity is too high and you can't see any of the content that isn't masked. Is there a reason for this and what can I do to fix it? I wasn't able to reproduce any kind of backdrop from within JSFiddle.
type: Question
upvote count: 2
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/40676023
has answer: http://stackoverflow.com/a/43260630
answer count: 3
score: 2
downvote count: 0

http://stackoverflow.com/comment/46074090
score: 1
comment on: http://stackoverflow.com/q/28907295
type: Comment
type: QuestionComment
has text: what is `fullscreen.document`? how you define it?

http://stackoverflow.com/q/28957223
possible better answer: http://stackoverflow.com/a/28957527
has answer: http://stackoverflow.com/a/28957527
answer count: 4
has answer: http://stackoverflow.com/a/28957647
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/28957689
type: Question
accepted answer: http://stackoverflow.com/a/28957647
has body: I want to add text every line in textarea using: text1 text2 text3 text4 one two three four process! Result: text1 one text2 two text3 three text4 four
tagged with: javascript
tagged with: jquery
has title: how to add text every line in textarea using jquery
has answer: http://stackoverflow.com/a/28957681

http://stackoverflow.com/comment/46561365
comment on: http://stackoverflow.com/a/28920296
type: Comment
score: 0
type: AnswerComment
has text: This definitely seems to be a step forward. There's only one thing I can see that might stop this method from working, but I'll attempt to get around it first and if it doesn't work I'll let you know. I'll hold of on best answer until then.

http://stackoverflow.com/a/57985716
type: Answer
score: 0
has body: One of the best solution in javascript to the fizzbuzz problem const fizzbuzz = (start, stop) =&gt; { const arr = []; let str; for(let i=start; i&lt;=stop; i++) { str = ""; if(i%3===0) { str = "fizz"; } if(i%5===0) { str += "buzz"; } arr.push(str||i); } return arr; } console.log(fizzbuzz(0, 105));
answers question: http://stackoverflow.com/q/28998093

http://stackoverflow.com/comment/46214553
score: 0
comment on: http://stackoverflow.com/q/28982487
type: Comment
type: QuestionComment
has text: OK. As always, searching, testing and looking and than just asked and an answer comes along like this one: http://stackoverflow.com/questions/18222665/huge-string-replace-in-javascript Maybe it's best for my case.

http://stackoverflow.com/q/29060572
tagged with: javascript
has title: Uncaught TypeError: Illegal invocation:error with modal form
has body: this is my first question in stackoverflow, in my html page i have a table, i want to send data to the servlet using modal form. But, i have this error :Uncaught TypeError: Illegal invocation. table.html ID NAME ACTION 1 JHON 2 Max test.js $(".d").click(function(){ var id =$("#id").attr("value",$(this).parent().prev().prev().text()); var name =$("#name").attr("value",$(this).parent().prev().text()); $("#dialog-form").dialog({ modal: true, buttons: { "Send":function () { $.post("Controller",{id:id,name:name},function(data){ $("#res").html(data); }) ; } Servlet.java String name=request.getParameter("name"); String id=request.getParameter("id"); out.println(id +" "+ name);
accepted answer: http://stackoverflow.com/a/29060871
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/29060871
favorite count: 0
has comment: http://stackoverflow.com/comment/46357750
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/46357469
tagged with: servlets
type: Question
downvote count: 0

http://stackoverflow.com/a/28979118
has body: I would stop worrying about it by hiding this feature- input::-ms-clear { display: none; } That is just one more of countless non-standard browser features that Microsoft introduce that contain missing functionality. Our time is too precious. Coding specifically for IE has been a pain for a decade...
answers question: http://stackoverflow.com/q/28978815
upvote count: 5
type: Answer
has comment: http://stackoverflow.com/comment/46209756
downvote count: 0
score: 5

http://stackoverflow.com/a/28926310
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28926272
type: Answer
answers question: http://stackoverflow.com/q/28926272
score: 12
has body: I have the following function...Inside $(document).ready().This function won't work unless it is put outside document.ready().Any ideas? It sounds like you're calling the function from an onXyz attribute, like this: ... Functions called that way must be globals, but when you declare the function within the ready callback, it's not a global, it's scoped to the ready callback. Creating globals is best avoided, which is one of the reasons not to use onXyz attributes for event hookup. Instead: ... ...and then in ready: $("#radius").on("click", function() { fav('radius'); }); ...or similar. You don't have to give these all ids, and in fact you may well be able to use the same handler for several of them. for instance: ... ... then $(".control").on("click", function() { fav(this.getAttribute("data-type")); // Or: // fav($(this).attr("data-type")); // But not .data(), that's for something else, not for just accessing data-* attributes }); Note that you don't need a ready function at all in most cases. Just put a inline-invoked function expression at the end of the document, just before the closing tag: You really only need a ready handler if you don't control where the script tags go.
upvote count: 12
type: AcceptedAnswer

http://stackoverflow.com/a/29038790
downvote count: 0
answers question: http://stackoverflow.com/q/29038395
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/46318702
accepted answer of: http://stackoverflow.com/q/29038395
has body: You could do this by attaching onchange listeners to each of your inputs like so: anIndividualInput.onchange = function(event) { var input = event.target; var delta = input._oldValue ? input.value - input._oldValue : input.value; input._oldValue = input.value; // Call your master function with the delta };
type: AcceptedAnswer

http://stackoverflow.com/comment/46358247
comment on: http://stackoverflow.com/a/29060558
type: AnswerComment
has text: If I remove the `$` from `("#fuse") ...` seems to work fine. Query wasn't needed my bad. However, now the views can't seem to find `onclick='search()'` function.
score: 0
type: Comment

http://stackoverflow.com/q/29049739
favorite count: 0
possible better answer: http://stackoverflow.com/a/29055707
has answer: http://stackoverflow.com/a/29055707
has body: How do i define properties of an object, so if one of them is changed all other are automatically updated. I have come up with this code so far, but it doesn't work: function CreateNamed(first, last) { Object.defineProperties(this, { "firstName": { value: first, writable: true }, "lastName": { value: last, writable: true }, "fullName": { value: first + ' ' + last, writable: true } }); } So after a new object is created it can be changed appropriately: var b = new CreateNamed('Bill', 'Gates'); // Bill Gates b.firstName = 'Paul'; // b.fullName = Paul Gates b.lastName = 'Wood'; // b.fullname = Paul Wood b.fullName = 'Chuck Norris' // b.firstName = Chuck, b.lastName = Norris
accepted answer: http://stackoverflow.com/a/29049786
type: AnsweredQuestion
tagged with: oop
upvote count: 2
downvote count: 1
type: Question
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/29049786
has title: Make all properties of object mutable
score: 1

osx-mavericks
type: Tag
tag name: osx-mavericks
tags question: http://stackoverflow.com/q/28991943

http://stackoverflow.com/q/29043057
tagged with: jquery
has answer: http://stackoverflow.com/a/29043286
has body: I have html string (js string) as below test1 testing2 testing3 testing4 testing5 testing6 I need just 2 to 3 list items, and discard the rest (as below) test1 testing2 testing3 Any idea how to do this? can I use jQuery to return subset of ol? or is there a regex for this? Edit: Thanks a lot for your answers. I have a sub question (sorry I should have asked this with original question) I want to limit just the li corresponding to test class (and not consider the li under testClass2 for removal). test1 testing2 testing3 testing4 testing5 testing6 I tried something like html.not('.testClass2').find("li:gt(3)").remove(); but its still considering the inner elements This seems to work: html.find("ol>li:gt(4)").remove();
has comment: http://stackoverflow.com/comment/46326095
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29043363
has answer: http://stackoverflow.com/a/29043136
type: Question
has comment: http://stackoverflow.com/comment/46326142
has answer: http://stackoverflow.com/a/29043191
has comment: http://stackoverflow.com/comment/46326180
tagged with: regex
possible better answer: http://stackoverflow.com/a/29043144
has title: How to extract some (under ol / ul tag) tags from html
has answer: http://stackoverflow.com/a/29043144
score: 0
answer count: 5
accepted answer: http://stackoverflow.com/a/29043363
tagged with: javascript

http://stackoverflow.com/a/28943707
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28943368
has body: Looks like Firefox 36.0.1 is not completely ok with property innerText, after all (thanks apsillers!). I replaced it with textContent and now the script works in Firefox, Chrome, IE and Safari.

http://stackoverflow.com/comment/46220362
type: Comment
comment on: http://stackoverflow.com/a/28983546
has text: I have added the full software in its original form at the question as a link.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28925396
tagged with: ng-animate
has answer: http://stackoverflow.com/a/30823875
has comment: http://stackoverflow.com/comment/46113933
has comment: http://stackoverflow.com/comment/46115295
has comment: http://stackoverflow.com/comment/46115551
has comment: http://stackoverflow.com/comment/46114990
type: AnsweredQuestion
tagged with: angular-ui-router
score: 4
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/46289274
has title: AngularJS Digest Cycle Occasionally Fails to Update Scope
type: Question
upvote count: 4
accepted answer: http://stackoverflow.com/a/30823875
has comment: http://stackoverflow.com/comment/46123695
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46108158
has body: Angular Devs! I'm running into a bit of an issue when using ngAnimate and UI-Router together. Basically, I have five child states ("slides") that make up my main content as well as a button on each side. These buttons go to the previous and next slides respectively when clicked. I'm using CSS3 translations to animate the entry and exit of the slides. When the user clicks the left button, the current slide exits to the right and the "previous" slide enters from the left. The opposite is true when the right button is clicked: the current slide exits to the left and the "next" slide enters from the right. These slides loop around, so slide zero goes to slide four and vice-versa. The direction my slides enter and exit the viewport (keep in mind that the slides are UI-Router states, so they are removed from the DOM at the end of the animations) is determined by a class that I apply to the parent element. Applying the "left" class makes the slides animate left, and the reverse for the "right" class. The code is broken up into several elements: appSlideDirective directive that contains slide buttons and an embedded UI-Router view div (content) handles user button presses and passes click events to baseController for state transitions baseController controller that belongs to parent module, manages stateService stateService (only used by baseController) navigates between UI-Router states when the directive sends it events slideService (only used by directive) manages 'left' and 'right' class addition and removal (via ng-click) Directive HTML: &lt;div id="slide-container"&gt; &lt;div id="slide" data-ng-class="{ left: slide.getTransitionState().left, right: slide.getTransitionState().right }"&gt; &lt;div id="slide-content" data-ui-view&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; Relevant Directive Code: angular.module('app').directive('appSlide', function(slideService) { restrict: 'A', scope: { currentState: '=', numberOfStates: '=', loadPreviousState: '&amp;onPreviousState', l…
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46108299
has comment: http://stackoverflow.com/comment/46125535

http://stackoverflow.com/q/28959022
has body: On my webpage I have 2 buttons and both of them should return a different 'confirm' popup depending on what button has been pressed. The code: echo ' Voltooi deze taak '; echo ' Markeren als onvoltooid '; function validateForm() { var btnMark = document.getElementById( 'btnMark' ); var btnActive = document.getElementById( 'btnActive' ); var btnComplete = document.getElementById( 'btnComplete' ); var btnDeComplete = document.getElementById( 'btnDeComplete' ); alert( btnDeComplete.value ); var sConfirmText = ""; var sAlertText = ""; if( btnMark ) { //alert( btnMark.value ); sConfirmText = "Test1"; sAlertText = "Test2"; } else if( btnActive ) { //alert( btnActive.value ); sConfirmText = "Test3"; sAlertText = "Test4"; } else if( btnComplete ) { alert( btnComplete.value ); alert( 'btncomplete' ); sConfirmText = "Test5"; sAlertText = "Test6"; } else if( btnDeComplete ) { alert( btnDeComplete.value ); alert( 'btndecomplete' ); sConfirmText = "Test7"; sAlertText = "Test8"; } if( confirm( sConfirmText ) ) { alert( sAlertText ); return true; } else return false; } So what should happen when you press any of those buttons, it should give you an alert with the value of btnDeComplete, show two alerts with 'Test' + the given number of the button that has been pressed. Now when you press the button btnComplete, you get the following alerts: btnComplete btncomplete Test5 Test6 When you press the button btnDeComplete, you get the following alerts: btnComplete btncomplete Test5 Test6 Notice that they're both the same, and the first 'alert( btnDeComplete.value );' returns btnComplete instead of btnDeComplete. I'm not changing any of the ID's or values anywhere in the code, I just set the id, name and value where I create the buttons. All of the other buttons work just fine. Anyone could help me with this problem?
score: 1
has comment: http://stackoverflow.com/comment/46173930
has comment: http://stackoverflow.com/comment/46171901
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28961112
has comment: http://stackoverflow.com/comment/46173392
tagged with: javascript
has title: html/javascript: ID of a button is changing (?)
answer count: 2
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28959154
has answer: http://stackoverflow.com/a/28961112
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46171728
tagged with: php
possible better answer: http://stackoverflow.com/a/28959154
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46173805

http://stackoverflow.com/a/28992473
has body: The first snippet of code executes the function inside the brackets right away and sets var1 to the function's return value. ASSUMING THAT the return value of the first snippet is itself a function, the second snippet of code will call that function with the result of the second function passed as a parameter.......
accepted answer of: http://stackoverflow.com/q/28992173
has comment: http://stackoverflow.com/comment/46304453
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28992173
type: Answer

http://stackoverflow.com/a/28915384
accepted answer of: http://stackoverflow.com/q/28914931
upvote count: 4
has comment: http://stackoverflow.com/comment/46108190
type: AcceptedAnswer
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/28914931
type: Answer
has body: You can use the updateFeature option of L.Realtime. It takes a method with three parameters: feature, oldLayer and newLayer. In there just take the newLayer and use the setIcon method of the marker: updateFeature: function (feature, oldLayer, newLayer) { newLayer.setIcon(new L.AwesomeNumberMarkers({ number: feature.properties.mynumber, markerColor: feature.properties.status.toLowerCase() })); } Unable to test, but that should work. Reference: https://github.com/perliedman/leaflet-realtime#-options

http://stackoverflow.com/comment/46177745
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28961526
type: QuestionComment
has text: @Luizgrs Good point, and yes, would be also more readable. Thanks for the reminder.

http://stackoverflow.com/comment/46114669
comment on: http://stackoverflow.com/q/28929326
type: QuestionComment
has text: I was told you didn't need to put semi-colons at the end unless you were using an old version of javascript? What do they do as most of my javascript coding works fine without them...
score: 0
type: Comment

http://stackoverflow.com/q/29022944
answer count: 1
favorite count: 0
type: UnansweredQuestion
score: -3
has answer: http://stackoverflow.com/a/29023925
has body: I am very new to javascript and trying to do something basic with 4 images. I am attempting to get the all to move right and the one on the end move to the front. Could someone tell me if I am headed in the right direction? Any help is appreciated. Thank you. Onclick Assignment Image 1 Image 2 Image 3 Image 4
has title: How to moving pictures to the right using javascript
has comment: http://stackoverflow.com/comment/46288985
downvote count: 3
type: Question
tagged with: javascript
upvote count: 0

session
tags question: http://stackoverflow.com/q/28919667
tags question: http://stackoverflow.com/q/28947184
tags question: http://stackoverflow.com/q/29024204
tags question: http://stackoverflow.com/q/28937576
type: Tag
tags question: http://stackoverflow.com/q/29018601
tags question: http://stackoverflow.com/q/29006462
tags question: http://stackoverflow.com/q/28978062
tags question: http://stackoverflow.com/q/29029611
tag name: session

http://stackoverflow.com/q/28998387
tagged with: css
tagged with: audio
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46248506
downvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/46330108
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/29010938
has comment: http://stackoverflow.com/comment/46245397
has title: load multiple audio files to be played simultaneously even with poor internet connection
has comment: http://stackoverflow.com/comment/46244886
upvote count: 0
has comment: http://stackoverflow.com/comment/46245590
answer count: 1
favorite count: 0
has body: I have developed a functional multi-track audio player, and if i am connected to wifi, this player works as intended. I need the files to play simultaneously. But, if I am on my phone, it plays the first file, then the second, then third and so on. Is there a way i can send all selected files to the server first, then send it back to the user to be listened to all together? Please help. Need to get this site launched as soon as possible. makeSong = function(f) { var add, button, path, play; path = curpath.concat(["" + f + ".mp3"]).join('/'); button = function(cls, onclick) { return $('&lt;i/&gt;').addClass(cls).addClass('link').addClass('fa').addClass("fa-" + cls).click(onclick); }; play = button('play', function() { play = $(this).hasClass('fa-play'); if (play) { multiPlayer.stop(); singlePlayer.play1(path); } else { singlePlayer.stop(); } $(this).toggleClass('fa-play', !play); return $(this).toggleClass('fa-pause', play); }); add = button('plus', function() { return addItem(f, path); }); return $('&lt;div/&gt;').addClass('sound cf').text(f).append($('&lt;div/&gt;').addClass('buttons left').append(play).append(add)); }; addSongs = function(fnames) { var $songs, f, _i, _len, _results; $songs = $('.sounds').empty(); _results = []; for (_i = 0, _len = fnames.length; _i &lt; _len; _i++) { f = fnames[_i]; _results.push(makeSong(f).appendTo($songs)); } return _results; }; currentPath = []; loadSongs = function(path) { return $.getJSON('/api/dir', { parts: JSON.stringify(path) }, function(d) { curpath = path; return addSongs(d.fnames); }); }; parentFolder = function(x) { return x.parents('.folder').first(); }; getPath = function(elem) { var parent; parent = parentFolder(elem); if (parent.length === 0) { return []; } return getPath(parent).concat([parent.attr('data-folder')]); }; $('.categories .folder span.link').click(function() { loadSongs(getPath($(this))); $('.categories .folder').removeClass('active'); return parentFolder($(this)).addClass('active'); }); $('.player .…
accepted answer: http://stackoverflow.com/a/29010938
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29017594
has body: First you need to check email with Regular expression. Then pass email to that function for testing. If result is true, put "mailto:" at the beginning of href and if result is false, add "http://" at the beginning. if(checkEmail($('a').text())) $('a').attr('href', "mailto:"+$('a').text()) else $('a').attr('href', "http://"+$('a').text()); function checkEmail(email) { var re = /^(([^&lt;&gt;()[\]\\.,;:\s@"]+(\.[^&lt;&gt;()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); }
has comment: http://stackoverflow.com/comment/46279610
has comment: http://stackoverflow.com/comment/46280100
downvote count: 0
has comment: http://stackoverflow.com/comment/46279598
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/46279870
answers question: http://stackoverflow.com/q/29017494
upvote count: 2

http://stackoverflow.com/comment/46085460
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28913571
has text: `parseInt()` returns an integer, as the name suggests. If you add only 0.2 to the value it will always round it down and undo the previous change (e.g. 10 + 0.2 = 10.2, `parseInt(10.2)` = 10).
score: 1

http://stackoverflow.com/a/28925329
score: 1
has body: it does not have a callback, but it returns a promise. you could do something like: $animate.removeClass(element, 'ng-hide').then(function() { $scope.afterShow(); });
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46117597
type: Answer
answers question: http://stackoverflow.com/q/28924798
accepted answer of: http://stackoverflow.com/q/28924798
downvote count: 0

http://stackoverflow.com/comment/46200774
has text: `LANGUAGE="Javascript"` - why do people still use this?!
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28974654

http://stackoverflow.com/q/28969468
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28969506
has title: Javascript Regular Expressions: obtain last two segments, divided by a dot
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/28969511
has comment: http://stackoverflow.com/comment/46193878
has body: I have a variable value that can have multiple segments separated by a dot. For example: var value = "abc.def.hij.asd.local" When the variable is passed in I don't know how many segments it will have. It can have 3 or more. For example: var value1 = "abc.cda.bds"; var value2 = "fdf.sdfsdf.dsds.sdfsdf.sdfds"; How do I use regular expressions in Javascript to get only the last two segments. For example: var value1 = "asda.dfgd.ghghg.hjkhj"; // return "ghghg.hjkhj" var value2 = "dfgdf.fghfg.fgfh"; // return "ghfg.fgfh"
favorite count: 0
type: UnansweredQuestion
tagged with: regex
score: -7
has comment: http://stackoverflow.com/comment/46193901
has comment: http://stackoverflow.com/comment/46190541
downvote count: 7

http://stackoverflow.com/comment/46199197
type: Comment
comment on: http://stackoverflow.com/q/28973656
has text: Mmhhh, sorry for my bad english: simply, i would like to show the submenu when hovering the corresponding main menu link. the problem is the mouseenter / mouseout timer. it would be more simple to put the submenu INSIDE the anchor element, but i would like to have the primary menu and the submenu in different div.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/46241289
type: Comment
type: QuestionComment
has text: @dlkulp x amount of time total on the website
score: 0
comment on: http://stackoverflow.com/q/28996268

http://stackoverflow.com/comment/46303307
type: Comment
comment on: http://stackoverflow.com/q/29031002
has text: You should try to do a [single page application](http://en.wikipedia.org/wiki/Single-page_application), instead of changing URLs.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/46219645
type: Comment
comment on: http://stackoverflow.com/a/28977474
has text: This is more like an example and not a complete solution. My advice would be to read up on `ajax` and also `prepared statements` in `mysqli`
score: 0
type: AnswerComment

http://stackoverflow.com/a/29013716
type: Answer
has body: Put the colors you allow in an array and use the last digit(s) of the name hash to select the color from the array.
answers question: http://stackoverflow.com/q/29013386
score: 0

http://stackoverflow.com/comment/46088991
type: Comment
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/28914355
has text: Hello please download it from here, http://www40.zippyshare.com/v/YxRgLqsL/file.html

http://stackoverflow.com/q/28918664
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/31299730
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/31299730
tagged with: css
has answer: http://stackoverflow.com/a/28930785
has body: I'm a little bit depressed because I need a customizable grid (moving and resizing DIVs) like Gridster, you can check the demo here: http://gridster.net/ Basically I need all the features Gridster is offering, like dragging and dropping DIVs, resizing them and saving the positions of the DIVs and loading them. However, there is one problem. It is not possible to drop the DIVs anywhere. In the Screenshot I want to drop the red highlighted DIV on that place, but it will snap to the upper highlighted area. http://fs1.directupload.net/images/150307/z2qlxelp.png Is there any solution to fix this problem? Also, could someone explain me how the Grid of Gridster works? Is there a "virtual grid" behind that or how is it realised? If someone has a solution for that problem, an example would be really nice.
has title: Why is it not possible to place DIVs anywhere with Gridster?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28930785
tagged with: gridster
type: Question

http://stackoverflow.com/comment/46130384
score: 0
type: AnswerComment
has text: You're right. At first I named the bar 'menu' and the buttons 'menu-item'. Later I changed that to be compatible with your mark-up, but I forgot that one. Thanks. It's fixed now.
type: Comment
comment on: http://stackoverflow.com/a/28921276

http://stackoverflow.com/a/62106310
upvote count: 1
answers question: http://stackoverflow.com/q/28966678
score: 1
has body: I encountered the same problem but in my case sometimes the rectangles were all equally offset by a constant number of pixels. I discovered that the body node itself can have some offset relative to the viewport, which you should adjust for when you attach any element to the body. See the following code: d3.selectAll("attribute-card").on("click", function (d) { var bodyRect = document.body.getBoundingClientRect(); // Get potential offset of the page's body node var rect = this.getBoundingClientRect(); // This gives coordinates relative to the viewport, not relative to the body's origin var card = d3.select("body") .append("div") .attr("class", "card") .style("background", "transparent") .style("border", "thin solid red") .style("left", (rect.left - bodyRect.left) + "px") // Correct for the body's offset .style("top", (rect.top - bodyRect.top) + "px") // Correct for the body's offset .style("width", (rect.right - rect.left) + "px") .style("height", (rect.bottom - rect.top) + "px") .style("position", "absolute"); });
downvote count: 0
type: Answer

http://stackoverflow.com/a/29013350
answers question: http://stackoverflow.com/q/29013035
upvote count: 1
has body: You can fix the height issue by either setting 'overflow:auto' to your 'relative-wrapper' css class or change the absolute positioned 'scroll-wrapper' to relative. I'm not sure tho if this is the best solution out there.
downvote count: 1
has comment: http://stackoverflow.com/comment/46271745
has comment: http://stackoverflow.com/comment/46272754
has comment: http://stackoverflow.com/comment/46272487
has comment: http://stackoverflow.com/comment/46272317
score: 0
type: Answer

http://stackoverflow.com/q/28994680
tagged with: javascript
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28998304
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have the following navigation, using the jquery accordion code below. Currently each of the #top-level nav items are set to toggle open and close the to reveal the children items. I'd like to modify code so that the stays open when user lands on any of its children. Screenshot for your reference: Any help is much appreciated. Thanks in advance. Visitor Information Visitor Information About our town Gallery I'm Hungry Membership Membership Advocacy Ambassadors Board Of Directors Upcoming Events Online Store Online Store Business Compliance Materials Events Membership Products Contact us jQuery Accordian plugin code: /* * jQuery Accordion plugin */ ;(function($){ $.fn.slideAccordion = function(opt){ // default options var options = $.extend({ addClassBeforeAnimation: false, allowClickWhenExpanded: false, activeClass:'active', opener:'.opener', slider:'.slide', animSpeed: 300, collapsible:true, event:'click' },opt); return this.each(function(){ // options var accordion = $(this); var items = accordion.find(':has('+options.slider+')'); items.each(function(){ var item = $(this); var opener = item.find(options.opener); var slider = item.find(options.slider); opener.bind(options.event, function(e){ if(!slider.is(':animated')) { if(item.hasClass(options.activeClass)) { if(options.allowClickWhenExpanded) { return; } else if(options.collapsible) { slider.slideUp(options.animSpeed, function(){ hideSlide(slider); item.removeClass(options.activeClass); }); } } else { // show active var levelItems = item.siblings('.'+options.activeClass); var sliderElements = levelItems.find(options.slider); item.addClass(options.activeClass); showSlide(slider).hide().slideDown(options.animSpeed); // collapse others sliderElements.slideUp(options.animSpeed, function(){ levelItems.removeClass(options.activeClass); hideSlide(sliderElements); }); } } e.preventDefault(); }); if(item.hasClass(options.activeClass)) showSlide(slider); else hideSlide(slider); }); }); }; // accordion slide visibility va…
has answer: http://stackoverflow.com/a/28997637
score: 1
has title: jQuery Accordion keep menu open from page to page when on child page
upvote count: 1
type: Question

http://stackoverflow.com/a/32970148
answers question: http://stackoverflow.com/q/29007635
downvote count: 0
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/76013687
upvote count: 1
has body: if you do not have following attribute in the style sheet it will not work with you "text-align: right;" it MUST be right. For Ex. بسم الله الرحمن الرحيم

http://stackoverflow.com/comment/46201898
type: QuestionComment
has text: "Is var making these variable local only?" Yes that is exactly what it is doing
score: 0
comment on: http://stackoverflow.com/q/28975328
type: Comment

http://stackoverflow.com/a/28918828
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28918555
answers question: http://stackoverflow.com/q/28918555
type: AcceptedAnswer
has body: If you don't mind the order of the array: $scope.calenderState.push($scope.calenderState.shift()); $scope.mod2m4 = $scope.calenderState[0];
downvote count: 0
type: Answer

http://stackoverflow.com/a/28957158
score: -4
answers question: http://stackoverflow.com/q/28957018
has comment: http://stackoverflow.com/comment/46170884
has body: The way controller and view talk to each other is through $scope. In your case the controller's vm variable is local to controller and is not available to view as you are declaring it as var vm. When you access vm in view, it actually creates a new variable vm and put it on scope. To correct it you need to pass $scope as controller dependency and use $scope.vm in your controller. Your controller should look like: function editFavoriteController($scope, $http, $window, $routeParams) { $scope.vm.search = []; var url = "/api/favorites/" + $routeParams.searchId; $http.get(url) .success(function (result) { $scope.vm.search = result; }) .error(function () { alert('error/failed'); }) .then(function () { //Nothing }); }; With these your view and controller should now refer to same 'vm' variable available in $scope. Please note that you need not to explicitly use $scope.vm in your view as 'vm' is implicitly refers to $scope.vm in view.
downvote count: 4
upvote count: 0
has comment: http://stackoverflow.com/comment/46167318
has comment: http://stackoverflow.com/comment/46168004
type: Answer

http://stackoverflow.com/comment/46349066
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29055671
has text: No reason to use lodash for this, you can easily do it in plain JavaScript.

http://stackoverflow.com/comment/46222333
has text: I was testing in my server , htrp://pandatracking.com/socket/chat:3000 and pandatracking.com:3000 ..both not working
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28986448
type: Comment

http://stackoverflow.com/a/30951516
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28950755
upvote count: 2
type: Answer
has body: I think this might be appropriate answer for slick centre mode Maganti IT Solution 1 2 3 4 5 6

http://stackoverflow.com/tag/svg
tags question: http://stackoverflow.com/q/28921225
tags question: http://stackoverflow.com/q/28974612
tags question: http://stackoverflow.com/q/28940287
tags question: http://stackoverflow.com/q/28974723
tags question: http://stackoverflow.com/q/28997769
tags question: http://stackoverflow.com/q/28956831
tags question: http://stackoverflow.com/q/29041214
tags question: http://stackoverflow.com/q/28968928
tags question: http://stackoverflow.com/q/29053731
tags question: http://stackoverflow.com/q/28971942
tags question: http://stackoverflow.com/q/29044631
tags question: http://stackoverflow.com/q/28921414
tag name: svg
tags question: http://stackoverflow.com/q/28992005
tags question: http://stackoverflow.com/q/28987690
tags question: http://stackoverflow.com/q/28935312
tags question: http://stackoverflow.com/q/28995955
tags question: http://stackoverflow.com/q/29011717
tags question: http://stackoverflow.com/q/28954327
tags question: http://stackoverflow.com/q/28951362
tags question: http://stackoverflow.com/q/28919529
tags question: http://stackoverflow.com/q/28990869
tags question: http://stackoverflow.com/q/28954880
tags question: http://stackoverflow.com/q/28931853
tags question: http://stackoverflow.com/q/29038874
tags question: http://stackoverflow.com/q/28990025
tags question: http://stackoverflow.com/q/28948461
tags question: http://stackoverflow.com/q/28989361
tags question: http://stackoverflow.com/q/28992878
tags question: http://stackoverflow.com/q/29018116
tags question: http://stackoverflow.com/q/29009566
tags question: http://stackoverflow.com/q/28952663
tags question: http://stackoverflow.com/q/28912858
tags question: http://stackoverflow.com/q/29016561
tags question: http://stackoverflow.com/q/28950276
tags question: http://stackoverflow.com/q/29053299
tags question: http://stackoverflow.com/q/29024270
tags question: http://stackoverflow.com/q/28958905
tags question: http://stackoverflow.com/q/28953030
tags question: http://stackoverflow.com/q/29036805
tags question: http://stackoverflow.com/q/29061016
tags question: http://stackoverflow.com/q/28912047
tags question: http://stackoverflow.com/q/28932963
type: Tag

http://stackoverflow.com/comment/46240716
type: QuestionComment
score: 1
has text: Wow, never knew you could query a database from jQuery
comment on: http://stackoverflow.com/q/28996193
type: Comment

http://stackoverflow.com/comment/46353491
type: Comment
type: QuestionComment
has text: @Urahara, it seems that `marko` is first and foremost a templating engine, and considering I already have the content covered, it would be way too heavy to use just for injecting http data. Thanks for the suggestion, though.
comment on: http://stackoverflow.com/q/29058371
score: 0

http://stackoverflow.com/q/29013891
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: rest
tagged with: zend-framework2
has title: ZF2: Restful and image combination
tagged with: angularjs
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/29076056
has body: I am building a site using Zend Framework 2 and AngularJS. I have a restful webservice running in ZF2 and I use AngularJS on the client to access that webservice. Now I want to add a photo album to my site, and I have the following question around this subject: How do I give the images to AngularJS? Should I just return a json with the links to the directories on the server. And then load it using &lt;img src="" /&gt;, or are there other, beter ways?

http://stackoverflow.com/q/29032382
tagged with: jquery
has comment: http://stackoverflow.com/comment/46305934
downvote count: 0
favorite count: 0
tagged with: currency
answer count: 0
type: UnansweredQuestion
has body: I am trying to use Jquery Mask Html: &lt;script src="~/Content/jquery.mask.js"&gt;&lt;/script&gt; &lt;input id="test1" type="text" data-mask-maxlength="false" /&gt; Javascript/Jquery: $("#test1").mask('000.000.000.000.000.000.000', { reverse: true }); I tried below function RemoveRougeChar(convertString) { if (convertString.substring(0, 1) == ",") { return convertString.substring(1, convertString.length) } return convertString; } $("#test1").on("focus", function (e) { var $this = $(this); var num = $this.val().replace(/,/g, ""); $this.val(num); }).on("blur", function (e) { var $this = $(this); var num = $this.val().replace(/[^0-9]+/g, '').replace(/,/gi, "").split("").reverse().join(""); var num2 = RemoveRougeChar(num.replace(/(.{3})/g, "$1,").split("").reverse().join("")); $this.val(num2); }); Question: I have value as below, 1 10 100 100.000 1.000.000 If user add comma last of value as below 1,00 10,0 100,00 100.000,0 1.000.000,00 User only add 1 or 2 numbers more after comma after last number like above values. How can i provide this by using jquery mask
upvote count: 1
score: 1
tagged with: mask
type: Question
has title: Jquery mask add comma last
tagged with: javascript

http://stackoverflow.com/comment/46227260
type: AnswerComment
has text: I really appreciate you for rewriting the javascript, but how can I make the anchor clickable with the dynamic element?
type: Comment
comment on: http://stackoverflow.com/a/28988093
score: 0

http://stackoverflow.com/q/29019376
has comment: http://stackoverflow.com/comment/46282770
has body: So I'm trying to write a function which gets the params and calls the scan method of DynamoDB which returns the paginated result and also I'm getting limit as an input from params, so I don't want to call my scan function recursively to get all data, instead I want to get data as much as limit has been passed as a param. I tried the following block of code, but it seems my logic is not right! could you please help me what I'm doing wrong? function scan(params, total, callback) { dynamo.scan(params, function(err, data) { if (err) { callback(err, data); } else { if (((!params.Limit || (params.Limit &amp;&amp; total.length &lt; params.Limit))) &amp;&amp; data.Items &amp;&amp; data.LastEvaluatedKey) { params.ExclusiveStartKey = data.LastEvaluatedKey; (function(data) { scan(params, data.Items.concat(data.Items), function(err, result) { data.Items = data.Items.concat(result.Items); if (result.LastEvaluatedKey) data.LastEvaluatedKey = result.LastEvaluatedKey; callback(err, data); }); } (data)); } else { callback(err, total); //Here it says undefined is not a function } } }); } Calling by the following code: //params is stuffed with needed parameters for scan method of DynamoDB scan(params,[],function(err, data){ //Processing data here })
upvote count: 2
has comment: http://stackoverflow.com/comment/46287869
type: UnansweredQuestion
tagged with: amazon-dynamodb
has comment: http://stackoverflow.com/comment/46405637
downvote count: 1
tagged with: node.js
tagged with: recursion
score: 1
has comment: http://stackoverflow.com/comment/46309049
has answer: http://stackoverflow.com/a/29038890
type: Question
has comment: http://stackoverflow.com/comment/46288278
answer count: 1
tagged with: javascript
favorite count: 0
has title: Recursive callback
has comment: http://stackoverflow.com/comment/46288500
has comment: http://stackoverflow.com/comment/46283996

http://stackoverflow.com/q/28940297
accepted answer: http://stackoverflow.com/a/28940321
has answer: http://stackoverflow.com/a/28940444
favorite count: 0
upvote count: 1
tagged with: css
has body: I am having the following inline class Lorem Ipsum is a dummy text, Lorem Ipsum is a dummy text I need to find Top from inline class and i have to add 20px to top. How to do this using Jquery/javascript. i can't able to do this.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28940327
score: 1
has answer: http://stackoverflow.com/a/28940327
has answer: http://stackoverflow.com/a/28940321
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: How to get top value from a inline class
answer count: 3

http://stackoverflow.com/q/28921910
tagged with: excel
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: javascript
tagged with: ajax
has title: How to import excel file using phpexcel and ajax?
score: 0
tagged with: sql
has answer: http://stackoverflow.com/a/28921939
accepted answer: http://stackoverflow.com/a/28921939
tagged with: php
has body: I have a problem in importing the excel file using PHPExcel, when im trying to import, there is a fatal error: Couldn't open 'filename.xls', File does not exist. How can i solve this? This is my code so far. javascript / Ajax uploading file: function load_file(id,url,type,data,json,callback) { var xmlhttp; var fdata = new FormData(); fdata.append('SelectedFile', data); (window.XMLHttpRequest)?xmlhttp = new XMLHttpRequest():xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { ((id != "")?(document.getElementById(id).innerHTML = xmlhttp.responseText):(((json == true)?(callback(JSON.parse(xmlhttp.responseText))):(callback(xmlhttp.responseText))))); } } xmlhttp.open(type,url,true); if(type == "POST") { xmlhttp.send(fdata); } else { xmlhttp.send(); } } load_file("","../../../phpscript/management/import_excel.php","POST",subNavigationAidToolFileInput.files[0],false,function(data) { alert(data); }); PHP: /* Database Connection */ include_once "../global/db_connect.php"; require "../../resources/widgets/PHPExcel_1.8.0_doc/Classes/PHPExcel.php"; require_once "../../resources/widgets/PHPExcel_1.8.0_doc/Classes/PHPExcel/IOFactory.php"; $Connection = new connection(); $objPHPExcel = PHPExcel_IOFactory::load($_FILES['SelectedFile']['name']); foreach ($objPHPExcel-&gt;getWorksheetIterator() as $worksheet) { $worksheetTitle = $worksheet-&gt;getTitle(); $highestRow = $worksheet-&gt;getHighestRow(); // e.g. 10 $highestColumn = $worksheet-&gt;getHighestColumn(); // e.g 'F' $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn); } echo $_FILES['SelectedFile']['name'];

http://stackoverflow.com/q/28913452
tagged with: heroku
score: 3
tagged with: javascript
downvote count: 0
has body: I'm getting an error everytime I try to push to heroku via Heroku Buildpack for Ember CLI. I've read through the following with no success: https://github.com/tonycoco/heroku-buildpack-ember-cli/issues/15 https://github.com/tonycoco/heroku-buildpack-ember-cli/issues/51 Anyone know what could be going wrong? remote: -----> Pruning cached bower dependencies not specified in bower.json remote: -----> Caching node_modules directory for future builds remote: -----> Cleaning up node-gyp and npm artifacts remote: bower loader.js#1.0.1 mismatch Version declared in the json (0.0.0) is different than the resolved one (1.0.1) remote: bower ember-qunit#0.2.8 invalid-meta ember-qunit is missing "main" entry in bower.json remote: bower ember-data#1.0.0-beta.12 invalid-meta ember-data is missing "ignore" entry in bower.json remote: bower ember#1.10.0 invalid-meta ember is missing "ignore" entry in bower.json remote: bower ECONFLICT Unable to find suitable version for ember-data remote: remote: ! Push rejected, failed to compile Ember CLI app
tagged with: ember-cli
favorite count: 0
has title: Ember CLI : Heroku build fails
type: UnansweredQuestion
tagged with: ember.js
answer count: 0
upvote count: 3
type: Question

http://stackoverflow.com/comment/46262120
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29008144
has text: check this may be u can understand bit clearly http://stackoverflow.com/questions/26493745/tofixed-simple-use-explanation-in-text-field
score: 0

http://stackoverflow.com/comment/63116359
type: Comment
has text: What about if you want to set state in response to a state change? E.g. one piece of state information can only be obtained by an asynchronous call based on some other piece of state information. In these cases I think (?) the React way is to split the component in two but I also feel it is valid to call `setState` inside `componentWillUpdate` with the caveats I describe in my answer below: http://stackoverflow.com/a/37448089/274677
type: AnswerComment
comment on: http://stackoverflow.com/a/28945173
score: 0

http://stackoverflow.com/comment/46221210
has text: I tested also one in place of on ... it change nothing
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28986234

http://stackoverflow.com/comment/46175977
type: Comment
has text: Did you add the javascript phonegap reference(s) to the page header so the `navigator.notification.alert` is accessible? Looks it is not initialized.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28961807

http://stackoverflow.com/q/28942607
tagged with: jsp
tagged with: javascript
has title: how to pass a value from JavaScript to JSP
score: 0
has comment: http://stackoverflow.com/comment/46168058
has comment: http://stackoverflow.com/comment/46168067
tagged with: applet
has comment: http://stackoverflow.com/comment/46163319
has comment: http://stackoverflow.com/comment/46144081
type: UnansweredQuestion
answer count: 0
has body: I have a requirement that I need to get the byte array value from applet to JSP so that I have used JavaScript in my JSP and I got the byte array perfectly but the value is in side the JavaScript method only I need to get that value out side of JavaScript so that I can pass that value to controller class can any body please tell me the solution here is my JavaScript method var bytes=[]; function accessAppletMethod() { var a= document.AppletABC.run(); console.log('byte Array Expected : '+a); bytes = a.split('~'); alert("bytes..."+bytes);
type: Question

http://stackoverflow.com/comment/72128354
type: AnswerComment
type: Comment
has text: While answers are always welcome, including a brief explanation of *how* the code solves the problem is more helpful to others. It also reduces the likelihood the post will end up in the "Very-Low-Quality" queue (as this one did).
comment on: http://stackoverflow.com/a/42491156
score: 1

http://stackoverflow.com/comment/46342515
has text: And you can always use the net tab of Firebug (or of the built-in debugger of FF or Chrome). There you can check if you have access to the js file
score: 0
comment on: http://stackoverflow.com/q/29052270
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46138873
type: AnswerComment
type: Comment
has text: Do you know any other library that has this feature?
comment on: http://stackoverflow.com/a/28941691
score: 0

http://stackoverflow.com/q/28999432
has body: I have something like this: And, i must replace 'Product: Name' for prod var But that syntax is incorrect to js. I'm trying the next syntaxis but doesn't works: Any idea to set correctly the prod var?
has title: Set dynamic parameter in ga command in angularjs
score: 0
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28999672
tagged with: google-analytics
type: Question
tagged with: javascript

http://stackoverflow.com/a/29021001
has comment: http://stackoverflow.com/comment/46285766
has body: Assuming the first example is a Javascript object, you could convert it into a JSON string using JSON.stringify: JSON.stringify({name:"User 01"}); outputs: "{"name":"User 01"}" Assuming String If the first example is a string, I think you would have to parse through it with methods like split.
score: 8
answers question: http://stackoverflow.com/q/29020931
downvote count: 0
upvote count: 8
type: Answer
has comment: http://stackoverflow.com/comment/46285412

http://stackoverflow.com/comment/46180091
type: QuestionComment
comment on: http://stackoverflow.com/q/28963734
type: Comment
score: 1
has text: Shouldn't it just be `grunt.file.read("temp/assets.json")` and not `'<%= grunt.file.read("temp/assets.json") %>'`?

http://stackoverflow.com/q/29017440
type: Question
upvote count: 9
tagged with: webpack
tagged with: javascript
has title: Shimming a package with webpack
score: 9
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29017627
has body: There's a javascript file that I need to use in my project as a dependency. It doesn't have a github repository, it's not on bower, or npm, it just lives here. http://a.klaviyo.com/media/js/learnmarklet.js I can install it with bower with: bower install http://a.klaviyo.com/media/js/learnmarklet.js --save I know that it will then live in my project at: ./bower_components/learnmarklet/index.js And I know it attaches a variable called _learnq to the global window object. What I want is simply this. var _learnq = require("klaviyo") I need to alias klaviyo something like this. { "klaviyo": "./bower_components/learnmarklet/index.js" } And "shim" an export of the _learnq variable like this. { "klaviyo": "_learnq" } How can I do this with webpack? This is what i've tried, this is what my webpack.config.js looks like. module.exports = { resolve:{ alias:{ "klaviyo": "./bower_components/learnmarklet/index.js" } }, externals: { klaviyo: "_learnq" } }
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29017627

http://stackoverflow.com/a/29001244
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28989887
has body: Please add this code on css. hope it will be useful for you @media screen and (min-width: 768px){ .dropdown:hover &gt; .dropdown-menu{display: block !important;} }

http://stackoverflow.com/q/28966327
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/46184580
accepted answer: http://stackoverflow.com/a/29894468
answer count: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28992383
tagged with: webstorm
has answer: http://stackoverflow.com/a/29894468
favorite count: 0
tagged with: browserify
possible better answer: http://stackoverflow.com/a/28992383
linked to: http://stackoverflow.com/q/20158401
tagged with: npm
upvote count: 3
has title: Browserify paths and Webstorm configuration
has body: I build my project with gulp and use browserify. To make path resolution easier i configurated browserify var b = browserify('./app', {paths: ['./node_modules','./src/js']}); The problem is that WebStorm IDE don't know about this and doesn't help me with intellisense when i require files. For example intellisense does't work on the following line var Store = require('lib/account/stores/account-store'); Is there any way i can make Webstorm IDE aware of my paths settings?
type: Question

http://stackoverflow.com/a/29049293
type: Answer
has body: Pass event as an argument to your function and add this statement. event.preventDefault() inside of addstoppoint function.
upvote count: 1
answers question: http://stackoverflow.com/q/29049282
downvote count: 0
score: 1

http://stackoverflow.com/a/28998786
answers question: http://stackoverflow.com/q/28998696
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28998696
type: Answer
has comment: http://stackoverflow.com/comment/46245837
has body: xmlhttp.open("POST", "&lt;?php echo site_url("/rhadmin/testing/"); ?&gt;"+str,true);
score: 0

http://stackoverflow.com/a/29046022
has comment: http://stackoverflow.com/comment/46331003
has comment: http://stackoverflow.com/comment/46331308
score: 2
has comment: http://stackoverflow.com/comment/46331303
has comment: http://stackoverflow.com/comment/46382784
has comment: http://stackoverflow.com/comment/46383754
has comment: http://stackoverflow.com/comment/46331212
has comment: http://stackoverflow.com/comment/46331319
has comment: http://stackoverflow.com/comment/46331077
downvote count: 0
has comment: http://stackoverflow.com/comment/46331028
has comment: http://stackoverflow.com/comment/46331276
has comment: http://stackoverflow.com/comment/46331261
has comment: http://stackoverflow.com/comment/46331085
has comment: http://stackoverflow.com/comment/46330980
has comment: http://stackoverflow.com/comment/46331186
has body: "https://demo.ippayments.com.au/access/index.aspx" this should be same domain with your javascript, otherwise, you should set : Access-Control-Allow-Origin: * on target page's response header to get work. See http://enable-cors.org/ For example you can put below in web.config on target server: &lt;configuration&gt; &lt;system.webServer&gt; &lt;httpProtocol&gt; &lt;customHeaders&gt; &lt;add name="Access-Control-Allow-Origin" value="*" /&gt; &lt;/customHeaders&gt; &lt;/httpProtocol&gt; &lt;/system.webServer&gt; &lt;/configuration&gt;
answers question: http://stackoverflow.com/q/29045889
upvote count: 2
has comment: http://stackoverflow.com/comment/46331293
has comment: http://stackoverflow.com/comment/46381850
has comment: http://stackoverflow.com/comment/46331165
type: Answer
has comment: http://stackoverflow.com/comment/46331189

http://stackoverflow.com/a/29032803
has comment: http://stackoverflow.com/comment/46306876
answers question: http://stackoverflow.com/q/29032700
has comment: http://stackoverflow.com/comment/46306785
score: 0
has body: Try this: var str = 'radio_3_78'; var splitStr = str.split('_'); var result = splitStr[0] + '_' + splitStr[1]; http://jsfiddle.net/7faag7ug/2/
type: Answer

http://stackoverflow.com/q/28953088
has answer: http://stackoverflow.com/a/28953418
has comment: http://stackoverflow.com/comment/46161737
tagged with: node.js
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has body: when I try to return success, I always receive an error. Here is my script code: $.ajax({ xhr: function(){ var xhr = new window.XMLHttpRequest(); //Upload progress xhr.upload.addEventListener("progress", function(evt){ console.log('up'); uploadProgress(evt); }, false); //Download progress xhr.addEventListener("progress", function(evt){ console.log('down'); }, false); return xhr; }, url : 'upload', type: 'POST', data: data, cache: false, dataType: 'xml', processData: false, contentType: false, success: function (result) { alert('success!'); }, error: function(err){ alert("error --'"); console.log(err); } }); And I try to return the success message with this: var response = { status : 200, success : 'Updated Successfully' } res.type('json'); res.end(JSON.stringify(response)); or this: res.end('{"success" : "Updated Successfully", "status" : 200}'); or this: res.status(200).send(JSON.parse('{"success":"Hey"}')); e.t.c ... And I always have an error alert. . .
has comment: http://stackoverflow.com/comment/46160455
type: Question
has title: Return Success on NodeJS + AJAX&XML
has comment: http://stackoverflow.com/comment/46159792
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/28954050
accepted answer: http://stackoverflow.com/a/28954050
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46160756
has comment: http://stackoverflow.com/comment/46160610
possible better answer: http://stackoverflow.com/a/28953418

http://stackoverflow.com/comment/46256294
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29003364
has text: I tried the things described in stackoverflow.com/a/19834224/1297435, but t=still its showing the same error.

http://stackoverflow.com/comment/46281798
score: 0
type: QuestionComment
type: Comment
has text: Can you post what the actual data looks like? And the call that receives this datsa?
comment on: http://stackoverflow.com/q/29018963

http://stackoverflow.com/comment/46244477
type: AnswerComment
comment on: http://stackoverflow.com/a/28997718
score: 0
has text: Re if statement: braces not required in this instance - http://stackoverflow.com/questions/7117873/do-if-statements-in-javascript-require-curly-braces
type: Comment

http://stackoverflow.com/a/29027157
score: 2
downvote count: 0
type: Answer
upvote count: 2
has body: take a look into html2canvas here example with description http://www.kubilayerdogan.net/html2canvas-take-screenshot-of-web-page-and-save-it-to-server-javascript-and-php/
answers question: http://stackoverflow.com/q/29027097

http://stackoverflow.com/a/28908633
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46076733
downvote count: 0
has body: I don't believe it supports it within a single function call. But, you could chain calls to .add(): $().add($selector1).add($selector2).add(document.getElementById('test')) When given an Array, jQuery() generally expects the contents to already be Elements. Otherwise, it treats it as using the jQuery(object) overload, leaving the strings as is. console.log( $(['#foo', '#bar']).get() ); // [ '#foo', '#bar' ]
answers question: http://stackoverflow.com/q/28908523
type: Answer

marker
tag name: marker
tags question: http://stackoverflow.com/q/29030402
type: Tag

http://stackoverflow.com/comment/46181581
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28964912
has text: Are you working on phonegap?
score: 0

http://stackoverflow.com/comment/46230307
comment on: http://stackoverflow.com/a/28990357
type: AnswerComment
has text: @AaditMShah try the same without var, worked for me. I dont know what is going on. :D
type: Comment
score: 0

http://stackoverflow.com/q/28979912
upvote count: 1
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/46209948
type: UnansweredQuestion
tagged with: javascript
linked to: http://stackoverflow.com/q/17636528
has body: I am trying to change the contents of a div when i click on a link in another div. I have used the javascript function: function load_home(){ document.getElementById("content").innerHTML='&lt;object type="type/html" data="home.html" &gt;&lt;/object&gt;'; } However, the page being loaded in the div 'content' is appearing as a small scrollable box. The size of the div 'content' is fixed and is occupying the part of the page i want it to. Any idea how i can change the size of that box being loaded?
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: How to load a page in a div using innerHtml and javascript
duplicate of: http://stackoverflow.com/q/17636528
has answer: http://stackoverflow.com/a/28980515
favorite count: 0
score: 0
tagged with: innerhtml

http://stackoverflow.com/q/29013984
tagged with: jquery
has answer: http://stackoverflow.com/a/29014052
has answer: http://stackoverflow.com/a/29014051
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29014049
has title: Styling each a different way with JQuery
type: Question
has comment: http://stackoverflow.com/comment/46272856
has body: weird little bug I can't figure out, I have the following line: $("#ingredientlist").append('&lt;li&gt;' + value + ' parts ' + capitalize(index + '') + '&lt;/li&gt;').css("color", curColor); Basically, in a previous statement I get curColor, which is different depending on what value I'm on. I checked the colors and they're different each time. I want each &lt;li&gt; to be styled to a specific color, so I tried setting the .css() to that, but all my entries are the same color. Any ideas? Thanks
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/29014052
has answer: http://stackoverflow.com/a/29014049
tagged with: javascript

http://stackoverflow.com/a/29021021
score: 0
type: Answer
has body: Try using the jQuery's post method to send the values, first using param to serialize your x/y indices: var things = { Xindex: xIndex, Yindex: yIndex }; var data = $.param(things); $.post(url_to_your_method, data, function (result) { // doing stuff... }); 'result' will be the string that storeXY is returning. The $.post() method is shorthand for $.ajax() which will let you manipulate server side code.
answers question: http://stackoverflow.com/q/29016486

http://stackoverflow.com/q/28910131
tagged with: jquery
score: 0
tagged with: xcode
answer count: 1
has answer: http://stackoverflow.com/a/28910554
has title: Go to div + change tab
has comment: http://stackoverflow.com/comment/46079483
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46079381
has body: I have a Tab menu (3 tabs) and I would like to find out, if there is a code that works like this: i press a button then i go automatically to the top of the site (for example "go to div" ) and automatically changes the Tab to second one? Something like this: (source: pictap.pl)
accepted answer: http://stackoverflow.com/a/28910554
type: Question
tagged with: javascript

http://stackoverflow.com/comment/46342688
has text: http://codepen.io/manifestinteractive/pen/viaAK? (not mine)
comment on: http://stackoverflow.com/q/29052005
score: 4
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46078388
has text: You don't appear to have an element with the id `calculate` and you've failed to use the Stackoverflow code formatting tools (as well as the snippet feature which could provide a live demo of the problem).
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28909610
type: Comment

http://stackoverflow.com/comment/46098386
comment on: http://stackoverflow.com/a/28920475
score: 1
type: AnswerComment
has text: g is for checking globally in the string.
type: Comment

http://stackoverflow.com/a/29008519
score: 5
answers question: http://stackoverflow.com/q/29003120
accepted answer of: http://stackoverflow.com/q/29003120
type: AcceptedAnswer
upvote count: 5
type: Answer
has body: You'll need to modify the library. Find this part: google.maps.event.addDomListener(this.markerContent_, 'click', function(e) { google.maps.event.trigger(that, 'click'); }); and change it to google.maps.event.addDomListener(this.markerContent_, 'click', function(e) { e.stopPropagation(); google.maps.event.trigger(that, 'click'); });
downvote count: 0
has comment: http://stackoverflow.com/comment/77882160

http://stackoverflow.com/comment/46274048
comment on: http://stackoverflow.com/q/29013838
has text: You could test if it was hoisted by simply console.logging `declarFunc` at the top, you'll get undefined. If you unwrap it the console.log will then give you the function.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/46233466
comment on: http://stackoverflow.com/a/28975752
score: 0
type: Comment
has text: I am declaring and defining two variables, each with the var statement, as a comma separated list. The line break is not significant. So instead of writing var a = 1; var b = 2; i wrote var a = 1, b = 2; which is equivalent to the prior statement. It's a bit more concise but arguably a bit less clear, so it's a matter of taste and the context you are writing in.
type: AnswerComment

http://stackoverflow.com/comment/46310308
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29034715
has text: thanks! it works! it saved me a lot of headache, i appreciate it!
type: AnswerComment

http://stackoverflow.com/q/28927618
upvote count: 4
answer count: 3
downvote count: 0
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/46111211
favorite count: 0
has comment: http://stackoverflow.com/comment/46112239
tagged with: angularjs
has body: I have a view where I render tweets. Inside the tweets, there is the user_mentions array. From this array, I want to get one user, make another request to the API, get the avatar for the user and then render it. The view looks like: &lt;md-item ng-repeat="item in content"&gt; &lt;div class="md-tile-left" ng-if="item.show"&gt; &lt;img ng-src="{{item.thumb}}" class="face" alt="{{item.name}}"&gt; &lt;/div&gt; &lt;div class="md-tile-content"&gt; {{item.text}} &lt;/div&gt; &lt;/md-item&gt; content variable will contain all the tweets. Initially, content[i].show is false for all i. The controller code looks like: for(var i = 0; i &lt; data.length; i++) { if(data[i].user_mentions[0]) { UserAvatar.get(data[i].user_mentions[0].screen_name).then(function(data){ $scope.content[i].thumb = data.avatar; $scope.content[i].show = true; }); } } Now, the problem I am facing is that after the UserAvatar service is called, variable i will continue to increment. So, by the time the callback is reached, i will have the value of data.length (hence, an error of undefined will be thrown). I have found a work-around by passing i to the API and then getting it back: UserAvatar.get(data[i].user_mentions[0].screen_name, i).then(function(data){ $scope.content[i].thumb = data.avatar; $scope.content[i].show = true; }); I realise that this is just a hack to make it work, but is there a more clever way of doing it?
has answer: http://stackoverflow.com/a/28927916
type: AnsweredQuestion
score: 4
possible better answer: http://stackoverflow.com/a/28927862
has answer: http://stackoverflow.com/a/28927862
has title: Async update of array in Angular
type: Question
has answer: http://stackoverflow.com/a/28927865
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28927916

http://stackoverflow.com/comment/46088709
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28915151
has text: If you convert all faces then all faces will simply flip, meaning that certain faces that were facing the right way, will also convert. So select faces you want to flip with 'Ctrl' and flip them.

http://stackoverflow.com/comment/46132501
type: Comment
type: QuestionComment
has text: try to click on more than one date to turn them active (blue), then click on them again .. you will see the problem @CodingCracker
comment on: http://stackoverflow.com/q/28938628
score: 0

http://stackoverflow.com/a/29014493
accepted answer of: http://stackoverflow.com/q/29011751
has comment: http://stackoverflow.com/comment/46274750
answers question: http://stackoverflow.com/q/29011751
score: 0
type: AcceptedAnswer
type: Answer
has body: You can bind it with a click or a hover. Click: $('.resizable').resizable({ handles: 'se' }); //////////////////////////////////////////////////////////////////////////////////// //how do I get the below working? These $('.resizable') DIV are created dynamically $('.resizable').on('click', function() { $(this).addClass('focus'); }); $(document).on('click', function(e) { if (!$(e.target).closest('.resizable').length) { $('.resizable').removeClass('focus'); } }); .resizable{ width: 100px; height: 100px; background-color: red; display: inline-block; } .resizable.focus { background: #f0f; } .resizable .ui-resizable-handle { background-color: black; display: none !important; } .resizable.focus .ui-resizable-handle { display: block !important; } &lt;div id="dragDiv1" class="resizable"&gt;&lt;/div&gt; &lt;div id="dragDiv2" class="resizable"&gt;&lt;/div&gt; &lt;div id="dragDiv3" class="resizable"&gt;&lt;/div&gt; Or, if you want the hover, just replace the .resizable.focus with .resizable:hover. http://jsfiddle.net/sjchn0L8/2/
has comment: http://stackoverflow.com/comment/46275130

http://stackoverflow.com/a/28940874
has body: The canvas API is only for drawing in raster. That's why it doesn't retain clarity when it resizes. It's to be expected. If you'd want to produce vector, you'd have to use SVG (Scalable Vector Graphics) instead. But the SVG doesn't support drawing. Producing SVG is basically through XML, so it's not flexible the same way as the canvas API is. Here's a library that will help you accomplish drawing to the canvas in vector: http://paperjs.org/ "Paper.js is an open source vector graphics scripting framework that runs on top of the HTML5 Canvas." Here's another thread which enumerates more options: HTML5 Canvas Vector Graphics?
has comment: http://stackoverflow.com/comment/46136844
has comment: http://stackoverflow.com/comment/46137583
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/46136493
has comment: http://stackoverflow.com/comment/46136636
answers question: http://stackoverflow.com/q/28940685
score: 3
has comment: http://stackoverflow.com/comment/46137354
has comment: http://stackoverflow.com/comment/46137233
has comment: http://stackoverflow.com/comment/46136404
has comment: http://stackoverflow.com/comment/46136919
has comment: http://stackoverflow.com/comment/46137498
downvote count: 0
has comment: http://stackoverflow.com/comment/46136833

http://stackoverflow.com/comment/46212064
type: AnswerComment
has text: first -- you forgot backslash at first `(` symbol. Instead of `\.setDisplayFormat\s*((?!\s*["'](shortdate|shortdate shorttime|shortdate longtime|longdate|longdate shorttime|longdate longtime|longtime|shorttime)["'])` it should be `\.setDisplayFormat\s*\((?!\s*["'](shortdate|shortdate shorttime|shortdate longtime|longdate|longdate shorttime|longdate longtime|longtime|shorttime)["'])`. And this is the right regex, because second one matches this string (with backslash added) `object.setDisplayFormat ( "shortdate");`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28960422

http://stackoverflow.com/comment/46159032
comment on: http://stackoverflow.com/q/28952375
has text: Please have a look at this [SO question](http://stackoverflow.com/questions/17935601/how-to-remove-responsive-features-in-twitter-bootstrap-3). It's pretty similar.
type: Comment
type: QuestionComment
score: 0

lodash
tags question: http://stackoverflow.com/q/29001762
tags question: http://stackoverflow.com/q/28965966
tags question: http://stackoverflow.com/q/28993520
tag name: lodash
tags question: http://stackoverflow.com/q/29050518
type: Tag
tags question: http://stackoverflow.com/q/29001247
tags question: http://stackoverflow.com/q/28972966
tags question: http://stackoverflow.com/q/28928210
tags question: http://stackoverflow.com/q/29017356
tags question: http://stackoverflow.com/q/28968594
tags question: http://stackoverflow.com/q/29003057
tags question: http://stackoverflow.com/q/29030903
tags question: http://stackoverflow.com/q/28970676
tags question: http://stackoverflow.com/q/28975820
tags question: http://stackoverflow.com/q/29055671

http://stackoverflow.com/a/29076381
accepted answer of: http://stackoverflow.com/q/29035079
answers question: http://stackoverflow.com/q/29035079
score: 0
type: Answer
type: AcceptedAnswer
has body: Load the JSONp file ondocumentready, or when you need it.

http://stackoverflow.com/q/29035883
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/49748798
favorite count: 0
has answer: http://stackoverflow.com/a/29036182
tagged with: css
has answer: http://stackoverflow.com/a/30977325
answer count: 4
tagged with: neat
has title: Bourbon Refill Navigation Menu slide up on click
has answer: http://stackoverflow.com/a/30846128
has answer: http://stackoverflow.com/a/30989676
upvote count: 7
type: Question
possible better answer: http://stackoverflow.com/a/30846128
type: AnsweredQuestion
tagged with: bourbon
has body: I am using the Bourbon Refill navigation menu, and want to modify it so when a link is clicked on in small mode the menu slides back up. At the moment the menu drops down, but when a menu item is clicked the menu stays dropped down. As I am using scroll-on-page with a fixed top menu this means a lot of the content is hidden behind the menu. Here is the code on Codepen: http://codepen.io/mikehdesign/pen/LVjbPv/ My existing code is below: HTML Menu About Us Contact Testimonials Sign up SCSS .navigation { $large-screen: em(860) !default; $large-screen: $large-screen; // Mobile view .navigation-menu-button { display: block; float: right; margin: 0; padding-top: 0.5em; @include media ($large-screen) { display: none; } } // Nav menu .navigation-wrapper { @include clearfix; position: relative; } .logo { float: left; img { max-height: 2em; padding-right: 1em; } } nav { float: none; @include media ($large-screen) { float: left; line-height: 1.5em; padding-top: 0.3em; } } ul.navigation-menu { clear: both; display: none; margin: 0 auto; overflow: visible; padding: 0; width: 100%; @include media ($large-screen) { display: block; margin: 0; padding: 0; } &.show { display: block; } } // Nav items ul li.nav-link { display: block; text-align: right; width: 100%; @include media ($large-screen) { background: transparent; display: inline; text-decoration: none; width: auto; } } li.nav-link a { display: inline-block; @include media ($large-screen) { padding-right: 1em; } } } JS $(document).ready(function() { var menuToggle = $('#js-mobile-menu').unbind(); $('#js-navigation-menu').removeClass("show"); menuToggle.on('click', function(e) { e.preventDefault(); $('#js-navigation-menu').slideToggle(function(){ if($('#js-navigation-menu').is(':hidden')) { $('#js-navigation-menu').removeAttr('style'); } }); }); }); Help greatly appreciated Mike
score: 7
accepted answer: http://stackoverflow.com/a/30989676

http://stackoverflow.com/q/28925098
has comment: http://stackoverflow.com/comment/46106606
tagged with: regex
duplicate of: http://stackoverflow.com/q/4244896
accepted answer: http://stackoverflow.com/a/28925127
favorite count: 0
score: -1
type: AnsweredQuestion
downvote count: 1
type: Question
has title: Return part of string with RegEx
tagged with: search
has answer: http://stackoverflow.com/a/28925127
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: string
linked to: http://stackoverflow.com/q/4244896
has comment: http://stackoverflow.com/comment/46106591
has body: First of all, Sorry, I'm newbie in Regular Expression so I cannot found the format for my RegEx. I have a string like this : { "xs:schema" : { "xs:element" : { "xs:complexType" : { "xs:choice" : { "xs:element" : { "xs:complexType" : { "xs:sequence" : { "xs:element":null } } } } } } }, "diffgr:diffgram" : { "NewDataSet" : { "Table" : { "Item1" : 12345, "Item2":"Part" } } } } I want select just this part of my string: "NewDataSet" : { "Table" : { "Item1" : 12345, "Item2":"Part" } } how can I do it ?

http://stackoverflow.com/comment/46206704
has text: thank you this should help do the trick. appreciate. sorry this my small last request, how do I set the width of an item in javascript in terms of % for example http://jsfiddle.net/UTp4T/43/ I want the width of the image to be 100%
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28975902
score: 0

http://stackoverflow.com/comment/46341236
score: 0
comment on: http://stackoverflow.com/q/29000096
type: Comment
type: QuestionComment
has text: That is interesting, I found http://isotope.metafizzy.co/faq.html which is the exact example. I am still interested in the logic behind how this is done so I could create something like this without a plugin.

attributes
tags question: http://stackoverflow.com/q/29033497
tags question: http://stackoverflow.com/q/29001860
tag name: attributes
type: Tag
tags question: http://stackoverflow.com/q/28989222
tags question: http://stackoverflow.com/q/28996244
tags question: http://stackoverflow.com/q/29045438

http://stackoverflow.com/q/28945551
tagged with: three.js
has comment: http://stackoverflow.com/comment/51098909
tagged with: video
has comment: http://stackoverflow.com/comment/46257629
has body: I have a Three.js project that tries to load four videos (about 40MB each) and place them on a simple model of a room. It works fine when I use 4 small videos, but when I use the bigger videos the sound loads but the video doesn't. I'm probably doing something stupid or repetitive... the page is here... https://googledrive.com/host/0Bznu7JgRtB5CLVVfb2Zub05YdVE/Three.js/cliffords.html
type: Question
has comment: http://stackoverflow.com/comment/46179090
has title: Video Not Loading in Three.js
tagged with: javascript
score: 0
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/29035736
score: 0
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/29035761
tagged with: callback
accepted answer: http://stackoverflow.com/a/29035761
tagged with: getjson
possible better answer: http://stackoverflow.com/a/29035841
has title: How to access index variable in a jquery getJson call ($.getJson) during a loop?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29035841
type: Question
has body: I have the following code, which has been simplified for this question. Basically i have a loop, that, on each iteration, calls the jquery getJSON function, calling out to a API end point to grab some weather data. The problem is that i need to access the index from the loop, when the getJSON request was fired, and am having some troubles with it. I need to know what index the request was for, so i can match it with some data from a database. The code: function buildCities() { for (var i = 0; i &lt; 7; i++) { var jqxhr = $.getJSON("http://api.openweathermap.org/data/2.5/weather?q=usa,phoenix&amp;units=metric", function(response) { alert(i); //this will always be 7 - this is the issue. i desire it to be 0,1,2,3, etc.... }); } } Here is a JSFiddle that shows the issue, and that you can work on if need be ;) - http://jsfiddle.net/5tr34k/0xshvrzp/ The request: How can i inject or otherwise access this index (i) inside of the callback function for the request ? Thanks for any help.
tagged with: javascript

http://stackoverflow.com/comment/46144463
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28944664
type: AnswerComment
has text: I edited my answer, you can try something like that.

http://stackoverflow.com/q/28944988
score: 0
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has title: Javascript I am trying to pause the ball with noloop(); but on key up I want to continue the ball bounce can you look at my code and help me?
type: Question
has answer: http://stackoverflow.com/a/29035025
tagged with: javascript
has body: Javascript I am trying to pause the ball with noloop(); but on key up I want to continue the ball bounce can you look at my code and help me? I am having trouble trying to pause the bouncing ball at frame-rate and return to bounce the ball. I managed to get some code that is able to identify at least a couple of keys, but I only need one key to stop the bouncing ball and the same key when release to let the ball bounce? Any ideas? Please help! Player Movement using onkeydown/onkeyup (Enhanced version)
favorite count: 0
has comment: http://stackoverflow.com/comment/46145834
answer count: 1
has comment: http://stackoverflow.com/comment/46233170

http://stackoverflow.com/q/29026131
tagged with: angularjs
type: UnansweredQuestion
has body: I am new to AngularJS.I am trying to get a newly changed value from a input tag using ng-model but it is returning me the previous value.Can anyone tell me what is wrong here? {{eventDateControl}} is the model. Event Date & Time: controller alertCallApp.controller('EventInfoController', function($q, $scope,$rootScope,$timeout,$http,eventDetails,$stateParams,currentEventID,getUserDetails,alertAppLib,currentEventStatus,alertTypeDetails) { $('.form_datetime').datetimepicker({ // language: 'fr', weekStart : 1, todayBtn : 1, autoclose : 1, todayHighlight : 1, startView : 2, forceParse : 0, showMeridian : 1 }); $scope.getEventDetails = function(){ // get updateTime in millisec and format in proper format var udate = eventResponse.data.alertEvent.updateTime; var cdate = eventResponse.data.alertEvent.createTime; // converting updateTime in proper format var d = new Date(udate); var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; var date = d.getDate() + ' ' + monthNames[d.getMonth()] + ' '+ (d.getYear() + 1900) + '-' + d.getHours() + ':' + d.getMinutes() var ampm = (d.getHours() >= 12) ? "PM" : "AM"; console.log('updateTime in expected format : '+ date+' '+ampm); $scope.eventDateControl = date+' '+ampm; // converting createTime in proper format d = new Date(cdate); monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; date = d.getDate() + ' ' + monthNames[d.getMonth()] + ' '+ (d.getYear() + 1900) + '-' + d.getHours() + ':' + d.getMinutes() ampm = (d.getHours() >= 12) ? "PM" : "AM"; console.log('createTime in expected format : '+ date+' '+ampm); $scope.createTime = date+' '+ampm; } else { errMsg = eventResponse.statusMessage; } }); } $scope.saveEventInfo = function(eventData,alertType,eventDateControl){ console.log('eventDateControl : '+eventDateControl); //GET DATE AND CHANGE IT TO MILLISECONDS // con…
has comment: http://stackoverflow.com/comment/46294514
score: 1
has comment: http://stackoverflow.com/comment/46294300
upvote count: 1
has title: not getting ng-model value
has comment: http://stackoverflow.com/comment/46294352
has answer: http://stackoverflow.com/a/29026386
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46294336
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46294400
favorite count: 0

http://stackoverflow.com/a/29014600
upvote count: 2
answers question: http://stackoverflow.com/q/29014292
has comment: http://stackoverflow.com/comment/46307373
has comment: http://stackoverflow.com/comment/46312970
has comment: http://stackoverflow.com/comment/46274773
has comment: http://stackoverflow.com/comment/46275246
has body: The hack way: Go about using JavaScript, however you run into potential issues with browsers not running it. The better way: Use mod_rewrite / .htaccess to redirect previous (expired) requests to the new location of the resource. You could also use FallbackResource and provide a .php file that could provide the new resource based on criteria (you now have the power of PHP to decide where the Location header should go). The best way1: Place those document references in a database table somewhere and reference them in the page using the table's current value. This creates a single place of "truth" and allows you to update the site from a global perspective. You could also, at a later date, provide search, tag, display a list, etc. &nbsp; 1 Not implying it's the abosolute best, but it is certainly a better way than updating hard-coded references.
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/46298840
accepted answer of: http://stackoverflow.com/q/29014292
score: 2

http://stackoverflow.com/comment/46309086
type: Comment
has text: @CasimiretHippolyte You mean using like `"\B` and `\B"` instead?
score: 0
comment on: http://stackoverflow.com/q/29034062
type: QuestionComment

http://stackoverflow.com/a/28957331
answers question: http://stackoverflow.com/q/28956940
has body: If you want to use javascript code in your views you can add below code to your page end. And you should be able to run javascript code &lt;% content_for :javascript do %&gt; $(). // your ruby code e.g. var formData = #{@s3_direct_post.fields.to_json.html_safe}; &lt;% end %&gt; Or Suppose you have show action in your controller and show form in views, then you can create show.js.html file and write java-script code in that
type: Answer
score: 0

http://stackoverflow.com/comment/46121461
comment on: http://stackoverflow.com/a/28930901
type: Comment
score: 0
type: AnswerComment
has text: It does not work. It seems that the req.article could not be overwritten on the middleware or may be it is actually overwritten after next().

http://stackoverflow.com/q/28936017
has comment: http://stackoverflow.com/comment/46127343
answer count: 2
tagged with: browserify
upvote count: 1
has body: I'm using browserify and knockout and am trying to load html files for knockout component templates. I have browserify successfully loading javascript files, but I'm unclear on how to get it to load html files. I'm trying to do something like this: (function() { var ko = require('./lib/knockout/dist/knockout.js'); var authenticationViewModel = require('./viewmodels/authentication.js'); var authenticationView = require('./views/authentication.html'); ko.components.register('authentication', { template: authenticationView, viewModel: authenticationViewModel }); })(); But the template is obviously not loading. Can someone please explain to me how this is to be accomplished? This is what I have in my gulpfile.js to get browserify to work with .js files: gulp.task('browserify', function () { var browserified = transform(function(filename) { var b = browserify(filename); return b.bundle(); }); return gulp.src([paths.appJs]) .pipe(browserified) .pipe(gulp.dest(paths.public)); }); I'm looking into the html-browserify plugin: https://www.npmjs.com/package/html-browserify The example they are using looks like this: gulp.task('js', function() { gulp.src('js/app.js') .pipe(browserify({ insertGlobals: true, transform: html })) .pipe(concat('app.js')) .pipe(gulp.dest('./public/js')); }); But I'm unclear on how to reconcile this example with my current code that is already working.
has comment: http://stackoverflow.com/comment/46127610
has comment: http://stackoverflow.com/comment/46128582
favorite count: 0
has comment: http://stackoverflow.com/comment/46127563
has answer: http://stackoverflow.com/a/29009949
has title: Load HTML Template for use with knockout component via Browserify
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29009949
downvote count: 0
score: 1
tagged with: knockout.js
has answer: http://stackoverflow.com/a/30077714
type: Question
accepted answer: http://stackoverflow.com/a/30077714
tagged with: javascript

for-loop
tags question: http://stackoverflow.com/q/29039910
tags question: http://stackoverflow.com/q/28933412
tags question: http://stackoverflow.com/q/29014638
tags question: http://stackoverflow.com/q/28976245
tags question: http://stackoverflow.com/q/28985002
tags question: http://stackoverflow.com/q/28979805
tags question: http://stackoverflow.com/q/29056895
tags question: http://stackoverflow.com/q/28998093
tags question: http://stackoverflow.com/q/29042443
tags question: http://stackoverflow.com/q/28961750
tag name: for-loop
tags question: http://stackoverflow.com/q/28953795
tags question: http://stackoverflow.com/q/29000695
tags question: http://stackoverflow.com/q/29032059
tags question: http://stackoverflow.com/q/28915672
tags question: http://stackoverflow.com/q/28936410
tags question: http://stackoverflow.com/q/28924682
tags question: http://stackoverflow.com/q/28942390
tags question: http://stackoverflow.com/q/29027487
tags question: http://stackoverflow.com/q/28950704
type: Tag
tags question: http://stackoverflow.com/q/29013976
tags question: http://stackoverflow.com/q/29002186
tags question: http://stackoverflow.com/q/28935783
tags question: http://stackoverflow.com/q/28968937
tags question: http://stackoverflow.com/q/29044520
tags question: http://stackoverflow.com/q/29000446
tags question: http://stackoverflow.com/q/28974100

dayofweek
type: Tag
tags question: http://stackoverflow.com/q/28959808
tag name: dayofweek

http://stackoverflow.com/q/28983708
favorite count: 0
has comment: http://stackoverflow.com/comment/46216562
has title: Button keeps on disappearing when clicked to call a javascript function
has answer: http://stackoverflow.com/a/28983931
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46216576
has body: function remove() { debugger; alert('sahd'); } Abcd1 Abcd1 Abcd1 //javascript code function remove() { debugger; alert('sahd'); } above is my html code and javascript function. when i click on the buttons, they keep on disappearing. Please help
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/28983793
has answer: http://stackoverflow.com/a/28983868
tagged with: javascript
has comment: http://stackoverflow.com/comment/46216507
has comment: http://stackoverflow.com/comment/46216585
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/46216501

http://stackoverflow.com/comment/46098888
comment on: http://stackoverflow.com/a/28920774
type: Comment
has text: `2 !== '2'` is `true`
score: 2
type: AnswerComment

http://stackoverflow.com/comment/46265354
has text: Give the elements a class that is not used elsewhere (e.g.`my-new-class`). Then update your event code to `$('.my-new-class').click(function () { var ss = $(this).val(); alert("ss "); });`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29009819

http://stackoverflow.com/comment/79020961
type: AnswerComment
score: 12
type: Comment
has text: Do all this, to just include a jquery package ?, what a pain. I'm going back to my gulp build
comment on: http://stackoverflow.com/a/28989476

http://stackoverflow.com/q/28997008
tagged with: javascript
has title: Mocking a Service into Controller
tagged with: karma-jasmine
linked to: http://stackoverflow.com/q/21590005
tagged with: jasmine
favorite count: 0
has answer: http://stackoverflow.com/a/28997415
tagged with: angularjs
upvote count: 1
has comment: http://stackoverflow.com/comment/46242317
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28997415
type: Question
tagged with: testing
has body: I'm trying to mock a service, with Jasmine 2.2.0: CheckoutService.patch() which returns a promise into my CheckoutController: describe('CheckoutController', function() { var $scope, vm, checkoutServiceMock, def; beforeEach(function(){ module('app'); checkoutServiceMock = jasmine.createSpyObj('CheckoutService', ['patch']); inject(function($rootScope, $controller, $q){ def = $q.defer(); $scope = $rootScope.$new(); vm = $controller('CheckoutController', { $scope: $scope, CheckoutService: checkoutServiceMock }); checkoutServiceMock.patch.andReturn(def.promise); }); }); }); But I'm getting: TypeError: 'undefined' is not a function (evaluating 'checkoutServiceMock.patch.andReturn(def.promise)') What I am missing?
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/46340937
type: Comment
has text: The most obvious answer would be to always remove/add this class by setting `$scope.collapseSidebar` (`ng-click` to function doing just that?), *never* by manual DOM manipulation. It has its place, but 9 times out of 10 it is Pandora's box when working with Angular. Not much more I can say without live example.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29049991

http://stackoverflow.com/a/29052526
has comment: http://stackoverflow.com/comment/46345220
score: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29052260
type: Answer
has body: Why not just set the default radio :checked property but .trigger('click') ? $(function(){ //state default radio ':checked' property there: $("input:radio:first").prop("checked", true); $("#radio1 input:radio").click(function() { alert("clicked"); }); // overwrite radio ':checked' property there (if exists in localStorage) : $('input[type=radio]').each(function(){ var state = JSON.parse( localStorage.getItem('radio_' + this.id) ); if (state) this.checked = state.checked; }); }); $(window).bind('unload', function(){ $('input[type=radio]').each(function(){ localStorage.setItem( 'radio_' + this.id, JSON.stringify({checked: this.checked}) ); }); }); JSFiddle Or, if you need to trigger an event handler for default radio (as you do in your code using .trigger('click')) on DOM ready, use this: $(function(){ //state default radio ':checked' property there and run its `click` event handler: radioClick.call($("input:radio:first").prop("checked", true)); $("#radio1 input:radio").click(radioClick); // method triggered on radio click, will skip the localStorage modification: function radioClick() { // you can refer here to 'this' as to clicked radio alert($(this).val()); } // overwrite radio ':checked' property there (if exists in localStorage) : $('input[type=radio]').each(function(){ var state = JSON.parse( localStorage.getItem('radio_' + this.id) ); if (state) this.checked = state.checked; }); }); $(window).bind('unload', function(){ $('input[type=radio]').each(function(){ localStorage.setItem( 'radio_' + this.id, JSON.stringify({checked: this.checked}) ); }); }); JSFiddle Alternatively, and even better, set the default radio checked property right in the HTML: &lt;input type=radio id=radio1 value=radio1 name=radio checked /&gt; &lt;input type=radio id=radio2 value=radio2 name=radio /&gt; &lt;input type=radio id=radio3 value=radio3 name=radio /&gt; ... So that you have it checked natively, not programatically. Then overwrite its prop depends on what is in the localStorage EDI…
upvote count: 3
has comment: http://stackoverflow.com/comment/46344070
has comment: http://stackoverflow.com/comment/46344944
answers question: http://stackoverflow.com/q/29052260

http://stackoverflow.com/q/28977621
has answer: http://stackoverflow.com/a/28978272
answer count: 2
downvote count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46206766
has body: I have an an object I need to transform into a different format The original: {"module1":{"mod1":[{"hours":10},{"weeks":2},{"days":15}]}, "module2":{"mod2":[{"cars":1},{"cats":5},{"people":4}]}, } the desired result : {"module1":"/mod1/10/2/15","module2":"/mod2/1/5/4" } Here is my attempt (sorry im still learning this) function(newUrl){ var encodedUrl = {}; var tempString = ""; console.log(JSON.stringify(newUrl)); for (var p in newUrl) { tempString = "/" + Object.keys(newUrl[p]); for (var j in newUrl[p]){ _.each(newUrl[p][j], function(obj){ tempString += "/" + _.values(obj); }); encodedUrl[p] = tempString; console.log(encodedUrl); } } } So, I think i was able to make the string correctly. Hoever it only seems to be working the first time around. it's logging in a weird pattern Object {module1: "/mod1/10/2/15"} Object {module1: "/mod1///"} Object {module1: "/mod1///", module2: "/mod2/1/5/4"} I think i have something wrong in my logic parsing this, I cannot pinpoint it though. Would love a second pair of eyes to help. Thanks!
has title: Object transformation in javascript
has answer: http://stackoverflow.com/a/28977965
accepted answer: http://stackoverflow.com/a/28977965
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/28978272
type: Question
upvote count: 2

http://stackoverflow.com/comment/46239739
type: AnswerComment
has text: Your skin is loading from - http://p.jwpcdn.com/6/12/skins/vapor.xml, so this is the unmodified version. Looking at your source, this file - static/js/step_detail.01f6e4005617.js, is loading the skin like this - skin:"vapor", this will load the skin from our CDN. You need to change this to something like, skin:"your/site/vapor.xml", and then have the skin uploaded to that location (as well as all skin images, unless you already base 64 encoded them).
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28934963

http://stackoverflow.com/q/29027830
accepted answer: http://stackoverflow.com/a/29580816
has title: Getting Cannot read property 'offsetWidth' of undefined with bootstrap carousel script
favorite count: 0
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/65867967
has answer: http://stackoverflow.com/a/38096288
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/75808406
has answer: http://stackoverflow.com/a/29580816
type: Question
answer count: 8
has answer: http://stackoverflow.com/a/60007469
has body: I created a carousel with Bootstrap 3.3 and it works on my local machine, but when I upload the whole thing on server where the bootstrap js file is being compiled together with other files in a single file, I get this error: Cannot read property 'offsetWidth' of undefined - has anybody faced this and are there any known solutions to this issue?
tagged with: javascript
tagged with: jquery
upvote count: 70
has comment: http://stackoverflow.com/comment/47310034
possible better answer: http://stackoverflow.com/a/38686360
has answer: http://stackoverflow.com/a/38686360
has answer: http://stackoverflow.com/a/42475547
has answer: http://stackoverflow.com/a/59628723
downvote count: 0
score: 70

http://stackoverflow.com/a/29016133
has body: I can see one major problem here - you have not declared i anywhere. In your while loop you have the condition set to (1 &lt; 10) which will always be true. I would recommend changing it to use a for loop like this: for (int i=0; i&lt;10; i++) { randomNum = Math.floor((Math.random() * numSeq.length)); if (randomNum == 9) { numLeaves = 0; } else { numLeaves = randomNum + 1; } document.getElementById("picture").src = numSeq[randomNum]; setInterval(function(){document.getElementById("picture").src = ""}, 1500); } Hope this helps.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29014562

http://stackoverflow.com/comment/46317810
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29038331
has text: @TomPhillippe I changed the function's parameter name to `results` because that made more sense than calling it `parsed`. So the code that I posted is internally consistent.
score: 0

http://stackoverflow.com/comment/46362461
comment on: http://stackoverflow.com/a/29060342
type: AnswerComment
type: Comment
score: 1
has text: `undefined` is still _falsy_ and not `false`. The _falsy_ it coerced to `false` when evaluated in a boolean context. This is also between parentheses `(undefined) === false` but here `undefined` is not coerced to `false`. The same with with _truthy_ values. And `console.log((x.keyBaz));` logs `undefined` and not `false`

http://stackoverflow.com/a/29006435
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/29006221
score: 0
has comment: http://stackoverflow.com/comment/46259321
type: Answer
has body: Rather than go into possible solutions to yur matching array index problem, I'm just going to show you a solution that wil work. &lt;?php header("Cache-Control : no-cache, must-revalidates"); header("Expires : Mon, 26 Jul 1997 00:00:00 GMT"); //Data user-id dan password $user["anton"] = "biola"; $user["ahmad"] = "gitar"; $user["dewi"] = "piano"; $user["santi"] = "keyboard"; $user["salman"] = "perkusi"; //Peroleh variable URL $user_id = $_GET["user_id"]; $password = $_GET["password"]; $ok = FALSE; if($user[$user_id] === $password){ $ok = TRUE; } session_start(); //Buat sesi $_SESSION["ok"] = $ok; if($ok) { $_SESSION["user_id"] = $user_id; $_SESSION["password"] = $password; print("OK"); } else print("NOT OK"); ?&gt; This is no more insecure than your existing method and it works.

http://stackoverflow.com/comment/46341193
comment on: http://stackoverflow.com/a/29051047
score: 0
type: AnswerComment
has text: This solution also worked for me. Thanks for your effort.. up voted.
type: Comment

http://stackoverflow.com/a/28911167
upvote count: 1
has body: Small Oversight. Easy Fix. You were calling push and remove off the observable array from the view model but it does not exists as a direct member of the view model. This is because you never add the observable array directly to this view model. You use a constructor to create an object to observe with DeliveryCategory. One of the properties on that object is an observable array DeliveryOptions. To get access to the observable array from this scope, you have to evaluate DeliveryCategory to get access to it's property DeliveryOptions before you run any array methods. So, instead of this: self.addDeliveryOptions = function () { self.DeliveryOptions.push(new DeliveryOption("new Option")); } self.removeDeliveryOptions = function (option) { self.DeliveryCategory.remove(option); } The Solution: self.addDeliveryOptions = function() { self.DeliveryCategory().DeliveryOptions.push(new DeliveryOption("new Option")); } self.removeDeliveryOptions = function(option) { self.DeliveryCategory().DeliveryOptions.remove(option); } See the snippet below function DeliveryCategoryViewModel() { var self = this; self.DeliveryCategory = ko.observable(new DeliveryCategory(1, "new Name", [new DeliveryOption("first"), new DeliveryOption("second")])); self.addDeliveryOptions = function() { self.DeliveryCategory().DeliveryOptions.push(new DeliveryOption("new Option")); } self.removeDeliveryOptions = function(option) { self.DeliveryCategory().DeliveryOptions.remove(option); } } function DeliveryCategory(id, name, option) { this.Id = id; this.Name = name; this.DeliveryOptions = ko.observableArray(option); } function DeliveryOption(name) { this.Id = "2"; this.Name = name; } $(document).ready(function() { ko.applyBindings(new DeliveryCategoryViewModel()); }); New delivery category name: +Add delivery option New delivery option name: Remove
score: 1
answers question: http://stackoverflow.com/q/28910688
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46106021
accepted answer of: http://stackoverflow.com/q/28910688
type: Answer

http://stackoverflow.com/q/28940287
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
linked to: http://stackoverflow.com/q/23362842
has title: How to call javascript on svg embed into an Object tag without security error?
tagged with: google-chrome
type: Question
linked to: http://stackoverflow.com/q/24644657
has body: I generate Html/js/svg document to be used from a local computer. When I try to execute my javascript I get this error: Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLObjectElement': Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match I found a stackoverflow answer about it: here I do not know what to put into document.domain as my html page is a local file. the html page Your browser doesn't support SVG the javascript code is simple: window.addEventListener('load',function(){ const object = document.getElementById('test'); const svgdoc = object.contentDocument; ... }, false); My script works fine with firefox 31.5.0 but not with google-chrome 41.0. Thanks for your help
tagged with: javascript
duplicate of: http://stackoverflow.com/q/24644657
score: 2
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
upvote count: 2

http://stackoverflow.com/comment/46418907
type: QuestionComment
has text: @JNevens You can do a curl request `curl {baseURL}/publication/view/#{paper.id}` with some dummy paper.id to narrow down problem to either front end or backend. Also try logging `request.url`, there are some instances where one extra request is made to get favicon.
comment on: http://stackoverflow.com/q/29049587
score: 1
type: Comment

http://stackoverflow.com/comment/46113253
comment on: http://stackoverflow.com/a/28924826
type: AnswerComment
score: 0
type: Comment
has text: is it possible to print a counter++ value in front of each input box added there ? It will help to know how much records we had entered. I tried with php, but it doesn't add counter++ because it is a server side language and the fields are added on client side.

http://stackoverflow.com/q/28915817
type: Question
has answer: http://stackoverflow.com/a/29037934
tagged with: javascript
score: 0
answer count: 1
type: UnansweredQuestion
has title: Insert JavaScript into WebView before pageload
has body: I have a little problem while inserting JavaScript into my WebView before the page is loaded. The reason why I want to insert JavaScript ist because I can't pass JSON to Java via a JavascriptInterface. I don't want to use strings or JSON.stringify while developing the WebApps so my approach was to add some JavaScript inside the WebViewClient.onPageStarted() method. simplified example: var JSWrapper = { callJavascriptInterface: function (str, obj) { if (typeof obj === 'object') { JavascriptInterface.function(str, JSON.stringify(obj)); } else { JavascriptInterface.function(str); } } } inside onPageStarted I also unregister sensors and remove old callbacks I registered via JavascriptInterfaces, cause they should be enabled anymore when the site has changed. That works when I change the site via a link or something but if I use window.location.reload() I end up with errors (JSWrapper not defined). Does someone have an idea how to solve this problem or maybe even a better approach for turning off the sensors, removing callbacks and the JSON.stringify?
tagged with: http://stackoverflow.com/tag/json
tagged with: webview

http://stackoverflow.com/comment/46249241
type: AnswerComment
score: 0
type: Comment
has text: @onsmith I agree it corrects the original approach, but then again the OP may not have known about a different approach. The RegEx actually gives him exactly what he wants, quicker.
comment on: http://stackoverflow.com/a/29000726

http://stackoverflow.com/q/28941020
accepted answer: http://stackoverflow.com/a/28941081
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/28941106
answer count: 2
has body: I can't find an answer to this question, sorry if it's a double post. Whenever I search for this, I get AJAX questions. So, are the first and second calls synchronous: function test() { first(); second(); } ?
upvote count: 0
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28941081
duplicate of: http://stackoverflow.com/q/2035645
has comment: http://stackoverflow.com/comment/46136567
favorite count: 0
linked to: http://stackoverflow.com/q/2035645
type: AnsweredQuestion
tagged with: synchronous
has answer: http://stackoverflow.com/a/28941106
has title: Are calls synchronous in Javascript?

http://stackoverflow.com/comment/46496792
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29022746
has text: Just for the record i do not see any line artifacts like yours on the sample(Chrome Stable - Linux). Besides that you may want to build a your sphere from a [tessellated icosahedron](http://stackoverflow.com/questions/561093/how-to-generate-a-subdivided-icosahedron)
score: 0

http://stackoverflow.com/comment/46167576
has text: When you call this function??
score: 1
comment on: http://stackoverflow.com/q/28957367
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46329480
comment on: http://stackoverflow.com/q/29044977
type: Comment
type: QuestionComment
has text: Is it a typo that you are using `form` and `formSub`?
score: 0

http://stackoverflow.com/q/29043454
downvote count: 2
upvote count: 1
tagged with: google-chrome
type: Question
has answer: http://stackoverflow.com/a/29044147
tagged with: javascript
has title: Why is my Google Chrome Extension not working in Google Chrome Version 41.0.2272.89
has body: I just upgraded Google Chrome on two computers to Version 41.0.2272.89, and the Google Chrome Extension I developed and have had on the Google Web Store for the past year no longer works. Here is my manifest file: { "manifest_version": 2, "name": "Maurice Wright - Note and Bookmarking App", "description": "Don't forget a thing! Easily save your most important notes and bookmarks. Use Mobile Safari's \"Add to Home Screen\" for iPads.", "version": "1.0", "permissions": [ "tabs" ], "browser_action": { "default_icon": "ico_logo.png", "default_popup": "popup.html" }, "icons" : { "48" : "ico_logo_48.png", "128" : "ico_logo_128.png" } } Here is my popup.html file: Getting Started Extension's Popup And, here is my popup.js file: var bookmarker = function() { var init = function() { chrome.tabs.getSelected(null, function(tab) { myFunction(tab.url,tab.title); }); } var myFunction = function(tablink,tabtitle) { url = 'http://mwright.com/popup?title='+encodeURIComponent(tabtitle)+'&link='+encodeURIComponent(tablink); popup(url); } var popup = function(url) { var width = 600; var height = 300; var left = (screen.width - width)/2; var top = (screen.height - height)/2; var params = 'width='+width+', height='+height; params += ', top='+top+', left='+left; params += ', directories=no'; params += ', location=no'; params += ', menubar=no'; params += ', resizable=no'; params += ', scrollbars=no'; params += ', status=no'; params += ', toolbar=no'; newwin = window.open(url,'windowname5', params); if ( window.focus ) { newwin.focus() } return false; } return { init : init } }(); document.addEventListener('DOMContentLoaded', function () { bookmarker.init(); }); window.close(); This has worked for the past year. I'm not sure what changed, how to find out what changed, or how to make the necessary change to get the extension back up-and-running. I've tried "Inspect Popup" in developer mode, but don't see any errors in the console. I should mention that on the mac using OSX 10.9.2, the "Inspe…
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29044147
tagged with: google-chrome-extension
tagged with: plugins
score: -1
type: AnsweredQuestion

http://stackoverflow.com/comment/46101122
type: AnswerComment
comment on: http://stackoverflow.com/a/28920943
type: Comment
has text: This also isn't very clean.. I would like a dryer solution. Thank you much, though!
score: 1

http://stackoverflow.com/q/29002053
has comment: http://stackoverflow.com/comment/46251851
answer count: 1
has comment: http://stackoverflow.com/comment/46251698
has comment: http://stackoverflow.com/comment/46252020
linked to: http://stackoverflow.com/q/13893473
tagged with: exception
type: UnansweredQuestion
tagged with: phonegap-build
has comment: http://stackoverflow.com/comment/46251550
has comment: http://stackoverflow.com/comment/46252060
has title: uncaught error invalid_state_err dom exception 11 phonegap
tagged with: dom
has body: When I am trying to execute the code (its written in a html page), I am getting uncaught error invalid_state_err dom exception 11 on this line--> tx.executeSql("UPDATE DETAILS SET username='"+item.doc.username+"' where id="+item.doc._id); Full code: function init2(tx) { var username = "abc"; var password = "abc"; $.ajax ({ url: "http://10.6.121.55:4985/oms/_all_docs?include_docs=true", type: 'GET', contentType: 'application/json', mimeType: 'application/json', //dataType: 'jsonp', // async: false, data: '{}', beforeSend: function (xhr){ xhr.setRequestHeader('Authorization', make_base_auth(username, password)); }, complete: function(returnData) { alert(returnData); alert(JSON.stringify(returnData)); var syncData=JSON.stringify(returnData); //////// window.globalsyncedinData= $.parseJSON(syncData); alert("globalsyncedinData: "+window.globalsyncedinData); alert("globalsyncedinData_rows or syncData: "+window.globalsyncedinData.responseJSON.rows); var syncData= window.globalsyncedinData.responseJSON.rows; ///// $.each(syncData, function(i, item) { alert("Inside each "); //if(item.doc!=null) alert(item.doc.username); alert(item.doc._id); if(item.doc._id!="channelUsers"){ alert("inside if"); tx.executeSql("UPDATE DETAILS SET username='"+item.doc.username+"' where id="+item.doc._id); alert("username updated"); tx.executeSql("UPDATE DETAILS SET email='"+item.doc.email+"' where id="+item.doc._id); alert("email updated"); tx.executeSql("UPDATE DETAILS SET mobile='"+item.doc.mobile+"' where id="+item.doc._id); alert("mobile updated"); alert("SYNCED IN COMPLETE"); } }); //alert(data.total_rows); alert("all updation done"); }, error: function() { alert("ERROR in Authentication!"); // localread(); } }); } FYI, {"rows":[ {"key":"1424951086535","id":"1424951086535","value":{"rev":"1-6f7d2dca1cc0045ec4f2d7d2aadfc31c"},"doc":{"_id":"1424951086535","_rev":"1-6f7d2dca1cc0045ec4f2d7d2aadfc31c","acresowned":"6","email":"email@go.com","gender":"Male","homephone":"9999999999","mobile":"1111…
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29002123
score: 0

http://stackoverflow.com/comment/46190779
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28969586
score: 0
has text: Have you written any javascript?

http://stackoverflow.com/q/28942169
tagged with: javascript
score: 0
tagged with: html5-canvas
answer count: 1
has title: JavaScript - Infinite State Loop - Pan Function
has body: In my free time I am currently reading the book "Pro HTML5 Games" written by Aditya Ravi Shankar. At the moment I am struggling with understanding the following line of code: var deltaX = Math.round((newCenter - game.offsetLeft - game.canvas.width / 4)/ 2); Can anyone tell me what's the reason for the following part? ( ... - game.canvas.width / 4) / 2) In one loop this formula resolves too 270 = Math.round((700 - 0 - 640 / 4) / 2) for the value of deltaX. Can anyone see the correlation of this value to the game? Eventuell the following line of code gets called: deltaX = game.maxSpeed * Math.abs(deltaX) / (deltaX); Which corresponds to: 3 = 3 * Math.abs(270) / (270); Appartently, deltaX just matters for the sake of right / left panning. So where does this delta value for deltaX belong too? Here are some additional values that might be helpful (x-axis): game canvas: 640px background picture: 1024px The code for the whole project can be found here:
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28942542
tagged with: http://stackoverflow.com/tag/html
tagged with: delta
type: Question

http://stackoverflow.com/q/29017918
has title: Error when sending message with realtime.co - Boolean is not a function
tagged with: .net
has body: I am using realtime.co for realtime messaging in my .NET 4.5/Javascript webapp. I created a connection using the code: xRTML.ready(function () { xRTML.Config.debug = true; globalRealtimeConnectionId = generateUUID(); globalRealtimeToken = getRealtimeToken(); globalMyConnection = xRTML.ConnectionManager.create( { id: globalRealtimeConnectionId, appkey: 'xxxx', authToken: globalRealtimeToken, // insert token url: 'http://ortc-developers.realtime.co/server/2.1' }); globalMyConnection.bind( { // When we get a message, process it message: function (e) { var user = e.message; // the use that just joined } }); globalMyConnection.active = true; }); On the server I gave permissions to "main:*" (all sub channels) and returned a token. When I send a message to the user from the server using the following code: OrtcClient client = (OrtcClient)Application["realtime"]; // get reference to client, which initialized in global.asax client.Send(channel, user); // send message user is a string with the username, channel is the channel name (e.g. main:12_323_34_. I get the following error in xrtml-custom-3.2.0-min.js:1 Uncaught TypeError: boolean is not a function xrtml-custom-3.2.0-min.js:1 c.Connection.process (anonymous function) f.proxy IbtRealTimeSJ.d.sockjs.d.sockjs.onmessage x.dispatchEvent m._dispatchMessage m._didMessage m.websocket.d.ws.onmessage From what I can tell, the client is subscribed because it triggers something when a message is sent to it from the server. But I can't understand the source of the error. Because of the error, the function binded to "message:" is not triggered.
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29018377
tagged with: real-time
answer count: 1
type: UnansweredQuestion
type: Question

http://stackoverflow.com/a/28953627
type: Answer
has body: That's because the animation is asynchronous. The code that increases the variable will run before the code that sets the text. Increase the variable in the code that sets the text instead: var question = $('#question'); question.fadeOut(400, function () { question.text(questions[currentQuestionIndex]); currentQuestionIndex = currentQuestionIndex+1; question.fadeIn(400); }); Demo: var questions = ["What is your name?","What is your favourite colour?","What is the air speed velocity of an unladen swallow?"]; var currentQuestionIndex = 0; function showQuestion() { if (currentQuestionIndex &lt;= questions.length-1) { var question = $('#question'); question.fadeOut(400, function () { question.text(questions[currentQuestionIndex]); currentQuestionIndex = currentQuestionIndex+1; question.fadeIn(400); }); questionTimer(); } else { console.log("End question 1"); } } function questionTimer() { setTimeout(function () { showQuestion(); }, 3000); } showQuestion(); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="question"&gt;&lt;/div&gt;
answers question: http://stackoverflow.com/q/28953529
score: 0

http://stackoverflow.com/comment/46236739
type: Comment
comment on: http://stackoverflow.com/a/28993995
score: 0
type: AnswerComment
has text: i checked that link, try changing 'otherClass' to 'otherclass' in the css part and run again.

http://stackoverflow.com/comment/46161218
has text: If you are asking the api to return JSON data, then you need to create a valid json string to return to the called.. So read your logs and create a valid json string to return
score: 0
comment on: http://stackoverflow.com/q/28952047
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/127317298
type: AnswerComment
comment on: http://stackoverflow.com/a/64874657
type: Comment
has text: It doesn't work. Also, the .click() is deprecated.
score: 0

http://stackoverflow.com/q/28948739
accepted answer: http://stackoverflow.com/a/28949522
tagged with: javascript
tagged with: xpages
type: Question
type: AnsweredQuestion
has body: We use the Dojo Tab Control. We fill this out with a HashMap, the title and the content. Now we want to hide and unhide the tabs with a button. If the control has been loaded before, does the presentation. If the control was hidden from the beginning, the control will not display correctly. The tabs with the title cut off and therefore can not be clicked. The display of the tabs we solve with CSJS, fadeOut and fadeIn. The area with the tabs has been hidden with 'display: none'. Why?
has answer: http://stackoverflow.com/a/28949522
answer count: 1
tagged with: dojo
score: 0
has title: Display Dojo Tabs broken in XPages

http://stackoverflow.com/a/28920774
answers question: http://stackoverflow.com/q/28920721
type: AcceptedAnswer
type: Answer
has body: arr = arr.filter(function( a ) { return a.b !== 2; }); This will only work for IE9+
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/46098888
accepted answer of: http://stackoverflow.com/q/28920721
upvote count: 2

http://stackoverflow.com/q/28984610
possible better answer: http://stackoverflow.com/a/28984693
answer count: 4
has answer: http://stackoverflow.com/a/28984693
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28985034
has body: Using Bootstrap News Feed Update Status Post On Wall Notifications Logout In Javascript, I am disabling some of the like the following: $('#LiNewsFeed').addClass('disabled'); The Item in the List actually LOOKS disabled, when when I click on it, it actually calls the javascript function, therefore, what I need is to disable the <a href> not just the I tried adding this after $(document).ready: $(".nav li.disabled a").click(function () { return false; }); But it's not really doing anything. What I need is to disable the <a href> directly after disabling in my Js code, and not to depend on a click event... Seems like there is no way to disable an <a href>, so I need a way around it Any help would be appreciated.
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46217971
has comment: http://stackoverflow.com/comment/46218966
accepted answer: http://stackoverflow.com/a/28985034
score: 0
has comment: http://stackoverflow.com/comment/46217920
has comment: http://stackoverflow.com/comment/46218037
tagged with: twitter-bootstrap
has title: Disable <a href> in runtime using Javascript
has answer: http://stackoverflow.com/a/28985111
has answer: http://stackoverflow.com/a/28985682
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46229912

http://stackoverflow.com/comment/46321886
has text: OK, sorry and thank You for migrating my question.
comment on: http://stackoverflow.com/q/29040814
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/46159785
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28952348
has text: Did you have a try by making your socket variable global ?

http://stackoverflow.com/a/29007907
has comment: http://stackoverflow.com/comment/46261509
accepted answer of: http://stackoverflow.com/q/29007801
type: Answer
answers question: http://stackoverflow.com/q/29007801
has comment: http://stackoverflow.com/comment/46263951
score: 6
has body: You should disable keyboard on your input like this: $(function() { $('#datepicker').keypress(function(event) { event.preventDefault(); return false; }); }); And Here is a working fiddle.
downvote count: 0
type: AcceptedAnswer
upvote count: 6

http://stackoverflow.com/q/29027248
has answer: http://stackoverflow.com/a/29027272
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has body: I'm developing a tool to create Nassi-Shneiderman diagrams online. The model for each diagram is simply an object literal, storing everything with unlimited possible children. this then results in a view populated like the following: Now if I want to add let's say a sequence into the while loop after the first sequence, I somehow have to add a child to the object between the two existing children. The order of an object's properties is not editable by default though and W3C says that one should not rely on the order of the properties because the can differentiate between browsers. I know I could store the object's order in an array, but then I'd have to rewrite the recursive loop which populates the view and so on.. Can I somehow manipulate the order of an object's properties? I don't mind using 3rd party libraries. By "order" I mean the order an object's properties get iterated over using a for(prop in obj) loop. Here's an example of my data structure/object: { "procedure": { "id": "content", "child": { "154": { "class": "sequence", "text": "json manually created in code", "id": 154, "contenteditable": "true" }, "155": { "class": "while", "id": 155, "child": { "157": { "class": "while-condition", "text": "while JSON from File imported", "id": 157, "contenteditable": "true" }, "158": { "class": "while-body", "id": 158, "child": { "159": { "class": "sequence", "text": "Sequence in a while loop", "id": 159, "contenteditable": "true" }, "160": { "class": "while", "id": 160, "child": { "161": { "class": "while-condition", "text": "while parentNode.Whatever != FALSE", "id": 161, "contenteditable": "true" }, "162": { "class": "while-body", "id": 162, "child": { "163": { "class": "sequence", "text": "Sequence even deeper nested", "id": "163", "contenteditable": "true" } } } } } } } } }, "156": { "class": "sequence", "text": "Finish Procedure", "id": 156, "contenteditable": "true" } } } }
accepted answer: http://stackoverflow.com/a/29027272
score: 2
type: AnsweredQuestion
downvote count: 0
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/51644310
tagged with: properties
has title: Manipulate Object literal: add property in certain order
has comment: http://stackoverflow.com/comment/46296325
upvote count: 2
answer count: 1
tagged with: object

http://stackoverflow.com/q/29028299
score: 0
has comment: http://stackoverflow.com/comment/46298122
answer count: 0
type: UnansweredQuestion
tagged with: iframe
has comment: http://stackoverflow.com/comment/46298279
has comment: http://stackoverflow.com/comment/46298164
has title: Can I change the javascript code inside an iframe?
type: Question
has comment: http://stackoverflow.com/comment/46298234
has comment: http://stackoverflow.com/comment/46298087
tagged with: javascript
has comment: http://stackoverflow.com/comment/46298108
has body: I have an iframe which loads a javascript tracking code. For analytics purposes it has to reside on another affiliate site which is not on the same domain. It is possible to change the value of a javascript variable using onload event? Or maybe something else? // on the affiliate site page var toBeChangedFromOutsideTheFrame = 0;

http://stackoverflow.com/comment/46326399
score: 0
comment on: http://stackoverflow.com/q/28971987
type: QuestionComment
has text: I cleaned it up a little: https://jsfiddle.net/qhucdmL5/1/ Mainly just added creation of the select/options. you need a lookup with the check to see if the value is uniq.
type: Comment

http://stackoverflow.com/comment/46196598
has text: @Banana the input type is number
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28972588

http://stackoverflow.com/comment/46138685
type: Comment
comment on: http://stackoverflow.com/a/28938416
score: 0
type: AnswerComment
has text: Regarding separation of concerns, you are right, but the options array in my real application is not dedicated for this select only, this is why I didn't like to change the values of it. Regarding the empty item in the select options array, I don't know why it is appearing in the demo, while it is not in my real application also.

http://stackoverflow.com/comment/46354993
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29058702
type: Comment
has text: True, you mentioned that elements without the property should be put in the end

http://stackoverflow.com/comment/46240887
score: 1
type: QuestionComment
has text: you need to jsperf various solutions as it is not clear which one would be more efficient
comment on: http://stackoverflow.com/q/28996317
type: Comment

http://stackoverflow.com/comment/46187792
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28967957
has text: instantly: if you can run the JS, you can use the URL

http://stackoverflow.com/a/29016095
answers question: http://stackoverflow.com/q/29015939
upvote count: 1
score: 1
downvote count: 0
has body: ^.{1,15}(?=\w\W). Try this.See demo. https://regex101.com/r/iS6jF6/28 For shorter string try ^.{1,14}(?=\w\W|\w$)..See demo. https://regex101.com/r/iL4kF6/3
has comment: http://stackoverflow.com/comment/46278808
type: Answer

http://stackoverflow.com/q/29018125
tagged with: leaflet
accepted answer: http://stackoverflow.com/a/29018705
tagged with: geojson
type: Question
has body: I am looking to add a popup with geoJSON attributes to each book store marker on my map. I have used "layer.feature.properties.name" within the marker.bindpopup method, but am getting a return of "undefined". L.mapbox.accessToken = 'jk.eyJ1IjsdkjfhskjdfhksdskdjflWNCJ9.Ov2O5PtskdljfsdR0lq3Q'; var map = L.mapbox.map('map', 'example.kks3kec4') .setView([38.633, -90.319],12); //add cafe, books store, and university geoJSON layers with styling var bookStore = L.mapbox.featureLayer() .loadURL('book_store84.geojson') //wait for the layer to be "on", or "loaded", to use a function that will setIcon with an L.icon object .on('ready', function(layer) { this.eachLayer(function(marker) { marker.setIcon(L.mapbox.marker.icon({ 'marker-color': '#BA1A1A', 'marker-symbol': "library", 'description': "book store" })); //when layer.feature is within the popup, it returns "undefined" marker.bindPopup("&lt;p&gt;" + layer.feature.properties.name + "&lt;/p&gt;"); }); }) .addTo(map);
tagged with: javascript
score: 0
answer count: 1
tagged with: mapbox
tagged with: gis
has title: Adding geoJSON feature attributes to mapbox popup
has answer: http://stackoverflow.com/a/29018705
type: AnsweredQuestion

http://stackoverflow.com/a/70884984
downvote count: 0
answers question: http://stackoverflow.com/q/28995757
has body: With PowerBi Rest API, I was able to fix the issue by putting the GUID within single quotes: https://api.powerbi.com/v1.0/myorg/groups?%24filter=id%20eq%20'9c02ab25-0e94-4835-92e6-62ac6460acd0'
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/46227884
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28989552
has text: Can you create a plnkr/fiddle for this?
score: 0

http://stackoverflow.com/comment/46337264
comment on: http://stackoverflow.com/a/29048563
type: AnswerComment
type: Comment
has text: The above example, does just that. First image is basic (image.jpg), without text and it generate another image with another name which includes the text (newImage.jpg). In The example, new image is overwritten when the code execute and it is what you want.
score: 0

http://stackoverflow.com/comment/46356526
comment on: http://stackoverflow.com/q/29054508
type: Comment
score: 0
type: QuestionComment
has text: Uncaught TypeError: Cannot read property 'value' of nullsignup.php:954 signupsignup.php:893 onclick this is the error

http://stackoverflow.com/comment/46095039
type: QuestionComment
type: Comment
has text: `return` here doesn't do what you think it does!
score: 0
comment on: http://stackoverflow.com/q/28918749

youtube-javascript-api
type: Tag
tags question: http://stackoverflow.com/q/29016718
tags question: http://stackoverflow.com/q/29006967
tag name: youtube-javascript-api
tags question: http://stackoverflow.com/q/28948327
tags question: http://stackoverflow.com/q/29035718

http://stackoverflow.com/q/29022964
tagged with: google-maps
answer count: 1
tagged with: arrays
has answer: http://stackoverflow.com/a/29023245
tagged with: javascript
has title: Accessing image array elements for marker icons
tagged with: google-maps-api-3
has body: I want to have different icons for each of my markers which are in an array. I have simply added the icon path (as a string) on the end of my locations array. I am not sure I am accessing the icons correctly within my 'marker' for loop. I am getting this error in the console when I run: Uncaught InvalidValueError: setIcon: not a string; and no url property; and no path property Which I think is telling me that the path is incorrect/not there, this is correct though, so I believe it's not accessing the array correctly. How should I be doing this? Or should the icons be in a separate array themselves? Edit: The icons correctly load if I have them in a separate array, however I would like to know if I can use the one multidimensional array rather than have a multidimensional array and another standard array. function initialize() { var locations = [ ['Title A', 3.180967,101.715546, 1, '/images/icons/letter_a.png'], ['Title B', 3.200848,101.616669, 2,'/images/icons/letter_b.png'], ['Title C', 3.147372,101.597443, 3,'/images/icons/letter_c.png'], ['Title D', 3.19125,101.710052, 4, '/images/icons/letter_d.png'] ]; var myLatlng = new google.maps.LatLng(3.182362,101.044922); var mapOptions = { zoom: 4, center: myLatlng } var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var infowindow = new google.maps.InfoWindow; var marker, i; 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] }); 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', initialize);
accepted answer: http://stackoverflow.com/a/29023245
score: 0
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/46316115
type: QuestionComment
type: Comment
score: 0
has text: i am not asking for comments, so better stick with the question and please read the question again before commenting, i clearly mention that i need a code snipt to start....
comment on: http://stackoverflow.com/q/29037627

http://stackoverflow.com/comment/46275461
score: 0
type: Comment
has text: That's not a bad idea. Then I would just need to generate the blob from the canvas and pass that to `fileReader` API so I can upload it.
comment on: http://stackoverflow.com/a/29002474
type: AnswerComment

http://stackoverflow.com/a/29034385
answers question: http://stackoverflow.com/q/29034268
has body: var fragment = document.createDocumentFragment(), ul = document.createElement('ul'), li, i; for (i = 10; i--;) { //the way this loop works, will add the elements in reverse order. Order could be of importance to you, so just an FYI li = document.createElement('li'); //do some stuff to li here fragment.appendChild(li); } ul.appendChild(fragment); No JQuery, just ~10 lines Reference for fragment: https://developer.mozilla.org/en-US/docs/Web/API/Document/createDocumentFragment EDIT For the case you want to iterate upon the whole ul and not the li as I understood: var ul = document.createElement('ul'), container = /*the container DOM element of the &lt;ul&gt;*/, liFragment ulFragment; function create(tag, times) { var fragment = document.createDocumentFragment(), el; for (times; times--;) { el = document.createElement(tag); //do some stuff to the element here fragment.appendChild(el); } return fragment; } function clone(element, times, deep) { var fragment = document.createDocumentFragment(), deep = (typeof deep === 'boolean') ? deep : true; el; for (times; times--;) { el = element.cloneNode(deep); //do some stuff to the element here fragment.appendChild(el); } return fragment; } liFragment = create('li', 10); ul.appendChild(liFragment); ulFragment = clone(ul, 10); container.appendChild(ulFragment);
upvote count: 3
has comment: http://stackoverflow.com/comment/46309820
type: Answer
has comment: http://stackoverflow.com/comment/46312204
score: 3
has comment: http://stackoverflow.com/comment/46309871
downvote count: 0

http://stackoverflow.com/q/28958685
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28961051
upvote count: 1
has body: I am trying to fix the position of my share icons on windows scroll. so i set the position fixed on scroll event. Its not working properly. position fixed important is not working. If i scroll up at the starting point(at the place where scroll stops) the default is not replicated. CSS edited js: $(document).ready(function () { var shareLink = $('#article_tools'); function setHeader(){ if($(window).width() &lt;= 990){ var shareLink = $('#article_tools'); if( shareLink.length &gt; 0) { shareLink.prepend($(".social-share-custom")); shareLink.next().css({'margin-top': shareLink.outerHeight(true) + "px", 'float': 'left'}); } else{ var social_alone = $(".social-share-custom"); $(".evt_detail_main").before(social_alone); social_alone.next().css('float', 'left'); } $(".author-article-info, .orange_oval, .author-article-organization").wrapAll('&lt;div class="author-details"&gt;&lt;/div&gt;'); } if ($(window).width()&lt;768) { shareLink.prepend($(".social-share-custom")); $('.follow-login-wrapper').append($('#top-login')); $('.responsive-menu').append($("#simplemenu")); $('#logo-title').after($('#container-search')); $('#homemenu').after($('#primary').find('&gt;ul&gt;li')); $('#comments').before($('#sidebar-right').find('#sidebar-right-inner&gt;#block-constant_contact-0')); } } $( window ).resize(function() { setHeader(); }); $(window).scroll(function(){ if($(window).width()&lt;=990) { if (shareLink.length &gt; 0) { shareLink.next().css('margin-top', shareLink.outerHeight(true) + "px"); shareLink.css("top", Math.max(0, 274 - $(this).scrollTop())); shareLink.css('background-color', 'white'); } else{ var social_alone = $(".social-share-custom"); social_alone.next().css('margin-top', shareLink.outerHeight(true) + "px"); social_alone.css("top", Math.max(0, 200 - $(this).scrollTop())); if(social_alone.css("top") == "0"){ social_alone.attr('style','position: fixed !important'); } social_alone.css({'background-color':'white','width':'64%'}); } } }); setHeader(); }); css: .social-sha…
has title: CSS style overriding using jQuery not working properly
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28959582
type: Question

http://stackoverflow.com/comment/46260706
type: AnswerComment
score: 0
type: Comment
has text: Yes, but the value returned will not inherit from `foo` and will not have its prototype, so using `new` there is meaningless and confusing. If you want to have private variables and `new`, you can do this: http://jsfiddle.net/rrrjqsq0/
comment on: http://stackoverflow.com/a/29007121

html-parsing
tags question: http://stackoverflow.com/q/29053868
tag name: html-parsing
type: Tag

http://stackoverflow.com/a/28921704
has comment: http://stackoverflow.com/comment/112950682
has comment: http://stackoverflow.com/comment/46101675
has comment: http://stackoverflow.com/comment/86715000
has comment: http://stackoverflow.com/comment/126143414
has comment: http://stackoverflow.com/comment/126142718
has comment: http://stackoverflow.com/comment/65826667
upvote count: 125
has comment: http://stackoverflow.com/comment/126143424
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/126142740
has comment: http://stackoverflow.com/comment/126156068
answers question: http://stackoverflow.com/q/28921127
has comment: http://stackoverflow.com/comment/65826011
accepted answer of: http://stackoverflow.com/q/28921127
has comment: http://stackoverflow.com/comment/84102411
has comment: http://stackoverflow.com/comment/46101554
has comment: http://stackoverflow.com/comment/65874388
has comment: http://stackoverflow.com/comment/126142491
type: Answer
has comment: http://stackoverflow.com/comment/126142424
downvote count: 4
has body: I'm wondering if there is any way to get a value from a Promise or wait (block/sleep) until it has resolved, similar to .NET's IAsyncResult.WaitHandle.WaitOne(). I know JavaScript is single-threaded, but I'm hoping that doesn't mean that a function can't yield. The current generation of Javascript in browsers does not have a wait() or sleep() that allows other things to run. So, you simply can't do what you're asking. Instead, it has async operations that will do their thing and then call you when they're done (as you've been using promises for). Part of this is because of Javascript's single threadedness. If the single thread is spinning, then no other Javascript can execute until that spinning thread is done. ES6 introduces yield and generators which will allow some cooperative tricks like that, but we're quite a ways from being able to use those in a wide swatch of installed browsers (they can be used in some server-side development where you control the JS engine that is being used). Careful management of promise-based code can control the order of execution for many async operations. I'm not sure I understand exactly what order you're trying to achieve in your code, but you could do something like this using your existing kickOff() function, and then attaching a .then() handler to it after calling it: function kickOff() { return new Promise(function(resolve, reject) { $("#output").append("start"); setTimeout(function() { resolve(); }, 1000); }).then(function() { $("#output").append(" middle"); return " end"; }); } kickOff().then(function(result) { // use the result here $("#output").append(result); }); This will return output in a guaranteed order - like this: start middle end Update in 2018 (three years after this answer was written): If you either transpile your code or run your code in an environment that supports ES7 features such as async and await, you can now use await to make your code "appear" to wait for the result of a promise. It is still programmin…
has comment: http://stackoverflow.com/comment/63546475
score: 121

http://stackoverflow.com/a/29067495
has body: It turns out the page was cached, after clearing the cache and refreshing the page, the grid could be found using the assigned id.
answers question: http://stackoverflow.com/q/29001548
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/29001548
type: Answer

http://stackoverflow.com/comment/46289673
score: 0
type: Comment
type: QuestionComment
has text: Sounds like a homework problem. Your recursive function should always be able to stop recursing, or have a "base case" conditional. So far, the only way to get out of your recursion is when num == 0. Think about what you need to change to make the recursion end in other cases.
comment on: http://stackoverflow.com/q/29023436

http://stackoverflow.com/comment/58455575
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28976333
type: Comment
has text: It works. I added above java script in jsp page and access the response object in external js file. So jsp page has sds ` `

http://stackoverflow.com/comment/46247961
type: Comment
type: QuestionComment
has text: It's better to show the code where you changed it. It looks like you have changed the template in XAML. Which is the same for all items.
comment on: http://stackoverflow.com/q/28997883
score: 0

http://stackoverflow.com/q/28943524
answer count: 1
tagged with: http://stackoverflow.com/tag/zip
has answer: http://stackoverflow.com/a/28957031
has title: Node: zlib.gunzip works, but not zlib.inflate?
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28957031
has comment: http://stackoverflow.com/comment/79317355
has body: Why is it that GZIP files I upload can be decompressed fine with zlib.gunzip(), but ZIP files uploaded result in an [Error: incorrect header check] errno: -3, code: 'Z_DATA_ERROR' error from zlib.inflate(), using the following code? if (req.body.compression == 'GZIP') { zlib.gunzip(body, function(err, dezipped) { if (typeof dezipped != 'undefined') { var xmlData = dezipped.toString('utf-8'); app.parseAndOffload(req, res, xmlData); } else res.status(400).send('Could not decompress as GZIP file') }); //-&gt; Decompresses perfectly } else if (req.body.compression == 'ZIP') { zlib.inflate(body, function(err, dezipped) { if (typeof dezipped != 'undefined') { var xmlData = dezipped.toString('utf-8'); app.parseAndOffload(req, res, xmlData); } else res.status(400).send('Could not decompress as ZIP file') }); //-&gt; [Error: incorrect header check] errno: -3, code: 'Z_DATA_ERROR' }
score: 0
tagged with: compression
type: Question
tagged with: zlib
tagged with: javascript
has comment: http://stackoverflow.com/comment/46141368

http://stackoverflow.com/q/29029339
has title: May i expand or collapse kendo gantt tasks programmatically?
type: Question
has answer: http://stackoverflow.com/a/29032310
tagged with: javascript
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/29032310
favorite count: 0
tagged with: kendo-ui
has comment: http://stackoverflow.com/comment/46300308
has body: I have a kendo gantt chart http://docs.telerik.com/kendo-ui/api/javascript/ui/gantt Can i expand and collapse its items programmatically? Kendo gantt documentation hasn't such methods, but may be is possible to expand tasks via jQuery? Also i tried expand tasks by changing expanded property for selected task: var selection = gantt.select(); if (selection) { var task = gantt.dataItem(selection); console.log('task.expanded = ' + task.expanded); // shows true or false depending on visual state task.expanded = true; console.log('task.expanded = ' + task.expanded); // always shows true } Property expanded sets, but visually nothing has changes
type: AnsweredQuestion
score: 1
upvote count: 1

http://stackoverflow.com/comment/46237623
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28979652
has text: When you select Maggie and then type and backspace a character, you have not really 'completed' the process of selection. (Notice how the dropdown is still visible?) Practically, to complete the selection process, you will either click somewhere else (maybe a submit button), or press ENTER/ESCAPE and once you do that, you do get the value you expect.

http://stackoverflow.com/a/29023825
score: 0
answers question: http://stackoverflow.com/q/29023734
has comment: http://stackoverflow.com/comment/46308534
type: Answer
has body: How about try this, $('#myForm').on('change', '#mySelect', function () { $('#myOtherSelect').width($('#myOtherSelect').parent().width()); });

http://stackoverflow.com/q/29062195
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
answer count: 1
tagged with: angularjs-ng-repeat
has comment: http://stackoverflow.com/comment/46361054
favorite count: 0
tagged with: angularjs
tagged with: css
type: AnsweredQuestion
has body: `http://plnkr.co/edit/jj7LvmZ73MKUAdecQzpP` Please provide me a solution to apply CSS to one selected field alone and not to whole row in ng-repeat. I am doing a form validation with mandatory input fields in ng-repeat grid. I want to check the value of input on blur and display error red border if it is empty. But all fields are highlighted when single field is empty. So I want to highlight fields separately. The border is disappearing when I click other text box. I want the border to stay till it is filled and not empty. Please guide me. You help is greatly appreciable. Took the source code from http://code.ciphertrick.com/2014/12/06/highlight-a-selected-row-in-ng-repeat-using-ng-class/ to demonstrate my problem.
score: 1
has title: Apply style to one field alone in ng-repeat
type: Question
has answer: http://stackoverflow.com/a/29062469
accepted answer: http://stackoverflow.com/a/29062469
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/46360759

http://stackoverflow.com/a/28931405
has body: language = url.split("/")[1]; Where url is the URL you are parsing. Maybe use 'location' to get it.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28931340
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28931340
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/29004425
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has title: Cannot read property '_handleNewFile' of undefined
has body: I've just implemented the example from tutorial page and the normal upload works just fine but I also wan't to make use of the camera on mobile devices, so I've added the code from this fineuploader blog post. Now, if I click the Camera button the file selection dialog appears or the camera app opens, but that's it. I'm only getting this message in my Javascript debug console: "Uncaught TypeError: Cannot read property '_handleNewFile' of undefined" Here's my client code: Fine Uploader default UI Camera Your help is appreciated!
has answer: http://stackoverflow.com/a/29005472
accepted answer: http://stackoverflow.com/a/29005472
type: AnsweredQuestion
tagged with: fine-uploader

http://stackoverflow.com/comment/46290337
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29023692
has text: code snippet it.. --'
score: 0

http://stackoverflow.com/a/28992341
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/46437773
answers question: http://stackoverflow.com/q/28992214
has body: you are adding it to the textarea which is hidden, NOT the ckeditor instance. Get the instance of the ckeditor and call insertText() to add text. Call insertHtml() for html. Example opener.CKEDITOR.instances.notes.insertText("Reason: " + r);
score: 1
accepted answer of: http://stackoverflow.com/q/28992214
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/28959637
has body: The issue here is, that i don't know how to pass some scope.data to expressjs when using ngResource, so then it can be used with express route to insert something to DB. ExpressJS REST router.route('/Data') .get(function(req,res){ var username = req.username; var collection = db.collection('users'); collection.find({username:username}).toArray(function (err, doc){ res.send(doc[0].pets); }); }) .post(function(req,res){ !!//I would like to use some data from angular here//!! var name = req.body.name; var surname = req.bodysurname; collection.update({username: username}, { $push: { "details": { name: name, surname: surname } } }, function (err, result) { if (err) throw err; }); }); Angular Factory (function() { 'use strict'; angular .module('App') .factory('Factory', function ($resource) { return $resource("/Data",{}, { get:{ method:"GET", cache:true, isArray:true}, save:{ method:"POST", cache:true, isArray:false }}); }); })(); Controller.js This one works fine i use this function with ng-click() $scope.load = function(){ Factory.get(function (data){ $scope.data = data; }); }; With this one i have problem i have ng-models name and surname in view and i would like to send them to server so it can be used in REST route as req.body.name and req.body.surname. $scope.AddData = function(){ Factory.save() }); }; I think that data should be passed here in this function AddData, however i haven't succeeded yet. So i tried as Jesus said but without results? $scope.AddData = function(){ Factory.save($scope.name) //I tried ({name:$scope.name}) too }); }; After advices from Jesús Quintana I checked the details of method POST and it occurred that everything was all right on angular side i was missing extension of body parser on server Express side app.use(bodyParser.json()) So now it looks like this app.use(bodyParser.urlencoded({extended: true})); app.use(bodyParser.json());
tagged with: javascript
has title: How angularJS ngResource pass variables to expressJS when doing http request operations to server?
tagged with: express
score: 0
has answer: http://stackoverflow.com/a/28959769
answer count: 1
tagged with: angularjs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28959769
tagged with: angularjs-resource
type: Question

http://stackoverflow.com/q/28967789
has title: add additional fields while maintaining input content
tagged with: textarea
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28968382
score: 0
has body: I'm trying to make an input form with multiple fields and generate a preview of this content in a div. I would like the user to be able to add additional fields as they wish. I have the basic functionality working but anytime I "add" an additional field, the entered content of my previous fields are wiped out. Any suggestions would be greatly appreciated. I've included the relevant code below. function addInput(){ var inpts = document.getElementById("inputs"); var inputCounter = Number(document.getElementById("inputCounter").innerHTML); var incCount = inputCounter+1; var currentInfo = inpts.innerHTML; var newField = " + "; inpts.innerHTML = currentInfo + newField; document.getElementById("inputCounter").innerHTML = incCount; } The call to the function looks like this... 1 XX
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28968382
tagged with: forms
type: Question

http://stackoverflow.com/q/28934413
has comment: http://stackoverflow.com/comment/46124507
tagged with: dom
downvote count: 1
has comment: http://stackoverflow.com/comment/46124671
type: Question
has comment: http://stackoverflow.com/comment/46143308
has comment: http://stackoverflow.com/comment/46124581
upvote count: 0
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/28934483
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: On a standard webpage you have hundreds (or thousands) of DOMNodes. When building single-page applications (or angular/react/polymer based projects) almost every link or button is already click-jacked by the framework using custom events to bind the DOMElement to a handler function. So, since you can bind the whole document to a click event (and then check the event.target) would that be a more performant way to listen for lots of events? Or is setting dozens of click handlers still better? function report(event) { console.log(event.target, event); return false; // You would only want to return false if you actually wanted to intercept this event (and the user wasn't pressing ctrl/cmd+click). } document .addEventListener('click', report, true); // vs document.querySelector('.a') .addEventListener('click', report, true); document.querySelector('.b') .addEventListener('click', report, true); document.querySelector('.c') .addEventListener('click', report, true); More performant can mean less CPU cycles or less memory or both.
favorite count: 0
has title: Is setting a Javascript event on the whole document worse than multiple individual events?
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46124613
has comment: http://stackoverflow.com/comment/46124557
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28934483

http://stackoverflow.com/q/28972694
type: UnansweredQuestion
type: Question
score: 1
favorite count: 0
has title: Service with API to send JavaScript code to run in a sandbox
upvote count: 1
has comment: http://stackoverflow.com/comment/46201436
has body: I want students to submit JavaScript code to our server. Then we test that JavaScript code to make sure the students solved the problem. I want to test for exceptions thrown, output, what's returned, individual variables and functions that were called. Is there a service with an API that I can send student submitted JavaScript code along with our tests? I'm familiar with sandbox JavaScript environments like JSFiddle, but I need an API so our environment can easily test and get results.
tagged with: sandbox
tagged with: unit-testing
has comment: http://stackoverflow.com/comment/46197204
tagged with: testing
answer count: 0
downvote count: 0
tagged with: sandbox-solution
tagged with: javascript

http://stackoverflow.com/comment/46137583
score: 2
has text: @shmuli you have to redraw canvas when it changes size cause it will be cleared. OP doesn't show his setup code here though, but he is probably scaling the default 300x150 to something using CSS which means the bitmap of canvas is scaled. He need to use width/height properties and then redraw (points can be stored in an array etc.).
comment on: http://stackoverflow.com/a/28940874
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28991193
has title: Breeze Type Error: object is not a function
type: Question
has comment: http://stackoverflow.com/comment/46245089
tagged with: breeze
tagged with: entity-framework
has body: I have a EF Code-First DB, with 3 important Tables. Share, ContactDetail and Owner. The Share and the Owner Tables both have the Contact Detail as navigational property, but the Share Table has both ContactDetail and Owner as navigational properties. I have a simple controller Get that retrieves the Shares [HttpGet] public IQueryable&lt;Share&gt; VesselShares() { return _cp.Context.Shares; } and the breeze call is: getVesselShares = function (vId) { var query = EntityQuery.from('VesselShares') .expand('Owner, ContactDetail') .where('VesselId', filterQueryOp.Equals, vId) .orderBy(orderBy.share); return manager.executeQuery(query) .then(querySucceeded) .fail(queryFailed); function querySucceeded(data) { return vesselShares(data.results); } } When I load my page, with some other data: return ctx.getVesselById(vId, vessel).then(function () { ctx.getVesselShares(vId).then(function() { logger.log('Data Loaded: ' + ctx.vesselShares().length, 'shipdetail', 'Ship', true); }); ////Load all the details before activating the other child pages //return Q.all([ // //ctx.getVesselShareOwners(vId, dbShareOwners), // //ctx.getVesselVesselBuilders(vId), // //ctx.getVesselAlterations(vId), // //ctx.getVesselInsurers(vId), // //ctx.getVesselClassifSocieties(vId), // ctx.getVesselShares(vId) //]).then(function () { // //shareOwners(utils.consolidateShares(dbShareOwners())); // logger.log('Data Loaded: ' + ctx.vesselShares().length, 'shipdetail', 'Ship', true); // //register.shareOwners(shareOwners()); // //ctx.vesselShareOwners(shareOwners()); // ////Can only Register when all 64 Shares are occupied // //ctx.canRegisterVessel(dbShareOwners().length === 64); //}); }); The first call to retrieve the Shares work fine, but oddly the 2nd call and subsequent calls throw an error on the ctx.getVesselShares method. "TypeError: object is not a function" . I was able to track down the error to this line of code in the breeze.debug.js... proto.getProperty = function (propertyName) { return this[pr…
upvote count: 1
tagged with: knockout.js
has comment: http://stackoverflow.com/comment/46236389
tagged with: asp.net-mvc
tagged with: javascript
type: UnansweredQuestion
answer count: 0
downvote count: 0
score: 1
favorite count: 0

http://stackoverflow.com/a/29009081
accepted answer of: http://stackoverflow.com/q/28976751
has body: I'm also quite new to PEG but you get the hang of it after mainly looking at examples rather than reading documentation. Try comparing your version with this one: start = ws* predicate:predicate ws* { return predicate; } predicate = "OR" ws* "(" operands:operand+ ")" { return { predicate: 'OR', operands: operands }; } / "AND" ws* "(" operands:operand+ ")" { return { predicate: 'AND', operands: operands }; } operand = ws* predicate:predicate ws* { return predicate; } / ws* string:string ws* { return string; } string = "\"" chars:valid_variable_characters+ "\"" { return { type: "STRING", value: chars.join("")}} valid_variable_characters = [a-zA-Z0-9 _] ws = [ \t\n] Whitespace is optional. OR("str1"OR("str2""str3"AND("str4""str5"))"str6") Gives: { "predicate": "OR", "operands": [ { "type": "STRING", "value": "str1" }, { "predicate": "OR", "operands": [ { "type": "STRING", "value": "str2" }, { "type": "STRING", "value": "str3" }, { "predicate": "AND", "operands": [ { "type": "STRING", "value": "str4" }, { "type": "STRING", "value": "str5" } ] } ] }, { "type": "STRING", "value": "str6" } ] }
has comment: http://stackoverflow.com/comment/46287400
answers question: http://stackoverflow.com/q/28976751
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 6
score: 6

http://stackoverflow.com/a/56204884
type: Answer
has body: I dealt with a similar issue. The way I solved it was this: // Detects if Safari 9 or less var isSafariNineOrLess = navigator.vendor &amp;&amp; navigator.vendor.indexOf('Apple') &gt; -1 &amp;&amp; navigator.userAgent &amp;&amp; navigator.userAgent.indexOf('CriOS') === -1 &amp;&amp; navigator.userAgent.indexOf('FxiOS') === -1 &amp;&amp; window.ApplePaySession === undefined; ... if(!isSafariNineOrLess) { save(file); } else { var myLink = document.getElementById('myLink'); if(myLink) { myLink.removeAttribute('href'); myLink.setAttribute('href', 'http://example.com/download.pdf.zip'); } } Then when people click on the link they can download a zipped file that contains the PDF. You look like you are using https://github.com/eligrey/FileSaver.js, or something similar, and that absolutely does not work with Safari 9 and below. Take a look at https://visualstudio.microsoft.com/thank-you-downloading-visual-studio-mac/?sku=communitymac&amp;rel=16# in Safari 9 or below for the behavior I'm talking about, where the a tag href is changed to a URL to download a file. Let me know if this works for you!
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28951224
upvote count: 1

http://stackoverflow.com/comment/46233680
type: QuestionComment
has text: is it really even necessary to search the reversed array? the neighbors will always be the same - just a reversed order.
comment on: http://stackoverflow.com/q/28992631
score: 0
type: Comment

http://stackoverflow.com/a/28959271
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46171240
answers question: http://stackoverflow.com/q/28959217
type: Answer
accepted answer of: http://stackoverflow.com/q/28959217
has body: If you need frameColour to be available in other functions, you have to move its scope up; to prevent adding it to the global scope, you can wrap related functions up in another function, i.e.: jQuery(function($) { var frameColour; $('#purple').click (function() { $(".border").css("fill", "#763d81"); frameColour = "purple"; }); $("#button").click (function() { var mailbody = "hello world."; // you can use frameColour here window.open('mailto:sales@beauxcadeaux.co.uk?subject=My Frame&amp;body=' + mail body); }); });
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46171215

http://stackoverflow.com/comment/46360096
type: QuestionComment
comment on: http://stackoverflow.com/q/29056631
score: 0
type: Comment
has text: It could be, but I'm not familiar with the term that describe the effect. And yes, is that one when you pass the mouse over the pic.

http://stackoverflow.com/comment/46074072
comment on: http://stackoverflow.com/q/28907268
score: 1
type: Comment
type: QuestionComment
has text: You could easily create your own function which inspects the first three characters of the string and handles it accordingly.

http://stackoverflow.com/q/28939067
has body: whenever, I mouseover on the 'li', then, that particular 'li' attribute need to changed to 'clsSect'. On the other hand, based on the list[li] selection, the div content has to set to 'display:block' other should changed to 'display:none'. if the first 'li' selected, then, the first 'div' need to be selected, likewise if the second 'li' selected, then, the second 'div' need to be selected, This below code does not work as expected. Any help please? sample3 To explore job opputunities at 'Company', see our Hot Jobs sample3 To explore job opputunities at 'Company', see our Hot Jobs sample1 To explore job opputunities at 'Company', see our Hot Jobs
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46133479
has answer: http://stackoverflow.com/a/28939453
has comment: http://stackoverflow.com/comment/46133522
type: Question
has answer: http://stackoverflow.com/a/28939861
tagged with: javascript
score: 0
answer count: 3
has title: how to rotationally change the content of 'div' on mouseover on each 'li'
has answer: http://stackoverflow.com/a/28939508
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28939508
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28939453

http://stackoverflow.com/q/29037890
has comment: http://stackoverflow.com/comment/46316403
type: AnsweredQuestion
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46316769
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/29038235
score: -2
tagged with: css
has title: Filter not being applied
has comment: http://stackoverflow.com/comment/46316349
downvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/46316711
accepted answer: http://stackoverflow.com/a/29038235
has comment: http://stackoverflow.com/comment/46316645
has body: I am trying to apply the filter style to an image. I'm using jQuery mobile, but theoretically this particular item should be out of jQuery Mobile styling. My CSS: #down-arrow { filter: hue-rotate(240deg) !important; // Browser Specific -webkit-filter: hue-rotate(240deg) !important; -moz-filter: hue-rotate(240deg) !important; -o-filter: hue-rotate(240deg) !important; -ms-filter: hue-rotate(240deg) !important; } And my image in Javascript: var downArrowDiv = document.createElement("div"); var downArrow = document.createElement("input"); downArrow.setAttribute("src", "arrow.png"); downArrow.setAttribute("type", "image"); downArrow.setAttribute("class", "arrow"); downArrow.setAttribute("data-enhance", "false"); downArrow.setAttribute("data-role", "none"); downArrow.setAttribute("id", "down-arrow"); downArrow.setAttribute("onclick", "downVote()"); However, the item created is NOT color-shifted, and Chrome is showing my filter style as being overridden. I check my computed styles, and it says, "filter: none;", in my inherited styles. Where is this coming from? How is it being set? Why can't I override it? Shouldn't #down-arrow override everything?
has comment: http://stackoverflow.com/comment/46316437
has comment: http://stackoverflow.com/comment/46316802
has comment: http://stackoverflow.com/comment/46316739

http://stackoverflow.com/comment/46318793
type: Comment
comment on: http://stackoverflow.com/a/29039095
score: 0
type: AnswerComment
has text: where do I change padding-top at? it is set in CSS now but I can't find it.

http://stackoverflow.com/q/28939261
type: UnansweredQuestion
tagged with: tidesdk
has answer: http://stackoverflow.com/a/29027614
type: Question
answer count: 1
tagged with: javascript
score: 0
has body: I am trying to implement, an AngularJS App, to work with TideSdk. Everything works fine, if I run it over the browser, but however, I am not seeing any element loaded when I package it as a TideSdk application. The template is not even loading. I don't find any useful as an error in the console. Has anyone tried it before.?
has title: AngularJS and TideSDK
tagged with: angularjs

http://stackoverflow.com/comment/46187338
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28953291
has text: @HelloWorld what exactly are you trying to do? If you're doing filtering of object values, it's probably better to use something like lodash/underscore for that.

http://stackoverflow.com/q/29032058
tagged with: jsni
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29034397
has title: Use native Phonegape js in GWT using JSNI
type: Question
tagged with: gwt
tagged with: java
accepted answer: http://stackoverflow.com/a/29034397
score: 0
answer count: 1
tagged with: javascript
tagged with: phonegap-plugins
has body: I wanna run this phonegap native alert on GWT using JSNI navigator.notification.alert( 'You are the winner!', // message null, // callback 'Game Over', 'Done' ); I've tried this: public static native void testNativeAlert()/*-{ navigator.notification.alert( 'You are the winner!', // message null, // callback 'Game Over', 'Done');}-*/;

http://stackoverflow.com/a/28920251
accepted answer of: http://stackoverflow.com/q/28918567
has body: A way to achieve this is to clone tooltips. In addition you will have to keep track of the clones as you keep hovering over new points, to correctly remove old tooltips and add new ones. An example which adds to your code would be (new code is commented): // Array for keeping track of open tooltips var openTooltips = []; $('#container').highcharts({ // Skipping irrelevant options plotOptions: { series: { point: { events: { mouseOver: function (event) { var chart = this.series.chart; // Remove any currently open tooltips for(var i = 0; i &lt; openTooltips.length; i++) { chart.container.firstChild.removeChild(openTooltips[i]); } // Reset array openTooltips = []; var r = 50; var currX = this.plotX; var currY = this.plotY; var points = this.series.points; for(var i=0;i&lt;points.length;i++){ var xdiff = currX - points[i].plotX; var ydiff = currY - points[i].plotY; // Changed distance formula to use plus instead of minus var distance = Math.abs(xdiff*xdiff + ydiff*ydiff); if(distance &lt; r*r) { // Open the tooltip for the point chart.tooltip.refresh([points[i]]); // Clone tooltip and add it to array openTooltips.push(this.series.chart.tooltip.label.element.cloneNode(true)); // Append tooltip to show it in chart chart.container.firstChild.appendChild(openTooltips[openTooltips.length-1]); } } } } }, } }, tooltip: { enabled: true, shared : true, animation: false // Disable animation to get correct tooltip positions } }); As you can see most of the changes are in cloning the tooltip and keeping track of them. Note that tooltip animation has been disabled to avoid misplaced tooltips. I also changed your distance formula from a difference to a sum, as is normal in finding Euclidean distance. See this JSFiddle example of how it looks and works. The tooltip code in this answer is strongly inspired by Marks answer for "Keep tooltip showing on click".
score: 4
has comment: http://stackoverflow.com/comment/101507165
upvote count: 4
has comment: http://stackoverflow.com/comment/46107552
has comment: http://stackoverflow.com/comment/46107639
answers question: http://stackoverflow.com/q/28918567
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/28943893
possible better answer: http://stackoverflow.com/a/28945797
tagged with: windows
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28945797
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46142802
has comment: http://stackoverflow.com/comment/46143059
has title: node js throws error on pc but not on Ubuntu
has body: I am trying to start my node js server on my windows machine. On my ubuntu everything works fine and it starts up however on windows i get the following error: c:\xampp\htdocs\learningbankapi\src\node_modules\bcrypt\node_modules\bindings\bindings.js:79 throw e ^ Error: no errorc:\xampp\htdocs\learningbankapi\src\node_modules\bcrypt\build\Release\bcrypt_lib.node at Error (native) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at bindings (c:\xampp\htdocs\learningbankapi\src\node_modules\bcrypt\node_modules\bindings\bindings.js:74:15) at Object.&lt;anonymous&gt; (c:\xampp\htdocs\learningbankapi\src\node_modules\bcrypt\bcrypt.js:3:35) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object.&lt;anonymous&gt; (c:\xampp\htdocs\learningbankapi\src\auth.js:2:14) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) The auth.js looks like this: var jwt = require('jwt-simple'); var bcrypt = require('bcrypt'); // Route: /login module.exports = function (express, sequelize, router) { var DataTypes = require("sequelize"); var User = sequelize.define('user', { id: DataTypes.INTEGER, username: DataTypes.STRING, password: DataTypes.STRING, organization_id: DataTypes.INTEGER, user_type_id: DataTypes.INTEGER, division_id: DataTypes.INTEGER }, { freezeTableName: true, instanceMethods: { retrieveByNamePassword: function (username, onSuccess, onError) { User.find({include: [{ all: true }],where: {username: username}}, {}) .then(onSuccess).catch(onError); } } } ), Division = sequelize.define('division', { id: DataTypes.INTEGER, organization_id: DataTypes.INTEGER, location_id: DataTypes.INTEGER, name: DataTypes.STRING }, {freezeTableName: true}), Profile = sequelize.defin…
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28945695
answer count: 2
favorite count: 0
has answer: http://stackoverflow.com/a/28945695

http://stackoverflow.com/comment/46179462
score: 0
type: Comment
type: QuestionComment
has text: Thanks @revo for the tip on[link](http://codereview.stackexchange.com/). That is a better place for the type of question. I'll keep it in mind next time.
comment on: http://stackoverflow.com/q/28958761

http://stackoverflow.com/comment/46324326
score: 0
type: QuestionComment
has text: Well I was meaning more of creating multiple groups and enabling and disabling them dynamically... I see that it is similar now. Would this be redundant then? and should I just delete it if that is the case?
type: Comment
comment on: http://stackoverflow.com/q/29015024

http://stackoverflow.com/q/28930237
has comment: http://stackoverflow.com/comment/46117157
tagged with: node.js
has answer: http://stackoverflow.com/a/28954941
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46117533
has comment: http://stackoverflow.com/comment/46116419
type: Question
has comment: http://stackoverflow.com/comment/46118157
has title: Response for getList SHOULD be an array and not an object or something else
has comment: http://stackoverflow.com/comment/46117552
has comment: http://stackoverflow.com/comment/46118108
score: 0
tagged with: mongodb
has body: I'm working in Cloud9, following a tutorial. I've got to the point where I'm trying load the data within mongo to the view. The table structure seems to get generated but no data is populated. From Chrome I see the following: Error: Response for getList SHOULD be an array and not an object or something else And the response from the page load within Chrome is: 0: {undefined: {}} 1: {undefined: {}} 2: {undefined: {}} 3: {undefined: {}} 4: {undefined: {}} My View Title Reason Actions Requester Verified {{ change.title }} {{ change.reason }} {{ change.actions }} {{ change.requester }} {{ change.verified }} My Controller 'use strict'; /** * @ngdoc function * @name clientApp.controller:ChangeCtrl * @description * # ChangeCtrl * Controller of the clientApp */ angular.module('clientApp') .controller('ChangeCtrl', function ($scope, Change) { $scope.changes = Change.getList().$object; }); My APP.JS /** * @ngdoc overview * @name clientApp * @description * # clientApp * * Main module of the application. */ angular.module('clientApp', ['ngRoute', 'restangular']).config(function ($routeProvider, RestangularProvider) { RestangularProvider.setBaseUrl('http://changebg-MYUSERNAME.c9.io/#:8080'); $routeProvider.when('/', { templateUrl: 'views/main.html', controller: 'MainCtrl' }) .when('/about', { templateUrl: 'views/about.html', controller: 'AboutCtrl' }) .when('/change', { templateUrl: 'views/change.html', controller: 'ChangeCtrl' }) .otherwise({ redirectTo: '/' }); }).factory('ChangeRestangular', function (Restangular) { return Restangular.withConfig(function (RestangularConfigurer) { RestangularConfigurer.setRestangularFields({ id: '_id' }); }); }).factory('Change', function (ChangeRestangular) { return ChangeRestangular.service('change'); }); I'm sure this is something simple but I just can't see it! Thanks
answer count: 1
tagged with: javascript
tagged with: angularjs

http://stackoverflow.com/a/28990994
has comment: http://stackoverflow.com/comment/46236792
type: Answer
score: 1
has body: If this is really Windows Mobile 5 there is no way to get JavaScript events for key presses as JScript in Windows Mobile 5 does simple NOT support any key event. Javascript Key event support started with Windows Mobile 6 (AKU 6.1.4 or so). There are third party 'browser' like Intermec Browser, NaurTecc and zetakey that either support javascript key events or provide a workaround using special META tags or setup that is captured by the browser 'wrapper'.
upvote count: 1
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28971310
accepted answer of: http://stackoverflow.com/q/28971310

http://stackoverflow.com/comment/46292262
comment on: http://stackoverflow.com/a/29024821
has text: This is what I get for staying up late and going straight to the bottom of the hex list assuming the hex values sequentially went straight up until the end. Thank you.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29024624
answer count: 1
has title: How can I filter out non-Japanese characters from my array?
has body: I currently have this http://jsfiddle.net/cuLa9mtf/8/ function wordStat(text) { return text.split('').filter(function(letter){ return letter &gt; '\u3040' &amp;&amp; letter &lt; '\u4DBF'; }).reduce(function (stat, word) { if (!stat[word]) stat[word] = 0; stat[word]++; return stat; }, {}); } var input = document.querySelector('#input'); var output = document.querySelector('#output'); input.addEventListener('keyup', function () { output.value = JSON.stringify(wordStat(input.value), 2, 2); }) but it does not seem to work depending on where I copy the Japanese text from. If I copy and paste characters from Rikai it works, and I see the results in the resulting array (intended result), but if I copy from a different site such as Jisho dictionary it does not work (the characters get filtered out). The way I am going to use this is: I will have a textbox where the user will paste their Japanese text and I will filter out anything that is not a Japanese character (take out [a-zA-Z all punctuation letters of other languages]. Which brings me to my question of how can I reliably filter out non-Japanese characters with front-end Javascript? (According to Rikai Japanese characters are unicode \u3040 - \u4DBF)
score: 2
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/29024821
tagged with: http://stackoverflow.com/tag/json
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/29024821
tagged with: addeventlistener
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/29029580
has comment: http://stackoverflow.com/comment/46303637
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46300966
answers question: http://stackoverflow.com/q/29029190
has comment: http://stackoverflow.com/comment/46301938
has comment: http://stackoverflow.com/comment/46300463
has comment: http://stackoverflow.com/comment/46300869
accepted answer of: http://stackoverflow.com/q/29029190
type: Answer
score: 2
has body: You should try to use: dataType: 'jsonp' and remove &amp;callback=? from the URL. Update: Update After receiving the response Jquery tries to validate that the response contains valid JSON. if the response is not valid JSON you will get the parse error. If you use dataType : 'json' and the response contains a callback like callback({ /* ... */ }) it will fail because the callback is not considered valid JSON. If you use dataType : 'jsonp' jquery will invoke the callback first and then validate the JSON. You can try to use a validation tool like jsonlint.com to ensure that the returned JSON is valid. If you want to stop Jquery from validating the response, you can set the response content type as text in the server-side. In the clinet-side, and use contentType : 'text' in the jquery AJAX call. In the success callback use the JavaScript function JSON.parse(text) to transform the response text into JSON. If you want your WCF service to support CORS you will need to add JSONP support or enable CORS. If you decide to enable CORS you will need the Jquery ajax setting crossDomain. Hope it helps!
upvote count: 2
has comment: http://stackoverflow.com/comment/46301845

http://stackoverflow.com/comment/46531489
has text: Hi Denis. I copied/pasted the code onto the page and wrapped in . The code seems to function, but not text (write) is being generated on the page...regardless if the URL has the ‘utm_term’ at the end. Do you think this has to do with the question you had? I'd like to get this functioning, so i'm okay with eliminating the H1
type: AnswerComment
comment on: http://stackoverflow.com/a/29044323
score: 0
type: Comment

http://stackoverflow.com/q/28930423
has comment: http://stackoverflow.com/comment/46117001
has comment: http://stackoverflow.com/comment/46116715
answer count: 0
type: Question
tagged with: c#
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46116878
tagged with: http://stackoverflow.com/tag/pdf
has title: Request PDF from remote server and print it from web
tagged with: asp.net-web-api
has comment: http://stackoverflow.com/comment/46116747
has body: I have pdf files that get generated on a remote server. From my web app I need to be able to request these pdfs and some how start a print action from the browser. Is something like this possible using the new XMLHttpRequest 2 functionality as mentioned here http://www.html5rocks.com/en/tutorials/file/xhr2/ The remote server is using Web API for all request/responses. I figure there may be a way to stream the files to the browser to accomplish this.
has comment: http://stackoverflow.com/comment/46116818
type: UnansweredQuestion

http://stackoverflow.com/comment/46624138
type: Comment
has text: How can I make sure the ashx gets deployed? For some reason, it doesn't get deployed.And the deploymenttype is set to NoDeployment. How can I change that?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29059506

http://stackoverflow.com/comment/46077100
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28907206
type: Comment
has text: @SapphireSun I see. I hadn't realized that you needed to update the model before updating the UI. In that case I would say that passing in a function is your best bet. That's pretty much what you need to do when you want to insert some behavior in the midst of some other behavior. I wouldn't say that this violates the spirit of promises. It's subtly different from the kind of callbacks that promises are intended to eliminate because you're not using callbacks to control your entire execution flow.

light
tags question: http://stackoverflow.com/q/29060373
tag name: light
type: Tag

http://stackoverflow.com/comment/46106107
type: QuestionComment
comment on: http://stackoverflow.com/q/28924757
has text: Whenever you ask question, the least thing you should do it to take the time to proper format your code and question. The _"formatting"_ of your code was really bad. And you should make sure that here are not obvious error contained like: `</div' ` or the missing `}` which will prevent your whole js code from running.
type: Comment
score: 1

http://stackoverflow.com/a/28964937
type: Answer
upvote count: 1
score: 1
has body: Hard to tell without looking at your code, but very likely you must call your onResize function manually to trigger scene/canvas init.
downvote count: 0
answers question: http://stackoverflow.com/q/28957575

http://stackoverflow.com/comment/46299709
type: QuestionComment
type: Comment
has text: yes i did that .....
comment on: http://stackoverflow.com/q/29028592
score: 0

http://stackoverflow.com/comment/46331212
score: 0
comment on: http://stackoverflow.com/a/29046022
type: Comment
has text: Ah, I follow. No I can't go messing with stuff on their server. I can email them and ask if their server is setup to allow cross-domain requests, but I won't get a reply until Monday or later. I was hoping I could fix the problem myself before then, hence this question.
type: AnswerComment

http://stackoverflow.com/q/28933168
possible better answer: http://stackoverflow.com/a/39521943
has answer: http://stackoverflow.com/a/39521943
has comment: http://stackoverflow.com/comment/46122667
tagged with: javascript
accepted answer: http://stackoverflow.com/a/31128062
has title: jVectorMap renders small with Angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/73499908
tagged with: jquery
tagged with: jvectormap
tagged with: angularjs
type: Question
has body: This question is very similar to the one posed here. However, with some small differences. My map has loaded without issue when I initially dropped it in the site. I am going through the process of adding Angularjs to the site and noticed the 'small' map issue. I have one very simple code injection which seems to be triggering something with load order. The strange thing is the following: IF I resize the browser I eventually get to a place where the map is being displayed as expected (per div css). This is why I believe it to be a load order issue, but it is not resolved with a .resize() call. Not sure if it is relevant but this is driven by an Express, Nodejs webserver on the backend. The map appeared as expected with the webserver set up and no Angularjs code injection. Any help would be greatly appreciated. Edit: Code below. Note without the ng-include (which is just a list of css files) this loads normally.
tagged with: css
has answer: http://stackoverflow.com/a/31128062
score: 0
linked to: http://stackoverflow.com/q/26903678
answer count: 3

http://stackoverflow.com/comment/46271440
has text: ok then every element within the class .btn will be clicked when i run it?
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29013213

http://stackoverflow.com/comment/46322764
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28955413
has text: I was able to resolve this issue by using views and by removing some css properties. I had a overflow attribute set as hidden in css. So because of this map wasn't rendering on screen. * { font-family: "HelveticaNeue-Light",Arial,sans-serif; font-size: 32px; overflow-x: hidden; overflow-y:hidden; } When I removed these the map rendered correctly.
score: 0

http://stackoverflow.com/q/28918333
favorite count: 0
upvote count: 2
score: 2
type: AnsweredQuestion
has body: My goal is to verify the contents of a complicated TD cell. It contains a SPAN tage and many BR tags. I'm restricted to using Selenium IDE for this test. The source text looks like this: TEXT_1 TEXT_2 TEXT_3 Neither TEXT_1 / TEXT_2 / TEXT_3 contain any spaces. I pull the TD contents into the variable 'td_cell_contents'. Then Javascript is used to split that variable on a single space: store | javascript{storedVars['td_cell_contents'].split(' ')[0]} | var_1 store | javascript{storedVars['td_cell_contents'].split(' ')[1]} | var_2 var_1 evaluates to "TEXT_1" as I would expect because there's a space between it and the rest of the cell. When I echo var_2, the log file shows that that is a new line between "TEXT_2" and "TEXT_3" as I would expect since there is a BR tag between them: [info] echo: var_2: TEXT 2 TEXT 3 I tried to use JavaScript to strip the newlines because this newline is making strong comparison very difficult: runScript | var_2 = var_2.replace(/(?:\r\n|\r|\n)/g, ' '); | When I run the echo command again for var_2, the log shows that the newline is still there. It's blocking the ability to do string matching. Looking for help... and am open to using other approaches within Selenium IDE. If I can verify the cell contents somehow without stripping the newline that's fine with me.
tagged with: selenium
has answer: http://stackoverflow.com/a/28969206
type: Question
tagged with: newline
tagged with: ide
tagged with: javascript
has title: Selenium IDE: How to verify Contents when it contains a mix of tags and breaks
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/28969206

http://stackoverflow.com/a/29210410
upvote count: 72
score: 71
has comment: http://stackoverflow.com/comment/52659223
has comment: http://stackoverflow.com/comment/53065278
accepted answer of: http://stackoverflow.com/q/28916985
has comment: http://stackoverflow.com/comment/46665193
type: AcceptedAnswer
downvote count: 1
has body: I found a material design CSS framework known as Materializecss. It looks promising. It's just plain CSS and javascript framework. http://materializecss.com/ Advantages over other frameworks Pure CSS classes, will not conflict with ionic directives. No performance loss. Of all the frameworks I have seen, this is the only one closely following material design rules Almost ready it has about 50+ contributors it's current Version 0.95.3 in less than 6 months Easy to use. Well documented with feature wise navigation. It has almost all the material design features needed for an app. This page http://materializecss.com/getting-started.html will show you how to include it in your projects. I hope this helps for any of you searching for a good material design framework. UPDATE: 2015-07-09 I Found another lightweight powerful beautiful CSS framework for material design Material Design Light http://www.getmdl.io/ It is lightweight, has smooth and quick animations, looking pretty good. It was made by one of the Google developers. It is officially promoted by google https://developers.google.com/web/. It is getting quite popular, try it. Comparision with Angular Material UPDATE: 2015-10-23 Ionic2 has InBuilt Support for Material Design in Android It's Official, You can watch Ionic2 demo in AngularConnect, It has Material Design as default for Android. We don't need to worry about choosing a Material Design framework.
answers question: http://stackoverflow.com/q/28916985
type: Answer
has comment: http://stackoverflow.com/comment/46663800

http://stackoverflow.com/q/28963599
type: AnsweredQuestion
tagged with: babeljs
type: Question
accepted answer: http://stackoverflow.com/a/28966085
tagged with: javascript
has title: aurelia, es6 and classname case
linked to: http://stackoverflow.com/q/19808514
tagged with: ecmascript-6
score: 0
has answer: http://stackoverflow.com/a/28966085
tagged with: aurelia
answer count: 1
has body: I'm studying custom components in aurealia and come accross strange behaviour which nature I don't understand. Consider this: component: xxxaaa.html xxxxxx xxxaaa.js: export class Xxxaaa {} app.html: <xxxaaa/> this works as expected, xxxxxx is shown. Then, camelcaseing component: xxxAaa.html: content not changed, only filename xxxAaa.js: export class XxxAaa {} app.html: <xxxAaa/> nothing is shown, but log dosen't contain any errors, only: INFO [aurelia] Aurelia Started index.js:26 DEBUG [templating] importing resources for dist/app.html ["dist/xxxAaa"] index.js:26 DEBUG [templating] importing resources for dist/xxxAaa.html [] Thus the first question, why is it so? UPDATE: This looks to me like either bug in aurelia (it fails to properly report wrongly made custom elt) or major gap in my understanding of how it actually works. Could you please either confirm it's a bug or explain why aurelia silently ignores my element. Then, rolling back to first, working state and after changing xxxaaa.js to export class xxxaaa {} console log error: Potentially unhandled rejection [1] TypeError: Cannot call a class as a function at execute._classCallCheck (http://localhost:9090/dist/xxxaaa.js:9:108) at xxxaaa (http://localhost:9090/dist/xxxaaa.js:12:9) at Container.invoke (http://localhost:9090/jspm_packages/github/aurelia/dependency-injection@0.4.5/container.js:362:27) at Array.<anonymous> (http://localhost:9090/jspm_packages/github/aurelia/dependency-injection@0.4.5/container.js:142:52) at Container.get [as superGet] (http://localhost:9090/jspm_packages/github/aurelia/dependency-injection@0.4.5/container.js:238:32) at Container.elementContainerGet [as get] (http://localhost:9090/jspm_packages/github/aurelia/templating@0.8.14/view-factory.js:27:17) at CustomElement.create (http://localhost:9090/jspm_packages/github/aurelia/templating@0.8.14/custom-element.js:136:80) at applyInstructions (http://localhost:9090/jspm_packages/github/aurelia/templating@0.8.14/view-factory.js:79:33) at…

http://stackoverflow.com/comment/46103345
has text: This should be able to help you out - it's for audio but video and audio share the same base element so it will work for video as well: https://stackoverflow.com/questions/28811139/html5-audio-tag-onplaying-even-is-triggered-before-audio-play-in-android/28866943#28866943
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28914479

http://stackoverflow.com/a/29047048
type: Answer
has comment: http://stackoverflow.com/comment/54069660
has comment: http://stackoverflow.com/comment/46332623
has comment: http://stackoverflow.com/comment/46332794
answers question: http://stackoverflow.com/q/29046938
has body: If you have a string for every button that represents a function, you can write var functionCollection = { 'stringOne': function() { ... } } ... newInput.onclick = functionCollection[myStringValue]; or you could create one handler function and invoke it with the string type through binding, e.g. function clickHandler(stringValue) { switch (stringValue) { case 'stringOne': return someSpecialFunction(); ... } } ... newInput.onclick = clickHandler.bind(this, myStringValue);
score: 0
has comment: http://stackoverflow.com/comment/46332733
has comment: http://stackoverflow.com/comment/46332675

http://stackoverflow.com/comment/46174419
comment on: http://stackoverflow.com/a/28960937
has text: @DanishJamil: Is `0.5` not being accepted fine even though it is a positive float value?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46141773
has text: Wow... Great men (and so fast)... This did the trick.. perfect solution. Thanx
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28943790

http://stackoverflow.com/comment/46153015
type: QuestionComment
has text: this isn't a jQuery function btw. It's just a recursive function written in plain JavaScript that uses some jQuery selectors.
score: 0
comment on: http://stackoverflow.com/q/28949409
type: Comment

http://stackoverflow.com/comment/91936076
type: Comment
comment on: http://stackoverflow.com/a/38096288
type: AnswerComment
has text: Note that we need to initialize the carousel using .carousel() method.
score: 0

http://stackoverflow.com/q/28931985
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28932051
tagged with: css
type: AnsweredQuestion
score: 1
upvote count: 1
has body: I use transition effect for a div to make it change smoothly on scroll down, but I don't want this transition effect to be used when I mouse over or mouse out as the div is used as a button. I could omit this effect from mouse over, but I couldn't do anything for mouse out: HTML Code: &lt;div class="navButton"&gt;&lt;/div&gt; CSS: .navButton { position: absolute; top:10px; -webkit-transition: all 0.5s ease-in-out; -moz-transition: all 0.5s ease-in-out; -o-transition: all 0.5s ease-in-out; -ms-transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out; } .navButton.scroll { top:100px; } .navButton:hover { cursor: pointer; -webkit-transition: none; -moz-transition: none; -o-transition: none; -ms-transition: none; transition: none; } and jQuery code: $(function() { $(window).scroll(function(event){ if($(this).scrollTop() &gt; 400){ $('.navButton').addClass('scroll'); }; }); });
type: Question
has title: no transition effect on mouse over and mouse out with css
possible better answer: http://stackoverflow.com/a/28932053
has answer: http://stackoverflow.com/a/28932053
tagged with: javascript
has answer: http://stackoverflow.com/a/28932051

http://stackoverflow.com/q/28942763
score: 0
has answer: http://stackoverflow.com/a/28942876
tagged with: jquery
has title: How to insert text into one textarea out of several with id?
answer count: 3
possible better answer: http://stackoverflow.com/a/28942876
accepted answer: http://stackoverflow.com/a/28943144
tagged with: http://stackoverflow.com/tag/html
has body: I have two textareas with different ids which both have wysiwyg buttons for text formatting. I can insert the formatting tags into the first textarea however when I try to insert tags into the second textarea, the tags are inserted into the first one. Obviously when I use the buttons assigned to their respective textarea I would like the format tags to be inserted in the appropriate textarea. In jQuery I try to store the id of the buttons to concatenated with '#textarea' to recreate the textarea id. B I U S B I U S
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28942890
has answer: http://stackoverflow.com/a/28943144
tagged with: javascript
type: Question

http://stackoverflow.com/comment/46300907
comment on: http://stackoverflow.com/a/29029241
type: Comment
score: 2
has text: Updated my code now. `$('select[name=dettaglio2]').val($('select[name=dettaglio2] option:first').val());` This will pick the `select` element with name dettaglio2
type: AnswerComment

http://stackoverflow.com/a/47856504
has body: The only thing that worked for me was to store item_add event locally, remove it from selectize instance and set it back after I added the item: onItemAdd: function(val) { var e = this._events['item_add']; delete this._events['item_add']; this.addItem(123); this._events['item_add'] = e; }
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/29011865
type: Answer
score: 2

universal-analytics
tag name: universal-analytics
type: Tag
tags question: http://stackoverflow.com/q/28967392

http://stackoverflow.com/comment/64432402
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/38410524
has text: Sure. Please let me know in case of any confusion or if you think that some portions could be improved

http://stackoverflow.com/q/28932978
score: 1
has comment: http://stackoverflow.com/comment/46121890
answer count: 2
has body: I have multiple canvas images on my page and I am trying to get the canvas id using Paper.js after the mousedown event on a single image through jQuery. My image disappears after a mouse click and after running the code below. I should be able to draw circles like on the link below on multiple images on my website. Drawing jQuery shapes using canvas elements I cannot use "script type="text/paperscript" canvas=''" as my canvas are created dynamically through JavaScript. Any help is appreciated. Thanks in advance.
has comment: http://stackoverflow.com/comment/46123679
tagged with: canvas
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28933014
tagged with: paperjs
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46122009
has comment: http://stackoverflow.com/comment/46122079
has title: How to use Paper.js on dynamically created canvas?
type: UnansweredQuestion
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/70433942
has comment: http://stackoverflow.com/comment/46121984

http://stackoverflow.com/comment/46147566
comment on: http://stackoverflow.com/a/28946544
type: AnswerComment
score: 0
type: Comment
has text: Thank you for the response, but doesn't every element that was once logged in the data join has to be logged at least once in the enter selection with this code? And what could be the possible adjustment of the key function? Array of data is basically a dictionary, if that's important.

http://stackoverflow.com/comment/46085890
has text: The Document Object Model is the Structure of the HTML within the browser. I wanted to tell you, that the images must change the position within the HTML structure, not only change the view position ( for example when you change the left/top position by css styles).
comment on: http://stackoverflow.com/a/28913633
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46163501
has text: I agree. As I have already successfully implemented the client and can call JavaScript functions to send messages to the Server I posed my question with this in mind, which is why I asked for a way to trigger a function call after the Server had started. I felt the c# part was not necessary to add as I could've implemented that if the triggering a function call was possible, I see the confusion and I acknowledge your description of inter message transmission. I will look into the Ajax calling you described.
comment on: http://stackoverflow.com/a/28953454
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46145590
has text: Yes, I am trying to implement the same thing using jQuery AJAX as well. But I am short on time hence I am trying to make a quick fix by including a query in my javascript.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28945746
type: AnswerComment

http://stackoverflow.com/a/28985798
type: Answer
score: 0
has body: You have to do this in other ways like write this on in this sequence. $check = ''; $check = (isset($_POST['free']) &amp;&amp; !empty($_POST['free'])) ? 'checked="checked"' : ''; if(isset($_REQUEST['reset'])) { $check = ''; } And change your inputs to &lt;input type="checkbox" name="free" &lt;?php echo $check; ?&gt;&gt;Free Shipping&lt;br&gt; And Reset button to &lt;input type="reset" value="clear" onclick="clearform()" style="float:right; width:80px; margin-right:5px;" name="reset" &gt;
answers question: http://stackoverflow.com/q/28985545

http://stackoverflow.com/a/28915989
has comment: http://stackoverflow.com/comment/46090235
upvote count: 2
type: Answer
score: 2
has body: You have a few issues with your code: The main issue is that you're calling .tooltip('show'); but there is no such method or event, according to the API documentation. You have to use .tooltip('open'). The content option accepts a function or string and you're passing an array. You need to implode the messages array with something like messages.join('&lt;br /&gt;') In order to show the errors only within the tooltip, you need to change the default options of parlsey, specifically errorsContainer and errorsWrapper. Your final code will be something like this (test in this jsfiddle): $(document).ready(function() { $("#myForm").parsley({ errorsContainer: function (ParsleyField) { return ParsleyField.$element.attr("title"); }, errorsWrapper: false }); $.listen('parsley:field:error', function (fieldInstance) { var messages = ParsleyUI.getErrorsMessages(fieldInstance); if(fieldInstance.$element.tooltip('instance') != undefined) { fieldInstance.$element.tooltip('destroy'); } fieldInstance.$element.tooltip({ content: messages.join('&lt;br /&gt;'), items: fieldInstance.$element, show: 'pulsate' }); fieldInstance.$element.tooltip('open'); }); });
answers question: http://stackoverflow.com/q/28915526
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28915526
type: AcceptedAnswer

http://stackoverflow.com/q/28907256
has body: I'm stuck on this and it's so simple but I don't understand anything of JavaScript. Basically I want to create a simple calculation to know the travel time, based on three different variables. I'm Dutch so some words are Dutch and some are English in the code. The first variable is the "woonplaats" which is the starting location. The second one is the "bestemming" which is the location of destination. The third one is the "vervoer" which is the vehicle you'll travel by. Now all of these variables have a standard value. So the only thing that needs to be done is the calculation. This is what my script code looks like: function location() { var woonplaats = document.getElementById("woonplaats").value; switch (woonplaats) { case "amstelveen": locationAm(); break; case "badhoevedorp": poelBa(); break; div2.innerHTML = "Jouw gemiddelde reistijd is: &lt;b&gt;" + tijd + "&lt;/b&gt; km/h"; function locationAm() { var e = document.getElementById("bestemming"); var eindbest = e.options[e.selectedIndex].value; var x = document.getElementById("bestemming"); var vervoer = x.options[e.selectedIndex].value; if (eindbest == ameer) { var distance = 14500 ; } else if (eindbest === groning) { var distance = 183000 ; } else if(eindbest === zwolle) { var distance = 114000 ; } if (vervoer === kuruma ) { var time = distance / 28 ; } else if (vervoer === jitensha) { var time = var distance / 4 ; } else if ( vervoer === densha) { var time = var distance / 56 ; } else if (vervoer === scoot) { var time = var distance / 8 ; } div2.innerHTML = "your travel time will be &lt;b&gt;" + time + "&lt;/b&gt; km/h"; } function locationBa() { var e = document.getElementById("bestemming"); var eindbest = e.options[e.selectedIndex].value; var x = document.getElementById("bestemming"); var vervoer = x.options[e.selectedIndex].value; if (eindbest == ameer) { var distance = 13000 ; } else if (eindbest === groning) { var distance = 40000 ; } else if(eindbest === zwolle) { var distance = 600000 ; } if (vervoer …
tagged with: time
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46074082
type: Question
has title: How to make simple calculation with JavaScript to know travel time?
has answer: http://stackoverflow.com/a/28907469
tagged with: distance
score: 0
has comment: http://stackoverflow.com/comment/46074244
accepted answer: http://stackoverflow.com/a/28907469
answer count: 1
tagged with: javascript
tagged with: variables

http://stackoverflow.com/a/29060584
score: 0
answers question: http://stackoverflow.com/q/29043622
type: Answer
has body: you can use jQuery’s Deferred / Promise features. $.when(something).then(doSomething); var that = this; var templateRetrieved = this.getTemplate(); $.when(templateRetrieved).then(function(template){ var html = that.renderTemplate(template, data); that.$el.html(html); });

http://stackoverflow.com/a/29012056
type: Answer
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/29009007
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29009007
type: AcceptedAnswer
has body: Facelets is a XML based view technology which uses XHTML+XML to generate HTML output. XML has five special characters which has special treatment by the XML parser: < the start of a tag. > the end of a tag. " the start and end of an attribute value. ' the alternative start and end of an attribute value. & the start of an entity (which ends with ;). In your particular case, the unescaped < in a JavaScript string triggered the XML parser to start a tag. The id is recognized as a tag attribute and then it will search for an open quote like " or '. However, in your particular case, you was using \ to escape it as a quote for a JavaScript string. This totally explains the XML parsing error you got: Open quote is expected for attribute "{1}" associated with an element type "id" In essence, you're writing JavaScript code in the wrong place, a XML document instead of a JS file, so you should be escaping all XML special characters accordingly. So, essentially, the $("#service_container").append(" SomeText ") must become $("#service_container").append(" SomeText ") to make it XML-valid. Noted should be that some parsers are more forgiving in some character sequences, with the most parsers you could just keep using > instead of escaping it. However, this makes the JavaScript code harder to read and maintain. As stated in Mozilla Developer Network's excellent document Writing JavaScript for XHTML, you should be placing the JavaScript code in a character data (CDATA) block. Thus, in JSF terms, that would be: <h:outputScript> // ... </h:outputScript> The XML parser will interpret the block's contents as "plain vanilla" character data and not as XML and hence interpret the XML special characters "as-is". But, much better is to just put the JS code in its own JS file which you include by , or in JSF terms, the <h:outputScript>. <h:outputScript name="functions.js" target="head" /> This way you don't need to worry about XML-special characters in your JS code. See also: Error parsing …

http://stackoverflow.com/q/29005349
has answer: http://stackoverflow.com/a/29005417
accepted answer: http://stackoverflow.com/a/29005417
favorite count: 0
tagged with: iframe
has body: I have a webpage with several iframe youtube videos embedded in it. In the script side, i have to find which video is clicked and started to play. example: if a user click video1, then the script alert "http://www.youtube.com/embed/video1" if a user click video2, then the script alert "http://www.youtube.com/embed/video2" if a user click video3, then the script alert http://www.youtube.com/embed/video3 Thanks in advance.
upvote count: 1
tagged with: youtube
type: AnsweredQuestion
score: 1
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Iframe youtube multiple videos tracking

http://stackoverflow.com/comment/46087577
type: QuestionComment
comment on: http://stackoverflow.com/q/28914656
type: Comment
has text: Have you tried: `.on("click touchstart", function()...`
score: 0

http://stackoverflow.com/a/28917846
has body: So your code looks like this? for(var i = 0; i &lt; parks.length; i++) { parks[i]["distance"] = calcDistance(parks[i].latitude, parks[i].longitude, user.latitude, user.longitude); } That works fine. Nothing's undefined there. Here is a more complete example. https://jsfiddle.net/yhkzo95L/
has comment: http://stackoverflow.com/comment/46093642
has comment: http://stackoverflow.com/comment/46097353
score: 0
answers question: http://stackoverflow.com/q/28917073
type: Answer

http://stackoverflow.com/q/28946977
tagged with: javascript
has title: Importing ES6 Class under a different name
tagged with: ecmascript-6
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/28947271
favorite count: 0
has body: Using gulp, browserify &amp; babelify, exporting/import classes worked fine until I tried to import the same class under a different name: // Acme/DefaultInit.js export default class DefaultInit { constructor() { console.log('hello'); } } // App/Init.js import * as B from "../Acme/DefaultInit"; class Init extends B.DefaultInit { constructor() { super(); console.log('how are you?'); } } So when I run the gulp built script, the error is: TypeError: Super expression must either be null or a function, not undefined coming from the babel generated code if (typeof superClass !== "function" &amp;&amp; superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } What I'm doing wrong there ? Note that are no jslint errors
has answer: http://stackoverflow.com/a/28947271
type: AnsweredQuestion
score: 1
tagged with: babeljs
upvote count: 1
type: Question

http://stackoverflow.com/q/28939828
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46134661
has comment: http://stackoverflow.com/comment/46140198
type: Question
tagged with: highcharts
has comment: http://stackoverflow.com/comment/46135771
tagged with: javascript
score: 0
has body: Please have a look at this bubble-chart picture. You see I have 3 series bundle, system and product. Within these series a number makes them unique. Each bubble has a "name" which is very long unfortunately. Now I had the Idea, that I put that into the legend not into the bubble itself. Is this possible?
has comment: http://stackoverflow.com/comment/46135063
has title: highcharts bubble chart legend with unique numbers
has comment: http://stackoverflow.com/comment/46365434
has comment: http://stackoverflow.com/comment/46380775

http://stackoverflow.com/a/28923612
upvote count: 4
has comment: http://stackoverflow.com/comment/46122806
type: AcceptedAnswer
downvote count: 0
has body: You can use the read methods of DataView to read 16 or 32 bit values as little-endian or big-endian (default) like this: var uint32lsb = view.getUint32(0, true); // little-endian, from byte-position 0 in buffer var uint32msb = view.getUint32(0, false); // big-endian, last argument is optional and of course the same for getInt32()/getUint16()/getInt16() (single bytes of course, does not have endianess, ie. getInt8() etc.). If the buffer is in big-endian and you read it manually as big-endian you can now shift and mask the values for each byte like this: var a = (uint32be &amp; 0xff000000)&gt;&gt;&gt;24; var r = (uint32be &amp; 0xff0000)&gt;&gt;&gt;16; var g = (uint32be &amp; 0xff00)&gt;&gt;&gt;8; var b = uint32be &amp; 0xff; If you read it as little-endian, just reverse the order: var a = uint32le &amp; 0xff; var r = (uint32le &amp; 0xff00)&gt;&gt;&gt;8; var g = (uint32le &amp; 0xff0000)&gt;&gt;&gt;16; var b = (uint32le &amp; 0xff000000)&gt;&gt;&gt;24; You can also read single bytes as long as you know the original order of the buffer. For example, if the buffer is big-endian you can read the four first bytes like this: var pos = 0; var a = view.getUint8(pos++); var r = view.getUint8(pos++); var g = view.getUint8(pos++); var b = view.getUint8(pos++); In your example the buffer is empty though so you will only get 0´s. To create a typed array buffer with 32 uint values, and then get a DataView you can do: var buffer32 = new Uint32Array(argb_16x16_LONG); var view = new DataView(buffer32.buffer); // or the original argb_16x16_LONG directly (They point to the same underlying ArrayBuffer so there is no new memory allocated for the buffer.) Hope this helps.
answers question: http://stackoverflow.com/q/28923426
has comment: http://stackoverflow.com/comment/46111140
type: Answer
has comment: http://stackoverflow.com/comment/46122807
has comment: http://stackoverflow.com/comment/46104095
accepted answer of: http://stackoverflow.com/q/28923426
has comment: http://stackoverflow.com/comment/46104092
has comment: http://stackoverflow.com/comment/46126270
score: 4

http://stackoverflow.com/comment/46250969
type: Comment
type: QuestionComment
has text: @jtimperley But it's not in an event handler. And he's not returning its value.
score: 0
comment on: http://stackoverflow.com/q/29001604

http://stackoverflow.com/comment/46317731
has text: in the code above does `results.length` and `var item = results [ i ]` need to be `parsed.length` and so on?
type: Comment
comment on: http://stackoverflow.com/a/29038331
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46098607
comment on: http://stackoverflow.com/a/28920448
score: 0
type: AnswerComment
type: Comment
has text: Thanks! Very nice answer, I chose **@l'L'l**'s answer because he managed to do it with the `.match` function, but yours is really good too!

http://stackoverflow.com/q/28958573
linked to: http://stackoverflow.com/q/9229645
answer count: 4
has body: But I want to leave last two duplicated value in array just like arr = [1,2,3,4,4,4,4,4,5,6,6,6] and the result will be result = [1,2,3,4,4,5,6,6] The reason why I want to leave last two is I have 2 arrays like date and data and it must match with each other. Thank you.
has answer: http://stackoverflow.com/a/28958858
has comment: http://stackoverflow.com/comment/46170265
linked to: http://stackoverflow.com/q/1960473
has title: Javascript - Remove duplicates value in array
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28958599
type: Question
has comment: http://stackoverflow.com/comment/46170447
score: 0
has answer: http://stackoverflow.com/a/28958919
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28958752

http://stackoverflow.com/comment/46113899
comment on: http://stackoverflow.com/q/28929025
has text: Parentnode. Is it some sort of recursion that ends up returning null when you are at the root?
score: 0
type: Comment
type: QuestionComment

flashlight
tags question: http://stackoverflow.com/q/29048519
type: Tag
tag name: flashlight

http://stackoverflow.com/a/28919554
has body: It's a little difficult to see exactly what's going wrong here. Sometimes you are referring to the hidden input having a name of "personID" in your code snippets, and sometimes "guestID". It would obviously cause issues if this disparity exists in your actual code. If you make sure that the rendered HTML is what you expect (using personID as the hidden input's name) then the following should work: $('#table_data tbody').on('click', 'tr', function () { var $tr = $(this); if ($tr.hasClass('active')) { $tr.removeClass('active'); } else { $tr.addClass('active'); // Use the input's name to find it within the &lt;tr&gt; var d = $tr.find('input[name=personID]').val(); alert(d); } }); Example: JSFiddle Then, it seems overkill to have a whole table column just for a hidden input. You could simply place the hidden input in the same column as the person's name - or even store it as a data attribute on the table row itself. Also, in your PHP loop, you are giving all your hidden inputs the same "personID" ID which is not technically correct - all ID values in an HTML document should be unique.
answers question: http://stackoverflow.com/q/28916875
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/46101706
score: 3
accepted answer of: http://stackoverflow.com/q/28916875
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28974002
has comment: http://stackoverflow.com/comment/46295781
has comment: http://stackoverflow.com/comment/46303123
answers question: http://stackoverflow.com/q/28973897
has comment: http://stackoverflow.com/comment/46312600
accepted answer of: http://stackoverflow.com/q/28973897
score: 3
has body: something like this: $(".teaser").mouseenter(function(){ $(this).find('video').media.play(); }); you could show the html that would make it easier... EDIT: here you go $(".teaser").mouseenter(function(){ $(this).find('video').get(0).play(); });
has comment: http://stackoverflow.com/comment/46309682
has comment: http://stackoverflow.com/comment/46200298
type: AcceptedAnswer
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/46264194
has comment: http://stackoverflow.com/comment/46244237
downvote count: 0

http://stackoverflow.com/comment/46123851
comment on: http://stackoverflow.com/q/28934016
type: Comment
type: QuestionComment
score: 1
has text: That's because function Greeting(`this section is used to pass arguments/values`) into the function.

http://stackoverflow.com/comment/46305882
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29031792
has text: @collapsar, I think it does not work. For instance, `U+D801` shouldn't be accepted (it's not valid XML) and it seems accepted: http://jsfiddle.net/mymxyjaf/16/. What is it wrong?
score: 0

http://stackoverflow.com/a/29031993
downvote count: 1
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/29031901
score: -1
has body: jQuery's css method can set any css style attribute. It's used like this: $('jQuery selector').css({"css property name":"css property value"}); To changing background color on a div with id="test" $('#test').css('background-color','#FF0000');

http://stackoverflow.com/q/28938933
tagged with: stylesheet
type: Question
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28939512
linked to: http://stackoverflow.com/q/28897149
has answer: http://stackoverflow.com/a/28939130
possible better answer: http://stackoverflow.com/a/28939491
has title: Stylesheet switcher button to toggle html when clicked (jQuery)?
answer count: 3
has answer: http://stackoverflow.com/a/28939491
has comment: http://stackoverflow.com/comment/46133146
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/46133532
has comment: http://stackoverflow.com/comment/46133917
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28939512
type: AnsweredQuestion
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/46133809
has body: I have a button at the top of my page that enables the use of a separate stylesheet for printing, I have a normal print.css that enables everything when printing and I have a acrfprint.css which just prints certain elements out. Someone on here gave me some help getting this to work last week using the following JS: This works perfectly but the only issue is that the button doesn't really give you any idea if the acrf-print.css has been enabled or how to disable it. Basically the HTML I'm using it this: Enable Annotation Print Mode (I know I'm using ' instead of " but that's because it's nested in VBScript) What I want to do is when the button is clicked, change the stylesheet to acrfprint.css and then display the following HTML instead Disable Annotation Print Mode When the disable button is selected I want the css to return to print.css Any help would be greatly appreciated.

http://stackoverflow.com/comment/46344494
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29053448
has text: I would imagine the first case was caused by the latency in downloading the JS file from Google API. The second example would not have had this overhead as the `console.log` would have been put straight in to the page. I haven't tested this however, and am only making an assumption.

http://stackoverflow.com/comment/46139386
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28942549
type: QuestionComment
has text: https://developer.mozilla.org/en-US/docs/Web/Guide/API/Camera

http://stackoverflow.com/q/28920209
has title: Sending value of radiobutton using ajax to node.js
type: Question
upvote count: 1
tagged with: javascript
tagged with: express
tagged with: ajax
has body: I am trying to send the value of a radiobutton using Ajax to my express/node app but I am having a problem (I am new to ajax). There are several other posts regarding this topic but I can't seem to get mine to work. I am creating a multiple choice question application and would like to send the value of the answer selected. Here is my js script: lockAnswer = function(value) { var x = document.getElementsByName("answer"); for ( i = 0; i &lt; x.length; i ++ ) x[i].disabled = true; document.getElementById("explanation").style.display = ""; $.ajax({ type: "POST", url: window.location.pathname, data: { "value": document.getElementById('answer').value }, success: alert(1), error: alert(0) }); }; The answers get locked but no success message or error message is sent out. My node code is: app.post('/test/:username/:testid/:noq/:quesnum', users.answer_selected); module.exports.answer_selected = function (req,res) { console.log("Made it!"); };
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28920376
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28920376

http://stackoverflow.com/q/28954811
favorite count: 0
has title: chrome.contextMenus `onclick` doesn't do anything
linked to: http://stackoverflow.com/q/26245888
accepted answer: http://stackoverflow.com/a/28960894
score: 3
tagged with: google-chrome-extension
upvote count: 3
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28960894
tagged with: javascript
type: Question
has body: I'm trying to add a context menu item to a chrome app and it's not showing up at all. Everything I've read seems to indicate that I'm doing the right thing here, but evidently I'm not. background.js: var clickHandler = function(e) { console.log('testing testing'); } chrome.contextMenus.create({ "title": "Click Me", "contexts": ["page", "selection", "image", "link"], "onclick" : clickHandler }); manifest.json: { "update_url": "https://clients2.google.com/service/update2/crx", "name": "Test", "description": "Test", "manifest_version": 2, "version": "3.2.3", "kiosk_enabled": true, "icons": { "128": "icon_128.png", "16": "icon_16.png" }, "app": { "background": { "scripts": [ "background.js" ], "persistent": false } }, "permissions": [ "http://*/", "https://*/", "webview", "storage", "power", "alwaysOnTopWindows", "idle", "contextMenus" ] } There are no errors being logged or anything like that. The item simply does not show up. What am I missing here?
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/46107673
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28925529
has text: I'm pretty sure there are not that many listeners, and it's possible to examine code if each of them. You can use more advanced tools if you want, check SpyJS.
score: 0

http://stackoverflow.com/comment/46150506
score: 0
has text: Thanks! I read that semicolons cannot be used with curly brackets so I am guessing that means that you still use them within a curly bracket but not after one? Please let me know.
type: Comment
comment on: http://stackoverflow.com/a/28932622
type: AnswerComment

http://stackoverflow.com/comment/46293383
comment on: http://stackoverflow.com/q/29025231
has text: Why are you setting the interval in the controller, and not in the service itself? Also, you should use `$interval`, rather than `setInterval` to avoid having to do `$scope.apply`
score: 0
type: Comment
type: QuestionComment

identifier
tag name: identifier
type: Tag
tags question: http://stackoverflow.com/q/28918324
tags question: http://stackoverflow.com/q/29032224

http://stackoverflow.com/comment/46437773
comment on: http://stackoverflow.com/a/28992341
score: 0
type: AnswerComment
has text: That worked PERFECTLY! Thank you very much for taking the time to help!
type: Comment

http://stackoverflow.com/comment/46140041
comment on: http://stackoverflow.com/q/28942881
score: 0
type: Comment
has text: Related: http://stackoverflow.com/questions/10313142/javascript-capture-mouse-wheel-event-and-do-not-scroll-the-page
type: QuestionComment

http://stackoverflow.com/a/29054436
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29054416
has body: Try this brightRoom('bedroom'); function brightRoom(room){ console.log("bright " + room); }
upvote count: 1
score: 1

http://stackoverflow.com/comment/46257830
type: Comment
has text: can you please add your html code or create one fiddle example?
score: 0
comment on: http://stackoverflow.com/q/29005798
type: QuestionComment

http://stackoverflow.com/q/28921322
has answer: http://stackoverflow.com/a/28921961
type: Question
has title: JavaScript keeps reloading my page
has answer: http://stackoverflow.com/a/28921353
answer count: 3
has answer: http://stackoverflow.com/a/28921340
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46099945
possible better answer: http://stackoverflow.com/a/28921340
has body: I am running this script on my page to replace mc= to MediaCode= in my url, the script works but it keeps reloading the page over and over. This is the script:
accepted answer: http://stackoverflow.com/a/28921353
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46100322

http://stackoverflow.com/a/29079111
answers question: http://stackoverflow.com/q/28978843
has body: You can use own events to pass data between elements. Parent component: <polymer-element name="parent-element"> Child component: <polymer-element name="sub-element" attributes="foo bar"> Send
downvote count: 0
type: Answer
score: 16
upvote count: 16

http://stackoverflow.com/comment/112848311
has text: try [ ID eq guid'07a2c616-968b-4a73-97bc-031c401e0b07' ]. Worked for me
type: AnswerComment
type: Comment
score: 2
comment on: http://stackoverflow.com/a/29025578

http://stackoverflow.com/comment/46345277
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29052005
has text: @Firedrake969 it disappears on click, not on text input. by "input" in the Questio header I meant the JS/JQ event, "input".

http://stackoverflow.com/q/28978312
has comment: http://stackoverflow.com/comment/46207347
accepted answer: http://stackoverflow.com/a/28978435
type: AnsweredQuestion
has title: Javascript parsing from json format
tagged with: http://stackoverflow.com/tag/json
type: Question
possible better answer: http://stackoverflow.com/a/28980439
tagged with: javascript
has answer: http://stackoverflow.com/a/28980439
score: 0
has answer: http://stackoverflow.com/a/28978435
answer count: 2
has body: Im having issue parsing javascript. I want to output the value of title permalink and the value of basename labeled "image_01". So it will only outputs http://blog.url/news/images/201516.jpg &lt;div id="placeholder"&gt;&lt;/div&gt; &lt;script&gt; var data={ "items": [ { "title": "HELLO THIS IS TITLE", "customFields": [ { "basename": "image_01", "value": "&lt;form mt:asset-id=\"352706\" class=\"mt-enclosure mt-enclosure-image\" style=\"display: inline;\"&gt;&lt;a href=\"http://blog.url/news/images/201516.jpg\"&gt;201516.jpg&lt;\/a&gt;&lt;\/form&gt;" }, { "basename":"image_02", "value":"&lt;form mt:asset-id=\"352705\" class=\"mt-enclosure mt-enclosure-image\" style=\"display: inline;\"&gt;&lt;a href=\"http://blog.url/news/images/201516.jpg\"&gt;201517.jpg&lt;\/a&gt;&lt;\/form&gt;" }, { "basename":"image_03", "value":"" }, ], "permalink": "http://blog.com/index.php" } ] } document.getElementById("placeholder").innerHTML=data.items[0].title + " " + data.items[0].permalink+"--"+ data.items[0].customFields[0].basename[0].image_01; &lt;/script&gt; http://jsfiddle.net/v57s2csa/3/

http://stackoverflow.com/comment/46086338
comment on: http://stackoverflow.com/q/28913571
score: 0
has text: @Juhana turns out that was the problem. Thanks for your help, I've now made it capable of moving left and right as well - https://jsfiddle.net/Tobsta/2gnoq5hx/2/
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29035387
type: Answer
has body: You can call a submitForm() method within the success: of the uploadImage ajax. $(document).ready(function (e){ $("#uploadForm").on('submit',(function(e){ document.getElementById("submit").disabled = true; // disable submit button so user doesn't press it again e.preventDefault(); $.ajax({ url: "upload.php?" + rand, type: "POST", data: new FormData(this), contentType: false, cache: false, processData:false, success: function(d) { console.log("image properly uploaded"); submitForm(); }, complete: function(data){ } }); })); }); function submitForm(){ //Your code here }
score: 0
answers question: http://stackoverflow.com/q/29035081

http://stackoverflow.com/comment/46298432
has text: This may help: https://stackoverflow.com/questions/28837326/javascript-fullscreen-rectangle-in-canvas-android-ios-web-app/28843722#28843722
type: Comment
comment on: http://stackoverflow.com/q/29027477
score: 0
type: QuestionComment

http://stackoverflow.com/a/29021986
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29020548
answers question: http://stackoverflow.com/q/29020548
has body: The issue here is that you are catching the wrong event. Select2 triggers all events using the lowercase name, so you should be catching select2:select, not Select2:select.
upvote count: 1

http://stackoverflow.com/comment/46088582
comment on: http://stackoverflow.com/a/28915161
score: 0
has text: Thanks, @Eyal. I´ll look into flex. However removing float:left; from the ".trEmulator li "-styling breaks the table structure, and reintroducing it takes me back to Sq.1.
type: Comment
type: AnswerComment

http://stackoverflow.com/q/29032087
answer count: 1
has body: Is it possible, to bind links and scripts(css/js) with knockout? I tried to bind it like: &lt;!-- ko text: headerLibs --&gt; &lt;!--/ko --&gt; But it is just text. Property headerLibs can contain from 0 to 10 different libs.
type: AnsweredQuestion
has title: Knockout.js binding css/js libraries in header
tagged with: knockout.js
type: Question
has answer: http://stackoverflow.com/a/29032426
accepted answer: http://stackoverflow.com/a/29032426
tagged with: javascript
score: 0
tagged with: knockout-2.0

http://stackoverflow.com/comment/46327508
score: 0
type: AnswerComment
type: Comment
has text: @Pointy still you have not answered my question but I appreciate your answer what i am asking is for any reason which one trigger first
comment on: http://stackoverflow.com/a/29043559

http://stackoverflow.com/q/28957801
has answer: http://stackoverflow.com/a/28957958
linked to: http://stackoverflow.com/q/9346346
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28957874
linked to: http://stackoverflow.com/q/9814298
has body: i have used the event for the whole row and perform some function by ajax in the page task.php and change the style removed the class and displayed the message without refreshing the page . Eventhough i have removed the class view_task its still getting worked and doing the function how to prevent it. and also changed the class with toggle class(jquery function $('#task tbody tr.view_task').dblclick(function(e){ var task_id = this.id.split('-'); var id = this.id; $.post('task.php',{'task':task_id[1],'action':'update_count','type':task_id[2],'index':task_id[3]},function(data){ $('#'+id).css('background-color','white'); $('#'+id).removeClass( "view_task" ); $("#message2").html('Task Viewed '); }); e.preventDefault(); });
linked to: http://stackoverflow.com/q/12824549
type: Question
possible better answer: http://stackoverflow.com/a/28957857
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28957857
has answer: http://stackoverflow.com/a/28957872
tagged with: ajax
tagged with: class
score: 0
has answer: http://stackoverflow.com/a/28958052
has answer: http://stackoverflow.com/a/28957874
linked to: http://stackoverflow.com/q/9730277
has title: how to stop the event of the class without refreshing
linked to: http://stackoverflow.com/q/8752321
answer count: 5
tagged with: innerhtml

http://stackoverflow.com/q/29000153
accepted answer: http://stackoverflow.com/a/29054795
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46383193
has comment: http://stackoverflow.com/comment/46292196
has comment: http://stackoverflow.com/comment/46292560
has comment: http://stackoverflow.com/comment/46314163
favorite count: 0
has comment: http://stackoverflow.com/comment/46346929
upvote count: 2
linked to: http://stackoverflow.com/q/9032517
has body: Problem: We currently have the following require.config: require.config({ paths: { lodash: '/embed/lodash', utils: '/embed/utils', analytics: '/external/analytics' } }); file paths that start with embed are guaranteed to exist. file paths that start with external may or may not be available, depending on the environment. If I begin my main.js with the following: require(['lodash', 'utils', 'analytics'], function (_, utils, analytics) { and analytics can't be found, the whole thing crashes (as expected). Trying variations on the following proved fruitless: require(['lodash', 'utils'], function (_, utils) { ...code and stuff $.ajax({ url: '/path/to/actual/file' }) .done(function () { require(['analytics'], function (analytics) { // throws Mismatched anonymous define() module Error }); }) .fail(function () { // continue with stub of analytics // or not run analytics dependent code }); As per the title of this question: Is there a way to conditionally include a module in RequireJS based on whether or not the file is accessible?
has answer: http://stackoverflow.com/a/29012711
has answer: http://stackoverflow.com/a/29054795
has title: Is there a way to conditional load a module via RequireJS based on whether or not the module 404s?
tagged with: requirejs
type: AnsweredQuestion
score: 2
possible better answer: http://stackoverflow.com/a/29012711
tagged with: amd
type: Question
has comment: http://stackoverflow.com/comment/46292401
answer count: 2

http://stackoverflow.com/a/29016367
downvote count: 0
upvote count: 2
has body: Set the visibility of that element in css before running any js code. #s2 { visibility: 'hidden' }
answers question: http://stackoverflow.com/q/29016296
has comment: http://stackoverflow.com/comment/46277180
type: Answer
score: 2

http://stackoverflow.com/comment/46174813
score: 0
type: Comment
type: QuestionComment
has text: So the ISP host details are not sent over the browser?
comment on: http://stackoverflow.com/q/28960827

http://stackoverflow.com/q/28920401
has comment: http://stackoverflow.com/comment/46099180
has comment: http://stackoverflow.com/comment/46098785
has answer: http://stackoverflow.com/a/28920684
accepted answer: http://stackoverflow.com/a/28920684
tagged with: node.js
type: AnsweredQuestion
tagged with: httprequest
type: Question
tagged with: http-proxy
answer count: 1
tagged with: javascript
tagged with: express
score: 0
has title: How to forward a request to another URL with all request information (headers, ip etc.)?
has body: Please see below: My app receives request from the user. My app makes an API call to the 3rd party application using request module. In order 3rd party API to work properly it needs to receive USERS IP and header information. (It's an ad server). But when I send a request through my app -as expected- 3rd party receives my app server's IP and headers. The question is: How can I make my application's request to the 3rd party API to "seem like" the user? How can I "clone" the request of user's to 3rd party? Thanks

http://stackoverflow.com/comment/46111625
has text: What version of nodejs/iojs are you using?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28926055

http://stackoverflow.com/a/29017228
type: Answer
answers question: http://stackoverflow.com/q/29017134
has body: Try this : console.log(typeof boy); the boy var is an Object, not an Function
score: 0

http://stackoverflow.com/q/28957018
has comment: http://stackoverflow.com/comment/46167589
has comment: http://stackoverflow.com/comment/46167734
tagged with: angular-ngmodel
has comment: http://stackoverflow.com/comment/46167095
has comment: http://stackoverflow.com/comment/46167029
has answer: http://stackoverflow.com/a/28977078
tagged with: javascript
has comment: http://stackoverflow.com/comment/46167799
has comment: http://stackoverflow.com/comment/46167395
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46167699
has comment: http://stackoverflow.com/comment/46167892
tagged with: angularjs
tagged with: viewmodel
type: UnansweredQuestion
tagged with: asp.net-mvc-5.2
has body: I have the following controller working and I can use ng-repeat to display the ONE json object I have. I just used ng-repeat to make sure the data was actually coming across. But I can't figure out how to bind my input fields to show the data inside the text fields in this edit view/template. Controller angular .module("renderIndex", ["ngRoute","ngCookies"]) .config(config) .controller("favoritesController", favoritesController) .controller("newFavoriteController", newFavoriteController) .controller("editFavoriteController", editFavoriteController); function config($routeProvider) { $routeProvider //...left out for brevity .when("/editfavorite/:searchId", { templateUrl: "/ng-js/ng-templates/editFavoriteView.html", controller: "editFavoriteController", controllerAs: "vm" }) .otherwise({ redirectTo: "/" }); }; //...left out for brevity function editFavoriteController($http, $window, $routeParams) { var vm = this; vm.search = []; var url = "/api/favorites/" + $routeParams.searchId; $http.get(url) .success(function (result) { vm.search = result; }) .error(function () { alert('error/failed'); }) .then(function () { //Nothing }); }; The controller works, it accepts a parameter of id and that is is used and tacked onto the end of the api endpoint URL. I get back a good response that is one json object, I am able to pass that over to the view using vm.search and if you notice at the bottom of the view I have a ng-repeat (which is only there because I wanted to make sure that some data was actually coming over the wire and it is. Of course it only repeats one record because this is an edit page, but it works, but my binded inputs are not showing anything in the text fields when the view renders. This has to be something simple, can anyone help? EditView/Angular Template Edit Search Name Description | Cancel {{s.name}} - {{s.userId}} So just to reiterate.... Data is being sent over in vm.search and it is the one database record that I am expecting, I know it is because it dis…
has comment: http://stackoverflow.com/comment/46167438
has title: Angular ng-model not binding to input fields
has answer: http://stackoverflow.com/a/28957158
has comment: http://stackoverflow.com/comment/46167688
has comment: http://stackoverflow.com/comment/46166998
type: Question

http://stackoverflow.com/comment/139961581
score: 1
has text: @jcairney You're spot on, thanks! I'm surprised nobody noticed in the 10 years since this answer was written. Corrected.
type: AnswerComment
comment on: http://stackoverflow.com/a/29022378
type: Comment

http://stackoverflow.com/q/28964886
has body: Is it possible to include external file with webpack (outside the context) and make the file included in built output bundle.js? consider this setup where "sub-app" is context for webpack: /sub-app/entry.js /bower-components/zepto/zepto.js And webpack config with broccoli: var webpackify = require('broccoli-webpack'); var path = require('path'); var webpack = require("webpack"); var bundler = webpackify(path.resolve('sub-app'), { entry: './entry', output: {filename: './bundle.js'}, devtool: 'eval', module: { loaders: [ {test: /\.js$/, loader: 'babel-loader'}, {test: /\.hbs$/, loader: "handlebars-loader"} ] }, plugins: [ new webpack.optimize.DedupePlugin(), new webpack.optimize.UglifyJsPlugin() ] }); I would like to include zepto.js in output bundle.js. But I need to preserve bower_components outside the sub-app.
score: 25
type: AnsweredQuestion
upvote count: 25
type: Question
accepted answer: http://stackoverflow.com/a/28966095
tagged with: webpack
linked to: http://stackoverflow.com/q/44151194
has comment: http://stackoverflow.com/comment/97271795
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28966095
has title: How to include external file with webpack

http://stackoverflow.com/comment/46201562
comment on: http://stackoverflow.com/q/28975226
has text: ah okay.. well what I actually did was use .push in a for loop on each of the arrays. I just tried to make it simple in this example. Sorry, I will change it.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46348356
type: QuestionComment
comment on: http://stackoverflow.com/q/29055411
score: 0
has text: @Anonymous I agree. I have spent the last hour trying different solutions, but nothing seems to work.
type: Comment

http://stackoverflow.com/comment/46091208
comment on: http://stackoverflow.com/q/28916710
type: Comment
type: QuestionComment
has text: It would help to know which library you're using.
score: 2

http://stackoverflow.com/q/28970830
downvote count: 0
tagged with: javascript
tagged with: drop-down-menu
tagged with: jquery
has title: How to disable certain options in a drop down select?
favorite count: 0
has answer: http://stackoverflow.com/a/28970961
has comment: http://stackoverflow.com/comment/46193664
score: 3
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/46193384
tagged with: select
accepted answer: http://stackoverflow.com/a/28970961
has body: We have two different drop down box's and depending on which one is selected in the first one, options will be grayed out in the second. http://jsfiddle.net/vUEks/109/ HTML Option 1 Option 2 Option 3 Option 4 Option 5 Option 6 JS if ($('option[value=2]').prop('selected', true)) { $('option[value=5]').prop('disabled', true); }
type: Question
answer count: 1

http://stackoverflow.com/comment/46220856
score: 0
type: Comment
has text: check this fiddle https://jsfiddle.net/9fqfh8ty/ here multiple forms are being used and a save action for each form, I have also editted the answer above , let me know if this solves your issue
comment on: http://stackoverflow.com/a/28983952
type: AnswerComment

http://stackoverflow.com/comment/46102472
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28922664
type: Comment
has text: That did it! What would you recommend instead of document.write?

http://stackoverflow.com/comment/46229227
type: QuestionComment
comment on: http://stackoverflow.com/q/28990291
has text: @MattBurland Thanks, my question was already answered and marked as a dublicate :( Thanks anyway!
score: 0
type: Comment

http://stackoverflow.com/q/29048042
has answer: http://stackoverflow.com/a/33472959
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I want to open HTML form in fancy box when button is clicked. At present form is open in bottom of page not in fancy box. Please have a look in my code Layout/custommodule.xml file skin_js js/custom_module/custommodule.js css/custom_module/custommodule.css css/custom_module /jquery.enter code herefancybox.css custommodule.js file code for open fancybox function loadcustomform(reloadurl){ new Ajax.Request(reloadurl, { method: 'post', parameters: Form.serialize($('product_addtocart_form')), onSuccess: function(transport) { var json = transport.responseText.evalJSON(); var displayString = json.message; if(json.success) { jQuery('body').append(' '); jQuery('#output-div').html(''); jQuery('#output-div').html(json.request_form); jQuery.fancybox({ type: 'ajax', width:200, height:100, fitToView: false, content: jQuery('#output-div'), modal: false }); } } }); } Hint : If I comment the line skin_js js/lib/jquery-1.10.2.min.js in frontend/rwd/default/layout/page.xml then fancy box is open properly. Please help me on this. Thanks.
type: UnansweredQuestion
tagged with: magento-1.9
type: Question
has title: Open fancy box on button click in Magento 1.9
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29048961
has comment: http://stackoverflow.com/comment/46340489
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29048464
has body: Use it this way and it should work and you are right, this is scope issue. Here is the working fiddle Notice that I have taken snapshot of this in a variable and am using that. It is usually done in order to keep a reference to this when the context is changing. No use of new Keyword In your case returning {} is returning a new instance of anonymous object with properties as defined. Hence, you do not need new keyword also. You can take a look at this for anonymous objects. When you use this, the scope of this changes in return {} object and they no more refer to the Example object. Using getter / setter function You don't need them. assignments would do, but remember, the variables would be attached with self so you would need to do self.name = name and self.purpose = purpose in order to do assignments or get values. var Example = (function() { var self = this; function getInfo() { return 'The purpose of "' + name + '" is: ' + purpose; } // Public stuff return { name: '', purpose: '', setInfo: function(name, purpose) { self.name = name; self.purpose = purpose; }, showInfo: function() { alert(getInfo()); } }; })(undefined); Example.setInfo('someModule', 'Showing some stuff.'); Example.showInfo(); Update: Fiddle wasn't saved properly I have updated that. Also In there I just corrected your code. I think this is what you are trying to achieve: var Example = (function (params) { var self = this; self.name = params.name; self.purpose = params.purpose; function getInfo() { return 'The purpose of "' + self.name + '" is: ' + self.purpose; }; self.showInfo(alert(getInfo())); return{ }; }); var myExample = new Example({ name: 'someModule', purpose: 'somePurpose' }); myExample.showInfo();
has comment: http://stackoverflow.com/comment/46337635
type: Answer
downvote count: 0

http://stackoverflow.com/q/28988623
has answer: http://stackoverflow.com/a/28992836
type: AnsweredQuestion
tagged with: asp.net-mvc
has title: How can i create an editable table column in jquery
type: Question
has comment: http://stackoverflow.com/comment/46226820
answer count: 1
accepted answer: http://stackoverflow.com/a/28992836
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have the above jQuery code that creates an a table listing items selected from a dropdownchecklist that supports multiple select. After a user has selected items in the dropdownchecklist, on onComplete, a "mini" table is created just below the dropdownchecklist with the users selected items. Currently, the created table is read-only but what i want to achieve is the user to proceed and update the created tables last column (Quantity) with a numeric value for each item (row) in the table. For example, if i selected Item_one, Item_five & Item_twenty from the dropdownchecklist, a table of 3 rows will be created. In that table i will have values for Item_ID and Item_Name. Now i want to be able to edit that table and input Item_Quantity against each row, after which i will finally save to the database. Does any one how i can modify the above code such that the table created has an editable third column (Quantity), that users can update? Below is the html for the dropdownlist @Html.DropDownList("ddlItemID", ViewBag.GatePassItemsList as SelectList, new { @multiple = "multiple" })
tagged with: asp.net-mvc-4
has comment: http://stackoverflow.com/comment/46227706
has comment: http://stackoverflow.com/comment/46227069
has comment: http://stackoverflow.com/comment/46226558

http://stackoverflow.com/q/28939784
answer count: 2
possible better answer: http://stackoverflow.com/a/28939842
has answer: http://stackoverflow.com/a/28939842
tagged with: angularjs
has answer: http://stackoverflow.com/a/28939885
type: AnsweredQuestion
tagged with: shopping-cart
has body: Angular beginner here. I'm trying to create a shopping cart for college. I need to add the name and price in a text input and after clicking a button the item is supposed to be added to a list. The thing is that whenever I press the button nothing happens, and I'm lost since the console doesn't tell me anything about what could be wrong. So, here's my code: Shopping Cart Add to cart Product: Price: <div"> {{product.name}} {{product.price}} {{product.price*amount}} And this is my js code: var myApp = angular.module("myApp", []); myApp.controller('myShoppingCart', function($scope) { $scope.products = []; function addProduct() { $scope.productos.push({nombre:$scope.nameProduct, price:$scope.priceProduct}); $scope.nameProduct = ""; $scope.priceProduct = ""; } });
has title: Add items to a shopping cart in AngularJS
type: Question
tagged with: angularjs-directive
accepted answer: http://stackoverflow.com/a/28939885
tagged with: javascript
tagged with: angularjs-scope
score: 0

http://stackoverflow.com/q/29039144
has comment: http://stackoverflow.com/comment/46318943
has comment: http://stackoverflow.com/comment/46319645
answer count: 0
type: UnansweredQuestion
tagged with: php
has body: for reasons that I won't get into here, I need to remove a plugin based on screenwidth. I can use CSS to 'display: none' but that is not sufficient because the code is still there and it causes a conflict. So I have been trying to get screen width via javascript and send that to the php file to keep the plugin from loading in this instance. However, I'm unclear how to access that variable in php. Here is what I have so far: var sWidth = window.screen.width; alert("sWidth is: " + sWidth); var xhttp = new XMLHttpRequest(); var url = "wp-content/plugins/NKS-custom/main.php?width=" + sWidth; xhttp.open("GET", url, true); xhttp.onload = function() { alert("Result: " + xhttp.responseText); }; xhttp.send(null); I got this code from somewhere else and I am unclear if I should specify the index.php file for 'var url' or the actual plugin file. I'd like to have an if/then statement in the php that executes the plugin code only if the screen width at certain size. How do I grab the width from the javascript and how can I test to make sure the php is processing it? I saw something like this in the same forum answer but it doesn't seem to work: $screen=$_GET["width"]; echo $screen; Do I use "width" as in their example above or should I be grabbing the "sWidth" variable in the php (or something else completely)? And if so, what is the correct syntax? Thanks in advance for any suggestions.
has comment: http://stackoverflow.com/comment/46319547
has comment: http://stackoverflow.com/comment/46320143
has comment: http://stackoverflow.com/comment/46320258
has title: Getting screen width via javascript to php variable
score: 0
tagged with: wordpress
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46319728

http://stackoverflow.com/q/28988206
type: Question
has title: WebRTC with Asterisk returns "SRTP unprotect" warning
upvote count: 2
tagged with: asterisk
score: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/52846193
has comment: http://stackoverflow.com/comment/64023700
tagged with: javascript
type: UnansweredQuestion
tagged with: sipml
tagged with: webrtc
answer count: 0
has body: I have this chat system that's using SIP for voice transmission (no phones, only browser to browser in the same server). The sound goes just fine in both ends, but asterisk gives a warning twice (one for each client probably): [Mar 11 09:01:27] WARNING[614][C-00000002]: res_srtp.c:407 ast_srtp_unprotect: SRTP unprotect failed with: authentication failure 10 [Mar 11 09:01:33] WARNING[614][C-00000002]: res_srtp.c:407 ast_srtp_unprotect: SRTP unprotect failed with: authentication failure 10 The keys where generated with: ./usr/src/asterisk-*/contrib/scripts/ast_tls_cert -C IpAddress -O "Company" -d /etc/asterisk/keys sip.conf file: [general] udpbindaddr=0.0.0.0:5060 realm=IpAddress transport=udp,ws,wss videosupport=no icesupport=yes allowguest=no allwaysreject=yes rtptimeout=30 My peers are set in sip.conf as: [000001] host=dynamic secret=000001 context=from-internal type=friend encryption=yes avpf=yes force_avp=yes icesupport=yes directmedia=no disallow=all allow=ulaw,alaw,gsm,all dtlsenable=yes dtlsverify=no dtlscertfile=/etc/asterisk/keys/asterisk.pem dtlscafile=/etc/asterisk/keys/ca.crt dtlssetup=actpass And I'm using sipML5 for the client. Any insights to clear the warnings?
favorite count: 0

http://stackoverflow.com/comment/46223911
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28987581
type: Comment
has text: Is "perpage" the same id of div you want to used for pagination ?

http://stackoverflow.com/q/28918137
has answer: http://stackoverflow.com/a/28929494
tagged with: cordova
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/46095019
has comment: http://stackoverflow.com/comment/46094521
type: Question
has comment: http://stackoverflow.com/comment/46094836
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28929494
has comment: http://stackoverflow.com/comment/46109156
has comment: http://stackoverflow.com/comment/46094063
has comment: http://stackoverflow.com/comment/46094470
has comment: http://stackoverflow.com/comment/46108511
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Why does JavaScript alert display an empty string in Phonegap Android App while the code is working perfectly fine on browser?
has body: I'm working on a simple PhoneGap application that communicates with a server that runs PHP, gets a string and displays it in JavaScript alert. The App works perfectly fine on a browser. The JavaScript alert displays the string returned by the PHP code on the server. This action happens on click event of a button. Here is the markup: PhoneGap Hello World! Click JS code $(document).ready(function(){ $("#eventfire").click(function(){ var data = { "action": "test" }; data=$.parseJSON('{ "name": "John" }'); $.ajax({ type: "POST", dataType: "text", url: "http://192.168.x.x/HelloWorldTest/response.php", //Relative or absolute path to response.php file data: data, success: function(data) { alert(data); alert("type is " + typeof data + ". Length is " + data.length); }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.statusText); alert(xhr.responseText); alert(xhr.status); alert(thrownError); }, statusCode: { 400: function () { alert("Bad request!"); }, 401: function() { alert("Unauthorized!"); }, 403: function() { alert("Forbidden!"); }, 404: function() { alert("Page not found!"); }, 408: function() { alert("Request Timeout!"); }, 200: function() { alert("page reached"); }, } }); }); }) PHP code <?php echo 'john'; ?> When I run this code on a AVD, the alert does not display the string. I have never seen such a alert getting displayed. The alert displayed inside the success function is shown below. On inspecting this string, I understood that the length is 0. I was able to reproduce the same issue on browser with a string of 0 characters length. I'm not sure why the piece of code that is working fine when run on browser but acts weirdly on AVD. The string was getting displayed as expected on browser but not on AVD. Find below the screenshots of the same code displaying the correct alert on browser. I want to know the possible reasons of why the string from PHP is getting lost ?
tagged with: android
has comment: http://stackoverflow.com/comment/46109139

http://stackoverflow.com/comment/46102155
comment on: http://stackoverflow.com/q/28922470
score: 0
has text: thanks for the reply. I guess i'm having trouble regenerating the page. It will show the full url hash but the lists & list are not populating.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46279209
score: 2
comment on: http://stackoverflow.com/q/29017548
type: Comment
type: QuestionComment
has text: possible duplicate of [adding 'click' event listeners in loop](http://stackoverflow.com/questions/8909652/adding-click-event-listeners-in-loop), or [javascript closure inside loops simple practical example](http://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example)

http://stackoverflow.com/comment/46361120
has text: @stylesenberg :I really appreciate you helping me out here. My problem is quite complex, In my actual table i have around 24 columns, columns types are ( checkbox, few select dropdown and one multiselect checkbox dropdown) . So I find it quite complex to implement , and ofcourse your option is cool but dont you think there should be simple way in datatables to retain the table state ?
type: Comment
comment on: http://stackoverflow.com/a/29059525
score: 0
type: AnswerComment

http://stackoverflow.com/q/28944914
type: Question
has title: Set LocalStorage based on dropdown value
score: -2
downvote count: 3
has comment: http://stackoverflow.com/comment/46144095
tagged with: javascript
has answer: http://stackoverflow.com/a/28944983
favorite count: 0
has comment: http://stackoverflow.com/comment/46144024
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has answer: http://stackoverflow.com/a/28945182
has answer: http://stackoverflow.com/a/38720276
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28944995
upvote count: 1
has body: How would I set the value of a localstorage item based on the value of a dropdown selection? Simple Black Blood Beige League Moon Night Serif Sky Solarized

http://stackoverflow.com/q/28913912
downvote count: 1
type: Question
has body: I have an html index page, which has a form on it. On submit the information is sent to a script (not on the page) for processing. I want this processed data sent back to the webpage to be displayed, but the page is already loaded. I understand I could send the data to a separate page but I don't want to set up another google script web app. Is there a way to keep a div from processing until a script function is returned? show? toggle?
tagged with: javascript
score: -1
upvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28915325
type: UnansweredQuestion
has title: Get data from a script, send to webpage for display
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/46352417
type: Comment
comment on: http://stackoverflow.com/a/29057540
type: AnswerComment
has text: This is an explanation for the wrong code. This is a common design pattern, but is not what the OP's question is about. The OP's code is `this.el = el || {};` which does something DIFFERENT than your code and your explanation. Perhaps the upvoters didn't realize that this does not even answer the question asked.
score: 0

http://stackoverflow.com/comment/96343179
has text: For the record, [window.scroll is not supported on Edge, IE, or Safari](https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll#Browser_Compatibility).
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28978543
type: Comment

http://stackoverflow.com/q/29025493
tagged with: facebook
has title: After logged in with Gmail Webpage Opened in new tab
tagged with: php
tagged with: gmail
tagged with: popup
has body: I had implemented authentication to my webpage using gmail, fb and twitter. When I logged in with gmail in a popup, it's redirecting to the same popup and my webpage got opened in the popup only. I had used header("Location:/index.php/"); after insert query but still it is opening in new tab after logged in with Gmail or Facebook. Also tried with window.return and $_SERVER['HTTP_REFERAL'] in header. Do I need to change anything in pop up? &lt;SCRIPT TYPE="text/javascript"&gt; function popup(mylink, windowname){ if (! window.focus) { return true; } var href; if (typeof(mylink) == 'string'){ href=mylink; } else { href=mylink.href; } window.open(href, windowname, 'width=400,height=200,scrollbars=yes'); return false; } &lt;/SCRIPT&gt;
type: Question
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29025734
has answer: http://stackoverflow.com/a/29025610
type: UnansweredQuestion

http://stackoverflow.com/q/28982474
upvote count: 2
tagged with: conditional-comments
answer count: 1
tagged with: internet-explorer
tagged with: versioning
has title: IE version check stopped working
has answer: http://stackoverflow.com/a/28982700
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/28982700
has body: I have just released a new version of a web app into test (maven based java app). It checks for old versions of IE and displays a box warning that it is out of date if less than version 9. This is working fine on live and UAT and as far as I can see I haven't changed the relevant files at all - home.jsp, with included header.jspf containing the 'code' (the css file is being found as the warning is contained in the usual format). Essentially the following should run and does run in live and UAT but on my new release the warning is displaying even when I access the page using IE11. <!--[if lt IE 9]> We have detected that you are using an out of date browser. <![endif]--> If I point the same browser to UAT (the previous version) the warning disappears. I'm sure this is the same header.jspf file as I merged it back in from the main git branch as there had been a tiny formatting change while development had been on-going. Presumably as this is processed by the browser this can't be anything to do with the server set up (it is running on a new 'devtest' server). As I don't think anything has changed or is different to previous versions I'm at a bit of a loss. Can anyone point me in the right direction?

http://stackoverflow.com/comment/46231887
comment on: http://stackoverflow.com/q/28991875
has text: UL/LI are list tags, so for lists of information, such as navigation.
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/q/28918091
has answer: http://stackoverflow.com/a/28918725
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: ajax
has title: Delegated Event Handler Selector
type: Question
has body: I'm trying to use a delegated event handler on dynamically-loaded content, like so: AjaxProt.prototype = { // bind handler - ensure to use $(document) to delay call to .on() method init: function () { var thisObj = this; $(document).on(thisObj.event, thisObj.targetEl, function (e) { e.preventDefault(); var url = $(thisObj.targetEl).attr('href'); thisObj.ajaxRequest(url); }); }, ajaxRequest: function (url) { var thisObj = this, method = this.method, ajaxCallType = this.ajaxCallType, callback; // $.ajax here targetEl is assigned to [id^=startOfClassName]. I tried to pass the href value from init() to ajaxRequest(), but it's still only selecting the first element matching the selector on the page. How might I be able to ensure that the href value is bound to the element that's actually clicked? Thanks!

slider
tags question: http://stackoverflow.com/q/28928073
tags question: http://stackoverflow.com/q/28946593
tags question: http://stackoverflow.com/q/29011937
tags question: http://stackoverflow.com/q/29057526
tags question: http://stackoverflow.com/q/28943618
tags question: http://stackoverflow.com/q/28947506
tag name: slider
tags question: http://stackoverflow.com/q/29027349
tags question: http://stackoverflow.com/q/28994690
tags question: http://stackoverflow.com/q/28945105
tags question: http://stackoverflow.com/q/28944857
type: Tag
tags question: http://stackoverflow.com/q/28966297

http://stackoverflow.com/comment/46290620
score: 0
type: Comment
has text: Bind a onClick event on the link that is adding rows.. And call the autoNumeric in callback of that event
type: AnswerComment
comment on: http://stackoverflow.com/a/29023259

http://stackoverflow.com/q/28968429
type: Question
type: AnsweredQuestion
tagged with: if-statement
tagged with: onclick
tagged with: onselect
has comment: http://stackoverflow.com/comment/46188652
has comment: http://stackoverflow.com/comment/46188496
score: 0
has answer: http://stackoverflow.com/a/28968650
accepted answer: http://stackoverflow.com/a/28968650
answer count: 1
tagged with: javascript
tagged with: asp.net
has title: If statements in onclick and onselect not working in ASP.NET
has body: This should be pretty straight forward, but I've been researching for over a day now and can't figure out why this isn't working. I'm making a web page in ASP.NET. What I'm trying to do is have a textbox with gray placeholder text that disappears and changes the font color to black when the textbox is clicked or selected. Here's my code: &lt;asp:TextBox ID="addEditTextBox1" runat="server" onselect="if(style.color=='#999999'){style.color='Black'; this.value='';}" onclick="if(style.color=='#999999'){style.color='Black';this.value='';}" ForeColor="#999999" Width="250px"&gt;Revision #&lt;/asp:TextBox&gt; I've tried changing the "if" statement triggers to if(style.color.value=='#999999'){...} and if(ForeColor=='#999999'){...} and if(ForeColor.value=='#999999'){...} and many other syntaxes but I can't find one that works. I do know the onclick and onselect statements are working because if I replace the "==" with a "=" they trip 100% of the time, but that completely negates the whole idea of an "if" statement. I'm new to ASP.NET and JavaScript, so maybe there's something obvious I'm missing, but I can't find it anywhere. Here's some other information that I didn't think was relevant but may be helpful: Running in Visual Studio Professional 2012 This is towards the top of the page's source code: &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; Target Framework: .NET Framework 4.5. Feel free to inquire if I left anything out. Thanks!

http://stackoverflow.com/a/28971564
score: 1
has body: Have you tried var map = L.map('map', { crs: crs, center: L.latLng(58.66, 25.05), zoom: 2 }); ?
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28970095
downvote count: 0

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/29023544
tags question: http://stackoverflow.com/q/29038495
tags question: http://stackoverflow.com/q/28921653
tags question: http://stackoverflow.com/q/29037655
tags question: http://stackoverflow.com/q/29061193
tags question: http://stackoverflow.com/q/29057730
tags question: http://stackoverflow.com/q/29034208
tags question: http://stackoverflow.com/q/29013156
tags question: http://stackoverflow.com/q/28972436
tags question: http://stackoverflow.com/q/29026660
tags question: http://stackoverflow.com/q/28970305
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/28999697

http://stackoverflow.com/comment/46334087
type: Comment
type: QuestionComment
has text: If those tasks are async (do they work with callbacks?) then you have to rethink the workflow
score: 0
comment on: http://stackoverflow.com/q/28981994

http://stackoverflow.com/comment/46135846
has text: That is to notify the end user who is child and who is parent. But when you select parent task `var childtaskHours = $('#dropDownId option:selected').next().data('task-hours');` gives me next option value which is a child task obviously. This is working for a single child task but not for multiple.
score: 0
comment on: http://stackoverflow.com/q/28940310
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29036776
upvote count: 1
downvote count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46314378
has answer: http://stackoverflow.com/a/29036896
has comment: http://stackoverflow.com/comment/46314362
has comment: http://stackoverflow.com/comment/46314382
has title: Get browser to show error when javascript fails
has comment: http://stackoverflow.com/comment/46314305
has comment: http://stackoverflow.com/comment/46314570
type: Question
tagged with: debugging
answer count: 2
has body: I'm new to JavaScript development. There's one problem I find annoying in particular, and I'm hoping there's a solution to it I haven't found yet. The problem concerns feedback/debugability when JavaScript execution fails. Whenever 'normal' languages would throw an exeption, the JavaScript execution just stops without any message. For example, I have this code: var Something = function() { var self = this; self.oneMethod = function () { /*whatever*/ }; self.otherMethod = function() { /*whatever*/ }; } var instance = new Something(); instance.oneMethod(); // fine instance.wrongMethodCall(); // does not exist! I would expect that last line to give an error, somehow, somewhere. But no, my browser console remains empty. Can I change something (either in the code or in my browser, Chrome) so that this will give an error, preferably with the line it occurred on (such as a throw statement would)?
has answer: http://stackoverflow.com/a/29036952
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46314503
score: 0

http://stackoverflow.com/a/28984693
answers question: http://stackoverflow.com/q/28984610
has comment: http://stackoverflow.com/comment/46218764
has comment: http://stackoverflow.com/comment/46218425
type: Answer
downvote count: 0
score: 1
has body: I would check on every link click if the parent has the disabled class. $('.nav li a').click(function () { if($(this).parent('li').hasClass('disabled')) { return false; } return true; }); EDIT, following more info from OP I would suggest the following: $('.nav li a').each(function() { var $this = $(this); // store reference of 'href' attr in case link is re-enabled $this.data('href', $this.attr('href')); if ($this.parent('li').hasClass('disabled')) { // remove href attribute disabling click $this.removeAttr('href'); } else { // restore href $this.attr('href', this.data('href')); } }); This code should be run after you add/remove the disabled class on li elements. EDIT 2 - Rather than you calling functions from the href of &lt;a&gt; links, you could do something like the following: var events = { '#LiNewsFeed': 'GetNewsFeed', '#LiStatusUpdate': 'StatusUpdate' '#LiWriteWall': 'WriteOnWall', '#LiNotifications': 'GetNotifications', '#LiLogOut': 'LogOut' }; for (var selector in events) { if (events.hasOwnProperty(selector)) { try { $(selector).click(function () { // assuming function is global if (typeof window[events[selector]] === 'function') { // call function window[events[selector]](); } // this is needed if the a element still has a href attr return false; }); } catch (e) { console.log('Invalid Selector'); } } } This way you can control the calling of the function, and check whether it should be called without altering the element, perhaps stick an if (!$(this).parent('li').hasClass('disabled')) { ... } around the function call.
upvote count: 1

http://stackoverflow.com/q/29023429
tagged with: fitbounds
tagged with: javascript
score: -1
tagged with: google-maps-api-3
has body: I've been teaching myself Javascript through online examples and trial and error for a little while now but I've come upon an issue that I just do not freaking understand and it is driving me pretty much crazy. Please excuse any and all flub ups in language/terminology & lack of basic coding knowledge. I have a functioning call to the Google Maps API that is working on my personal site but I hate the way that fitBounds() adds 45px of padding to the boundaries of the map box. I read on that same thread a potential solution on re-doing the math for the fitBounds() with something custom, called myFitBounds, which was also detailed on what I presume is the user's site. So I tried to plug in his code into my javascript call, but I am getting absolutely nowhere with it. When I run the script in a debugger, I get an error: undefined is not a function (evaluating 'map.myFitBounds(map, bounds)') Now, I'm totally certain that I'm not calling this correctly, somehow. But since I have no training whatsoever on javascript, and I can not find a single example of how to call this particular custom function in the GMaps API environment, I am super confused on what I need to do. Here is the code between my script tags. The myFitBounds() call is located in the same place in the code as the fitBounds() call in the functioning example. I'm really sorry if this looks like total crap to all of you, but I do appreciate the help and time as I learn more about this.
answer count: 1
downvote count: 1
favorite count: 0
type: UnansweredQuestion
has title: Completely new to javascript and using Google Maps API v3 w/ custom fitbounds (myFitBounds)
has answer: http://stackoverflow.com/a/29023763
upvote count: 0
linked to: http://stackoverflow.com/q/9843732
type: Question
tagged with: google-maps

http://stackoverflow.com/comment/46174312
type: QuestionComment
comment on: http://stackoverflow.com/q/28960827
type: Comment
has text: I am after the ISP Host information as I can already extract the Client IP. thanks
score: 0

http://stackoverflow.com/q/29019124
type: Question
has body: Based on instruction from this question, I have added the following code to my application within the config stage: $provide.decorator('formDirective', function($delegate) { var directive = $delegate[0]; directive.controller.prototype.inputs = {}; console.log(directive.controller); return $delegate; }); All I want to do is create another field and a few methods to the existing angular form object. All of that appears to be defined within the formDirective controller but when I prototype new fields and methods into that controller they are not available after my application is completed bootstrapping. Is there something I'm missing, is this even possible without modifying the source? Thanks in advance! EDIT Code Pen of Design Patterns Here http://codepen.io/anon/pen/EadRBo
has title: Prototyping an Angular Directive
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29019821
has comment: http://stackoverflow.com/comment/46282522
has comment: http://stackoverflow.com/comment/46282270
has comment: http://stackoverflow.com/comment/46283100
score: 2
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/46282595
linked to: http://stackoverflow.com/q/17005122
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29019821
tagged with: prototype

java
tags question: http://stackoverflow.com/q/29032058
tags question: http://stackoverflow.com/q/28972262
tags question: http://stackoverflow.com/q/29000233
tags question: http://stackoverflow.com/q/28992302
tags question: http://stackoverflow.com/q/29030479
tags question: http://stackoverflow.com/q/29025772
tags question: http://stackoverflow.com/q/28959169
tags question: http://stackoverflow.com/q/29051472
tags question: http://stackoverflow.com/q/29060651
tags question: http://stackoverflow.com/q/28941172
tags question: http://stackoverflow.com/q/28935299
tags question: http://stackoverflow.com/q/28990993
tags question: http://stackoverflow.com/q/29030169
tags question: http://stackoverflow.com/q/29060014
tags question: http://stackoverflow.com/q/29021923
tags question: http://stackoverflow.com/q/28907189
tags question: http://stackoverflow.com/q/29024456
tags question: http://stackoverflow.com/q/29035054
tags question: http://stackoverflow.com/q/29044437
tags question: http://stackoverflow.com/q/29035781
tags question: http://stackoverflow.com/q/29031898
tags question: http://stackoverflow.com/q/29009343
tags question: http://stackoverflow.com/q/29061488
tags question: http://stackoverflow.com/q/28977742
tags question: http://stackoverflow.com/q/28998464
tags question: http://stackoverflow.com/q/28972125
tags question: http://stackoverflow.com/q/29007294
tags question: http://stackoverflow.com/q/29048932
tags question: http://stackoverflow.com/q/28993724
tags question: http://stackoverflow.com/q/28920076
tags question: http://stackoverflow.com/q/28941763
tags question: http://stackoverflow.com/q/28975585
tags question: http://stackoverflow.com/q/29052240
tags question: http://stackoverflow.com/q/29007896
tags question: http://stackoverflow.com/q/28925527
tags question: http://stackoverflow.com/q/28957639
tags question: http://stackoverflow.com/q/29031002
tags question: http://stackoverflow.com/q/29055155
tag name: java
tags question: http://stackoverflow.com/q/28979026
tags question: http://stackoverflow.com/q/29000317
tags question: http://stackoverflow.com/q/28975761
tags question: http://stackoverflow.com/q/28950945
tags question: http://stackoverflow.com/q/28983440
tags question: http://stackoverflow.com/q/28972342
tags question: http://stackoverflow.com/q/28953203
tags question: http://stackoverflow.com/q/28918445
tags question: http://stackoverflow.com/q/28934850
tags question: http://stackoverflow.com/q/29035552
tags question: http://stackoverflow.com/q/29061874
tags question: http://stackoverflow.com/q/28929029
tags question: http://stackoverflow.com/q/29025677
type: Tag
tags question: http://stackoverflow.com/q/29032704
tags question: http://stackoverflow.com/q/29044688
tags question: http://stackoverflow.com/q/28974548

http://stackoverflow.com/comment/46319017
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29039094
has text: your `switch` statement has a syntax error -- after `case 1:`, your `break` statement should be followed by `;` and not `:`

http://stackoverflow.com/comment/46165491
has text: Is your question about `null` or `instanceof`?
score: 0
comment on: http://stackoverflow.com/q/28956060
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29008351
has comment: http://stackoverflow.com/comment/46263335
answer count: 0
has comment: http://stackoverflow.com/comment/46262439
has comment: http://stackoverflow.com/comment/46262204
has comment: http://stackoverflow.com/comment/46274704
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46262146
has comment: http://stackoverflow.com/comment/46262581
has comment: http://stackoverflow.com/comment/46262070
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Onchange of selection how to fix the size of another text field
has comment: http://stackoverflow.com/comment/46262303
has comment: http://stackoverflow.com/comment/46262707
tagged with: php
has body: These are required Passport Driving license aadhar card (as selection options) When I select passport, the another text field should correspondingly change to corresponding pattern of passport and so on. What would be the better options to do this ? I saw onchange event but I'm not that familiar with JavaScript so I need some suggestions.

famo.us
tags question: http://stackoverflow.com/q/28908001
tag name: famo.us
type: Tag

http://stackoverflow.com/comment/46169235
has text: if you want it external, just put your script into a file and then give it an extension .js and then link or include it on your page.
type: AnswerComment
comment on: http://stackoverflow.com/a/28956133
score: 0
type: Comment

http://stackoverflow.com/q/28976845
favorite count: 0
has answer: http://stackoverflow.com/a/28976954
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46204789
tagged with: css
score: 1
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have two images: I want to print sample1 in front of the paper and sample2 in the back of the paper, how will I do that using javascript/window.print()? My printer is capable of printing double sided printing.
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Print Image in a Double Sided Paper using window.print()
has comment: http://stackoverflow.com/comment/46204808
has comment: http://stackoverflow.com/comment/46204802

http://stackoverflow.com/comment/46264649
comment on: http://stackoverflow.com/a/29009477
type: Comment
score: 0
type: AnswerComment
has text: jordi, you are right when you are rotating each image, but i meant really let the image disappear, and reappear on a different position...(no rotating it 7 degrees or something)

http://stackoverflow.com/comment/46212315
score: 0
comment on: http://stackoverflow.com/a/28981203
has text: The snippet code works well! But the values I enter on input is dynamic so I pass an id with it to function.
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/66225910
has text: And I think it is not correct that the function necessarily returns a promise (which would be a logical answer to this problem of course). The implementation looks like it's working synchronously, too.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28966023

http://stackoverflow.com/q/29006507
has comment: http://stackoverflow.com/comment/46258833
has title: html code(with onclick()) written in javascript not working
accepted answer: http://stackoverflow.com/a/29006610
has body: Following code created table dynamically in separate java script file and each row has created button dynamically with onclick() function and also created link dynamically with calling some function when click on link but both not working means "onclick" not working. I want to call another function when I click on button "Clear Login" which is wriiten in that JS file if(reclist[8] == 'F') { //alert(1); string[j] += " "; } else { alert(reclist[8]+" "+reclist[2]); string[j] += " "; string[j] += ' '; string[j] += " GPS Location ";
possible better answer: http://stackoverflow.com/a/29006853
type: Question
score: 0
answer count: 2
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29006610
has answer: http://stackoverflow.com/a/29006853
type: AnsweredQuestion

http://stackoverflow.com/comment/46350130
has text: Are you using .change() for the results to be displayed somewhere as the user selects info? If not, why not just iterate through all the values once on submit?
comment on: http://stackoverflow.com/q/29056444
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/88221023
has text: Your ScriptEngine should be obtained by the name of "nashorn" and not "Nashorn"
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29051472

http://stackoverflow.com/q/28982207
type: Question
has comment: http://stackoverflow.com/comment/46214253
answer count: 2
has comment: http://stackoverflow.com/comment/46214075
tagged with: javascript
tagged with: jsf-2.2
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28982574
score: 0
has answer: http://stackoverflow.com/a/28982574
has comment: http://stackoverflow.com/comment/46213907
has body: I want to achieve following thing with Jquery There are multiple trips and each trip has checkbox and textbox. Whenever checkbox is checked then the value in textbox corresponding to that checkbox must be updated to "1" . Whenever customer types in textbox then checkbox shall be checked Trip 1 sadssad Trip 2 sadsassad JQUERY as $(function () { $("input[type=checkbox]").on('click', function () { $(this).next().val($(this).is(':checked') ? '1' : '0'); }); $("input[type=text]").on('keyup', function () { if ($(this).val()) { $(this).prev().prop('checked', true); } else { $(this).prev().prop('checked', false); } }); }); But this is not working and when i use JSF Tag <h:selectBooleanBox> then also it is not working.
has answer: http://stackoverflow.com/a/28982645
accepted answer: http://stackoverflow.com/a/28982645
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46214027
has comment: http://stackoverflow.com/comment/46214334
has title: update text box based on checkbox selection jquery

http://stackoverflow.com/q/29018392
has comment: http://stackoverflow.com/comment/49930964
favorite count: 0
has answer: http://stackoverflow.com/a/30949253
accepted answer: http://stackoverflow.com/a/30949253
tagged with: cordova
downvote count: 0
has comment: http://stackoverflow.com/comment/46280811
type: Question
type: AnsweredQuestion
has title: How do I grab CCTV DVR's broadcast for custom application
score: 1
possible better answer: http://stackoverflow.com/a/29202156
has answer: http://stackoverflow.com/a/29202156
has comment: http://stackoverflow.com/comment/139106958
answer count: 2
upvote count: 1
tagged with: javascript
has body: I have 16 analog cameras feeding in to my Defender DVR. I'm able to access the camera feeds locally by going to a specific port and entering login details using an ActiveX control in IE. I can also view them through apps from the Apple apps tore on my iPad by simply entering my external IP address, port number, and login credentials. My question is, if I wanted to create an app similar to those in the app store. How would I go about communicating with the DVR's stream of videos/images? I'd image I need to poll the IP address to get the data but I'm not sure what type of connection is needed and what to expect there. It seems that many DVRs defer to the same apps in the marketplace so my guess is that they all conform to some standard when outputting the data. Thank you.

http://stackoverflow.com/comment/46263841
score: 1
has text: You haven't closed the selector, missing `'`.
comment on: http://stackoverflow.com/q/29009310
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29040868
tagged with: javascript
has body: I created a little fetch function that basically just does an ajax POST for me along with a number of other things that I've removed for the sake of brevity. In this function I pass a callback which should fire when the success callback is hit. function ajax_fetch(url, fetch, data, callback) { $.ajax({ type: "Post", url: baseurl + url, data: data, contentType: "application/json", dataType: "html", success: function (response) { fetch.html(response); // if there's a callback, run it. if (typeof callback == "function") callback(); }, error: function (xhr, ajaxOptions, thrownError) { handleErrors(xhr, ajaxOptions, thrownError); } }); } Below I have a piece of code where I am essentially doing 2 ajax calls. The first one fires a normal ajax POST and then upon success, calls my ajax_fetch() function above, all works as intended. $("#markstatus").singleBind("click", function () { var step = "{ step : " + $(this).data("step") + "}"; $.ajax({ type: "POST", url: baseurl + "SetStatus", data: step, contentType: "application/json", dataType: "html", success: function (result) { $("#header.container").html(result); ajax_fetch("/StepIndex", $(".replaceable"), step, function() { window.alerts.success("Step Complete"); }); }, error: function (xhr, ajaxOptions, thrownError) { handleErrors(xhr, ajaxOptions, thrownError); } }); }); However here is the problem: $("#removestatus").singleBind("click", function () { var step = "{ step : " + $(this).data("step") + "}"; ajax_fetch("RemoveStatus", $("#header.container"), step, ajax_fetch("/StepIndex", $(".replaceable"), step, function () { window.alerts.warning("Step Re-Opened"); }) ); }); I thought I could be tricky and do essentially the same double ajax call by using my ajax_fetch() function initially, and then upon hitting the first callback pass in another ajax_fetch() all should be fine and dandy. But when I look at my console output: customSpa.js:793 Object {url: "/StepIndex", fetch: jQuery.fn.init[1], data: "{ step : 1}", callbackl: …
upvote count: 1
has answer: http://stackoverflow.com/a/29040951
downvote count: 0
has answer: http://stackoverflow.com/a/29052234
tagged with: jquery
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/46352535
has answer: http://stackoverflow.com/a/29040908
accepted answer: http://stackoverflow.com/a/29040908
has comment: http://stackoverflow.com/comment/46336880
answer count: 4
score: 1
possible better answer: http://stackoverflow.com/a/29040951
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29041038
has title: Javascript function fire order when used as callbacks

http://stackoverflow.com/q/28938825
accepted answer: http://stackoverflow.com/a/28938854
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46132730
tagged with: jquery
has answer: http://stackoverflow.com/a/28938854
has title: Select option depending on GET parameter
has comment: http://stackoverflow.com/comment/46132963
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28939063
has comment: http://stackoverflow.com/comment/46132857
has body: I have this select: march 2015 january 2015 And the following jQuery: var archive = getParameterByName('m'); jQuery('select option[value="' + archive + '"').attr('selected', true); function getParameterByName(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } The function get's me the value of the param m from the URL which I put in the var archive. Only thing it doesn't do is setting the attribute selected from the corresponding option. ie. if the url contains ?m=201501 I want january 2015 to become january 2015 so it's selected in the select What am I missing?
has comment: http://stackoverflow.com/comment/46133268
type: Question
possible better answer: http://stackoverflow.com/a/28939063
has comment: http://stackoverflow.com/comment/46133250
has comment: http://stackoverflow.com/comment/46133104
has comment: http://stackoverflow.com/comment/46133271
tagged with: javascript

http://stackoverflow.com/comment/46267127
has text: this is for use in an internal application, so the whole world won't see it
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29010946

http://stackoverflow.com/q/29051011
tagged with: javascript
favorite count: 0
answer count: 5
has answer: http://stackoverflow.com/a/34143541
has body: Is there a way to retain the name of a destructured function argument? I.e., the name of the root object? In ES5, I might do this (using inheritance as a metaphor to make the point): // ES5: var setupParentClass5 = function(options) { textEditor.setup(options.rows, options.columns); }; var setupChildClass5 = function(options) { rangeSlider.setup(options.minVal, options.maxVal); setupParentClass5(options); // &lt;= we pass the options object UP }; I'm using the same options object to hold multiple configuration parameters. Some parameters are used by the parent class, and some are used by the subclass. Is there a way to do this with destructured function arguments in ES6? // ES6: var setupParentClass6 = ({rows, columns}) =&gt; { textEditor.setup(rows, columns); }; var setupChildClass6 = ({minVal, maxVal}) =&gt; { rangeSlider.setup(minVal, maxVal); setupParentClass6( /* ??? */ ); // how to pass the root options object? }; Or do I need to extract all of the options in setupChildClass6() so that they can be individually passed into setupParentClass6()? // ugh. var setupChildClass6b = ({minVal, maxVal, rows, columns}) =&gt; { rangeSlider.setup(minVal, maxVal); setupParentClass6({rows, columns}); };
tagged with: arguments
has answer: http://stackoverflow.com/a/29051395
upvote count: 29
has answer: http://stackoverflow.com/a/62597866
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/54177943
has answer: http://stackoverflow.com/a/71778352
tagged with: destructuring
score: 29
linked to: http://stackoverflow.com/q/54591307
type: Question
accepted answer: http://stackoverflow.com/a/34143541
possible better answer: http://stackoverflow.com/a/33185715
has answer: http://stackoverflow.com/a/33185715
tagged with: ecmascript-6
has title: ES6 destructuring function parameter - naming root object
tagged with: function
has comment: http://stackoverflow.com/comment/100652897
downvote count: 0

http://stackoverflow.com/a/28970302
has comment: http://stackoverflow.com/comment/46192251
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/46192297
answers question: http://stackoverflow.com/q/28969175
has body: Try var handles = {}; // resize handles $.each(["se", "ne", "nw", "sw"], function(i, handle) { var elem = $("div[class^=area]").eq(i) elem.addClass("ui-resizable-handle ui-resizable-" + handle).show(0); handles[handle] = elem[0]; }); $(".shape").resizable({ handles:handles, containment:"parent" }); jsfiddle http://jsfiddle.net/xzkby36n/23/ See Resizable Widget
downvote count: 0
type: Answer

http://stackoverflow.com/a/29665587
accepted answer of: http://stackoverflow.com/q/28912744
type: Answer
answers question: http://stackoverflow.com/q/28912744
has body: I solved it by using the official methods. So first of all they did not work because timeglider still has issues with using the latest jQuery release somehow. So I'm now using the latest 1.* jQuery release and that works great with timeglider anyway. So as I said this allows me to use the official methods now. First of all I initialized timeglider with: function initializeTimeline(jsonfile) { tg1 = $("#timelinearea").timeline({ "min_zoom":20, "max_zoom":60, "image_lane_height":10, "icon_folder":"timeglider/icons/", "data_source":"json/" + jsonfile, "constrain_to_data": true, "show_footer": false, "display_zoom_level": true }); tg_instance = tg1.data("timeline"); }; and now I was able to use tg_instance and changed the file for instance with: tg_instance.loadTimeline("json/someOtherData.json", function(){debug.log("cb!");}, true); For sure the callback is not needed. So just load the initialize method one time and never again and all is fine.
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/29000626
has body: concat() is for joining two arrays. You just want to join two strings. Try var time = hours.toString() + mins.toString();
score: 2
answers question: http://stackoverflow.com/q/29000572
downvote count: 0
type: Answer
upvote count: 2

http://stackoverflow.com/comment/46291153
score: 0
comment on: http://stackoverflow.com/q/29024097
type: Comment
type: QuestionComment
has text: Way too broad for Stack Overflow. Try to produce a simple working example of a remote form and work from there, rather than leaping straight to a complex usecase.

http://stackoverflow.com/q/29034187
has comment: http://stackoverflow.com/comment/46309513
has comment: http://stackoverflow.com/comment/46309352
accepted answer: http://stackoverflow.com/a/29034351
possible better answer: http://stackoverflow.com/a/29034560
tagged with: javascript
answer count: 2
has title: How to animate a position of a fixed element with jQuery
has body: I have a div whose position properties is: .some { position: fixed; top: 0px; } I then want to animate its bottom (not with top, with bottom property) $(document).ready(function(){ $("a").on("click", function(e){ e.preventDefault(); $("div").animate({ top: "none", bottom : 25}); }); }); But it does not work. The problem is that top property is in the priority. If I set the top to 0 then it sticks to the top, it does not care any to bottom value. However I remove the top property and animate bottom, it starts the animation right from the very bottom. I want the animation to start from the position which is designated by top value and end in where it is specified by bottom value. What should I do? Here is the JSFiddle: http://jsfiddle.net/mostafatalebi2/ex1b69g9/
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/8518400
tagged with: animation
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29034351
tagged with: css
type: AnsweredQuestion
score: 2
upvote count: 3
has answer: http://stackoverflow.com/a/29034560
downvote count: 1
type: Question

http://stackoverflow.com/comment/46242546
type: Comment
type: QuestionComment
has text: The only reason for the second input is to test changing the focus. The issue is that if the reset button is pressed and then one of the text fields is cleared (highlight the text and press delete or backspace) and the click on the second text field, no change event is fired (even though the user cleared the field).
score: 0
comment on: http://stackoverflow.com/q/28991353

http://stackoverflow.com/comment/46352634
has text: No, it didn't work. it is giving me TypeError: undefined is not an object (evaluating 'second_class.style'). thanks for trying though. Do you know what the issue is? also do checkout the jsfiddle in the question
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29057923
type: AnswerComment

http://stackoverflow.com/q/28991909
has comment: http://stackoverflow.com/comment/46232054
has answer: http://stackoverflow.com/a/28992019
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/46231906
has body: I have a list and I'm trying to change the text of the elements when the mouse is over them. For instance, if i have this list Some text More text and more text and the mouse is over the first element, I want the text to change to, for instance, "1st element". I'm trying to achieve the above using this code: $(document).ready(function(){ //when mouse is over, save initial value and replace with newText function hover_in(newText){ console.log(newText); var $this = $(this); $this.data('initialText', $this.text()); $this.text(newText); } //when mouse is over, replace with initial value function hover_out(){ var $this = $(this); $this.text($this.data('initialText')); } $('#first-li').hover(function(){hover_in("NEW TEXT")}, hover_out); }); I can see the value insert in the arguments of hover_in' "NEW TEXT" printed in the console but the text doesn't change. Any ideas what I'm doing wrong ? Thanks in advance !
has title: jQuery - Hover function on li element
tagged with: javascript
tagged with: jquery
answer count: 3
has answer: http://stackoverflow.com/a/28992108
favorite count: 0
score: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/28992019
tagged with: text
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46231977
has comment: http://stackoverflow.com/comment/46232138
has answer: http://stackoverflow.com/a/28992165
possible better answer: http://stackoverflow.com/a/28992108

http://stackoverflow.com/a/29034866
has body: The .text() grabs the text not the html. Use .html() $('.post-5 div p'); gives three results not just one. If you want to use the same effect you will have to modify completely the script.
type: Answer
has comment: http://stackoverflow.com/comment/46312167
answers question: http://stackoverflow.com/q/29034662
score: 0

http://stackoverflow.com/comment/46204789
has text: First you'd need a printer capable of printing on both sides.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28976845
score: 0

http
tags question: http://stackoverflow.com/q/29000484
tags question: http://stackoverflow.com/q/28915695
tags question: http://stackoverflow.com/q/28965210
tags question: http://stackoverflow.com/q/28993724
tags question: http://stackoverflow.com/q/29058371
tag name: http
tags question: http://stackoverflow.com/q/29055032
tags question: http://stackoverflow.com/q/29026071
tags question: http://stackoverflow.com/q/29058987
type: Tag
tags question: http://stackoverflow.com/q/29032704
tags question: http://stackoverflow.com/q/29034011
tags question: http://stackoverflow.com/q/28966906
tags question: http://stackoverflow.com/q/28928747
tags question: http://stackoverflow.com/q/29049587
tags question: http://stackoverflow.com/q/28990565

http://stackoverflow.com/q/28976594
answer count: 1
has body: I'm trying to create a vanilla javascript that creates one div or more when clicking on a specific link. When said div has appeared I want to be able to remove it by clicking on that div. So far I've successfully made it so that a div is created when clicking a link. The HTML: Click me! And the JavaScript: (function() { 'use strict'; var createTarget = document.getElementById('target'); var link = document.getElementById('create-div'); function createDiv() { var content = ' '; createTarget.innerHTML = content; } link.addEventListener("click", function() { createDiv(); }); })(); What I can't figure out is how to remove the div by clicking on it after it has been created? Bear in mind that I am new and trying to learn vanilla JavaScript for now. I know about jQuery and all the other libraries, but I'd rather just learn the basic JavaScript to begin with. Through the power of Google I've found out about "removeChild" but I am yet to find out how to get it to work on a div by clicking it. All help is appreciated!
favorite count: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/46204342
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46205788
has title: JavaScript, create div with link and then remove by clicking said div
has answer: http://stackoverflow.com/a/28976680
downvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46204327
score: 0
accepted answer: http://stackoverflow.com/a/28976680
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29009434
has comment: http://stackoverflow.com/comment/46264648
score: 0
answers question: http://stackoverflow.com/q/29009022
has body: you have some mistakes in your code within the last for loop (var count is not properly used) see here a demo http://jsfiddle.net/h829p07n/7/ for(var i = 0 ; i &lt; tempArra.length-1 ; i++){ count = tempArra[i].length; for(var k = 0; k &lt; count ; k++){ for(var L = 0; L &lt; count; L++){ if(tempArra[i][k].EventName != tempArra[i+1][L].EventName){ NewArray.push(tempArra[i+1][L]); }else{ if(tempArra[i][k] != undefined){ CommonArray.push(tempArra[i][k]) ; } if(tempArra[i+1][L] != undefined){ CommonArray.push(tempArra[i+1][L]); } } } } }
type: Answer

http://stackoverflow.com/comment/46110745
score: 0
type: Comment
has text: queryselector selects the first element only. So the style will only apply to first element
type: AnswerComment
comment on: http://stackoverflow.com/a/28927366

http://stackoverflow.com/comment/46273518
type: AnswerComment
has text: @RoryMcCrossan Yeah, I completely overlooked that bracket. Noted. :)
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29014258

http://stackoverflow.com/a/29002474
upvote count: 5
accepted answer of: http://stackoverflow.com/q/28999829
score: 5
has comment: http://stackoverflow.com/comment/46275461
type: AcceptedAnswer
downvote count: 0
has body: I ran into basically the same problem at work. We didn't find a way to remove the metadata. Instead we solved it by using exif.js to read the metadata, and then drew the image onto a canvas while rotating it appropriately. Vaguely something like this: var exif = EXIF.findEXIFinJPEG(binary); switch(exif.Orientation){ case 1: //no change needed break; case 2: //horizontal flip context.translate(imageWidth, 0); context.scale(-1, 1); break; ... case 8: //rotate 90 deg left context.rotate(-0.5 * Math.PI); context.translate(-imageWidth, 0); break; } context.drawImage(image, 0, 0, imageWidth, imageHeight); Hopefully that points you in the right direction.
has comment: http://stackoverflow.com/comment/54255680
type: Answer
answers question: http://stackoverflow.com/q/28999829

http://stackoverflow.com/comment/46124865
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28917955
type: Comment
has text: Still can't seem to get it to work with the updated answer. I've got jQuery installed via npm and I'm requiring it like this: `require('jquery/dist/jquery')` in both **adaptive-backgrounds.js** and **app.js** files.

http://stackoverflow.com/comment/46333077
type: Comment
type: QuestionComment
score: 1
has text: I think this question would help you [create a json response]( http://stackoverflow.com/questions/2428092/creating-a-json-response-using-django-and-python)
comment on: http://stackoverflow.com/q/29047056

http://stackoverflow.com/q/29006246
answer count: 0
has body: I am working with some API that requires usage of PUT method. I am using pure Javascript with AJAX and PHP to get contents from API. I found out that PUT method behaves a little bit different than GET or POST. One thing for example, you can access query parameters in GET or POST easily with $_GET or $_POST, in PUT method you can't do that. So in my example I broke apart $_SERVER['QUERY_STRING'] in PUT method and put it into array and then read the parameters from it. Just because of that I am wondering if there is anything special to be concirned about the PUT method? I've read some articles, why it PUT method suppose to be used for, but there weren't any specific examples how to use it, especially in my cas with AJAX/PHP. I made my code working like this: if ($_SERVER['REQUEST_METHOD'] == 'PUT') { $method = $_SERVER['REQUEST_METHOD']; $qstring = $_SERVER['QUERY_STRING']; parse_str($qstring, $qstring); if ($qstring['func'] == 'updatecart') { $query['sessid'] = intval($qstring['sessid']); $query['artikelid'] = $qstring['artikelid']; $query['velikostid'] = $qstring['velikostid']; $query['kolicina'] = intval($qstring['kolicina']); $resarr = getdatafromapi($method, $apibaseurl.'/kosarica', $query); echo json_encode($resarr); $query = array(); exit; } } I just want to know if this is the correct way to use PUT method?
has comment: http://stackoverflow.com/comment/46258411
has comment: http://stackoverflow.com/comment/46258559
type: Question
linked to: http://stackoverflow.com/q/6805570
has comment: http://stackoverflow.com/comment/46258584
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/46260208
score: 0
has title: proper way of PUT method usage with AJAX and PHP
has comment: http://stackoverflow.com/comment/46258650
has comment: http://stackoverflow.com/comment/46258717
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/46258589
has comment: http://stackoverflow.com/comment/46262794

http://stackoverflow.com/a/29059608
score: 8
upvote count: 8
has comment: http://stackoverflow.com/comment/46360298
type: Answer
answers question: http://stackoverflow.com/q/29056704
downvote count: 0
has body: Your code works correctly under the assumption document.getElementById('canvas') returns an element. If you're running this in a background page defined as a script, it will be empty. You don't actually need to have an element in the DOM for it to work. Just create a new element just for this. Also, note that you're writing text using the same color as the background; so it's invisible. Putting it together (and nudging the coordinates a bit): draw(); function draw() { var canvas = document.createElement('canvas'); // Create the canvas canvas.width = 19; canvas.height = 19; var context = canvas.getContext('2d'); context.fillStyle = "#262626"; context.fillRect(0, 0, 19, 19); context.fillStyle = "#FFFFFF"; context.textAlign = "center"; context.textBaseline = "middle"; context.font = "11px Arial"; context.fillText("69F", 8, 8); chrome.browserAction.setIcon({ imageData: context.getImageData(0, 0, 19, 19) }); }

http://stackoverflow.com/q/28962425
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28962668
answer count: 1
has title: angular service to factory
tagged with: angularjs
type: UnansweredQuestion
tagged with: internationalization
has body: I need to remake this functoin 'i18n' to a factory but so i return a value instead of just setting it with this. Thanks in advance! services.service('i18n', function() { var self = this; this.setLanguage = function(language) { $.i18n.properties({ name: 'messages', path: 'i18n/', mode: 'map', language: language, callback: function() { self.language = language; } }); }; this.setLanguage('nl'); });

report
tags question: http://stackoverflow.com/q/28983440
type: Tag
tag name: report

summernote
tags question: http://stackoverflow.com/q/29041798
type: Tag
tag name: summernote
tags question: http://stackoverflow.com/q/29018525
tags question: http://stackoverflow.com/q/28940404

http://stackoverflow.com/q/28977946
has answer: http://stackoverflow.com/a/28990384
has body: My website has a simple form that is linked with MailChimp. The problem is that the form's submit button has conflicting interests, specifically, there's javascript email-field validation code that is requiring the button to have type="submit" written in the button code. But if I include type=submit, it prevents my form from submitting to MailChimp. Here is the button code in 2 forms. The first is the form which allows javascript error validation to work but submission to MailChimp to NOT work (notice the type) Submit Form The second form does not have type="submit" and so js validation won't work, but it will submit to MailChimp: Submit Form Here's the full form * Submit and here's the script for validating the e-mail field. Notice how it calls on "submit". How do I combine the 2 button code forms I posted at the beginning, so that the form IS validated with js and also submits to MC? Thanks so much!
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: Form won't submit due to button's conflicting interests
accepted answer: http://stackoverflow.com/a/28990384
tagged with: forms
type: Question
has comment: http://stackoverflow.com/comment/46228224
tagged with: mailchimp
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/46261301
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29004688
has text: Ok, you can use a element too, but add type="button" to it. Main difference between and is that allows content inside itself.
type: AnswerComment

http://stackoverflow.com/a/29055572
downvote count: 0
score: 1
has body: From the Angular Docs (just before the first example) After a watcher is registered with the scope, the listener fn is called asynchronously (via $evalAsync) to initialize the watcher. In rare cases, this is undesirable because the listener is called when the result of watchExpression didn't change. To detect this scenario within the listener fn, you can compare the newVal and oldVal. If these two values are identical (===) then the listener was called due to initialization. You could check if newValue !== oldValue to prevent it or create a variable that prevents the first check.
type: Answer
answers question: http://stackoverflow.com/q/29055517
upvote count: 1

asp.net-mvc
tags question: http://stackoverflow.com/q/29016458
tags question: http://stackoverflow.com/q/28945990
tags question: http://stackoverflow.com/q/29003648
tags question: http://stackoverflow.com/q/28930330
tags question: http://stackoverflow.com/q/28941823
tags question: http://stackoverflow.com/q/28992199
tags question: http://stackoverflow.com/q/28949553
tags question: http://stackoverflow.com/q/28940540
tags question: http://stackoverflow.com/q/28918159
tags question: http://stackoverflow.com/q/28914685
tags question: http://stackoverflow.com/q/28943164
tags question: http://stackoverflow.com/q/29028177
tags question: http://stackoverflow.com/q/29048400
tags question: http://stackoverflow.com/q/29053825
tags question: http://stackoverflow.com/q/28907713
tags question: http://stackoverflow.com/q/28942792
tags question: http://stackoverflow.com/q/29000074
tags question: http://stackoverflow.com/q/29026796
tags question: http://stackoverflow.com/q/29012260
tags question: http://stackoverflow.com/q/28991193
tags question: http://stackoverflow.com/q/28965600
tags question: http://stackoverflow.com/q/29009779
tags question: http://stackoverflow.com/q/29002444
tags question: http://stackoverflow.com/q/29012712
tags question: http://stackoverflow.com/q/28964370
tag name: asp.net-mvc
tags question: http://stackoverflow.com/q/28961224
tags question: http://stackoverflow.com/q/28952006
tags question: http://stackoverflow.com/q/28962229
tags question: http://stackoverflow.com/q/29059719
tags question: http://stackoverflow.com/q/28962618
tags question: http://stackoverflow.com/q/29003002
tags question: http://stackoverflow.com/q/28960614
tags question: http://stackoverflow.com/q/28919772
tags question: http://stackoverflow.com/q/28959362
tags question: http://stackoverflow.com/q/29046970
tags question: http://stackoverflow.com/q/28948612
tags question: http://stackoverflow.com/q/29026681
tags question: http://stackoverflow.com/q/28992601
type: Tag
tags question: http://stackoverflow.com/q/29011107
tags question: http://stackoverflow.com/q/28988623
tags question: http://stackoverflow.com/q/28966440
tags question: http://stackoverflow.com/q/29030402
tags question: http://stackoverflow.com/q/28980278
tags question: http://stackoverflow.com/q/28917058
tags question: http://stackoverflow.com/q/28998665
tags question: http://stackoverflow.com/q/29002523

http://stackoverflow.com/q/28996511
type: AnsweredQuestion
downvote count: 1
type: Question
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28996655
has comment: http://stackoverflow.com/comment/46241215
upvote count: 0
has title: Javascript function to return page id's
answer count: 1
tagged with: arrays
favorite count: 0
accepted answer: http://stackoverflow.com/a/28996655
has body: I'm lookingfor a javascript function which returns the next value from an array on every function call.. I have created a script but i'm a little stuck now.. is there someone to help me? My location: resultLocation= "beugen"; This should be the identifier to get the correct array of id's. There will be more arrays with id''s for example resultLocation = "mill"; My array of Id's var beugen = []; beugen[0] = "140"; beugen[1] = "33"; beugen[2] = "121"; beugen[3] = "150"; beugen[4] = "52"; beugen[5] = "68"; beugen[6] = "70"; beugen[7] = "82"; beugen[8] = "15"; My function to return a value. (the next value should be shown on each call of getId (resultLoction) getId = function(resultLocation) { var arrayLength = beugen.length; page = beugen; for (var i = 0; i &lt; arrayLength; i++) { init_table(page[i]); } } getId(resultLocation); Now my function keeps on looping and calls the init_table(page[i]) as many times as there are id's in my array. It should get the first (140) on the first call of getId and the 2nd (33) on the next call, and if it reaches the end, it should start over again at the the top. Maybe an array is not the best solution? I don't really know. Since there are multiple locations?

vim
tags question: http://stackoverflow.com/q/28906854
tags question: http://stackoverflow.com/q/28909876
tags question: http://stackoverflow.com/q/28973441
tag name: vim
type: Tag

http://stackoverflow.com/a/28935113
upvote count: 1
score: 1
has body: By using the selectedIndex property (and potentially the options one as well) of your select element. Option 1 is selected And the JavaScript: function stuff(yourSelectElement){ document.getElementById('yourHiddenField').value = yourSelectElement.options[yourSelectElement.selectedIndex].innerHTML; } And if you want to store just one number in your hidden field, use the value attribute on your option tags like so: Option 1 is selected Then the JS changes like this: document.getElementById('yourHiddenField').value = yourSelectElement.options[yourSelectElement.selectedIndex].value;
accepted answer of: http://stackoverflow.com/q/28935052
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28935052
downvote count: 0
has comment: http://stackoverflow.com/comment/46126732
has comment: http://stackoverflow.com/comment/46126127
has comment: http://stackoverflow.com/comment/46129302
type: Answer
has comment: http://stackoverflow.com/comment/46126053

http://stackoverflow.com/comment/46240026
type: QuestionComment
has text: Are the variables you need to check always a and c ?
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28995890

http://stackoverflow.com/q/28988988
has answer: http://stackoverflow.com/a/28989133
accepted answer: http://stackoverflow.com/a/28989133
has comment: http://stackoverflow.com/comment/46226714
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46226700
has comment: http://stackoverflow.com/comment/46226928
score: 0
has comment: http://stackoverflow.com/comment/46226669
has comment: http://stackoverflow.com/comment/46226711
has comment: http://stackoverflow.com/comment/46226587
answer count: 1
tagged with: variables
has comment: http://stackoverflow.com/comment/46227048
has title: Global replace using variable
has comment: http://stackoverflow.com/comment/46227275
tagged with: regex
has comment: http://stackoverflow.com/comment/46226858
type: AnsweredQuestion
has body: In JavaScript I can uses a regex to replace tex: var textSearch = "10"; var textReplace = "2"; var c = alayer.textItem.contents c = c.replace(new RegExp(textSearch, "g"),textReplace); alert(c); text strings of "10" gets replaced with "2". Huzzah! However, I was unable to do a global replace without a new RegExp constructor I got into a mess. c = c.replace(textSearch, textReplace); //2 10 10 I tried various iterations of /g and "g" to no avail. Do you have to uses regxEx in the form of new regExp() when using variables, or am I missing a trick? Reginald X. Pression where are you?? I need your help!
duplicate of: http://stackoverflow.com/q/2116558

http://stackoverflow.com/comment/46101948
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28921503
has text: @Noitidart seem as I was the one mistaken. I updated it to convert alpha channel, but the color order is then ARGB as you stated frst... (I also assumed it read ABGR but see now it's ARGB, canvas is RGBA). sorry, it's been a long day :) Now things are correct.
type: Comment

http://stackoverflow.com/q/28940033
has comment: http://stackoverflow.com/comment/46135230
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28940253
has body: I need to capture coordinates on a click. But when I click inside cont, I get incorrect values. What could be the reason for this? It seems, that x-coordinate captured is correct, but Y coordinate is incorrect. HTML : First Second 1 2 3 4 jquery : $('#cont').click(function(event) { var parentOffset = $(this).parent().offset(); if(count == 0) { x1 = event.pageX - parentOffset.left; y1 = event.pageY - parentOffset.top; $('#cont').line(x1,y1,x1+1,y1+1,{color:"white", style: "dashed"}); } });
answer count: 1
favorite count: 0
has title: Unable to capture coordinates inside a div element
accepted answer: http://stackoverflow.com/a/28940253
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: coordinates
type: Question

http://stackoverflow.com/comment/46244191
type: QuestionComment
has text: and then try the much simpler `function confirmation() { return confirm("want to add as "+document.getElementById("chkbx").checked?"A?":"B?"); }`
comment on: http://stackoverflow.com/q/28998007
score: 0
type: Comment

http://stackoverflow.com/comment/46251120
has text: as the name suggest document.getElementById expects ID of element not 'this' …!
score: 0
comment on: http://stackoverflow.com/q/29001785
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28987646
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28987776
has answer: http://stackoverflow.com/a/28987776
accepted answer: http://stackoverflow.com/a/28991084
has body: I've tried a few times to install my first AngularJS project via their docs: https://docs.angularjs.org/misc/contribute *# Clone your Github repository: git clone "git@github.com:&lt;github username&gt;/angular.js.git" # Go to the AngularJS directory: cd angular.js # Add the main AngularJS repository as an upstream remote to your repository: git remote add upstream "https://github.com/angular/angular.js.git" # Install node.js dependencies: npm install # Install bower components: bower install # Build AngularJS: grunt package* Each time I try to npm install it returns an error for jasmine-node I've searched for solutions and tried a bunch of methods &amp; hopeful tests but still not receiving back any luck. Much appreciated for any help, guys!
type: Question
answer count: 2
tagged with: javascript
score: 0
tagged with: jasmine
tagged with: angularjs
tagged with: npm
has title: angular jasmine-node not installing via node npm
tagged with: node.js
has answer: http://stackoverflow.com/a/28991084

http://stackoverflow.com/comment/46350692
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29056779
score: 0
has text: The problem is that the code isn't working in my Brackets project in the way that the code works on Codepen. There is no style applying to the box, and the functionality of the code is not working (can't add to the list).

http://stackoverflow.com/comment/46290348
has text: what errors do you see in your console ?
comment on: http://stackoverflow.com/q/28999350
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29049001
has body: In my page I have elements as shown below &lt;div id="target" class="textarea"&gt; HTML is written in the form of HTML elements consisting of tags enclosed in angle brackets (like &amp;lt;html&amp;gt; ),within the web page content. HTML tags most commonly come in pairs like and ,although some tags, known as empty elements, are unpaired, for example &amp;lt;img&amp;gt;. The purpose of a web browser is to read HTML documents and compose them into visible or audible web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page. &lt;div id="target2" class="textarea"&gt;&lt;div id="test3"&gt;&lt;div id="test4"&gt;Right Click Here&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; I need to check whether the element I am having ("target2") is the same element, whenever I click in the Div elements target2 or test2 or test3. Here test2 and test3 or contained inside target2.I am currently using $(e).is($.trim(my element) to check whether the element I am having is the same element I am clicking. But, e.target returns test4 whenever I click on the div element target2. But, I am actually clicking on target2. How can I do this? Thanks in advance.
has comment: http://stackoverflow.com/comment/46336592
answer count: 1
accepted answer: http://stackoverflow.com/a/29049255
has comment: http://stackoverflow.com/comment/46336581
type: AnsweredQuestion
score: 0
type: Question
has answer: http://stackoverflow.com/a/29049255
tagged with: javascript
tagged with: jquery
has title: check provided element is within the clicked target

http://stackoverflow.com/comment/46162195
comment on: http://stackoverflow.com/q/28954143
score: 0
type: QuestionComment
has text: Btw, you are calling a click function on a class element "btn-toggle'" but I can't seem to find it anywhere in your html
type: Comment

http://stackoverflow.com/a/73205349
answers question: http://stackoverflow.com/q/29050004
score: 0
has comment: http://stackoverflow.com/comment/129328180
has body: The following would copy objA to objB without referencing objA let objA = { prop: 1 }, let objB = Object.assign( {}, objA ) objB.prop = 2; console.log( objA , objB )
type: Answer

http://stackoverflow.com/q/29036319
tagged with: http://stackoverflow.com/tag/html
answer count: 4
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29036396
has body: I have a link that is tied to an externally hosted JS script that I cannot change. The external script uses jquery to bind to the click function to perform an action. <script...src="external cannot change"> Click me I need to perform another action onClick as well. But when I do the below, the browser only runs the onclick even bound in the external script. Click me It does not run doThis(). It only performs the action specified in the externally hosted script. Is there a method to run 2 onClick events - 1 stored in the external script and 1 coded locally?
tagged with: onclick
has answer: http://stackoverflow.com/a/29036464
has title: Calling OnClick Twice - Once in Tag and Once in Externally Hosted Script
has answer: http://stackoverflow.com/a/29036393
has answer: http://stackoverflow.com/a/29036419
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/28943712
answers question: http://stackoverflow.com/q/28943618
score: -1
has body: I wonder if you could use the onclick event vs .on('click' - http://www.w3schools.com/jsref/event_onclick.asp
upvote count: 0
has comment: http://stackoverflow.com/comment/46141981
type: Answer
has comment: http://stackoverflow.com/comment/46148758
has comment: http://stackoverflow.com/comment/46142149
has comment: http://stackoverflow.com/comment/46148177
downvote count: 1

http://stackoverflow.com/q/29027047
tagged with: dialog
tagged with: javascript
tagged with: modal-dialog
downvote count: 0
tagged with: jquery
has body: I have a modal and i closing the dialog on clicking outside the modal dialog using backdrop property . I have a form in modal. If any changes are made in form and click outside the modal i should warn the user about unsaved changes. The code i am using $(window).on('hide.bs.modal', function() { var changed_data = $("#formid").serialize(); if(changed_data!=original_data) { var result = confirm("Are you sure ?"); if(result == true){ $('#dialog').data('bs.modal').options.backdrop = true; } else { $('#dialog').data('bs.modal').options.backdrop = "static"; } } else { $('#dialog').data('bs.modal').options.backdrop = true; } }); If i click outside the dialog the above function is calling and backdrop option value is changing but the changes are reflecting in the next call of dialog(again if i open the dialog).
favorite count: 0
tagged with: jquery-ui-dialog
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
type: Question
has title: Prompt a warning message before closing a modal

http://stackoverflow.com/a/29041483
answers question: http://stackoverflow.com/q/29041223
has comment: http://stackoverflow.com/comment/46324175
score: 1
has comment: http://stackoverflow.com/comment/46323573
has comment: http://stackoverflow.com/comment/46323507
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46323995
accepted answer of: http://stackoverflow.com/q/29041223
has body: You should add your JavaScript requirements to application.js: //= require full-calendar.js //= require owl-carousel.js Then add application.js to your asset precompilation configuration located under /config/initializers/assets: Rails.application.config.assets.precompile += %w(application.js)
type: Answer
upvote count: 1

http://stackoverflow.com/q/28912069
tagged with: curl
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28912128
has title: How to get contents of a file using cUrl and insert into textarea
has body: I'm using a form for users to fill in their username and password and a filename in order to access a specific file located on a server. The files can be accessed with a url like this: http://username:password@webserver.org:8080/folder1/folder2/filename.txt This would display the contents of the text file in the browser. What I need to do is to have the text content copied into a textarea I have on my site, so that users can work with the text. I would like to have users able to save the contents back to the file, but that can come later. Is there any way I can do this using Javascript or jQuery? Also, if the file is a .html file, I would need to have the code inserted into the textarea. This is the form I have: Username Password File Name If this is not possible in either Javascript or jQuery, please let me know if there are any other tools or libraries I can use to achieve this.
type: Question
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46082813
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28912284
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/comment/46303738
comment on: http://stackoverflow.com/a/29030153
type: Comment
score: 0
type: AnswerComment
has text: Hi BIgt - Thanks for your help, I will sure fiddle with it.

http://stackoverflow.com/q/28997714
answer count: 3
tagged with: triggers
tagged with: google-apps
upvote count: 5
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29000107
tagged with: google-apps-script
has title: Google Script send form values by email, error: cannot read property "namedValues"
tagged with: google-forms
downvote count: 0
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28998300
has comment: http://stackoverflow.com/comment/46247849
has body: Project key: MyvPlY2KvwGODjsi4szfo389owhmw9jII I am trying to run a script that sends the contents of my form by email each time the form is submitted. I was following the instructions from this link below exactly until I started getting errors and I received advice to change my script to open spreadsheets by id: http://www.snipe.net/2013/04/email-contents-google-form/ When I complete the form, it is supposed to email the contents to my email. The problem I am now having is that the function which goes through the form values doesn't work. It's returning the error TypeError: Cannot read property "namedValues" from undefined. (line 15, file "Code")" in regards to the piece of code below: for(var i in headers) message += headers[i] + ': '+ e.namedValues[headers[i]].toString() + "\n\n"; I am not too familiar with Google Apps Scripts so I'm not sure how to work around this issue either. Is there anything you recommend? I have included the entire script below. function sendFormByEmail(e) { // Remember to replace this email address with your own email address var email = "sample@email.com"; var s = SpreadsheetApp.openById("1hOqnK0IVa2WT6-c-MY0jyGGSpIJIV2yzTXdQYX4UQQA").getSheets()[0]; var headers = s.getRange(1,1,1,s.getLastColumn()).getValues()[0]; var message = ""; var subject = "New User Form"; // The variable e holds all the form values in an array. // Loop through the array and append values to the body. for(var i in headers) message += headers[i] + ': '+ e.namedValues[headers[i]].toString() + "\n\n"; // Insert variables from the spreadsheet into the subject. // In this case, I wanted the new hire's name and start date as part of the // email subject. These are the 3rd and 16th columns in my form. // This creates an email subject like "New Hire: Jane Doe - starts 4/23/2013" subject += e.namedValues[headers[2]].toString() + " - starts " + e.namedValues[headers[15]].toString(); // Send the email MailApp.sendEmail(email, subject, message); }
score: 5
has answer: http://stackoverflow.com/a/50881772

http://stackoverflow.com/a/28932765
has comment: http://stackoverflow.com/comment/46143869
score: 2
downvote count: 0
has body: If you're writing a CSV, you'll probably need to stream the data to S3. Lambda has a pretty good example here for streaming image data from a buffer. Obviously you're not using an image but the concept is about the same. get your data from db format it how you need it. I'd recommend looking into streams with something like csv-write-stream. stream data to s3 with something like s3-streaming-upload or the aws-sdk. as part of the response from the SDK, you'd get the location of your file. i'd use mandrill (https://mandrillapp.com/api/docs/messages.html) because it's free , easy, and awesome. you can set the attachment content as base64. Yours might look something like this: "attachments": [ { "type": "text/csv", "name": "myfile.csv", "content": new Buffer( myCsvContent ).toString('base64') } ] I haven't tested this but did something similar recently and this general approach should work for you.
answers question: http://stackoverflow.com/q/28931362
upvote count: 2
type: Answer

http://stackoverflow.com/q/28919446
has title: RegisterStartupScript in a loop
has comment: http://stackoverflow.com/comment/46097224
type: Question
tagged with: c#
answer count: 1
tagged with: javascript
score: 0
has body: I have a problem with call javascript function(in .aspx file) from C#(in .aspx.cs file) in loop. The code below doesn't work. Nothing happens. What's wrong? I read a few posts on stack overflow about it, but nothing work. Here is code: int i = 1; while (i&lt;10) { Page.ClientScript.RegisterStartupScript(this.GetType(), "key" + i.ToString(), "myFunction('" + i + "')", true); i++; } JavaScript function function myFunction(i){ document.write(i); } But this code work, but it doesn't interest me. string something = "something"; Page.ClientScript.RegisterStartupScript(this.GetType(), "key", "myFunction('" + something + "')", true);
has comment: http://stackoverflow.com/comment/46097238
tagged with: asp.net
has comment: http://stackoverflow.com/comment/46097975
has answer: http://stackoverflow.com/a/28919809
accepted answer: http://stackoverflow.com/a/28919809
type: AnsweredQuestion

http://stackoverflow.com/comment/46170925
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28959217
has text: You can't "get around scope".
score: 0

http://stackoverflow.com/q/28938472
linked to: http://stackoverflow.com/q/8900652
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28938678
type: Question
has body: http://jsfiddle.net/xgpqe4rv/ var i = 1; $('#right').click(function(){ $('img').attr('src',arr[i]['logo']); i++ }); so far I can only do until here, there are still 2 missing requirements. I want the infinite loop, means it goes back to the 1 when it clicked the 4th item. The other one is the back button.
answer count: 2
has answer: http://stackoverflow.com/a/28938678
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28938958
score: 0
has comment: http://stackoverflow.com/comment/46131991
possible better answer: http://stackoverflow.com/a/28938958
has title: infinite slider logic with back and forth button

http://stackoverflow.com/comment/46103666
has text: Depending on the template differences, it might be better if you use the show/hide feature on some of the DOM elements whenever one of your components is clicked. If you could show us the templates it might be easier to see if that is an option.
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/28922720

http://stackoverflow.com/a/28969496
has comment: http://stackoverflow.com/comment/46198640
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/46197538
downvote count: 0
has comment: http://stackoverflow.com/comment/46223538
has body: I think you want to remove the .submit() line and just run that inner function on click. Try this instead: $("#saveoshadayssubmit").click(function(e){ e.preventDefault(); var formdata = $("#addoshadaysdiv *").serializeArray(); console.log(formdata); })
answers question: http://stackoverflow.com/q/28969391
type: Answer

http://stackoverflow.com/a/28976680
type: Answer
has comment: http://stackoverflow.com/comment/46206878
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28976594
score: 1
answers question: http://stackoverflow.com/q/28976594
has comment: http://stackoverflow.com/comment/46205728
has comment: http://stackoverflow.com/comment/46204588
upvote count: 1
type: AcceptedAnswer
has body: Try this out : createTarget.addEventListener("click", function() { var elem = document.getElementById('clickme'); // to get the id of the div that dynamically created elem.parentElement.removeChild(elem); // function removes specified child node of your specified element. }); see this working FIDDLE

http://stackoverflow.com/comment/46243054
comment on: http://stackoverflow.com/q/28997350
score: 0
has text: Need some more information. How are you getting the item content originally? On page load? Can you provide some details to the google blogger api on how one could retrieve the updated string?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46148373
has text: Well it looks bad when the border has different size than the picture. Affects just the aesthetics.
comment on: http://stackoverflow.com/a/28945015
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46197676
type: QuestionComment
score: 1
has text: @Veverke - I've added a lot more to my answer to point out two limitations of using a Javascript object as your lookup mechanism for a poor man's set. I've also linked in several polyfill implementations that show you all the extra work required to make a Javascript object come close to doing what an ES6 Set does.
comment on: http://stackoverflow.com/q/28967074
type: Comment

http://stackoverflow.com/a/28949746
score: 0
has comment: http://stackoverflow.com/comment/46187163
has comment: http://stackoverflow.com/comment/46199104
type: Answer
answers question: http://stackoverflow.com/q/28949409
has body: Why don't you check for typeof callback[key] === 'array' Instead checking the length property?

http://stackoverflow.com/comment/46250387
has text: I added it to the main stylesheet as follows Didn't fix it. Did I do it right?
comment on: http://stackoverflow.com/a/29001164
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46174031
score: 0
type: Comment
type: QuestionComment
has text: Regular expressions, while they *could* do what you're asking, aren't meant for this. It would be much easier to check you've got a numeric expression, cast it to an appropriate type and then check it's positive.
comment on: http://stackoverflow.com/q/28960890

http://stackoverflow.com/comment/46277709
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29016426
has text: It works for me when I click on them. I don't have tabbed enabled in FF (default in that browser), so tabbing does nothing. In Chrome it works when I click or tab (focus) on each link.
score: 0

http://stackoverflow.com/q/28971685
tagged with: sharepoint-2010
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28971752
has answer: http://stackoverflow.com/a/28990258
tagged with: javascript
type: Question
has body: I am hoping someone might be able to help. I am trying to change the 'Body #s4-workflow" height to auto when the user is on an iPhone or iPad. This is a Sharepoint 2010 site. I have put the following code into the head section of the Master page but it does not change the height. Does anyone have any ideas? Thank you &lt;script type="text/javascript"&gt; if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPad/i))) { document.getElementById("body #s4-workspace").style.Height = "auto !important"; } &lt;/script&gt;
score: 0
answer count: 2
has title: Sharepoint 2010 Using JavaScript to set the Body #S4-Workflow

http://stackoverflow.com/a/28983937
answers question: http://stackoverflow.com/q/28965210
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/92564365
type: Answer
upvote count: 3
has body: You should do the authentication through web, return a cookie and then connect to the websocket server again, carrying the cookie. The WS server can validate the cookie If there is no cookie based authentication or it is just not possible (like the WS server in another domain), you will have to create your own request-response messages for login.
score: 3
has comment: http://stackoverflow.com/comment/75460578
accepted answer of: http://stackoverflow.com/q/28965210

var
tags question: http://stackoverflow.com/q/28996610
tags question: http://stackoverflow.com/q/28947152
tag name: var
type: Tag

http://stackoverflow.com/a/28976954
answers question: http://stackoverflow.com/q/28976845
score: 0
has body: The obvious solution is to use css that splits images onto separate pages @media print { img {page-break-after: always;} } That will separate your images onto separate pages for print only. Then tell your print dialog to print duplex
type: Answer

http://stackoverflow.com/q/28958084
has comment: http://stackoverflow.com/comment/46168897
has title: Call c# function from javascript function
type: Question
linked to: http://stackoverflow.com/q/5828803
tagged with: c#
has comment: http://stackoverflow.com/comment/46168904
has body: I have c# function which returns true/false, I want a JavaScript function to call this c# function and depending on the return value of the c# function, if true, I need the JavaScript function to show an alert. So please How can I call a c# function in a JavaScript function? Thank you
tagged with: javascript
linked to: http://stackoverflow.com/q/18441194
score: 0
has comment: http://stackoverflow.com/comment/46169713
duplicate of: http://stackoverflow.com/q/18441194
has comment: http://stackoverflow.com/comment/46168908
answer count: 0
has comment: http://stackoverflow.com/comment/46168857
type: UnansweredQuestion

http://stackoverflow.com/comment/46329737
comment on: http://stackoverflow.com/q/29044688
has text: Hide `li` having text "3333" , `click` element having text "John Doe", log `3333` at `console` ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28981006
has comment: http://stackoverflow.com/comment/46211782
has comment: http://stackoverflow.com/comment/46212428
type: Answer
answers question: http://stackoverflow.com/q/28980615
score: 0
has body: Try below custom function for your sort: array1.sort(mySort); function mySort(a,b){ var A = a; var B = b; if (A &lt; B) { return -1; } else if (A &gt; B) { return 1; } else { return 0; } }

http://stackoverflow.com/comment/46168497
type: Comment
comment on: http://stackoverflow.com/a/28957704
has text: Not sure what you're driving at ... canonical object to string is var str_value = JSON.stringify(some_object); object to array is not so generally accepted
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46110679
type: AnswerComment
has text: Hi bala thanks for quick reply ! however i need this to apply only for the first item and not for both
comment on: http://stackoverflow.com/a/28927366
score: 0
type: Comment

http://stackoverflow.com/q/29056215
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29056352
has title: How to remove items from array that begin with "XXX"
has answer: http://stackoverflow.com/a/29056853
type: UnansweredQuestion
score: 1
type: Question
has comment: http://stackoverflow.com/comment/46349848
has answer: http://stackoverflow.com/a/29056244
has comment: http://stackoverflow.com/comment/46349723
has comment: http://stackoverflow.com/comment/46349617
answer count: 3
has comment: http://stackoverflow.com/comment/46349609
upvote count: 1
has body: Let's say you have the follow array: var array = ["app_angrybirds", "app_flappybird", "ilovebirds"]; How would you go about removing any array element that begins with the string "app_"?

http://stackoverflow.com/a/29034708
has body: Try to change the target sort. Instead of function ascendingTargetDepth(a, b) change it to function ascendingTargetDepth(b, a). IE sort by name in descending order. function ascendingTargetDepth(b, a) { return a.target.y - b.target.y; }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28909128

http://stackoverflow.com/comment/46109153
score: 0
has text: I tried to change listaDipendenti with listEmployees, but it doesn't work.
type: Comment
comment on: http://stackoverflow.com/q/28926049
type: QuestionComment

http://stackoverflow.com/a/28963480
has comment: http://stackoverflow.com/comment/46178714
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/46179371
has comment: http://stackoverflow.com/comment/46178687
score: 1
has comment: http://stackoverflow.com/comment/46179484
answers question: http://stackoverflow.com/q/28963316
has comment: http://stackoverflow.com/comment/46178837
has body: Use onchange event on select <?php if($_POST){ $item = $_POST['item']; $link = mysql_connect('host', 'username', 'password'); mysql_select_db('database_name', $link); //write your sql query to enter into table } ?> Select an activity 1 2 ... On your php page you can retrieve post data by $_POST variable

http://stackoverflow.com/comment/46170854
has text: I cannot run the code snippet unfortunately, because of the company restrictions.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28958196
type: AnswerComment

http://stackoverflow.com/a/29009056
score: 0
has body: The below code will collapse the menu on pressing escape $(document).keyup(function(e) { if (e.keyCode == 27) { $("#nav-trigger").removeAttr("checked") } });
type: Answer
answers question: http://stackoverflow.com/q/29008783

http://stackoverflow.com/a/29016409
answers question: http://stackoverflow.com/q/29014080
has body: Use the following, using JQuery to detect the change in first select - and include JQuery as Scott said $( document ).ready(function() { $("#inputType").on('change', function (){ $(".style-sub-1").show(); }); });
score: 0
type: Answer

http://stackoverflow.com/q/28974100
accepted answer: http://stackoverflow.com/a/28974181
possible better answer: http://stackoverflow.com/a/74332687
has answer: http://stackoverflow.com/a/74332687
has body: I need to print a range of numbers in a range using a function and a for-loop. Again I'm stuck on the return value. I believe my code is sufficient for the task but if you have a better idea I'm all ears. function printRange(rangeStart, rangeStop) { var text = ""; for (var i = rangeStart; i &lt; rangeStop; i++) { text += i + ','; } return text; var result = text; } printRange(20, 47); The 'result' is ought to print the numbers 20,21,22...,46,47 but of course it doesn't... Any help is appreciated. Regards, Thomas
upvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28974181
type: Question
answer count: 2
tagged with: for-loop
has title: Print range using for-loop JavaScript
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46199474

http://stackoverflow.com/comment/46168113
type: Comment
has text: Can you make it online and provide us a link (URL) so that we can see exactly what is happening
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28957441

http://stackoverflow.com/comment/46086521
type: AnswerComment
comment on: http://stackoverflow.com/a/28913725
score: 0
type: Comment
has text: To trigger `onclick` set in HTML markup, call native DOM API method `click()` on element, e.g, `$('li a[onclick]').get(0).click()` **but** better is to call method directly then: `showAlertInJs()`. Now it is really depending use case, this is kind of too broad question

http://stackoverflow.com/comment/46252196
score: 0
has text: I also thought that some kind of race condition cause your problem like you did. For confirming it, would you like to try to replace some static max value instead of dynamic value?
type: Comment
comment on: http://stackoverflow.com/q/29001205
type: QuestionComment

http://stackoverflow.com/comment/46186105
type: Comment
comment on: http://stackoverflow.com/q/28966958
score: 0
has text: If you open the console in your browser most of the external resources are 404, maybe they are behind a login screen?
type: QuestionComment

http://stackoverflow.com/a/29061078
upvote count: 6
downvote count: 0
has comment: http://stackoverflow.com/comment/46358968
answers question: http://stackoverflow.com/q/29061034
has comment: http://stackoverflow.com/comment/46358835
has comment: http://stackoverflow.com/comment/46358866
type: Answer
score: 6
has body: Change this line &lt;input name="Submit" type="button" value="Submit Details" /&gt; To &lt;input name="Submit" type="submit" value="Submit Details" /&gt; Adding Javascript function &lt;input name="Submit" type="button" value="Submit Details" onclick="submitfunction();"/&gt; &lt;script type="text/javascript"&gt; function submitfunction() { document.getElementById("YOURFORMID").submit(); } &lt;/script&gt;

http://stackoverflow.com/q/28931408
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28931534
type: Question
tagged with: javascript
has title: radio button as table cell
has body: Js Fiddle here is the JS i have : $( function() { $('td').click( function() { $(this).toggleClass("red-cell"); } ); } ); and the style : td { background: white; cursor: pointer; padding: 2px } td.red-cell { background: #339933; } Easiest to explain by looking at the jsfiddle. I want to be able to click the table cell and if its green then the radio button "yes" is selected, if clicked again it should toggle to the no radio button. I have the radio buttons on the dog picture currently. Once its working i would change the radio buttons to be hidden... The fiddle above is the closest i can get with my limited knowledge of js. Any suggestions on how i can achieve this?
tagged with: html-table
score: 0
tagged with: radio-button
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28931534

http://stackoverflow.com/comment/69021121
score: 0
has text: Hi bb, The link you are provided not working. Can you please tell me the workaround you find.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28993157

http://stackoverflow.com/comment/46215440
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28981495
score: 0
has text: I didn't get it why it is not working, but it's fine ;) Whatever you mean by "I have more parenthesis to keep in mind" the fiddle above is working and I took your own html as the source!

http://stackoverflow.com/comment/46171269
type: Comment
score: 0
has text: Do you want to edit a value in the grid record with the combo? If so, don't use widget column but cell editing plugin.
type: QuestionComment
comment on: http://stackoverflow.com/q/28945442

http://stackoverflow.com/q/28916231
type: Question
has comment: http://stackoverflow.com/comment/46090452
tagged with: javascript
has title: Javascript in html URL
has answer: http://stackoverflow.com/a/28916303
answer count: 2
has answer: http://stackoverflow.com/a/28917242
has body: How to add the javascript in the end of url? I try this but not success... MY CITY Is possible?
has comment: http://stackoverflow.com/comment/46090468
has comment: http://stackoverflow.com/comment/46090464
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46090427
tagged with: http://stackoverflow.com/tag/html
tagged with: php
downvote count: 4
has comment: http://stackoverflow.com/comment/46090531
upvote count: 0
score: -4

http://stackoverflow.com/comment/46189680
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28967171
type: AnswerComment
has text: @sc2bigjoe then look at [this page for passing these parameters to the server](http://stackoverflow.com/q/14757691/1841194) using jQuery load function

http://stackoverflow.com/comment/46307152
type: AnswerComment
comment on: http://stackoverflow.com/a/29032824
type: Comment
has text: What are you using to generate the pdf byteArray?? i think will be easy to make a multipage pdf first and then send to `javascript` in just one byteArray
score: 0

http://stackoverflow.com/comment/46288190
type: Comment
comment on: http://stackoverflow.com/a/29021632
score: 0
type: AnswerComment
has text: That was it! I had two inputs with the same id. Thank you so much

http://stackoverflow.com/a/28995436
accepted answer of: http://stackoverflow.com/q/28995366
has body: Give your elements a common class and a custom data attribute: &lt;div class="ajax doit-01234" data-id="01234"&gt;&lt;/div&gt; And then use 1 handler: $('.ajax').click(function (e) { e.preventDefault(); var id = $(this).data("id"); $.ajax({ url: "https://www.domain.com/page.php?add=" + id, type: "GET", success: function (data) { //Concatenate a selector based on the "id" in the data attribute $(".result-" + id).html('&lt;span class="icon-favorite-green"&gt;&lt;/span&gt;'); }, error: function (xhr, ajaxOptions, thrownError) { //Concatenate a selector based on the "id" in the data attribute $(".result-" + id).html('&lt;span class="icon-favorite-red"&gt;&lt;/span&gt;'); }, timeout: 15000 }); });
upvote count: 5
has comment: http://stackoverflow.com/comment/46239020
score: 5
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28995366

http://stackoverflow.com/comment/46352631
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29038981
score: 0
has text: @JLRishe Splice = less code and I want to modify the array.

http://stackoverflow.com/comment/51542793
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28990085
has text: This soluttion is betters because are special chars encoded anso in 3 bytes, thanks in advance for your feedback
score: 0

angular-ui-bootstrap
tags question: http://stackoverflow.com/q/28948629
type: Tag
tags question: http://stackoverflow.com/q/28987880
tags question: http://stackoverflow.com/q/28925198
tags question: http://stackoverflow.com/q/28958540
tags question: http://stackoverflow.com/q/28956685
tags question: http://stackoverflow.com/q/28964816
tags question: http://stackoverflow.com/q/29039387
tags question: http://stackoverflow.com/q/28970611
tag name: angular-ui-bootstrap

http://stackoverflow.com/q/28932414
tagged with: twitter-bootstrap
has title: Override a directive's link function
type: AnsweredQuestion
downvote count: 0
score: 9
type: Question
accepted answer: http://stackoverflow.com/a/28932945
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28932945
has body: I'm working on an application that's using the excellent UI Bootstrap library. Everything works fine, but I've hit upon a bug with the collapse plugin that breaks on IE10. I'm using the collapse plugin for the main nav and having this broken is a pretty big deal, so I need to figure a way around it. I really don't want to hack the main library. It seems like I ought to be able to decorate this third party directive using approaches found here or here or here, but I can't seem to get it to work. Specifically, I'm trying to override the extend() function that lives in the collapse directive's link() function to do a check for IE10 browser. Has anyone done this or have an idea how to do this?
upvote count: 9
tagged with: angularjs

http://stackoverflow.com/q/28946757
type: UnansweredQuestion
has title: Date Validation Parameters
has body: I have some older code that I am working on (not mine), specifically a date validation function. The user enters the date and the function checks whether the formatting and numbering is correct with onBlur="validateDate(this.value)". If there is an issue found, the system will alert the user. However, there is a couple of things it doesn't take into account. For instance, you can type in characters for the date values and the system will accept it. The system will also accept different string lengths than what are intended for MM/DD/YYYY format (2/2/4). How can I easily modify the code to account for these parameters? function validateDate(date_string) { if (date_string.indexOf('/') == -1) { alert("this date is not valid. Please enter a data in MM/DD/YYYY format"); ErrorCount=1; } else { if (date_string.indexOf(' ') &gt;=0) { alert("this date is not valid. Please enter a data in MM/DD/YYYY format"); ErrorCount=1; } else { var date_element=date_string.split('/'); if(date_element[0] &lt; 1 || date_element[0] &gt; 12) { alert("Month should be a value between 1 and 12"); ErrorCount=1; } if(date_element[1] &lt; 1 || date_element[1] &gt; 31) { alert("Day should be a number between 1 and 31"); ErrorCount=1; } if(date_element[2] &lt; 1999 || date_element[2] &gt; 2075) { alert("The year is suspect"); ErrorCount=1; } } } if (ErrorCount==1) {document.getElementById('release_date').focus(); } ErrorCount=0; }
type: Question
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28946912

http://stackoverflow.com/comment/46269986
comment on: http://stackoverflow.com/a/29012479
has text: `"out that line"`. take out that *attribute*, you mean?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46168581
type: AnswerComment
type: Comment
has text: What is the error your are receiving? I was able to successfully upload images using the code above.
comment on: http://stackoverflow.com/a/28957217
score: 0

http://stackoverflow.com/q/28929540
downvote count: 3
upvote count: 1
type: Question
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/28929561
answer count: 1
favorite count: 0
has body: I want to create the following method: // expects: (array of objects, name of property on object to compare to value, value to compare to) // returns: index of object in array function findIndex(array, delegate, value) { for (index in array) { if (value === array[index].delegate) { return index; } } }; The above method does not work if I pass in a delegate value that is a string. Is something like this possible?
accepted answer: http://stackoverflow.com/a/28929561
has title: How to pass a function an object and a property
type: AnsweredQuestion

http://stackoverflow.com/a/28945084
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28944942
has body: use a filter: var results = $filter('filter')(myArray, { 'name': nameKey }, true)
downvote count: 0
score: 1

http://stackoverflow.com/q/28972758
has answer: http://stackoverflow.com/a/28972791
downvote count: 1
tagged with: arrays
favorite count: 0
has body: I've downloaded a Javascript file from: https://github.com/cavestri/themoviedb-javascript-library In my code i have following line: var a= theMovieDb.search.getMovie({"query":"Fight%20Club"}, successCB, errorCB); The method "theMovieDb.search.getMovie(...) should return a JSON-Array but I don't know were to get the "sucessCB" and the "errorCB". Where do I get this two variables?
has comment: http://stackoverflow.com/comment/46196751
upvote count: 0
tagged with: http://stackoverflow.com/tag/json
possible better answer: http://stackoverflow.com/a/28972798
has answer: http://stackoverflow.com/a/28972798
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28972791
tagged with: javascript
score: -1
has title: Get callback variables in JavaScript-function
answer count: 2

http://stackoverflow.com/comment/46232080
comment on: http://stackoverflow.com/q/28991875
type: Comment
score: 3
has text: It seems like you're asking "Why do web developers go through the pains of using semantically correct (but difficult-to-style) list elements, when they could use ` `s which are easier to style (but semantically less valuable)?" Is that correct, or am I projecting my own understanding of the situation onto your question?
type: QuestionComment

http://stackoverflow.com/comment/46890393
comment on: http://stackoverflow.com/a/29055878
score: 0
type: AnswerComment
type: Comment
has text: djvs - do I need to create the class in my CSS file or is it sufficient to have the class referenced in the javascript? if I need to place is in the CSS... what would that statement look like?

http://stackoverflow.com/comment/69522188
comment on: http://stackoverflow.com/a/28955637
type: Comment
has text: Local storage solution: http://stackoverflow.com/questions/18247130/how-do-i-store-data-in-local-storage-using-angularjs
type: AnswerComment
score: 0

http://stackoverflow.com/q/28941773
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28942444
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28941995
type: UnansweredQuestion
has title: Javascript won't save cookie
has body: I'm using a quick Javascript code (based on a tutorial) to try and create an age screen on a site. However, although the age screen should only pop up once and then be fine for a while, it pops up every refresh. Here's the code I'm using: &lt;script type="text/javascript"&gt; function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+d.toGMTString(); document.cookie = cname + "=" + cvalue + "; " + expires; } function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i &lt; ca.length; i++) { var c = ca[i]; while(c.charAt(0)==' ') c = c.substring(1); if(c.indexOf(name) == 0) return c.substring(name.length,c.length); } return ""; } function checkCookie() { var age = getCookie("allowed"); if (age != true) { age = confirm("you must be 18 or older to enter and view the content on this blog"); } if (age == true) { setCookie("allowed", age, 7); } else if (age == false) { //window.location.replace("http://tumblr.com/dashboard"); } return age; } &lt;/script&gt; I've checked every available online resource and tutorial I can find, but nothing explains why this won't save the cookie properly. If I open the console, it recognizes the site creating the cookie, but gives me undefined values for everything. If I have the console run the checkCookie() function, it returns the proper value depending on whether I clicked 'OK' or 'Cancel' but it still won't actually save that value into the cookie. Can anyone think of any reason this might be happening? UPDATE After changing the age == true checks from boolean checks into strings, it made no difference.
tagged with: cookies

http://stackoverflow.com/comment/46140994
score: 0
type: Comment
type: QuestionComment
has text: Yes it doesn't replace or prevent the submit action, and the alert stops the script until the user clicks ok, then it continues (and redirects). Not clean but I have no access to any source.
comment on: http://stackoverflow.com/q/28943028

http://stackoverflow.com/q/28956751
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/15726377
has answer: http://stackoverflow.com/a/28956913
type: Question
has body: I have many $http requests as following: Scholarship.loadMaxAcademicYear().success(function (AcademicYearId) { if (AcademicYearId) { Scholarship.deleteAllCurrentData(data).success(function () { Scholarship.copyDataToCurrentYear().success(function(){ Scholarship.getPromises(null, AcademicYearId).then(function () { $scope.isSuccess = true; $timeout(function () { $scope.isSuccess = false; $scope.isSubmit = false; $scope.confirmModal.close(); }, 5000); }, function(err){ importError(); }); }).error(function(){ importError(); }) }).error(function(){ importError(); }); } }).error(function (err) { importError(); }); I want to reduce the error callback to be only one at the end as following: Scholarship.loadMaxAcademicYear().success(function (AcademicYearId) { if (AcademicYearId) { Scholarship.deleteAllCurrentData(data).success(function () { Scholarship.copyDataToCurrentYear().success(function(){ Scholarship.getPromises(null, AcademicYearId).then(function () { $scope.isSuccess = true; $timeout(function () { $scope.isSuccess = false; $scope.isSubmit = false; $scope.confirmModal.close(); }, 5000); } }) }) } }).error(function (err) { importError(); }); I'm thinking of using the async but Angular might have some way to handle this kind of problem. Would it be possible to do so in AngularJs?
tagged with: javascript
has comment: http://stackoverflow.com/comment/46166585
score: 0
accepted answer: http://stackoverflow.com/a/28956913
answer count: 1
has comment: http://stackoverflow.com/comment/46167185
has title: How to handle a call back hell in $http chaining?
tagged with: angularjs

http://stackoverflow.com/comment/46235265
type: Comment
type: QuestionComment
score: 0
has text: I am new to Javascript and the jquery-ui datepickers I saw, expected a textfield in the form. But the django-model says it is a "models.TimeField". Now, if I use the model.Form, does django parse the model.TimeField (in HTML) to a TextField?
comment on: http://stackoverflow.com/q/28992064

http://stackoverflow.com/a/29051270
downvote count: 0
answers question: http://stackoverflow.com/q/29051220
has body: If you don't especify the method attribute on the form it will be GET by default, that's why you get the URL params. Also, because you aren't not stopping the default action, your form is being submitted (the reloading effect), so I recommend you the following code to help you: &lt;script&gt; $(function() { //executes js code after html has been loaded $("#button").on("click", function(e) { e.preventDefault(); //avoids to reload the page var postData = $('#form').serialize(); var jqxhr = $.post("SaveForm.jsp", postData ,function() { }).done(function() { alert("The form was submitted successfully"); }) .fail(function() { alert("Error submitting the form."); }) } }); &lt;/script&gt; And remove the onclick at the button to have a cleaner HTML: &lt;button id="button"&gt; Submit &lt;/button&gt;
type: Answer
has comment: http://stackoverflow.com/comment/116205754
accepted answer of: http://stackoverflow.com/q/29051220
score: 3
upvote count: 3
type: AcceptedAnswer

http://stackoverflow.com/q/28913571
has comment: http://stackoverflow.com/comment/46085593
has title: Javascript +/+= Operator
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46085460
has body: I am having trouble with a basic movement engine I have made, where the Up key triggers a function making a small div go up, and the Down key doing the opposite. I am fairly sure it's to do with the += in the Down() function, and I have tested it with -=, which works fine, just I can't work out what might be clashing with the function. At the bottom, I have put a comment to indicate where my problem is. var interval = ''; var key = false; var interval1 = ''; var key1 = false; $(document).keydown(function(e) { if(e.which === 38) { if(key === false){ interval = setInterval(function(){Up()},20) key = true; } } if(e.which === 40) { if(key1 === false){ interval1 = setInterval(function(){Down()},20) key1 = true; } } }); $(document).keyup(function(e) { if(e.which === 38) { clearInterval(interval) key = false; } if(e.which === 40) { clearInterval(interval1) key1 = false; } }); document.getElementById('Jumper').style.top = '46%'; var Top = parseInt(document.getElementById('Jumper').style.top); var Topp = parseInt(document.getElementById('Jumper').style.top); function Up(){ if(Top &gt; 0){ Top = parseInt(document.getElementById('Jumper').style.top); Top -= 0.2; document.getElementById('Jumper').style.top = Top+'%'; } } function Down(){ if(Topp &gt; 0){ Topp = parseInt(document.getElementById('Jumper').style.top); Topp += 0.2; //&lt;--PROBLEM document.getElementById('Jumper').style.top = Topp+'%'; } } #Jumper{ position: absolute; top: 46%; left: 48%; height: 8%; width: 4%; background-color: red; opacity: 1; } &lt;div id='Jumper'&gt;&lt;/div&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt; Can anyone please tell me how I can fix this? Here is a fiddle of it: https://jsfiddle.net/Tobsta/2gnoq5hx/
has comment: http://stackoverflow.com/comment/46086338
has comment: http://stackoverflow.com/comment/46088175
possible better answer: http://stackoverflow.com/a/28923150
tagged with: css
has comment: http://stackoverflow.com/comment/46085555
has comment: http://stackoverflow.com/comment/46085487
has comment: http://stackoverflow.com/comment/46085383
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46085438
has comment: http://stackoverflow.com/comment/46085826
accepted answer: http://stackoverflow.com/a/28914265
has comment: http://stackoverflow.com/comment/46103090
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46085534
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28923150
has answer: http://stackoverflow.com/a/28914265

http://stackoverflow.com/comment/46165530
comment on: http://stackoverflow.com/q/28956060
type: Comment
type: QuestionComment
has text: @thefourtheye - sorry, I meant: "I have **no** idea why they made it that way". Typo in my comment that can't be edited any more.
score: 1

http://stackoverflow.com/q/29060100
tagged with: javascript
score: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/46357091
has comment: http://stackoverflow.com/comment/46356465
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29060537
accepted answer: http://stackoverflow.com/a/29060537
upvote count: 1
downvote count: 1
type: Question
tagged with: client-server
has body: I know that I can see how many times someone opened a specific page in my website. but What I want is to enter a web page URL like www.example.com/page from the user and see how many times this page was opened. can I do this if the page was a PHP, HTML or even an URL for image or mp3 file. What I'm trying to make is a web page that the user enters Different pages link and views how many times the page was opened. Is that possible?
has title: how many person visited a specific web page?
tagged with: counter

http://stackoverflow.com/comment/46354938
has text: @Mehran No, it's not linked to `UTC+03:30`, but to *`Iran time`*! Try to run your browser as last comment purpose.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28989484

http://stackoverflow.com/a/65153921
answers question: http://stackoverflow.com/q/28985656
has body: My code is from an answer above. Special thank for you! calculate = function (a, p, t) { var amount = document.getElementById(a).value; var price = document.getElementById(p).value; document.getElementById(t).value = parseInt(amount)*parseInt(price);} &lt;input type="number" id="a0" onblur="calculate('a0', 'p0', 't0')"&gt; &lt;input type="number" id="p0" onblur="calculate('a0', 'p0', 't0')"&gt; &lt;input type="number" id="t0" &gt; &lt;hr&gt; &lt;input type="number" id="a1" onblur="calculate('a1', 'p1', 't1')"&gt; &lt;input type="number" id="p1" onblur="calculate('a1', 'p1', 't1')"&gt; &lt;input type="number" id="t1" &gt;
score: 1
upvote count: 1
downvote count: 0
type: Answer

http://stackoverflow.com/q/28909281
duplicate of: http://stackoverflow.com/q/19982257
has comment: http://stackoverflow.com/comment/46078351
has comment: http://stackoverflow.com/comment/46078202
tagged with: javascript
linked to: http://stackoverflow.com/q/15261377
has body: I am quite confused of these ember helpers. Can anyone deeply explain what the differences between them in an 'easier' way?
has answer: http://stackoverflow.com/a/28909584
answer count: 1
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/19982257
tagged with: ember.js
has title: different between ember helpers for {{outlet}}, {{yield}}, {{render}} and {{partial}}
type: UnansweredQuestion
score: 16
upvote count: 16
type: Question

http://stackoverflow.com/q/28937576
has title: how to prevent opening another tab in same browser session with php or javascript?
has body: I would like to know how i can prevent users from opening a new tab while he/she still open the previous browser instance? My purpose is to prevent from overriding the data. For example, if the users open a new tab within same application, I want to prompt the message like "You are trying to open a new active window within same application.Please close previous window." Is there any way to do it with php, javascript, session or cookie ?
tagged with: session
tagged with: javascript
has answer: http://stackoverflow.com/a/28937730
answer count: 2
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28937715
tagged with: php
tagged with: cookies
score: 1
downvote count: 1
type: Question

http://stackoverflow.com/q/28915565
has comment: http://stackoverflow.com/comment/46089924
has comment: http://stackoverflow.com/comment/46090132
has comment: http://stackoverflow.com/comment/46089411
has comment: http://stackoverflow.com/comment/46090146
favorite count: 0
has title: Populating a JavaScript array with MySql data
has comment: http://stackoverflow.com/comment/46089729
has comment: http://stackoverflow.com/comment/46089370
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46089622
has body: I've looked through various other questions on SO, but can't quite get the right answer. Basically, I have an array that needs data from a MySql database. Here's what I've tried: var $name = "Foo", $x = 10, $bar = &lt;? php $barQuery = mysql_query("SELECT item FROM table WHERE name = '$name' AND number = '$x'"); $barArray = array(); while ($r = mysql_fetch_assoc($barQuery)) { $barArray[] = $r['item']; } echo json_encode($barArray); ?&gt;; EDIT: I then post this to a .php file, and print the returned data: $.post("file.php", {bar: JSON.stringify($bar), name: $name}).done(function(data) { $('body').html(data); window.print(); setTimeout("location.reload(true)", 500); }); However, I get an error saying "syntax error, unexpected T_VARIABLE". Is it not possible to populate a JS array this way, or is there another way to do it?
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/46089302
has comment: http://stackoverflow.com/comment/46089326
score: 1
has comment: http://stackoverflow.com/comment/46089334
tagged with: mysql
has comment: http://stackoverflow.com/comment/46089363
has comment: http://stackoverflow.com/comment/46090104
has comment: http://stackoverflow.com/comment/46089975
type: Question
linked to: http://stackoverflow.com/q/2973202
has comment: http://stackoverflow.com/comment/46090007
answer count: 2
has comment: http://stackoverflow.com/comment/46090028
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/46089320
tagged with: javascript
has answer: http://stackoverflow.com/a/28915889
has answer: http://stackoverflow.com/a/28915590

http://stackoverflow.com/comment/46115898
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28911508
has text: I applied your first answer to cropit.js and compiled the project on Visual Studio. Even though I refreshed the browser, I still kept getting the same error like I never saved the changes. When I added restarting the browser to my next tries, I saw that your answer worked. Thanks @jdphenix
type: AnswerComment

http://stackoverflow.com/q/29055034
favorite count: 0
tagged with: node.js
answer count: 0
tagged with: oauth
downvote count: 0
type: UnansweredQuestion
tagged with: oauth-2.0
has body: I have a server to server style application running in Node.JS which needs access to Google Docs. I am able to get a JWT token back from Google, but can't figure out how to exchange it for an OAUTH2 token to be used with the various Google APIs. The OAuth 2.0 Playground isn't any help either, it doesn't recognize the string JWT token either... Sample Token Received: ya29.NgECxOUI6NICe_ow3C3iLyFviklSB5mW_ugMh0LADLjupr4fuGuih9UZHHCpHoAdhP7-JeBWZH-PCg When I run this and get the above token, the error I receive back from Google is: { [Error: Incorrect token type.] code: 400, type: 'invalid_grant' } Here is my code: / Code to Obtain OAUTH2 credentials to access google drive in Node.JS // // To install googleapis --&gt; npm install googleapis --save var googleapis = require('googleapis'); // To install JWT Support --&gt; npm install google-oauth-jwt var googleAuth = require('google-oauth-jwt'); // To install Google Drive, npm install google-drive var drive = googleapis.drive('v2'); var OAuth2 = googleapis.auth.OAuth2; // variables to use to use to get initial identification token var EMAIL = 'MyEmailAddressForServices@developer.gserviceaccount.com', KEYFILE = 'C:/GoogleWork/key.pem', SCOPE = 'https://www.googleapis.com/auth/drive.file'; // Variables to use to obtain Oauth2 authorization var CLIENT_ID = 'XXXXXXXXXXX-XXXXXXXXXXXXXXXX.apps.googleusercontent.com', CLIENT_SECRET = 'XXXXXXXXXXXXXXXXXXXXXXXXXX', REDIRECT_URL = 'http://localhost'; googleAuth.authenticate({email: EMAIL, keyFile: KEYFILE, scopes: [SCOPE]}, function(err, token) { if (err) { console.log('ERROR: ' + err); return; } else { console.log('Token Received: ' + token); GetToken(token); } }); var GetToken = function(token) { var auth = new OAuth2(CLIENT_ID, CLIENT_SECRET, REDIRECT_URL); auth.getToken(token, function(err, Oauth_Tokens) { if (err) { console.log('Error while trying to retrieve token: ', err); return; } auth.credentials = Oauth_Tokens; console.log("Tokens: " + auth.credentials) //upload(); }); }…
has comment: http://stackoverflow.com/comment/46363858
has comment: http://stackoverflow.com/comment/46410952
score: 1
has comment: http://stackoverflow.com/comment/46357149
has title: How to convert a Google JWT into a Oauth2 token for the various APIs?
type: Question
upvote count: 1
tagged with: javascript

timer
tag name: timer
tags question: http://stackoverflow.com/q/29057702
tags question: http://stackoverflow.com/q/28950630
tags question: http://stackoverflow.com/q/28974654
type: Tag
tags question: http://stackoverflow.com/q/29029925
tags question: http://stackoverflow.com/q/29018682
tags question: http://stackoverflow.com/q/28915522
tags question: http://stackoverflow.com/q/29039892
tags question: http://stackoverflow.com/q/28955627
tags question: http://stackoverflow.com/q/28949028
tags question: http://stackoverflow.com/q/28908451

http://stackoverflow.com/q/29003605
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46263468
has comment: http://stackoverflow.com/comment/46254089
score: -1
tagged with: servlets
answer count: 2
has comment: http://stackoverflow.com/comment/46256630
has answer: http://stackoverflow.com/a/29003817
has comment: http://stackoverflow.com/comment/46256691
tagged with: javascript
has title: Html body "onload" is not working in Chrome
has comment: http://stackoverflow.com/comment/46257449
has comment: http://stackoverflow.com/comment/46256610
has body: I have written sample web application with servlets and jsp. As per the below code the action url should be executed automatically according to the "onload". I have written this below code in one of my servlet, The below "onload" form hits the path in action only in Firefox and IE but not in Chrome(41.0.2272.74 beta-m (64-bit)).I have seen the link Chrome - is not working but i did not get proper idea, I have my below code in the end of servelt. there is nothing to execute after this code in the servlet. out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" \n"); out.write(" \n \n \n"); out.close(); Is there any reserved key words of chrome in the above action url?
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/46263840
upvote count: 0
has answer: http://stackoverflow.com/a/29075437
accepted answer: http://stackoverflow.com/a/29075437
possible better answer: http://stackoverflow.com/a/29003817
linked to: http://stackoverflow.com/q/18459305
has comment: http://stackoverflow.com/comment/46263677
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/46254152

http://stackoverflow.com/q/29047085
answer count: 1
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46332988
has comment: http://stackoverflow.com/comment/46332742
has answer: http://stackoverflow.com/a/29047272
type: AnsweredQuestion
score: 0
type: Question
tagged with: performance
has comment: http://stackoverflow.com/comment/46332976
has comment: http://stackoverflow.com/comment/46332770
accepted answer: http://stackoverflow.com/a/29047272
has title: AngularJS and efficiency (or: storing values for multiple uses)
has body: I recently started studying a bit of AngularJS (with almost no previous experiences in programming). I would like to create a tool for statistical analysis and to do so I worked on a few "proof-of-concept" examples. Like this one: http://jsfiddle.net/nitecorp/udcjnoxo/ It works but I have the feeling that the way I am using the functions is highly inefficient: Average Age {{getAverage()}} Younger {{getStats(getAges())['younger']}} Older {{getStats(getAges())['older']}} Question What is the right approach to store getAges and use the results instead of recalculating every time? Same for getStats: can I just store the values instead of recalculating twice (in the example)? Note: In this example is not a big deal, but I need to apply that code to a more complex scenario, with more complex stats (standard deviation, variance etc) and using more than 1M values... Thanks

http://stackoverflow.com/q/29053186
has answer: http://stackoverflow.com/a/29053428
accepted answer: http://stackoverflow.com/a/29053428
downvote count: 0
tagged with: javascript
tagged with: media
favorite count: 0
tagged with: android
tagged with: plugins
has answer: http://stackoverflow.com/a/29053921
score: 2
type: AnsweredQuestion
tagged with: cordova
upvote count: 2
has title: PhoneGap Cordova Media Plugin - How to integrate/install?
type: Question
has body: I have been searching everywhere and trying everything, but I just can't seem to be able to use cordova's Media plugin. (e.g var sound = new Media("sound.mp3"); ) I've tried everything and can't seem to get it to work. Please put me out of my misery and give me a step by step instruction on how to do this. I have android sdk and gethub installed already along with a bunch of other things. Most of the things I see are, " Installation: cordova plugin add cordova-plugin-media" THATS IT. Specially the ones with the stupid $ symbol which is completely unrecognized. ..thank you in advance :(
possible better answer: http://stackoverflow.com/a/29053921
answer count: 2

http://stackoverflow.com/comment/46234536
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28991760
has text: That is perfect. I needed to reference the index, not the 'key'. Thank you so much R3tep.
type: AnswerComment

http://stackoverflow.com/a/29018278
upvote count: 0
score: -1
answers question: http://stackoverflow.com/q/29017669
type: Answer
has body: you can do it this way http://jsfiddle.net/dm96hvb9/ you need to append the class="ui-tabs-active ui-state-active" and then show the matching div $('button#addtab').click(function(){ var num_tabs = $("div#search-tabs ul li").length + 1; // remove any active tab $('#search-tabs li').removeClass('ui-state-active'); $('#search-tabs li').removeClass('ui-tabs-active'); // added the active class to the li $("div#search-tabs ul").prepend( "&lt;li class='ui-tabs-active ui-state-active'&gt;&lt;a href='#s-tab" + num_tabs + "'&gt;#" + num_tabs + "&lt;/a&gt;&lt;/li&gt;" ); $("div#search-tabs").append( "&lt;div id='s-tab" + num_tabs + "'&gt;#" + num_tabs + "&lt;/div&gt;" ); $("#search-tabs").tabs("refresh"); //show the active div $("#s-tab"+num_tabs).show(); });
downvote count: 1

http://stackoverflow.com/comment/46297467
type: QuestionComment
comment on: http://stackoverflow.com/q/29027897
has text: I'm assuming `u` is a variable, hence the duplicate, but you did write the **string** `u`, and if it is just a string, it should be obvious that `countDescription.match(/u/g)` matches a literal `u` ?
score: 0
type: Comment

http://stackoverflow.com/q/28996253
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: How do I change row in automated response with js
has comment: http://stackoverflow.com/comment/46240808
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28996372
has comment: http://stackoverflow.com/comment/46255173
accepted answer: http://stackoverflow.com/a/28996372
upvote count: 1
type: Question
score: 1
has body: I have problem with my automated response that client sees when he submits a form from my site. The pages are in three languages and the "thank you message" in the automated response is in three languages. However, I have tried different methods to make these three short different lauguage messages to be displayed on three different rows, but I have not found the answer. Now the message looks like this: Viesti lähetetty! Success! Meddelandet är skickat! Olen yhteydessä heti tiedot luettuani! I will be in contact shortly! Jag är i kontakt så fort som möjligt! I would like it to be like this: Viesti lähetetty! Success! Meddelandet är skickat! Olen yhteydessä heti tiedot luettuani! I will be in contact shortly! Jag är i kontakt så fort som möjligt! I used a nubered list here, but I only want messages to be in different rows. I have tried /n and different methods but noting seems to change the row correctly. These automated replies are on js file that is called TMform.js The part of the js file where all the language answers are looks like this: form .removeClass(opt.processingClass) .addClass(opt.successClass) modal.find('.modal-title').text('Viesti lähetetty! Success! Meddelandet är skickat!') modal.find('.modal-body').text('Olen yhteydessä heti tiedot luettuani!\r I will be in contact shortly!\r Jag är i kontakt så fort som möjligt!') setTimeout(function(){ form .removeClass(opt.successClass) .trigger('reset') },opt.successShowDelay) }else{ modal.find('.modal-title').text('Error!') modal.find('.modal-body').html(e) form There is another file that somehow also controls the form file which name is modal.js If someone knows how to do the row change and format js files that dispaly messages, it would be a big help. The form is easily tested by filling in some data and submitting it, then the thank you message that I want to display differently is seen.
tagged with: forms
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/46700763
comment on: http://stackoverflow.com/q/29002512
score: 0
type: QuestionComment
type: Comment
has text: @Oleg: Thanks, issue is resolved and you point pain area very correctly, it is in the loadComplete event. Once again thanks for your support.

http://stackoverflow.com/comment/46597095
type: Comment
comment on: http://stackoverflow.com/a/29112917
has text: might be worth mentioning that performance.now() is more precise and ignores local clock adjustments made after the tab is opened.
score: 2
type: AnswerComment

http://stackoverflow.com/comment/46130724
comment on: http://stackoverflow.com/q/28937755
type: Comment
type: QuestionComment
has text: Can you show me Json object format?
score: 0

http://stackoverflow.com/comment/46080553
comment on: http://stackoverflow.com/a/28910739
score: 0
type: AnswerComment
type: Comment
has text: I did what you explain here, but this isn't working either, i'm not getting anything from the console, and the queries aren't being executed.

http://stackoverflow.com/q/29011937
has answer: http://stackoverflow.com/a/29012202
has answer: http://stackoverflow.com/a/29012596
type: Question
answer count: 2
has body: I've been trying to figure this out for many, many hours. I'm having an issue where the indicators on this jquery slider will stop changing opacity if you click on them after the slideshow has looped. Furthermore the first indicator doesn't seem to be changing opacity at all when you click on it. function slideSwitch() { var $active = $('.bannercontainer IMG.active'); var $indicator = $('.bannerindicator.active'); if ( $active.length == 0 ) $active = $('.bannercontainer IMG:last'); if ( $indicator.length == 0 ) $indicator = $('.bannerindicator:last'); var $next = $active.next().length ? $active.next() : $('.bannercontainer img:first'); var $nexti = $indicator.next().length ? $indicator.next() : $('.bannerindicator:first'); $next.addClass('active'); $nexti.animate({opacity: 1}, 1000, function() { $nexti.addClass('active'); }); $active.animate({opacity: 0}, 1000, function() { $active.removeClass('active'); }); $indicator.animate({opacity: 0.2}, 1000, function() { $indicator.removeClass('active'); }); $next.css({opacity: 0}) .addClass('active') .animate({opacity: 1}, 1000, function() { }); } var start = setInterval(function() { slideSwitch(); }, 4000 ); $('.bannerindicator:nth-of-type(1)').click(function (){ var $one = $('.bannercontainer IMG:nth-of-type(1)'); var $onei = $('.bannerindicator:nth-of-type(1)'); var $active = $('.bannercontainer IMG.active'); var $indicator = $('.bannerindicator.active'); if($onei.hasClass('active')) { } else { clearInterval(start); $indicator.animate({opacity: 0.2}, 1000, function() { $indicator.removeClass('active'); }); $active.animate({opacity: 0}, 1000, function() { $active.removeClass('active'); }); $onei.addClass('active'), 10, function() { $onei.animate({opacity: 1}, 1000 )}; $one.css({opacity: 0}) .addClass('active') .animate({opacity: 1}, 1000, function() { }); } }); $('.bannerindicator:nth-of-type(2)').click(function (){ var $two = $('.bannercontainer IMG:nth-of-type(2)'); var $twoi = $('.bannerindicator:nth-of-type(2)'); var $…
tagged with: slideshow
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/29012596
tagged with: slider
has title: trying to solve this bug in jquery slider controls
possible better answer: http://stackoverflow.com/a/29012202
type: AnsweredQuestion

http://stackoverflow.com/comment/46085436
comment on: http://stackoverflow.com/q/28913569
has text: I would clone `source` (and change its ID) rather than clone each individual option. You should change ID to a dynamic ID (or remove it altogether) to prevent duplicates
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/29023259
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46290456
has comment: http://stackoverflow.com/comment/46290428
type: Answer
answers question: http://stackoverflow.com/q/29023013
has comment: http://stackoverflow.com/comment/46290907
has comment: http://stackoverflow.com/comment/46290620
accepted answer of: http://stackoverflow.com/q/29023013
has comment: http://stackoverflow.com/comment/46290873
has body: When your JS is run after the page load, the autoNumeric is called on all DOM elements present at the moment with .percent class. But when you add a new row, you ll need to call autoNumeric on it again. Eg: Function addRow(){ $.('.container').append(this.$row); $.('.percent').autoNumeric();} Or you can share ur js code so I can help better. $.('.add_nested_fields').click(function()$.('.percent').autoNumeric();}) Edit: solution found by the questioner @Questifier $(function() { $(document).on('nested:fieldAdded', function(event){ $('.percentage').autoNumeric('init', {aSign: '%', pSign: 's'}); })}); works perfectly. I read more about the gem after you asked me. Copy that code and make it your answer if you would like- thank you for the help.
has comment: http://stackoverflow.com/comment/46290512

http://stackoverflow.com/a/29048070
answers question: http://stackoverflow.com/q/29047890
has comment: http://stackoverflow.com/comment/46334967
has comment: http://stackoverflow.com/comment/46335514
type: Answer
accepted answer of: http://stackoverflow.com/q/29047890
has comment: http://stackoverflow.com/comment/46334628
has comment: http://stackoverflow.com/comment/46335130
has comment: http://stackoverflow.com/comment/46337527
has comment: http://stackoverflow.com/comment/46337350
has body: Like this Instead of onclick use onsubmit and assign the function onload window.onload=function() { document.getElementsByName("f1")[0].onsubmit=function() { var chk = document.getElementsByName('subject[]'),chkOk=false; for (var i = 0, n=chk.length; i &lt; n; i++) { if (chk[i].checked) { chkOk = true; break; } } console.log(chkOk) if (!chkOk) { alert('please select the subject'); chk[0].focus(); // focus the first return false; } var reg = document.getElementsByName('regional[]'),regOk=false; for (var i = 0, n=reg.length; i &lt; n; i++) { if (reg[i].checked) { regOk = true; break; } } if (!regOk) { alert('please select the medium'); reg[0].focus(); // focus the first return false; } return true; // allow submit } } &lt;form name="f1" action="s.php" method="post" onsubmit="return check()"&gt; Subject &lt;input type='checkbox' name='subject[]' value='science'&gt;science &lt;input type='checkbox' name='subject[]' value='maths'&gt;maths&lt;br/&gt; Medium &lt;input type='checkbox' name='regional[]' value='Hindi'&gt;Hindi &lt;input type='checkbox' name='regional[]' value='english'&gt;english&lt;br/&gt; &lt;input type="submit" name="land" class="butt" value="SUBMIT"&gt; &lt;/form&gt;
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/28993984
has comment: http://stackoverflow.com/comment/46236503
score: 0
has comment: http://stackoverflow.com/comment/46248651
type: Answer
has comment: http://stackoverflow.com/comment/46236410
has comment: http://stackoverflow.com/comment/46236554
has comment: http://stackoverflow.com/comment/46236035
has body: From the documentation: destinationType: Choose the format of the return value. The default is FILE_URI. Defined in navigator.camera.DestinationType (Number) Camera.DestinationType = { DATA_URL : 0, // Return image as base64-encoded string FILE_URI : 1, // Return image file URI NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android) }; If you set the destination type to DATA_URL, you will have access to the base64 encoded version of the image. You can then simply POST this string, and many other image strings, along with your JSON payload to your webservice for processing.
answers question: http://stackoverflow.com/q/28993872

http://stackoverflow.com/a/57161646
downvote count: 0
has body: Note on the "classic form"/JQuery solution given by Gregoire: this will not work on the newly added inputs, as the listener is not active on them. If you modify this to use delegated events you have a working clean solution: &lt;div id="files"&gt; &lt;input type="file" name="file[]" /&gt; &lt;/div&gt; $("#files").on("change", "input", function(event){ $('#files').append('&lt;input type="file" name="file[]"/&gt;') });
answers question: http://stackoverflow.com/q/28987896
type: Answer
upvote count: 5
score: 5

http://stackoverflow.com/q/29000189
has comment: http://stackoverflow.com/comment/46248193
tagged with: javascript
score: -1
answer count: 3
upvote count: 0
has body: In my meteor code I return a collection like this Template.posts.helpers({ posts: function () { return Posts.find({}, {sort: {date: -1}}); } }); And then render it with blaze into html with help of the {{#each posts}} {{tags}} {{otherstuff}} {{/each}} But the Posts collection has an tags["one","two","three","four"] array that contains only strings and when i render it on page i get this: one,two,three,four The problem is it inserts commas(don't mind those) and doesn't put spaces between items in array. Any idea how do I approach this?
tagged with: arrays
tagged with: meteor
favorite count: 0
has title: Array of strings returns as one single string with no spaces
has answer: http://stackoverflow.com/a/29000504
has answer: http://stackoverflow.com/a/29000506
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29039338
downvote count: 1
type: Question

http://stackoverflow.com/comment/46557356
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29061716
type: Comment
has text: @LászlóLukács it is likely a problem with handling the async load behavior (ie, not properly handling onload etc. - there could also be errors that needs to be handled using onerror/onabort).

http://stackoverflow.com/comment/46342771
score: 0
comment on: http://stackoverflow.com/a/29049612
has text: Ok you could say that some params are optional ?
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28981079
upvote count: 1
has comment: http://stackoverflow.com/comment/46212157
has comment: http://stackoverflow.com/comment/46212326
has comment: http://stackoverflow.com/comment/46211901
downvote count: 0
has comment: http://stackoverflow.com/comment/46211985
has comment: http://stackoverflow.com/comment/46211883
has comment: http://stackoverflow.com/comment/46212185
has body: The reason your confirm box never appears is actually because you have an error in jquery.confirm.js on line 147: Uncaught ReferenceError: dataOptions is not defined I see your using jquery.confirm.js version 2.3.1. In the official version the file ends like this: /** * Globally definable rules */ $.confirm.options = { text: "Are you sure?", title: "", confirmButton: "Yes", cancelButton: "Cancel", post: false, confirmButtonClass: "btn-primary" } })(jQuery); In your copy, the file ends like this: /** * Globally definable rules */ var settings = $.extend({}, $.confirm.options = { confirm: $.noop, cancel: function (o) {}, button: null, text: "Are you sure?", title: "Warning!", confirmButton: "Yes", cancelButton: "Cancel", post: true, confirmButtonClass: "btn-primary", cancelButtonClass: "btn-default" }, dataOptions, options); })(jQuery); I would replace that bit of code iwth the original bit, or, better yet, grab a new copy of the file from the jquery.confirm site
has comment: http://stackoverflow.com/comment/46212135
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28980624

http://stackoverflow.com/q/29060679
favorite count: 0
has title: For My Blogger <data:post.timestamp/> gives only HH:MM as result
type: UnansweredQuestion
score: 1
tagged with: blogger
upvote count: 1
type: Question
tagged with: javascript
has body: When I use data:post.timestamp in my blogger site gives only HH:MM as result instead of the entire timestamp. How can I get the full date by using data:post.timestamp. Thanks
has answer: http://stackoverflow.com/a/29060791
answer count: 1
downvote count: 0

http://stackoverflow.com/q/28954478
tagged with: angularjs-scope
upvote count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/46285760
tagged with: angularjs-ng-repeat
has comment: http://stackoverflow.com/comment/66375364
has comment: http://stackoverflow.com/comment/46162703
has title: Access dom element inside ng-repeat
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
type: Question
has body: So I have created a simple tab system using ng-repeat the only problem is I can't access the dom element within the tab containers. I have tried doing this: var myEl = angular.element( document.querySelector('editor_'+UniqueId)).scope(); but that returns undefined in the console window. jsfiddle: http://jsfiddle.net/brw7m8q5/4/ my code is pretty simple, i have got a watch function inside my main controller that checks for changes from my service, when a change occurs, it gets the data and generates a unique id and pushes the data to my main object which then create my tabs. When the tab is created I wanna initialize a plugin on the div inside the tab container, but I can't access it don't know what am doing wrong.
score: 1

http://stackoverflow.com/q/28964746
possible better answer: http://stackoverflow.com/a/28964786
tagged with: javascript
tagged with: jquery
score: -1
has body: I am new to jQuery and Javascript and therefore im testing it. I want to create a div container which is draggable and hideable/visible by clicking on a button. Could someone please tell why my buttons are not working? Could you also tell me how I can set the div container to invisible as standard so that I have to klick on the show button the see it? CSS #draggable { width: 150px; height: 150px; padding: 0.5em; } HTML Hide Show Drag me around JS $(function() { $( "#draggable" ).draggable(); }); $(document).ready(function(){ $("#hide").click(function(){ $("draggable").hide(); }); $("#show").click(function(){ $("draggable").show(); }); }); Here you can see my current code running: http://jsfiddle.net/tdsdu1uq/2/ Thank you in advance.
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has comment: http://stackoverflow.com/comment/46181113
tagged with: css
type: AnsweredQuestion
upvote count: 0
has title: DIV container is not hideable
accepted answer: http://stackoverflow.com/a/28964778
has answer: http://stackoverflow.com/a/28964786
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28964778

http://stackoverflow.com/comment/46261576
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29007635
score: 0

http://stackoverflow.com/a/29008890
score: 0
has body: http://jsfiddle.net/extca38f/ $(window).on("resize", function () { if($(window).width()&lt;=900){ console.log("800"); $('.dropdown').hide(); $('.ch-logo').bind('click',function(){ $('.dropdown').toggle(); }); }else{ $('.dropdown').show(); } }).resize();
type: Answer
answers question: http://stackoverflow.com/q/29008690
has comment: http://stackoverflow.com/comment/46263776

http://stackoverflow.com/a/29297073
answers question: http://stackoverflow.com/q/28939017
score: 0
type: Answer
has body: You might also want to check out the audio-slideshow plugin that allows to play separate audio files for each slide and fragment. If your main need is this, the plugin should do the job for you. You can find a demo here and the plugin here. There is also the slideshow-recorder plugin that allows you to record your narration. Asvin

http://stackoverflow.com/comment/46188581
comment on: http://stackoverflow.com/q/28968392
has text: The select is dynamically built based on a employees table and is an intranet, they may need to select 1 employee or 15 individuals for the form to interact with (send the message to) - I don't know how many employees there will be (1 to 3k....) I thought about the checkbox option but it gets unruley in large numbers
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29025431
tagged with: javascript
has answer: http://stackoverflow.com/a/29071674
tagged with: extjs
has title: ExtJS5 Menu panel disappears when panel lose focus
tagged with: extjs4
has comment: http://stackoverflow.com/comment/46295915
accepted answer: http://stackoverflow.com/a/29071674
score: 0
has comment: http://stackoverflow.com/comment/46377615
type: AnsweredQuestion
has body: when i run this code , it will generate a menu panel, but in ExtJS 5.1 the menu panel will disappears when once you click the menu item and then click anywhere else. is that a ExtJS 5.1's bug ? ExtJS 5.0 and ExtJS 4.x are work fine. Ext.application({ name : 'Fiddle', launch : function() { var menu = Ext.create('Ext.menu.Menu',{ floating : false, items : [{ text : 'Service Info', itemId : 'service' },{ xtype: 'menuseparator' },{ text : 'Project Info', itemId : 'project' }], renderTo : Ext.getBody() }) } }); https://fiddle.sencha.com/?fiddle=jhb#fiddle/jhb
type: Question
answer count: 1

http://stackoverflow.com/q/28935047
has title: Jquery - Jittery scrolling when using window scroll
has body: I have a menu at the top of a page that is initially set to position:absolute. Then I have a script with window scroll that changes the position to fixed once someone scrolls 113px down the page. It works fine except the menu jitters really bad when using the mousewheel (seems to only be an issue in Chrome and Opera). Strangely enough when using the actual scroll bar, no problem, it's just when using the mousewheel. It abruptly moves up and down as if it's recalculating its position. Is there anything I can add to this script or the css that will take away the jitters? &lt;style&gt; #topnavcontainer {width:100%; height:50px; position:absolute; top:144px; z-index:200; background:#faa619} .topnavcontainer-scroll {position:fixed !important; top:30px !important} &lt;/style&gt; &lt;script type="text/javascript"&gt; $(window).scroll(function() { var windscroll = $(window).scrollTop(); if (windscroll &gt;= 113) { $('#topnavcontainer').addClass('topnavcontainer-scroll'); } else { $('#topnavcontainer').removeClass('topnavcontainer-scroll'); } }).scroll(); &lt;/script&gt;
tagged with: scroll
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28935138
type: UnansweredQuestion
tagged with: css

http://stackoverflow.com/q/29014473
tagged with: regex
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29014567
has body: var testString = 'Please use "command1" to accept and "command2" to ignore'; All I'm trying to achive is replacing the string between the quotes but when replacing, I need to know what was inside the quotes. After replacing it should be like: var result = 'Please use command1 to accept and command2 to ignore'; I tried somethiing like this with no success: var rePattern = /\"(.*?)\"/gi; Text.replace(rePattern, function (match, txt, urlId) { return "rendered link for " + match; });
has title: regex replace all matches based on pattern
tagged with: replace
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29014575
has answer: http://stackoverflow.com/a/29014547
has answer: http://stackoverflow.com/a/29014575
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29014547
type: Question

http://stackoverflow.com/comment/46291299
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29023974
has text: Thanks for the idea.. It worked..I changed the functions `fn1,fn2` and `off` to `editable`..

http://stackoverflow.com/a/28983520
has body: Try after encoding url component like var redirect_url = "http://listupon.com" + encodeURIComponent(location.pathname) + encodeURIComponent(location.search) ;
has comment: http://stackoverflow.com/comment/46217947
score: 0
has comment: http://stackoverflow.com/comment/46217857
answers question: http://stackoverflow.com/q/28983369
type: Answer
has comment: http://stackoverflow.com/comment/46216156
has comment: http://stackoverflow.com/comment/46216278
has comment: http://stackoverflow.com/comment/46216195
has comment: http://stackoverflow.com/comment/46216814

http://stackoverflow.com/q/29030618
has answer: http://stackoverflow.com/a/29030715
upvote count: 16
tagged with: node.js
type: AnsweredQuestion
has body: I'm using Node.js v0.12.0 with MongoDB driver v1.4.34. So, is there any difference between converting ObjectID to String with toString and toHexString methods?
tagged with: objectid
score: 16
has title: MongoDB native: is there any difference between toString and toHexString methods?
type: Question
accepted answer: http://stackoverflow.com/a/29030715
tagged with: javascript
tagged with: mongodb
answer count: 1
downvote count: 0
tagged with: node-mongodb-native
favorite count: 0

http://stackoverflow.com/q/28928137
answer count: 7
possible better answer: http://stackoverflow.com/a/32376072
accepted answer: http://stackoverflow.com/a/28928961
tagged with: javascript
upvote count: 13
tagged with: jquery
favorite count: 0
tagged with: dropzone.js
has body: Using dropzone.js, I've had no issues getting it to work, including retrieving images already previously uploaded to the server. The only problem I have is when I retrieve those files from the server on a page refresh (meaning they weren't uploaded during this page's current usage), the upload progress bar is permanently displayed. Is there any way to suppress the progress bar for images previously uploaded? I would like to continue to use the progress bars when uploading and don't want to remove the css from the template. Not that it's helpful in this case, but here is the code I'm using to retrieve the files and display them in a remote previews div. Dropzone.options.myDropzone = { previewsContainer: document.getElementById("previews"), init: function() { thisDropzone = this; $.get('../cgi/fileUpload.php', 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, value.uploaddir+value.name); var strippedName = (value.name).slice(11); fileList[i] = {"serverFileName" : value.name, "fileName" : value.name, "fileSize" : value.size, "fileId" : i }; i++; var removeButton = Dropzone.createElement(" Remove file "); var _this = this; removeButton.addEventListener("click", function(e) { e.preventDefault(); e.stopPropagation(); thisDropzone.removeFile(mockFile); }); mockFile.previewElement.appendChild(removeButton); }); }); }, url: "../cgi/fileUpload.php" };
has answer: http://stackoverflow.com/a/28928961
tagged with: css
has answer: http://stackoverflow.com/a/41160598
has answer: http://stackoverflow.com/a/43977000
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/39520908
has answer: http://stackoverflow.com/a/32376072
score: 13
type: Question
has answer: http://stackoverflow.com/a/55596785
has title: dropzone.js Suppress progress bar when retrieving from server
has comment: http://stackoverflow.com/comment/46112191
has answer: http://stackoverflow.com/a/61813795
has comment: http://stackoverflow.com/comment/46112350

http://stackoverflow.com/comment/46232759
has text: Well yes, you should lay out what actual problem you have more clearly. Why don't you even want to use the simple approach?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28992015

http://stackoverflow.com/a/28941052
type: Answer
has body: I imagine you have a typo in the following line: $elem = $("span[id^='impfung_1['"); try this instead: $elem = $("span[id^='impfung_1']");
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28936853
has comment: http://stackoverflow.com/comment/46136570
upvote count: 1

http://stackoverflow.com/q/29054218
downvote count: 0
has comment: http://stackoverflow.com/comment/46346182
has body: My JavaScript code: console.clear(); function BaseClass(nname) { var name = nname; this.bc_PublicProperty = "DefaultValue_BaseClass"; this.bc_getName = function GetName() { return name; }; this.bc_setName = function SetName(nname) { name = nname; }; } function SubClass(nname) { BaseClass.call(this, nname); this.sc_PublicProperty = "DefaultValue_SubClass"; this.sc_getName = function GetName() { return name; }; this.sc_setName = function SetName(nname) { name = nname; }; } SubClass.prototype = Object.create(BaseClass.prototype); SubClass.prototype.constructor = SubClass; var bc = new BaseClass("Anton"); var sc = new SubClass("Bernd"); console.log("hasOwnProperty check on subclass object 'sc' returns true for Method 'bc_getName'"); for (var pro in sc) { console.log("Is " + pro + " own property of subclass: --> " + Object.hasOwnProperty.call(sc, pro)); } I have two objects (BaseClass and SubClass). One inherits from the other using the constructor pattern, as explained on MDN. Now, when I iterate over all properties of the subclass object, they all return true for hasOwnProperty, even for the parent methods/properties, except constructor. Does it mean, that it breaks when using the constructor pattern? When I put public properties and methods in the constructor function, whether in BaseClass or SubClass, they will always be "marked" as own properties/methods. When I instead attach them to the respective prototype, the hasOwnProperty will output "false" for them. Whether you put the public methods/properties to the prototype or to the constructor function itself, they will all be available for use in the subClass (--> SubClass2, --> SubClass3). The only thing, that I can think of right now, why you should attach them to the prototype object, is because of efficiency reasons, as explained here, "Defining class methods"-section. In order not to add closures for every constructed instance. Value Types should be declared on the prototype, but not for instance variables whose…
favorite count: 0
possible better answer: http://stackoverflow.com/a/29054348
has answer: http://stackoverflow.com/a/29054348
has comment: http://stackoverflow.com/comment/46357565
tagged with: hasownproperty
linked to: http://stackoverflow.com/q/16063394
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29054281
tagged with: prototypal-inheritance
has title: hasOwnProperty returns true, when checked against parent object properties
type: Question
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/46358035
tagged with: javascript
score: 4
tagged with: coding-efficiency
has comment: http://stackoverflow.com/comment/46348408
has answer: http://stackoverflow.com/a/29054281

http://stackoverflow.com/a/28934860
score: 1
downvote count: 0
has body: It is a good practice for handling DOM Stuffs using directive. I use .next() for getting the next span. or you can use other selector for getting it. documentation for elem: https://docs.angularjs.org/api/ng/function/angular.element working here here html: Custom Custom 1 is showing but Custom 2 should not be if it was already opened Custom2 Custom 2 is showing but Custom 1 should not be if it was already opened. css .toggle-hide-css { visibility: hidden; } .toggle-show-css { visibility: visible; } directive app.directive('changeToggle', ['$location', function($location) { return { restrict: 'A', link: function(scope, elem, attrs) { elem.bind('click', function(event) { var spanner = elem.next(); if(spanner.hasClass("toggle-show-css")) { elem.parent().parent().find('span').removeClass("toggle-show-css"); elem.parent().parent().find('span').addClass("toggle-hide-css"); spanner.removeClass("toggle-show-css"); spanner.addClass("toggle-hide-css"); } else { elem.parent().parent().find('span').removeClass("toggle-show-css"); elem.parent().parent().find('span').addClass("toggle-hide-css"); spanner.removeClass("toggle-hide-css"); spanner.addClass("toggle-show-css"); } }); } } }]);
answers question: http://stackoverflow.com/q/28933879
type: Answer
upvote count: 1

http://stackoverflow.com/comment/46235221
type: Comment
comment on: http://stackoverflow.com/a/28992095
score: 0
type: AnswerComment
has text: Thanks for the answer, However, I really do not understand your answer, but I came up with a solution and got it figured out, might not be effecient, I just decided to create another array that will store the `response.rows[0].elements[0].duration.text` - which are the distance then create another function to display the values within those two arrays. Therefore, I can then loop through the two array to output the tilte and distance: `function displayPlacesDistance() { for(var i=0; i<p_marker.length; i++) { $("#list").append(p_marker[i].title + " " + placeDist[i] + " "); } }`

http://stackoverflow.com/comment/46247216
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28999445
has text: thank mr. Diego Goes Bauleo on the response, my problem is the HTML that already exist in each blog post and is not possible to change the link one by one, so I wanted to change simultaneously using jquery
type: Comment

http://stackoverflow.com/comment/46307308
type: Comment
comment on: http://stackoverflow.com/a/29031706
score: 0
type: AnswerComment
has text: @Arulkumar For javascript code that is complex it is better to make a method in controller and call it from view.

http://stackoverflow.com/q/29034918
tagged with: response
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46310854
type: Question
has answer: http://stackoverflow.com/a/29035030
has title: Issue with getting data from a JSON object
score: 0
has comment: http://stackoverflow.com/comment/46310602
answer count: 1
accepted answer: http://stackoverflow.com/a/29035030
linked to: http://stackoverflow.com/q/11922383
tagged with: http://stackoverflow.com/tag/json
has body: I have a response from an Ajax POST request which looks like this: { "columns": [ "r" ], "data": [ [ { "extensions": {}, "start": "http://localhost:7474/db/data/node/2762", "property": "http://localhost:7474/db/data/relationship/2709/properties/{key}", "self": "http://localhost:7474/db/data/relationship/2709", "properties": "http://localhost:7474/db/data/relationship/2709/properties", "type": "IS_CONNECTED_WITH", "end": "http://localhost:7474/db/data/node/2763", "metadata": { "id": 2709, "type": "IS_CONNECTED_WITH" }, "data": { "FOC_Type": "IRU", "DuctType": "IRU", "TrenchType": "IRU", "linestringId": "53805" } } ] ] } The above is a string. What I am trying to access is the elements: "FOC_Type":"IRU","DuctType":"IRU","TrenchType":"IRU","linestringId":"53805". I transform the string to JSON like this: var response = JSON.parse(response); and then I try to access some of the values like this: var dataEquip = response[Object.keys(response)[Object.keys(response).length - 1]] // get the data from json obj var komvosName = dataEquip[0][2]; But I can not make it work. I found a work around in which I don't convert the response to JSON format and I play with the string. But that's not nice. I would appreciate if someone could show me what I do wrong.
tagged with: javascript
duplicate of: http://stackoverflow.com/q/11922383

http://stackoverflow.com/comment/46114701
comment on: http://stackoverflow.com/a/28922664
type: Comment
type: AnswerComment
has text: I've got one more question. How do I use these with true/false if statements? Again, thank you so much.
score: 0

http://stackoverflow.com/comment/47894456
has text: Checking logic by URL sounds wrong. Seems you should have different Services and or Service methods for different interceptor behaviors, The Service Methods should call different interceptors which call different Error Resolvers. One of the Error Resolvers should handle 404's and another should ignores 404's. The service method should decide this. Coupling logic with URL's sounds like a violation of SoC.
comment on: http://stackoverflow.com/q/29027724
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/28911017
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/48516866
has title: Javascript FileReader.onload event.currentTarget.result.byteLength = 0 in Chrome
has body: I am trying to read a javascript Blob by iterating through slices and recreating the blob from the slices after reading them with FileReader. In the latest Chrome this intermittently results in either an event.currentTarget.result.byteLength = 0 or "A requested file or directory could not be found at the time an operation was processed." The process is 1) Make a blob of 1 MB. 2) Slice it in 1024 byte increments one by one using callback from FileReader.onload. 3) Read each slice via FileReader and create a new Blob and save it. 4) Repeat step 2 and create a new Blob consisting of the current read and the previous one. 5) If all goes well we have an identical Blob to the original one. This intermittently fails in Chrome. Here is a fiddle http://jsfiddle.net/jimlowrey/8koxyoft/. Be sure to open the console viewer. A more elaborate fiddle http://jsfiddle.net/jimlowrey/d2dL8phh/ &lt;html&gt; &lt;body&gt; Blob Test &lt;script&gt; var end = 0, i = 0, size, newBlob = new Blob(), partBlob; var readSlice = function(event){ var bytesRead = event.currentTarget.result.byteLength; if ( bytesRead &gt; 0){ newBlob = new Blob([newBlob, event.currentTarget.result]); }else{ log("Zero bytes read" , event); return; } i = i + 1024; //i = i + bytesRead; end = i + 1024; if ( end &gt; bigBlob.size ) { end = bigBlob.size; } if ( i &lt; bigBlob.size){ log("i:"+i + " end:" + end); read(bigBlob, i, end); }else{ log(newBlob); log(bigBlob); newBlob = null; bigBlob = null; } }; function read(blob, start, end){ partBlob = blob.slice(start, end); log("sliced " + start + ":"+ end+", partBlob size: " + partBlob.size); var reader = new FileReader(); reader.onerror = error; reader.onabort = onabort; reader.onload = readSlice; reader.readAsArrayBuffer(partBlob); }; function error(e){ log("error " , e); log("i:" + i + " end:" + end); }; function onabort(e){ log("aborted", e); error(e); }; function buildBlob(kb){ var uintKbArr = new Uint8Array(1024); for(var i=0;i&lt;uintKbArr.length;i++){ uintKbArr[i]=i%…
tagged with: javascript
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: filereader
score: 1
has answer: http://stackoverflow.com/a/44227075

http://stackoverflow.com/comment/46174279
score: 0
comment on: http://stackoverflow.com/a/28960956
type: Comment
type: AnswerComment
has text: cool but its accepting 15.000. More than 2 numbers after decimal are not required.

http://stackoverflow.com/a/29027819
score: 0
answers question: http://stackoverflow.com/q/29027675
has body: remove ['ngRoute'] because you don't use it. If you want to use, please include angular-route.js in head
has comment: http://stackoverflow.com/comment/46298015
type: Answer

http://stackoverflow.com/a/29036566
type: Answer
has body: Nevermind, I found a solution. The problem was that I was using onkeypress, and the letter "t" has the same code as "F5" (116 instead of 84) for the key press event. I changed it to onkeydown and that fixed the problem.
score: 0
answers question: http://stackoverflow.com/q/28988352

http://stackoverflow.com/comment/46295797
has text: Hello, Thank you for your help. I have updated my fiddle http://jsfiddle.net/kb3gN/10334/ I now get an error which says : Uncaught TypeError: Cannot read property 'handleClick' of undefined It seems to refer to the onClick={} Event in the bottom Component, but I am not sure
type: Comment
comment on: http://stackoverflow.com/a/29013090
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46293256
comment on: http://stackoverflow.com/q/29002278
score: 0
type: Comment
type: QuestionComment
has text: @MANOJ, do you want to just "select" the checkboxes, or also change the underlying model, because the accepted solution does not change the model bound to each checkbox

http://stackoverflow.com/comment/46358305
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29060960
has text: sorry, I edited my code

http://stackoverflow.com/comment/46132871
type: Comment
comment on: http://stackoverflow.com/a/28938917
has text: OP has not made it clear why they want to store data in their DOM. If they need to store it as a text node for whatever reason, then ` ` would not be suitable.
type: AnswerComment
score: 0

http://stackoverflow.com/q/29032453
score: 1
answer count: 2
possible better answer: http://stackoverflow.com/a/29032562
upvote count: 1
tagged with: javascript
favorite count: 0
tagged with: scope
accepted answer: http://stackoverflow.com/a/29032576
type: AnsweredQuestion
has title: why is the the function not getting called and throwing me an error?
has answer: http://stackoverflow.com/a/29032562
downvote count: 0
has body: The below is my code function callName() { var name="x"; function printName(){ alert(name); } return printName; } name = callName(); alert(name); name(); When i execute it, the alert statement is printing the printName function perfectly, but the function call name() is giving an error stating string is not a function. if scope is the problem the alert should have printed the name instead of the function. I am trying to understand closures here and was trying this out and got confused with the scope management in js.
has answer: http://stackoverflow.com/a/29032576
type: Question

http://stackoverflow.com/comment/46182900
type: QuestionComment
has text: Please consider bookmarking the [Stack Overflow Regular Expressions FAQ](http://stackoverflow.com/a/22944075/2736496) for future reference. As @Biffen said, this is likely not a good candidate for regular expressions.
type: Comment
comment on: http://stackoverflow.com/q/28965568
score: 0

http://stackoverflow.com/comment/46229909
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28990793
type: AnswerComment
has text: http://www.w3.org/TR/cors/#access-control-allow-methods-response-header says that the syntax is `"Access-Control-Allow-Methods" ":" #Method`. Does the `#` tell us to separate tokens by comma?

http://stackoverflow.com/q/28931904
score: 12
answer count: 2
possible better answer: http://stackoverflow.com/a/79500583
has body: I'm using babeljs to write an RPG engine library. I have two files: dice.js import assert from 'assert'; import Random from 'random-js'; export default class Dice { constructor(maxNumber) { assert(typeof(maxNumber) === "number", "maxNumber must be a number"); this._mt = Random.engines.mt19937(); this.minNumber = 1; this.maxNumber = maxNumber; } makeThrow() { this._mt.autoSeed(); return Random.integer(this.minNumber, this.maxNumber)(this._mt); } } throwManager.js import assert from 'assert'; import Dice from 'dice'; export default class ThrowManager { constructor(settings) { assert(settings.hasOwnProperty("numberOfDices"), "must set 'numberOfDices'"); assert(settings.hasOwnProperty("maxNumberInDice"), "must set 'maxNumberInDice'"); assert(settings.maxNumberInDice &lt;= 1, "must have at least 1 dice"); this.settings = settings; } execute() { var throwResults = []; for (var d = 1; d &lt;= this.settings.numberOfDices; d++) { var dice = new Dice(this.settings.maxNumberInDice); throwResults.push(dice.makeThrow()); }; return throwResults; } } When I test them with mocha, I do these imports: tests.js var assert = require('assert'); var Amzhen = require('../Amzhen.js'); var random = require('random-js'); //tests here... Yet when I run the tests, I get this: Error: Cannot find module 'dice' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.&lt;anonymous> (/home/joel/Amzhen.js/Amzhen.js:47:28) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.&lt;anonymous> (/home/joel/Amzhen.js/test/tests.js:2:14) Any ideas why the dice module isn't being found? I'm compiling the code with babel src --out-file Amzhen.js &amp;&amp; mocha
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28935714
tagged with: node.js
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/16163176
tagged with: babeljs
type: Question
accepted answer: http://stackoverflow.com/a/28935714
tagged with: ecmascript-6
has title: Error: cannot find module when testing with mocha
upvote count: 12
has answer: http://stackoverflow.com/a/79500583
tagged with: javascript
has comment: http://stackoverflow.com/comment/46120040

http://stackoverflow.com/q/29028827
type: Question
tagged with: javascript
score: 4
linked to: http://stackoverflow.com/q/11520116
upvote count: 4
answer count: 2
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29030021
has answer: http://stackoverflow.com/a/29030277
accepted answer: http://stackoverflow.com/a/29030021
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29030277
has title: In CoffeeScript when trying to call a method (@_methodName) in a class it returns undefined
has body: I'm trying to use underscore's debounce function in my code, and I'm passing a method of my class as the first parameter, but _.debounce is telling me that I'm passing an undefined parameter where the function should be. class SomeClass click: _.debounce @_save, 600 _save: =&gt; # Save logic On the other hand, If I do it like this, it works, but this solution seems kind of ugly. class SomeClass click: _.debounce ( -&gt; @_save() ), 600 _save: =&gt; # Save logic When I check the generated JS source of both functions, it seems like both should work fine, don't know if I'm missing something from CoffeeScript here.
tagged with: underscore.js
tagged with: coffeescript

http://stackoverflow.com/comment/46202940
score: 1
type: Comment
has text: It isn't a Java-based game. It's a browser game in HTML and Javascript that they happen to want to use some functionality they current have in Java. The clean answer is to rewrite that functionality in Javascript.
type: AnswerComment
comment on: http://stackoverflow.com/a/28975813

http://stackoverflow.com/a/29260174
answers question: http://stackoverflow.com/q/29011511
accepted answer of: http://stackoverflow.com/q/29011511
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46731915
type: Answer
has body: Change this line $select.trigger('update'); To this: $select.val(null).trigger('change') And I think you're all set. The .val(null) clears any selection that is already there, and 'change' is the correct event that updates the div which is displaying the selected value. Edit: By calling .trigger('change') we are simulating the user making a change on the select box. Since this line is in the handler for the change event of the select (so that it runs when the user makes a change), this line should also run when the previous select simulates a change. It's a chain reaction. The first select causes the second to change, and the second causes the third to change and so on.
has comment: http://stackoverflow.com/comment/46728145
upvote count: 2

http://stackoverflow.com/q/28954292
score: -1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28954524
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46162376
accepted answer: http://stackoverflow.com/a/28954524
upvote count: 0
has comment: http://stackoverflow.com/comment/46162480
answer count: 1
tagged with: scrollbars
tagged with: javascript
favorite count: 0
tagged with: angularjs
has body: I have the following CSS for my web app to style scrollbars: ::-webkit-scrollbar { height: 16px; z-index: 100; } ::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); border-radius: 12px; z-index: 100; background-color: rgba(58,193,203, .2); } ::-webkit-scrollbar-thumb { border-radius: 12px; -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); background-color: #3AC1CB; width: 100px; } and reset them with a media query when the width is less than a certain size: ::-webkit-scrollbar { height: initial; z-index: initial; } ::-webkit-scrollbar-track { -webkit-box-shadow: initial; border-radius: initial; z-index: initial; background-color: initial; } ::-webkit-scrollbar-thumb { border-radius: initial; -webkit-box-shadow: initial; background-color: initial; width: initial; } How can we remove the scrollbar styles using ng-style, when javascript detects for example that it's on an ipad: I know the basic syntax from here, but how can this be applied in the case of scrollbars?
tagged with: css
has title: Conditional scrollbar styles

http://stackoverflow.com/a/28958635
answers question: http://stackoverflow.com/q/28958506
has comment: http://stackoverflow.com/comment/46169911
type: Answer
has body: won't work because div and p are not child nodes of a tag. You are still misunderstood it. As per your markup, one can easily says that div and p are the child nodes of anchor. Issue is .innerHTML javascript method you are binding this method to a jQuery object, while you need to have a DOM Node to use it, so either you can use [0] suffix to convert it to the DOM Node or use .get(0) for the same in jquery. To use innerHTML $('.category').on('click', function() { alert($(this).find("p")[0].innerHTML); alert($(this).find("p").get(0).innerHTML); }); or another way is to use .html(), .text() of jQuery which also does the same: $('.category').on('click', function() { alert($(this).find("p").html()); alert($(this).find("p").text()); });
score: 0

http://stackoverflow.com/comment/46208367
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/72725/discussion-between-eric-b-and-syed-farjad-zia-zaidi).
comment on: http://stackoverflow.com/a/28978118
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29050880
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46376342
has comment: http://stackoverflow.com/comment/46421564
answers question: http://stackoverflow.com/q/29050827
has body: For comparing dates easily i suggest you take a look at using Moment.js More specifically moment().diff() From the docs here's how you would compare 2 dates and get the difference in days, i'm assuming you are using jQuery. $('.service-button').click(function(){ var subDate = $('.submission-date').val(); var retireDate = $('.retirement-date').val(); parseDateDifference(subDate, retireDate); }); function parseDateDifference(start, end) { start = moment(start, 'YYYY-MM-DDD'); end = moment(end, 'YYYY-MM-DDD'); var difference = start.diff(end, 'days'); // this now contains you the difference in days between the dates alert(difference); }

http://stackoverflow.com/q/29059546
has comment: http://stackoverflow.com/comment/46355431
has comment: http://stackoverflow.com/comment/46355447
has title: jquery .onsubmit doesnt trigger
answer count: 1
tagged with: submit
tagged with: events
favorite count: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/46355436
has comment: http://stackoverflow.com/comment/46355443
type: AnsweredQuestion
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46355573
has answer: http://stackoverflow.com/a/29059720
tagged with: javascript
tagged with: jquery
has body: I blocked since some hours with a problem. I want to trigger the .submit event and test before validate. But when i debug if i put a breakpoint on the $("#btnSub").submit It detects but just go to end without executing my code. //on submit //_________________________________________________________ $('#btnSubs').submit(function(e) { //Check if form is already shown if ($('#collapseState').val() === "true") { //Check content before send //-------------------------------------------------------------------------------------------------------------------------------------- var valid = (chckPseudo() === true) &amp;&amp; (chckMail() === true) &amp;&amp; (chckMail2() === true) &amp;&amp; (chckPWD() === true); //define a valid flag if (valid) { //disable the btn to avoid multiple connections $(this).button('loading'); //submit the form return true; } else { if (chckPseudo()) formValidate("grpPseudo", "correct"); else formValidate("grpPseudo", "incorrect"); if (chckMail()) formValidate("grpMail", "correct"); else formValidate("grpMail", "incorrect"); if (chckMail2()) formValidate("grpMail2", "correct"); else formValidate("grpMail2", "incorrect"); if (chckPWD()) formValidate("grpPSW", "correct"); else formValidate("grpPSW", "incorrect"); //dont submit e.preventDefault(); return false; } } //show form else { $('#collapseSubscribe').collapse('show'); $('#collapseState').val("true"); // don't submit the form e.preventDefault(); return false; } }); If you could give me some clues it will be very very kind(exasperation) (The code works i know because before I used in .click event and No I havent forget to put a form and button type submit) Thank you!! The html in case &lt;div id="logIndex"&gt; &lt;h3&gt;Toute question a une réponse&lt;/h3&gt; &lt;form method="post" id="reg" action=""&gt; &lt;div class="collapse" id="collapseSubscribe"&gt; &lt;div class="form-group" id="grpPseudo"&gt; &lt;label class="control-label sr-only" for="psdo"&gt;Pseudo&lt;/label&gt; &lt;input type="text" …
accepted answer: http://stackoverflow.com/a/29059720
score: 0

http://stackoverflow.com/comment/46346681
comment on: http://stackoverflow.com/q/29054646
type: Comment
type: QuestionComment
has text: You would start from hidden using CSS.
score: 1

http://stackoverflow.com/comment/46097875
type: QuestionComment
has text: Maybe `.*?Ta.*?py.*?34`
score: 0
comment on: http://stackoverflow.com/q/28920076
type: Comment

http://stackoverflow.com/a/29046501
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29046452
answers question: http://stackoverflow.com/q/29046452
has comment: http://stackoverflow.com/comment/46331867
has comment: http://stackoverflow.com/comment/46331936
has comment: http://stackoverflow.com/comment/46331924
has body: No you don't actually need to, specially if that element is going to be displayed again, because it wouldn't be cool to add/remove the listener every single time. Event listeners are asynchronous, and only impact on performance when they are executed, so since that you're hiding that element (and the user isn't able to interact with it) your listener will not be called as long as it stays hidden, and there will not be any performance impact. Plus: even if you were completely removing that element using parentEl.removeChild(childEl), you still wouldn't have needed to remove the listeners, because deleting an element will cause all its listeners to be removed as well.
type: AcceptedAnswer
downvote count: 0
upvote count: 2

http://stackoverflow.com/a/44311610
upvote count: 1
downvote count: 0
has body: its very easy. Use the bellow code, Its works for me. Here I have used fontawesome icon but you can use anything as image or any other Icon's code. $(document).ready(function(){ $('.slider').slick({ autoplay:true, arrows: true, prevArrow:" ", nextArrow:" " }); });
type: Answer
answers question: http://stackoverflow.com/q/29043562
score: 1

http://stackoverflow.com/a/28981195
has body: the dependencies without return should be added at end( after the other parameters ) define(['backbone', 'item/hide','hbs!tmpl/show_tmpl'], function (Backbone, Hide) { return Backbone.Marionette.ItemView.extend({ initialize: function () { console.log('initialize a UserLogin ItemView'); console.log(Hide); // this comes in as undefined }, ...
score: 0
answers question: http://stackoverflow.com/q/28979519
type: Answer

http://stackoverflow.com/comment/46416640
comment on: http://stackoverflow.com/q/28957517
has text: @DelightedD0D I have quoted the object key with double quotes, now the page is loading infinitely without showing the content and with no error
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29034356
answers question: http://stackoverflow.com/q/29033286
type: Answer
score: 0
has body: If you are using a latest browser(IE >= 11) you can try MutationObserver. Try this in the link function of imageDirective. var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { var target = mutation.addedNodes &amp;&amp; mutation.addNodes[0], targetScope; if (target) { target = angular.element(target); targetScope = target.scope(); console.log(targetScope.width, targetScope.height) } }); }); var config = {childList: true}; observer.observe(element[0], config);

http://stackoverflow.com/q/29000822
has answer: http://stackoverflow.com/a/29010379
accepted answer: http://stackoverflow.com/a/29001066
has title: ng-pattern not functioning in AngularJS
score: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29001066
has answer: http://stackoverflow.com/a/55292936
tagged with: angularjs
has body: Select Interval days hours Above I have an input box and a dropdown list where the value being inputted in the first text box depends on the value being chosen in at the dropdown list. The JavaScript is reading it well, but my problem is that ng-pattern is not functioning, and I don't know why. If I check it in Firebug, it is being shown that ng-pattern is placed into the textbox, but I'm not sure why I am still able to input numbers that are not within the range I have specified. function changetextbox(interval) { if(interval == "days"){ $(".fld-updateinterval-val").attr("placeholder", "1-365"); $(".fld-updateinterval-val").attr("ng-pattern", "/\\b([1-9][0-9]?|[12][0-9]{2}|3[0-5][0-9]|36[0-5])\\b/"); } else if (interval == "hours"){ $(".fld-updateinterval-val").attr("placeholder", "1-8760"); $(".fld-updateinterval-val").attr("ng-pattern", "/\\b([1-9][0-9]{0,2}|[1-7][0-9]{3}|8[0-6][0-9]{2}|87[0-5][0-9]|8760)\\b/"); }
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29010379
tagged with: regex
tagged with: css
answer count: 4
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/44067065

http://stackoverflow.com/comment/46336137
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29048768
has text: @Ali Thanks. This is a very good and clever way to do it if you can put PHP code in the webpage calling the js.php file. However in my particular case, the webpage supposed to call the js.php script within a script src="js.php" is not handling php.

http://stackoverflow.com/q/29033594
has body: I have input slider like that &lt;input ng-model="value" type="text" id="mySlider1" slider ng-change="fun()"/&gt; this slider have values from 1 to 10 i need to get this value by ng-model and perform fun() with angularjs controller when change slider. angularjs controller $scope.fun = function () { console.log($scope.value) };
favorite count: 0
tagged with: angularjs
has title: Angularjs slider with ng-change
has answer: http://stackoverflow.com/a/29034727
downvote count: 0
type: UnansweredQuestion
score: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46308544
upvote count: 1
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/46308246

http://stackoverflow.com/q/28993470
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/46237661
has comment: http://stackoverflow.com/comment/46235513
has comment: http://stackoverflow.com/comment/46235816
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46236061
favorite count: 0
has body: As the title states, I have an issue where my HTML file is not finding a function in a javascript file, even though the javascript file is added and loaded in the . The code in the HTML file In : In the : In num.js: function readNames() { firstName = document.getElementById("firstName").value; alert(firstName); lastName = document.getElementById("lastName").value; alert(lastName); }
has comment: http://stackoverflow.com/comment/46236375
has comment: http://stackoverflow.com/comment/46235250
has title: HTML Javascript function not defined
tagged with: exception
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46236067
has comment: http://stackoverflow.com/comment/46235592
has comment: http://stackoverflow.com/comment/46236174
has comment: http://stackoverflow.com/comment/46236257
has answer: http://stackoverflow.com/a/28993869
has comment: http://stackoverflow.com/comment/46235222
downvote count: 1
has answer: http://stackoverflow.com/a/28994008
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46235230
upvote count: 0

http://stackoverflow.com/q/29015024
has body: I have a program that will have a couple thousand markers on it. Performance isn't the issue here, but organizing the markers so they make sense is what I am going for. I was thinking about making a few check boxes and for example, turning group 1 which has 500 markers on and off and leave group 2 on which has say 200. I have not, however, in my research been able to figure out a viable method for this. I found this example: http://www.geocodezip.com/v2_MarkerCheckBoxesNoXml.asp. However, if you look at the code for it markers are created like this: var point = new GLatLng(43.545068,-89.994888); var marker = createMarker(point, '&lt;div id="infowindow" style="white-space: nowrap;"&gt; church of god&lt;br&gt;1225 n dewey ave&lt;br&gt;Reedsburg, WI&lt;br&gt;&lt;a href=http://&gt; &lt;/a&gt;&lt;/div&gt;','purple'); Which is a lot of code for a single marker. I would prefer it to be something like this: var yellowMarkers = new [[39.9406864, -77.8082025], [33.4482117, -112.0709371],[42.922825, -85.6523916],[40.331837, -79.3783739]]; for (var i = 0; i &lt; yellowMarkers.length; i++) { var place = locations[i]; var myLatLng = new google.maps.LatLng(place[1], place[2]); var marker = new google.maps.Marker({ position: myLatLng, map: map, // icon: image, shape: shape, title: place[0], zIndex: place[3] });} I am new to javascript so if this is a dumb question just send me the right way... but is there a way to organize markers like you would from that example using sets of arrays instead of creating every marker individually?
has answer: http://stackoverflow.com/a/29015720
linked to: http://stackoverflow.com/q/1544739
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46324326
downvote count: 2
upvote count: 1
type: Question
has title: Enabling and Disabling large amounts of markers in Google Maps API V3
has comment: http://stackoverflow.com/comment/46324473
accepted answer: http://stackoverflow.com/a/29015720
tagged with: javascript
score: -1
tagged with: google-maps-api-3
answer count: 2
tagged with: google-maps
possible better answer: http://stackoverflow.com/a/29040917
has comment: http://stackoverflow.com/comment/46276557
has answer: http://stackoverflow.com/a/29040917
favorite count: 0

http://stackoverflow.com/comment/46106685
comment on: http://stackoverflow.com/a/28925167
type: AnswerComment
score: 0
type: Comment
has text: No, that's not how it works. Read the question again.

http://stackoverflow.com/comment/46286022
score: 0
has text: @StevensHaen: Can you please [edit] your post to only ask specifically about the parts that you don't understand, and that are not answered by [\_\_proto\_\_ VS. prototype in JavaScript](http://stackoverflow.com/q/9959727/1048572)?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29020806

http://stackoverflow.com/a/29063912
upvote count: 4
has comment: http://stackoverflow.com/comment/46363955
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46402571
has comment: http://stackoverflow.com/comment/46364058
type: Answer
score: 4
accepted answer of: http://stackoverflow.com/q/29057980
has body: Please take a look at my solution at JSFiddle. HTML select operation Submit Javascript: //ajax emulation $.mockjax({ url: '/test/0', responseTime: 200, responseText: { "aaData" : [ [{"id":1}, {"chk":"on"}, {"operation":["Modify", "Delete"]}], [{"id":2}, {"chk":"on"}, {"operation":["Modify", "Delete"]}], [{"id":3}, {"chk":"on"}, {"operation":["Modify", "Delete"]}], [{"id":4}, {"chk":"on"}, {"operation":["Modify", "Delete"]}], [{"id":5}, {"chk":"on"}, {"operation":["Modify", "Delete"]}], [{"id":6}, {"chk":"on"}, {"operation":["Modify", "Delete"]}], [{"id":7}, {"chk":"on"}, {"operation":["Modify", "Delete"]}] ] } }); // Global variable holding current state of the controls in the data table var g_data = {}; var $table = $('#test'); $table.dataTable( { "lengthMenu": [[2,25,50 ,100, -1], [2,25,50, 100, "All"]], "pagingType": "full_numbers" , "paging": true, "ordering" : true, "scrollY":false, "autoWidth": false, "serverSide": false, "processing": false, "info": true , "deferRender": true, "processing": true, "columns": [ ["data", 1 ], ["data", 2 ] ], "ajax" : { "url": "/test/0", "dataSrc" : function(json){ var data = json.aaData; for (var i = 0; i < data.length; i++){ var chk_name = 'chk_' + data[i][0].id; // If checkbox was never checked if(typeof g_data[chk_name] === 'undefined'){ // Retrieve checkbox state from received data g_data[chk_name] = (data[i][1].chk === 'on') ? true : false; } } return data; } }, "createdRow" : function( row, data, index ){ var chk_name = 'chk_' + data[0].id; var chk_checked = (g_data[chk_name]) ? " checked" : ""; $('td:eq(0)', row) .html(' '); var select_name = 'select_' + data[0].id; html = ' ' + ' Select one ' + '<option' + ((typeof g_data[select_name] !== 'undefined' && g_data[select_name] === data[2].operation[0]) ? ' selected' : '') + '>' + data[2].operation[0] + ' ' + '<option' + ((typeof g_data[select_name] !== 'undefined' && g_data[select_name] === data[2].operation[1]) ? ' selected' : '') + '>' + data[2].operation[1] + ' '; + ' '; …
answers question: http://stackoverflow.com/q/29057980

http://stackoverflow.com/comment/46288658
type: Comment
has text: No problem, I'm glad @MajoB had the easy answer!
type: AnswerComment
comment on: http://stackoverflow.com/a/29018448
score: 0

http://stackoverflow.com/comment/46223714
score: 0
type: Comment
type: QuestionComment
has text: If you try using slimerjs as the engine it will help your troubleshooting. a) you'll be able to see the browser activity, not rely on screenshots; b) it will be a more recent browser engine (so if it works it might mean PhantomJs 1.9.x does not support something in your page).
comment on: http://stackoverflow.com/q/28973117

http://stackoverflow.com/q/29005657
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: php
has answer: http://stackoverflow.com/a/29005721
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29005721
has body: Here's my code: foreach($rows as $row) { echo '&lt;div class="div-that-toggles-other-div" id="' . $row['unique_id'] .'"&gt;'; } foreach($rows as $row) { echo '&lt;div class="div-to-be-toggled" id="uid-' . $row['unique_id'] .'"&gt;'; } The jQuery i've used to toggle the div before wont work when im printing an array of divs where i want only the specific id to open specific div. $(".div-that-toggles-other-div").click(function () { $(".div-to-be-toggled").slideToggle(1000); }); how can i make it toggle depending on id?
type: Question
has title: jQuery, how to make a on click function work with array to toggle divs based on id?

http://stackoverflow.com/a/29060791
answers question: http://stackoverflow.com/q/29060679
downvote count: 0
has body: It worked when I changed the Timestamp format under the settings>Language and formatting.
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/a/29024326
type: Answer
accepted answer of: http://stackoverflow.com/q/29024109
has body: Actually if you look at the console, they are calling different divs. You could probably get it done quickly using jQuery .slideUp() / .slideDown().
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/29024109

http://stackoverflow.com/comment/46263099
type: QuestionComment
has text: @nerezo i get Null if i check with service path, but i get content in localhost path
comment on: http://stackoverflow.com/q/29008311
score: 0
type: Comment

http://stackoverflow.com/q/28955743
favorite count: 0
possible better answer: http://stackoverflow.com/a/28955764
answer count: 3
has body: doesn't work: console.log(obj.html_template); // outputs "myfile.html" var html = fs.readFileSync(JSON.stringify(obj.html_template)); // file not found. works: console.log(obj.html_template); // "myfile.html" var html = fs.readFileSync("myfile.html"); // Works. I'm going crazy.
has title: Node.JS - Filename won't accept a variable
has answer: http://stackoverflow.com/a/28955764
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/28955776
has answer: http://stackoverflow.com/a/28955758
type: Question
has comment: http://stackoverflow.com/comment/46164728
upvote count: 1
tagged with: javascript
tagged with: string
has answer: http://stackoverflow.com/a/28955776

http://stackoverflow.com/a/28989066
has body: it's probably done with an SVG animation / morphing https://css-tricks.com/svg-shape-morphing-works/ basically icons / png nowadays are vector graphics which can be easily adjusted since they are simply text based. You can even put the animation inside the actual image code. or simply use it with jquery and css classes like: svg.animating { transform: rotate(90deg); } which would rotate your svg by 90° http://www.w3schools.com/svg/ for further infos on svg
has comment: http://stackoverflow.com/comment/46239892
type: Answer
downvote count: 1
score: -1
answers question: http://stackoverflow.com/q/28988665
has comment: http://stackoverflow.com/comment/46255914
upvote count: 0

http://stackoverflow.com/a/39528442
score: 0
has body: This dirty hack resolves my issue a little, but it's not perfect: jsfiddle.net/4dm318nn/1 Home Dropdown 1 Dropdown 2 Test 1 Test 2 $(document).ready(function($) { $('.inline').find('.navtoggle').click(function(){ //Expand or collapse this panel $(this).next().slideToggle('fast'); //Hide the other panels $(".sub-menu").not($(this).next()).slideUp('fast'); }); });
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28990617
type: Answer
accepted answer of: http://stackoverflow.com/q/28990617

google-analytics
tags question: http://stackoverflow.com/q/28967392
tags question: http://stackoverflow.com/q/28999432
tags question: http://stackoverflow.com/q/28970142
tags question: http://stackoverflow.com/q/28974768
tags question: http://stackoverflow.com/q/29007427
tags question: http://stackoverflow.com/q/28982806
tag name: google-analytics
tags question: http://stackoverflow.com/q/28967647
tags question: http://stackoverflow.com/q/28913733
tags question: http://stackoverflow.com/q/28963726
type: Tag
tags question: http://stackoverflow.com/q/29007941
tags question: http://stackoverflow.com/q/28947889

http://stackoverflow.com/a/29014760
accepted answer of: http://stackoverflow.com/q/29014483
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/46274729
downvote count: 0
has comment: http://stackoverflow.com/comment/46274414
has comment: http://stackoverflow.com/comment/46274698
has body: It's not setting an "active" state, but you can use the :focus psuedo-selector to define a CSS rule for the button and then set the focus() and then blur() it with a timeout later: var btn = document.getElementById('click'); btn.onclick = function() { var testBtn = document.getElementById('testBtn'); testBtn.focus(); window.setTimeout(function() { testBtn.blur(); },1000); }; Fiddle: http://jsfiddle.net/g0hyfgwg/
answers question: http://stackoverflow.com/q/29014483

http://stackoverflow.com/comment/46379306
comment on: http://stackoverflow.com/a/29032549
type: AnswerComment
score: 0
type: Comment
has text: It's more useful than you might think :) the identifier `y` is reachable inside the function itself (and only there), so it might be used for some kind of recursion for example. It's also useful to have `function y` in the stack trace instead of a bunch of `(anonymous function)`. You can learn more about it here http://kangax.github.io/nfe/ and here https://medium.com/@cramforce/on-the-awesomeness-of-fn-displayname-9511933a714a.

http://stackoverflow.com/a/29006385
answers question: http://stackoverflow.com/q/29006210
has comment: http://stackoverflow.com/comment/46259107
has comment: http://stackoverflow.com/comment/46259963
upvote count: 3
has comment: http://stackoverflow.com/comment/46258813
has comment: http://stackoverflow.com/comment/46258688
type: AcceptedAnswer
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/46259365
has body: You can use white-space: nowrap on each part of the text that you hope not to be wrapped around. See https://developer.mozilla.org/en-US/docs/Web/CSS/white-space The HTML markup nobr can be used but is not recommended. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nobr See http://jsfiddle.net/zo9oygfk/1/ vs http://jsfiddle.net/zo9oygfk/4/ As in your comment, the wrapper having overflow: hidden is not affecting it.
accepted answer of: http://stackoverflow.com/q/29006210
type: Answer

http://stackoverflow.com/a/29062963
type: Answer
upvote count: 4
downvote count: 0
has body: I ended up using RxJS implementing observables with streams. var sanFrancisco = [ '-122.75', '36.8', '-121.75', '37.8' ] var stream = T.stream('statuses/filter', { locations: sanFrancisco }); var source = Rx.Node.fromEvent(stream, 'tweet'); var observer = Rx.Observer.create( function (tweet) { // THIS IS WHERE EACH TWEET SHOULD COME FROM THE STREAM console.log(tweet); }, function (err) { console.log('Error getting tweets: ' + err); }, function () { console.log('Completed'); } ); source.subscribe(observer); I ended up having to use RX.Observable.fromEvent instead of Rx.Node.fromStream because, the Twit module must handle the actual stream behind the scenes but exposing it through and EventEmitter, they probably shouldn't have named it T.stream.
score: 4
answers question: http://stackoverflow.com/q/29013899

http://stackoverflow.com/comment/46081288
comment on: http://stackoverflow.com/q/28911025
type: Comment
has text: I know, I'm really new to fiddle. The markerwithlabel is the marker for each squad. It's nothing relevant to the actual site it's self right now. I'm going to implement it in later on. I appreciate you helping out!
type: QuestionComment
score: 0

http://stackoverflow.com/a/28982372
upvote count: 1
answers question: http://stackoverflow.com/q/28982300
downvote count: 0
has body: Yes, for instance window[room1.north].description. Depending of course of the scope.
type: AcceptedAnswer
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/28982300

http://stackoverflow.com/comment/46129160
type: AnswerComment
has text: It says Requested Unknown parameter "Index" for row 0. And the Index numbers are not displayed.
type: Comment
comment on: http://stackoverflow.com/a/28936987
score: 0

http://stackoverflow.com/a/29032500
has body: The output you get from console.log is a string, not an array. Try using JSON.parse() on it before trying to access like Sergiu suggested in his comment. var leaderboard = []; leaderboard = JSON.parse($(".tojs").text()); console.log(leaderboard[0][0]); //should be "aname1"
has comment: http://stackoverflow.com/comment/46305852
accepted answer of: http://stackoverflow.com/q/29032356
type: Answer
answers question: http://stackoverflow.com/q/29032356
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28970095
type: Question
has body: I have a map and I want to center it to concrete point. Following implementation is working correctly: var map = L.map('map', { crs: crs } ); map.setView([58.66, 25.05], 2); However, implementation below is not working correctly and does not center the map. Why it is happening? I get just blank grey area instead of my map. According to the documentation it does completely the same as the code above. var map = L.map('map', { crs: crs, center: L.latLng(58.66, 25.05) } ); map.setZoom(2); Why?
possible better answer: http://stackoverflow.com/a/28971564
has answer: http://stackoverflow.com/a/28971520
has title: Leaflet map "center" option not working
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28971520
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28971564
type: AnsweredQuestion
tagged with: leaflet

http://stackoverflow.com/a/28939199
score: 3
has body: You should execute function, add () after }, like so UserText: function() { alert("test"); var text = ""; switch ($scope.LanguageId) { case "1": text = "is in process"; break; case "2": text = "test message"; break; } return text; }()
accepted answer of: http://stackoverflow.com/q/28939138
answers question: http://stackoverflow.com/q/28939138
type: AcceptedAnswer
upvote count: 3
type: Answer
downvote count: 0

http://stackoverflow.com/q/28959520
has answer: http://stackoverflow.com/a/28959571
answer count: 4
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28959659
possible better answer: http://stackoverflow.com/a/28959653
type: Question
accepted answer: http://stackoverflow.com/a/28959571
has comment: http://stackoverflow.com/comment/46171688
has answer: http://stackoverflow.com/a/28959653
has title: hide div when it contain not equal attr
tagged with: javascript
tagged with: jquery
has body: Lets say I have 2 type of div class a and b , attr is data-type. When I click a with data-type is test1 , In b all data-type not equal to test1 will be hide , only left div attr is test1. Any idea how to to this ? $(".a").click(function () { var a_datatype = $(this).attr("data-type"); var b_datatype = $(".b").attr("data-type"); if(a_datatype ! = b_datatype){ $(".b").hide(); } }); .a{ float:left; cursor:pointer; } .a:hover{ background:#000; color:#fff; } .b{ float:right; } Name1 Name2 Name3 NewName1 NewName2 NewName3 NewName4 NewName5 NewName6
has answer: http://stackoverflow.com/a/28959698
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/28992937
possible better answer: http://stackoverflow.com/a/28993541
has comment: http://stackoverflow.com/comment/46234061
has answer: http://stackoverflow.com/a/29031860
accepted answer: http://stackoverflow.com/a/29031860
has comment: http://stackoverflow.com/comment/46234357
has comment: http://stackoverflow.com/comment/46235699
type: AnsweredQuestion
tagged with: performance
tagged with: responsive-design
has comment: http://stackoverflow.com/comment/46236315
has comment: http://stackoverflow.com/comment/46234399
upvote count: 5
type: Question
score: 5
has answer: http://stackoverflow.com/a/28993541
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46236977
has comment: http://stackoverflow.com/comment/46235652
has answer: http://stackoverflow.com/a/35989162
has comment: http://stackoverflow.com/comment/46237316
has comment: http://stackoverflow.com/comment/46235946
has title: What’s the best way to add dynamic responsive background images?
has comment: http://stackoverflow.com/comment/46234105
tagged with: css
answer count: 4
favorite count: 0
has body: What is the best way to add (responsive) background images to a static site? Another requirement (which is decribed by 'dynamic') is that the image is set by the backend and therefore cannot be written directly into the CSS file. Option A: Inject background-image in the template via style attribute. Pro: Preparser of the browser could fetch it. Contra: It’s adding styles directly and hardcoded to the markup which isn’t ideal. I also don’t know how to achieve the responsive images solution with that without adding super complex media queries into the style attribute. Option B: Inject responsive background-image sources in the template as data-attributes and write the best assumption as style attribute via JavaScript. Pro: Responsive Images are achievable. Inline styles are only written into markup by script. Contra: Fails when JavaScript fails. Preparser can’t fetch it early. Therefore increases chance of a flash before image is displayed. Option C: Use content responsive images. Pro: Easy to do. Contra: This is not what I want to do and not semantically correct as the images clearly are only representational and should live in CSS, not HTML. Do you have a better idea or know what’s the best option? Thanks for any additional insight or idea!
has answer: http://stackoverflow.com/a/29005603

http://stackoverflow.com/comment/46186204
comment on: http://stackoverflow.com/a/28966002
type: Comment
has text: Why do you say that the parameters are not passed ? Are you sure you don't receive them in the requested URL ?
score: 0
type: AnswerComment

http://stackoverflow.com/q/28965112
has comment: http://stackoverflow.com/comment/46181893
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46183142
has comment: http://stackoverflow.com/comment/46183585
has answer: http://stackoverflow.com/a/49438569
has answer: http://stackoverflow.com/a/74866220
score: 341
has comment: http://stackoverflow.com/comment/46182038
has comment: http://stackoverflow.com/comment/46182498
has comment: http://stackoverflow.com/comment/46182235
has comment: http://stackoverflow.com/comment/46182873
has comment: http://stackoverflow.com/comment/46182663
type: Question
has body: MDN references JavaScript's Set collection abstraction. I've got an array of objects that I'd like to convert to a set so that I am able to remove (.delete()) various elements by name: var array = [ {name: "malcom", dogType: "four-legged"}, {name: "peabody", dogType: "three-legged"}, {name: "pablo", dogType: "two-legged"} ]; How do I convert this array to a set? More specifically, is it possible to do this without iterating over the above array? The documentation is relatively lacking (sufficient for instantiated sets; not for conversions - if possible). I may also be thinking of the conversion to a Map, for removal by key. What I am trying to accomplish is an iterable collection that can be accessed or modified via accessing the elements primarily via a key (as opposed to index). Conversion from an array to the other being the ultimate goal.
has comment: http://stackoverflow.com/comment/46181818
has comment: http://stackoverflow.com/comment/46183817
has comment: http://stackoverflow.com/comment/84687875
has comment: http://stackoverflow.com/comment/46182893
has title: JavaScript Array to Set
has comment: http://stackoverflow.com/comment/46183278
has comment: http://stackoverflow.com/comment/46182911
tagged with: arrays
has comment: http://stackoverflow.com/comment/46182332
tagged with: javascript
has comment: http://stackoverflow.com/comment/46182830
answer count: 6
has comment: http://stackoverflow.com/comment/84795111
has comment: http://stackoverflow.com/comment/46183190
favorite count: 0
has answer: http://stackoverflow.com/a/28965702
linked to: http://stackoverflow.com/q/5525795
has answer: http://stackoverflow.com/a/72759427
has comment: http://stackoverflow.com/comment/46182514
has comment: http://stackoverflow.com/comment/46182156
has comment: http://stackoverflow.com/comment/46183321
has comment: http://stackoverflow.com/comment/46182963
has comment: http://stackoverflow.com/comment/46183788
has comment: http://stackoverflow.com/comment/84687404
has answer: http://stackoverflow.com/a/50908954
possible better answer: http://stackoverflow.com/a/49438569
tagged with: set
has answer: http://stackoverflow.com/a/28965567
upvote count: 342
accepted answer: http://stackoverflow.com/a/28965567

http://stackoverflow.com/comment/46267573
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29011285
type: Comment
has text: @emjay You can do that with CSS backgrounds too.

http://stackoverflow.com/comment/46242123
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28996268
has text: You could use `setTimout()` to check the against the cookie/localstorage within one page but you'd need to do that on every page, ie: you can't start a `setTimout()` on the home page and expect it to work when they click the contact link unless you start a new interval on the contact page as well
score: 1

http://stackoverflow.com/comment/55520507
has text: @Xan: Oh, Thanks a lot for telling me this!
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/33804997
score: 0

http://stackoverflow.com/comment/46337978
score: 0
type: Comment
has text: You forgot to declare `parts` in the fullName setter.
type: AnswerComment
comment on: http://stackoverflow.com/a/29049786

http://stackoverflow.com/a/28977640
has comment: http://stackoverflow.com/comment/46206418
answers question: http://stackoverflow.com/q/28977340
type: Answer
accepted answer of: http://stackoverflow.com/q/28977340
downvote count: 0
score: 1
has body: The method you are using for setting the cookie is correct but at start the values are not showing because there are no cookies. Remember that you only can access the cookies set by your site so at start there aren't any. You can add a test cookie to see that your code is working like in the following example, also it shows how to update the value of the cookie when the select is changed as you asked: Image Link Text hi
has comment: http://stackoverflow.com/comment/46206631
has comment: http://stackoverflow.com/comment/46241577
has comment: http://stackoverflow.com/comment/46206522
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/46144056
score: 0
type: Comment
has text: OK but also with this solution I must change all id's manually :(
type: AnswerComment
comment on: http://stackoverflow.com/a/28944627

http://stackoverflow.com/q/29002328
has comment: http://stackoverflow.com/comment/46251948
tagged with: jquery
has comment: http://stackoverflow.com/comment/46252016
favorite count: 0
accepted answer: http://stackoverflow.com/a/29002364
has comment: http://stackoverflow.com/comment/46251969
has comment: http://stackoverflow.com/comment/46251949
type: AnsweredQuestion
has body: I want to fetch the json data from an url that have following structure [ { "item1": "1", "item2": "2", "item3": "3"}] I am able to find the result if I remove the third brackets from the above,But i am getting problem to show the result because in the url the json data have the above format. Is it possible to get data from an url that have third brakets?advance thanks
has title: get json data that have third brackets from url using jquery or javascript
score: 0
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/46251982
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46253079
has comment: http://stackoverflow.com/comment/46251942
has answer: http://stackoverflow.com/a/29002364
answer count: 1

http://stackoverflow.com/q/29052270
favorite count: 0
has comment: http://stackoverflow.com/comment/46342515
has comment: http://stackoverflow.com/comment/46342428
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46342493
tagged with: external
has comment: http://stackoverflow.com/comment/46342606
has comment: http://stackoverflow.com/comment/46342539
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46342552
has comment: http://stackoverflow.com/comment/46342513
has comment: http://stackoverflow.com/comment/46342624
has answer: http://stackoverflow.com/a/29052524
score: 1
has title: external javascript link not working
has comment: http://stackoverflow.com/comment/46342705
has comment: http://stackoverflow.com/comment/46342426
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/46342996
answer count: 1
tagged with: hyperlink
tagged with: javascript
has comment: http://stackoverflow.com/comment/46342743
has body: I can't figure out why my external javaScript won't link to my html code. What am I doing wrong? With my input function I am trying to concatenate 2 Strings and output the new String in the empty text field. Thanks in advance guys! HTML (index.html) Free GPA Calculator Free GPA Calculator Course Number of Credits Letter Grade JavaScript (gpacalc.js) function input() { var doc = document.getElementById("courseAdd"); var course = doc.course.value; var credits = doc.credits.value; var grade = doc.grade.value; doc.exp.value = course + credits; }

http://stackoverflow.com/comment/46244315
has text: Please show the html with the checkbox and button
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28998007

http://stackoverflow.com/a/28996372
has comment: http://stackoverflow.com/comment/46266030
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28996253
score: 1
has comment: http://stackoverflow.com/comment/46320008
answers question: http://stackoverflow.com/q/28996253
type: Answer
has comment: http://stackoverflow.com/comment/46319797
has comment: http://stackoverflow.com/comment/46280619
has comment: http://stackoverflow.com/comment/46255977
has body: Assuming your .modal-body and .modal-title classes are on div's, you need to append a tag to the div instead of just setting the text like this: $('.modal-title').append(' MESSAGE '); $('.modal-body').append(' BODY ');
upvote count: 1

http://stackoverflow.com/a/28994043
answers question: http://stackoverflow.com/q/28993673
has body: just do this instead and keep the ordering like so: writeData(return_another_value); var final_value = do_something_last(variable2); Well, that simply won't work, as do_something_last is not called after the writeData(…) promise is resolved. It'll just start right after the promise is created and returned. So if you care about that particular order and want to wait until the data is written, then you need to use then with a callback: var final_promise = writeData(return_another_value).then(function(writeResult) { return do_something_last(variable2); }); The general rules are: make synchronous functions synchronous - no need for promises make all asynchronous functions always return a promise use deferreds only at the lowest possible level for promisification You can just place synchronous functions in a then chain, non-promise return values (or even thrown exceptions) work fine in them. So while you can write your sequence like Q('test1.txt') .then(do_something) .then(do_something_else) .then(writeData) .then(do_something_last.bind(null, 'test2.txt')) .done(); it looks rather odd. If you don't plan to make the do_somethings asynchronous in the near future for some reason, it's often simpler to write and read writeData(do_something_else(do_something('test1.txt'))).then(function() { return do_something_last('test2.txt'); }).done(); Admittedly, it's sometimes more appealing to write somePromise() .then(doSomethingSynchronous) .then(doSomethingAsynchronous) than somePromise .then(function(res) { return doSomethingAsynchronous(doSomethingSynchronous(res)); }) even though they are functionally identical. Choose the style that you like better and that is more consistent.
type: Answer
has comment: http://stackoverflow.com/comment/46236486
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/46236722
has comment: http://stackoverflow.com/comment/46237657
accepted answer of: http://stackoverflow.com/q/28993673
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/53980675
type: Comment
comment on: http://stackoverflow.com/a/29010747
has text: @GANA Read the documentation for `page.sendEvent()`. You can specify the Home key and pass a modifier.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46143299
has text: In the first time display table of domains but after a few second table removed and code not display result! Chrom console display this error: Failed to load resource: net::ERR_CONNECTION_TIMED_OUT
type: AnswerComment
comment on: http://stackoverflow.com/a/28930953
score: 0
type: Comment

http://stackoverflow.com/comment/106388753
comment on: http://stackoverflow.com/a/44506266
type: AnswerComment
type: Comment
score: 3
has text: I still have this issue on iOS 11

http://stackoverflow.com/comment/46107717
comment on: http://stackoverflow.com/q/28917038
score: 0
type: Comment
type: QuestionComment
has text: @SecondRikudo It returned true, I really don't know what goes wrong. But i'll find out.

http://stackoverflow.com/q/28927572
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28930206
type: Question
has body: in Fabric JS when an object or multiple objects is/are selected, it's possible to scale them. Either in the corner (with aspects) or only width/height. Is it possible to allow this only if an object is selected and prevent this if multiple objects are selected? Thanks in advance!
tagged with: javascript
tagged with: fabricjs
has title: Fabric JS: How to prevent scaling active group
downvote count: 0
answer count: 1
favorite count: 0
linked to: http://stackoverflow.com/q/5758363
score: 6
upvote count: 6
has answer: http://stackoverflow.com/a/28930206

http://stackoverflow.com/a/28929885
has body: Because they share a single children array: When the defaults are set, they're set by assignment, and what gets assigned is a reference to the array, not a copy of the array. E.g., for the same reason that a and b below refer to the same array: var a = []; var b = a; ...just rather less directly via the defaults mechanism. Instead, you specify a defaults function, which gets called each time to create a distinct array: defaults function: var Parent = Backbone.Model.extend({ defaults: function() [ return { children: [] }; }, addChild: function() { var child = new Child(); this.get('children').push(child); return child; } }); This is what the documentation is talking about when it says: Remember that in JavaScript, objects are passed by reference, so if you include an object as a default value, it will be shared among all instances. Instead, define defaults as a function. It may also be possible to do this using a constructor instead, but I won't show an example because I don't use Backbone and could easily show something misleading (and the docs point to using a defaults function, so they probably have a reason).
downvote count: 0
has comment: http://stackoverflow.com/comment/46116355
score: 5
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28929728
answers question: http://stackoverflow.com/q/28929728
upvote count: 5
type: Answer

http://stackoverflow.com/comment/46253692
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29003412
score: 1
has text: PHP runs on the server, before the page is sent to the client. The Javascript doesn't run until PHP is all done. Why not use media queries?

http://stackoverflow.com/q/29015607
tagged with: css
has title: JS uses to different paddings
type: Question
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46287637
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I am having a problem with my website. The padding-top of div class="row slide-content" is acting weird. For some slides it is about 223px and for other slides it uses a different padding. PHP <?php while ($slide =& $loop->next()): ?> <?php if ( ! empty( $slide->button ) ) : ?> <?php echo $slide->button; ?> <?php endif; ?> <?php if ( ! empty( $slide->ititle ) || ! empty( $slide->caption ) ) : ?> <?php if ( ! empty( $slide->ititle ) ) : ?> <?php echo $slide->ititle; ?> <?php endif; ?> <?php if ( empty( $slide->ititle ) ) : ?> <?php endif; ?> <?php echo $slide->caption; ?> <?php endif; ?> <img class="slider-bg" alt="<?php echo esc_attr( $slide->alt ); ?>" src="<?php echo esc_attr( $slide->img ); ?>" /> <?php endwhile; ?> The logo is inserted here <?php echo $slide->button; ?> Both logo's are exactly the same dimensions JS // Append HTML 's as CSS Background for slides // also center the content of the slide jQuery('.home-slider .slides li').each(function () { var imgSrc = jQuery(this).children('.slider-bg').attr('src'); jQuery(this).css('background', 'url("' + imgSrc + '")'); jQuery(this).children('.slider-bg').remove(); var slideHeight = jQuery(this).height(); var contentHeight = jQuery(this).children('.slide-content').height(); var padTop = (slideHeight / 2) - (contentHeight / 2); jQuery(this).children('.slide-content').css('padding-top', padTop); }); this is the link to my website http://timberlife.nl It wont happen every time but sometimes the padding between the logo and the top of the page changes. I hope i have explained wel enough :) Many thanks! Daan
has comment: http://stackoverflow.com/comment/46303691
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29022247
tagged with: php

http://stackoverflow.com/a/28979828
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28977804
has body: As per my comments to your question, this should do the trick. Note the model hook can return a Promise whereas setupController shouldn't return anything. Here is a JSBin that tries correspond with your project - obviously the data is different: http://emberjs.jsbin.com/letalehoje/1/edit?html,js,console,output Make sure you view it externally as well: http://emberjs.jsbin.com/letalehoje/1/#/project/1/file/text1-1.txt App.ProjectRoute = Ember.Route.extend({ model: function(params) { return Ember.$.getJSON('/load-project?id=' + params.id); } }); App.FileRoute = Ember.Route.extend({ model: function(params) { var projectPromise = this.modelFor('project'); return Ember.RSVP.resolve(projectPromise).then(function(project) { // this is the promise that should be returned for the FileRoute model return Ember.$.getJSON('/load-file?project=' + project.id + '&amp;path=' + params.encodedPath); }); } });
accepted answer of: http://stackoverflow.com/q/28977804
type: Answer
has comment: http://stackoverflow.com/comment/46237238
has comment: http://stackoverflow.com/comment/46244305
has comment: http://stackoverflow.com/comment/46211949
score: 0
has comment: http://stackoverflow.com/comment/46237879
has comment: http://stackoverflow.com/comment/46243822

http://stackoverflow.com/comment/46198075
comment on: http://stackoverflow.com/a/28973010
type: AnswerComment
has text: Thanks for the link; it seems contradictory to state that I can ask about 'software tools commonly used by programmers', but then states off-topic as 'Questions seeking debugging help'...circular reference => stack overflow. I'll try to be more vigilant for future questions.
score: 0
type: Comment

http://stackoverflow.com/comment/46271851
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29013436
has text: Pretty sure when you do `-g` the folder is added to the npm folder which is in the system path. If you want to run bower/grunt from your node_modules folder you need to specify the actual path to that bin file: `node_modules/bower/bin`. Or something like that.
score: 0

http://stackoverflow.com/comment/99809109
score: 0
has text: As @brandon-keith-biggs said, `setOrientation` has been deprecated. Now you have to set each param one at a time (answer has been edited accordingly).
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28932077

http://stackoverflow.com/comment/46304270
score: 0
type: Comment
has text: If i put a display: none in the toggling-image.collapse it works, but it not showing the fade with the opacity, it appears instantly... Is there any option to fade with the display or something? Thanks.
comment on: http://stackoverflow.com/a/29023049
type: AnswerComment

http://stackoverflow.com/q/29055221
has comment: http://stackoverflow.com/comment/46347836
has comment: http://stackoverflow.com/comment/46347771
has comment: http://stackoverflow.com/comment/46347815
has body: This question is brought up because of this. The problem is, probably, the page is designed to generate a confirmation alert only if the user click on browser X button. I know that window.close() will close the current browser window which probably is not the same as clicking the X of browser window. Is there any way, possibly with JavaScript to recreate the click action on browser X button as if a real user would do?
has comment: http://stackoverflow.com/comment/46348136
has comment: http://stackoverflow.com/comment/46347860
score: 2
has comment: http://stackoverflow.com/comment/46347762
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/21576316
has comment: http://stackoverflow.com/comment/46347742
accepted answer: http://stackoverflow.com/a/29055312
type: Question
upvote count: 2
has title: Invoke browser X button with JavaScript
tagged with: browser
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/29054134
tagged with: dom-events
has comment: http://stackoverflow.com/comment/46347842
has answer: http://stackoverflow.com/a/29055312
has comment: http://stackoverflow.com/comment/46347801
has comment: http://stackoverflow.com/comment/46347744
linked to: http://stackoverflow.com/q/13443503
answer count: 1
has comment: http://stackoverflow.com/comment/46347792
favorite count: 0

list
type: Tag
tag name: list
tags question: http://stackoverflow.com/q/28958823

http://stackoverflow.com/a/29052213
has comment: http://stackoverflow.com/comment/46342816
has body: In second for loop: // #1 propsInB += 1; counts objects properties // #2 !(prop in a) checks whether object a has same property as b has // #3 !deepEqual(a[prop], b[prop]) checks if property value for both objects has same values (deepEqual is used here because it might be comparing pair of another objects too) if #2 or #3 fails it returns false immediately, but if it won't happen (which means that a has all b's properties) it finally checks if the number of all properties in both objects are equal. If they are - objects are same instances. EDIT I rewrite whole code so it will be more readable for you. Notice that i changed prop to both prop_a and prop_b for each for loop function deepEqual(a, b) { if (a === b) return true; if (a == null || typeof a != "object" || b == null || typeof b != "object") { return false; } var propsInA = 0; var propsInB = 0; for (var prop_a in a) { propsInA += 1; } for (var prop_b in b) { propsInB += 1; if (!(prop_b in a) || !deepEqual(a[prop_b], b[prop_b])) { return false; } } return propsInA == propsInB; }
upvote count: 1
answers question: http://stackoverflow.com/q/29052075
has comment: http://stackoverflow.com/comment/46342714
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46343749
has comment: http://stackoverflow.com/comment/46344113

http://stackoverflow.com/q/29031096
tagged with: http://stackoverflow.com/tag/xhtml
has body: I am pretty new in JavaScript and JQuery and I have the following problem. Into a JSP page I have some HTML code like this: <form id="treeForm" method="post" action="http://localhost:7001/web/guest/link?p_auth=2QCM0Vgs&p_p_id=KMCountryArea_WAR_KMPortlets&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-4&p_p_col_count=1&_KMCountryArea_WAR_KMPortlets_templateDir=template&_KMCountryArea_WAR_KMPortlets_theme=css_xhtml&_KMCountryArea_WAR_KMPortlets_dynamicAttributes=%7B%7D&_KMCountryArea_WAR_KMPortlets_id=treeForm&_KMCountryArea_WAR_KMPortlets_struts.portlet.action=%2FkmCountryArea%2FkmCountryArea%2FsaveEventAttach&_KMCountryArea_WAR_KMPortlets_struts.portlet.mode=view" name="treeForm"> ............................................................... ............................................................... ............................................................... Selezionare una Folder CAMEX NORTH AMERICA BRAZIL CHILE NEW ANDEAN IBERIA ITALY_EUROPE ............................................................... ............................................................... ............................................................... </s:form> So, as you can see in the previous code snippet, the user can select a value (represented by the value) from a drop down menu rendered by the tag. And also, in the previous code there is an hidden input field that have id="folderId". So now what I need to do is the following operation: when the user select an option from the menu rendered by the tag a Javascript\JQuery script set the value of the hidden input tag (id="folderId") with the value of the selected option. How can I do it?
type: Question
score: 0
has answer: http://stackoverflow.com/a/29031342
tagged with: javascript
tagged with: jquery
has title: How can I set the value of an hidden input tag with the value of the selected option of a select tag using JavaScript\JQuery?
has answer: http://stackoverflow.com/a/29031151
tagged with: jquery-events
answer count: 3
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29031151
accepted answer: http://stackoverflow.com/a/29031342
has answer: http://stackoverflow.com/a/29031562
type: AnsweredQuestion

http://stackoverflow.com/comment/46290512
comment on: http://stackoverflow.com/a/29023259
score: 0
has text: I never thought to look at the gem docs. I just found an event I can use. I used the nested:fieldAdded event and it works just as expected.
type: Comment
type: AnswerComment

http://stackoverflow.com/q/28910709
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Bootstrap Modal Loading but Non-Responsive
type: Question
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28910935
tagged with: jquery
has body: I've read the many threads on this topic but none have answered the issue that I'm having. I am trying to create a modal view overlay that spans the page width. However, the modal renders but it isn't responsive. It is darkened out and buttons won't work. This is how I load my assets: &lt;!-- Bootstrap Core --&gt; &lt;link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'&gt; &lt;!-- Custom CSS --&gt; &lt;link rel='stylesheet' href='styles/application.css'&gt; &lt;!-- jQuery --&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt; &lt;!-- Bootstrap Core JavaScript --&gt; &lt;script src="scripts/bootstrap.min.js"&gt;&lt;/script&gt; And this the code I'm running on modal: &lt;/head&gt; &lt;body&gt; &lt;!-- Modal --&gt; &lt;div class="modal fade" id="basicModal" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Modal title&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;h3&gt;Modal Body&lt;/h3&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="container-fluid"&gt; &lt;%= yield %&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; And this is where I want it called from. And I think because I have an animation effect it might be screwing with the event. Note that this is the first thing within the yield: &lt;div class="container-fluid"&gt; &lt;div class="row"&gt;&lt;div class="col-md-12"&gt;&lt;h1&gt;Title&lt;/h1&gt;&lt;/div&gt; &lt;div class="row"&gt; &l…

http://stackoverflow.com/a/28932355
has body: In plain js (replace 'yourInputId'): var content = document.getElementById('yourInputId').value; In jQuery: var $content = $('#yourInputId').val(); Then, calculate your answer: var answer = Number(content)*0.8/2.5; ...
type: Answer
answers question: http://stackoverflow.com/q/28932293
score: 0

http://stackoverflow.com/comment/46306843
has text: I see, the script that caused me "problems" was just doing "forever stop script", git pull, then forever start with all parameters for log files.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29005911

http://stackoverflow.com/comment/46214950
type: QuestionComment
score: 0
has text: @murshid_Dev: https://github.com/matthewhudson/DEVICE.js you have everything here for most of known user agents, and if support for this library drops you can update yourself (client side).
comment on: http://stackoverflow.com/q/28982292
type: Comment

http://stackoverflow.com/a/40473683
answers question: http://stackoverflow.com/q/28936329
downvote count: 1
score: -1
upvote count: 0
has body: what does your index.js look like? try the following: Create index.js with the following content in the same folder: var bitcoin = { base58: require('bs58'), bitcoin: require('bitcoinjs-lib'), ecurve: require('ecurve'), BigInteger: require('bigi'), Buffer: require('buffer'), elliptic: require('elliptic'), bs58check: require('bs58check'), } module.exports = bitcoin; Then run: browserify index.js -s bitcoin | uglifyjs &gt; bitcoinjs.min.js
type: Answer

http://stackoverflow.com/q/29058476
has answer: http://stackoverflow.com/a/29058626
tagged with: cross-browser
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has title: Load advanced jQuery version on page ready
score: 1
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has body: My page is loaded with jQuery 1.4.4 On page ready I want to dynamically load jQuery 1.11.1 My question is: There is a way to load advanced version of jQuery (1.11.1) with current jQuery (1.4.4)? I've tried to use jQuery.getScript() in order to dynamically load JavaScript files and it worked fine, but the only file that didn't loaded is the jQuery 1.11.1 version I know how can I do it with native JavaScript code, but I want a cross browser solution so it have to be with using of the current jQuery (1.4.4).
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/q/28966967
linked to: http://stackoverflow.com/q/8893329
tagged with: algorithm
upvote count: 5
type: UnansweredQuestion
has title: Split polygon into multiple polygons based on grid (html5 canvas)
has comment: http://stackoverflow.com/comment/46217439
tagged with: split
tagged with: canvas
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46208391
favorite count: 0
type: Question
score: 5
tagged with: http://stackoverflow.com/tag/html
has body: I'm drawing polygons on a canvas with an underlying grid I want to split this polygon into multiple polygons now (based on the grid) So instead of 1 polygon, I get the coordinates for 4 polygons. Is there an easy solution for this I'm not thinking about? This is the code for my test canvas (codepen) &lt;script&gt; var bw = 200; var bh = 200; var p = 0; var cw = bw + (p*2) + 1; var ch = bh + (p*2) + 1; var grid = 50; var canvas = document.getElementById("canvas"); var context = canvas.getContext("2d"); function drawBoard(){ context.beginPath(); for (var x = 0; x &lt;= bw; x += grid){ context.moveTo(0.5 + x + p, p); context.lineTo(0.5 + x + p, bh + p); } for (var x = 0; x &lt;= bh; x += grid) { context.moveTo(p, 0.5 + x + p); context.lineTo(bw + p, 0.5 + x + p); } context.lineWidth = 1; context.strokeStyle = "black"; context.stroke(); } drawBoard(); // Polygon context.fillStyle = '#f00'; context.beginPath(); context.moveTo(0, 0); context.lineTo(100,50); context.lineTo(50, 100); context.lineTo(0, 90); context.closePath(); context.fill(); &lt;/script&gt;
has answer: http://stackoverflow.com/a/28968069
answer count: 2
has answer: http://stackoverflow.com/a/28984803
linked to: http://stackoverflow.com/q/3623703
has comment: http://stackoverflow.com/comment/46209218

http://stackoverflow.com/comment/46229604
has text: Yes, it did move to the centre now thankyou very much but would it be possible to move it just a bit to the left so it can be parallel to the heading?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28988517

http://stackoverflow.com/comment/46295816
score: 0
type: Comment
has text: I understand that, but that's not the issue here. What's happening is my partial is stored in the `shared` directory, and that partial is called from another partial in the `shared` directory. That partial was called with a local variable of `node: node`, but because I am passing the execution to a modal that is only fired when that above link is clicked, I have no way of passing that `node: node` to the partial that renders the pop-up/modal after the link is clicked. I hope that was more clear. If this were a standard view in a standard controller, your suggestion would work. But it's not :(
type: AnswerComment
comment on: http://stackoverflow.com/a/29026886

http://stackoverflow.com/q/28954331
type: Question
tagged with: html-table
has comment: http://stackoverflow.com/comment/46162471
tagged with: javascript
has answer: http://stackoverflow.com/a/28954922
accepted answer: http://stackoverflow.com/a/28954922
score: 0
answer count: 1
has title: Setting table column width in CSS (if necessary, JavaScript)
has body: Okay, I have changed from using JavaScript to CSS in aligning the column width. But for some reasons it still won't line up. I want every td in a fixed width percentage, and the thead with the same too. Eg. If you search "cherry" the width will change, but I want it to be fixed. shouldn't it be 40px all the time with the current code? fiddle Thank you very much. No. Name ad Tel Fax 12311 Apple A1fgsdfgfhynfg 1-11 1-22 12312 Banana A2dfgdfgdfgdfg 2-11 2-22 3Asdqwe Cherry A3 3-11 3-22 12314 Duriaen A456ghkfghk 4-11 4-22 12315 Apple A1uyjmghtd 5-11 5-22 12316 Banana A2yukmkfgmufc 6-11 6-22 3Asdqwe Cherry A3 7-11 7-22 123117 Duriaen A4nuftkｆ 8-11 8-22 123118 Duriaen A4 8-11 8-22 123119 Cherry Aoikdhpnko 7-11 7-22 4A Duriaen A4ueowrqp 8-11 8-22 12311 Duriaen A4zcnnzcxt 8-11 8-22 CSS #table-body, table.header tr> *:nth-child(1) {width:10px;} #table-body, table.header tr> *:nth-child(2) {width:10px;} #table-body, table.header tr> *:nth-child(3) {width:40px;} #table-body, table.header tr> *:nth-child(4) {width:20px;} #table-body, table.header tr> *:nth-child(5) {width:20px;}
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46162310

http://stackoverflow.com/a/29590980
score: 0
type: Answer
has body: OK Solution to your problem $('input[type=number]').each(function(){ var val = $(this).val(); $(this).attr('type','text'); $(this).val(val); }); above code will work on all inputs with type number. If you want to use only one use class or id in first line. If you want to count value from string like 1+1 u can use eval in try catch block. But this is generally a lot more complicated solution.
answers question: http://stackoverflow.com/q/29030685
has comment: http://stackoverflow.com/comment/47367963

http://stackoverflow.com/a/28967168
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28952047
has body: I figured out a different way to do it using file_get_contents. I must have not been to clear with my question as this was staring me in my face for awhile. &lt;?php header('Content-Type: text/html; charset=utf-8'); $homepage = file_get_contents('http://url/api.php?xm=server.getlogs&amp;f=json&amp;a[username]=pizzaman&amp;a[password]=PizzaPassword&amp;a[type]=error'); echo"&lt;pre&gt;". str_replace('\n', '&lt;br&gt;', $homepage) ."&lt;/pre&gt;"; ?&gt; This then takes all of the /n lines and turns them into line breaks, which makes everything look semi-pretty. Now I just need to figure out how to replace all of the /t with a blank space and I am all set. If anyone has a better solution, or a way to make it cleaner I am all ears! Thanks everyone.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28952047
type: Answer

http://stackoverflow.com/q/29004409
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46255385
has comment: http://stackoverflow.com/comment/46255441
has comment: http://stackoverflow.com/comment/46255336
type: Question
has title: How to disable the click event for the customized checkbox
tagged with: javascript
duplicate of: http://stackoverflow.com/q/18366366
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29004476
possible better answer: http://stackoverflow.com/a/29004605
has answer: http://stackoverflow.com/a/29004584
score: 0
has comment: http://stackoverflow.com/comment/46255481
answer count: 3
has comment: http://stackoverflow.com/comment/46255361
has body: I was trying to disable a customized checkbox using jquery once the class disabled is added. Below is my code what I tried so far. $('span').click(function(e){ $(this).toggleClass('active'); }); $('.disabled').click(function(e){ e.stopPropagation(); return false; }); CSS span{ width: 16px; height: 16px; display: inline-block; cursor: pointer; background-color: gray; } span.disabled{ cursor: not-allowed; } cite.fa-check{ font-size: 14px; color: #fff; margin-left: 1px; display: none; } span.active cite.fa-check{ display: inline-block; } My event should not worked if I add class disabled to my checkbox. Any help would be appreciated. Thanks in advance. Working Demo
has answer: http://stackoverflow.com/a/29004476
linked to: http://stackoverflow.com/q/18366366
tagged with: checkbox
has answer: http://stackoverflow.com/a/29004605
tagged with: css
has comment: http://stackoverflow.com/comment/46255284
has comment: http://stackoverflow.com/comment/46255287

http://stackoverflow.com/comment/46109814
type: Comment
has text: And be careful that your code is vulnerable to SQL injections. Use PDO or mysqli_* not mysql_* it is obsolete as of PHP 5.5
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28926462

http://stackoverflow.com/a/28970753
upvote count: 2
has comment: http://stackoverflow.com/comment/46211342
answers question: http://stackoverflow.com/q/28969327
has body: You can use subscribe from knockoutjs for the functionlaity you are looking for. Small demo of same function model(){ var self = this; self.pageIndex = ko.observable(5).extend({ rateLimit: 1500 }); self.pageIndex.subscribe(function(newValue) { alert(newValue); //Call here your ajax call //Subscribe will be called on every change of your PageIndex }); }; var mod = new model(); ko.applyBindings(mod); &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.1.0/knockout-min.js"&gt;&lt;/script&gt; &lt;input type="number" id="input_page_select" min="1" data-bind='value: pageIndex, valueUpdate: ["input", "keypress"]' /&gt;
has comment: http://stackoverflow.com/comment/46220611
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/q/29035913
has comment: http://stackoverflow.com/comment/46312631
answer count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46312630
has title: jQuery onclick function: Undefined is not a function
has answer: http://stackoverflow.com/a/29036024
tagged with: function
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46312573
type: Question
tagged with: undefined
favorite count: 0
score: 0
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/29036189
has comment: http://stackoverflow.com/comment/46312634
has answer: http://stackoverflow.com/a/29036656
has body: Edit: I guess part of this is an issue of me being inexperienced with Drupal. I added a javascript file to site.info, so that it will be added to every page. This is all the file contains: (function ($){ $("#ctl00_btnSearch001").on("click", function(){ var searchVal = $("#ctl00_txtSearch").val(); window.location.href = "http://www.mywebsite.org/search/?sa=Search&amp;q=" + searchVal; }); })(jQuery); When the site loads, it gets compiled into this larger script, which looks like this in the debugger: (function ($) { Drupal.behaviors.titlebar = { init: function(context, settings) { // Using percentage font size to easily increase/decrease page font size var baseFontSize = 100; $('.pgc-font-size a').click(function() { if($(this).hasClass('increase')) { if(baseFontSize &lt; 150) baseFontSize += 20; $('.pg-content-body p').css('font-size', baseFontSize+'%'); } else { if(baseFontSize &gt; 70) baseFontSize -= 10; $('.pg-content-body p').css('font-size', baseFontSize+'%'); } }); // Print button $('.pgc-print a').click(function() { window.print(); }) } }; }(jQuery)); // There's a problem with our jQuery loading before the ingested site's // jQuery which is causing jQuery plugins to break (the "once" plugin in this case). // I'm using this workaround for now jQuery(function() { Drupal.behaviors.titlebar.init(); });; (function ($) { Drupal.behaviors.giftTypes = { init: function() { // Gift details accordion $('.pg-gift-details .accordion-items').css('display', 'none'); $('.pg-gift-details .accordion-switch').click(function(){ if($(this).hasClass('open')) { $(this).find('span').removeClass('icon-arrow-up').addClass('icon-arrow-down'); $('.pg-gift-details .accordion-items').slideUp('slow'); $(this).html($(this).html().replace('Hide', 'Show More')); $(this).removeClass('open'); } else { $(this).find('span').removeClass('icon-arrow-down').addClass('icon-arrow-up'); $('.pg-gift-details .accordion-items').slideDown('slow'); $(this).html($(this).html().replace('Show More', 'Hide')); $…

http://stackoverflow.com/comment/46150058
score: 0
comment on: http://stackoverflow.com/q/28946179
type: Comment
type: QuestionComment
has text: So as you said i changed my request to this return $http({url: 'http://maps.googleapis.com/maps/api/geocode/json', method: "GET", data: { address: val, sensor: false }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' }}); Still getting pre-flight request

http://stackoverflow.com/comment/46597011
has text: i don't think your drawbacks for #1 are needed. even if the clocks are radically off, both still advance 1 per second, and lag is rarely over 1000ms. there's nothing that says you can't simply calc the # of seconds needed from the first code and then feed that to your 2nd code.
type: Comment
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/29112917

ipad
tags question: http://stackoverflow.com/q/29000589
tags question: http://stackoverflow.com/q/28961350
tags question: http://stackoverflow.com/q/29039286
tags question: http://stackoverflow.com/q/28916325
tags question: http://stackoverflow.com/q/28959573
tag name: ipad
type: Tag

http://stackoverflow.com/q/29003481
has answer: http://stackoverflow.com/a/29003917
has body: I make 2 iframe as below Fiddle : http://jsfiddle.net/ow0wy0jm/1/ The first one doesn't returned its responsive design, I wonder what's the problem. Then I tested with other site, the second one worked properly. If you resize http://www.caely.my which is the first site, it's acutally a respnsive site. How come in iframe it render desktop version instead?
type: UnansweredQuestion
tagged with: iframe
tagged with: css
has title: embed iframe doesn't returned responsive design?
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28965095
answers question: http://stackoverflow.com/q/28960046
has comment: http://stackoverflow.com/comment/46214395
upvote count: 1
has comment: http://stackoverflow.com/comment/46818779
has comment: http://stackoverflow.com/comment/46803850
score: 1
downvote count: 0
has body: Not sure I understand what you're trying to do, but you can influence whether the menu closes when you click outside of the menu like this: kendo.ui.ContextMenu.fn._closeHandler = function (closeHandler) { return function(e) { var clickInMenu = $.contains(this.element[0], e.target); if (clickInMenu) { // click outside will do nothing closeHandler.call(this, e); } } }(kendo.ui.ContextMenu.fn._closeHandler); var contextMenu =$("#context-menu").kendoContextMenu({ target: "#target" }); (demo)
type: Answer
has comment: http://stackoverflow.com/comment/46211981

http://stackoverflow.com/comment/46339988
has text: Hi Alvaro, When opened on an Iphone it expands beyond the screen so you cannot see the form in a readable fashion. It opens find but beyond the screen width. Does that help?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29035188
score: 0

http://stackoverflow.com/q/29041214
linked to: http://stackoverflow.com/q/10525729
answer count: 0
has title: d3.js or javascript version of Raphael.js isPointInside method
has comment: http://stackoverflow.com/comment/46324660
type: Question
has comment: http://stackoverflow.com/comment/46324252
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
type: UnansweredQuestion
tagged with: path
has body: I'm doing a D3 project where I need to find if a point is inside a closed svg path element. I found this post which would be helpful if I were using Raphael, but I'm not. Is there an equivalent method in javascript or d3.js I can use? ex: http://raphaeljs.com/reference.html#Element.isPointInside

http://stackoverflow.com/comment/46310637
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29020488
has text: Yeah, innerHTML did not work with the form element "textarea", instead value was the right property to use, in this case.
score: 0

http://stackoverflow.com/q/29039786
tagged with: javascript
has answer: http://stackoverflow.com/a/29040018
answer count: 2
has comment: http://stackoverflow.com/comment/46320244
downvote count: 0
favorite count: 0
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
has body: As titled, how do I trigger an onmouseover event on element in javascript? please refer to Code Snippet. Instead of hovering over the big box, can I click on the small black box and execute the onmouseover event? The goal is NOT to turn the box blue but TRIGGER the onmouseover event. And also I need this to be done with only JavaScript, no Jquery please. function showBlue() { document.getElementById('xyz').style.background = "#425dff"; } function showRed() { document.getElementById('xyz').style.background = "#e2e2e2"; } #abc{width: 50px; height: 50px; background: #000000; color:#ffffff; cursor: pointer;} #xyz{width: 200px; height: 200px; background: #e2e2e2;} click me I tried this but did not work for me :(
tagged with: css
linked to: http://stackoverflow.com/q/2490825
accepted answer: http://stackoverflow.com/a/29040018
has title: how to trigger an onmouseover event on element in javascript?
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29039998
tagged with: onmouseover
duplicate of: http://stackoverflow.com/q/2490825
tagged with: triggers
possible better answer: http://stackoverflow.com/a/29039998
type: Question
has comment: http://stackoverflow.com/comment/46320240

http://stackoverflow.com/a/29027933
has comment: http://stackoverflow.com/comment/46378978
has body: Unlike C and other compiled languages, Javascript runs in a container - a program that reads your js codes and runs them. This program must do two things parse your code and convert it to runnable commands provide some objects to javascript so that it can interact with the outside world. The first part is called Engine and the second is Runtime. For example, the Chrome Browser and node.js use the same Engine - V8, but their Runtimes are different: in Chrome you have the window, DOM objects etc, while node gives you require, Buffers and processes.
upvote count: 191
type: Answer
answers question: http://stackoverflow.com/q/29027845
has comment: http://stackoverflow.com/comment/138640483
has comment: http://stackoverflow.com/comment/57844121
downvote count: 0
has comment: http://stackoverflow.com/comment/64914987
score: 191
has comment: http://stackoverflow.com/comment/131929985

http://stackoverflow.com/comment/46144548
comment on: http://stackoverflow.com/a/28939794
has text: I'm completely not following what you're asking. In your code you're adding the tilelayer separately in the index.html, the voronio gets added seperately in the voronoiMap method. They are seperated? I must be really overlooking something here or completely misunderstanding what you want.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29043312
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29043519
upvote count: 0
favorite count: 0
has body: i have problem with this function if i click in a simple link this function is call but i need to call him just for previous/next button in navigator or button in keyboard $(window).on("popstate", function() { alert('ok'); }); Thanks
has title: Popstate history and link
type: Question
score: -1
answer count: 1
downvote count: 1
tagged with: javascript

http://stackoverflow.com/q/29003527
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29003923
type: Question
has title: How to write columns and rows using .map and for loop
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29003923
tagged with: javascript
has body: I've been trying to solve this all day. It's an exercise for a programming course, but I seem unable to solve it. It's pretty beginner but I would still appreciate any help. http://repl.it/dfl/1 Basically the exercise is this: create a function called clearBoard() This function will go through every cell in checkerboard and set that cell's value to null. we've been using for loops and .map so that's basically the tools we should use to solve this. I am kind of lost, so I created a function to see how to write on the columns and how to write on the rows. I can't seem to write on both. I see that my for loop isn't working, and I don't know why. I think I'm doing everything right. The only thing that works is the .map iterator but it doesn't do rows and columns.

http://stackoverflow.com/comment/46076020
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28908210
has text: Yes it is, adding my code now
score: 0

http://stackoverflow.com/comment/46301156
type: AnswerComment
comment on: http://stackoverflow.com/a/29029879
type: Comment
score: 1
has text: There's no class named '.content-wrap' in your html, can you please re-check your html code?

http://stackoverflow.com/comment/46122067
score: 2
comment on: http://stackoverflow.com/q/28933021
type: Comment
type: QuestionComment
has text: `R.last(fib_Arr,2)`? I don't see the docs mentioning that `last` takes a second argument.

http://stackoverflow.com/q/28955925
has title: How to find the location of an error when line numbers cannot be used
has body: I am finding it difficult to locate where an error occurs in javascript on a client I have no access to. Currently I trap the error with onerror and send the arguments to a log on the server. Unfortunately the line number is no help because numerous javascript files get included, causing the line number to not correspond to anything I have access to. So if I get something like "n is not defined", and n occurs many times in the function, I have no way to locate where it happened. I have been trying to reference the code on the line throwing the error say "x=n * 5 + 4", then I could search for that code, but have had no luck referencing the actual code on a line from within javascript. So how does one locate the line that threw the error in this situation? client uses firefox only, if that matters. I have no access to client This is not one error I am stuck on, but working on how to track an error in this situation
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28956055
has comment: http://stackoverflow.com/comment/46165159
tagged with: debugging
downvote count: 0
has comment: http://stackoverflow.com/comment/46165087
tagged with: javascript
type: UnansweredQuestion
favorite count: 0
tagged with: onerror
type: Question
score: 1
has answer: http://stackoverflow.com/a/28956037

http://stackoverflow.com/comment/46262910
type: Comment
comment on: http://stackoverflow.com/a/29006514
has text: Thanks alot Oleg. Issue was with id's only. For default values ,I used value like value:{"Select City":"Select City"} and initialized the chosen in dataInit .Earlier I was also creating options (for default values) in dataInit.and then on employee autocpmplete's select event I populated other options dynamically and called chosen:updated. By this time ,id was already created, so it didn't create any problem.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46147170
has text: Seems like there could possibly be an error with the directory?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28946237
type: Comment

http://stackoverflow.com/a/77933671
has body: If anyone looking for a answer in 2024 You Can get the testResults from the runner like this runner.testResults const Mocha = require("mocha"); const { readFileSync } = require("fs"); const mocha = new Mocha({ reporter: "json", }); mocha.addFile("./test/index.test.js"); runner = mocha.run(); runner.on("end", function () { console.log(runner.testResults); console.log("All done"); // Send you mail here });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29050720

http://stackoverflow.com/comment/46257332
type: QuestionComment
comment on: http://stackoverflow.com/q/29004431
has text: It's 100% legal, be sure. And i can't use an anchor, because when i clicking it, i just get redirected to a picture that need to be clicked once again to be delivered to target site :\
score: 0
type: Comment

http://stackoverflow.com/a/29017574
score: 7
upvote count: 7
has body: you can use CSS transition property rather than doing vai timer in javascript. thats more performance oriented compared to what you are doing. check http://fvsch.com/code/transition-fade/test5.html#test3
has comment: http://stackoverflow.com/comment/46279172
downvote count: 0
has comment: http://stackoverflow.com/comment/46280405
type: Answer
answers question: http://stackoverflow.com/q/29017379

http://stackoverflow.com/comment/46171451
type: Comment
comment on: http://stackoverflow.com/q/28959416
score: 0
type: QuestionComment
has text: by last td you mean the last column or the last cell?

http://stackoverflow.com/a/29040575
accepted answer of: http://stackoverflow.com/q/29040497
upvote count: 3
answers question: http://stackoverflow.com/q/29040497
has body: When calling a function as an argument, don't use parentheses. setInterval(changeImages, 3000); Demo If you did need to pass arguments in the function call, wrap it in an anonymous function: setInterval(function() { var myArg; changeImages(myArg); }, 3000); Demo
type: Answer
score: 3
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/46141981
type: Comment
has text: Thats still not working :( It doesnt throw an error but it doesnt set the value of count.
comment on: http://stackoverflow.com/a/28943712
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46164443
type: QuestionComment
comment on: http://stackoverflow.com/q/28955547
score: 0
has text: Yes I know it doesn't, it's not suppose to be there actually. Hehe, because the login() in the submit input will grab the file that is needed to execute the action. It doesn't do anything even when it is there, just forgot to remove it.
type: Comment

http://stackoverflow.com/q/28991127
type: Question
has comment: http://stackoverflow.com/comment/46230484
has answer: http://stackoverflow.com/a/28991222
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46230518
has answer: http://stackoverflow.com/a/28991300
upvote count: 3
answer count: 3
has body: I am trying to create a dynamic hyperlink that will download an image retrieved from the server. The code I am using: HTML: Save & Download JS: this.downloadJPEGClickHandler = function() { CollageCore.downloadJPEG(function(data){ $("#controlDownloadJPEG").attr("href", "../file/fileStore.action?fileName=/" + data[0].AttachmentUrl); });; return true; }; The href is getting changed on click, but the link itself is linking to the href set before my JavaScript executes. The first click does nothing as there is no default href and the second click will download what the first click should have downloaded. I have seen suggestions to use JavaScript window.href instead of relying on the html tag itself. The reason I need to use the html tag is for its download functionality.
has title: how to change href during onclick event
has comment: http://stackoverflow.com/comment/46230673
has comment: http://stackoverflow.com/comment/46230497
accepted answer: http://stackoverflow.com/a/28991300
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28991247
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/28991247

http://stackoverflow.com/comment/46165233
has text: worked great thanks - I combined it with setTimeout to make it run every 5 seconds!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28948748

http://stackoverflow.com/comment/46309697
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29033635
has text: I believe that I have interpreted your question correctly. See my answer below. Also, your example data is not valid JavaScript and you cannot reference variables by name.

http://stackoverflow.com/comment/46098031
has text: Oh wow defining the variable fixed it, that was probably the problem this whole time and was looking else where. Thanks you very much.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28920284

http://stackoverflow.com/q/29022961
tagged with: mongodb
tagged with: javascript
has body: I have three Collections: UserCollection, DepartmentCollection and QuestionsCollection QuestionsCollection is a configurable list of questions. Users and Departments each answer a survey generated from QuestionsCollection and as a result each have an embedded array of questionAnswer objects with each object having a questionid and an answer property. An example User document from the UserCollection would be: { id:SoEtnNvN8B3QYcd3N, questionAnswers:[ { questionId: 1, answer: "melbourne" }, { questionId: 2, answer: "10"}] } } A department would have the same embedded array but could contain more or less questionAnswer objects. With different or same answers of course. The problem: What i'd like to do is be able to get a single Users questionAnswers array as the search criteria, and see how many departments match those questionAnswers. The matching would match on both properties, and a user must answer the same questions a department has answered in order to match e.g. If the department has answered more questions than the user it's automatically not a match. If the user and department have answered the same number of questions then all questionAnswer values should match. If a user has answered more questions than a department, then all the departments questionAnswers must be contained within the users questionAnswers. The answers would be exact matches, though I might need a mechanism for ranged searches at some point. I've looked into maybe building a query using the users questionAnswers array and using $elemMatch to search on the DepartmentCollection, but I'm not sure how to implement this. Any help or direction would be appreciated.
upvote count: 1
answer count: 1
tagged with: meteor
favorite count: 0
type: UnansweredQuestion
has title: Meteor comparing embedded arrays in collections
tagged with: node.js
tagged with: mongodb-query
has answer: http://stackoverflow.com/a/29024659
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/q/29061293
has comment: http://stackoverflow.com/comment/46379366
linked to: http://stackoverflow.com/q/9424550
score: 0
has body: I'm trying to write an extension that takes text typed by user in real time. I've succeeded to take text from textarea etc in web pages. but not from composed mail area in gmail, I believe that the main problem is that the composed mail box appears only after clicking on the 'compose' button. This is my code: $( document ).ready( function() { $('div, input, textarea, html, iframe').focus( function() { $(this).keyup(function(){ var text = $(this).val(); console.log("text: " + text ); }); }); }); Can someone help me understand how to manage in taking the text from the composed message body?
tagged with: google-chrome-extension
answer count: 1
has comment: http://stackoverflow.com/comment/46360774
tagged with: jquery
has answer: http://stackoverflow.com/a/29096676
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: gmail
has title: Chrome extension - Getting text typed by user while composing mail
linked to: http://stackoverflow.com/q/8110934
type: Question
tagged with: javascript

http://stackoverflow.com/comment/46156145
comment on: http://stackoverflow.com/q/28950071
has text: Try the code: `Message 1` `Message 2`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28996787
score: 0
has body: One thing you can do is... var text = escape($(this).find('textarea[id*=&lt;%=txtText.ClientID%&gt;]').val()); Performance difference is negligible, even so I just usually do a view source, find w/e asp.net is calling it and use that. The above approach is fool proof however as far as I know.
answers question: http://stackoverflow.com/q/28996517
type: Answer

http://stackoverflow.com/q/29040189
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29043639
tagged with: keyup
has body: I'm using Backbone.js. In my view, I have a textarea whose keyup is bound to a function like this (but see edit below): this.model.save({text: self.$('textarea').val()}, {patch: true}); In the view's initialize function, I bind the model's change event to the view's render function: initialize: function() { this.listenTo(this.model, 'change', _.bind(this.render, this)); }, Trouble is, when the user types in the textarea, the following sequence of events occurs: The keyup event fires. The keyup handler calls save on the model. The call to save triggers the model's model's change event. The view, listening for the model's change event, calls render. The textarea is replaced in the DOM. The textarea is no longer focused, and the text cursor position is lost. What is the best practice for situations like this, where a texarea's keyup event needs to trigger a sync? Some options I have considered: Don't bind change to render. Disadvantage: If the model data changes due to anything other than the user typing, the textarea doesn't automatically update. Read and remember the cursor position at the beginning of render. Set the cursor position at the end of render. Disadvantage: Depends on cursor manipulation features for which browser support is spotty. In the keyup handler, set a temporary property on the view telling it not to re-render. Unset it after the model has been saved. Disadvantage: Feels like spaghetti code, fights against the structure of Backbone. Are there any options I'm not seeing? Do you recommend one of the options above? Edit: I didn't want to distract from the main point, but since it came up in one of the answers: I'm not binding directly to keyup, but intermediating it with _.debounce. Thus, the event handler only runs once the user stops typing, as defined by a certain amount of time elapsing since the last keyup.
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29043639
score: 1
favorite count: 0
tagged with: backbone.js
has title: Best practice to maintain cursor position when keyup triggers save
upvote count: 1

http://stackoverflow.com/q/29035895
has answer: http://stackoverflow.com/a/32395511
type: Question
tagged with: firefox
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: hammer.js
tagged with: http://stackoverflow.com/tag/html
has body: I am using Hammer to detect a pinch on an HTML5 page and direct it to an SVG image for zooming. The SVG image is in its own div and the Hammer pinch detection is attached to that div. This works fine on the latest versions of IE, Safari (mobile and desktop), Opera and Chrome but not on Firefox. On Firefox, the pinch is not detected by Hammer and thus is not directed to the SVG element. It instead zooms other items on the page. I am also using Hammer to detect a pan action (again on the SVG) and this works properly on all browsers including Firefox. So I think I am just missing some Firefox directive to prevent it from capturing the pinch event before Hammer sees it. I do notice however that it doesn't work using Firefox on the Hammer touch test page so maybe it is a Firefox fix I need to wait for.
favorite count: 0
has title: Using Hammer Pinch in Firefox directed wrongly - works in all other browsers
type: UnansweredQuestion
upvote count: 1
score: 1
tagged with: pinch

http://stackoverflow.com/comment/46165451
type: Comment
comment on: http://stackoverflow.com/a/28942061
has text: I just get this status 304 message for jquery but papa parse doesnt seem to work. Is there any way i can post my code so you can see what messes up things?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46304506
type: AnswerComment
type: Comment
has text: Nevermind. Works. Thank you
comment on: http://stackoverflow.com/a/29031033
score: 0

http://stackoverflow.com/comment/46300241
type: AnswerComment
score: 0
type: Comment
has text: Could you enlighten me with the statement "in case you would be using Angular 1.3, it would be better not to use the $scope for this but instead use the 'Controller as vm' syntax"? :)
comment on: http://stackoverflow.com/a/29028104

http://stackoverflow.com/comment/46265379
type: QuestionComment
has text: Beware that [`showModalDialog` is being permanently removed from Chrome.](http://blog.chromium.org/2014/07/disabling-showmodaldialog.html) You should rework your code to avoid it.
score: 0
comment on: http://stackoverflow.com/q/29010011
type: Comment

http://stackoverflow.com/comment/46194158
type: Comment
comment on: http://stackoverflow.com/a/28971213
type: AnswerComment
has text: Server knows what the user selected on client - the value gets posted back. What the server does not know is that ddlStatus was made visible on client - it is returned back hidden again.
score: 0

http://stackoverflow.com/a/28964730
score: 1
has comment: http://stackoverflow.com/comment/46182224
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28963959
has body: I noticed you tagged this question meteor. Meteor uses Fibers on the server. This package gives you co-operative multitasking using a sort of lightweight thread (called a fiber). This allows you to write "blocking" functions like your requesting without actually blocking the event loop. Future lets you use callback-based node.js functions in a blocking way using Fibers. Without Fibers, it is impossible to write a function like your requesting which does I/O and returns the result directly. Instead you'd have to pass a callback (or use promises). Idiomatic Meteor code should make use of Fibers on the server to make "blocking" functions. This is how the core Meteor APIs work, and is necessary inside Meteor methods. Rather than using future, you might find Meteor.wrapAsync more convenient. In regular node.js code you could use Fibers, but it's more common to use function (err, result) {...} callbacks or promises. In the browser (including Meteor client code) you can't use Fibers, so you have to use callbacks or promises. Here's how you would sequence operations using future, regular callbacks and promises: // Future function doTwoThings() { var future = new Future(); asyncFunction(argument, function (err, result) { if (err) future.throw(err); else future.return(result); }); var result = future.wait(); var future2 = new Future(); anotherAsyncFunction(result, function (err, result2) { if (err) future2.throw(err); else future2.return(result2); }); var result2 = future2.wait(); return result2 + 2; } // wrapAsync var wrappedAsyncFunction = Meteor.wrapAsync(asyncFunction); var wrappedAnotherAsyncFunction = Meteor.wrapAsync(anotherAsyncFunction); function doTwoThings() { var result = wrappedAsyncFunction(argument); var result2 = wrappedAnotherAsyncFunction(anotherAsyncFunction); return result2 + 2; } // Regular callbacks function doTwoThings(callback) { asyncFunction(argument, function (err, result) { if (err) return callback(err); anotherAsyncFunction(result, function (err, …
answers question: http://stackoverflow.com/q/28963959

http://stackoverflow.com/comment/46220281
comment on: http://stackoverflow.com/a/28985400
type: AnswerComment
score: 1
has text: you need to fetch data from the jason object with .each function . follow the link i attached
type: Comment

http://stackoverflow.com/comment/46294792
type: Comment
comment on: http://stackoverflow.com/a/29026386
has text: which goes back to, why make a control `readonly` and then use a directive to get outside angular and capture the change to the element from jquery? Obviously the element is meant to be changed......
score: 0
type: AnswerComment

http://stackoverflow.com/q/28948629
answer count: 1
has body: I am using angularjs with the angular-ui library (specially the angular-ui-bootstrap one). How can I delay a modal from closing? After the user clicks on the x, or Cancel button, I need the modal to stay visible for an extra half second, but I haven't found a way to do it. I was thinking to add some timeout in the callback function that is passed into the then function of the modal instance, such as: modalInstance.result.then(function success(){ // timeout .5 second }, function cancel() { // timeout .5 second }); but the code in the callback functions is actually run after the modal has been close. Is there a way to do this?
has comment: http://stackoverflow.com/comment/46173210
tagged with: javascript
tagged with: angular-ui-bootstrap
has title: Delay angular-ui modal from closing
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/28948794
downvote count: 0
tagged with: angular-ui
favorite count: 0
tagged with: angularjs
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/46151453
has answer: http://stackoverflow.com/a/28948794

http://stackoverflow.com/a/28927878
answers question: http://stackoverflow.com/q/28927649
has comment: http://stackoverflow.com/comment/46111999
has body: If you have an jQuery Ajax call (you need to fill it up your self). This is just an elementary (basic) Ajax call: function fnGetNewTextForInfoWindow(infoWindow){ var infoWnd = infoWindow $.ajax( "example.php" ) .done(function(data) { var newText = data; //data from the jQuery ajax call infoWnd.setContent(newText); //set the content infoWnd.open(map, marker, newText); }) } To invoke your call replace these lines: var newText = fnGetNewTextForInfoWindow(); infoWnd.setContent(newText); With fnGetNewTextForInfoWindow(infoWnd); This works by sending the object infoWnd to the fnGetNewTextForInfoWindow function. We set up the Ajax call in the same scope, so we can reuse the infoWnd object in the done method.
has comment: http://stackoverflow.com/comment/46113233
score: 0
has comment: http://stackoverflow.com/comment/46111903
has comment: http://stackoverflow.com/comment/46119900
has comment: http://stackoverflow.com/comment/46112867
type: Answer

http://stackoverflow.com/comment/46284388
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29020227
has text: I've tried that and it's still not working unfortunately. I'm not sure whether there's another error or something conflicting with it?

http://stackoverflow.com/q/28945549
score: 0
possible better answer: http://stackoverflow.com/a/28945986
answer count: 2
has comment: http://stackoverflow.com/comment/46145982
has title: ng-click in template not firing
tagged with: angularjs
has body: I am having no luck figuring out why the ng-click isn't calling the function. I am compiling the angular template. I know I have an isolated scope, but the function That should be called is on the scope of the directive... JSFiddle HTML: Name AngularJS(v1.28): angular.module("myMod", []). controller("myController", function ($scope) { $scope.data = [ { 'name' : 'testA', 'isAdmin': true}, { 'name' : 'testB', 'isAdmin': false}, { 'name' : 'testC', 'isAdmin': false}, ]; }).directive("myElement",function($compile){ var myTest = function(){ console.log("table cell clicked!"); }; var getTemplate = function(person){ return ' {{person.name}} test2 '; }; return { restrict : 'A', scope : { person : "=" }, link : function (scope,element,attrs){ var template = getTemplate(scope.person); element.html(template); $compile(element.contents())(scope); } }; });
has answer: http://stackoverflow.com/a/28945933
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46145930
type: Question
has answer: http://stackoverflow.com/a/28945986
accepted answer: http://stackoverflow.com/a/28945933
tagged with: javascript
has comment: http://stackoverflow.com/comment/46145837

http://stackoverflow.com/comment/46211734
type: QuestionComment
has text: I read it .It say it will return array or null but my question is why array consist two values instead of one ?
comment on: http://stackoverflow.com/q/28980963
score: 0
type: Comment

http://stackoverflow.com/comment/46174426
score: 0
has text: Every ISP Host has a specific IP range. So it is easy to check if your IP is in a specific range. There are maybe [some lists in the internet](http://serverfault.com/questions/151122/finding-all-ip-ranges-belonging-to-a-specific-isp).
type: QuestionComment
comment on: http://stackoverflow.com/q/28960827
type: Comment

http://stackoverflow.com/comment/46080337
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28910711
has text: I would recommend you read up on [CSS classes](https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors) and use those instead of inline styles like you have now.
score: 0

http://stackoverflow.com/a/76082592
answers question: http://stackoverflow.com/q/28992406
score: 0
has body: Turn on your microphone in Device Manager. Make sure have any available mic in system.
type: Answer

http://stackoverflow.com/a/28930206
has comment: http://stackoverflow.com/comment/46133245
accepted answer of: http://stackoverflow.com/q/28927572
has comment: http://stackoverflow.com/comment/46129289
score: 18
upvote count: 18
has comment: http://stackoverflow.com/comment/110077248
has comment: http://stackoverflow.com/comment/136957588
has body: When you select multiple objects on the canvas, it essentially behaves like a Fabricjs Group. You can disable scaling for a group using lockScalingX and lockScalingY properties. Now to access this group formed on selection, you can use the canvas selection:created event. Below is the sample code: canvas.on('selection:created',function(ev){ ev.target.set({ lockScalingX: true, lockScalingY: true }); }); Above code disables scaling specifically for groups formed on user selection and not the groups that might have been added to the canvas by you. If you want to disable scaling globally for any group, then you can do that in following way: fabric.Group.prototype.lockScalingX = true; fabric.Group.prototype.lockScalingY = true; You can find a working fiddle here: http://jsfiddle.net/n9z58nuk/2/
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28927572
type: Answer

http://stackoverflow.com/a/28930223
has body: I realize your client cannot afford a standard HTTPS certificate, but honestly, even a free SSL certificate is likely to be far better than what ever you can concoct here. In this situation, all you are doing is making the browser-side hash the user's password, and all one has to do to get in is send a matching hash. If you decide to do this, you definitely need to hash the password again on the server side, but it is still no replacement for SSL. More on it here: https://crackstation.net/hashing-security.htm
answers question: http://stackoverflow.com/q/28930222
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/28937130
accepted answer of: http://stackoverflow.com/q/28937069
downvote count: 0
type: AcceptedAnswer
score: 1
type: Answer
upvote count: 1
has body: You can use var newString=yourstring.replace(/[$,]/g, "");
answers question: http://stackoverflow.com/q/28937069

http://stackoverflow.com/q/28976475
has comment: http://stackoverflow.com/comment/46270040
tagged with: javascript
type: UnansweredQuestion
has body: I have a bunch of sections in my fullpage js continuous scroll. By default, I only want the user to scroll through a select few. However, upon clicking a link, I want an additional section to be appended and navigated to. I tried using jquery append; however, it doesn't seem possible afterLoad.
answer count: 0
has comment: http://stackoverflow.com/comment/46219321
tagged with: jquery
type: Question
tagged with: fullpage.js
score: 0
has title: append section when link is clicked - fullpage.js

http://stackoverflow.com/a/28983664
upvote count: 5
score: 4
has comment: http://stackoverflow.com/comment/46216333
answers question: http://stackoverflow.com/q/28983424
downvote count: 1
type: Answer
has body: check $q on angular: function outerFunction() { var defer = $q.defer(); var promises = []; function lastTask(){ writeSome('finish').then( function(){ defer.resolve(); }); } angular.forEach( $scope.testArray, function(value){ promises.push(writeSome(value)); }); $q.all(promises).then(lastTask); return defer; }

http://stackoverflow.com/a/28998514
upvote count: 5
type: Answer
downvote count: 0
score: 5
has comment: http://stackoverflow.com/comment/46245860
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28997769
has body: You need to create SVG elements via SvgElement.tag and not Element.tag At the moment you're creating a HTML element with a tag name of g rather than an SVG &lt;g&gt; element.
answers question: http://stackoverflow.com/q/28997769

http://stackoverflow.com/comment/46093242
type: Comment
has text: Now if I want to add extra data to formData like textbox value, how can I achieve it. just post it as comment. don't edit your answer..
score: 0
comment on: http://stackoverflow.com/a/28917581
type: AnswerComment

http://stackoverflow.com/a/29012711
score: 3
has comment: http://stackoverflow.com/comment/46291706
downvote count: 0
has body: If you want fallback to be downloaded when your external file is not available, you can use path fallback configuration in requireJS. Set your path configuration like following. require.config({ paths: { lodash: '/embed/lodash', utils: '/embed/utils', analytics: ['/external/analytics', '/embed/analytics' ] } }); Then create a file analytics.js in embed directory which gives you the object normally returned by analytics from outside. If external/analytics adds a object in the global namespace, do that as well. embed/analytics.js define(function(){ var analytics = window.analytics = { send : function(){ //Nothing to do here. } //,... //Add more methods used by your code like send } return analytics; });
answers question: http://stackoverflow.com/q/29000153
type: Answer
has comment: http://stackoverflow.com/comment/46291730
has comment: http://stackoverflow.com/comment/46291722
upvote count: 3

http://stackoverflow.com/a/29054431
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29054416
has comment: http://stackoverflow.com/comment/46346584
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29054416
score: 1
has body: JavaScript's concatenation operator is a + brightRoom('bedroom'); function brightRoom(room) { // of course console.log("bright " + room); works document.write("bright " + room); } It results in undefined because the JavaScript engine thinks that you are trying to find a property of the string called room which of course does not exist. When you try to access a non existent property of an object undefined is returned

http://stackoverflow.com/comment/46363496
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29054281
type: Comment
has text: @Legends While I was reading your comment my head was about to explode!! hahaha ;) Ok, you're welcome

http://stackoverflow.com/q/29011712
answer count: 0
type: Question
linked to: http://stackoverflow.com/q/3404057
tagged with: javascript
duplicate of: http://stackoverflow.com/q/3404057
linked to: http://stackoverflow.com/q/4602141
score: 0
has title: JS - Override console.log to show "object: object" of logged object?
has comment: http://stackoverflow.com/comment/46268508
has comment: http://stackoverflow.com/comment/46268639
linked to: http://stackoverflow.com/q/9795773
has comment: http://stackoverflow.com/comment/46268588
type: UnansweredQuestion
has body: How can I override the log method of the console object in order to turn this: //objectXYZ: {prop: 1} console.log(objectXYZ); ==&gt; {prop: 1} Into this: //objectXYZ: {prop: 1} console.log(objectXYZ); ==&gt; objectXYZ: {prop: 1} So I could save time and instead of typing console.log("object: ",object);, I would only type console.log(object); Any ideas?
tagged with: console.log
has comment: http://stackoverflow.com/comment/46268573

http://stackoverflow.com/comment/46291931
type: Comment
has text: Maybe it's some browser issue... I notice you are missing ... tags around your whole code
comment on: http://stackoverflow.com/a/29024021
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46197238
score: 0
has text: Your first 2 lines with **escape_javascript** are missing matching closing parenthesis.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28972935

http://stackoverflow.com/a/29055878
type: Answer
has comment: http://stackoverflow.com/comment/46349228
answers question: http://stackoverflow.com/q/29055752
upvote count: 3
has body: Assuming you're actually trying to click a link that doesn't navigate to another page (what you asked, I suppose), you would probably use jQuery: var variableToCancelInterval = setInterval(function(){ $("a.linkclass").click(); }, 5000);
downvote count: 0
has comment: http://stackoverflow.com/comment/46406934
has comment: http://stackoverflow.com/comment/46349044
score: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46414854
has comment: http://stackoverflow.com/comment/46365199
has comment: http://stackoverflow.com/comment/46891335
has comment: http://stackoverflow.com/comment/46952084
has comment: http://stackoverflow.com/comment/47019578
has comment: http://stackoverflow.com/comment/46890393
has comment: http://stackoverflow.com/comment/46965729
accepted answer of: http://stackoverflow.com/q/29055752

http://stackoverflow.com/comment/46220978
type: AnswerComment
has text: I rest my case for this one - it is dfficult with no updated code from star_tasneem - good luck with the troubleshooting. :-)
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28982096

http://stackoverflow.com/comment/46098146
has text: Thanks. I changed the conditional to `if( month != undefined )` it still does not throw the exception `"No month provided"`. Why?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28920333

http://stackoverflow.com/comment/46248742
type: QuestionComment
comment on: http://stackoverflow.com/q/29000364
has text: @Barmar the vectors are just the positions of the sprites. So I think having 5 rows of 5 would be better then 2 in the last row. But I'm having trouble coming up with any thing so If I need to change things to get a solution that's cool
score: 0
type: Comment

http://stackoverflow.com/comment/46123549
comment on: http://stackoverflow.com/a/28933866
has text: I'm still getting "Undefined is not a function". Sorry, but thanks for the input!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28949684
has body: I think you should use the DOMelement for this. Assuming you're using jQuery you could try something like this: var videoDom = $('&lt;video width="320" height="240" autoplay&gt;&lt;source src="movie.mp4" type="video/mp4"&gt;&lt;/video&gt;').appendTo(document.body)[0]; var cjsVideo = new createjs.DOMElement(videoDom); stage.addChild(cjsVideo);
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/28927434
score: 3
downvote count: 0

http://stackoverflow.com/q/29061937
tagged with: bignum
has body: I know JavaScript numbers are just "double" numbers and have only 52bit precisions for the fraction part. However, the REAL JavaScript numbers seem to have more practical precisions for huge numbers. For example, the predefined constant Number.MAX_VALUE represents the largest positive finite value of the Number type, which is approximately 1.7976931348623157e+308. Here I can access trailing digits of this value using a modulus operator. &gt; Number.MAX_VALUE 1.7976931348623157e+308 &gt; Number.MAX_VALUE % 10000000000 4124858368 From this result I can assume that this number is 7fef ffff ffff ffff which represents (1 + (1 − 2 ** −52)) × 2 ** 1023 (Wikipedia) and can be transcribed in an exact form as following: 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368 ...and we only saw trailing 10 digits of this 309 digits. So I think each JavaScript number must have exact digits in the decimal form. My question is: how to get this 309 digits string in JavaScript? Challenges like Number.MAX_VALUE / 10000000000 % 10000000000 just fails because of such hugeness. Furthermore, how about tiny numbers such as Number.MIN_VALUE? This must be the following fraction in the decimal form. 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000049406564584124654417656879286822137236505980261432476442558568250067550727020875186529983636163599237979656469544571773092665671035593979639877479601078187812630071319031140452784581716784898210368871863605699873072305000638740…
favorite count: 0
downvote count: 0
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/46360142
has comment: http://stackoverflow.com/comment/46360187
type: Question
answer count: 2
has title: How can I get exact value string of huge numbers in JavaScript?
upvote count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29062879
has answer: http://stackoverflow.com/a/29062877

http://stackoverflow.com/a/28918135
type: Answer
has comment: http://stackoverflow.com/comment/46097491
answers question: http://stackoverflow.com/q/28916275
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28916275
type: AcceptedAnswer
downvote count: 0
has body: If your aim is to draw historic lines or shapes, best would be to use QGIS, load STRM for the topography as a background for reference, then draw the borders as shp vector lines or polygons. One year (date) as one layer, each layer of the .shp will then give an object in the topojson, itself containing an array of objects (line or polygon). Shapefile being the format of reference for geographic data, it's a good idea to store your raw data as shp. From there you will always have tools to convert data out.
has comment: http://stackoverflow.com/comment/46096728

http://stackoverflow.com/comment/46318851
type: QuestionComment
comment on: http://stackoverflow.com/q/29039094
score: 4
has text: Remove the "javascript" from the onclick: `onclick="BeginSort(0);"`
type: Comment

http://stackoverflow.com/a/29025197
type: Answer
score: 2
upvote count: 2
has body: $('#wrapper').children().unbind(); Remove event handler on child elements
accepted answer of: http://stackoverflow.com/q/29025157
answers question: http://stackoverflow.com/q/29025157
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46292807

http://stackoverflow.com/q/28927084
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
answer count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
score: 1
has body: Scenario: User is on site http://www.someWhere.com/here?query1=abc User clicks on a link to go http://www.someWhere.com/there If the user clicks on the back button, they would go back to http://www.someWhere.com/here?query1=abc Is there a way to update the "back button" url to be http://www.someWhere.com/here?query2=xyz instead? In order of preference I would prefer a solution in AngularJS, JQuery, or JavaScript.
type: Question
has title: Update (or set before redirect) back button url in browser
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28949048
has title: Error: Permission denied to access property 'nodeType' on AJAX request in Firefox
has body: I include the Google Sign-in button on my page, and use gapi to interact with it. When the user successfully authenticates using the Google API , I make an AJAX call using JQuery to my server: var token = gapi.auth.getToken(); var data = { "token": token, "userId": googleResponse.id }; console.log("sending data"); console.log(data); $.post(url, data, function(response) { window.location.reload(); }, "json").error(function(responseObj, statusCode) { var response = responseObj.responseJSON; console.log("error"); console.log(response); console.log(statusCode); }); I see this issue in the console: "sending data" Object { token: Object, userId: "xxxxxxxxxxxxxxx" } Error: Permission denied to access property 'nodeType' The page does not reload and I do not see additional info in the console. I do not use JQuery to access any element properties or manipulate the DOM in any way. This issue happens with Firefox 36.0.1 and JQuery 2.1.1, but not with Chrome or Safari (same page, same code), on my Mac. EDIT There were posts suggesting FireBug is to blame, so I disabled it and restarted Firefox, but it didn't help.
has answer: http://stackoverflow.com/a/28949895
upvote count: 2
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28949895
type: Question
answer count: 1
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
tagged with: ajax

http://stackoverflow.com/a/28912952
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/46084483
score: 1
has comment: http://stackoverflow.com/comment/46084403
accepted answer of: http://stackoverflow.com/q/28912826
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28912826
has comment: http://stackoverflow.com/comment/46084511
has comment: http://stackoverflow.com/comment/46084426
has body: I suggest you two possible solutions: Statically load your data using php and Use javascript. As you mentioned you are having 14 Rows of data which is very small data, so you can statically load your data with php when the page loads for the first time. Then when the user enters say Pipe dia &amp; class as per your comment you can use javascript ( jQuery will be great for easier DOM manipulation) to show Thickness, Pressure, grade &amp; price etc. Advantage: very fast Disadvantage: As the data grows performance decreases, and loading your page for the first time will be very slow as you are having large data to load. Use Ajax and Php. If you think that your data could possibly grow large for the future, then loading large data could relatively inefficient. So if this is the case all you have to do is load the needed row from backend on demand using ajax.. I also suggest you use jQuery ajax for simplicity. Advantage:Scalable, as your data grows performance will not decrease by significant amount. Disadvantage:As this sends a request to the server for every row it depends on the connection speed of your clients and is relatively difficult to implement in comparison to the above solution. Personally I chose number 2 !
upvote count: 1
has comment: http://stackoverflow.com/comment/46084546

object
tags question: http://stackoverflow.com/q/28936867
tags question: http://stackoverflow.com/q/28962478
tag name: object
tags question: http://stackoverflow.com/q/28993928
tags question: http://stackoverflow.com/q/28972474
tags question: http://stackoverflow.com/q/28915522
tags question: http://stackoverflow.com/q/28991014
tags question: http://stackoverflow.com/q/29015965
tags question: http://stackoverflow.com/q/29021749
tags question: http://stackoverflow.com/q/28929815
tags question: http://stackoverflow.com/q/29053894
tags question: http://stackoverflow.com/q/29012635
tags question: http://stackoverflow.com/q/29009012
tags question: http://stackoverflow.com/q/28946330
tags question: http://stackoverflow.com/q/28955828
tags question: http://stackoverflow.com/q/28987879
tags question: http://stackoverflow.com/q/29016658
tags question: http://stackoverflow.com/q/28992173
tags question: http://stackoverflow.com/q/29009388
tags question: http://stackoverflow.com/q/29047619
tags question: http://stackoverflow.com/q/28984266
tags question: http://stackoverflow.com/q/28962330
tags question: http://stackoverflow.com/q/28969243
tags question: http://stackoverflow.com/q/28914213
tags question: http://stackoverflow.com/q/29017629
tags question: http://stackoverflow.com/q/28989091
tags question: http://stackoverflow.com/q/28982300
tags question: http://stackoverflow.com/q/29000003
tags question: http://stackoverflow.com/q/28908523
tags question: http://stackoverflow.com/q/29050004
tags question: http://stackoverflow.com/q/29001308
tags question: http://stackoverflow.com/q/29016619
tags question: http://stackoverflow.com/q/28971206
tags question: http://stackoverflow.com/q/28956060
tags question: http://stackoverflow.com/q/28940738
tags question: http://stackoverflow.com/q/28913748
tags question: http://stackoverflow.com/q/28933161
type: Tag
tags question: http://stackoverflow.com/q/28948885
tags question: http://stackoverflow.com/q/28947403
tags question: http://stackoverflow.com/q/28917038
tags question: http://stackoverflow.com/q/28933700
tags question: http://stackoverflow.com/q/29027248

http://stackoverflow.com/q/29044722
tagged with: swift
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46347406
linked to: http://stackoverflow.com/q/24580413
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/31307500
tagged with: javascript
has title: Save changes to a user that is not currently logged in
has answer: http://stackoverflow.com/a/31307500
has body: In my _User class I have a column named check. The initial value of the column for someUser(some other saved user) is true and as a currentUser(currently logged in user) I want to be able to change that value to false. Unfortunately for security reasons, Parse won't allow me to save any changes to a user that is not currently logged in, and I get an error: User cannot be saved unless they have been authenticated via logIn or signUp. I already tried adding ACL to Public read and write, but It didn't work. I know I need to use Cloud Code and the Master Key to get it sorted out. There is this post: Can&#39;t write non current user objects by PFUser currentuser, but I can't figure out the way to adapt it.
has answer: http://stackoverflow.com/a/29055101
score: 0
has comment: http://stackoverflow.com/comment/46347294
tagged with: parse-platform
accepted answer: http://stackoverflow.com/a/29055101

http://stackoverflow.com/a/29006153
has comment: http://stackoverflow.com/comment/46258574
score: 0
has body: I got this answer here: How can I disabling backspace key press on all browsers? $(document).keydown(function(e) { var nodeName = e.target.nodeName.toLowerCase(); if (e.which === 8) { if ((nodeName === 'input' &amp;&amp; e.target.type === 'text') || nodeName === 'textarea') { // do nothing } else { e.preventDefault(); } } }); Just put it inside your controller.
type: Answer
has comment: http://stackoverflow.com/comment/60577148
upvote count: 1
has comment: http://stackoverflow.com/comment/46258500
downvote count: 1
answers question: http://stackoverflow.com/q/29006000

http://stackoverflow.com/q/29032353
has comment: http://stackoverflow.com/comment/46320531
tagged with: graph
answer count: 2
has comment: http://stackoverflow.com/comment/46383776
tagged with: highcharts
tagged with: javascript
score: 4
favorite count: 0
has body: I am trying to make a dynamic graph something like as below: Y-axis gives no. of users and x axis date range(For continuous graph ) x axis gives release of an algo on that date.(For discontinued graph) I tried combined charts of highchart this and looked in google charts library. Is there any way by how i can either directly generate a similar chart or merge two chart types in to one? Preferably using high charts or google graphs. I guess we can merge two highcharts in to one but I am not very sure about it, also if we can Iam not sure how to do that. Any help is appreciated. Thanks
has comment: http://stackoverflow.com/comment/46307161
has answer: http://stackoverflow.com/a/35482351
upvote count: 4
has answer: http://stackoverflow.com/a/33499383
downvote count: 0
type: UnansweredQuestion
has title: Merge two or more graphs using library
has comment: http://stackoverflow.com/comment/46306385
type: Question

http://stackoverflow.com/comment/46269695
comment on: http://stackoverflow.com/q/29009642
type: QuestionComment
type: Comment
has text: So, your case is something like this: 1. User received email from your site with link 2. User click on the link 3. User's browser navigate to your site 4. Your site determine OS of the device 5. Your site redirect the user to particular URL Is it correct?
score: 0

http://stackoverflow.com/q/29002492
tagged with: javascript
has answer: http://stackoverflow.com/a/29002775
has comment: http://stackoverflow.com/comment/46252381
has comment: http://stackoverflow.com/comment/46252550
score: 0
has answer: http://stackoverflow.com/a/29003055
answer count: 3
has title: Unable to retieve the particular value of cell on table using javascript
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29003018
has comment: http://stackoverflow.com/comment/46252239
type: Question
has body: I am using the following code to retrieve the values of a particular cell of a table.: function addCatAttr() { var tbl = document.getElementById("tblAttributes1"); if (tbl.rows.length > 1) { for ( var i = 1 ; i < tbl.rows.length ; i++ ) { var r = tbl.rows[i]; var catname1 =r.cells[0].document.getElementsByTagName("input").item(1).value; var lifecycycleattr1 = r.cells[0].document.getElementsByTagName("input").item(2).value; var stateattr1 = r.cells[0].document.getElementsByTagName("input").item(3).value; } } } and my html code is : Category Life Cycle Attribute State Attribute cat1 pf state I want to retrieve each value of a particular. Its just an example.I have more thane two rows for which i need for loop to get the values of each cell.

http://stackoverflow.com/comment/46347891
has text: can you use ajax in your script? you need to find something that takes a moment and uses a callback, then your infinite loop won't freeze the UI. you might be able to use FileReader()'s onload if ajax is also forbidden. there's also requestAnimationFrame... and you could use a dataURL-based script tag, that should give an execution window between iterations.
score: 1
comment on: http://stackoverflow.com/q/29055083
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46210937
has text: this solution is what i first thought of, but this way all prices sum won't be 100, will be 101 or 102...
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28974584
type: AnswerComment

http://stackoverflow.com/comment/46125717
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28933457
has text: Examine [chai-as-promises](http://chaijs.com/plugins/chai-as-promised) and [this SO question](http://stackoverflow.com/questions/20931737/chai-as-promised-is-eating-assertion-errors)
score: 0

http://stackoverflow.com/comment/46286646
has text: I found your other issue. Please see my updated answer
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29016029
type: Comment

http://stackoverflow.com/comment/46095187
comment on: http://stackoverflow.com/q/28916104
has text: @KagamiSaschaRosylight tried but somehow the listner isnt hitting.I am not getting any events fired for the postMessage,very strange.Post message works without iframes,eh?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46121295
comment on: http://stackoverflow.com/q/28932764
type: Comment
type: QuestionComment
has text: Go back through your code and try to match up the curly braces. You have five opening braces and only four closing. Proper indentation and formatting will help you a lot.
score: 2

http://stackoverflow.com/comment/46291080
type: AnswerComment
comment on: http://stackoverflow.com/a/29024188
type: Comment
has text: ah I did a careless mistake there. I found that if I do $(this).closest('.modal-body').find('.inputWrap input').val(), it will get single value only, how do I loop true to ensure everyone of them has something?
score: 0

http://stackoverflow.com/comment/46087824
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28914662
has text: @Francodi, just one thing more. So, in the second example, `index`, `currentValue`, etc. are internally defined and `reduce` calculate internally their values? And for callback, parameter names are reserved names?

http://stackoverflow.com/q/28992764
has comment: http://stackoverflow.com/comment/46237633
has title: JavaScript form validation not working on all HTML fields
has answer: http://stackoverflow.com/a/28993484
has body: Hoping you can help, I am making a HTML form which uses JavaScript validation. The form validation works on Firstname, Surname and town. However, for some reason, it doesn't work on Frist line or Second line of address and also postcode and I am unable to tell why. Any help would be appreciated. Below is the HTML and JavaScript. HTML: <Title> In Class Test 5 Working out the difference between today and your selected date Please enter your first name: Please enter your surname: Please enter your first line of address Please enter your Second line of address Please enter your City or Town Please enter your postcode Please enter a email: Please enter your home number: Please enter your mobile number Submit My JavaScript: function checkFName() { var Fname = document.forms["MyForm"]["Fname"].value; if (Fname == null || Fname == "") { alert("Name must be filled out"); document.MyForm.Fname.focus(); document.getElementById("Fname").style.border = '2px solid red'; return true; } } function checkSName() { var Sname = document.forms["MyForm"]["Sname"].value; if (Sname == null || Sname == "") { alert("Surname must be filled out"); document.MyForm.Sname.focus(); document.getElementById("Sname").style.border = '2px solid red'; return true; } } function checkTown() { var Town = document.forms["MyForm"]["Town"].value; if (Town == null || Town == "") { alert("Town must be filled out"); document.MyForm.Town.focus(); document.getElementById("Town").style.border = '2px solid red'; return true; } } function Pcode() { var Pcode = document.forms["MyForm"]["Pcode"].value; if (Pcode == null || Pcode == "") { alert("Town must be filled out"); document.MyForm.Pcode.focus(); document.getElementById("Pcode").style.border = '2px solid red'; return true; } } function checkFLA() { var FLA = document.forms["MyForm"]["FLINE"].value; if (FLA == null || FLA == "") { alert("First line of address must be filled out"); document.MyForm.FLINE.focus(); document.getElementById("FLINE").style.border = '2px s…
answer count: 3
tagged with: function
tagged with: validation
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/46233881
has comment: http://stackoverflow.com/comment/46234041
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28993454
has comment: http://stackoverflow.com/comment/46235667
type: UnansweredQuestion
upvote count: 1
tagged with: forms
type: Question
has answer: http://stackoverflow.com/a/28993715
tagged with: javascript

http://stackoverflow.com/q/28948875
tagged with: jquery
type: Question
has answer: http://stackoverflow.com/a/28948935
tagged with: datetime
has comment: http://stackoverflow.com/comment/48995146
score: 0
answer count: 1
has title: Set default bootstrap date and datetime values at page load using javascript
accepted answer: http://stackoverflow.com/a/28948935
tagged with: javascript
tagged with: date
type: AnsweredQuestion
has body: I'm using date and datetime functions for my textfields, when I click at textfield it shows the calender and I select date and datetime from calender and my functions are $('.date-picker').datepicker({ rtl: Metronic.isRTL(), autoclose: true, format: "mm/dd/yyyy", startDate: new Date() }); $(".datetime-picker").datetimepicker({ autoclose: true, isRTL: Metronic.isRTL(), format: "mm/dd/yyyy - hh:ii", pickerPosition: (Metronic.isRTL() ? "bottom-right" : "bottom-left") }); What I want is when I load my page the values set by automatically current date and datetime. I search about these functions but cannot set default values of current date and datetime. I also try defaultdate: new Date() OR defaultdate: '03/09/2015' but didn't work for me. How could I do this? I've done this but my programme is not working properly I don't know why is this happening?

http://stackoverflow.com/comment/46262517
has text: @robert ioersed check my answer
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29007788
type: Comment

http://stackoverflow.com/comment/87853754
has text: @My1 Not to minify the stuff you post in answers, you let minifiers do that to production code
comment on: http://stackoverflow.com/a/29017677
score: 4
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29001594
has answer: http://stackoverflow.com/a/29011654
favorite count: 0
linked to: http://stackoverflow.com/q/28482288
upvote count: 1
has body: If I have a bunch of table rows and with select tags in them how would I get the selected value? If the variable "selected_ingr_action" is the same for every row then when I select an item they all change instead of just the one. I know I'm missing something. {{#Ingredients}} {{Name}} {{VendorName}} pack:{{Pack}} unit price {{UnitPrice}} case price {{CasePrice}} Action Rename Edit Unit Price Archive {{/}}
type: AnsweredQuestion
score: 1
has title: How to get selected value from dropdown in a table when there is more then 1?
has answer: http://stackoverflow.com/a/29013622
accepted answer: http://stackoverflow.com/a/29013622
possible better answer: http://stackoverflow.com/a/29011654
has answer: http://stackoverflow.com/a/29004140
type: Question
downvote count: 0
tagged with: javascript
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: ractivejs

http://stackoverflow.com/comment/46353508
score: 1
has text: Works just fine for me. Did you remember to add quotes around it?
type: QuestionComment
comment on: http://stackoverflow.com/q/29058471
type: Comment

http://stackoverflow.com/comment/46304933
type: QuestionComment
type: Comment
has text: Sorry, I read your code badly.... didn't noticed you declared everything within the post call
score: 0
comment on: http://stackoverflow.com/q/29031556

http://stackoverflow.com/a/29103389
score: 0
type: AcceptedAnswer
has body: After a deep investigation, I have noticed that K2 calls another jQuery library which causes confliction as I guessed. Then I have uninstalled K2 completely. Now it is OK.
answers question: http://stackoverflow.com/q/29033261
type: Answer
accepted answer of: http://stackoverflow.com/q/29033261

http://stackoverflow.com/comment/46336254
comment on: http://stackoverflow.com/q/29048465
score: 1
has text: You did improve the question a lot, thanks for the effort.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46689322
has text: i am using the firebase adapter
comment on: http://stackoverflow.com/a/29216458
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28955797
possible better answer: http://stackoverflow.com/a/28955863
has comment: http://stackoverflow.com/comment/46165695
has body: I am using jquery.card.js from jessepollak. It is awesome. If anyone has experience with it, could you please tell me if there is an option to choose what types of credit card you want to support? e.g. //This is how I would like it to be... var card = new Card({ supportedCardTypes: 'Visa, Master'; //I don't want DC or AMEX etc... }); Is there any options like that? How do I achieve it? Thank you. Answer ------------------------------------------------------------ Turns out, only changing cardTypes as TMan suggested didn't work. But it is not about the fish, it is about giving me the idea of fishing. Following TMan's idea hacking into the script, I found adding this line would work: Card.prototype.handlers = { setCardType: function($el, e) { //my modification here to support only Visa and Master!! var cardType = e.data === 'mastercard' || e.data === 'visa' ? e.data : 'unknown'; //end of my modification!! if (!QJ.hasClass(this.$card, cardType)) { QJ.removeClass(this.$card, 'jp-card-unknown'); QJ.removeClass(this.$card, this.cardTypes.join(' ')); QJ.addClass(this.$card, "jp-card-" + cardType); QJ.toggleClass(this.$card, 'jp-card-identified', cardType !== 'unknown'); return this.cardType = cardType; } }, You can just hack the library source code, quick and dirty NOT the best idea, or do something to initialise the handlers your way in your own code. Thanks again.
has title: Credit cards types for jessepollak's JQuery.Card.js
has answer: http://stackoverflow.com/a/28956290
has comment: http://stackoverflow.com/comment/46165729
type: AnsweredQuestion
upvote count: 5
type: Question
answer count: 2
score: 5
accepted answer: http://stackoverflow.com/a/28956290
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28955863

http://stackoverflow.com/comment/46242387
type: Comment
has text: I use it in my production code. Despite the learning curve, the payback in readability, concision, and reduction in needed brainpower to read object/array manipulation code like the above is astounding. I would highly recommend it to anyone
comment on: http://stackoverflow.com/a/28996339
type: AnswerComment
score: 0

http://stackoverflow.com/a/28971106
has comment: http://stackoverflow.com/comment/46194737
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28971026
accepted answer of: http://stackoverflow.com/q/28971026
type: Answer
score: 2
downvote count: 0
has body: Use a callback in replace: var locrep = locstr.replace(/\d+/, function($0) { return Number($0) + 1; }); //=&gt; #img-5 Or else: var locrep = locstr.replace(/(#img-)(\d+)/i, function($0, $1, $2) { return $1 + (Number($2) + 1); }); //=&gt; #img-5
upvote count: 2

http://stackoverflow.com/comment/46183055
type: QuestionComment
type: Comment
has text: So are you uploading the image to display the preview and then uploading it again if they want to save the image?
score: 0
comment on: http://stackoverflow.com/q/28965584

http://stackoverflow.com/comment/46096466
type: Comment
comment on: http://stackoverflow.com/a/28919225
type: AnswerComment
has text: localhost/main/files/files/files/files/about.html
score: 0

http://stackoverflow.com/a/42853584
answers question: http://stackoverflow.com/q/29016985
upvote count: 1
downvote count: 1
has body: src= "https://sapui5.hana.ondemand.com/resources/sap-ui-core.js" id= "sap-ui-bootstrap" data-sap-ui-libs= "sap.m" data-sap-ui-theme= "sap_bluecrystal" or src= "resources/sap-ui-core.js" id= "sap-ui-bootstrap" data-sap-ui-libs= "sap.m" data-sap-ui-theme= "sap_bluecrystal"&gt;
score: 0
type: Answer

http://stackoverflow.com/comment/46138543
type: QuestionComment
comment on: http://stackoverflow.com/q/28939168
score: 0
has text: php and javascript run in different environments and at different times. Stop mixing them as if they can talk to each other.
type: Comment

http://stackoverflow.com/comment/46197340
has text: Can you use html in Titanium Alloy? How does that work?
comment on: http://stackoverflow.com/q/28971497
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46207086
score: 0
type: Comment
has text: I'm trying to accomplish something like this: http://skifreeonline.com/
type: QuestionComment
comment on: http://stackoverflow.com/q/28977498

http://stackoverflow.com/comment/46287786
type: Comment
has text: `_.isNull(undefined)` returns `false`. You better check that `sports` is defined and not null.
score: 0
comment on: http://stackoverflow.com/q/29022245
type: QuestionComment

http://stackoverflow.com/q/29023436
type: Question
answer count: 2
tagged with: function
upvote count: 0
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29023487
has title: Recursion using Javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/29023485
accepted answer: http://stackoverflow.com/a/29023487
has answer: http://stackoverflow.com/a/29023485
has comment: http://stackoverflow.com/comment/46289652
has body: I'm still trying to wrap my ahead around recursion and just when I think I'm starting to understand it a problem presents itself and I have no clue what to do. The problem is: Catsylvanian money is a strange thing: they have a coin for every denomination (including zero!). A wonky change machine in Catsylvania takes any coin of value N and returns 3 new coins, valued at N/2, N/3 and N/4 (rounding down). Write a function wonkyCoins(num)that returns the number of coins you are left with if you take all non-zero coins and keep feeding them back into the machine until you are left with only zero-value coins. The solution I came up with (doesn't work, infinite loop) is: function wonkyCoins(num){ if (num == 0){ return 1; } else { return (wonkyCoins(num/4) + wonkyCoins(num/3) + wonkyCoins(num/2)); } } Any help you guys can contribute would be great!
tagged with: recursion
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46289673
downvote count: 1

http://stackoverflow.com/comment/46172658
has text: i want to return with this function format ( d ) { // `d` is the original data object for the row return ' Agencies '+ ' '+ ' agencies has to come from data attributes from tds ' ' ' ' '
type: AnswerComment
comment on: http://stackoverflow.com/a/28959694
score: 0
type: Comment

http://stackoverflow.com/comment/46153984
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28949414
has text: I'm not seeing the .comment-icon in your markup. Also, could you show the js in context? Is it inline in a script block right below the markup (not seeing a script block) or is it in an external file? If it's in an external file, where is it being pulled in?
score: 0

select
tags question: http://stackoverflow.com/q/28971045
tags question: http://stackoverflow.com/q/29026521
tags question: http://stackoverflow.com/q/29031394
tags question: http://stackoverflow.com/q/28962342
tags question: http://stackoverflow.com/q/28970830
tags question: http://stackoverflow.com/q/28967106
type: Tag
tags question: http://stackoverflow.com/q/29045596
tags question: http://stackoverflow.com/q/28987450
tags question: http://stackoverflow.com/q/29017397
tag name: select
tags question: http://stackoverflow.com/q/28913569

http://stackoverflow.com/q/29045352
has comment: http://stackoverflow.com/comment/46331679
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/46330146
tagged with: php
has comment: http://stackoverflow.com/comment/46330080
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/46337433
upvote count: 2
accepted answer: http://stackoverflow.com/a/29050757
tagged with: codeigniter
type: Question
tagged with: javascript
tagged with: jquery
has title: How to get the data from ajax in controller codeigniter
has body: I have an editable table in my view.. At first, there's no data in the table but the user can add data in the table since it is editable. And there's no exact number of rows in the table since I have also a button that can add new row. I want to get the data that the user have added and save it in the database. I have this code: VIEW: First Name Middle Name Last Name Add new row Save Reset JS: $.fn.editable.defaults.mode = 'inline'; $.fn.editable.defaults.showbuttons = false; $.fn.editable.defaults.url = '/post'; $.fn.editable.defaults.type = 'text'; // make all items having class 'edit' editable $('.edit').editable(); // this is to automatically make the next item in the table editable $('.edit').on('save', function(e, params){ var that = this; // persist the old value in the element to be restored when clicking reset var oldItemValue = $(that)[0].innerHTML; if (!$(that).attr('oldValue')) { console.log('persisting original value: ' + oldItemValue) $(that).attr('oldValue', oldItemValue); } setTimeout(function() { // first search the row var item = $(that).closest('td').next().find('.edit'); console.log(item); if (item.length == 0) { // check the next row item = $(that).closest('tr').next().find('.edit'); } item.editable('show'); }, 200); }); $('#resetbtn').click(function() { $('.edit').each(function() { var o = $(this); o.editable('setValue', o.attr('oldValue')) //clear values .editable('option', 'pk', o.attr('pk')) //clear pk .removeClass('editable-unsaved') .removeAttr('oldValue'); }); }); $('#savebtn').click(function() { var person = []; var x=1; $('tbody tr',$('#memberTB')).each(function(){ for(var i = 0 ; i < cells ; i++) { person[x][i]=$(this).find('td').eq(i).text(); } x++; }); $.ajax({ url: '<?php echo base_url("index.php/test/Savedata");?>', type: "post", data: { values: arraylng }, cache: false, contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { } }); }); $('#addrow').click(function() { $('#memberTB > tbody:last').…
has comment: http://stackoverflow.com/comment/46332192
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29050757

http://stackoverflow.com/comment/46244770
comment on: http://stackoverflow.com/q/28973260
score: 0
type: Comment
type: QuestionComment
has text: Does the "in.login" state have an ancestor? Also, is the path to the template correct?

http://stackoverflow.com/q/28967170
has body: I am trying to create a website that changes its in a based on user input in a previous . My mock-up is below. Car Phone Get new list What I want this code to do is allow the user to pick Honda, Nissan, or BMW if they choose the Car option and pick either Blackberry, Nokia, or Android if they choose the Phone option. However the add() command only takes the last line of input (BMW, or Android). Am I going about this in the right way with just a simply fix needed, or should I rework how I approach this problem? Also, how can I make it so they second form automatically populates without needing to click the button? Thank you for your time,
has answer: http://stackoverflow.com/a/28967246
answer count: 1
tagged with: javascript
has title: Using multiple add() commands in a select object
score: 0
type: UnansweredQuestion
tagged with: addition
type: Question

http://stackoverflow.com/comment/46245786
comment on: http://stackoverflow.com/a/28998857
type: AnswerComment
score: 0
type: Comment
has text: I got the update - thanks, as the output is an error object, when submit is clicked the object appends to the existing html - rather than replacing it.

http://stackoverflow.com/a/28989307
downvote count: 0
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/46232963
answers question: http://stackoverflow.com/q/28989228
score: 2
has comment: http://stackoverflow.com/comment/46231393
has body: You can create a file called .jshintrc that defines the global settings that you want jshint to use. This shows all the possible settings for a file https://github.com/jshint/jshint/blob/master/examples/.jshintrc You would simply create a .jshintrc and set globalstrict: true in that instead of in every js file. The config section of jshint here: http://jshint.com/docs/ has more info if you need it.

http://stackoverflow.com/q/29037307
tagged with: webpack
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46315967
has comment: http://stackoverflow.com/comment/46316480
accepted answer: http://stackoverflow.com/a/29042543
favorite count: 0
has comment: http://stackoverflow.com/comment/46315527
tagged with: bundling-and-minification
upvote count: 6
tagged with: node.js
has body: I'm trying to setup webpack for my project. The project is big enough and is provided in multiple languages. I want each of my entry points to be provided in each language as separate files. My language files are not just plain JSON, but JavaScript instead. So i18n plugin doesn't match my needs. The solution seems to be similar to i18n plugin: var languages = ['en', 'fr', 'de']; module.exports = languages.map(function (lang) { return { name: lang, // some other language-dependent config } }) Then in some of my scripts I want to require localization file, using environment variable: var lang = ...; // some environment variable, available only at compile time var l10n = require('./lang/' + lang); But by default webpack tries to store that expression between parentheses assuming to evaluate it later in browser. So is there a way to tell webpack to evaluate that immediately? Or maybe someone has a better solution to my problem?
has comment: http://stackoverflow.com/comment/46315468
score: 6
has comment: http://stackoverflow.com/comment/46324800
type: Question
has answer: http://stackoverflow.com/a/29042543
type: AnsweredQuestion
has title: Webpack: Is it possible to evaluate javascript expression at compile time?
has comment: http://stackoverflow.com/comment/46315710

http://stackoverflow.com/comment/46286678
type: Comment
has text: @nicomv95 - Then, the values are not actually changing in the inputs. Show us the HTML and the code you're using for changing them. There's likely something wrong in that.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29021632

http://stackoverflow.com/q/29052005
has comment: http://stackoverflow.com/comment/46345277
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/29090594
has comment: http://stackoverflow.com/comment/46412949
type: Question
has answer: http://stackoverflow.com/a/29090594
tagged with: javascript
tagged with: jquery
score: 4
has comment: http://stackoverflow.com/comment/46345555
has body: I've seen demos like this. But it's about creating a new element. parent().append("&lt;span&gt;" + $input.attr('placeholder') + "&lt;/span&gt;"); Is there a way to animate placeholder's disappear on input event without appending a new element? $("input[placeholder]").each(function () { var $input = $(this); // wrap the input with a label $input.wrap("&lt;label class='placeholder'&gt;"); // append a span to the label $input.parent().append("&lt;span&gt;" + $input.attr('placeholder') + "&lt;/span&gt;"); // and finally remove the placeholder attribute $input.attr('placeholder', ''); }).keyup(function () { var $input = $(this); // toogle hidden class on span, according to whether there is content or not if ($input.val() === "") { $input.next("span").removeClass("hidden"); } else { $input.next("span").addClass("hidden"); } }); label.placeholder { position: relative; } label.placeholder span { opacity: 1; -webkit-transition: opacity 250ms; -moz-transition: opacity 250ms; -o-transition: opacity 250ms; -ms-transition: opacity 250ms; transition: opacity 250ms; position: absolute; left: 5px; top: 2px; font-size: 12px; color: grey; } label.placeholder span.hidden { opacity: 0; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="text" placeholder="the placeholder"&gt;
has comment: http://stackoverflow.com/comment/46345498
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46342688
has title: Animate placeholder for an input field event when user inputs something there
upvote count: 4
tagged with: css

http://stackoverflow.com/comment/46342727
comment on: http://stackoverflow.com/q/29052439
type: Comment
type: QuestionComment
score: 0
has text: @Banana - that's too easy

http://stackoverflow.com/a/29040011
accepted answer of: http://stackoverflow.com/q/29038495
type: Answer
answers question: http://stackoverflow.com/q/29038495
score: 0
has comment: http://stackoverflow.com/comment/46323025
type: AcceptedAnswer
has body: You need to wrap your JS in $(document).ready(function({ yourCodeHere }) Otherwise, the JS gets executed before the elements they target are actually loaded and will not work.

http://stackoverflow.com/q/28961717
tagged with: asp.net-web-api2
has answer: http://stackoverflow.com/a/28966047
tagged with: javascript
has title: Json parameter casting inheritance web api 2
upvote count: 1
has body: I am using MS Web API 2 to receive calls from our web page using ajax. Then I have 2 classes: subscriber and externalSubscriber. Subscriber contains very basic data like a name and id. External subscriber inherits from subscriber and adds basic data like address and email. I have one api method to edit the data of a subscriber defined like this: public IHttpActionResult PutSubscriber(int id, Subscriber subscriber) In our page I create a json string using the data provided which leads to it ether being a external or a normal subscriber. I am able to post to this function using both but with an externalSubscriber object the added data gets lost and trying to cast from subscriber leads to an error. my question is if anyone has any experience with this issue and if there is another way to fix this besides creating a specific function for putting a external subscriber.
answer count: 1
tagged with: .net
has comment: http://stackoverflow.com/comment/46182932
favorite count: 0
linked to: http://stackoverflow.com/q/8030538
linked to: http://stackoverflow.com/q/13609579
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28966047
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: c#

http://stackoverflow.com/comment/46324544
score: 0
type: AnswerComment
type: Comment
has text: I created a pull request in core-transition to have this added.
comment on: http://stackoverflow.com/a/29041767

http://stackoverflow.com/comment/46103917
has text: Whenever you change the `Square`'s colour, you actually want to change `Shape`'s colour?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28923461

http://stackoverflow.com/q/29019464
possible better answer: http://stackoverflow.com/a/29020299
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46282812
tagged with: math
has body: I am trying to find an equation for finding the lat/long point between two lat/long points in Javascript. It would work something like this. getMiddle(lat1, lng1, lat2, lng2) &lt;= would return [lat3, lat3] halfway distance wise (going around the earth obviously). I found this: Link Date: 10/11/2001 at 11:41:08 From: Doctor Rick Subject: Re: Determining lat and long of a point between two given points Hi, Chuck. This will probably be a little more complicated than you think. The easiest way for me to do it is to think in terms of vectors. Some of the items in our Archives on the topic of latitude and longitude use the vector approach, so you can see them for background. For example: Distance Between Two Points on the Earth Link Let's call the two points A and B, and choose a rectangular coordinate system in which the equator is in the x-y plane and the longitude of point A is in the x-z plane. Let lat1 be the latitude of A, let lat2 be the latitude of B, and let dlat be the longitude of B minus the longitude of A. Finally, use distance units such that the radius of the earth is 1. Then the vectors from the center of the earth to A and B are A = (cos(lat1), 0, sin(lat1)) B = (cos(lat2)*cos(dlon), cos(lat2)*sin(dlon), sin(lat2)) Point C, the midpoint of the shortest line between A and B, lies along the sum of vectors A and B. (This works because A and B have the same length, so the sum of the vectors is the diagonal of a rhombus, and this diagonal bisects the angle.) A+B = (cos(lat1)+cos(lat2)*cos(dlon), cos(lat2)*sin(dlon), sin(lat1)+sin(lat2)) To get the actual vector C, we need to scale this vector to length R so it ends at the surface of the earth. Thus we have to divide it by |A+B|, that is, the length of vector A+B. That would get pretty messy. But we can find the latitude lat3 and longitude difference (lon3-lon1) by looking at ratios of the coordinates of A+B, and these ratios are the same whether we scale the vector or not. To see this, look back at the formul…
tagged with: javascript
score: -1
type: Question
downvote count: 2
answer count: 3
upvote count: 1
tagged with: latitude-longitude
has comment: http://stackoverflow.com/comment/46316995
favorite count: 0
has comment: http://stackoverflow.com/comment/46317009
has answer: http://stackoverflow.com/a/29020299
has comment: http://stackoverflow.com/comment/46282876
has title: Lat/Long equation in Javascript
has comment: http://stackoverflow.com/comment/46317078
has comment: http://stackoverflow.com/comment/46282811
has answer: http://stackoverflow.com/a/29040274
accepted answer: http://stackoverflow.com/a/29040274
has answer: http://stackoverflow.com/a/79078530

http://stackoverflow.com/a/29011170
has body: I dont have enough point for adding comments. So just adding my comments as answer. I dont have much info about knockout.js. but below should work. $scope.headerVal = { 'usercode': $rootScope.usrCrdntls.getLoginUcode(), 'venue': data.VENUECODE(), 'symbol': data.SECURITYCODE(), 'option': data.CALLPUT(), 'strikeprice': data.STRIKEPRICE() }; if (data.EXPIRATIONDATE){ $scope.headerVal.expirydate = data.EXPIRATIONDATE(); } Add extra check for the field. Hope it helps.
answers question: http://stackoverflow.com/q/29011015
type: Answer
score: 0

http://stackoverflow.com/q/28929094
score: 0
tagged with: input
has comment: http://stackoverflow.com/comment/46114082
has answer: http://stackoverflow.com/a/28929130
type: AnsweredQuestion
has body: I am making a speed calculator where you enter the numbers and you get a speed. here is the code... speed Speed Calculator distance: time: Hours I enter the numbers but it returns "the speed you were traveling is NaNmph". Is there a way to fix this?
has title: I cannot obtain numerical values from input elements, even using parseInt
type: Question
tagged with: parseint
answer count: 1
has comment: http://stackoverflow.com/comment/46113993
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28929130

http://stackoverflow.com/a/28923824
answers question: http://stackoverflow.com/q/28923808
downvote count: 0
upvote count: 3
type: Answer
has body: You should access nth child as follows, $('#slides:nth-child(' + curren_photo + ')').css("display", "none");
score: 3

http://stackoverflow.com/q/29056379
tagged with: google-chrome
type: Question
has body: i wrote following code to have a select list on my page: Pie Line Bar Odometer Radar this is correctly work when i use mozilla firefox browser. but when i use google chrome browser the onclick event(changechart function) doesn't execute. how can i solve it? thanks this is part of my rendered html code: Pie Line Bar Odometer Radar and this is my javascript function: function changechart(id,chtype){ var xmlhttp; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { //response="server/img/useravatars/"+xmlhttp.responseText; response=xmlhttp.responseText; document.getElementById("chartcontainer").innerHTML=response; document.getElementById(chtype).selected="true"; } } var req="showchart.php?id="+id+"&chtype="+chtype; xmlhttp.open("GET",req,true); xmlhttp.send(); } the javascript function even doesn't execute in chrome. but in firefox work's correctly
tagged with: firefox
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29056504
has comment: http://stackoverflow.com/comment/46349902
score: 0
has title: OnClick event doesn't work in Chrome
upvote count: 1
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/46349981
has answer: http://stackoverflow.com/a/29056504
favorite count: 0
has comment: http://stackoverflow.com/comment/46349886
linked to: http://stackoverflow.com/q/4340690
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/9972280
type: AnsweredQuestion

http://stackoverflow.com/q/29043785
has body: I'm trying to implement a json endpoint via hook_menu. Here is my code: function gcm_subscribe_menu() { $items['gcm_subscribe/subscribe'] = array( 'title' =&gt; 'Test-Endpoint', 'page_callback' =&gt; 'gcm_subscribe_ajax_subscribe', 'type' =&gt; MENU_CALLBACK, 'access arguments' =&gt; array('access content'), ); return $items; } function gcm_subscribe_ajax_subscribe() { drupal_json(array('test' =&gt; 'testData')); } My problem is, that when i call this endpoint via javascript, i get an error 403. Does someone know why?
tagged with: hook-menu
type: UnansweredQuestion
has title: Drupal 7 hook_menu with type MENU_CALLBACK gives 403 error
type: Question
tagged with: drupal-7
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29086226

http://stackoverflow.com/comment/46182934
comment on: http://stackoverflow.com/q/28965594
has text: Are you allowed to use ES6 collections?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28994591
score: 3
tagged with: yui-compressor
answer count: 1
downvote count: 0
tagged with: minify
favorite count: 0
linked to: http://stackoverflow.com/q/8060799
has comment: http://stackoverflow.com/comment/46277374
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29002466
upvote count: 3
tagged with: compression
has body: Having something like this: (function ($, window, document, undefined) { 'use strict'; $.fn.demo = function (options) { var active = "active"; var section = ".bb-demo"; $(section).addClass(active); $(section).addClass(active); $(section).addClass(active); $(section).addClass(active); }; })(jQuery, window, document); Closure Simple mode results in 200 bytes: (function(a,b,c,d){a.fn.demo=function(b){a(".bb-demo").addClass("active");a(".bb-demo").addClass("active");a(".bb-demo").addClass("active");a(".bb-demo").addClass("active")}})(jQuery,window,document); While YUI compressor results in 169 bytes: (function(c,b,a,d){c.fn.demo=function(e){var g="active";var f=".bb-demo";c(f).addClass(g);c(f).addClass(g);c(f).addClass(g);c(f).addClass(g)}})(jQuery,window,document); Isn't there a way to compress those string variables in Closure as well? why isn't it doing it? Is it because of better results in terms of performance?
type: Question
tagged with: google-closure-compiler
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29002466
has title: Google Closure compiler not compressing string values?

http://stackoverflow.com/a/29052249
answers question: http://stackoverflow.com/q/29051378
score: 0
type: AcceptedAnswer
has body: The program doesn't wait for .load() to finish before running the next line of code. So you call the datepicker function before your content gets updated. According to the jquery documentation, you can add a callback function that runs once .load() finishes. This is when you should do the datepicker. Try this instead: $(document.body).on("click", "#type1diabetes_link", function(event){ event.preventDefault(); $("#content").load("type1diabetes.html", function() { $('.date').datepicker(); }); });
type: Answer
accepted answer of: http://stackoverflow.com/q/29051378

http://stackoverflow.com/comment/46102057
score: 0
type: Comment
type: QuestionComment
has text: What is the purpose of myArray.splice(0,2); ? You remove some values in the array by doing that, and I guess that will make the number of elements in the array not match the number of rows in your table.
comment on: http://stackoverflow.com/q/28922382

http://stackoverflow.com/comment/46337067
has text: Nice and simple solution :+1:
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29042543

http://stackoverflow.com/a/29010959
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29010915
has body: Because you have to remove ng-controller="personController" from the html tag. AngularJS is searching for that controller, but it doesn't exist, giving an error on the console. Updated plunker: http://plnkr.co/edit/N14qOlvzPF8eIuPj1I4U?p=preview
answers question: http://stackoverflow.com/q/29010915
type: Answer
score: 2
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/a/28990762
has comment: http://stackoverflow.com/comment/46230339
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46230784
type: Answer
has body: As you mentioned in your question : The platforms that support throttling and pausing are currently the following: Flash Player Desktop Mac and Windows, AIR Mobile, and Flash Player Android. ... And as you are writing for Flash Player, so you have just to verify if it's Flash Player Desktop Mac or Windows to know if throttling and pausing are supported, and you can verify that using flash.system.Capabilities especially Capabilities.version, Capabilities.os and Capabilities.playerType. Hope that can help.
accepted answer of: http://stackoverflow.com/q/28989153
answers question: http://stackoverflow.com/q/28989153

http://stackoverflow.com/q/28930624
has title: php ajax form submit ..nothing happens
tagged with: php
type: AnsweredQuestion
has body: I have a PHP Ajax form that I'm trying to submit a Zendesk API call. Whenever I use the ajax part, in order to keep the user on the same page, it doesn't work. When I remove the Your Name: Your Email Address: Subject: Description: My Description Here And the PHP Part: You can probably ignore most of this since it works when I don't use the Ajax. Only the last few lines gives the response $array['valid'] = 1; which should then be catched by if(json.valid == 1) above. <?php ( REMOVED API CALL CODE FROM ABOVE HERE ) if (isset($_POST['submit'])) { foreach($_POST as $key => $value){ if(preg_match('/^z_/i',$key)){ $arr[strip_tags($key)] = strip_tags($value); } } $create = json_encode(array('ticket' => array( 'subject' => $arr['z_subject'], 'comment' => array( "body"=> $arr['z_description']), 'requester' => array('name' => $arr['z_name'], 'email' => $arr['z_requester']) ))); $return = curlWrap("/tickets.json", $create, "POST"); $array = array(); $array['valid'] = 1; $array['message'] = 'Thank you!'; echo json_encode($array); ?> Any ideas why this isn't working?
tagged with: forms
type: Question
has answer: http://stackoverflow.com/a/28930678
answer count: 2
accepted answer: http://stackoverflow.com/a/28930845
has comment: http://stackoverflow.com/comment/46117592
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28930678
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/46116963
has comment: http://stackoverflow.com/comment/46116950
has answer: http://stackoverflow.com/a/28930845

http://stackoverflow.com/a/29051407
has comment: http://stackoverflow.com/comment/46342726
has comment: http://stackoverflow.com/comment/46343530
has comment: http://stackoverflow.com/comment/46342340
has comment: http://stackoverflow.com/comment/46343095
answers question: http://stackoverflow.com/q/29050720
has comment: http://stackoverflow.com/comment/46342924
type: Answer
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/46342036
has comment: http://stackoverflow.com/comment/46343138
has comment: http://stackoverflow.com/comment/46342594
has comment: http://stackoverflow.com/comment/46342641
score: 1
has body: Hmm normally people would use a CI bot to achieve what you are trying to do. However, regarding your direct question about getting the result from JSON reporter, I don't know if there is a better way to achieve it, but here is what I'd do after reading the mocha source. You'll have to create the Suite, the Runner and get the reporter yourself (copy from https://github.com/mochajs/mocha/blob/master/test%2Freporters%2Fjson.js): var mocha = new Mocha({ reporter: 'json' }); var suite = new Suite('JSON suite', 'root'); var runner = new Runner(suite); var mochaReporter = new mocha._reporter(runner); runner.run(function(failures) { // the json reporter gets a testResults JSON object on end var testResults = mochaReporter.testResults; // send your email here });
has comment: http://stackoverflow.com/comment/46342307

http://stackoverflow.com/comment/46202243
score: 1
type: QuestionComment
has text: Related (duplicate?): [What is the function of the var keyword and when to use it (or omit it)?](http://stackoverflow.com/q/1470488/1529630)
comment on: http://stackoverflow.com/q/28975328
type: Comment

http://stackoverflow.com/a/29408114
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28906943
answers question: http://stackoverflow.com/q/28906943
score: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47009168
downvote count: 0
has body: For rare actions such as opening the browser action popup, you'd better actively query the cookies API for the latest state of the relevant cookie, instead of listening for cookie changes via the chrome.cookies.onChanged, because: If your observed bug is real, then this will work around it. Since the popup is not opened very often, it's quite a waste of resources to keep a background/event page alive merely to get notified of cookie changes, especially given the alternative method presented in this answer. Example (popup.js, requires activeTab and cookies permission): // Example: Get the value of the _gaq cookie for the top-level frame of the // current tab. chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) { // Need activeTab permission to read url, e.g. http://example.com/home var url = tabs[0].url; chrome.cookies.get({ url: url, name: '_gaq' }, function(cookie) { // TODO: Do something with cookie, e.g. by updating the view (via DOM). }); });
has comment: http://stackoverflow.com/comment/46996914

http://stackoverflow.com/comment/46170926
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28959155
has text: Ohh sorry man i'm little bit confuse, hold for a while i'll try it once is it possible or not
type: AnswerComment

http://stackoverflow.com/q/29043431
answer count: 1
downvote count: 0
tagged with: sandbox-solution
tagged with: javascript
favorite count: 0
type: UnansweredQuestion
has body: I want students to submit JavaScript code to our server. Then we test that JavaScript code to make sure the students solved the problem. I want to test for exceptions thrown, output, what's returned, execution time, individual variables and functions that were called. We run Ruby on Rails in Heroku, but I'm happy to put up a node.js/io.js server to run the JavaScript code and have our Ruby on Rails code simply send over the user submitted code, wait for a response for success or problems with that user-submitted code and then respond back to the user. What's the best solution for this? Of course, I need to have a timeout as well to make sure while (true)s don't cause problems.
upvote count: 1
tagged with: ruby-on-rails
tagged with: sandbox
has title: Running JavaScript code on the server in a sandbox
type: Question
tagged with: heroku
score: 1
has answer: http://stackoverflow.com/a/29043794

http://stackoverflow.com/a/28956276
upvote count: 1
has comment: http://stackoverflow.com/comment/46165814
has comment: http://stackoverflow.com/comment/46165718
has comment: http://stackoverflow.com/comment/46165749
has body: The darker border is associated with the checked radio button([id^=tab]:checked + label {}) so mark the tab2 radio as checked $(document).ready(function () { $("#continue1").click(function () { $("#tab-content3").hide(); $("#tab-content2").show(); $("#tab-content1").hide(); $('#tab2').prop('checked',true) }); }); Demo: Fiddle
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28956240
answers question: http://stackoverflow.com/q/28956240
has comment: http://stackoverflow.com/comment/46165670
type: Answer

http://stackoverflow.com/comment/50733815
score: 0
type: Comment
type: QuestionComment
has text: Poosible duplicate: http://stackoverflow.com/questions/20482047/jquery-not-working-with-ng-repeat-results
comment on: http://stackoverflow.com/q/28958004

http://stackoverflow.com/comment/121100653
type: QuestionComment
comment on: http://stackoverflow.com/q/28989361
score: 0
type: Comment
has text: I've been thinking about the same thing, but I think the approach I would take is a drop-down list of paths to select from by id. Then reference the path by ID I might even do this one of these days.

http://stackoverflow.com/comment/46270761
score: 2
has text: Well, did you try to change the selectors to include the hash (#) character before the id´s?
type: AnswerComment
comment on: http://stackoverflow.com/a/29012578
type: Comment

jscrollpane
tags question: http://stackoverflow.com/q/28943209
tag name: jscrollpane
type: Tag

http://stackoverflow.com/comment/46168200
comment on: http://stackoverflow.com/a/28954922
type: Comment
has text: Daved, for now I don't think I can use JavaScript (or I'm just not skilled enough) to set the td width. I have 2000+ cells minimum so I want to avoid class for each. I have took your idea of let the css handle more, and tried to set it with css. Although, the results are still concluded with errors.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46323932
type: AnswerComment
type: Comment
has text: Yes, that's it, but what if i have large object? Is any solution, where i don't use this `result.push({ i : x[j].i, _r : Math.random()} );` and use just `result._r = Math.random()` ?
comment on: http://stackoverflow.com/a/29040962
score: 0

http://stackoverflow.com/a/28927704
has comment: http://stackoverflow.com/comment/46150994
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46121900
type: Answer
has body: You have to do the addition yourself (osc1.frequency.value + output of gain). The best current (but see below) way to get access to the output of gain is probably to use a ScriptProcessorNode. You can just use the last sample from each buffer passed to the ScriptProcessorNode, and set the buffer size based on how frequently you want to update the color. (Note on ScriptProcessorNode: There is a bug in Chrome and Safari that makes ScriptProcessorNode not work if it doesn't have at least one output channel. You'll probably have to create it with one input and one output, have it send all zeros to the output, and connect it to the destination, to get it to work.) Near-future answer: You can also try using an AnalyserNode, but under the current spec, the time domain data can only be read from an AnalyserNode as bytes, which means the floating point samples are being converted to be in the range [0, 255] in some unspecified way (probably scaling the range [-1, 1] to [0, 255], so the values you need would be clipped). The latest draft spec includes a getFloatTimeDomainData method, which is probably your cleanest solution. It seems to have already been implemented in Chrome, but not Firefox, as far as I can tell.
has comment: http://stackoverflow.com/comment/46233441
has comment: http://stackoverflow.com/comment/46146196
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/46150617
accepted answer of: http://stackoverflow.com/q/28922461
answers question: http://stackoverflow.com/q/28922461

http://stackoverflow.com/comment/46220165
type: Comment
has text: @AlanHay Then can you provide me a solution without using Ajax, because I don't know Ajax.
type: AnswerComment
comment on: http://stackoverflow.com/a/28979917
score: 0

http://stackoverflow.com/q/28914382
has answer: http://stackoverflow.com/a/28914402
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/46086890
has answer: http://stackoverflow.com/a/28914417
has body: I am trying to send a form field array through my form but am unsuccessfull :-/ I have a hidden field, generated from jQuery, looking like this: $(".imghidden").html('&lt;input type="hidden" name="pimage[]" value="'+data.imgname+'"&gt;'); This is generated for each file uploaded to this post. When I then submit the form I do not get anything through the "pimage" form submission. All other fields return a value?!? Below is the jQuery Ajax I am trying to use: var $form = $( this ), category = $form.find( "select[name='category']" ).val(), newcategory = $form.find( "input[name='newcategory']" ).val(), title = $form.find( "input[name='title']" ).val(), subtitle = $form.find( "input[name='subtitle']" ).val(), content = $form.find( "textarea[name='content']" ).val(), pimage = $form.find( "input[name='pimage']" ).val() // Send the data using post var posting = $.post( "data/mod/projects.php", { createnew: true, cat: category, newcat: newcategory, ti: title, sti: subtitle, con: content, pimg: pimage }); What am I doing wrong. Any help is appreciated. Thanks in advance :-)
has comment: http://stackoverflow.com/comment/46086854
has title: Sending input array with jQuery and Ajax
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46086901
accepted answer: http://stackoverflow.com/a/28914402
tagged with: forms
possible better answer: http://stackoverflow.com/a/28914417
type: Question
answer count: 2

http://stackoverflow.com/a/29006341
accepted answer of: http://stackoverflow.com/q/29000233
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29000233
type: Answer
downvote count: 0
score: 3
has body: Append ${user.id} with href value of popup show button i.e. #myModal_${user.id} Add modal popup inside the foreach loop and now append ${user.id} with popup id. i.e. myModal_${user.id} replace your foreach with this code and remove popup. &lt;c:forEach var="user" items="${listpersons}"&gt; &lt;tr&gt; &lt;td&gt;&lt;a href="#"&gt;${user.username}&lt;/a&gt;&lt;!-- &lt;span&gt;Clients&lt;/span&gt; --&gt; &lt;/td&gt; &lt;td&gt;&lt;a href="#"&gt;${user.email}&lt;/a&gt;&lt;/td&gt; &lt;td&gt; &lt;button class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top" title="Compose"&gt;&lt;a href="#"&gt;&lt;i class="fa fa-envelope-o"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/button&gt; &lt;a href="${pageContext.request.contextPath}/edit?id=${user.id}&amp;name=${user.username}&amp;password=${user.password}&amp;email=${user.email}"&gt;&lt;i class="fa fa-edit" title="Edit"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/button&gt; &lt;a href="${pageContext.request.contextPath}/delete?id=${user.id}" title="Delete"&gt;&lt;i class="fa fa-trash-o"&gt;&lt;/i&gt;&lt;/a&gt; &lt;a href="#myModal_${user.id}" role="button" class="btn btn-large btn-primary" data-toggle="modal"&gt;Launch Demo Modal&lt;/a&gt; &lt;/td&gt; &lt;td class="text-right mail-date"&gt;Jan 16&lt;/td&gt; &lt;/tr&gt; &lt;div id="myModal_${user.id}" 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;Confirm Delete&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;p&gt;Are you sure you want to delete this user? &lt;/p&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;a href="${pageContext.request.contextPath}/delete?id=${user.id}" title="Delete"&gt;&lt;i class="fa fa-trash-o"&gt;&lt;/i&gt;Delete&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt…
upvote count: 3

http://stackoverflow.com/comment/46430931
type: Comment
comment on: http://stackoverflow.com/a/29000489
score: 1
type: AnswerComment
has text: Under SDK2 PNG images were automatically converted to PBI.

http://stackoverflow.com/comment/46080680
has text: I removed the audio[0].play(); from the init function and it now works as expected. A bunch of answers in just a few mins, thanks so much guys, you all rock!
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28910795
score: 0

http://stackoverflow.com/q/29006893
score: 1
has body: When I use new to instainciate an instance of a certain class, I got the actual instance. When the constructor function has a return value, the new sentence gives out the actual instance also. However, when the constructor returns itself, I can't get the instance. Instead I get the constructor. I wander what's wrong with this. Here are my test code fragment: function foo() { this.x = 1; return foo; } console.log(new foo()); // prints the defination of foo As we consider, in most situations, it makes no sence to return a function like this. However, why does JS has such a feature? Is there any consideration when designing JS? Or is it just a bug of JS?
has answer: http://stackoverflow.com/a/29007038
type: Question
has comment: http://stackoverflow.com/comment/46259716
tagged with: javascript
tagged with: prototype
upvote count: 1
has answer: http://stackoverflow.com/a/29007121
has title: What's wrong with a JavaScript class whose constructor returns a function or an object
answer count: 4
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29006958
has answer: http://stackoverflow.com/a/29006924
downvote count: 0

http://stackoverflow.com/comment/46292931
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29019831
has text: @plalx - The linked duplicate asked how to stop the loop from an OS level, this asks from a javascript level. The questions are fundamentally different and the answers will be as well.
score: 0

http://stackoverflow.com/comment/51317883
type: AnswerComment
comment on: http://stackoverflow.com/a/29044323
has text: Hi Denis...you had helped me with the above script a few months back. I took a break from this because I wasn't having any success. However, I tried again today and it now seems to work in IE, but not Firefox. Not sure why. I hope you will get this post because I feel I'm getting very close to getting this to work. Here is a link to the HTML page I'm working on. It only has the script and nothing else. http://www.thepiezoexchange.com/threeJS_Codes.html ....I'm hoping you might know why it doesn't work in Firefox. It could be an issue with the settings on my computer, but not sure
score: 0
type: Comment

http://stackoverflow.com/comment/46152979
type: Comment
comment on: http://stackoverflow.com/a/28948062
has text: Cheers! I have found out elsewhere - yes, by using RegEx object that works fine.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46463795
type: Comment
has text: This demonstrates the contenteditable http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_global_contenteditable In Chrome for example, if you copy any part in the page and paste into that div, it will keep the HTML. This may not a standard with other browsers.
comment on: http://stackoverflow.com/a/29094545
score: 0
type: AnswerComment

http://stackoverflow.com/q/29026529
type: Question
has title: Why is Javascript hoisting this variable?
duplicate of: http://stackoverflow.com/q/23667086
has comment: http://stackoverflow.com/comment/46295294
score: 0
has comment: http://stackoverflow.com/comment/46295111
tagged with: javascript
has body: Why the freak is Javascript hoisting the variable jsonObj?!?! If I place the console.debug into the $.get function, I can see the JSON data. Otherwise, it's an empty string. function searchDirectory() { var jsonObj = ''; var params = { 'firstName': $('input[name=firstName]').val(), 'lastName': $('input[name=lastName]').val() }; $.get("directory-search.php", params, function (data) { jsonObj = JSON.parse(data); }) .fail(function () { alert("Oops! We could not process your request. Please try again later."); }); console.debug(jsonObj); } I've tried not declaring the variable at the top and letting it set the global inside the $.get function, but that requires that I click the button that calls this function twice the first time.
has comment: http://stackoverflow.com/comment/46294975
has comment: http://stackoverflow.com/comment/46295072
linked to: http://stackoverflow.com/q/23667086
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/29004878
has comment: http://stackoverflow.com/comment/46256559
has body: It looks like skipCopy1 is a variable. If so, remove the that. from: var skipCopy = that.skipCopy1.is(':checked'); // ^^^^^---- remove this Or, if you intended skipCopy1 to be a property of that, you need to set it on the previous line: that.skipCopy1 = that.element.find('#emptyFolder input[name=emptyFolder]'); // ^^^^^---- add this
type: AcceptedAnswer
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/29004863
type: Answer
accepted answer of: http://stackoverflow.com/q/29004863

http://stackoverflow.com/comment/92564365
has text: URL params are usually logged by proxies.
comment on: http://stackoverflow.com/a/28983937
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46309076
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29033813
has text: It's also uncommon to have two different scripts for different browser versions. Usually you'd just make sure every script you have work as intended in all versions you want to support.

http://stackoverflow.com/q/28957670
downvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/29009168
favorite count: 0
has title: Day difference in the java script function
has body: For example. Day start from :: 9/3/15 14:00:00 Day End to :: 10/3/15 13:59:59 Consider day is end at 14.00.00 not from 24.00.00 Example 1 :: Input Start date :: 9/3/15 15:05:00 End date :: 10/3/15 7:05:00 Here, day is start after 14.00.00 and end before the 14.00.00 at the next day so here not complete the day. So it will return 0 days Example 2 :: Input Start date :: 10/3/15 12:05:00 End date :: 10/3/15 15:05:00 Here, day is start before 14.00.00 and end after the 14.00.00 at the next day so here complete the day. So it will return 1 days Here, day is end at the 14.00.00
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46168232
has comment: http://stackoverflow.com/comment/46168129
accepted answer: http://stackoverflow.com/a/29009168
upvote count: 2
has comment: http://stackoverflow.com/comment/46168316
has answer: http://stackoverflow.com/a/28964382
type: Question
has comment: http://stackoverflow.com/comment/46168280
has comment: http://stackoverflow.com/comment/46168190
score: -2
has comment: http://stackoverflow.com/comment/46168403
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28964382

http://stackoverflow.com/comment/46245172
type: QuestionComment
has text: are we supposed to guess what your html and css looks like?
comment on: http://stackoverflow.com/q/28998541
score: 0
type: Comment

http://stackoverflow.com/comment/46185197
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28964640
has text: It's really hard to parse your question, and your code sample is enormous. Try breaking it up into smaller bits, and asking your question in a different way, for a better chance at someone being able to help. As it stands, I'm not sure what I'm supposed to be seeing in your fiddle nor what the desired behavior is.

http://stackoverflow.com/q/29015201
tagged with: http://stackoverflow.com/tag/csv
has body: I'm trying to find a solution for my previous post: Mongo gives duplicate key error on _id_ field in Meteor application In order to do that I want to read data from my CSV file at server side, and not from the client. First I tried the solution in this post Using node-csv and meteor-file to import CSV into a collection but meteor-file isn't compatible anymore with current version of Meteor. I also tried the solution in this post Upload Data to Meteor / Mongo DB but It's also on the client and that solution generates the same error as in my previous post. After some further research I tried to read the data with the code below. However it doesn't work: First I created a collection: Meteor.orders = new Meteor.Collection('Orders'); I defined the following template to read the csv file: Kies bestand Importeer Wis gegevens This is the client javascript: Template.read_file_orders.events({ "click #read_orders" : function(e) { var f = document.getElementById('fileInput2').files[0]; console.log("read file"); readFile(f, function(content) { Meteor.call('upload',content); }); } }); readFile = function(f,onLoadCallback) { var reader = new FileReader(); reader.onload = function (e){ var contents=e.target.result onLoadCallback(contents); } reader.readAsText(f); }; And this is the server javascript: Meteor.startup(function () { // code to run on server at startup return Meteor.methods({ upload : function(fileContent) { console.log("start insert"); import_file_orders(fileContent); console.log("completed"); } }); }); import_file_orders = function(file) { var lines = file.split('%\r\n'); var l = lines.length - 1; for (var i=0; i < l; i++) { var line = lines[i]; var line_parts = line.split('|'); var ex_key = line_parts[0]; var ex_name = line_parts[1]; var clin_info = line_parts[2]; var order_info = line_parts[3]; var clinician_last_name = line_parts[4]; var clinician_first_name = line_parts[5]; var clinician_code = line_parts[6]; var clinician_riziv = line_parts[7] var pat_id = line_p…
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29016925
type: Question
tagged with: mongodb
linked to: http://stackoverflow.com/q/19314200
has title: How to import data from CSV file into Meteor collection at server side
has comment: http://stackoverflow.com/comment/86810093
tagged with: javascript
score: 4
linked to: http://stackoverflow.com/q/28961281
accepted answer: http://stackoverflow.com/a/29016925
upvote count: 4
linked to: http://stackoverflow.com/q/21053061
answer count: 1
downvote count: 0
tagged with: meteor
favorite count: 0

http://stackoverflow.com/a/28963861
has body: moment() returns an object, the local storage doesn't accept object. Parse into string before store the value $scope.SetLocalStorage('My-' + $rootScope.UserId, JSON.stringify(moment())); And when you use it use JSON.parse : var dt = moment(JSON.parse($scope.GetLocalStorage('My-' + $rootScope.UserId)));
accepted answer of: http://stackoverflow.com/q/28963673
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28963673

http://stackoverflow.com/q/29032704
has comment: http://stackoverflow.com/comment/46308320
tagged with: http
type: Question
has answer: http://stackoverflow.com/a/29079524
tagged with: java
has comment: http://stackoverflow.com/comment/46306436
has comment: http://stackoverflow.com/comment/46306349
tagged with: httprequest
score: 0
answer count: 2
tagged with: concatenation
has body: So, I want to send a stream of bytes to the browser(for example a pdf) so he can show it to the user. if (bytesToRead == -1) { bytesToRead = (int)fullPathFile.length();} byte[] buffer = new byte[bytesToRead]; int bytesRead = -1; if((inputFileInputStream != null) &amp;&amp; ((bytesRead = inputFileInputStream.read(buffer)) != -1)){ if (codec.equals("base64")) { String streamLength = Base64.encodeBytes(buffer, 0, bytesToRead); response.setContentLength(streamLength.length()); outputFileOutputStream.write(Base64.encodeBytes(buffer, 0, bytesToRead).getBytes()); } else { outputFileOutputStream.write(buffer, 0, bytesToRead); } } inputFileInputStream.close(); outputFileOutputStream.flush(); outputFileOutputStream.close(); At the moment it works with option -1 to get the stream of byte in one go but I want to send 2kb lets says. I understand that for that I need to send multiple 2kb replies and I have to concatenate them in the javascript code. But, how do I do that ?
tagged with: javascript
has comment: http://stackoverflow.com/comment/46306357
accepted answer: http://stackoverflow.com/a/29079524
has title: How to dynamically concat a block of byte stream from http response in javascript?
has comment: http://stackoverflow.com/comment/46306400
possible better answer: http://stackoverflow.com/a/29032824
has answer: http://stackoverflow.com/a/29032824
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46306409

http://stackoverflow.com/comment/46078062
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28909036
score: 0
has text: @WayneJenkins hmm, any other alternatives? **Edit**: Here: http://tinychat.com/cv31ll

http://stackoverflow.com/q/28932250
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28932317
score: 2
upvote count: 2
accepted answer: http://stackoverflow.com/a/28932317
type: Question
type: AnsweredQuestion
has body: I was just going through some code in modal.js and came across the following line of code: var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' &amp;&amp; option) The line mostly makes sense, except the last part, i.e.: typeof option == 'object' &amp;&amp; option I understand the typeof operator but I don't understand its usage in $.extend, can somebody explain please? My line of difficulty can be found in the plugin code online too . Line 296.
has title: Understanding complex $.extend in modal.js
answer count: 1
downvote count: 0

http://stackoverflow.com/a/29121890
has body: Quick update: I actually got it to work the way it needed to in the end. :) var count_of_lines = parseInt(window.prompt("Enter number of lines in the CSV file.","Please enter a number...")); var DataSource = "/Users/Username/iMacros/Datasources/" + window.prompt("Please enter the name of the file.",""); var Load_Csv = ""; var Timeouts = 0; for (i = 1; i &lt;= parseInt(count_of_lines); i++) { iimDisplay("The script has run through " + i + " lines out of a total of " + count_of_lines + "."); //Provide feedback about progress. iimDiplay("The script has timed out a total of " + Timeouts + " times." ); //Provide feedback about total timeouts. iimSet("i", i); //Necessary to make the attribution of i here. iimSet("DataSource", DataSource); //Necessary to make the attribution of DataSource here. Load_Csv = "TAB T=1 \n"; Load_Csv += "CMDLINE !DATASOURCE {{DataSource}} \n"; Load_Csv += "SET !DATASOURCE_LINE {{i}} \n"; Load_Csv += "SET !TIMEOUT_PAGE 120 \n"; Load_Csv += "URL GOTO= \n"; iimPlayCode(Load_Csv); iimPlay("CODE:TAG POS=2 TYPE=SPAN ATTR=TXT:* EXTRACT=TXT"); //We are checking to see if the attribute exists (its length is &gt;0) if (iimGetLastExtract() != '#EANF#' &amp;&amp; iimGetLastExtract().trim().length != 0) { // Condition is met (Field exists = Page loaded correctly) iimSet("i", i); //Necessary to make the attribution of i here. iimSet("DataSource", DataSource); //Necessary to make the attribution of DataSource here. Insert_Rating = "CMDLINE !DATASOURCE {{DataSource}} \n"; Insert_Rating += "SET !DATASOURCE_LINE {{i}} \n"; Insert_Rating += "TAG POS= TYPE=A ATTR=TXT: \n"; iimPlayCode(Insert_Rating); //Run the macro } else { // if the field could not be found, retry.. iimPlay("CODE:REFRESH"); i--; //If the load fails, you should subtract from i in order to make sure that you're not skipping a row in the .csv Timeouts++; //Adds to the timeouts counter. } }
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29032941

http://stackoverflow.com/a/28986523
score: 1
has comment: http://stackoverflow.com/comment/46296730
downvote count: 0
has comment: http://stackoverflow.com/comment/46221587
has body: hi this change i made for min date live code http://jsfiddle.net/RLQhh/1003/ /****new min date code */ $scope.dateChange = function(event){ var d= $scope.minDate1.setDate( $scope.dt.getDate() + 1); $scope.minDate1=new Date(d); } /****new min date code end */ $scope.toggleMin = function() { $scope.minDate = $scope.minDate ? null : new Date(); $scope.minDate1 = new Date(); }; html code Start Date End Date
type: Answer
answers question: http://stackoverflow.com/q/28925198
upvote count: 1

http://stackoverflow.com/comment/46251564
has text: that is a bad solution
comment on: http://stackoverflow.com/a/29001994
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28998093
has answer: http://stackoverflow.com/a/28998261
has comment: http://stackoverflow.com/comment/46244455
score: 0
answer count: 3
tagged with: for-loop
has answer: http://stackoverflow.com/a/57985716
has answer: http://stackoverflow.com/a/28998131
has comment: http://stackoverflow.com/comment/46244365
tagged with: fizzbuzz
tagged with: javascript
type: UnansweredQuestion
has body: I'm having an assignment where I have to do the FizzBuzz game in Javascript. The problem is my loop stops after the first iteration and only return the first value (4). I may be blind to my code but I can't find where the error(s) is. If you could please push me in the right direction I'd be happy. Thanks in advance. Regards, Thomas. function fizzBuzz(start, stop) { for(var i = start; i &lt;= stop; i++) { if (i % 3 == 0) { return "fizz"; }else if( i % 5 == 0) { return "buzz"; }else if(i % 15 == 0) { return "fizz buzz"; }else { return i; } } } ANSWER = (fizzBuzz(4, 22)); New code: function fizzBuzz(start, stop) { for(var i = start; i &lt;= stop; i++) { if (i % 3 == 0 &amp;&amp; i % 5 == 0) { document.write ("Fizz Buzz"); }else if(i % 3 == 0) { document.write ("Fizz"); }else if(i % 5 == 0) { document.write ("Buzz"); }else { document.write(i); } } } ANSWER = (fizzBuzz(4, 22)); It returns: Answer = undefined
type: Question
favorite count: 0
has title: Fizz Buzz return value javascript
has comment: http://stackoverflow.com/comment/46244417
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/46245710

http://stackoverflow.com/q/29003002
accepted answer: http://stackoverflow.com/a/29012970
has title: Sum of sum columns in kendo grid
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29005957
tagged with: kendo-grid
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/29012970
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29005957
answer count: 2
downvote count: 0
has body: I have kendo grid java script grouping as follows group: { field: "ResourceName", aggregates: [ { field: "WeekOneUtilization", aggregate: "sum" }, { field: "WeekTwoUtilization", aggregate: "sum" }, { field: "WeekThreeUtilization", aggregate: "sum" }, { field: "WeekFourUtilization", aggregate: "sum" } ] }, aggregate: [{ field: "ProjectName", aggregate: "count" }, { field: "WeekOneUtilization", aggregate: "sum" }, { field: "WeekTwoUtilization", aggregate: "sum" }, { field: "WeekThreeUtilization", aggregate: "sum" }, { field: "WeekFourUtilization", aggregate: "sum" }] I want to get Sum of sums of four weeks the result is as follows
tagged with: asp.net
favorite count: 0
tagged with: kendo-ui

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/29015025
tags question: http://stackoverflow.com/q/28939020
type: Tag
tags question: http://stackoverflow.com/q/28978418

http://stackoverflow.com/comment/46224792
score: 0
type: Comment
has text: sry, though why u want to change your valuefield? mby im just too blind - though i cant imagine a case where i do want that.
type: QuestionComment
comment on: http://stackoverflow.com/q/28987568

http://stackoverflow.com/comment/46251886
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29002278
score: 0
has text: Can you please elaborate

http://stackoverflow.com/comment/60577148
type: AnswerComment
type: Comment
score: 1
has text: I can't backspace on password field, and I don't know the === operator. I fix it with: if ((nodeName == 'input' && (e.target.type == 'text' || e.target.type == 'password')) || nodeName == 'textarea') {
comment on: http://stackoverflow.com/a/29006153

http://stackoverflow.com/comment/46110938
type: QuestionComment
comment on: http://stackoverflow.com/q/28927161
has text: The browser and the server must already be using the same hashing algorithm for ETags to work at all. Can I ask the browser to run that algorithm on a blob of mine, or would I really have to find / write a Javascript implementation? I don't want to have to renegotiate the algorithm with the server, if the browser already has that figured out.
score: 0
type: Comment

http://stackoverflow.com/comment/46262268
has text: @NicholasSmith running on a node server on both the live and my local.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29001205

http://stackoverflow.com/comment/46114924
type: Comment
type: QuestionComment
has text: I did not get you. I want to know whether, what I have handled is right or wrong. Or should I add some more conditions for handling errors. Can you tell me is it the right way on what I have done
comment on: http://stackoverflow.com/q/28929303
score: 0

http://stackoverflow.com/comment/46265505
comment on: http://stackoverflow.com/q/29010223
type: Comment
type: QuestionComment
has text: You forgot to add code, Pl add it first
score: 1

http://stackoverflow.com/comment/46116194
comment on: http://stackoverflow.com/q/28930232
has text: http://stackoverflow.com/questions/19786525/how-to-list-loaded-resources-with-selenium-phantomjs
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29016414
answers question: http://stackoverflow.com/q/29014080
score: 0
has body: It looks like you are trying to use jquery (the $ in your javascript code). However, you haven't specified the jquery script in your html. Try adding this In between the head blocks
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29014080

http://stackoverflow.com/a/29056619
score: 1
answers question: http://stackoverflow.com/q/29045985
upvote count: 1
has body: You can't and never will. It's a security risk and accounts.google.com and authentication is a high security area.
type: Answer
downvote count: 0

asp.net
tags question: http://stackoverflow.com/q/28979081
tags question: http://stackoverflow.com/q/28974838
tags question: http://stackoverflow.com/q/29017696
tags question: http://stackoverflow.com/q/28957367
tags question: http://stackoverflow.com/q/28936644
tags question: http://stackoverflow.com/q/29013658
tags question: http://stackoverflow.com/q/28989015
tags question: http://stackoverflow.com/q/28943507
tags question: http://stackoverflow.com/q/29007024
tags question: http://stackoverflow.com/q/28989519
tags question: http://stackoverflow.com/q/29009432
tags question: http://stackoverflow.com/q/29053825
tags question: http://stackoverflow.com/q/28968429
tags question: http://stackoverflow.com/q/29039388
tags question: http://stackoverflow.com/q/28973749
tags question: http://stackoverflow.com/q/29031682
tags question: http://stackoverflow.com/q/28972707
tags question: http://stackoverflow.com/q/28991986
tags question: http://stackoverflow.com/q/29006724
tags question: http://stackoverflow.com/q/28970779
tags question: http://stackoverflow.com/q/29012712
tags question: http://stackoverflow.com/q/28968087
tags question: http://stackoverflow.com/q/29017358
tags question: http://stackoverflow.com/q/28949986
tags question: http://stackoverflow.com/q/28980300
tags question: http://stackoverflow.com/q/28955993
tags question: http://stackoverflow.com/q/29007751
tags question: http://stackoverflow.com/q/29001185
tags question: http://stackoverflow.com/q/28970035
tags question: http://stackoverflow.com/q/28924104
tags question: http://stackoverflow.com/q/29025076
tags question: http://stackoverflow.com/q/28957908
tags question: http://stackoverflow.com/q/29003002
tags question: http://stackoverflow.com/q/28960614
tags question: http://stackoverflow.com/q/28971049
tags question: http://stackoverflow.com/q/29031365
tags question: http://stackoverflow.com/q/28998007
tags question: http://stackoverflow.com/q/28961582
tags question: http://stackoverflow.com/q/29008052
tags question: http://stackoverflow.com/q/28938143
tags question: http://stackoverflow.com/q/29020908
tags question: http://stackoverflow.com/q/28919446
tags question: http://stackoverflow.com/q/28959362
tags question: http://stackoverflow.com/q/28982394
tags question: http://stackoverflow.com/q/28908376
tags question: http://stackoverflow.com/q/28948612
tags question: http://stackoverflow.com/q/29026681
tags question: http://stackoverflow.com/q/28953981
tags question: http://stackoverflow.com/q/29046824
tags question: http://stackoverflow.com/q/29015788
tags question: http://stackoverflow.com/q/28950693
tags question: http://stackoverflow.com/q/28983372
tags question: http://stackoverflow.com/q/28971604
type: Tag
tags question: http://stackoverflow.com/q/29044686
tags question: http://stackoverflow.com/q/28966440
tags question: http://stackoverflow.com/q/28997283
tags question: http://stackoverflow.com/q/29001131
tags question: http://stackoverflow.com/q/28956617
tags question: http://stackoverflow.com/q/28952379
tags question: http://stackoverflow.com/q/28985165
tags question: http://stackoverflow.com/q/28986128
tags question: http://stackoverflow.com/q/28960958
tags question: http://stackoverflow.com/q/28931550
tags question: http://stackoverflow.com/q/29002523
tags question: http://stackoverflow.com/q/29028166
tags question: http://stackoverflow.com/q/28970142
tags question: http://stackoverflow.com/q/28911351
tags question: http://stackoverflow.com/q/28914297
tags question: http://stackoverflow.com/q/29026227
tags question: http://stackoverflow.com/q/28913262
tags question: http://stackoverflow.com/q/29043158
tags question: http://stackoverflow.com/q/28928636
tags question: http://stackoverflow.com/q/28919246
tags question: http://stackoverflow.com/q/28974647
tag name: asp.net
tags question: http://stackoverflow.com/q/28992199
tags question: http://stackoverflow.com/q/29011252
tags question: http://stackoverflow.com/q/29061752
tags question: http://stackoverflow.com/q/29044698

http://stackoverflow.com/a/28991962
answers question: http://stackoverflow.com/q/28988106
score: 0
type: Answer
has body: Surround your &lt;img&gt; tag inside an &lt;a&gt; like this: &lt;a href="http://www.example.com" id="link1"&gt;&lt;img id="img1" src="images/img1.jpg"&gt;&lt;/a&gt; Now in both the methods add code to update the href of the tag accordingly. var urls=["http://www.example.com","http://www.example2.com","http://www.example3.com","http://www.example4.com"]; function moveToNextSlide() { if (index &gt;= 4){index=0} var img = document.getElementById("img1"); var slideName="images/img" + titles[++index] + ".jpg"; img.src=slideName; var link= document.getElementById("link1"); var url=urls[++index]; link.href=url; } function moveToPreviousSlide() { if (index &lt;= 0){index=4} { var img = document.getElementById("img1"); var slideName="images/img" + titles[--index] + ".jpg"; img.src=slideName; var link= document.getElementById("link1"); var url=urls[++index]; link.href=url; } } Try and tell.

http://stackoverflow.com/q/28997057
has comment: http://stackoverflow.com/comment/46244462
has title: How can I download an excel file through javascript, while passing an "Authorization" header?
has body: I need to download an excel file through javascript, and I need to pass along a header with a security token. It seems that this is not possible through typical ajax requests, or through form.submit. Does anyone know of a way to do this? Thanks!
downvote count: 0
score: 1
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
answer count: 0
upvote count: 1
tagged with: excel
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/16592709
tagged with: http-headers
tagged with: security

http://stackoverflow.com/a/29004585
upvote count: 2
answers question: http://stackoverflow.com/q/29003324
type: Answer
has body: node's default debugger (node debug ): doesn't stop at debugger but stops on every single line AFAIK, the builtin debugger can run until a breakpoint is hit (e.g. a debugger line). Did you resume the execution via cont? It is expected that the debugger stops on the next line after the command next. Also what version of Node are you using? AFAIK there were significant changes in the debugger implementation between v0.10 and v0.12, you may have discovered a bug (a regression).
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/46292862
has comment: http://stackoverflow.com/comment/46262416

http://stackoverflow.com/comment/46312706
score: 0
has text: Also, it's not true that you can't block in Javascript. You can block just fine with callbacks, promises, or generators.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29035079

http://stackoverflow.com/comment/46292769
has text: The files are in the same folder and I've checked the spelling multiple times to make sure it matches. I've also changed the name of the .js file since it used to be the same as the .html name. They need to stay separate files since this is homework. I've gotten other .js files linked to .html files before and I can't seem to figure out why these 2 won't link.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29002220

http://stackoverflow.com/q/29014818
tagged with: video
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29014960
has answer: http://stackoverflow.com/a/29014960
accepted answer: http://stackoverflow.com/a/29014928
type: Question
tagged with: javascript
score: 0
answer count: 2
has title: How to play video by entering URL through input field using javascript
has answer: http://stackoverflow.com/a/29014928
has body: I am trying to make a page so that I can enter a URL through the input field and on submitting it will play the video. But unfortunately it's not happening like that. I am working with a local file on my PC. JavaScript window.onload=function(){ alert('Your video player is Here'); } function play(){ var path = document.getElementById("path").value; document.getElementById('show').innerHTML='&lt;video id="movie" src="'+url+'" height="600px" width="1300px" controls autoplay &gt; &lt;/video&gt;'; var player =document.getElementById('movie'); player.load(); alert(''+player.duration); } HTML &lt;input type="text" id="path" placeholder="put movie path"/&gt; &lt;input type="submit" onclick="play();" value="Play on"/&gt; &lt;div id="show"&gt;&lt;/div&gt;
has comment: http://stackoverflow.com/comment/46274391

http://stackoverflow.com/a/29025885
answers question: http://stackoverflow.com/q/29025832
has body: This has nothing to do with java but anyway. Values are string, so you can't calculate them like that. You need to parse values to integer and then calculate. var CALC1 = parseInt(document.TEST.INPUT1.value);
score: 0
type: Answer

http://stackoverflow.com/q/28948467
has comment: http://stackoverflow.com/comment/46207667
tagged with: javascript
has body: I am trying to put some color on vertices but the colors do not appear. I am using Three.js library. This is the function example I am using: function parserExpose(arr) { var geometry = new THREE.PlaneGeometry(60, 60, arr.x - 1, arr.y - 1); for (var i = 0, l = geometry.vertices.length; i &lt; l; i++) { geometry.vertices[i].z = (arr.topo[i].topoValues / 65535 * 2470); geometry.vertices[i].color = new THREE.Color(Math.random() * 0x00ffff); } geometry.colorsNeedUpdate = true; geometry.needsUpdate = true; geometry.__dirtyVertices = true; geometry.__dirtyNormals = true; geometry.computeBoundingSphere(); //vertexColors: THREE.VertexColors //THREE.FaceColors var plane = new THREE.Mesh(geometry, new THREE.MeshBasicMaterial({vertexColors: THREE.VertexColors, wireframe: true, wireframeLinewidth: 3})); scene.add(plane); } If I use geometry.faces[] I can change the color but I only want to change on vertices not the faces. Thx in advance. :)
score: 0
has comment: http://stackoverflow.com/comment/46165760
has comment: http://stackoverflow.com/comment/46151017
has title: Can't color the vertices but if use faces the three.js works
answer count: 0
type: UnansweredQuestion
tagged with: three.js
has comment: http://stackoverflow.com/comment/46172525
linked to: http://stackoverflow.com/q/10330342
has comment: http://stackoverflow.com/comment/46151157
has comment: http://stackoverflow.com/comment/46150927
type: Question

http://stackoverflow.com/comment/137801993
score: 0
type: Comment
has text: It's important to call window.focus() on page load, otherwise it won't be listening for blur event unless user interacts with document.
comment on: http://stackoverflow.com/a/52588765
type: AnswerComment

http://stackoverflow.com/q/29055517
answer count: 2
has title: angularjs : watch of array has been triggered when the array in initial load and not being changed
tagged with: javascript
tagged with: angularjs
has answer: http://stackoverflow.com/a/29055572
has body: $scope.$watch('selectedCategories', function(newValue, oldValue){ console.log(newValue); console.log(oldValue); $scope.loadPosts(); }, true); $scope.$watch('selectedCities', function(newValue, oldValue) { console.log(newValue); console.log(oldValue); $scope.loadPosts(); }, true); These two watches have been triggered when the page is initially loaded. Isn't it supposed not to trigger when the page is loading and the array not being changed?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29055583
accepted answer: http://stackoverflow.com/a/29055583
type: Question
possible better answer: http://stackoverflow.com/a/29055572
score: 0

http://stackoverflow.com/q/28914561
has answer: http://stackoverflow.com/a/28914617
score: 1
has answer: http://stackoverflow.com/a/28914664
has title: Function closures
type: Question
tagged with: function
tagged with: closures
downvote count: 0
tagged with: javascript
has body: Hi I'm trying to run the following function: function add (a, b) { return a + b; } var make_lazy = function (add, a, b) { return function () { add(a,b); } } Basically what I'm trying to do is to pass another function as an argument and its parameters to the make_lazy function - and then run the function that was passed in as the argument along with the other two parameters. I get undefined is not function as an error when I try to run the code.
accepted answer: http://stackoverflow.com/a/28914623
has answer: http://stackoverflow.com/a/28914713
answer count: 4
favorite count: 0
upvote count: 1
possible better answer: http://stackoverflow.com/a/28914617
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28914623

http://stackoverflow.com/comment/46187851
has text: Is there any specific reason why you decided not to use a `/plugins/:pluginId` general route instead of multiple small ones? As far as I know, Iron-Router is more designed to be a one-time configuration...
score: 0
comment on: http://stackoverflow.com/q/28967351
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46303801
has text: Ok, got it and it's working (the alert) but...how do I make the onchange js function trigger after the change ? Sorry but I am quite new at jquery...
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29031426
type: Comment

kendo-treeview
tags question: http://stackoverflow.com/q/28930152
tag name: kendo-treeview
tags question: http://stackoverflow.com/q/28945836
type: Tag

http://stackoverflow.com/comment/46141984
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28943134
has text: Does these lines are enough for you?
score: 0

http://stackoverflow.com/comment/46103377
has text: ... do you pull from the server a resized and cropped image or in any way you're getting the whole 1536x1024px image? Also what you mean by saying *"best area of the image inside the div"*?
score: 0
comment on: http://stackoverflow.com/q/28923269
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46258118
type: AnswerComment
has text: Its really aweseme.Thank you so much.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29005417

http://stackoverflow.com/q/29018531
type: AnsweredQuestion
has body: At URL www.here.com/article1.htm, I have Javascript that fills a modal with an HTML login form whose action is www.not-here.com/login.php and authentication works fine, except after completing the login.php action, the browser ends up at www.not-here.com/login.php, rather than remaining at the URL where the modal was activated, www.here.com/article1.htm. To instruct the browser to remain at www.here.com/article1.htm, I first added id="loginTrigger" in the submit input tag like this: &lt;input id="loginTrigger" type="submit" name="doLogin" value="Login"&gt; Then, in my Javascript I added a click event handler to override the form's default behavior and remain at the URL detected when the document loaded (modal Javascript is omitted for brevity): $(document).ready(function(){ hereSecureURL = window.location.protocol; hereDomain = window.location.hostname; herePath = window.location.pathname; hereAnchor = window.location.hash; hereURL = hereSecureURL + '//' + hereDomain + herePath + hereAnchor; $('#trigger').click(function(e){ modal.open({content: $form}); }); $('#loginTrigger').click(function(e){ e.preventDefault(); window.location = hereURL; modal.close(); }); }); How can the browser be instructed to remain at www.here.com/article1.htm and just have the form process and modal close?
type: Question
has comment: http://stackoverflow.com/comment/46282956
has answer: http://stackoverflow.com/a/29018695
accepted answer: http://stackoverflow.com/a/29018695
possible better answer: http://stackoverflow.com/a/29020442
has answer: http://stackoverflow.com/a/29020442
tagged with: javascript
tagged with: forms
has title: How Can a Remote Form Action URL Be Overridden?
has comment: http://stackoverflow.com/comment/46281144
score: 0
has comment: http://stackoverflow.com/comment/46281323
answer count: 2
tagged with: jquery
has comment: http://stackoverflow.com/comment/46281418
has comment: http://stackoverflow.com/comment/46281331
tagged with: php

http://stackoverflow.com/comment/46299729
comment on: http://stackoverflow.com/q/29029129
score: 0
type: Comment
type: QuestionComment
has text: There is a npm module for that you can use named **grunt-contrib-uglify**. I use it with basic compression and it does the job well. Here is details: https://github.com/gruntjs/grunt-contrib-uglify

http://stackoverflow.com/a/28987537
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/46223566
downvote count: 0
has body: The first issue with this code that I see is that you are deleting rows in a forward moving loop, meaning if you delete row 3, row 4 will now be 3 etc (not an issue if only deleting a single row but not a good practice).. You should delete in reverse ordered loop. Also, you should probably compare the innerText vs innerHTML, I doubt the user input is HTML. for(var x = theTable.rows.length; x &gt; 0 ; x--){ if(theTable.rows[x - 1].cells[2].innerText!= userInput){ theTable.deleteRow(x -1); } }
answers question: http://stackoverflow.com/q/28987470
type: Answer

http://stackoverflow.com/comment/46145283
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28945396
has text: @Jamiec Thanks for your correction. In fact I'm french so every cultural/language advices are welcome :)
score: 0

http://stackoverflow.com/q/29049384
tagged with: iframe
type: Question
answer count: 2
has body: I have a simple Chrome application. There is a base64 string. In it, I store a PDF file and I want to open this PDF file on new window or iframe. I tried to create an iframe with src="data:application/pdf;base64,..". After that, I get this error: Refused to load plugin data from 'data:application/pdf;base64,JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3R…Q4RUU5MzdDRDQyM0RFNEI4MTkzNDU3MzIzMTM2OQo+PgpzdGFydHhyZWYKMjA0NTQKJSVFT0YK' because it violates the following Content Security Policy directive: "default-src 'self' chrome-extension-resource:". Note that 'object-src' was not explicitly set, so 'default-src' is used as a fallback.
tagged with: javascript
tagged with: base64
has title: How to open base64 PDF in Chrome app?
score: 0
has answer: http://stackoverflow.com/a/29049796
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/pdf
has answer: http://stackoverflow.com/a/77098907
favorite count: 0
has comment: http://stackoverflow.com/comment/46336954
upvote count: 2
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/46336977

http://stackoverflow.com/a/28964871
answers question: http://stackoverflow.com/q/28961429
score: 0
type: Answer
has body: if you want to submit each form individually than you can try this.. first give different id to each form... &lt;form id='id1'&gt; .. &lt;/form&gt;.. and use button instead of submit. and call a javascript function on button click event to submit form.. &lt;input type='button' onclick='return submitForm('id1')'&gt;&lt;/button&gt; and create a javascript function on bottom of your page &lt;script type='text/javascript'&gt; function submitForm(id) { document.getElementById(id).submit(); } &lt;/script&gt; so you will have two forms with two different ids and two buttons... let me know if any further help needed.

http://stackoverflow.com/comment/46250552
type: Comment
comment on: http://stackoverflow.com/a/29001107
score: 1
has text: @jetru a you are assigning a function **declaration** to bar. Not a function itself.
type: AnswerComment

http://stackoverflow.com/q/28917090
tagged with: rest
tagged with: angularjs
tagged with: angular-promise
tagged with: angular-http
type: AnsweredQuestion
downvote count: 0
score: 1
has body: The following snippet returns the following error: TypeError: object is not a function service.deleteItem = function(itemId) { var def = $q.defer(); $http.delete(SERVER_REST_PATH + '/items/' + itemId) .success(function() { def.resolve(); }).error(function(data, status) { def.reject("Error deleting the item"); }); return def.promise(); }; If I rewrite it as the following it works: service.deleteItem = function(itemId) { return $http.delete(SERVER_REST_PATH + '/items/' + itemId); }; All other $http methods that I use(i.e GET, PUT, POST) in my app are wrapped with the $q the same way and they don't have this issue. Only the DELETE is causing this issue. When I debug it it just skips the $http's success(), error() and then() methods. I'm using angular version 1.3.13.
type: Question
has title: Angularjs $http delete with $q promise leads to TypeError: object is not a function
tagged with: javascript
has answer: http://stackoverflow.com/a/28917250
accepted answer: http://stackoverflow.com/a/28917250
upvote count: 1
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/46092120

http://stackoverflow.com/a/28913841
has comment: http://stackoverflow.com/comment/46087245
accepted answer of: http://stackoverflow.com/q/28913317
has comment: http://stackoverflow.com/comment/46085891
upvote count: 5
answers question: http://stackoverflow.com/q/28913317
has comment: http://stackoverflow.com/comment/46100755
type: Answer
downvote count: 0
has body: ngModel compares by reference, not value. So if you use ng-options="value as value.Title for value in doesNotBind", then your doesNotBindModel must be: JavaScript: $scope.doesNotBindModel = $scope.doesNotBind[1]; However, if you still want to set your doesNotBindModel in JSON notation, you can add track by value.ID to the ng-options expression like this: HTML: &lt;select ng-options="value as value.Title for value in doesNotBind track by value.ID" ng-model="doesNotBindModel"&gt; &lt;/select&gt; It also works by adding a track by expression, but it is not recommended by Angular's documentation for ngOptions. For the reason behind this please refer the following example: HTML: &lt;select ng-options="item.subItem as item.label for item in values track by item.id" ng-model="selected"&gt; &lt;option value=""&gt;---- not selected ----&lt;/option&gt; &lt;/select&gt; JavaScript: $scope.values = [{ id: 1, label: 'aLabel', subItem: { name: 'aSubItem' } }, { id: 2, label: 'bLabel', subItem: { name: 'bSubItem' } }]; $scope.selected = { name: 'aSubItem' }; With the purpose of preserving the selection, the track by expression is always applied to the element of the data source (to item in this example). To calculate whether an element is selected, we do the following: Apply track by to the elements in the array. In the example: [1, 2] Apply track by to the already selected value in ngModel. In the example: This is not possible, as track by refers to item.id, but the selected value from ngModel is {name: 'aSubItem'}. So the track by expression is applied to a wrong object, the selected element can't be found. &lt;select&gt; is always reset to the "not selected" option. Live example: http://plnkr.co/edit/Hu5T1Vo3qTkrDqe5PHJy
has comment: http://stackoverflow.com/comment/46108244
score: 5
type: AcceptedAnswer

http://stackoverflow.com/q/28933580
type: AnsweredQuestion
tagged with: google-chrome
has title: No input validation in node webkit (nw.js) based app
type: Question
accepted answer: http://stackoverflow.com/a/28935618
score: 0
answer count: 1
tagged with: javascript
has body: This is my HTML code &lt;input type="text" required="" placeholder="Username"&gt; which basically make the username necessary for form submission and displays a tooltip for the field if left black on submission. The HTML Page works fine, output: However on running the genrated app.exe file, there are no messages, output: My Question: Is this a Node Webkit limitation? Are there any workarounds?
tagged with: nw.js
tagged with: node-webkit
has answer: http://stackoverflow.com/a/28935618
tagged with: node.js

http://stackoverflow.com/q/28966169
has body: I am trying to create a data-driven questionnaire in Angular. The questionnaire can support several types of questions which should be displayed differently based on their type. Currently, I achieve this using a series of ngIfs like so: &lt;div ng-if="question.type === 'SingleAnswerQuestion'"&gt; &lt;pn-single-answer-question model="question"&gt;&lt;/pn-single-answer-question&gt; &lt;/div&gt; &lt;div ng-if="question.type === 'MultipleAnswerQuestion'"&gt; &lt;pn-multiple-answer-question model="question"&gt;&lt;/pn-multiple-answer-question&gt; &lt;/div&gt; &lt;div ng-if="question.type === 'IncrementalSingleAnswerQuestion'"&gt; &lt;pn-single-answer-incremental-question model="question"&gt;&lt;/pn-single-answer-incremental-question&gt; &lt;/div&gt; This feels a little clunky to me, especially since we are going to be adding a ton more question types in the near future. So I was playing around with encapsulating this in a directive hoping that would be a little more sleek rather than trying to achieve this in a template. Here's what I came up with: angular.module('membercenter.riskquestionnaire') .directive('pnDynamicQuestion', function ($compile) { return { restrict: 'E', scope: { question: "=model" }, link: function(scope, element, attrs) { var question = scope.question; var questionHtml = null; if (question.type === 'SingleAnswerQuestion') { questionHtml = '&lt;pn-single-answer-question model="question"&gt;&lt;/pn-single-answer-question&gt;'; } else if (question.type === 'MultipleAnswerQuestion') { questionHtml = '&lt;pn-multiple-answer-question model="question"&gt;&lt;/pn-multiple-answer-question&gt;'; } else if (question.type === 'NumericSingleAnswerQuestion') { questionHtml = '&lt;pn-single-answer-incremental-question model="question"&gt;&lt;/pn-single-answer-incremental-question&gt;'; } if (questionHtml) { var questionElement = angular.element(questionHtml); var compiled = $compile(questionHtml); element.append(questionElement); compiled(scope); } } }; }); This se…
answer count: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/29016578
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46276937
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/29016578
type: Question
tagged with: angularjs-directive
has title: Creating a directive that manipulates DOM to add child directives dependent on scope
possible better answer: http://stackoverflow.com/a/28966394
has comment: http://stackoverflow.com/comment/46184480
has answer: http://stackoverflow.com/a/28966394
tagged with: javascript

http://stackoverflow.com/q/29033187
has comment: http://stackoverflow.com/comment/46307362
tagged with: requirejs
has body: I'm trying out requireJS in order to improve the loading of Javascript on an ASP.NET MVC app, using Knockout. I have some files defining custom ko bindings like that: (function (ko, bindings) { bindings.stopBinding = { init: function () { return { controlsDescendantBindings: false }; } }; bindings.anotherBinding = { ... }; })(ko, ko.bindingHandlers); If I try to load it as a requireJS module this way: define(['jquery', 'knockout', 'custom/knockout.bindings'], function ($, ko){ ko.applyBindings(...); }); I get a ko is not defined error. I know that I could enclose this file in a require callback for instance in order ot make it work: require(['knockout'], function (ko) { (function (ko, bindings) { bindings.stopBinding = { init: function () { return { controlsDescendantBindings: false }; } }; bindings.anotherBinding = { ... }; })(ko, ko.bindingHandlers); }); Is there another way to allow this file to work without having to update each and every legacy JS file in the application ? I thought of using shim, but I didn't get anywhere, but I'm quite a noob with requireJS, so maybe I'm missing something obvious.
has title: Load standard javascript files with requireJS
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29072441
tagged with: knockout.js
type: Question
score: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29072441
has comment: http://stackoverflow.com/comment/46307278
linked to: http://stackoverflow.com/q/17575048

http://stackoverflow.com/a/28926692
has comment: http://stackoverflow.com/comment/46116745
accepted answer of: http://stackoverflow.com/q/28926529
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28926529
score: 1
has body: var $root = $('html, body'); $('a').click(function() { var href = $.attr(this, 'href'); $root.animate({ scrollTop: $(href).offset().top -47 }, 500, function () { window.location.hash = href; }); return false; }); add this within your $(document).ready(function(){});
has comment: http://stackoverflow.com/comment/46109543
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28982021
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28982709
accepted answer: http://stackoverflow.com/a/39979198
type: Question
has title: How to set Date of an existing moment.js object
upvote count: 33
possible better answer: http://stackoverflow.com/a/52166201
tagged with: javascript
has answer: http://stackoverflow.com/a/52166201
score: 33
answer count: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/46214705
favorite count: 0
has answer: http://stackoverflow.com/a/39979198
has comment: http://stackoverflow.com/comment/46214209
has body: Let's say I have an existing moment object: var m = moment(); // this will default to now and want to update it with a new Date object, but WITHOUT REPLACING the entire object. E.g. this is NOT an acceptable solution for me: m = moment(new Date()); The only solution I can find in there docs, is using set method: m.set({'year': 2013, 'month': 3}); but in this way we'll need to split our existing Date object into peaces like this: var myDate = new Date(); var newDate = moment(myDate); var splittedDate = { year: newDate.get('year'), month: newDate.get('month'), date: newDate.get('date'), hour: newDate.get('hour'), minute: newDate.get('minute'), second: newDate.get('second'), millisecond: newDate.get('millisecond') }; m.set(splittedDate); But this looks ugly to me. Maybe someone can suggest a better solution?
tagged with: momentjs

http://stackoverflow.com/comment/46312626
score: 1
has text: please review [MDN Event reference](https://developer.mozilla.org/en-US/docs/Web/Events), you might just find the event you are after ;)
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29035896

http://stackoverflow.com/a/29050435
answers question: http://stackoverflow.com/q/29050100
type: Answer
has body: You can render a different mobile compatible HTML page based on USER-AGENT. For e.g. you can use pre request processors to check request HEADERS for USER-AGENT and if the pattern matches to any of the mobile ones, you can redirect user to another url e.g. m.yourwebsite.com, you can replace the underlying HTML page you're about to render (e.g. Say the url maps to /path/to/templates, it changes to /path/to/mobile templates/. The file name is the same) you can simply set a variable on request and make decisions inside the HTML file itself. E.g. In templates you can do {% if request.is_mobile %} /url/to/mobile.css {% else %} /url/to/desktop.css {% endif %} Option 1 is lot of work and option 3 would be least amount of work. We chose option 2. Option 3 isn't recommended because it can make a HTML page buggy (we do it for smaller and mostly static pages like about us privacy etc) It seems that Google favors same domain with responsive web design over a sub domain, though jury is still out on it. Here is what google has to say. So having same URL is preferred way for all devices.
score: 0

http://stackoverflow.com/q/28912303
tagged with: javascript
has body: Would it be possible to create a window in threejs that would allow me to use normal desktop applications (code editors, etc) from inside of the scene? Note: I'm doing this inside of a custom application, or a node-webkit application, so there are no restrictions on file usage
score: 0
tagged with: 3d
answer count: 1
has answer: http://stackoverflow.com/a/28919073
type: UnansweredQuestion
tagged with: three.js
has title: Would it be possible to create a working computer interface in threejs
type: Question

http://stackoverflow.com/comment/46133532
score: 0
type: QuestionComment
type: Comment
has text: So, you want to switch stylesheets and also the text of the button?
comment on: http://stackoverflow.com/q/28938933

http://stackoverflow.com/comment/46182694
comment on: http://stackoverflow.com/q/28965210
type: Comment
score: 0
has text: @dandavis Please can you clarify. Surely authentication headers can be sent along with the upgrade request - it being an HTTP request.
type: QuestionComment

http://stackoverflow.com/a/28931179
downvote count: 0
has comment: http://stackoverflow.com/comment/46118486
has comment: http://stackoverflow.com/comment/46118202
has comment: http://stackoverflow.com/comment/46118317
has comment: http://stackoverflow.com/comment/55996788
has comment: http://stackoverflow.com/comment/46118372
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28931084
has body: The problem is that you are passing a promise into .then() in f2. .then() will ignore anything that is not a function, so all that f2 is really returning is a promise for mkdirp(this.path) and that's a big bug for a few reasons. If an error is thrown in request(options)'s then handler, then there will be nothing to handle it. Also, you are not doing anything to handle a possible error from writeFile. If you call writeFile, you either need to return a promise chain that includes it, or add logic to handle it within f2. Since it looks like you can run mkdirp() and request() in parallel here, but you are not using the result of mkdirp() I would say this is the way to go: function f2(path, fileName, options) { var p = mkdirp(path).return(request(options)).then(res =&gt; { if (res[0].statusCode === 200) { return writeFile(fileName, res[0].body) .return(res[0].body); } else { throw new Error(res[0].statusCode + ': ' + res[0].body); } }); return p; }
has comment: http://stackoverflow.com/comment/46119674
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28931084
has comment: http://stackoverflow.com/comment/46118217
has comment: http://stackoverflow.com/comment/46118430
type: Answer
score: 2

http://stackoverflow.com/comment/46211554
score: 0
has text: @SimoneRiboldi Yes both images are in same folder.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28980421

http://stackoverflow.com/comment/46348790
score: 0
has text: CURL doesn't matter, the parsing is happening in Node.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29055675

http://stackoverflow.com/a/28916624
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
has body: You are recreating the map for the second access point, which means you have two maps, each having one marker on it, the first of which is overwritten and not visible. You are also overwriting the marker variable (which shouldn't cause an issue): Unless you have multiple &lt;div&gt;'s with maps in them, only create one map. function initialize() { var myLatlng = new google.maps.LatLng(51.843143, -2.643555), map = new google.maps.Map(document.getElementById('map'), { zoom: 12, center: myLatlng }), marker = new google.maps.Marker({ position: myLatlng, map: map, title: "We are here!" }); var accessPoint1 = new google.maps.LatLng(51.840913, -2.638603), marker1 = new google.maps.Marker({ position: accessPoint1, map: map, title: "Access Point 1" }); map.controls[google.maps.ControlPosition.TOP_CENTER].push($("#findButton")[0]); function successCallback(position) { var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude), myOptions = { zoom: 3, center: latlng, mapTypeControl: false, navigationControlOptions: { style: google.maps.NavigationControlStyle.SMALL }, mapTypeId: google.maps.MapTypeId.ROADMAP }, bounds = new google.maps.LatLngBounds(latlng); bounds.extend(marker.getPosition()); map.setOptions(myOptions); map.fitBounds(bounds); new google.maps.Marker({ position: latlng, map: map, title: "You are here!", icon: 'http://maps.gstatic.com/mapfiles/markers2/boost-marker-mapview.png' }); } function errorCallback() { alert("I'm afraid your browser does not support geolocation."); } function findMe() { $(this).hide(); if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(successCallback, errorCallback, { timeout: 10000 }); } else { alert("I'm afraid your browser does not support geolocation."); } } $("#findButton").click(findMe); } google.maps.event.addDomListener(window, 'load', initialize); html, body, #map { height: 500px; width: 500px; margin: 0px; padding: 0px } &lt;script src="http://maps.google.com/maps/api/js"&gt;&lt;/s…
accepted answer of: http://stackoverflow.com/q/28915449
answers question: http://stackoverflow.com/q/28915449
upvote count: 1

http://stackoverflow.com/q/28936913
has title: Force PhantomJS execution with JavaScript error
has body: I have a third-party script that is throwing an error message in the console. The webpage renders fine in the browser and functions correctly. However, when I use PhantomJS to test the webpage, the script would stop execution when it reaches the page error. So I was wondering if there is any way I can force PhantomJS to continue execution even when there is error on the page.
score: 0
has comment: http://stackoverflow.com/comment/46129680
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28937085
type: Question
tagged with: phantomjs
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46129520

http://stackoverflow.com/a/49769576
type: Answer
answers question: http://stackoverflow.com/q/28956629
score: 0
has body: You can do like this in php instead of using form data, Serialize you form data and send through ajax, like, $.ajax({ type: 'post', url: 'post.php', data: $('#form').serialize(), success: function () { } }); }); using $('#form').serialize() you can send your all form data to php. I hope it helps,

http://stackoverflow.com/comment/46273523
type: QuestionComment
has text: Why wouldn't you just use `.htaccess` & `mod_rewrite` and rewrite the URL? You could also use `FallbackResource` to point to a php file that would have additional logic in it (then pass off a `header('Location: http://new/resource/file.ext');`)
comment on: http://stackoverflow.com/q/29014292
score: 0
type: Comment

ember.js
tags question: http://stackoverflow.com/q/29043030
tags question: http://stackoverflow.com/q/28980266
tags question: http://stackoverflow.com/q/29012579
tags question: http://stackoverflow.com/q/28952200
tags question: http://stackoverflow.com/q/28921471
tags question: http://stackoverflow.com/q/29061556
tags question: http://stackoverflow.com/q/28920133
tags question: http://stackoverflow.com/q/28961499
tags question: http://stackoverflow.com/q/28934315
tags question: http://stackoverflow.com/q/28909281
tags question: http://stackoverflow.com/q/29011155
type: Tag
tags question: http://stackoverflow.com/q/29026275
tag name: ember.js
tags question: http://stackoverflow.com/q/29011854
tags question: http://stackoverflow.com/q/29052574
tags question: http://stackoverflow.com/q/29046477
tags question: http://stackoverflow.com/q/28909150
tags question: http://stackoverflow.com/q/29028939
tags question: http://stackoverflow.com/q/28977804
tags question: http://stackoverflow.com/q/29049067
tags question: http://stackoverflow.com/q/29057441
tags question: http://stackoverflow.com/q/28913452
tags question: http://stackoverflow.com/q/28950952
tags question: http://stackoverflow.com/q/28933184
tags question: http://stackoverflow.com/q/28955413
tags question: http://stackoverflow.com/q/28945093
tags question: http://stackoverflow.com/q/29044604

http://stackoverflow.com/q/28961556
type: Question
tagged with: graph
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28961861
has body: I want a line graph like the image below using some opensource js library. I am using Charts.js currently but apparently it doesn't have something like this. I want a section of the graph to be highlighted using dotted lines. Which opensource lib can I use ?How can I do this ?
score: 0
has comment: http://stackoverflow.com/comment/46293472
type: UnansweredQuestion
has title: Highlight line graph with dotted lines
tagged with: charts

http://stackoverflow.com/comment/46150766
score: 0
type: Comment
type: QuestionComment
has text: You need to display the rest of your javascript, this appears to be the end of a function.... where is the rest? It would be relevant to show the full function used to set the `divs` attributes. If you cannot display the **relevant source code** then I cannot help you, sorry.
comment on: http://stackoverflow.com/q/28947941

http://stackoverflow.com/comment/46240745
type: Comment
comment on: http://stackoverflow.com/a/28977103
type: AnswerComment
has text: Thanks **VICTORKOHL** i never tought about that.I am really inexperienced with Node.js and Express.js.I hope you dont think this is ridiculous but can we use POST METHOD TO A REMOVE ROUTE??Something in a form like this: form(id='form', action='/post/delete', method='POST') **Once Again thanks a lot for your answer**
score: 0

http://stackoverflow.com/comment/46208271
type: Comment
has text: on my http.put call inmy angular controller i changed `vm.editFavorite` to `vm.search` So I got some naming conventions I need to refactor, but it's working! I think I would like to play with a few things in the code I got from you because right now I have two different save methods in my repository and a few other weird quirks, but at least I have some working code to play with. THANK YOU VERY MUCH!
comment on: http://stackoverflow.com/a/28978118
score: 0
type: AnswerComment

http://stackoverflow.com/a/28934110
has comment: http://stackoverflow.com/comment/46124106
score: 2
has comment: http://stackoverflow.com/comment/46124257
has comment: http://stackoverflow.com/comment/46124309
type: AcceptedAnswer
downvote count: 0
has body: Here you are dealing with the scope hierarchy, you wil want to use one of the mechanisms to coordinate between controllers. Some options are: Using the $rootScope Using messages I have updated your example to use $rootScope here http://jsfiddle.net/4q7hrpc5/3/ firstly, create something to initialize the $rootScope. I created an outer controller and wrapped the two other controllers in that controller. Here is the updated HTML: Custom Custom 1 is showing but Custom 2 should not be if it was already opened Custom2 Custom 2 is showing but Custom 1 should not be if it was already opened. here is the code for the controllers: angular.module('simpleToggle', []) .controller('OuterCtrl', ['$rootScope', function($rootScope) { $rootScope.custom1 = false; $rootScope.custom2 = false; }]) .controller('AppCtrl',['$rootScope', '$scope', function($rootScope, $scope){ $scope.toggleCustom1 = function() { $rootScope.custom1 = !$rootScope.custom1; $rootScope.custom2 = false; }; }]) .controller('App2Ctrl',['$rootScope', '$scope', function($rootScope, $scope){ $scope.toggleCustom2 = function() { $rootScope.custom2 = !$rootScope.custom2; $rootScope.custom1 = false; }; }]); Now this specific technique only works well for a small number of things that have to be coordinated. Messages or a service might be better if you have a large number of these things that need to be coordinated. Another alternative would be to put them all into the same controller.
answers question: http://stackoverflow.com/q/28933879
type: Answer
has comment: http://stackoverflow.com/comment/46146274
accepted answer of: http://stackoverflow.com/q/28933879
upvote count: 2
has comment: http://stackoverflow.com/comment/46123951

http://stackoverflow.com/comment/46145054
type: Comment
comment on: http://stackoverflow.com/a/28943901
score: 0
type: AnswerComment
has text: @ Matías Fidemraizer, No, it won't, probably. So the javascript basically use Camel-case, but the pascal-casing is preserved for constructor functions. So normal function went for lowerCamelCase. Is it?

http://stackoverflow.com/comment/46097896
type: Comment
comment on: http://stackoverflow.com/a/28920015
score: 0
type: AnswerComment
has text: Is jQuery loaded by the time the in question is executed? Try adding alert($.fn.jquery); just before the $("#WAFTest").load(...) piece.

http://stackoverflow.com/q/28942324
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/46139349
has comment: http://stackoverflow.com/comment/46140576
score: 1
tagged with: dom
type: Question
has body: Im using Simple HTML DOM to screen scrap an rss feed http://rss.sciencedirect.com/publication/science/09218009, this is my code: require_once DOMAIN_DIR . 'simple_html_dom.php'; $articles = array(); getArticles('http://rss.sciencedirect.com/publication/science/09218009'); function getArticles($page) { global $articles; $html = new simple_html_dom(); $html-&gt;load_file($page); //echo $html; $items = $html-&gt;find('.entry'); echo sizeof($items); /*foreach($items as $post) { # remember comments count as nodes $articles[] = $post-&gt;innertext; //echo $html; } foreach($articles as $item) { echo "&lt;div class='item'&gt;"; echo $item; echo "&lt;/div&gt;"; }*/ } The good part is that load_file($page) works and when I output it to the browser it displays the whole page. Good run so far. Now the problem is that $items is equal to [], yes nada! When I analyze the dom I see that there is a javascript initialization function which I suspect is the culprit. I need to know how: Can this php library do some sort of js initilization If no, what other alternatives can I use Thanks
tagged with: javascript
has title: Parsing rss feed with simple HTML dom not working for any element
has comment: http://stackoverflow.com/comment/46139259
has comment: http://stackoverflow.com/comment/46139174
has comment: http://stackoverflow.com/comment/46140089
downvote count: 0
favorite count: 0
answer count: 0
tagged with: rss
type: UnansweredQuestion

http://stackoverflow.com/comment/46239458
comment on: http://stackoverflow.com/q/28995561
score: 0
has text: Thanks eicto, I will update the post,
type: Comment
type: QuestionComment

if-statement
tags question: http://stackoverflow.com/q/28940199
tags question: http://stackoverflow.com/q/29059035
tag name: if-statement
type: Tag
tags question: http://stackoverflow.com/q/29002186
tags question: http://stackoverflow.com/q/28914434
tags question: http://stackoverflow.com/q/28907075
tags question: http://stackoverflow.com/q/28922568
tags question: http://stackoverflow.com/q/29053105
tags question: http://stackoverflow.com/q/28918435
tags question: http://stackoverflow.com/q/28977130
tags question: http://stackoverflow.com/q/28968429
tags question: http://stackoverflow.com/q/28996664
tags question: http://stackoverflow.com/q/28985002
tags question: http://stackoverflow.com/q/29056415
tags question: http://stackoverflow.com/q/28955351
tags question: http://stackoverflow.com/q/29011565
tags question: http://stackoverflow.com/q/29005724
tags question: http://stackoverflow.com/q/28993019
tags question: http://stackoverflow.com/q/28983907
tags question: http://stackoverflow.com/q/28915672
tags question: http://stackoverflow.com/q/29056641

http://stackoverflow.com/comment/46143024
score: 2
has text: My guess is that it is displaying undefined because the loop is repeating and jQuery(this).val().split('/')[2] is causing a problem. Maybe console.log on this and this.val() right at the beginning of the loop's block?
comment on: http://stackoverflow.com/q/28943812
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/49632702
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28974156
has text: where I should add CFRunLoopAddObserver. I was trying to take screenshot with delayed perform selector in webviewDidFinishLoading.
type: AnswerComment

http://stackoverflow.com/comment/46089299
has text: Yes,when I removed this code `#RewriteRule ^(.*)/$ /$1 [L,R=301]` from my htaccess file,issue solved.
type: AnswerComment
comment on: http://stackoverflow.com/a/28913630
score: 0
type: Comment

http://stackoverflow.com/comment/137111849
type: Comment
comment on: http://stackoverflow.com/a/56713809
type: AnswerComment
has text: @Yusuf Take a look at all the non-blocking API (except Windows overlapped I/O). All the API calls block at the function call and the function only return when there's an event (or timeout - which is also an event). On Unixen the most popular asynchronous I/O API are select: https://man7.org/linux/man-pages/man2/select.2.html, epoll: https://man7.org/linux/man-pages/man7/epoll.7.html and kqueue: https://man.openbsd.org/kqueue.2. Look at the manual pages of all 3. They all block the thread...
score: 0

http://stackoverflow.com/a/47587167
score: 0
answers question: http://stackoverflow.com/q/28917363
type: Answer
has body: you must be initialize your particle.js script first, then only you initialize another scripts

http://stackoverflow.com/q/28917634
has comment: http://stackoverflow.com/comment/46093215
answer count: 0
tagged with: http://stackoverflow.com/tag/json
has body: fiddle here http://jsfiddle.net/prantikv/owtakr1a/6/ i have html like so company1 company2 company3 {{key}}::{{val}} what i want is that when the user selects the company1 only its sub data should be displayed the javascript is var myApp = angular.module('myApp',[]); function MyCtrl($scope) { $scope.info={ "company1": {"employee":"*2", "rooms":"*6", "vehicals":"3"}, "company2": {"employee":"*2", "rooms":"*6"}, "company3": {"employee":"*2", "rooms":"*6", "vehicals":"3"} }; } it works fine on single level object but i cant get it working on 2nd level i tried the (key,val) in info but the filter doesn't seem to work then
type: Question
has comment: http://stackoverflow.com/comment/46092998
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46093039
has comment: http://stackoverflow.com/comment/46092951
has title: Angular filter object and sub Object
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/q/28938019
score: 1
has comment: http://stackoverflow.com/comment/46131773
type: Question
has comment: http://stackoverflow.com/comment/46137507
tagged with: canvas
has comment: http://stackoverflow.com/comment/46131187
downvote count: 0
has comment: http://stackoverflow.com/comment/46137324
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has title: Is there a way to cache when using html canvas to draw 20000 same circles?
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: In chrome, using html canvas to draw 20000 moving circles at the same time will cause non-fluency. However, drawing 20000 moving rectangles is fluent. I think it's because that getting the points of circles to draw is time-consuming. And my questions is as follows: Why doesn't chrome cache the points of one circle, so that it can calculate once and use the result to draw the 19999 circles left? Is there a way to make it by using JavaScript?

http://stackoverflow.com/q/28931074
favorite count: 0
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/28931101
has answer: http://stackoverflow.com/a/28931271
tagged with: angularjs-ng-repeat
score: -1
possible better answer: http://stackoverflow.com/a/28931271
answer count: 2
downvote count: 1
tagged with: javascript
has title: Angular JS, add filter condition to ng-repeat
has body: I have this: I would like to add a filter to the ng-repeat so if link.url is a specific string(/myfolder/mypage.aspx). I would like to not show that anchor tag. I have tried this: How do I compare link.url with a specific string? please help.
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/28931101
tagged with: jquery

http://stackoverflow.com/comment/46091981
type: Comment
type: QuestionComment
has text: http://stackoverflow.com/questions/9722624/how-to-stop-ffmpeg-remotely Use `ffmpegrec.kill('SIGINT');`
comment on: http://stackoverflow.com/q/28917056
score: 0

http://stackoverflow.com/comment/46244886
has text: Please post relevant code.
score: 5
comment on: http://stackoverflow.com/q/28998387
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46258472
has text: Wait. now it won't show when the screen width is greater than 600px?
comment on: http://stackoverflow.com/q/29006066
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46302502
type: QuestionComment
has text: [EDIT]Thanks Paul. I saw your comment after posting mine. The redirect url also has the same origin. So I was not getting security error. It was just that I had to enable some option in the request module[EDIT]. I found the solution to this problem. I used the request npm module. Make sure you read through the documentation and read about follow redirects and jar option.
score: 0
comment on: http://stackoverflow.com/q/29026071
type: Comment

http://stackoverflow.com/comment/46158044
score: 1
comment on: http://stackoverflow.com/q/28952006
has text: Why not use pipes `|` as a separator between the values?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46189082
has text: While this code snippet may solve the question, [including an explanation](http://meta.stackexchange.com/questions/114762/explaining-entirely-code-based-answers) really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion.
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28963841

http://stackoverflow.com/comment/46224599
type: Comment
has text: paste in http://jsfiddle.net/ , and come back please.
comment on: http://stackoverflow.com/q/28988043
score: 0
type: QuestionComment

http://stackoverflow.com/q/29051421
accepted answer: http://stackoverflow.com/a/29051536
has comment: http://stackoverflow.com/comment/46340691
has comment: http://stackoverflow.com/comment/46340929
type: AnsweredQuestion
has body: I am displaying a throbber when I do an ajax post. Below is how I am doing it. I would like to make the code more concise. Could I extend $.post to do so? Other options? Thanks //myThrobber is an object that displays a throbber in the center of the page myThrobber.start(); $.post('somePage.php',myData,function (json){ myThrobber.stop(); //do whatever },'json');
has comment: http://stackoverflow.com/comment/46340891
type: Question
answer count: 1
tagged with: javascript
has title: Add throbber to jQuery post()
tagged with: jquery
has answer: http://stackoverflow.com/a/29051536
tagged with: ajax
has comment: http://stackoverflow.com/comment/46340663
score: 0

http://stackoverflow.com/comment/46099960
score: 1
has text: This doesn't move the focus from one menu to the next on hover.
type: AnswerComment
comment on: http://stackoverflow.com/a/28920943
type: Comment

http://stackoverflow.com/comment/128089848
type: AnswerComment
comment on: http://stackoverflow.com/a/72507522
type: Comment
has text: Please add supporting info to your answer to improve it.
score: 1

http://stackoverflow.com/a/28975660
type: Answer
has comment: http://stackoverflow.com/comment/46203052
has body: Short answer is: This cannot work since document.referrer is a URI, not the referring document. In theory, you could load that page (again) and do a lot of magic to obtain its background image. In general however (i.e. if the referrer can be any page), you won't be able to load it from Javascript anyway due to all kinds of security restrictions. If in your use case you are in control of the referring page it is probably best to find a different solution to pass that information to the navigation target, but you would have to be more clear on your use case.
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28975527
has comment: http://stackoverflow.com/comment/46202926
has comment: http://stackoverflow.com/comment/46202834
downvote count: 0
has comment: http://stackoverflow.com/comment/46202865

http://stackoverflow.com/a/30788349
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29009566
has body: I was having the exact same problem and spent hours re-converting my SHP file to GeoJSON/Topojson in command line with different settings. The solution is quite simple! - Get QGIS here: https://www.qgis.org/en/site/forusers/download.html - open your SHP file or GeoJSON file - Select the layer you want to export - Go to Layer > Save as - Format: Geojson - CSR: WGS 84, EPSG: 4326 - Save. Enjoy!
downvote count: 0
has comment: http://stackoverflow.com/comment/51629945
type: Answer
has comment: http://stackoverflow.com/comment/49627736

http://stackoverflow.com/q/29049907
score: 1
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29053853
has comment: http://stackoverflow.com/comment/46344729
has body: I use Google Page Speed CSS load script to defer the my larger css file. &lt;script async&gt; var cb = function() { var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = '&lt;?php echo $root; ?&gt;css/custom.css'; var h = document.getElementsByTagName('head')[0]; h.parentNode.insertBefore(l, h); }; var raf = requestAnimationFrame || mozRequestAnimationFrame || webkitRequestAnimationFrame || msRequestAnimationFrame; if (raf) raf(cb); else window.addEventListener('load', cb); &lt;/script&gt; How can I also defer these scripts? &lt;link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'&gt; &lt;link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"&gt;
accepted answer: http://stackoverflow.com/a/29053853
answer count: 1
downvote count: 0
favorite count: 0
has title: How to defer multiple CSS files with Google Page Speed CSS load script
has comment: http://stackoverflow.com/comment/46341118
has comment: http://stackoverflow.com/comment/46337994
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46341538

http://stackoverflow.com/q/28934070
has comment: http://stackoverflow.com/comment/46134328
tagged with: search
score: 0
has comment: http://stackoverflow.com/comment/46124169
has body: What is the correct way to output a item for a on a live search using ReactJS? I'm using $("#livesearchdesc").html(rows.join("")); in order to populate the , but the problem comes when it tries to add the rows array. The rows array is populated like this: rows.push( item.iditem item.descripcion ) I've tried to use dangerouslySetInnerHTML={{__html: rows}} but it doesn't work for me. Do you know anything I can do in order to fix this problem?
has title: Output HTML in ReactJS with onClick function on a live search div
has comment: http://stackoverflow.com/comment/46144100
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46136111
has comment: http://stackoverflow.com/comment/46124525
answer count: 0
type: Question
tagged with: reactjs
tagged with: javascript

http://stackoverflow.com/q/28926980
has title: Polymer - Accessing DOM input element inside a custom element
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28927619
has answer: http://stackoverflow.com/a/28927619
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
type: Question
has body: I just started working SNAP with polymer & everything seems to work fine for me,except that i am not able to access or set the value to the input field that is under a custom element. Please guide me through as to how to access/set the value to it. The code is as follows.. Source: Destination: Flight:
has answer: http://stackoverflow.com/a/28927660
tagged with: polymer
accepted answer: http://stackoverflow.com/a/28927660

http://stackoverflow.com/comment/46224703
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28972963
has text: @user3784238 Yes, it looks like they're using the DefaulButton in that. If you look at the link above it contains a simple example. All it does is makes sure the search button is pressed(form submitted) if they're typing into the search box or otherwise hitting enter can either do nothing or submit another form on the page.
type: AnswerComment

http://stackoverflow.com/comment/46276420
type: Comment
score: 0
has text: I think it is an illusion to think that there would be no solution to copy your page. It is always possible to disable JavaScript for example, or just this function of JS, and as soon as some information is on some screen, it can be copied.
type: QuestionComment
comment on: http://stackoverflow.com/q/29015788

http://stackoverflow.com/q/28959856
answer count: 3
has answer: http://stackoverflow.com/a/28960021
has comment: http://stackoverflow.com/comment/46172168
has title: select row table using ajax (jquery)
tagged with: javascript
tagged with: jquery
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28960021
type: AnsweredQuestion
has body: I want to send(delete) id and p_type value from row table td value by using ajax. to detete row according to selected row id Printer name Click <?php foreach ($value->result() as $row) { ?> <?php echo $row->ipt_id;?> <?php echo $row->ink_printer_type;?> <?php } ?> and this is the ajax. I try to take value for each row but still not work. Can I use this way or if there is another way please tell me.
has answer: http://stackoverflow.com/a/28960008
possible better answer: http://stackoverflow.com/a/28959908
has answer: http://stackoverflow.com/a/28959908
type: Question
has comment: http://stackoverflow.com/comment/46172359
score: 0

http://stackoverflow.com/a/29001472
answers question: http://stackoverflow.com/q/29001455
accepted answer of: http://stackoverflow.com/q/29001455
score: 2
type: AcceptedAnswer
downvote count: 0
has body: You can't access a variable name like that, instead what you can do is to access a object's property with a dynamic key Assuming the variables userOne/userTwo are in the global scope, you can use the bracket notation like var userOne = "&lt;p&gt;userOne info&lt;p&gt;"; var userTwo = "&lt;p&gt;userTwo info&lt;p&gt;"; var userThree = "&lt;p&gt;userThree info&lt;p&gt;"; $('.item').on("click", function () { var printId = window[this.id]; $('.bio').html(printID); }); another option is to store those values as properties of an object var user = { userOne: "&lt;p&gt;userOne info&lt;p&gt;", userTwo: "&lt;p&gt;userTwo info&lt;p&gt;", userThree: "&lt;p&gt;userThree info&lt;p&gt;" }; $('.item').on("click", function () { var printId = user[this.id]; $('.bio').html(printID); });
type: Answer
upvote count: 2

http://stackoverflow.com/a/32047873
accepted answer of: http://stackoverflow.com/q/28955140
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28955140
has body: To formalise Brandon Pugh's answer in the comments: The method is componentWillUnmount. The problem will be because of the capitalised M: ... }, componentWillUnMount:function() { // &lt;- should be componentWillUnmount console.log("goodbye cruel world!"); ...
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46144750
type: Comment
comment on: http://stackoverflow.com/a/28944975
type: AnswerComment
has text: Thanks...is there documentation that lists the event listeners? I couldn't find a list...just random bits scattered on the readme and issue of the github repo.
score: 0

http://stackoverflow.com/comment/46195955
type: Comment
type: AnswerComment
has text: Thanks, i knew it was simple !
score: 0
comment on: http://stackoverflow.com/a/28972274

http://stackoverflow.com/comment/46224761
type: Comment
type: QuestionComment
has text: @Xan, I know and I tried Asynchronous XMLHttpRequest, with a little success, I also explicitly state that I would like to know the solution if using FileReader but nobody cares...
comment on: http://stackoverflow.com/q/28985562
score: 0

http://stackoverflow.com/q/29043988
favorite count: 0
has answer: http://stackoverflow.com/a/29044048
score: 2
type: AnsweredQuestion
downvote count: 0
has title: Merging the elements of nested arrays into one big array
type: Question
possible better answer: http://stackoverflow.com/a/29044021
has answer: http://stackoverflow.com/a/29044021
tagged with: javascript
has body: I'm trying to merge the elements of the array into one big array. But I receive a message saying: ReferenceError: reduce is not defined Here is my code: var arrays = [[1, 2, 3], [4, 5], [6]]; console.log(reduce(arrays, function(arrayOne, arrayTwo){ return arrayOne.concat(arrayTwo); }, 0));
has comment: http://stackoverflow.com/comment/46327817
linked to: http://stackoverflow.com/q/10865025
upvote count: 2
accepted answer: http://stackoverflow.com/a/29044048
answer count: 2

http://stackoverflow.com/q/29010639
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29011101
accepted answer: http://stackoverflow.com/a/29010809
has title: Promises and uploading data
answer count: 3
tagged with: jquery
has body: I've got some problems regarding sending a form online or saving it locally. I have an Phonegap application which is just a simple form which get saved to a database, or if that fails, locally. I have everything set up only this fucntion. Firstly I thought, I just do it with Boooleans, run the fucntion and if everything goed well return True. But that doesn't work because the code just gets executed before I have a value to compare, which means the value will be always false. This is the code now: if(uploadDataAndImage(formData)) { //Its true, do my things } else { //Its false } This is the boolean fucntion: function uploadDataAndImage(dataForm) { var localURL = dataForm.cardurl; console.log(localURL); if(localURL == "") { $$.ajax({ type: "POST", url: "upload.php", crossDomain: true, data: dataForm, success:function(data) { console.log("Upload to server without card"); return true; }, error: function() { console.log("Form couldn't upload to the server"); //alert("Couldnt upload to server, saving locally"); return false; } }); } else{ //set upload options var options = new FileUploadOptions(); options.chunkedMode = false; console.log("Start upload picture"); var ft = new FileTransfer(); ft.upload(deLokaleURL, encodeURI("uploaderino.php"), win, fail, options); function win(r) { console.log("Code = " + r.responseCode); console.log("R" + r.response); console.log("Sent = " + r.bytesSent); dataForm.cardurl = r.response; var dataString = JSON.stringify(dataForm); $$.ajax({ type: "POST", url: "upload.php", crossDomain: true, data: dataForm, success:function(data) { console.log("Upload to server with card"); return true; }, error: function() { console.log("Form couldn't upload to the server, do nothing"); return false; } }); } function fail(error) { //alert("An error has occurred: Code = " + error.code); console.log("An error has occurred: Code = " + error.code); console.log("upload error source " + error.source); console.log("upload error target " + error.target); showMessa…
favorite count: 0
tagged with: promise
possible better answer: http://stackoverflow.com/a/29010883
has answer: http://stackoverflow.com/a/29010883
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29010809

http://stackoverflow.com/comment/46312861
type: Comment
type: QuestionComment
score: 0
has text: Just add CSS: http://plnkr.co/edit/4YoJ7UaxDXxMYFk9CKJP?p=preview
comment on: http://stackoverflow.com/q/29035099

http://stackoverflow.com/comment/46302787
score: 0
type: Comment
has text: @robert.. yes you must rewrite the code again, since input type number will simply discard any NAN value from it
comment on: http://stackoverflow.com/a/29030810
type: AnswerComment

http://stackoverflow.com/comment/46098596
comment on: http://stackoverflow.com/a/28919920
score: 0
type: AnswerComment
has text: Here is an update. Got to use negative margin in that case. http://jsfiddle.net/52pxbfcs/19/
type: Comment

http://stackoverflow.com/a/28952701
answers question: http://stackoverflow.com/q/28952644
type: Answer
score: 2
upvote count: 2
has body: Your non-capture group is not capturing. The 0th element of the array is always the full value. If you want to capture just the value, you have to put parenthesis around what you want to capture: &gt; /(?:\?id=){1}([a-z0-9]+)/.exec('?id=0061ecp6cf0q') ["?id=0061ecp6cf0q", "0061ecp6cf0q"] EDIT: You put parenthesis around just ([a-z0-9]), which will match one character (in this case q), not the whole thing including the +.
accepted answer of: http://stackoverflow.com/q/28952644
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46192331
has text: I just saw that https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument mentions that there is `de-DE-u-co-phonebk` to request the German phone book sorting (don’t know whether that is explicitly implemented by common browsers). If that specifically exists for that purpose, then one might assume that the “other” sorting should be the default.
comment on: http://stackoverflow.com/a/28967780
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/comment/46222692
comment on: http://stackoverflow.com/a/28986975
type: Comment
has text: You need to do `$("#form_id").trigger("reset");` I implemented in my code and working fine. Downvoter please comment for `downvote ?????`
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46242894
type: Comment
comment on: http://stackoverflow.com/a/28997258
has text: What's strange is that after revising my `validator` variable I still don't get an alert response within my conditional.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29011001
has body: i have a logo listing which I would like to enhance with an hover effect. (logo in color &lt;-> logo in black and white) I have the following markup: var sourceToggle = function () { var $this = $(this); var newSource = $this.data('hover'); $this.data('hover', $this.attr('src')); $this.attr('src', newSource); } $(function() { $('img[data-hover]').each(function() { new Image().src = $(this).data('hover'); }).hover(sourceToggle, sourceToggle); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;a href="url"&gt; &lt;img src="http://lorempixel.com/200/200/sports/1/" data-hover="http://lorempixel.com/g/200/200/sports/1/"&gt; &lt;/a&gt; This code is working fine so far, but I would like to know if it is good code, or if I could make it shorter. Also I would like to know if it is possible to preload the hover image, because sometimes it is not loaded fast enough and I see a flickering.
tagged with: css
type: AnsweredQuestion
has title: swapping images on hover with preload
has comment: http://stackoverflow.com/comment/46267288
accepted answer: http://stackoverflow.com/a/29011790
type: Question
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46267623
tagged with: jquery
has comment: http://stackoverflow.com/comment/46267194
possible better answer: http://stackoverflow.com/a/29011285
has answer: http://stackoverflow.com/a/29011790
has answer: http://stackoverflow.com/a/29011285
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/46358363
has text: you mean when you click outside you want to change it back or do you mean when you hover out of it then change it back?
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29061023

http://stackoverflow.com/q/29021783
tagged with: javascript
score: 0
has title: Recursive Promise Call- Memory Scope Variable Issue
accepted answer: http://stackoverflow.com/a/29022237
has body: I have these functions for the purpose of retrieving a token through a api call out. If the user enters the wrong password, the promise will reject and on reject the function is called again to give the user another try. If the user enters the right password the first time, there is no issue. But if the user enters a wrong password and tries again...but tries again successfully, I am having a memory issue. Because of the recursive call to callApiToken() on the second try the promise is fullfilled and callApiToken().then(function() { refreshToken(); }) is called. file.token = JSON.parse(tokenString); is completed but in a different memory scope. Not sure what to do about this. I say this because the routine runs successfully. But the global var file is not populated as it should be. createTokenFile() is called first. var file = {}; function createTokenFile() { block = true; callApiToken() .then(function() { refreshToken(); }) // ON THE SECOND RECURSIVE .catch(function() { // RUN refreshToken() IS CALLED callApiToken(); }).finally(function() { block = false; }); } function refreshToken() { var tokenFileAbsolute = path.join(__dirname, 'token-file.json'); return fs.readFileAsync(tokenFileAbsolute, {encoding: 'utf-8'}) .then(function(tokenString) { file.token = JSON.parse(tokenString); }).catch(function(err) { console.log("No token-file.json file found. " .red + "Please complete for a new one." .red); createTokenFile(); }); } UPDATE with other promise code that gives resolve for callApiToken()which is actually getCredentials: Note: fs.writeFileAsync(tokenFile, token) does complete successfully on the second recursive call. function getPassword(user) { return readAsync({prompt: "Password: ", silent: true, replace: "*" }) .then(function(pass) { return postAsync(URL, payload(user[0], pass[0])); }); } function getCredentials() { return readAsync({prompt: "Username: "}).then(getPassword); } function writeToFile(data, response) { tokenFile = path.join(__dirname, 'token-file.js…
tagged with: node.js
tagged with: promise
has comment: http://stackoverflow.com/comment/46287553
has comment: http://stackoverflow.com/comment/46286745
type: AnsweredQuestion
tagged with: bluebird
has comment: http://stackoverflow.com/comment/46286817
has answer: http://stackoverflow.com/a/29022237
type: Question
has comment: http://stackoverflow.com/comment/46287510
answer count: 1

http://stackoverflow.com/a/29054667
type: Answer
upvote count: 1
has body: change i to other parameter like ii .it seems i is in use with that calendar.
answers question: http://stackoverflow.com/q/29054633
score: 1
downvote count: 0

http://stackoverflow.com/comment/46146746
comment on: http://stackoverflow.com/q/28944599
type: QuestionComment
score: 0
has text: Maybe there is a piece of configuration that I should show, but I have no idea what settings I could be missing.
type: Comment

http://stackoverflow.com/q/28955442
has comment: http://stackoverflow.com/comment/46830338
possible better answer: http://stackoverflow.com/a/28956057
has body: Suppose I have a string such as var x = "This is as,] sent,}encee:. Doo} youu: likei} i,:t." I wanted to know if there is any way to remove all characters that come before either ],}, or :? This would result in "This is as] sent}encee:. Doo} youu: likei} i:t." I know I could probably loop through the string, but do you guys know what any simpler ways? EDIT: Sorry how would you address this if you only wanted to replace the , that come before ],}, or :?
score: 0
has title: How to remove all commas before certain characters in javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28955489
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28956057
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28955489

http://stackoverflow.com/comment/46157546
type: Comment
comment on: http://stackoverflow.com/a/28951669
score: 0
type: AnswerComment
has text: You are very welcome. Tip for next time you need help: Submit **all** relevant source code, you will get help/answers much quicker!

http://stackoverflow.com/a/28991023
answers question: http://stackoverflow.com/q/28985301
score: 0
has comment: http://stackoverflow.com/comment/46262231
has body: If you spend the two hours it takes to run through this (free) video series, you'll be a pro. https://phpacademy.org/videos/php-and-mysql-with-mysqli For reading from textarea: var ta_content = $('#myTA').val(); For updating server: $.ajax({ type: 'post', url: 'your_php_processor_file.php', data: 'ta=' + ta_content, success: function(d){ //anything the server echoes back will be in var " d ". So, for e.g.: if (d.length) alert(d); } }); your_php_processor_file.php: &lt;?php $tarea = $_POST['ta']; //do your mysqli_ input here, using $tarea variable echo 'This goes back to the AJAX block'; Here are some good posts for getting the basics of AJAX: A simple example More complicated example Populate dropdown 2 based on selection in dropdown 1 Note that, for AJAX, you don't need to use the &lt;form&gt; architecture - but if you do, you'll have to suppress the default action of the submit button (because it will navigate to a different page, which is what AJAX is all about preventing). Thus: $('#addDescription-form').submit(function(e){ var ta_content = $('#myTA').val(); $.ajax({ type: 'post', url: 'your_php_processor_file.php', data: 'ta=' + ta_content, success: function(d){ //anything the server echoes back will be in var " d ". So, for e.g.: if (d.length) alert(d); } }); //THIS PART: e.preventDefault(); });
type: Answer

specifications
type: Tag
tag name: specifications
tags question: http://stackoverflow.com/q/28967074

http://stackoverflow.com/comment/46251812
comment on: http://stackoverflow.com/q/29002220
score: 0
has text: it ll work, some where in script file it may have syntax error
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28985220
has comment: http://stackoverflow.com/comment/46238814
has comment: http://stackoverflow.com/comment/46307878
has comment: http://stackoverflow.com/comment/46238292
has comment: http://stackoverflow.com/comment/46297048
has comment: http://stackoverflow.com/comment/46282452
has comment: http://stackoverflow.com/comment/46221123
has comment: http://stackoverflow.com/comment/46283013
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46315058
score: 0
accepted answer of: http://stackoverflow.com/q/28983397
type: Answer
answers question: http://stackoverflow.com/q/28983397
has body: First of all what you need to do is to check the total time of your values. Do this when pressing the start-button. var hours = document.getElementById("hh").value; var minutes = document.getElementById("mm").value; var seconds = document.getElementById("ss").value; var totalTime = 60*60*hours + 60*minutes + seconds; The next step is to separate the growing of your pie to outside the drawing. Right now, you're using rAF, which means you'll update your pie whenever the browser is ready. var degreesPerSecond = 360/totalTime; var updateFrequency = 200; //milliseconds var curDeg = 0; //Keeping track on the currect degree function update() { curDeg += degreesPerSecond/1000*updateFrequency; curPerc = curDeg/360; } When pressing the start-button, you also start an interval. var myInterval = setInterval(update,updateFrequenzy); Check out this update of your fiddle

http://stackoverflow.com/q/29006486
tagged with: validation
has body: I am using jquery validation plugin for i agree terms and conditions in the form as well as for fields, i implemented the form validation, but for i agree terms and conditions i noticed if the caption is in left side of checkbox it working properly, if i make the checkbox caption rightside, then the error message overlap now, if you can look into the demo of jsfiddle you can easily know about what i mean Here is the code Email: I accept the terms and conditions. http://jsfiddle.net/x0wsq59p/ Thanks.
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29010918
score: 0
has title: Overlap I Agree Caption in jQuery Validation
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29010918
possible better answer: http://stackoverflow.com/a/29007435
has answer: http://stackoverflow.com/a/29007435
tagged with: jquery-validate
answer count: 2

http://stackoverflow.com/comment/46328767
score: 1
type: AnswerComment
has text: I am an idiot. I didn't realize that long code was the equivalent of `md5_hex()`
type: Comment
comment on: http://stackoverflow.com/a/29043708

http://stackoverflow.com/a/29023933
has body: $interval takes in a function which will be called every X seconds. var timeBetweenEachInterval = 5 * 1000; //5 seconds (or 5000 milliseconds) var intervalPromise = $interval(function () { //This function will be called every 5 seconds. index = index + 1; if (/*don't need interval anymore*/) { $interval.cancel(intervalPromise); } }, timeBetweenEachInterval);
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29023785
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29023785
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/28917518
has body: I am reading RGBA data from a png file in JavaScript. To do this I draw the image on a canvas and use .getImageData. The data differs from what I expect: Test image: https://raw.githubusercontent.com/FlorianLudwig/imghash/master/test/transparent.png The third pixel's RGBA in JS is: [9, 0, 0, 54] (tested in chrome and firefox) but it should be [12, 0, 0, 54] (at least it is what gimp and python pillow claim). My guesses what could be wrong drawImage does some compositing (setting ctx.globalCompositeOperation to copy does not make any difference) there is some color mangament going on at load time of the image Example Code http://codepen.io/anon/pen/EaemZw Select the test image check console output
accepted answer: http://stackoverflow.com/a/28919250
has title: Reading pixeldata from images in JavaScript returns unexpected results for semi transparent pixels
linked to: http://stackoverflow.com/q/23497925
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28919250
score: 1
has answer: http://stackoverflow.com/a/28917721
type: Question
tagged with: javascript
answer count: 2
tagged with: canvas
upvote count: 1
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/28917721

http://stackoverflow.com/comment/46232931
has text: Highcharts lib has [tutorial](http://www.highcharts.com/docs/working-with-data/data-intro) for working with data.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28957500
type: QuestionComment

http://stackoverflow.com/a/28990672
type: AcceptedAnswer
downvote count: 0
has body: Try to use ' for javascript and obligatory use " for HTML. It will looks like: $('&lt;li class="item" id="item" name="' + infoitem + '"&gt;' + title + '&lt;/li&gt;').appendTo('#sortable'); $('&lt;li class="item" id="item" name="' + infoitem + '"/&gt;').html(title).appendTo('#sortable'); Edit1: var addedTitle="I'am a supe long string".replace('\'', '&amp;#39;'); this is in your fiddler code. Edit2: If you need to replace multiple things: String.prototype.replaceAll = function (searchvalue, newvalue) { return this.split(searchvalue).join(newvalue); };
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28990307
answers question: http://stackoverflow.com/q/28990307
score: 1

http://stackoverflow.com/comment/46279568
type: QuestionComment
comment on: http://stackoverflow.com/q/29017696
score: 3
has text: If you want to hide particular element , then why you need a webmethod unless you need any server code operation, you can directly show/hide them in javascript.
type: Comment

http://stackoverflow.com/q/28922881
accepted answer: http://stackoverflow.com/a/29916458
tagged with: single-page-application
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28941726
has title: Error: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file' : AngularJS SPA
has comment: http://stackoverflow.com/comment/46102868
has comment: http://stackoverflow.com/comment/46102881
type: AnsweredQuestion
upvote count: 9
has body: I'm very new to Angular SPA and for the first time I get a code by Googling and try to run. But I get some errors in Console. I couldn't figure out why, I found list of following Console errors: XMLHttpRequest cannot load file:///C:/Users/hp/Downloads/single-page-app-angularjs-master/home.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. Error: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///C:/Users/hp/Downloads/single-page-app-angularjs-master/home.html'. XMLHttpRequest cannot load file:///C:/Users/hp/Downloads/single-page-app-angularjs-master/about.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. Error: [$compile:tpload] http://errors.angularjs.org/1.3.3/$compile/tpload?p0=home.html Single page web app using Angularjs Home(current) About us Read tutorial
score: 9
type: Question
has comment: http://stackoverflow.com/comment/60597273
answer count: 2
possible better answer: http://stackoverflow.com/a/28941726
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29916458

http://stackoverflow.com/comment/46328930
score: 0
type: AnswerComment
has text: That's my only option, no pun intended. I can't return nothing or something, I can only return something?
type: Comment
comment on: http://stackoverflow.com/a/29044556

http://stackoverflow.com/comment/46211174
type: Comment
has text: yes, actually it is filter function, corrected the answer
comment on: http://stackoverflow.com/a/28980539
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46298024
comment on: http://stackoverflow.com/a/29028094
type: AnswerComment
has text: I am also aiming to keep my code as simple as possible. nothing fancy
score: 0
type: Comment

http://stackoverflow.com/a/29040844
has comment: http://stackoverflow.com/comment/46709339
has comment: http://stackoverflow.com/comment/46725854
has comment: http://stackoverflow.com/comment/46708075
score: 0
answers question: http://stackoverflow.com/q/29039602
type: Answer
has body: Because you say "when another button is clicked", I assume you are trying to make it so there are multiple buttons, each one loading a different image. If this is indeed the case, I'd go with the following approach: // Array of image objects to keep things neat var images = [ { "src": "http://placehold.it/120x160", "width": "120", "height": "160", "alt": "Test Image 1" }, { "src": "http://placehold.it/120x161", "width": "120", "height": "160", "alt": "Test Image 2" } ]; function show_image(image) { // Ensure provided index is in array if (image &lt; images.length) { // Remove this image if already displayed if (document.getElementsByClassName("imageNo" + image)[0] !== undefined) document.getElementsByClassName("imageNo" + image)[0].outerHTML = ""; else { // Remove other images if displayed if (document.getElementById("currentImage") !== null) document.getElementById("currentImage").outerHTML = ""; var img = document.createElement("img"); var cur = images[image]; img.id = "currentImage"; img.className = "imageNo" + image; img.src = cur.src; img.width = cur.width; img.height = cur.height; img.alt = cur.alt; document.body.appendChild(img); } } else console.log('No image exists for this index'); } // Add functionality to buttons document.getElementById("imageButton1").onclick = function() {show_image(0);} document.getElementById("imageButton2").onclick = function() {show_image(1);} Fiddle If you have one button that you'd like to cycle through all the images, you could use the same approach but change show_image to var currentImage = 0; function show_image() { // Remove other images if displayed if (document.getElementById("currentImage") !== null) document.getElementById("currentImage").outerHTML = ""; var img = document.createElement("img"); var cur = images[currentImage++ % images.length]; img.id = "currentImage"; img.src = cur.src; img.width = cur.width; img.height = cur.height; img.alt = cur.alt; document.body.appendChild(img); } function hide_image() { // Remove o…
has comment: http://stackoverflow.com/comment/46522426
has comment: http://stackoverflow.com/comment/46465815

http://stackoverflow.com/comment/46357779
comment on: http://stackoverflow.com/a/29060558
score: 0
has text: `$` and `getJSON` tells me that it requires jQuery.
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/46334682
has text: I've just made an update that might help you give me an answer.
score: 0
comment on: http://stackoverflow.com/q/29047957
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28960773
accepted answer: http://stackoverflow.com/a/28967768
tagged with: google-chrome-extension
answer count: 1
linked to: http://stackoverflow.com/q/11996053
upvote count: 3
downvote count: 2
has title: Chrome Extension workaround with popup html
tagged with: google-chrome
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46306706
has comment: http://stackoverflow.com/comment/46226983
score: 1
has answer: http://stackoverflow.com/a/28967768
has comment: http://stackoverflow.com/comment/46226270
has comment: http://stackoverflow.com/comment/46225593
has comment: http://stackoverflow.com/comment/46318326
has comment: http://stackoverflow.com/comment/46226206
type: Question
has body: My project is a Chrome extension that will do the following. Push the extension icon. Popup will appear (from popup.html) 5 buttons will be in the popup. When you click one of the four buttons, one javascript code will be executed. close popup window. So depending on the answer of this post over here Detect a button click in the browser_action form of a Google Chrome Extension (big ups to Michael for his enormous help) This example is only for one button. Created it with only one of my javascript code and works perfect. But when it comes to put all of the 5 buttons i 've tried to make this kind of coding but it didnt work at all (im new at javascript code so dont hate) Here are the codes MANIFEST.JSON { "background": { "scripts": [ "background.js" ] }, "browser_action": { "default_icon": "img/icon.png", "default_title": "TITLE", "default_popup": "popup.html" }, "icons": { "128": "img/icon_128.png", "19": "img/icon19.png", "38": "img/icon38.png", "48": "img/icon_48_2.png" }, "manifest_version": 2, "name": " NAME", "description": " DESCR ", "permissions": [ "activeTab" ], "version": "2.0" } POPUP.HTML Click1 Click2 POPUP.JS function clickHandler(e) { chrome.extension.sendMessage({directive: "popup-click-l"}, function(response) { this.close(); // close the popup when the background finishes processing request }); } document.addEventListener('DOMContentLoaded', function () { document.getElementById('click-me-l').addEventListener('click', clickHandler); }) function clickHandler(e) { chrome.extension.sendMessage({directive: "popup-click-f"}, function(response) { this.close(); // close the popup when the background finishes processing request }); } document.addEventListener('DOMContentLoaded', function () { document.getElementById('click-me-f').addEventListener('click', clickHandler); }) BACKGROUND.JS chrome.extension.onMessage.addListener( function(request, sender, sendResponse) { switch (request.directive) { case 1 "popup-click-l": // execute the content script chrome.ta…
has comment: http://stackoverflow.com/comment/46229672
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46302293

http://stackoverflow.com/comment/46276492
type: Comment
comment on: http://stackoverflow.com/q/29014976
has text: http://packertest.com/Dropzone/striped.html is my working test file.
score: 0
type: QuestionComment

http://stackoverflow.com/a/28915161
has comment: http://stackoverflow.com/comment/46089198
score: 1
has comment: http://stackoverflow.com/comment/46091348
upvote count: 1
has body: You can try using CSS flex. updated example: http://jsfiddle.net/baLhx3v0/5/ .tableEmulator { display: inline-flex; flex-direction: column; border: 1px solid; border-color: blue; } ul.trEmulator { display:flex; clear:both; border: 1px solid; border-color: red; width:auto; } .trEmulator li { list-style:none; position: relative; padding: 5px 10px; border: 1px solid #eee; } You can find more about Flex here: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
has comment: http://stackoverflow.com/comment/46088582
has comment: http://stackoverflow.com/comment/46092226
has comment: http://stackoverflow.com/comment/46088651
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28915000
has comment: http://stackoverflow.com/comment/46092758
has comment: http://stackoverflow.com/comment/46089260
answers question: http://stackoverflow.com/q/28915000
type: Answer
has comment: http://stackoverflow.com/comment/46092582

http://stackoverflow.com/comment/54616106
type: AnswerComment
type: Comment
has text: I disagree, $timeout causes an extra digest cycle, in my example scope variables are not being modified.
comment on: http://stackoverflow.com/a/31118452
score: 0

http://stackoverflow.com/comment/46129520
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28936913
has text: No, the only way is to fix the error. There are shims that may work for you. Maybe a script wasn't loaded and the error is an undefined variable in which case you can try some SSL related commandline options. This is all very vague.
score: 0

http://stackoverflow.com/comment/46138566
comment on: http://stackoverflow.com/a/28941691
type: Comment
has text: Interesting...looks like the library is not designed to do that :-/
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46272751
comment on: http://stackoverflow.com/a/29013816
score: 0
type: Comment
has text: Thank you very much I already tried it from the beginning of the week. :)
type: AnswerComment

http://stackoverflow.com/q/29038741
has comment: http://stackoverflow.com/comment/46408523
has comment: http://stackoverflow.com/comment/46709969
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29253769
downvote count: 3
type: Question
has body: I am researching XSS, and all I can find so far is that javascript can be used to 1) inject malicious code into let's say a profile page. (A page that is intended to be modified). Or 2) that HTML and javascript can be used to modify the properties of a client-side page as displayed in the browser, and 3) that it can perhaps query information from the web server on the page's privilege level server-side. Should I fear that an XSS vulnerability on my website can actually modify my website's pages server side? (Make some changes that everyone is affected by)
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/46318359
tagged with: javascript
tagged with: xss
accepted answer: http://stackoverflow.com/a/29253769
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46319093
favorite count: 0
has comment: http://stackoverflow.com/comment/46318403
has title: Can XSS Be Used To Modify A Part Of My Website, One That Was Not Intended To Be Modified?
possible better answer: http://stackoverflow.com/a/29087897
score: -3
has answer: http://stackoverflow.com/a/29087897

http://stackoverflow.com/comment/46317609
type: Comment
has text: @LShetty Same problem, `keyup` never runs the function, even on its own. The `boundEvents` always contains `change`, `input`, `keydown`, `keypress`, `keyup`, `paste` despite the event type. I'm also confused at what `'oninput' in document.createElement('input')` is doing here. If we create an `input`, `oninput` is always `in` it.
comment on: http://stackoverflow.com/q/29036164
score: 0
type: QuestionComment

http://stackoverflow.com/q/28930222
has comment: http://stackoverflow.com/comment/46116130
has answer: http://stackoverflow.com/a/28930224
type: Question
tagged with: passwords
has body: My problem: I need, basic authentication over HTTP (client can't afford HTTPS). So I don't worry if communication is not encrypted. I just want to prevent some user from sniffing and using the password (site only used to upload photos and those photos are public.). Toolbox of what I have at my disposal: Javascript PHP Sha512.js The SHA algorithm is the same in both PHP and JS: The proof:(?) &lt;?php $password= "password"; echo hash('sha512',$password); //outputs: b109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706a8bb980b1d7785e5976ec049b46df5f1326af5a2ea6d103fd07c95385ffab0cacbc86 ?&gt; While in JS (all my files are encoded in utf8) document.getElementById("hiddenField").value = JS.sha512("password"); //outputs b109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706a8bb980b1d7785e5976ec049b46df5f1326af5a2ea6d103fd07c95385ffab0cacbc86 However I cannot simply send the same hash on every connection, else anyone can sniff it and send it to connect. So my idea was to use password_hash() function as salt generator. The salt is public, the hash of (password+salt) is public, but password is private and never sent as clear text: the server will compute (hopefully) the same hash as the one in JS from the client and verify that both hashes match. The problem is that regardless of what I do, I'm unable to get the same output when I hash the output of that function(password_hash). It seems to be something related to encoding. I want to use password_hash() because it already keeps into account a lot of security stuff: Javascript: document.getElementById("hiddenField").value = JS.sha512("password" + document.getElementById("publicToken").value); I put the "password_hash" content into another hidden form field that I call "publicToken". Regardless of what I do I'm unable to get the hash match: &lt;?php $salt = ut8_encode(password_hash("another_password")); //doesn't work either In the end, what do I have to do to get a correctly encoded salt? &lt;?php $salt = //... one…
has title: Php's password_hash encoding for HTTP basic authentication
tagged with: javascript
answer count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46122080
tagged with: php
has comment: http://stackoverflow.com/comment/46121586
has answer: http://stackoverflow.com/a/28930223
score: 0
has comment: http://stackoverflow.com/comment/46116131

http://stackoverflow.com/a/29009598
has comment: http://stackoverflow.com/comment/46265836
has comment: http://stackoverflow.com/comment/46266790
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29009343
has comment: http://stackoverflow.com/comment/46265138
has comment: http://stackoverflow.com/comment/46265769
has comment: http://stackoverflow.com/comment/46264977
has comment: http://stackoverflow.com/comment/46267286
has comment: http://stackoverflow.com/comment/46265904
has comment: http://stackoverflow.com/comment/46265710
has comment: http://stackoverflow.com/comment/46264805
has comment: http://stackoverflow.com/comment/46265246
has comment: http://stackoverflow.com/comment/46264736
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46264637
has body: Update Try this (Java 8, see here for more ways to join an array in java) &lt;% String[] array=["books","pens","cars"]; String array_joined = '["' + String.join('","', array) + '"];'; %&gt; or use this instead to join the array in case the String.join menthod is not available &lt;% String[] array=["books","pens","cars"]; String array_joined = '"' + array[0] + '"'; for (int i=1; i&lt;array.length; i++) array_joined += ',' + '"' + array[i] + '"'; array_joined = '[' + array_joined + '];'; %&gt; &lt;script&gt; var javaArray= &lt;%= array_joined %&gt; // renders ["books","pens","cars"]; var tempArrayValue = []; function myFunction(){ for(var i=0,j=0;i&lt;javaArray.length;i++,j++){ tempArrayValue[j]=javaArray[i]; //trying to store ["books","pens","cars"] values into "tempArrayValue" } } &lt;/script&gt; Note i dont remember the jsp tags, so i may have used incorrect tags to render a jsp expresion above, use accordingly found use &lt;%= %&gt; expression tag
type: Answer
answers question: http://stackoverflow.com/q/29009343
score: 2

http://stackoverflow.com/q/29010054
has comment: http://stackoverflow.com/comment/46265280
has answer: http://stackoverflow.com/a/29010142
upvote count: 0
type: Question
score: -2
tagged with: javascript
has body: Room Types & Prices Edit 1 pax 2 pax 3 pax 4 pax 5 pax 6 pax Save {{editMode}} $scope.saveSetting = function(){ $scope.editMode = false; } } my $scope.editmode doesn't change its value, I put an alert the function did fire. Any idea?
downvote count: 2
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: ng-click fired function but couldn't change $scope.var

http://stackoverflow.com/a/29038034
score: 1
downvote count: 0
has body: just replace var value = 1; with scope.value = 1;
type: Answer
answers question: http://stackoverflow.com/q/29037895
upvote count: 1

http://stackoverflow.com/comment/46196262
has text: @nicholas79171 don't be afraid to use that JS I've provided you, tweak it. Improve it as explained above. I would also increase the space between the sections.
comment on: http://stackoverflow.com/a/28954777
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46350793
comment on: http://stackoverflow.com/q/29045616
score: 0
type: Comment
type: QuestionComment
has text: There are so many unresolved relative paths on your scripts that the jsFiddle isn't directly runnable. The code in your `setTimeout()` fails because there's no element with a class of `hs_input` in your document, thus `document.getElementsByClassName("hs_input")` returns `null` and then the code fails when you try to get the `[0]` element of that `null`.

http://stackoverflow.com/q/29061949
tagged with: javascript
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/29060291
has title: Titanium: Saving file locally from Android's Camera/Gallery image
has answer: http://stackoverflow.com/a/29074186
type: Question
tagged with: android
tagged with: titanium
tagged with: titanium-mobile
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46364255
accepted answer: http://stackoverflow.com/a/29074186
tagged with: android-camera
has comment: http://stackoverflow.com/comment/46372123
has body: I am having issues saving image to local application files in Titanium. Specifically creating file from event.media; function handleImageEvent(event) { imgpreview.image = event.media; var imaget = event.media; var f = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,imagename); f.write(imaget); } //imagename : I am using in the format of 'photo0.png' Here's the code I have so far that I have tried to put together and test through my own search, they do not work. exception were thrown [WARN] : TextView: TextView does not support text selection. Action mode cancelled. [ERROR] : TiFileProxy: (KrollRuntimeThread) [5233,84017] IOException encountered [ERROR] : TiFileProxy: java.io.IOException: read only [ERROR] : TiFileProxy: at org.appcelerator.titanium.io.TiResourceFile.write(TiResourceFile.java:100) [ERROR] : TiFileProxy: at org.appcelerator.titanium.TiFileProxy.write(TiFileProxy.java:286) [ERROR] : TiFileProxy: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] : TiFileProxy: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) [ERROR] : TiFileProxy: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) [ERROR] : TiFileProxy: at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR] : TiFileProxy: at android.os.Looper.loop(Looper.java:137) [ERROR] : TiFileProxy: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) I hope I can provide more details, but I am at lost, apologies Thanks in advance.

http://stackoverflow.com/q/29013976
has answer: http://stackoverflow.com/a/29014106
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29014066
score: 1
has answer: http://stackoverflow.com/a/29014066
accepted answer: http://stackoverflow.com/a/29014035
type: Question
tagged with: for-loop
tagged with: arrays
downvote count: 0
tagged with: javascript
has title: for each table push to array
favorite count: 0
has body: I'm a beginner with code, I'm trying to run on this table and get the text from each .winner class and push it to an Array, so instead of getting: ["aa","aa","dd"] I'm getting ["aaaadd","aaaadd","aaaadd"] $(document).ready(function(){ var arr = []; var winner = $('.winner').text() ; for ( i = 0; i < $('table').length ; i++ ) { arr.push(winner); } console.log(arr); }); HTML: # aa bb cc dd # aa bb cc dd # dd cc bb aa I guess something is wrong with my for loop
answer count: 3
has answer: http://stackoverflow.com/a/29014035
upvote count: 1

http://stackoverflow.com/q/29057270
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29057324
has answer: http://stackoverflow.com/a/29057374
answer count: 4
score: 2
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/86513
type: Question
has body: Given the following object: var obj = { a: 1 }; and the following string: var s = "b: 2"; what I need is to end with the following object, after evaluating the string s: obj === { a:1, b:2 } I tried with eval but couldn't figure it out. any ideas?
has comment: http://stackoverflow.com/comment/46351566
has title: How to add a property in a string to an object in javascript?
has answer: http://stackoverflow.com/a/29057305
accepted answer: http://stackoverflow.com/a/29057305
upvote count: 2
has answer: http://stackoverflow.com/a/29057420
possible better answer: http://stackoverflow.com/a/29057324

gulp-inject
tag name: gulp-inject
type: Tag
tags question: http://stackoverflow.com/q/28950193

http://stackoverflow.com/comment/46204294
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28976431
score: 1
has text: @jimmyjansen—see [*ECMA-262 §11.4.3*](http://ecma-international.org/ecma-262/5.1/#sec-11.4.3). Some consider it a specification bug that the *typeof* operator doesn't necessarily reflect the actual [*Type*](http://ecma-international.org/ecma-262/5.1/#sec-8).

http://stackoverflow.com/comment/46244728
score: 0
comment on: http://stackoverflow.com/q/28998007
type: Comment
type: QuestionComment
has text: Can use check that document.getElementById(...) returns the CheckBox element?

http://stackoverflow.com/comment/46089207
comment on: http://stackoverflow.com/q/28915454
score: 0
has text: Did you set up server to recognize the html5 mode virtual directories?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/125414234
type: Comment
comment on: http://stackoverflow.com/q/29041660
has text: Your original approach (diff the current vs. latest selection arrays) is both simple and correct. I implemented it here: https://stackoverflow.com/questions/70934630/implement-exclusive-option-in-multi-select-clear-other-entries-on-selecting-it The accepted answer is hard to follow.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28964370
tagged with: javascript
has body: I have an action div like below The School for Gods #1 When /sertanarig/calismalar/theschoolofgods# clicked, it supposed to send theschoolofgods# to the controller as an argument, but it just sends theschoolofgods, and leaves out the hash symbol and page goes to the top. How can I solve this problem?
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46180768
accepted answer: http://stackoverflow.com/a/28964569
possible better answer: http://stackoverflow.com/a/28964614
has comment: http://stackoverflow.com/comment/46180589
has answer: http://stackoverflow.com/a/28964614
tagged with: http://stackoverflow.com/tag/html
has title: hash in href link to be sent to controller
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46180456
type: Question
has answer: http://stackoverflow.com/a/28964569
tagged with: asp.net-mvc

http://stackoverflow.com/q/29032901
answer count: 2
has body: I'm using this code to match if href attribute starts with # and according to that to add class: $('.navbar-nav a').each(function(index, element) { if($(element).attr("href").match("^#")) { //Add class to inernal links $(element).addClass("internal"); } else { //Add class to external links $(element).addClass("external"); } }); Now I have problem to match if href starts with /#. I tried with '^/#' but it doesn't work. I'll appreciate any help. Update Here is the whole code I'm using: jQuery.noConflict(); (function( $ ) { $(function() { /*********************************************************************************************************/ /* -------------------------------------- Navigation ------------------------------------------ */ /*********************************************************************************************************/ //Add class to inernal and external links $('.navbar-nav a').each(function(index, element) { if($(element).attr("href").match(/^\/?#/)) { //Add class to inernal links $(element).addClass("internal"); } else { //Add class to external links $(element).addClass("external"); } }); var lastId, topMenu = $(".navbar-nav"), topMenuHeight = topMenu.outerHeight(), // All list items without external links menuItems = topMenu.find("a").not(".external"), // Anchors corresponding to menu items scrollItems = menuItems.map(function() { var item = $($(this).attr("href")); if (item.length) { return item; } }); // Bind click handler to menu items // so we can get a fancy scroll animation menuItems.click(function(e) { if (!$(this).hasClass("dropdown-toggle")) { var href = $(this).attr("href"), offsetTop = href === "#" ? 0 : $(href).offset().top - topMenuHeight + 1; $('html, body').stop().animate({ scrollTop: offsetTop }, 1450, 'easeInOutQuart'); e.preventDefault(); } }); // Bind to scroll $(window).scroll(function() { // Get container scroll position var fromTop = $(this).scrollTop() + topMenuHeight; // Get id of current scroll item var cur = sc…
has comment: http://stackoverflow.com/comment/46317527
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29032919
has answer: http://stackoverflow.com/a/29033009
has answer: http://stackoverflow.com/a/29032919
tagged with: regex
has comment: http://stackoverflow.com/comment/46306808
type: AnsweredQuestion
has title: How to match '/#' in href
has comment: http://stackoverflow.com/comment/46306677
accepted answer: http://stackoverflow.com/a/29033009
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/q/29045218
accepted answer: http://stackoverflow.com/a/29045261
downvote count: 1
type: Question
has body: I have the table below which hides all the child rows by default. I'd like to toggle all child rows right underneath the corresponding clicked root row. That is, the n .child rows next to the clicked .root. How can I do this in pure Javascript? .hidden { display:none; } Root Child 1 Child 2 Child 3 Child 4 Root Child 1 Child 2
tagged with: javascript
score: -1
has title: Javascript - how to toggle all next singlings until class found
upvote count: 0
answer count: 1
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29045261

http://stackoverflow.com/q/29040130
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has title: How do I detect that a div with overflow has scrolled to the bottom?
has body: &lt;div id="item-group" class="scroll-box"&gt;&lt;/div&gt; .scroll-box { overflow-x: hidden; overflow-y: auto; max-height: calc(100vh - 300px); } I want to load items as the user scrolls. I've been facilitating this by detecting when they scroll to the bottom of the screen. I've been trying to do the same with the a div element and can't quite figure it out.
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29040221
accepted answer: http://stackoverflow.com/a/29040221
score: 0
has comment: http://stackoverflow.com/comment/46321553
answer count: 1
tagged with: jquery
linked to: http://stackoverflow.com/q/6271237

http://stackoverflow.com/a/29000729
answers question: http://stackoverflow.com/q/29000634
score: 1
downvote count: 0
has body: When you're setting up the mock data, you're only setting them on $scope.projects...the factory's projects is never updated. You could flip it around and it should work: projects.projects = [&lt;mock data&gt;]; $scope.projects = projects.projects;
type: Answer
upvote count: 1

http://stackoverflow.com/comment/100560801
type: AnswerComment
comment on: http://stackoverflow.com/a/28914364
type: Comment
has text: Funny enough I saw this but didn't understand it and then thought up the same answer and was going to post it. You're basically saying find where the character is at (11) and building a substring off of it and then counting the number of new lines before the match. Makes perfect sense
score: 0

http://stackoverflow.com/comment/46249671
has text: I just divided the value by 5 and everything is working great. Thanks for the help. It is very much appreciated.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29000584
type: AnswerComment

http://stackoverflow.com/q/28970570
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
has title: Meteor: how to loop over an array which is the result of an asynchronous method
answer count: 2
has answer: http://stackoverflow.com/a/28971231
has answer: http://stackoverflow.com/a/28971057
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I have an asynchronous method which does a Facebook request for retrieving photos from the current logged in user. I have a template where I loop over these results. But since the call to Facebook is asynchronous, it fails. &lt;template name="mytemplate"&gt; {{#if photos}} {{&gt; images pics=photos}} {{/if}} &lt;/template&gt; &lt;template name="images"&gt; {{#with pics}} {{#each this}} {{images}} {{/each}} {{/with}} &lt;/template&gt; Here is my javascript: Template.mytemplate.helpers({ photos: function () { return Template.instance().myAsyncValue.get(); } }); Template.mytemplate.created = function (){ var self = this; self.myAsyncValue = new ReactiveVar("Waiting for response from server..."); Meteor.call('getPhotos', function (err, data) { if (err) console.log(err); else self.myAsyncValue.set(data.data); }); } I already have a variable that is being watched, but the problem is that my template is already created and the result is not an array yet. Can someone show me the best practices on how to use an asynchronous array result in a template. I want to create image tags in the template, not with jquery or javascript. Thanks
tagged with: facebook
tagged with: meteor
tagged with: asynchronous

http://stackoverflow.com/q/28958942
tagged with: iron-router
has answer: http://stackoverflow.com/a/29002950
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28959008
has title: Dynamically set background-color on html tag
downvote count: 1
has comment: http://stackoverflow.com/comment/46188249
type: Question
has comment: http://stackoverflow.com/comment/46170426
has comment: http://stackoverflow.com/comment/46177951
tagged with: javascript
score: -1
has body: I need to dynamically set the background-color in the html tag. &lt;html style="background-color:{{ backColor }};"&gt; How is this done in Meteor?
possible better answer: http://stackoverflow.com/a/28959008
answer count: 2
upvote count: 0
tagged with: meteor
accepted answer: http://stackoverflow.com/a/29002950
favorite count: 0

http://stackoverflow.com/q/28957599
has answer: http://stackoverflow.com/a/28958026
type: Question
tagged with: javascript
answer count: 2
has title: Select larger value from dropdown
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I have a dropdown with the lists of times. My condition is- select only option whose value is just greater than current time However, I have implemented the way i could do it and this is working fine but there must be a better way of doing this, I am afraid that my implementation may break in some certain conditions. Here is what I have done- HTML- Select Departure Time... 09:00 12:30 15:30 18:30 22:30 01:30 jQuery var arrayTimes = []; $('#RunID option').not(':first-child').each(function () { var timeNow = new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"); if (Date.parse('01/01/2011 ' + $(this).val()) > Date.parse('01/01/2011 ' + timeNow)) { arrayTimes.push($(this)); } }); if (arrayTimes.length > 0) { arrayTimes[0].attr('selected', 'selected'); } and the Demo Edit- May be this question is creating confusion so I simply put an example for this. As in my dropdown there are times 09:00:00,12:30:00,15:30:00... Now the current time is 12:58:25 seconds. so accordingly the default selected value would be 15:30:00 because this is most nearly greater value than this current time. Also, I am not trying to disable any of values which doesn't match with the condition!
has answer: http://stackoverflow.com/a/28958212
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28958212
possible better answer: http://stackoverflow.com/a/28958026
upvote count: 1

http://stackoverflow.com/comment/46150119
score: 1
type: QuestionComment
has text: fi you have an error in line 7 of editform.php it would be helpful for give us more than 2 lines of the file
type: Comment
comment on: http://stackoverflow.com/q/28948000

http://stackoverflow.com/a/28951298
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28951042
has body: This is an untested version. Since you're using jQuery, try the following. $(document).ready(function() { var myEl = $("#theBody"); myEl.on('click', function () { launchIntoFullscreen(myEl[0]); }).trigger("click"); });
upvote count: 1

http://stackoverflow.com/q/28993172
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28993504
has comment: http://stackoverflow.com/comment/46235081
has comment: http://stackoverflow.com/comment/46234655
downvote count: 2
upvote count: 1
type: Question
has body: They asked me to learn JavaScript for work, so I'm doing some of the solutions on Project Euler to help me learn. My solution for problem 8 works for the 4 number example they give, if I change the 13s to 4s, but it doesn't get the right answer for 13 digits as the question wants. I solved this problem forever ago in C and don't remember it giving me this much trouble. Am I doing something wrong with JavaScript or is this a error with my code? In either case, please point me in the right direction. My code: var numbas = "\ 73167176531330624919225119674426574742355349194934\ 96983520312774506326239578318016984801869478851843\ 85861560789112949495459501737958331952853208805511\ 12540698747158523863050715693290963295227443043557\ 66896648950445244523161731856403098711121722383113\ 62229893423380308135336276614282806444486645238749\ 30358907296290491560440772390713810515859307960866\ 70172427121883998797908792274921901699720888093776\ 65727333001053367881220235421809751254540594752243\ 52584907711670556013604839586446706324415722155397\ 53697817977846174064955149290862569321978468622482\ 83972241375657056057490261407972968652414535100474\ 82166370484403199890008895243450658541227588666881\ 16427171479924442928230863465674813919123162824586\ 17866458359124566529476545682848912883142607690042\ 24219022671055626321111109370544217506941658960408\ 07198403850962455444362981230987879927244284909188\ 84580156166097919133875499200524063689912560717606\ 05886116467109405077541002256983155200055935729725\ 71636269561882670428252483600823257530420752963450"; var biggestProduct = 0; var currentProduct = 0; var currentNumbas = {}; function product (proddedNumbas){ var productHolda = 1; for (var i = 0; i &lt; 13; i++) productHolda *= proddedNumbas[i]; return productHolda; } for (var j = 0; j &lt; 1000; j++) for (var i = 0; i &lt; 13; i++){ currentNumbas[i] = numbas[j+i]; currentProduct = product(currentNumbas); if (currentProduct &gt; biggestProduct) biggestProduct = currentProduct; …
has comment: http://stackoverflow.com/comment/46234791
has comment: http://stackoverflow.com/comment/46244170
score: -1
accepted answer: http://stackoverflow.com/a/28993504
has comment: http://stackoverflow.com/comment/46234788
answer count: 1
tagged with: javascript
favorite count: 0
has title: Project Euler number 8

http://stackoverflow.com/q/29044666
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29044738
favorite count: 0
upvote count: 1
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29044842
score: 1
has title: Enabling and disabling required field dynamically
accepted answer: http://stackoverflow.com/a/29044738
has answer: http://stackoverflow.com/a/29044842
has body: I am developing a simple form with two drop downs. The second drop down will be loaded once the first drop down is selected. And based on the second drop down selection, either file upload or text box will be appear. Once the submit button is clicked the file should be uploaded or file name should be get from the form. But I am issue with the required field. I mean when I select the file name option from the 2nd drop down and give file name as input, and submit the form , it still asks for file to load (because I set both as required). Can some one tell me how to set required dynamically?? My Code so for : Sample Form Input Type Select Type : Type Of You Want to Process Text Numbers Special Characters Data Type Select Data Source : Where is your Data? Data is already in Server Need to Upload the File Input File File Name
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29033709
accepted answer of: http://stackoverflow.com/q/29033548
answers question: http://stackoverflow.com/q/29033548
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46309316
type: Answer
has body: Add gem 'rails_12factor', group: :production # Helpful for rails 4 assets on heroku And in /config/environments/production.rb config.assets.compile = true This should work
has comment: http://stackoverflow.com/comment/46308718
has comment: http://stackoverflow.com/comment/57665251
upvote count: 1
has comment: http://stackoverflow.com/comment/46309034
score: 1

http://stackoverflow.com/q/28976493
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28977096
has body: I have a site , where i need visitors to jump between theme previews. To see one of theme's preview i simply add a suffix of /?preview_theme_id=39393-023 to url. But further site viewing is continued in that theme preview mode. It's easy to escape if visitor clicks on link (add another suffix), but if visitor clicks "back" button in browser site stays in that same theme preview mode. Is there any way to add that suffix to an event where visitor clicks "back"?
has title: Add a suffix to "back" button url
has comment: http://stackoverflow.com/comment/46204077
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/46204126
score: 0

http://stackoverflow.com/q/28930457
has comment: http://stackoverflow.com/comment/46116701
has comment: http://stackoverflow.com/comment/46116669
tagged with: live
has body: I have a javascript that has a live function as: $('.myid').live('click', function () { $.jGrowl("Hello The message is so and so ", {'life': 5000}); }) now whenever I click its related link having class as "myid" a Box pops up and shows the message. Now the problem is if the previous box is still active and I click on the "myid" link again I once again get a pop up just below the previous one. As many number of time I click the link that many number of time I get the pop up. I want that only one popup should be visible at a time. Please help.
type: AnsweredQuestion
upvote count: 0
tagged with: javascript
favorite count: 0
has title: limiting the number of time .live() function become active in javascript
type: Question
score: -2
has comment: http://stackoverflow.com/comment/46116637
has answer: http://stackoverflow.com/a/28930529
downvote count: 2
answer count: 1
accepted answer: http://stackoverflow.com/a/28930529

http://stackoverflow.com/comment/46242413
type: QuestionComment
comment on: http://stackoverflow.com/q/28997029
type: Comment
score: 0
has text: Seriously - That is the whole point of a **non**-capturing group. This question is weird (sorry if my comment isn't constructive). Can you change the pattern?

http://stackoverflow.com/q/28977484
favorite count: 0
has answer: http://stackoverflow.com/a/28977833
tagged with: onresize
tagged with: youtube
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/46206406
upvote count: 2
tagged with: iframe
accepted answer: http://stackoverflow.com/a/28977833
has comment: http://stackoverflow.com/comment/46206437
type: Question
has comment: http://stackoverflow.com/comment/46206202
has comment: http://stackoverflow.com/comment/46206379
has comment: http://stackoverflow.com/comment/46206481
has title: Accessing iframe DOM
has comment: http://stackoverflow.com/comment/46206335
tagged with: javascript
has comment: http://stackoverflow.com/comment/46206448
answer count: 1
downvote count: 0
has body: I want to stop YouTube playback onresize i have an iframe and a function function stopTheVideo(){ var div = document.getElementById("tutube"); var iframe = div.getElementsByTagName("iframe")[0].contentWindow; div.style.display = state == 'hide' ? 'none' : ''; func = state == 'hide' ? 'pauseVideo' : 'playVideo'; iframe.postMessage('{"event":"command","func":"' + func + '","args":""}', '*'); }; which I call <body onresize="stopTheVideo();" and I get Uncaught TypeError: Cannot read property 'contentWindow' of undefinedindex10.html:198 toggleVideoindex10.html:206 resizeFunctionsindex10.html:31 onresize Any ideas?

http://stackoverflow.com/comment/46342676
type: Comment
type: QuestionComment
has text: @CBroe That is exactly what I did just before I read your comment. Thanks a lot. I will update my post with the solution. I know for you guys it is probably obvious but it's just incase someone like me has the same problem. Thanks one more time.
score: 0
comment on: http://stackoverflow.com/q/29052119

http://stackoverflow.com/q/28933570
has comment: http://stackoverflow.com/comment/46123484
upvote count: 2
has body: Take the following example: var tag_oh_so_alone_ = '[FieldName]', tag_with_default = '[FieldName:The default value]', the_regex = /\[([a-z]+)(\:([^\]]+))?\]/i; console.log( "Results:\n", tag_oh_so_alone_.replace(the_regex,"1: $1\n 2: $2\n 3: $3\n"), tag_with_default.replace(the_regex,"1: $1\n 2: $2\n 3: $3\n") ); The console reads: Results: 1: FieldName 2: 3: 1: FieldName 2: :The default value 3: The default value What I'd like to do is, within the replacement declaration (in other words, the place where we include "$1" etc), specify basically: if $3 is populated use $3, otherwise use $1. The expected output would be the following: tag_oh_so_alone_ => FieldName tag_with_default => The default value Is this possible?
has comment: http://stackoverflow.com/comment/46123378
type: Question
has comment: http://stackoverflow.com/comment/46123357
accepted answer: http://stackoverflow.com/a/28933613
tagged with: javascript
has comment: http://stackoverflow.com/comment/46123330
has comment: http://stackoverflow.com/comment/46122930
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/46123469
has answer: http://stackoverflow.com/a/28933613
tagged with: regex
score: 2
has title: Javascript `replace` Replacement Fallback
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46123199

http://stackoverflow.com/q/28967128
has body: I am new to Ext JS and am trying to create a JSFiddle using the Ext JS Framework (which is included in the list of Frameworks &amp; Extensions provided by JSFiddle) My Fiddle is here, and the output pane alone can be viewed here. I am expecting to see a toolbar with a breadcrumb trail underneath. In fact I see nothing. I have tested in different browsers but am still not able to see output. I would like to know why I am not able to see the output on JSFiddle. The JSFiddle draws code directly from a Github account and the relevant section is copied below for reference. Ext.onReady(function(){ var breadcrumbView = Ext.create('Ext.toolbar.BreadCrumbs', { renderTo: document.body, gtIconCls:'thread-greaterthan-icon', removeIconCls:'thread-remove-icon', crumbCls:'breadCrumb', width : 700, onRemoveItem:function( btn ){ //This is called when a user clicks on a crumb. The crumb is an Ext.button.Button, if you passed in //the optional param 2 to onItemAdded, it will be attached to this btn as _extraData }, onRemoveSelection:function( aBtn ){ //This is called when a user clicks the &gt; button. The &gt; removes all crumbs abover the &gt; button //aBtn is an array of the buttons that were removed. if( aBtn instanceof Array ){ for( var i=0,l=aBtn.length,itm=null; i&lt;l; i++ ){ } } } }); Ext.create('Ext.toolbar.Toolbar', { renderTo: document.body, width : 700, margin : '5 0 0 0', items : [ { text : 'Add a crumb', scope : this, handler: function() { var text = prompt('Please enter the text for your crumb. Use commas to list crumbs:'); text = text.split(','); for( var i=0, l=text.length,itm=null; i&lt;l; i++ ){ itm = text[i]; //This is how you add an item to the breadcrumb view //Param 1 is some text to show the user //Param 2 is an optional object to attach to the crumb. breadcrumbView.onItemAdded(itm.trim(), {}); } } } ] }); });
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28968525
tagged with: extjs
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/46187611
score: 0
has title: Ext JS toolbar and breadcrumb example not working in JSFiddle
answer count: 1
has answer: http://stackoverflow.com/a/28968525

http://stackoverflow.com/comment/46241594
type: QuestionComment
has text: So it sounds like you need to end the user's web session. In that case, you should just send them to https://www.dropbox.com/logout like the first answer mentions. (You shouldn't include the access_token parameter like that example does though.)
comment on: http://stackoverflow.com/q/28965447
score: 0
type: Comment

http://stackoverflow.com/comment/46296082
type: QuestionComment
comment on: http://stackoverflow.com/q/29026537
has text: I couldnt find the issue but here is a jsfiddle if someone else wants to take a crack at it http://jsfiddle.net/DelightedDoD/5he2n2rb/ , open the console then resize the window, you'll see the log messages and notice the poblem. It's like each element overwrites the last in your plugin like its not setup to work with a collection of elements but rather just one.
score: 0
type: Comment

http://stackoverflow.com/comment/46211883
score: 0
type: Comment
has text: Hi, it still does not fix the issue. Everything is work on localhost. Just when i put the code on server, it wont work. It does not call my Ajax function to call the schoolFormItem.php. I had try to hardcode to call the schoolFormItem.php function, but it only insert data into my database and it does not upload the file into the "Uploads" folder in the server
type: AnswerComment
comment on: http://stackoverflow.com/a/28981079

http://stackoverflow.com/q/29061556
score: 1
tagged with: ember-cli
has answer: http://stackoverflow.com/a/29074171
favorite count: 0
type: Question
possible better answer: http://stackoverflow.com/a/29063248
tagged with: ember.js
answer count: 2
upvote count: 1
accepted answer: http://stackoverflow.com/a/29074171
tagged with: ember-simple-auth
has body: Trying to execute this code within a component's template // components/my-component.js {{#if session.isAuthenticated}} <a {{action 'invalidateSession'}}>Sign out {{else}} {{#link-to 'signin'}}Sign in{{/link-to}} {{/if}} However, when clicking "Sign out" button I get this error Error: <...@component:my-component::ember381> had no action handler for: invalidateSession How do I make "invalidateSession" available from a component?
has title: "Ember Simple Auth" invalidateSession from component
tagged with: javascript
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/29063248

http://stackoverflow.com/comment/52284010
type: Comment
has text: @RutwickGangurde Thanks for your answer. Yes you are right this solution is working. But, I am getting a mix content from editor including the video script tag . So i think this is difficult to extract the right parameters to pass to this function.
type: AnswerComment
comment on: http://stackoverflow.com/a/28986699
score: 0

http://stackoverflow.com/comment/46335053
type: AnswerComment
score: 0
type: Comment
has text: In case of multiple php file url for particular notification, How to assign them here in `url: "/server/" + type + ".php",`
comment on: http://stackoverflow.com/a/29047910

http://stackoverflow.com/q/29021328
has answer: http://stackoverflow.com/a/29021347
duplicate of: http://stackoverflow.com/q/4935632
upvote count: 0
answer count: 1
tagged with: string
has title: Javascript Turn string into array
has body: I want to turn this into an array "["65747add-afd2-45b5-92e0-150bbe40e6d9", "9c247ea5-6b81-4f47-a50c-42367dedd50b", "c1555363-aca9-4e04-8844-e0180397c72e"]" I am getting it from the page like this: $('#layout-uuids').text() Is there away to just get it as an array or do I need to turn the string into an array somehow? Thanks!
favorite count: 0
type: UnansweredQuestion
score: -2
downvote count: 2
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/4935632

http://stackoverflow.com/comment/46132429
type: QuestionComment
has text: @Claies, I actually think it is about Angular, although the request is to trigger a scope-defined function from outside of Angular - I edited the question text and voted to re-open
comment on: http://stackoverflow.com/q/28932581
score: 0
type: Comment

http://stackoverflow.com/q/29039760
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29040579
has answer: http://stackoverflow.com/a/29039810
has comment: http://stackoverflow.com/comment/46320346
tagged with: php
has comment: http://stackoverflow.com/comment/46320002
has comment: http://stackoverflow.com/comment/46320222
has comment: http://stackoverflow.com/comment/46320473
type: Question
has answer: http://stackoverflow.com/a/29040392
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46320086
tagged with: ajax
score: 0
linked to: http://stackoverflow.com/q/60174
answer count: 3
has title: Trigger php script within ajax success
has body: I've searched and cannot find an answer to this. I have an ajax that loops and waits for a variable and when it does not equal 0 I want to send the data to another script so that it can update the db and then it redirects to another URL. I've tried .post and .get and cannot get the values to update the db but the script does redirect. function updateTrigger(){ $.ajax({ url: "json.trigger.php", dataType: "json", cache: false, success: function(data) { var scrape_type = data.scrape_type; var account_id = data.account_id; if(account_id != 0) { $.post('update-pending.php', {account_id: account_id, scrape_type: scrape_type}); document.location.href="redirect.com"; } } }); } Here is my update-pending.php that I am sending the variables to first before it redirects. $account_id = $_POST['account_id']; $scrape_type = $_POST['scrape_type']; $stmt = $con-&gt;prepare("UPDATE triggers SET pending='1' WHERE account_id = '$account_id' AND scrape_type = '$scrape_type'") or die(mysql_error()); $stmt-&gt;execute();

http://stackoverflow.com/q/28962693
tagged with: http://stackoverflow.com/tag/json
type: Question
has body: For a school assignment we have to build a small app prototype which interfaces with the Forecast.io api. I have little experience with APIs but everything in the code seems to be clean and okay. However, in Brackets, JSHint keeps telling me "Navigator not defined (W117)". Furthermore, console.log statements don't work in several functions and the browser doesn't ask me to share my location. I tried copying exact code and had the same reults. None of the console logs in the file return anything, I have no way of checking if my browser even gets location data. //JSON declareren (function () { 'use strict'; /*global $, jQuery, console, alert*/ //Variabelen invoegen var latitude, longitude, url, App, myApp, day, days, month, months, year, years, dateTime, getTest, date, Location, myLocation; App = function () { this.getLocation = function () { if (navigator.geolocation) { console.log("Geofix werk"); navigator.geolocation.getCurrentPosition(this.updateWeather); } else { alert("Geolocation fix fail"); } }; this.updateWeather = function (posn) { console.log("Position OK"); latitude = posn.coords.latitude; longitude = posn.coords.longitude; console.log(latitude); console.log(longitude); url = "https://api.forecast.io/forecast/412e0bc4cc3095a2de7d0bdf663f4e3e/" + latitude + ',' + longitude + "?units=si"; $.ajax({ url: url, dataType: 'jsonp', type: 'GET', success: function (resp) { console.log(resp); date = new Date(); getTest = date.getDate(); day = date.getDay(); month = date.getMonth(); year = date.getFullYear(); //arrays invoegen days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; } }); }; }; myLocation = new App(); myLocation.getCurrentLocation(); }());
tagged with: navigator
tagged with: api
tagged with: javascript
answer count: 1
has answer: http://stackoverflow.com/a/29691217
has title: "Navigator is not defined" JSHint, forecast API with JSON
type: UnansweredQuestion
tagged with: adobe-brackets
score: 0

http://stackoverflow.com/a/28975704
answers question: http://stackoverflow.com/q/28975556
has comment: http://stackoverflow.com/comment/46203032
has comment: http://stackoverflow.com/comment/46202890
score: 2
accepted answer of: http://stackoverflow.com/q/28975556
downvote count: 0
has comment: http://stackoverflow.com/comment/46202745
upvote count: 2
type: Answer
has body: This should actually be pretty easy to fix, via adding a boolean var: // Handle Right and Left Keyboard Arrow presses to navigate to Next or Previous Project var canUseArrows = true; $("body").keydown(function(e) { if(e.which === 37 &amp;&amp; canUseArrows) { // left $("#page-left").parent("a")[0].click(); } else if(e.which === 39 &amp;&amp; canUseArrows) { // right $("#page-right").parent("a")[0].click(); } }); And the functions would simply be changed to: // Colorbox Event for Opening a Modal $(document).bind('cbox_open', function(){ canUseArrows = false; }); // Colorbox Event for Closing a Modal $(document).bind('cbox_closed', function(){ canUseArrows = true; }); Here's a fiddle showing it working, with checkbox checked simulating a cbox being open.
has comment: http://stackoverflow.com/comment/46202624
has comment: http://stackoverflow.com/comment/46202873
type: AcceptedAnswer

http://stackoverflow.com/a/29030045
upvote count: 3
has body: replace string = string.replace("/\u21b5/", ""); with string = string.replace(/\u21b5/g, "");
type: Answer
has comment: http://stackoverflow.com/comment/46301324
score: 3
answers question: http://stackoverflow.com/q/29029992
downvote count: 0

http://stackoverflow.com/a/29027614
answers question: http://stackoverflow.com/q/28939261
has body: I'm currently working on a project which is Angular based with TideSDK, and it's working well. All my routes, directives, services, (...), are working. Could you explain a bit more your issue? Did you enable the webkit console of the app ? (https://github.com/TideSDK/TideSDK/wiki/Enabling-Web-Inspector => for macos) All the logs are not present in the TideSDK Developper tool.
score: 0
type: Answer

http://stackoverflow.com/q/28927557
has title: Angularjs: How to capture the text in tag and use it inside my controller
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28927608
has body: I need to capture the id and title value of the row for which the edit button was pressed. Here is how my ng-repeat is structured: {{post.id}} {{post.title}} {{post.posted_on}} {{post.is_moderated}} And this is the part of my controller code where I need to access the particular {{post.id}} and {{post.title}} value. app.controller('SampleController', ['$scope', 'ModalService', function($scope, ModalService) { $scope.showCustom = function() { ModalService.showModal({ templateUrl: "complex/complex.html", controller: "ComplexController", inputs: { id: // This is where I need to specify the id for which the edit button was pressed. title: // This is where I need to specify the title for which the edit button was pressed. } }).then(function(modal) { modal.element.modal(); modal.close.then(function(result) { $scope.complexResult = "Name: " + result.name + ", age: " + result.age; }); }); }; I need to access the post.id which is in a label and post.title which is wrapped in a element. ng-model does not work for these type of elements so I can't use that.
tagged with: angularjs
tagged with: semantic-ui
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28927608

http://stackoverflow.com/a/29048330
has comment: http://stackoverflow.com/comment/46335615
has comment: http://stackoverflow.com/comment/46335577
has comment: http://stackoverflow.com/comment/46337528
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46337447
has comment: http://stackoverflow.com/comment/46342244
type: Answer
has comment: http://stackoverflow.com/comment/46336509
has comment: http://stackoverflow.com/comment/46341031
score: 1
has comment: http://stackoverflow.com/comment/46337514
accepted answer of: http://stackoverflow.com/q/29048314
upvote count: 1
has body: Put the code you want to refresh in a function. &lt;script&gt; var songs = ... function f(){ var randomIndex = Math.floor(Math.random() * songs.length); var song = songs[randomIndex]; document.querySelector("source").src = song.filename; document.getElementById("songTitle").textContent = song.title; document.getElementById("songAlbum").textContent = song.album; } &lt;/script&gt; Then set the function as a callback of onclick. As this: &lt;img ... onclick="f();" ... /&gt;
has comment: http://stackoverflow.com/comment/46335730
answers question: http://stackoverflow.com/q/29048314

http://stackoverflow.com/comment/46116405
type: Comment
score: 0
has text: @adeneo That would be even better and probably the *native* way. Could you post an answer how to do that?
type: QuestionComment
comment on: http://stackoverflow.com/q/28930232

http://stackoverflow.com/a/28943742
has comment: http://stackoverflow.com/comment/46141949
score: 2
accepted answer of: http://stackoverflow.com/q/28943565
upvote count: 2
answers question: http://stackoverflow.com/q/28943565
has comment: http://stackoverflow.com/comment/46142312
type: AcceptedAnswer
downvote count: 0
has body: Maybe is used to represent an operation that might fail. In the case of this function, you return Just(the element) if an element fulfills the predicate, else, you return Nothing to show that it had "failed" (in this case, none of the elements fulfill the predicate). It's preferred to just returning a null because the return type explicitly shows that it can fail, and the answer can be pattern matched against.
type: Answer

http://stackoverflow.com/comment/46204848
comment on: http://stackoverflow.com/a/28954852
has text: Okay. I didn't want to have to make these records individually. I was hoping there was a easy way I could add them to the record before saving. With Active Model this is possible. It doesn't create records in the join table unless the first record saves. Then if one of the records you are trying to join doesn't exist it bails and deletes all previously saved records. Gives you a little transaction control so you don't have incomplete records hanging around. Oh well, guess I'll have to roll that myself.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/106321765
score: 2
type: AnswerComment
has text: How would one go about to actually see said links?
comment on: http://stackoverflow.com/a/56931291
type: Comment

http://stackoverflow.com/comment/46299172
type: Comment
has text: While this is possible, perhaps this task is best handled outside of the application - the target is to make sure that whatever is starting your application (init script? systemd unit? Something custom?) will run `npm install` just before that. Using *npm* programmatically is really useful only when you do not know beforehand which packages you are going to need.
type: QuestionComment
comment on: http://stackoverflow.com/q/29028710
score: 0

http://stackoverflow.com/comment/106408339
comment on: http://stackoverflow.com/a/28959957
score: 0
type: AnswerComment
has text: this fails if \n is inside string literals
type: Comment

http://stackoverflow.com/q/29051143
tagged with: webrtc
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29055450
tagged with: webcam
tagged with: google-chrome
has body: I am currently trying to switch the input video source being displayed but from what I have found, navigator.getUserMedia() can be used to get the localMediaStream but it only has a handle on one of each audio and video sources available to the browser. Is there a way (using html or javascript) to set the default camera in Chrome if I have the device IDs?
type: Question
tagged with: javascript
score: 0
has title: Is there a way to set default capture device in Chrome like navigator.setUserMedia()? (GOOGLE CHROME)
answer count: 1

http://stackoverflow.com/a/28931799
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28930639
score: 1
has comment: http://stackoverflow.com/comment/46120021
has body: Try var data = $("script").filter(function(i, el) { return !!$(el).data().myparm }).data().myparm || void 0; console.log(data)
upvote count: 1

http://stackoverflow.com/comment/46324177
has text: j08691: sorry, the semi-colons are from a bad cut and paste job... I removed them. I want the user to be able to select -1 or any combination of 1,2,3. The first option is exlusive of the others. Does that help?
comment on: http://stackoverflow.com/q/29041660
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28907232
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28907373
type: Question
has answer: http://stackoverflow.com/a/28907355
has comment: http://stackoverflow.com/comment/46073929
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46073943
answer count: 3
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has body: Let's say I've a homepage called homepage.html and when I click the "About" part, instead of going to another page, about.html, is it possible to render the about.html in homepage.html? Basically take off all the homepage.html and it becomes about.html. I was thinking of using JavaScript where if you click "About", it would do .remove to remove all the elements of the homepage.html and then use .createElement to create the elements for "About". However, I'm not sure if this is the best approach to this. What's a good to do this? Reason I'm doing is I'm making a game and I don't want to go to different pages when I click "Start", "Single Player", etc. and I just want to stay on the same page. Sorry if it sounds confusing, let me know if you need any clarification. Thanks.
accepted answer: http://stackoverflow.com/a/28907412
favorite count: 0
has title: Run multiple webpages in a single webpage
possible better answer: http://stackoverflow.com/a/28907355
has answer: http://stackoverflow.com/a/28907412

http://stackoverflow.com/comment/46241660
type: Comment
type: QuestionComment
has text: @jtmarmon `str.split()` returns an array, which does not have the `split` method. You'd get a `TypeError` with that.
score: 2
comment on: http://stackoverflow.com/q/28996583

http://stackoverflow.com/a/28930620
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28930371
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28930371
has body: if(isset($id)){ echo ' '; }elseif(isset($name)){ echo ' '; } this code is trying execute and javascript understanding it as test variable. But you must do it as So, you must change your code as follows: if(isset($id)){ echo ' '; }elseif(isset($name)){ echo ' '; }

http://stackoverflow.com/a/28944314
has body: MyValue = { "name": "myValue", "apple": 3, "banana": 2 }; ListValue = [ {name:"value1", apple:1, banana:2}, {name:"value2", apple:3, banana:2}, {name:"value2", apple:5, banana:1}, {name:"value4", apple:3, banana:3}, {name:"value5", apple:3, banana:5} ]; var NewListValue = ListValue.filter(function(element){ if (MyValue.apple &gt;= element.apple &amp;&amp; MyValue.banana &gt;= element.banana ) { return element; } }); document.body.innerHTML += JSON.stringify(NewListValue ); //demo code I would use Array.prototype.filter here. However a for loop would also work. Corrected a lot of syntax errors here. Converter your MyValue array into an object and not an array with keys (doesn't work). Fixed the ListValue array.
type: Answer
accepted answer of: http://stackoverflow.com/q/28944111
score: 1
answers question: http://stackoverflow.com/q/28944111
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46084700
score: 0
comment on: http://stackoverflow.com/q/28913046
has text: @nithin : Yeah, that seems to be there for some time due to the side nav bar, but that does not seems to affect other stuff on the page, or I should I be fixing that?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28945440
has comment: http://stackoverflow.com/comment/46145425
linked to: http://stackoverflow.com/q/857670
has comment: http://stackoverflow.com/comment/46145056
has comment: http://stackoverflow.com/comment/46145418
tagged with: javascript
linked to: http://stackoverflow.com/q/245062
accepted answer: http://stackoverflow.com/a/28945703
has comment: http://stackoverflow.com/comment/46145438
has comment: http://stackoverflow.com/comment/46145450
score: 0
possible better answer: http://stackoverflow.com/a/28945746
tagged with: syntax-error
answer count: 2
has answer: http://stackoverflow.com/a/28945746
has comment: http://stackoverflow.com/comment/46145291
has comment: http://stackoverflow.com/comment/46145526
has comment: http://stackoverflow.com/comment/46145154
has comment: http://stackoverflow.com/comment/46146292
has title: Javascript Error: SyntaxError: missing ; before statement
has comment: http://stackoverflow.com/comment/46145253
has comment: http://stackoverflow.com/comment/46146436
type: AnsweredQuestion
tagged with: mysql-connector
has body: I have the following code snippet. I have tried all the possible things mentioned on StackExchange but am unable to spot the error in my code. <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@ page import="java.sql.*" %> Twitter Mapper The line for the error is shown to be as the first line in function populateMap(). Please help.
type: Question
has answer: http://stackoverflow.com/a/28945703

http://stackoverflow.com/q/28907440
favorite count: 0
possible better answer: http://stackoverflow.com/a/28908983
upvote count: 1
has title: Setting loop on a slider
has answer: http://stackoverflow.com/a/28907612
has answer: http://stackoverflow.com/a/28908983
has body: I'm trying to set a loop on a slider but it would always stop on the last slider. Please help. jsfiddle function slideSwitch() { var $active = $('div#slideshow .active'); var $next = $active.next(); $next.addClass('active'); $active.removeClass('active'); } $(function() { setInterval( "slideSwitch()", 5000 ); });
type: AnsweredQuestion
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46074464
accepted answer: http://stackoverflow.com/a/28907612
linked to: http://stackoverflow.com/q/28864879
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28950820
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html

titanium
type: Tag
tags question: http://stackoverflow.com/q/28995254
tags question: http://stackoverflow.com/q/29032191
tags question: http://stackoverflow.com/q/29061949
tag name: titanium
tags question: http://stackoverflow.com/q/28988639
tags question: http://stackoverflow.com/q/28972721
tags question: http://stackoverflow.com/q/29035718
tags question: http://stackoverflow.com/q/28935091
tags question: http://stackoverflow.com/q/28971497
tags question: http://stackoverflow.com/q/28917770
tags question: http://stackoverflow.com/q/28910594
tags question: http://stackoverflow.com/q/29060291

http://stackoverflow.com/a/29027506
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29026294
downvote count: 0
answers question: http://stackoverflow.com/q/29026294
has body: Always check your browser console for errors thrown. In this case, I see a Uncaught TypeError: undefined is not a function message. That error is found on line 112 on your page, and if you check it carefully, you are using the $ without assigning the jQuery object to it, hence causing an error: jQuery(document).ready(function() { jQuery(".clickable").click(function() { var toHide = $(this).attr('data-hide'); // Line 112 where error is from jQuery(".map").toggle(); jQuery("#"+toHide).toggle(); }); jQuery(".hide").click(function() { jQuery(".map").toggle(); jQuery(this).toggle(); }); }); Replace the $ with jQuery, i.e. var toHide = jQuery(this).attr('data-hide');. Alternatively, you can tell jQuery that you are using $ to stand in for the jQuery object, saving you 5 characters every single instance you call for it: jQuery(document).ready(function($) { $(".clickable").click(function() { var toHide = $(this).attr('data-hide'); $(".map").toggle(); $("#"+toHide).toggle(); }); $(".hide").click(function() { $(".map").toggle(); $(this).toggle(); }); });
type: AcceptedAnswer
score: 1

http://stackoverflow.com/a/38720276
has comment: http://stackoverflow.com/comment/71429142
answers question: http://stackoverflow.com/q/28944914
has body: this is working for me Simple Black Blood Beige League Moon Night Serif Sky Solarized here jquery $(function(){ $('#theme').change(function() { var locationName = $('#theme option:selected').val(); localStorage.setItem('locationName', locationName); }); });
type: Answer
score: 0

http://stackoverflow.com/a/29049301
accepted answer of: http://stackoverflow.com/q/29049282
answers question: http://stackoverflow.com/q/29049282
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/46341427
downvote count: 0
has comment: http://stackoverflow.com/comment/46343052
has body: Use preventDefault(). $("#stop-point-btn").bind("click", function(e) { e.preventDefault(); addStopPoint(); }); And keep in mind: As of jQuery 1.7, the .on() method is the preferred method for attaching event handlers to a document. For earlier versions, the .bind() method is used for attaching an event handler directly to elements.
score: 4
type: AcceptedAnswer

http://stackoverflow.com/q/28975857
score: 0
answer count: 2
upvote count: 1
downvote count: 1
has title: How to redirect after user log in with Iron Router?
tagged with: meteor
has comment: http://stackoverflow.com/comment/46203970
has body: I want to redirect to '/' main page when user log in, I managed to redirect to '/'main page with this.render, but then it only shows main page and can't access other urls. Router.route('/', {name: 'yaksList'}) Router.route('/submit', {name: 'yaksSubmit'}); Router.route('/login', {name: 'accounts'}); Router.onBeforeAction(function() { if (Meteor.userId()) { this.render('yaksList'); } else { this.next(); } }); I tried to use Router.go('yaksList') instead of this.render, but it's not working. What is the right solution, please ?
favorite count: 0
tagged with: iron-router
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28977854
type: Question
has answer: http://stackoverflow.com/a/28976812
tagged with: javascript

http://stackoverflow.com/q/29030479
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29031547
linked to: http://stackoverflow.com/q/1395551
answer count: 1
downvote count: 0
favorite count: 0
tagged with: scala
tagged with: oracle-database
has comment: http://stackoverflow.com/comment/46302407
has body: I am writing a Scala application (that is supposed to run on Hadoop using Spark) and my users are to execute JavaScript snippets that they upload and I want to provide access to certain helper functions written in Scala (like "make an HTTP call" etc.) to these JavaScript users. So what I do is writing a big JavaScriptHelpers object and then give access to that object using engine = scriptEngineManager.getEngineByName("JavaScript") engine.put("jql", JavaScriptHelpers) so users can say jql.httpPost(...) from within JavaScript. The Scala code that makes this possible looks as follows: def httpPost(where: String, params: Object): Try[String] = { params match { // JavaScript string becomes Java's String: case body: String =&gt; // ... // JavaScript object becomes Java's ScriptableObject case obj: ScriptableObject =&gt; val params = convertToMap(obj) // ... } } protected def convertToMap(obj: ScriptableObject): Map[String, String] = { (for (key &lt;- obj.getIds().toList) yield { (key.toString, obj.get(key) match { case s: String =&gt; s case d: java.lang.Double if d.toString.endsWith(".0") =&gt; d.toInt.toString case other =&gt; other.toString }) }).toMap } The only way I found to access information stored in JavaScript objects is to look at them as an instance of sun.org.mozilla.javascript.ScriptableObject. Now this works like a charm on my local OpenJDK installation java version "1.7.0_75" OpenJDK Runtime Environment (fedora-2.5.4.2.fc20-x86_64 u75-b13) OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode) but when I run the same code on my Hadoop cluster, which is running java version "1.7.0_67" Java(TM) SE Runtime Environment (build 1.7.0_67-b01) Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode) then I get: java.lang.NoClassDefFoundError: sun/org/mozilla/javascript/ScriptableObject sun.org.mozilla.javascript.internal.JavaMembers.discoverAccessibleMethods(JavaMembers.java:383) sun.org.mozilla.javascript.internal.JavaMembers.discoverAccessibleMethods(Java…
accepted answer: http://stackoverflow.com/a/29031547
type: AnsweredQuestion
score: 1
tagged with: java
upvote count: 1
has title: Access fields of a JavaScript object in Java

http://stackoverflow.com/q/28939267
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: How to insert TEXT ANCHOR 1 as a part of the src value inside script tag? I will use this on a tabbed content. Thank you. FIDDLE HERE. TEXT ANCHOR 1
has title: How to insert text anchor inside script tag onload?
has comment: http://stackoverflow.com/comment/46134123
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28939907
downvote count: 2
has comment: http://stackoverflow.com/comment/46134237
type: Question
has comment: http://stackoverflow.com/comment/46134595
score: -2
has comment: http://stackoverflow.com/comment/46133677
has comment: http://stackoverflow.com/comment/46133561
has comment: http://stackoverflow.com/comment/46134436
accepted answer: http://stackoverflow.com/a/28939907
has comment: http://stackoverflow.com/comment/46133701
has comment: http://stackoverflow.com/comment/46134147
upvote count: 0

windows-8.1
tags question: http://stackoverflow.com/q/28910844
type: Tag
tags question: http://stackoverflow.com/q/28949074
tag name: windows-8.1
tags question: http://stackoverflow.com/q/28997883

http://stackoverflow.com/a/29052993
upvote count: 1
downvote count: 1
score: 0
has body: JFK's answer is correct, but I extended that a little $(document).on("keydown", function (e) { var code = e.which || e.keyCode; if (code == 40 || code == 39) { // down &amp; right // replace selector with your button id/class $('.btn-next').click(); } else if (code == 38 || code == 37) { // up &amp; left // replace selector with your button id/class $('.btn-previous').click(); } }); The code simulates a click on the next/previous buttons so you are able to place any code which should happen when clicking or key pressing only once.
has comment: http://stackoverflow.com/comment/46343822
has comment: http://stackoverflow.com/comment/46343758
answers question: http://stackoverflow.com/q/29052774
type: Answer
has comment: http://stackoverflow.com/comment/46343874

http://stackoverflow.com/comment/46141373
type: Comment
type: QuestionComment
has text: use `.prop()` not `.setAttribute`
comment on: http://stackoverflow.com/q/28943507
score: 0

http://stackoverflow.com/comment/46287702
has text: @Laerion The client **ISN'T ALWAYS RIGHT**. This time, he is far from it. He lost it, for sure. Ask to edit the data.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29017039
type: QuestionComment

http://stackoverflow.com/a/29017627
answers question: http://stackoverflow.com/q/29017440
has comment: http://stackoverflow.com/comment/46279814
has body: In your example, your code will kind of conflict, the externals basically says require('klaviyo') should be rewritten to window._learnq and the alias says require('klaviyo') basically does require('./bower_components/learnmarklet/index.js') What I would recommend is this: module.exports = { resolve:{ alias:{ // Make it so that 'require' finds the right file. "klaviyo": "./bower_components/learnmarklet/index.js" } }, module: { loaders: [{ // Rewrite the file so that it exports the window global. test: __dirname + '/bower_components/learnmarklet/index.js', loader: 'exports?window._learnq' }] } } You's need to npm install exports-loader as well.
type: AcceptedAnswer
upvote count: 9
has comment: http://stackoverflow.com/comment/46280463
has comment: http://stackoverflow.com/comment/46337172
type: Answer
has comment: http://stackoverflow.com/comment/46280501
downvote count: 0
score: 9
accepted answer of: http://stackoverflow.com/q/29017440

parse-platform
tags question: http://stackoverflow.com/q/28996204
tags question: http://stackoverflow.com/q/28921920
type: Tag
tags question: http://stackoverflow.com/q/29044722
tags question: http://stackoverflow.com/q/28949399
tags question: http://stackoverflow.com/q/29044690
tags question: http://stackoverflow.com/q/28986701
tags question: http://stackoverflow.com/q/29019702
tags question: http://stackoverflow.com/q/29059551
tags question: http://stackoverflow.com/q/28971920
tags question: http://stackoverflow.com/q/29029876
tags question: http://stackoverflow.com/q/28932764
tags question: http://stackoverflow.com/q/28985269
tags question: http://stackoverflow.com/q/28976237
tags question: http://stackoverflow.com/q/28924120
tags question: http://stackoverflow.com/q/29053919
tags question: http://stackoverflow.com/q/28994527
tags question: http://stackoverflow.com/q/29022536
tags question: http://stackoverflow.com/q/29030846
tags question: http://stackoverflow.com/q/28948931
tags question: http://stackoverflow.com/q/29044574
tag name: parse-platform
tags question: http://stackoverflow.com/q/28928042

http://stackoverflow.com/q/29016048
tagged with: javascript
type: AnsweredQuestion
tagged with: spotify
answer count: 1
has body: I'm making a Spotify Advertiser page, but recently Spotify updated to version 1.0.1.1060.gc75ebdfd and now all the links with "a href" are opening in the native browser and not in the micro browser inside Spotify. I already tried using the "target='_self'" and that did not work, and as a solution I started using javascript with location.href on onClick event and that works. I need to open the page to share on Facebook and Twitter, but it wont open with JS only with "a href" Anyone know what might be or how can it be fix?
type: Question
has title: Spotify Advertiser Page
tagged with: ads
score: 0
has answer: http://stackoverflow.com/a/29027603
tagged with: href
accepted answer: http://stackoverflow.com/a/29027603

http://stackoverflow.com/comment/46315527
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29037307
has text: How can a task runner help to solve this problem?
score: 0

http://stackoverflow.com/comment/46169194
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28957554
has text: Well, extra table in DB, ORM, DAL, BLL, MVC/WebAPI (or whatever project structure you use in backend) and probably extra ajax call just to get locations of 4-5 cities on one particular image? For me it's over-engineering for this trivial situation. If it were all countries we talk about then sure it's another type of problem where I say _In general your point is valid_. And responsive/adaptive does not necessary mean scaling.

http://stackoverflow.com/comment/46412626
score: 0
has text: @bzlm : I've resorted to setting a global flag to `true` once the page has finished loading (called from `window.onload`, which is what I believe to be an equivalent of checking if the page has reached the `complete` `readyState`), and to use that flag to determine the other scripts' availabilities. This seems to be working--thanks for the help, and if you'd like, make that an answer so I can accept it
comment on: http://stackoverflow.com/q/28962913
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28984238
score: 0
has body: You need to pass the clicked element to the function Abcd1 Abcd1 Abcd1 then function removeDOM(el) { el.parentNode.removeChild(el.previousElementSibling) } Demo: Fiddle - supported IE >= 9
type: Answer
has comment: http://stackoverflow.com/comment/46219250
answers question: http://stackoverflow.com/q/28984171

http://stackoverflow.com/q/29020363
has answer: http://stackoverflow.com/a/29022226
tagged with: javascript
tagged with: date
has comment: http://stackoverflow.com/comment/46284834
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29022226
type: Question
has body: Here is my issue: I'm trying to get the last week date in Javascript but for some reason I'm getting the date not in the correct format. Instead of getting the date in this format: dd-mm-yyy I'm getting : Thu Mar 05 2015 00:00:00 GMT-0800 (Pacific Standard Time) How can I convert it what I desire??? JS Function: //================================= // // Search By Given Range // // ============================== // function OnClientSelectedIndexChanged(sender, eventArgs) { var From = $find("&lt;%= rdpFromDate.ClientID %&gt;"); var To = $find("&lt;%= rdpToDate.ClientID %&gt;"); var nowDate = new Date(); From.clear(); To.clear(); var lastWeekPeriod = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate() - 7); From.set_selectedDate(lastWeekPeriod); To.set_selectedDate(nowDate); } aspx Code: From: &lt;telerik:RadDatePicker ID="rdpFromDate" runat="server" Width="135px"&gt; &lt;/telerik:RadDatePicker&gt; To: &lt;telerik:RadDatePicker ID="rdpToDate" runat="server" Width="135px"&gt; &lt;/telerik:RadDatePicker&gt;
has comment: http://stackoverflow.com/comment/46284592
score: 0
has title: How to format javascript date Pacific Standard Time to Today Format
answer count: 1

http://stackoverflow.com/a/28907284
upvote count: 6
score: 6
accepted answer of: http://stackoverflow.com/q/28907061
answers question: http://stackoverflow.com/q/28907061
has body: If you're going to read the data with .data you should also set it with .data: $("#fav").data("action","delete"); jQuery's data doesn't use the data attribute to store the data when you set it, it actually stores it in some form of js object. It will read the initial value from the attribute but then moves to the object. From the jquery documentation: The data- attributes are pulled in the first time the data property is accessed and then are no longer accessed or mutated (all data values are then stored internally in jQuery).
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/29044662
tagged with: javascript
tagged with: phonegap-plugins
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29044694
has title: how to return array of values from js function
has answer: http://stackoverflow.com/a/29044674
type: Question
answer count: 2
score: 0
has body: I am using social-auth-plugin for phonegap and I have this function: window.socialAuth.accessFacebook(function success() {}, function error() {}) in the description of this plugin it says: If permission is granted, returns account. If not granted, it returns "Error" I tried the function like this window.socialAuth.accessFacebook(function success() {alert("success")}, function error() {}) now how can I return the array of values ??

http://stackoverflow.com/q/28988015
linked to: http://stackoverflow.com/q/14994391
possible better answer: http://stackoverflow.com/a/28988115
favorite count: 0
score: 0
has title: How to add html into DOM with Angularjs?
has answer: http://stackoverflow.com/a/28990664
accepted answer: http://stackoverflow.com/a/28990664
tagged with: angularjs
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28988115
type: AnsweredQuestion
type: Question
answer count: 2
has body: if it's jquery, we can do like $('table-row').clone().preprenTo($('table')); I know it's just push a new value into an object in adding new data but I want to first insert the empty row and field first, how to add that html with angularjs?
tagged with: javascript

http://stackoverflow.com/q/29000326
has body: I'm trying to run some code if a string is found in the users URL. However I only want it to run if there is nothing else following the string. The string appears at the end of the URL like this. http://shop.com/?searchTerm=bread My code: if (window.location.search.indexOf('searchTerm=bread') &gt; -1) { do stuff; } This works fine but the problem is it will still run if the string is 'searchTerm=bread+rolls' I don't want this to happen. Any ideas? I should also mention there is a bunch of other parameters in the URL that change, but the one I'm trying to target is always at the end. I'm also unable to use any libraries. http://shop.com/?p=kjsl&amp;g=sdmjkl&amp;searchTerm=bread
has comment: http://stackoverflow.com/comment/46249442
has comment: http://stackoverflow.com/comment/46248635
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/901115
tagged with: javascript
tagged with: string
has comment: http://stackoverflow.com/comment/46248375
has answer: http://stackoverflow.com/a/29000663
has comment: http://stackoverflow.com/comment/46248936
has comment: http://stackoverflow.com/comment/46248902
type: Question
has comment: http://stackoverflow.com/comment/46248684
has comment: http://stackoverflow.com/comment/46250400
has comment: http://stackoverflow.com/comment/46248885
has comment: http://stackoverflow.com/comment/46248970
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/29000663
has comment: http://stackoverflow.com/comment/46249064
linked to: http://stackoverflow.com/q/280634
has answer: http://stackoverflow.com/a/29001356
has comment: http://stackoverflow.com/comment/46248384
has comment: http://stackoverflow.com/comment/46248917
tagged with: indexof
possible better answer: http://stackoverflow.com/a/29001356
has title: Javascript - How to find specific string using .indexOf instead of just the beginning

http://stackoverflow.com/comment/46250222
has text: Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\Project_OVS\cast_vote.php:63) in C:\xampp\htdocs\Project_OVS\cast_vote.php on line 87
comment on: http://stackoverflow.com/a/29001272
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46268017
score: 0
comment on: http://stackoverflow.com/q/29008052
has text: Specifically the value is equals to document.getElementById(labelname)
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29030779
has comment: http://stackoverflow.com/comment/46315061
downvote count: 0
has comment: http://stackoverflow.com/comment/46302586
has body: This is the new arrow syntax of ES6. It differs by the treatment of this: function gets a this according to the calling context (traditional semantics), but the arrow functions keep the this of the context of definition. see http://tc39wiki.calculist.org/es6/arrow-functions/
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29030747
upvote count: 29
answers question: http://stackoverflow.com/q/29030747
type: Answer
score: 29

http://stackoverflow.com/a/28955716
has comment: http://stackoverflow.com/comment/46164880
has comment: http://stackoverflow.com/comment/46164705
has comment: http://stackoverflow.com/comment/46164823
downvote count: 0
has body: name your callback: $('.arrow').on("click", function cb(e){ run(); var $this = $(this) $this.off(e); // unbind setTimeout(function(){ $this.on("click", cb); }, 700); }); or debounce it, like i said. choose your favorite debounce impl, here is underscore: $('.arrow').on("click", _.debounce(run, 700));
has comment: http://stackoverflow.com/comment/46164853
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/46164794
score: 1
has comment: http://stackoverflow.com/comment/46164694
answers question: http://stackoverflow.com/q/28955614

http://stackoverflow.com/comment/46279772
score: 0
type: Comment
type: QuestionComment
has text: Are class(x)Values within the arrayOfdata unique? from `if(value === class1Value)` in the map function, it seems as if these objects are identical.
comment on: http://stackoverflow.com/q/29017076

http://stackoverflow.com/comment/46098560
type: Comment
comment on: http://stackoverflow.com/a/28920544
has text: That's good! One more thing, do you know exactly why yours works and mine doesn't?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46268598
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29010009
type: Comment
has text: Tried on Z1, S4, same issue. I added the useNativeScrolling property and the problem is gone. However there are some limitations with this approach as stated here : http://docs.telerik.com/kendo-ui/mobile/native-scrolling

infinite-scroll
tag name: infinite-scroll
type: Tag
tags question: http://stackoverflow.com/q/28985991
tags question: http://stackoverflow.com/q/29022499
tags question: http://stackoverflow.com/q/29005610

http://stackoverflow.com/q/28925393
tagged with: javascript
tagged with: jquery
has title: Connecting data from mouse hover pop up data on a States Map for generating PIE chart
score: 0
has comment: http://stackoverflow.com/comment/46126049
answer count: 0
has comment: http://stackoverflow.com/comment/46122482
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46107183
has body: I am new to D3js and I need help how can I get the value of mouse hover pop up data on a STATE MAP and at the same time, it will generate a PIE chart . Any kind of help would be appreciated http://jsfiddle.net/2emnt8m3/16/ -- 1 dataset is available for Map, I want those data, which will generate a pie based on pop up data. This is for Pie chart: { "label": "Assault on women ", "value": 64131, "color": "#1ee675" }, { "label": "Dowry Deaths", "value": 57618, "color": "#44b9ae" }, { "label": "Cruelty", "value": 18812, "color": "#7b37c0" }]; The above value is taken for sample for pie chart. But it should return the pop up data on mouse hover so that it will generate a PIE chart for every data pop up on mouse hover. In the dataset, There are 34 states and 6 crimehead varaibles with DATA from 2001 to 2012. Just say for 2001, I select state: Andhra pradesh on mouse hover, Below data would pop up and I want these data to generate for PIE chart in the same time. This is for map chart: STATEUTS:"Andhra Pradesh", RAPE:871, Kidnapping:765, Dowry:420, Assault:3544, Insult:2271, Cruelty:5791, Importation:7, ImmoralT:1332, Prohibtion:551, Total:16477, Year:2001 Here is one of the example I have look on: http://simonbjohnson.github.io/Ebola_Dashboard/
type: Question

http://stackoverflow.com/comment/46374350
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29046075
type: AnswerComment
has text: since exdata1 and extdata2 are strings, then you can just add them extdata = extdata1 + extdata2;

http://stackoverflow.com/comment/46122436
score: 1
has text: without using a date formatting library you will need to manipulate the pieces as strings yourself
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28933292

http://stackoverflow.com/comment/46201432
type: QuestionComment
score: 0
has text: @KennyThompson I have edited the question. Kindly have a look. I have added submenu1 and submenu2
comment on: http://stackoverflow.com/q/28975030
type: Comment

http://stackoverflow.com/comment/46341476
comment on: http://stackoverflow.com/a/29051597
type: AnswerComment
score: 0
type: Comment
has text: when you run your code do you receive any error in the console ?

http://stackoverflow.com/a/29059879
answers question: http://stackoverflow.com/q/29059775
has comment: http://stackoverflow.com/comment/46356188
type: Answer
has body: Use indexOf to detect the presence of the letter: word.indexOf(letter); Use replace to replace _: underscore = underscore.replace(/_/g, function(m, index) { return word[index] === letter ? letter : m; }); http://jsfiddle.net/2y4so8t0/
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46356439
accepted answer of: http://stackoverflow.com/q/29059775
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28936112
downvote count: 0
accepted answer: http://stackoverflow.com/a/28936220
score: 1
has title: Returns [Object object] instead Dom string in Reactjs
type: Question
tagged with: reactjs
has answer: http://stackoverflow.com/a/28936220
tagged with: javascript
upvote count: 1
answer count: 1
favorite count: 0
has body: var content = ""; for(var i=0;i<menuData.length;i++){ content += {componentLabel}{manageActionLabel} {allowDropDownElement} {this.createInnerComponent(allowDropDownFlag,innerComponents,showComponent)} } return {content} Above code is all put up in Reactjs. The above code is a code inside a function which is suppose to return the DOM string instead it return as [object object][object object][object object][object object]. Please help in solving this.
type: AnsweredQuestion

http://stackoverflow.com/comment/46126840
score: 0
has text: upvoted, dont forget to also change your jsfiddle :)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28923693

http://stackoverflow.com/comment/46251081
has text: I think OP is assuming incorrectly that you need to define the object type ahead of time. JavaScript is a dynamically typed language.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29001706

http://stackoverflow.com/comment/46095172
type: QuestionComment
has text: I think I misunderstood it, got it now, see the answer below.
comment on: http://stackoverflow.com/q/28916680
score: 0
type: Comment

http://stackoverflow.com/q/29014080
type: AnsweredQuestion
has title: Showing 2nd Dropdown based on First drop down not working
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/29016414
tagged with: jquery
has body: I am a newbie learning web development. I am trying to create a simple form with two dropdowns. Based on first drop down second dropn down should be visible. But it is not working : Untitled Document Input Type Select Type : Type Of You Want to Process Text Numbers Special Characters Data Type Select Data Source : Where is your Data? Data is already in Server Need to Upload the File Can someone tell me what I am doing wrong here ?
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: drop-down-menu
has answer: http://stackoverflow.com/a/29016409
accepted answer: http://stackoverflow.com/a/29016414
possible better answer: http://stackoverflow.com/a/29016409

http://stackoverflow.com/comment/46336613
type: Comment
has text: In Angular 2.0 there won't be a $scope anymore, this controller as syntax will be the way to go. More information (and other reasons why to use the controller as syntax) can be found here: https://docs.angularjs.org/api/ng/directive/ngController (see Example section)
comment on: http://stackoverflow.com/a/29028104
type: AnswerComment
score: 0

http://stackoverflow.com/q/28910844
tagged with: winjs
possible better answer: http://stackoverflow.com/a/29339335
tagged with: javascript
has answer: http://stackoverflow.com/a/28910859
answer count: 2
has title: Error when instantiating WinJS.UI.ListView with template from code
has comment: http://stackoverflow.com/comment/46153933
has comment: http://stackoverflow.com/comment/46080580
downvote count: 0
tagged with: windows-8.1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28910859
type: AnsweredQuestion
score: 2
has body: In the process of creating a custom WinJS control which contains a WinJS.UI.ListView, I was attempting to allow a user to pass a selector for the template. However, no matter if I have the template "pre-created" in the HTML page like you would expect: Nor if I query for the element and create the template from code like: var template = new WinJS.Binding.Template(document.querySelector(selector)); When I get to instantiating the ListView and pass in the template element itself (or its winControl property) to the ListView's itemTemplate option, as such: new WinJS.UI.ListView(elem, { itemTemplate: template.winControl }); I receive the following error: Exception is about to be caught by JavaScript library code at line 11562, column 21 in ms-appx://microsoft.winjs.2.0/js/base.js 0x800a01b6 - JavaScript runtime error: Object doesn't support property or method '_renderItemImpl' I attempted to trace it back a bit but am getting lost in base.js. Hoping someone else has run into this. Note: I've included my workaround as an answer.
upvote count: 2
has comment: http://stackoverflow.com/comment/46147087
has answer: http://stackoverflow.com/a/29339335
type: Question
tagged with: windows-8

http://stackoverflow.com/q/28912875
has comment: http://stackoverflow.com/comment/46090346
type: Question
score: 0
has title: chrome extension memory not freed when page is closed
tagged with: google-chrome-extension
has body: I wrote an extension with a background page bg.html and another UI page ui.html. When the extension was first loaded, I saw in the Task Manager that it used about 20mb memory. Then I opened the UI page, the memory went up to 170mb(the UI is quite complicated, I may ask a separate question for that). When I closed the UI page, memory was not totally freed(160mb remaining). I am aware that Chrome may not decide to perform GC right after I close the page, but it seems that it actually never free that memory(after a long period of time), and when I open the page again and again, it will consume more and more memory. Is this a normal behavior? Or is it caused by some memory leaks in my code? Such great memory consumption can be quite frightening to users. By the way, I took heap snapshot in dev tools, bg.html used 5.3mb, and ui.html 7.5mb
has comment: http://stackoverflow.com/comment/46104142
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46094251
has comment: http://stackoverflow.com/comment/46199848
tagged with: google-chrome
tagged with: javascript

http://stackoverflow.com/a/28967204
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/46194992
upvote count: 3
answers question: http://stackoverflow.com/q/28966710
has comment: http://stackoverflow.com/comment/46187430
type: Answer
has body: Compare a WebView with the iFrame Element where you just take a URL and put it into a special view. So if im understanding you correctly your form already works as standalone website. So just replace the String in loadUrl(...) with the URL of your form and it should work fine. If you want Javascript in your webview, you can enable it like this: WebSettings webSettings = myWebView.getSettings(); webSettings.setJavaScriptEnabled(true);

http://stackoverflow.com/q/28952721
type: UnansweredQuestion
tagged with: selectize.js
type: Question
has body: I'm facing an issue with selectize.js when using the onItemAdd parameter of the constructor (https://github.com/brianreavis/selectize.js/blob/master/docs/usage.md#callbacks). Let's say I have a class which instance will hold and manage the selectize instance. I want to add options dynamically, and to have a method of my class called whenever an option is selected. In the code below, The &lt;select id="#select"&gt;&lt;/select&gt; is not mentioned but does exist. function Class() { var self = this; // create the selectize instance $('#select1').selectize({ onItemAdd: self._func }); var select = $('#select1')[0].selectize; select.addOption({value: 'hello', text: 'Hello'}); select.addOption({value: 'world', text: 'World'}); self._func = function (value) { alert(value); } } $(function() { new Class(); }); Surprisingly, the object method self._func is never called when the items are selected. However, if I replace it by something like onItemAdd: function (value) { self._func(value); }, the object method self._func is called as expected! JsFiddle that demonstrate the issue: https://jsfiddle.net/qDL37/1/ Any reason that could explain this behaviour?
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Selectize.js: onItemAdd property not called when given a class method
has answer: http://stackoverflow.com/a/28952722

http://stackoverflow.com/comment/46255874
score: 0
type: Comment
type: QuestionComment
has text: This sound like an attempt to build up clicks on advertisement to gain more revenue, if so then you might want to make sure this isn't going to breach the agreements as you could face legal action. Example google adsense, this would be against their terms/agreements. Reason for my suspicion? *Adverts/Click without them knowing how*
comment on: http://stackoverflow.com/q/29004431

http://stackoverflow.com/a/29000504
answers question: http://stackoverflow.com/q/29000189
type: Answer
has comment: http://stackoverflow.com/comment/46320173
downvote count: 2
score: -2
has comment: http://stackoverflow.com/comment/46366808
has body: Thanks guys for the help, found out the meteor way to do it. UI.registerHelper("formatArray", function(array) { return array.join(', ') }); and this &lt;p&gt;{{formatArray tags}}&lt;/p&gt;
upvote count: 0

http://stackoverflow.com/q/29043135
upvote count: 116
has answer: http://stackoverflow.com/a/50586210
has answer: http://stackoverflow.com/a/78895214
has answer: http://stackoverflow.com/a/44187672
linked to: http://stackoverflow.com/q/10526739
answer count: 11
linked to: http://stackoverflow.com/q/476436
tagged with: conditional-operator
type: Question
score: 116
has comment: http://stackoverflow.com/comment/46326219
has answer: http://stackoverflow.com/a/29043161
possible better answer: http://stackoverflow.com/a/34860002
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/34860002
has answer: http://stackoverflow.com/a/29043182
has answer: http://stackoverflow.com/a/57081356
has answer: http://stackoverflow.com/a/68766778
has answer: http://stackoverflow.com/a/29043183
has answer: http://stackoverflow.com/a/70892190
has title: Javascript one line If...else...else if statement
favorite count: 0
accepted answer: http://stackoverflow.com/a/29043161
has answer: http://stackoverflow.com/a/77923344
has body: I know you can set variables with one line if/else statements by doing var variable = (condition) ? (true block) : (else block), but I was wondering if there was a way to put an else if statement in there. Any suggestions would be appreciated, thanks everyone!
type: AnsweredQuestion

http://stackoverflow.com/q/28993076
tagged with: minimongo
has answer: http://stackoverflow.com/a/28993335
answer count: 1
has comment: http://stackoverflow.com/comment/46234780
has title: Efficient and flexible Javascript library to query large JSON files that allows aggregation?
favorite count: 0
has comment: http://stackoverflow.com/comment/46235195
has comment: http://stackoverflow.com/comment/46235684
score: 2
type: AnsweredQuestion
upvote count: 3
tagged with: http://stackoverflow.com/tag/json
downvote count: 1
has comment: http://stackoverflow.com/comment/46235390
type: Question
accepted answer: http://stackoverflow.com/a/28993335
has body: I am dealing with large json files with deep hierarchical structure on the frontend and I want to be able to query and aggregate them efficiently,the same way I query mongoDB or redis collections. I am aware of two libraries: Minimongo which I'm not sure if can be used independently without using the entire Blaze/Meteor framework. and JSLINQ any other suggestions, tricks ? Edit: there is also another library called json:select() which provides an API similar to CSS selectors
tagged with: javascript

http://stackoverflow.com/q/28908342
answer count: 0
has title: Is my code malicious?
has comment: http://stackoverflow.com/comment/46076088
type: Question
has comment: http://stackoverflow.com/comment/46076463
has comment: http://stackoverflow.com/comment/46076302
has comment: http://stackoverflow.com/comment/46076134
has comment: http://stackoverflow.com/comment/46076158
has comment: http://stackoverflow.com/comment/46076057
score: 0
has comment: http://stackoverflow.com/comment/46076141
has comment: http://stackoverflow.com/comment/46076161
has comment: http://stackoverflow.com/comment/46076027
has comment: http://stackoverflow.com/comment/46076201
has comment: http://stackoverflow.com/comment/46076767
has comment: http://stackoverflow.com/comment/46076321
has comment: http://stackoverflow.com/comment/46076374
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46076193
has comment: http://stackoverflow.com/comment/46076280
has comment: http://stackoverflow.com/comment/46076287
tagged with: ajax
has body: In a few pages of my website I show some information to my visitors. This information needs to be current (max 30 minutes old) otherwise it's not only useless but misleading too. To get this kind of information I need about 2-3 seconds. My site tries it's best to refresh every page once per 30 minutes but this is not always possible. When a user visits a page with expired information, in the past I did the following: Show a loading bar Do an Ajax call to the server and tell him refresh the information on the database When the server replies done, use document.write to replace the whole page Some of my users got security warnings from this when posting the link on Facebook! I immediately modified my code and now I do the following (It just got live): Show a loading bar Do an Ajax call to the server and tell him refresh the information on the database When the server replies done, refresh the page via javascript - location.reload(); Question: #1: Why the document.write is considered malicious? Is my new solution considered malicious too? Question: #2: Will Google penalize my new solution? Also if you have any suggestion on how can I improve this please let me know!
has comment: http://stackoverflow.com/comment/46076237
has comment: http://stackoverflow.com/comment/46076413

http://stackoverflow.com/q/29013091
has answer: http://stackoverflow.com/a/29013162
accepted answer: http://stackoverflow.com/a/29013216
tagged with: regex
upvote count: 2
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29013125
has answer: http://stackoverflow.com/a/29013125
has answer: http://stackoverflow.com/a/29013216
type: Question
has title: The same RegExp returns true and false alternatively. Why?
downvote count: 0
tagged with: javascript
has body: I have this regexp. And it returns true and false interchangeably. How it can be? How to fix the regexp? The goal is to "allow figures AND spaces only" (123 56 123). var r = new RegExp("[0-9\s]{3,30}", "gi") r.test("123454") true r.test("123454") false
favorite count: 0
answer count: 3

http://stackoverflow.com/comment/46144770
type: Comment
has text: `autoSlide = setInterval(cycle(), 3000);` <--- wrong
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/28945296

http://stackoverflow.com/comment/62664176
comment on: http://stackoverflow.com/q/28949414
has text: Is it *really* the `slideDown` not working on dynamic content, or is it (as I suspect) the whole `click` event handler not executing for dynamic content?
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/a/28972511
upvote count: 1
has body: Try this: $(this).closest(".inner-content").find("ul").slideToggle("slow") .closest(".column").siblings().find("ul").slideUp("slow"); http://api.jquery.com/siblings
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28972415
type: Answer

http://stackoverflow.com/comment/46152710
score: 0
type: QuestionComment
type: Comment
has text: I have now added this line `if (seconds_left <= 0){ target_date = target_date + 30 days; }` But now nothing will show on my page, it is just blank, where before it showed the countdown?
comment on: http://stackoverflow.com/q/28949028

http://stackoverflow.com/comment/46304119
has text: That was from jsfiddle. Registry is there and is seen from outside the ready function.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29029006

http://stackoverflow.com/comment/46218084
score: 0
type: AnswerComment
has text: That now makes more sense. Now `onLoadFinished` is not getting called. Through debugging I can see that `exists` **is** true. Therefore I assume the keypress is not sending properly or the element loses focus before the keypress event. Are one of these possible? Is there another way to submit an input element? On the actual site I can confirm that focusing the element, typing then pressing enter starts a search and loads a new page.
comment on: http://stackoverflow.com/a/28980922
type: Comment

http://stackoverflow.com/comment/133723449
has text: maybe, have you tried? I remember doing something like that.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/74436684

http://stackoverflow.com/a/29025861
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29025829
has body: If you want to detect, that the browser tab with your page was clicked, when user was on aother tab, then you can use window.onfocus window.onfocus = function() { alert('Browser tab clicked'); };
accepted answer of: http://stackoverflow.com/q/29025829
type: Answer
score: 0

http://stackoverflow.com/q/28920599
has comment: http://stackoverflow.com/comment/46098867
score: 0
answer count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/46098620
has answer: http://stackoverflow.com/a/28920638
has body: I want to update score, when clicking on the image, but it just wont happen. i have the HTML: &lt;img id="item1" src="http://nikolajlicht.com/Unicorn/lasso.png"&gt; &lt;h1 id="score"&gt;&lt;/h1&gt; and the JavaScript: var score = 100; var item1 = document.getElementById('item1'); var scoreText = document.getElementById('score'); scoreText.innerText = score; item1.addEventlistener('click',function(){ score -= 20; scoreText.innerText = score; }); JSFIDDLE: http://jsfiddle.net/
favorite count: 0
has title: How to update text, when clicking on image
possible better answer: http://stackoverflow.com/a/28920638
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28920649
type: Question
tagged with: addeventlistener
tagged with: javascript
has answer: http://stackoverflow.com/a/28920649
tagged with: image
upvote count: 2

http://stackoverflow.com/comment/46238076
type: Comment
comment on: http://stackoverflow.com/a/28968665
score: 0
has text: Hi gibberish. Thanks for posting that. I took a look at it and it is definitely beyond my capabilities. I do understand a little of it and I will probably understand it more - the more I reread it.
type: AnswerComment

http://stackoverflow.com/a/77852018
has body: I created this based off the answer @planet260 gave; this one actually works though. It uses Typescript, but you can just remove the typing if you're using JS. You can also play with the time delta (how long to wait for the 2nd tap). Personally, 300ms feels pretty natural to me. let tapTimer: ReturnType&lt;typeof setTimeout&gt;| null = null export function tap(singleTapFunc: Function, doubleTapFunc: Function) { const dblTapDelta = 300 function dblTapTimeout() { singleTapFunc() tapTimer = null; } if (!tapTimer) { tapTimer = setTimeout(dblTapTimeout, dblTapDelta) } else { clearTimeout(tapTimer) tapTimer = null doubleTapFunc() } } And you can call it like this: &lt;div onClick={() =&gt; tap( () =&gt; console.log('SINGLE CLICK'), () =&gt; console.log('DOUBLE CLICK'), )}&gt;&lt;/div&gt;
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28940676

http://stackoverflow.com/comment/46102708
comment on: http://stackoverflow.com/a/28922810
score: 0
type: AnswerComment
has text: Well, I guess I could have a wrapper.
type: Comment

forms
tags question: http://stackoverflow.com/q/29002143
tags question: http://stackoverflow.com/q/28981982
tags question: http://stackoverflow.com/q/29035361
tags question: http://stackoverflow.com/q/28913666
tags question: http://stackoverflow.com/q/28953902
type: Tag
tags question: http://stackoverflow.com/q/29048303
tags question: http://stackoverflow.com/q/28992764
tags question: http://stackoverflow.com/q/29047415
tags question: http://stackoverflow.com/q/29014908
tags question: http://stackoverflow.com/q/28986594
tags question: http://stackoverflow.com/q/28943028
tags question: http://stackoverflow.com/q/28988027
tags question: http://stackoverflow.com/q/29037011
tags question: http://stackoverflow.com/q/28950452
tags question: http://stackoverflow.com/q/28993531
tags question: http://stackoverflow.com/q/28914526
tags question: http://stackoverflow.com/q/29043858
tags question: http://stackoverflow.com/q/29051220
tags question: http://stackoverflow.com/q/29015257
tags question: http://stackoverflow.com/q/29020264
tags question: http://stackoverflow.com/q/29016860
tags question: http://stackoverflow.com/q/28978179
tags question: http://stackoverflow.com/q/29007018
tags question: http://stackoverflow.com/q/29018531
tags question: http://stackoverflow.com/q/28996253
tags question: http://stackoverflow.com/q/28940199
tags question: http://stackoverflow.com/q/28976558
tags question: http://stackoverflow.com/q/28977946
tags question: http://stackoverflow.com/q/28979515
tags question: http://stackoverflow.com/q/29007751
tags question: http://stackoverflow.com/q/29013156
tags question: http://stackoverflow.com/q/28914382
tags question: http://stackoverflow.com/q/28955942
tags question: http://stackoverflow.com/q/28917896
tags question: http://stackoverflow.com/q/28982487
tags question: http://stackoverflow.com/q/28969391
tags question: http://stackoverflow.com/q/29025316
tags question: http://stackoverflow.com/q/28926146
tags question: http://stackoverflow.com/q/29056757
tags question: http://stackoverflow.com/q/28914542
tags question: http://stackoverflow.com/q/28967789
tags question: http://stackoverflow.com/q/28979662
tags question: http://stackoverflow.com/q/28966529
tags question: http://stackoverflow.com/q/28913564
tags question: http://stackoverflow.com/q/29013596
tags question: http://stackoverflow.com/q/28931291
tags question: http://stackoverflow.com/q/29023237
tags question: http://stackoverflow.com/q/28939168
tags question: http://stackoverflow.com/q/29055425
tags question: http://stackoverflow.com/q/28955368
tags question: http://stackoverflow.com/q/28930624
tags question: http://stackoverflow.com/q/29031827
tags question: http://stackoverflow.com/q/28976802
tags question: http://stackoverflow.com/q/29029911
tags question: http://stackoverflow.com/q/28921198
tags question: http://stackoverflow.com/q/28978285
tags question: http://stackoverflow.com/q/28941972
tag name: forms
tags question: http://stackoverflow.com/q/29014570
tags question: http://stackoverflow.com/q/29024573
tags question: http://stackoverflow.com/q/28985651
tags question: http://stackoverflow.com/q/28999942
tags question: http://stackoverflow.com/q/29037539
tags question: http://stackoverflow.com/q/29013105
tags question: http://stackoverflow.com/q/29037538
tags question: http://stackoverflow.com/q/29050244
tags question: http://stackoverflow.com/q/28965922
tags question: http://stackoverflow.com/q/28909292
tags question: http://stackoverflow.com/q/29020061
tags question: http://stackoverflow.com/q/28911698
tags question: http://stackoverflow.com/q/29026337
tags question: http://stackoverflow.com/q/28966830
tags question: http://stackoverflow.com/q/28934672

http://stackoverflow.com/comment/46157205
score: 2
comment on: http://stackoverflow.com/a/28951561
has text: Ty I better go to sleep :)
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28951657
tagged with: angularjs
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28952144
has comment: http://stackoverflow.com/comment/46159571
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46158029
has title: Angular, setting up a callback function for updating between factory and controller
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28953158
downvote count: 0
favorite count: 0
has body: I'm not sure if i have completely wrapped my head around this idea - but I'll try my best to clearly describe what I am trying to do here. I have a factory that changes and parses a URL for me, so I can pass params into a controller for use (that were stored in the url). This is sort of so I can save a state for the user and they can share it via copy'ing of a URL (send it to their friends or bookmark it or w/e). I am trying to set up a factory (or service) that listens for locationChangeSuccess - so that if the user mofies the url and presses enter, it will refresh the scopes in the controllers. So here is what I have: .factory("urlFactory", function($location, freshUrl, StateString){ //request to change new url requestObj.requestState = function(moduleName, stateName, startVar){ } //request item from url, via your module and state name requestObj.parseState = function(moduleName, stateName){ } I dropped the center out (if it is needed im happy to link), but those just get and set the url for me. So in the controllers I do something like $scope.mod2m3 = urlFactory.parseState("module2", "mod3"); $scope.mod2m4 = urlFactory.parseState("module2", "mod4"); So when they land on the page, they pull their state. This works great. However, now i'm trying to solve some edge case scenarios where maybe the user modifies the url. So I can latch onto that even pretty easily with .factory("urlWatcher", function($location, $scope){ var urlWatcher = {}; $scope.$on('$locationChangeSuccess', function(event) { console.log("Asdsa"); }); return urlWatcher }); However, where I am struggling is trying to determine a way where when this fires, it would connect the new value to the scope in the controller. It was suggested to me that a callback of some sort in the parse (set) function, but I am struggling with how to approach that. It would be super cool if I could set a way for this factory/service to re send the new value when it changes to the right place. Callback sounds good, however I…

http://stackoverflow.com/comment/56068033
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29033052
has text: see my answer for http://stackoverflow.com/a/34159525/312929

http://stackoverflow.com/a/28915763
score: 1
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/46089642
has body: There were several issues with the code: 1. Some functions weren't being bound to the correct context (this). 2. The reference set to "obName" was global and constantly changing to the newly created instance. 3. The start time variable was global and constantly being reset every time you called the renderTime function. I have made the modifications to your code in jsFiddle and they can be found in this update: http://jsfiddle.net/3qxoea52/5/ Rendering: this.renderTime = function (startTime) { if( startTime ) { this.startTime = startTime; } this.endTime = new Date(); // time difference in ms this.timeDiff = this.endTime - this.startTime; // strip the miliseconds this.timeDiff /= 1000; // get seconds this.seconds = Math.round(this.timeDiff % 60); // remove seconds from the date this.timeDiff = Math.floor(this.timeDiff / 60); // get minutes this.minutes = Math.round(this.timeDiff % 60); // remove minutes from the date this.timeDiff = Math.floor(this.timeDiff / 60); // get hours this.hours = Math.round(this.timeDiff % 24); this.block.innerHTML = this.hours + " h " + this.minutes + " min " + this.seconds + " sec"; // window.setInterval('this.obName.renderTime()',1000);// Uncomment if you want to test your PCs limit } Binding: this.startButton.addEventListener("click", function () { //if (this.hours === 0 &amp;&amp; this.minutes === 0 &amp;&amp; this.seconds === 0){ this.startTime = new Date(); // } this.tm = window.setInterval(this.renderTime.bind(this), 1000); }.bind(this)) this.stopButton.addEventListener("click", function () { window.clearInterval(this.tm); //timePassed = this.endTime - this.startTime; //endTime = new Date(); // timePassed = endTime - startTime; }.bind(this)) CreateTimer: function createNewTimer() { obName = document.getElementById("ObName").value; if (obName !== "") { obName = new timerObject(obName); obName.addBlock(); obName.renderButtons(); startTime = new Date(); obName.renderTime(startTime); //window.setInterval('obName.renderTime()',1000); } el…
answers question: http://stackoverflow.com/q/28915522
type: Answer

http://stackoverflow.com/a/29012607
score: 3
has comment: http://stackoverflow.com/comment/46271349
type: AcceptedAnswer
downvote count: 0
has body: You need to use the setInterval and setTimeout functions to execute code with schedule: later.setInterval(logit, s);
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29011783
answers question: http://stackoverflow.com/q/29011783

http://stackoverflow.com/comment/46206951
has text: add a word boundary.. Now it won't.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28977602
type: Comment

http://stackoverflow.com/q/28966395
tagged with: jqgrid
has title: Set cellattr function dynamically in JQGrid is not Working
score: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28967122
has body: I am using jqgrid in my application. I am preparing Meta data dynamically for each column. When I am setting cellattr:"functionname” for any of the column is not working. Because I am setting this in double quotes, so it's not working. So is there any workaround of this problem. I am loading data from array. Please let me know any suggestion on this. Thanks in advance.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28967122
favorite count: 0
has comment: http://stackoverflow.com/comment/46185475
type: Question
upvote count: 2
answer count: 1

http://stackoverflow.com/a/28910415
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28910321
score: 0
type: Answer
has body: Edited Use $.eq(), $.index(), $.show() and $.hide() var content = $('div.my-content').hide();//get all and hide var i = $('div.current-page').index();//get index of the current content.eq(i).show();//show selected index OR inline $('div.my-content').hide().eq($('div.current-page').index()).show();
accepted answer of: http://stackoverflow.com/q/28910321

http://stackoverflow.com/comment/46241204
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28996268
has text: do you mean x amount of time on one page or x amount of time on the website?

http://stackoverflow.com/a/60007469
type: Answer
answers question: http://stackoverflow.com/q/29027830
score: 0
has body: "Change to if (typeof $next == 'object' &amp;&amp; $next.length) $next[0].offsetWidth" -did not help. if you convert Bootstrap 3 to php(for WordPress theme), when adding WP_Query ($loop = new WP_Query( $args );) insert $count = 0;. And and at the end before endwhile; add $count++;.

http://stackoverflow.com/q/28942661
tagged with: angularjs
has body: Beginning to dive into AngularJS so I went to their website, but got stuck on the wire up a backend portion where Angular uses Firebase. The first issue came from the ordering of dependencies: angular.module('project', ['ngRoute', 'firebase']) changed to angular.module('project', ['firebase', 'ngRoute']) But now it's telling my that $add, in my $scope.save call, is undefined. Similar $add undefined questions are here and here, but neither seem to apply. Note: I'm running node's http-server, so I'm assuming it's not a localhost problem. Scripts angular.module('project', ['firebase', 'ngRoute']) .value('fbURL', 'https://unique-url-yay.firebaseio.com/') .service('fbRef', function(fbURL) { return new Firebase(fbURL) }) .service('fbAuth', function($q, $firebase, $firebaseAuth, fbRef) { var auth; return function () { if (auth) return $q.when(auth); var authObj = $firebaseAuth(fbRef); if (authObj.$getAuth()) { return $q.when(auth = authObj.$getAuth()); } var deferred = $q.defer(); authObj.$authAnonymously().then(function(authData) { auth = authData; deferred.resolve(authData); }); return deferred.promise; } }) .service('Projects', function($q, $firebase, fbRef, fbAuth) { var self = this; this.fetch = function () { if (this.projects) return $q.when(this.projects); return fbAuth().then(function(auth) { var deferred = $q.defer(); var ref = fbRef.child('projects/' + auth.auth.uid); var $projects = $firebase(ref); ref.on('value', function(snapshot) { if (snapshot.val() === null) { $projects.$set(window.projectsArray); } self.projects = $projects.$asArray(); deferred.resolve(self.projects); }); return deferred.promise; }); }; }) .config(function($routeProvider) { $routeProvider .when('/', { controller:'ListCtrl', templateUrl:'list.html', resolve: { projects: function (Projects) { return Projects.fetch(); } } }) .when('/edit/:projectId', { controller:'EditCtrl', templateUrl:'detail.html' }) .when('/new', { controller:'CreateCtrl', templateUrl:'detail.html' }) .otherwise({ redirec…
downvote count: 0
score: 1
linked to: http://stackoverflow.com/q/26435066
tagged with: firebase
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28948034
tagged with: javascript
has comment: http://stackoverflow.com/comment/49933008
type: Question
has answer: http://stackoverflow.com/a/28948034
upvote count: 1
answer count: 1
linked to: http://stackoverflow.com/q/18864017
tagged with: angularfire
favorite count: 0
has title: Firebase API issue with AngularJS website example project

http://stackoverflow.com/a/28952491
has comment: http://stackoverflow.com/comment/46170444
score: 1
upvote count: 1
type: AcceptedAnswer
has body: Is this something that would be better served by using in-memory structures? Should I look at Redis? That probably mostly depends on how long your players are willing to wait. It doesn't seem to make much sense to store waiting player persistently, so redis or even a redis without persistence might be a better fit indeed. [...] but should tolerate say, the world's chess population playing speed chess games matching against similar ELO rankings Whatever that means... 5M? 10M? Whatever it is, you can get 16GB of RAM at a decent price, so millions usually isn't too troublesome unless you store tens of thousands of bytes per entry.
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28947339
accepted answer of: http://stackoverflow.com/q/28947339
has comment: http://stackoverflow.com/comment/46162513

http://stackoverflow.com/q/28929869
has title: Load div on collapse in Boostrap when screen width is 991px or less
tagged with: twitter-bootstrap
tagged with: css
answer count: 1
score: 0
tagged with: mobile
has answer: http://stackoverflow.com/a/28931019
tagged with: javascript
type: UnansweredQuestion
has body: I am trying to optimize the mobile version of my website in Boostrap. I have a div that takes a lot of space on my page and I would like to be able to hide this div on page load for any screen width of 991px or less. I want to give the option to the user to show the div when clicking on a button. I want this div to appear on page load for screen width greater than 992px. I would like to know if Boostrap offers a way to do so without the use of additional JavaScript and if so, how to do it. If not, what would be the best way to accomplish what I want. &lt;div class="mydiv"&gt; I want to be hidden on page load for screen width of 991px or less &lt;/div&gt; &lt;a class="btn" data-toggle="collapse" data-target=".mydiv"&gt;Show Div &amp;raquo;&lt;/a&gt;
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/46269723
comment on: http://stackoverflow.com/q/29012206
score: 0
has text: please create another question for this since it is not part of the topic
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/130840103
comment on: http://stackoverflow.com/a/67245546
has text: Didn't worked for me.....
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46199103
type: Comment
has text: I believe you can just add the external url to the `files` block in your `karma.config.js` (unsure) http://stackoverflow.com/questions/20938320/loading-external-file-from-karma-jasmine-test
comment on: http://stackoverflow.com/q/28973220
score: 0
type: QuestionComment

http://stackoverflow.com/comment/100444095
score: 0
has text: Thanks for sharing @kadir_ilkimen. If you would like to share an example that you know works users will find that even more useful.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/56952754

http://stackoverflow.com/q/28950704
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
possible better answer: http://stackoverflow.com/a/28950831
has answer: http://stackoverflow.com/a/28950831
type: Question
tagged with: for-loop
has title: JSON objects and HTML tables
tagged with: javascript
has answer: http://stackoverflow.com/a/28950969
has answer: http://stackoverflow.com/a/28950777
score: 0
has answer: http://stackoverflow.com/a/28950868
accepted answer: http://stackoverflow.com/a/28950777
answer count: 4
has body: First time poster here and new to JavaScript... Below is my JSON object... [ { "Name":"Ted", "EmailAddress":"ted@ted.edu", "Title":"Director", "Expertise":"Statistics", "PhoneNumber":"444-444-4444" }, { "Name":"Ann", "EmailAddress":"ann@ann.edu", "Title":"Director", "Expertise":"Physics", "PhoneNumber":"444-444-5555" } ] What I need is to be able to loop through this to add each table row for each employee. There are five values: Name, EmailAddress, Title, Expertise, PhoneNumber This is what I have so far... $(function () { var Employees= [{"Name":"Ted","EmailAddress":"ted@ted.edu","Title":"Director","Expertise":"Statistics","PhoneNumber":"444-444-4444"}, {"Name":"Ann","EmailAddress":"ann@ann.edu","Title":"Director","Expertise":"Physics","PhoneNumber":"444-444-5555"}]; $("#pager").append("&lt;table id='employeelist' class='table'&gt;&lt;table&gt;"); //for loop goes here// Any help would be appreciated! EDIT: Also, how would I make the e-mail addresses 'clickable'/'mail to' the address?

http://stackoverflow.com/q/29044516
type: UnansweredQuestion
tagged with: geolocation
has body: I have a form I'm trying to populate with the closest address to a user (using Google's Reverse Geocode API). That means I need to send latitude and longitude to an Ajax script, but my problem is that the lat/long aren't resolving before the Ajax call is being made. The code I'm using for lat/long calculation is below. Any idea how to make sure the Ajax call happens AFTER the geolocation is received (or cancelling out if it's not) without using a sleep call or some other hack solution. &lt;script type="text/javascript"&gt; var lat, long; function savePosition(position) { lat = position.coords.latitude; long = position.coords.longitude; //alert("Lat = "+lat+"\nLong = "+long); } jQuery(document).ready(function() { function initialize() { var location = navigator.geolocation.getCurrentPosition(savePosition); //lat = location.coords.latitude; //long = location.coords.longitude; //alert(lat+","+long); jQuery.ajax({ url: "./address.php", type: "POST", data: { lat: lat, long: long } }).done(function(result) { alert(result); }); } }); &lt;/script&gt; EDIT Tried to follow the comment's advice and made it the following: &lt;script type="text/javascript"&gt; jQuery(document).ready(function() { var lat, long; function savePosition(position) { lat = position.coords.latitude; long = position.coords.longitude; alert("Lat = "+lat+"\nLong = "+long); jQuery.ajax({ url: "./address.php", type: "POST", data: { lat: lat, long: long } }).done(function(result) { alert(result); }); } function initialize() { var location = navigator.geolocation.getCurrentPosition(savePosition); //lat = location.coords.latitude; //long = location.coords.longitude; alert(lat+","+long); } initialize(); }); &lt;/script&gt; But now the savePosition function isn't getting called at all when I set a breakpoint in it on Chrome. Any idea what's going on?
has title: HTML5 Geolocation + Ajax Request: Ajax firing before Lat/Long
has comment: http://stackoverflow.com/comment/46328763
type: Question
score: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46328887
answer count: 0

http://stackoverflow.com/a/29018510
type: Answer
has body: After you render the new page, the javascript needs to call the function updateform() to populate the html DOM. window.onload=updateform; You can also call it in the &lt;body&gt; element &lt;body onload="updateform()"&gt;
downvote count: 0
has comment: http://stackoverflow.com/comment/46282287
has comment: http://stackoverflow.com/comment/46281540
answers question: http://stackoverflow.com/q/29018350
has comment: http://stackoverflow.com/comment/46281576
has comment: http://stackoverflow.com/comment/46281053
score: 1
upvote count: 1

http://stackoverflow.com/q/28952762
has comment: http://stackoverflow.com/comment/46159625
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28953333
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46159558
score: 0
has comment: http://stackoverflow.com/comment/46159742
tagged with: video
has answer: http://stackoverflow.com/a/28953333
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46159887
has title: Html5 video paused at specific time VideoFrame
has body: For a project i need to pause a video at a very specific time. In order to be precise i watch the frame of the video using VideoFrame. demo here It's works but i don't understand why i need to click twice to relanch the video. Any ideas or others solutions ? Thanks
type: Question

http://stackoverflow.com/comment/46127201
score: 0
type: Comment
has text: @bablu - Want to try and avoid using a third party framework like jQuery as this will be packaged in an internal framework and we want to avoid dependency on a third party library.
type: QuestionComment
comment on: http://stackoverflow.com/q/28935801

http://stackoverflow.com/comment/46666435
has text: You could maybe try to create a job in the DB for each time a value is updated, you re-generate a the cached files so it is easy to use for the FE.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29031855
type: Comment

http://stackoverflow.com/a/28908275
has comment: http://stackoverflow.com/comment/54685259
has comment: http://stackoverflow.com/comment/54683132
score: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/54721106
type: Answer
answers question: http://stackoverflow.com/q/28907706
has comment: http://stackoverflow.com/comment/54691969
downvote count: 1
has body: Try this (demo): $(function () { $('button[type="submit"]').click(function () { var pageTitle = 'Page Title', stylesheet = '//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css', win = window.open('', 'Print', 'width=500,height=300'); win.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;' + pageTitle + '&lt;/title&gt;' + '&lt;link rel="stylesheet" href="' + stylesheet + '"&gt;' + '&lt;/head&gt;&lt;body&gt;' + $('.table')[0].outerHTML + '&lt;/body&gt;&lt;/html&gt;'); win.document.close(); win.print(); win.close(); return false; }); });

http://stackoverflow.com/comment/46204077
type: QuestionComment
has text: Never worked with it so cant give you an example, but take a look here: https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history
comment on: http://stackoverflow.com/q/28976493
score: 0
type: Comment

http://stackoverflow.com/comment/46308000
type: AnswerComment
comment on: http://stackoverflow.com/a/29025309
type: Comment
has text: The styles of the iframe that the editor resides in already has the height set to auto but it does not expand when typing.
score: 0

conditional-operator
tags question: http://stackoverflow.com/q/29037737
tags question: http://stackoverflow.com/q/29052832
tags question: http://stackoverflow.com/q/29043135
type: Tag
tag name: conditional-operator
tags question: http://stackoverflow.com/q/28963398

http://stackoverflow.com/comment/46216525
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28983632
has text: sorry, version is 1.7
score: 0

http://stackoverflow.com/a/29024867
answers question: http://stackoverflow.com/q/29024820
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/46292301
upvote count: 1
has comment: http://stackoverflow.com/comment/46292346
has body: Check it out here http://jsfiddle.net/p56awrea/2 &lt;script type='text/javascript'&gt; var index = 0; var text = 'hello' var current = '' // Here you can put in the text you want to make it type. function type() { document.getElementById('screen').innerHTML = '{'+current+'}'; current+=text.charAt(index); index += 1; if(index==text.length+1){ current = ''; index=0; setTimeout('type()',2000); } else { setTimeout('type()',120); } } &lt;/script&gt; &lt;body onload="type()"&gt; ... &lt;div id='screen'&gt;{}&lt;/div&gt; EDIT: Added the 2 second delay before looping behavior
accepted answer of: http://stackoverflow.com/q/29024820
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46179120
type: QuestionComment
type: Comment
has text: Use `isset()` or `empty()` or a ternary operator.
score: 3
comment on: http://stackoverflow.com/q/28963732

http://stackoverflow.com/a/29001323
has comment: http://stackoverflow.com/comment/46258071
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29000086
has body: To solve your problem you need to remove the following line from your post function: $compile(tElem)(scope); It's not clear to me why you are compiling here so I'm not sure if there will be any unintended side effects from this.
downvote count: 0
score: 1

http://stackoverflow.com/a/29209632
has comment: http://stackoverflow.com/comment/46645644
downvote count: 0
score: 1
has body: Have you looked into SignalR? Personally I would go this route, having the console app running on your web server register to the same SignalR hub as the clients (i.e. your web app will host the SignalR hub). Then use the console app to push the messages to the SignalR hub on your web app, which will relay them to all listening clients (given the correct setup). The disadvantage the WCF route has is the usual configuration nightmare, certainly possible - but in my option not as straight forward as SignalR. Have you seen the following stack overflow question for a good comparison between WCF and SignalR Push data to client using SignalR vs WCF? There is some great tutorials for this over at http://www.asp.net/signalr
answers question: http://stackoverflow.com/q/29020026
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29020026
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46629431
type: Answer
has comment: http://stackoverflow.com/comment/46638375

http://stackoverflow.com/q/28998308
has title: DOM not updating after changing slick-carousel's html with ajax
score: 0
answer count: 1
tagged with: jquery
has body: My slick carousel is defined inside the body as: &lt;div class="election-carousel"&gt; &lt;?php echo Election.php::createView(); ?&gt; &lt;/div&gt; Items of the carousel are created using an interval ajax call but the carousel is not updating: setInterval(function(){ $.ajax({ url: '../class/Election.php?createView=1', success: function (html) { $(".election-carousel").html(html); }, type: 'GET' }); }, 5000); I checked the page source after loading the carousel's items and it's there. I also tried .slick("unslick") then reinitialize but it doesn't work. It seems to be the DOM which is not updating?
accepted answer: http://stackoverflow.com/a/28998410
tagged with: slick.js
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28998410
tagged with: javascript

http://stackoverflow.com/a/29029042
answers question: http://stackoverflow.com/q/28966297
type: AcceptedAnswer
has body: I had a look at your page, and I found you placed the 'jssor.slider.mini.js' in root folder. So, the correct reference path is, &lt;script src="/jssor.slider.mini.js"&gt;&lt;/script&gt; or &lt;script src="jssor.slider.mini.js"&gt;&lt;/script&gt; Btw, the 'jssor.slider.min.js' and 'jssor.slider.mini.js' are the same, you need only one. Please remove the following line, &lt;script src="js/jssor.slider.min.js"&gt;&lt;/script&gt; Edit: And you have no initialization code, please add the following code, &lt;script&gt; jssor_slider1_starter = function (containerId) { var options = { $DragOrientation: 3, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0) $ArrowNavigatorOptions: { //[Optional] Options to specify and enable arrow navigator or not $Class: $JssorArrowNavigator$, //[Requried] Class to create arrow navigator instance $ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always $AutoCenter: 0, //[Optional] Auto center arrows in parent container, 0 No, 1 Horizontal, 2 Vertical, 3 Both, default value is 0 $Steps: 1 //[Optional] Steps to go for each navigation request, default value is 1 } }; var jssor_slider1 = new $JssorSlider$(containerId, options); }; &lt;/script&gt; And also, please move a03.png to your [root]/img folder.
has comment: http://stackoverflow.com/comment/46304031
has comment: http://stackoverflow.com/comment/46300190
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28966297
upvote count: 2

http://stackoverflow.com/comment/46343223
type: Comment
comment on: http://stackoverflow.com/q/29052506
type: QuestionComment
score: 1
has text: Define what is mobile and what is desktop? The lines are not so clear these days. What is a tablet? What is a laptop that can convert to a tablet?

http://stackoverflow.com/q/28924907
has title: Add share (contact) button for whatsapp and other messangers in website
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28924957
possible better answer: http://stackoverflow.com/a/28925421
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/28924957
tagged with: javascript
score: 0
tagged with: android
tagged with: http://stackoverflow.com/tag/html
has body: How can I add a share button on the page of my site, we can add send SMS on mobile HTML pages with this code : title And how can use this sample in share, such as Viber, Watsapp and etc
has comment: http://stackoverflow.com/comment/46106392
has answer: http://stackoverflow.com/a/28925421

http://stackoverflow.com/q/29011313
answer count: 1
has body: I've recently picked up on Angular's basics a couple of months ago, and now I'm trying to build an industry-grade-like practice app. I've just followed John Papa's Play by Play and Clean Code courses on Pluralsight; both are roughly expansions to his latest ng-conf talk. I am yet to read the Style Guide in its entirety but generally, these courses gave me an idea of the what, why and how of many things. There are few things I don't understand in his code, though, which is replicated on the hottowel yo generator. The 'blocks' decorator modules, both, 'router' and 'exception' blocks do not work when I try to replicate them into my project. This is what I write to configure my landing route (which is almost exactly what is written in the generator's dashboard route): (function() { 'user strict'; angular .module('app.landing') .run(appRun); appRun.$inject = ['routerHelper']; //////////////////// // @ngInject function appRun(routerHelper) { routerHelper.configureStates(getStates()); } function getStates() { return [ { state: 'landing', config: { url: '/', templateUrl: 'sections/landing/landing.html', controller: 'Landing', controllerAs: 'landing', title: 'landing' } } ]; } })(); I am trying to get the app talking to a Rails backend, so I don't want any server-side node implementation (and my gulp sever is a functioning entirely browser-sync with a middleware proxy implementation), but even just copying the 'blocks' code to the letter doesn't work with me. It doesn't show anything in the browser, nothing at all in the dev-tools and I lost half of my hair trying to figure out what's wrong. Could you please help me make sense of this?
tagged with: javascript
tagged with: hottowel
score: 0
tagged with: angularjs
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/30541439
has title: Angular Hottowel 'blocks.exception' and 'blocks.router' Do not Show the App in the Browser

http://stackoverflow.com/comment/46225430
comment on: http://stackoverflow.com/q/28988027
score: 0
type: Comment
type: QuestionComment
has text: I highly suggest that you provide the price calculated from server side. The client can manipulate the value of the var "Price". If you want just to implement this in order to provide a good experience to your customer then it's OK, however you will need to change your code twice if you change your logic.

http://stackoverflow.com/a/28982096
accepted answer of: http://stackoverflow.com/q/28981825
has body: Issue here is with your control's ID in the aspx page. For instance, you have the below text box in asp grid view row: &lt;asp:TextBox ID="TextBox1" runat="server" Text='&lt;%# Bind("Hour") %&gt;'&gt;&lt;/asp:TextBox&gt; Text box ID here is 'TextBox1', but in the code behind you are searching for text box with ID 'Hour' TextBox txtHour = (TextBox)e.Row.FindControl("Hour"); I think you have mistaken the TextBox Id to the asp:TemplateField header attribute &lt;asp:TemplateField HeaderText="Hour" SortExpression="Hour"&gt; Ensure the ID with which you search in the code behind (using FindControl) is the same as the control'd ID in the aspx page (Text box control ID here) As the FindControl method(in RowDataBound event) in the code behind is not able to find a TextBox control with ID 'Hour' it is throwing the error 'null reference exception' Same goes with other control in your Grid Row. UDPATED ANSWER protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Footer) { TextBox txtHour = (TextBox)e.Row.FindControl("txtHour"); TextBox txtrate = (TextBox)e.Row.FindControl("ratePerHourTextBox"); TextBox TextBoxInsertTotal = (TextBox)e.Row.FindControl("TextBoxInsertTotal"); txtHour.Attributes["onKeyup"] = "javascript: return multiplication('" + Convert.ToInt32(txtHour.Text) + "','" + Convert.ToDouble(txtrate.Text) + "','" + Convert.ToInt32(TextBoxInsertTotal.ClientID) + "')"; txtrate.Attributes["onKeyup"] = "javascript: return multiplication('" + Convert.ToInt32(txtHour.Text) + "','" + Convert.ToDouble(txtrate.Text) + "','" + Convert.ToInt32(TextBoxInsertTotal.ClientID) + "')"; } }
has comment: http://stackoverflow.com/comment/46218929
type: Answer
has comment: http://stackoverflow.com/comment/46214627
has comment: http://stackoverflow.com/comment/46220978
has comment: http://stackoverflow.com/comment/46218992
has comment: http://stackoverflow.com/comment/46216264
has comment: http://stackoverflow.com/comment/46213928
has comment: http://stackoverflow.com/comment/46220113
has comment: http://stackoverflow.com/comment/46215339
has comment: http://stackoverflow.com/comment/46220245
has comment: http://stackoverflow.com/comment/46282606
has comment: http://stackoverflow.com/comment/46216579
has comment: http://stackoverflow.com/comment/46214354
has comment: http://stackoverflow.com/comment/46215818
has comment: http://stackoverflow.com/comment/46215007
has comment: http://stackoverflow.com/comment/46216888
has comment: http://stackoverflow.com/comment/46215234
score: 0
has comment: http://stackoverflow.com/comment/46378765
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28981825
has comment: http://stackoverflow.com/comment/46214735
has comment: http://stackoverflow.com/comment/46217381
has comment: http://stackoverflow.com/comment/46256071

http://stackoverflow.com/q/28940581
answer count: 1
tagged with: jquery
tagged with: instagram
type: UnansweredQuestion
has title: Pulling in an Instagram feed of image to my website
has answer: http://stackoverflow.com/a/28940750
type: Question
tagged with: javascript
has body: I'm using some JS to pull in a feed of Instagram images from my account by a certain hashtag associated with the image. I've set it to pull in 10 images but for some reason it seem to be pulling in 21 instead. This was working ok a few days ago but all of a sudden it's not working now and have no idea why Here's the page online http://www.gezzamondo.co.uk/simple.html // JavaScript Document $(function() { var cmdURL, embedImage, onPhotoLoaded, param, tag_name, userid, param = { access_token: "I'VE REMOVED THIS", // feel free to change it with your own access token count: 10 // the total number of images }, tag = 'Gezzamondoportfolio', // your user id. you can find this one out by looking into one of your pictures uri tag_name = '#photowall', cmdURL = 'https://api.instagram.com/v1/tags/' + tag + '/media/recent?callback=?'; embedImage = function(photo) { var a, img; img = $('&lt;img/&gt;').attr({ //'src': photo.images.thumbnail.url, //'width': photo.images.thumbnail.width, //'height': photo.images.thumbnail.height 'src': photo.images.standard_resolution.url, 'width': photo.images.standard_resolution.width, 'height': photo.images.standard_resolution.height }); a = $('&lt;a /&gt;').attr({ 'href': photo.images.standard_resolution.url, 'target': '_blank', 'class': 'pull-left' }).append(img).appendTo(tag_name); }; onPhotoLoaded = function(data) { var photo, _i, _len, _ref, _results; if (data.meta.code === 200 &amp;&amp; data.data) { _ref = data.data; _results = []; for (_i = 0, _len = _ref.length; _i &lt; _len; _i++) { photo = _ref[_i]; _results.push(embedImage(photo)); } return _results; } }; return $.getJSON(cmdURL, param, onPhotoLoaded); });
score: 0

http://stackoverflow.com/q/28964455
has comment: http://stackoverflow.com/comment/46241941
tagged with: meteor-collection2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46188005
has body: I'm using autoform, collection2. I want to use method call type for insert/update, as I want to add additional fields before saving to database in server. SimpleSchema would check the data in client, but how can I make the data is checked against the schema on server-side as well? My method for adding new data is as follows: Meteor.methods({ companyAdd: function (companyAttr) { // add additional fields to document var currentDate = new Date(); var company = _.extend(companyAttr, { createdBy: user._id, createdAt: currentDate }); var newCompanyId = Companies.insert(company); return {_id: newCompanyId}; } }
type: Question
tagged with: meteor-autoform
has answer: http://stackoverflow.com/a/28964531
upvote count: 5
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28964531
score: 5
answer count: 1
downvote count: 0
tagged with: meteor
favorite count: 0
has title: Verifying schema on Meteor Method using autoform

http://stackoverflow.com/q/29033943
has title: Autofill input by Chrome - is there an event?
has body: A have form with lots of inputs. Each one of them gets validated and saved on focus out. The trouble is that when user autofills several inputs by Chrome, there is no focusout events on that field, so they are not saved. Is it possible to catch event when Chrome fills inputs - to validate them at that moment?
tagged with: google-chrome
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46309111
has answer: http://stackoverflow.com/a/29034124
type: Question
upvote count: 4
downvote count: 0
linked to: http://stackoverflow.com/q/11708092
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29034124
answer count: 1
favorite count: 0
score: 4

http://stackoverflow.com/comment/46157816
comment on: http://stackoverflow.com/q/28951873
type: QuestionComment
has text: Does the callback get called? do extractor.process(function(err, res) { console.log('done') });
type: Comment
score: 0

http://stackoverflow.com/q/29057730
favorite count: 0
possible better answer: http://stackoverflow.com/a/29066216
has answer: http://stackoverflow.com/a/29066216
type: Question
has answer: http://stackoverflow.com/a/29057883
has title: Rails-jQuery Why do I have to click twice for jQuery effect to show?
has body: I am using Rails 4.1.1 Why do I have to click twice for jQuery effect to show? I have been Googling but I cannot find any solutions, not sure if there's something wrong with my jQuery code or.... When I click "Submit" for the first time, the effect didn't appear but the POST action is already called, when I click for the second time, the effect appeared and the POST action is called. Please check below my create.js.erb, users_controller.rb, new.html.erb create.js.erb function isValidEmailAddress(emailAddress) { var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i); return pattern.test(emailAddress); }; $("form").submit(function( event ) { var email = $("input#user_email").val(); if (email == "") { $("h1").text( "Email cannot be empty" ).show().fadeOut( 3000 ); return; } else if (!isValidEmailAddress(email)) { $("h1").text( "Email address is not valid" ).show().fadeOut( 3000 ); }else { $("h1").text( "Correct email address" ).show(); } event.preventDefault(); }); new.html.erb <%= form_for @user, remote: true do |f| %> <%= f.text_field :email %> <%= f.submit :Submit %> <% end %> <% @users.each do |user| %…
upvote count: 2
answer count: 2
tagged with: ruby-on-rails
accepted answer: http://stackoverflow.com/a/29057883
tagged with: ruby-on-rails-4
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/46110741
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28927191
has text: @MonicaOlejniczak Yes it is on Safari, not on Chrome.

http://stackoverflow.com/comment/46164293
type: Comment
type: QuestionComment
has text: paqogomez, in my page i can not use ajax post back process. thanks for your valuable information
score: 0
comment on: http://stackoverflow.com/q/28948433

http://stackoverflow.com/a/28948281
has comment: http://stackoverflow.com/comment/46188817
answers question: http://stackoverflow.com/q/28942985
has comment: http://stackoverflow.com/comment/46187684
has comment: http://stackoverflow.com/comment/46180996
score: 0
type: Answer
has body: You can try to overwrite you path with different color with new polyline var reRouteOptions = { path: position_driver.getPath(), strokeColor: 'grey', strokeWeight: 1 }; var reRoute = new google.maps.Polyline(reRouteOptions); reRoute.setMap(map);

http://stackoverflow.com/q/28914662
has comment: http://stackoverflow.com/comment/46087417
tagged with: javascript
has comment: http://stackoverflow.com/comment/46088492
favorite count: 0
has comment: http://stackoverflow.com/comment/46087824
has comment: http://stackoverflow.com/comment/46087504
has body: I'm learning JavaScript through "Eloquent JavaScript" manual and now I'm doing exercises from chapter 5 "High-Order Functions". One of the functions this chapter introduces you is "reduce". I understand how it works, my problem comes up when I try to understand its definition at MDN. I don't understand syntax definition it gives: arr.reduce(callback[, initialValue]) This syntax sections is followed by the section called Parameters. These are: callback previousValue currentValue index array initialValue (optional) What I don't understand is what do those square brackets and the comma mean? Because when I see square brackets immediately I think in arrays. And why is just initialValue in the definition and not the others parameters? Why there is no space between square brackets and callback? Because below there are two examples: Example 1 [0, 1, 2, 3, 4].reduce(function(previousValue, currentValue, index, array) { return previousValue + currentValue; }); Example 2 var total = [0, 1, 2, 3].reduce(function(a, b) { return a + b; }); // total == 6 and I don't know how do they fit into the definition. Thanks
has comment: http://stackoverflow.com/comment/46088334
has title: What does this documentation syntax mean at MDN for a JavaScript function?
has answer: http://stackoverflow.com/a/28915625
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28914723
has comment: http://stackoverflow.com/comment/46087659
upvote count: 7
downvote count: 1
linked to: http://stackoverflow.com/q/10925478
has comment: http://stackoverflow.com/comment/46087616
duplicate of: http://stackoverflow.com/q/10925478
has comment: http://stackoverflow.com/comment/46090633
score: 6
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46087412
tagged with: arrays

http://stackoverflow.com/comment/46328061
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29043341
has text: Hey Justin, Thanks for that, I've had a look at it seems to be semi-working. This is just an example, the values in the dropdowns won't always be "test1", "test2"...etc. Also doesn't let me make more than 1 mistake, for example: http://screencast.com/t/eXwB4NE9V you can see after my second attempt it's just a mess. I worked out the `$('#all').replaceWith('Complete');` and changed .error to `border: red 1px dashed` but still would prefer it to look more "error" like :/
type: AnswerComment

http://stackoverflow.com/comment/46344420
has text: I don't think you'd have any luck as yahoo doesn't seem to support `JSONP`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29053326
score: 0

http://stackoverflow.com/a/28949895
accepted answer of: http://stackoverflow.com/q/28949048
type: AcceptedAnswer
has body: I figured this out by taking a closer look at the token object I was sending: the token object contains a field called g-oauth-window, which contains a reference to the DOM object which created it. When you pass this token inside of a $.post request, JQuery will resolve this field, and it makes Firefox bug out. Blanking out this field (setting it to null) makes everything work!
answers question: http://stackoverflow.com/q/28949048
has comment: http://stackoverflow.com/comment/128741778
type: Answer
downvote count: 0
score: 6
upvote count: 6

http://stackoverflow.com/q/28999645
has answer: http://stackoverflow.com/a/28999727
has answer: http://stackoverflow.com/a/29001025
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
upvote count: 1
has title: Anime line on scroll
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46248298
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/29001212
has body: I have a simple animation (a line extend) and it's played automatically, but it's at the second section of the website. How can I make it appear when the user is on it? Here is the code: #home { height:1000px; background:rgba(0,153,255,1); } #work { position:relative; height:1000px; background: rgba(0,204,102,1); } #about{ height:1000px; background: rgba(153,51,51,1); } #contact { height:1000px; background: rgba(153,153,153,1); } #line{ position:absolute; width:340px; margin-top:200px; height:4px; background:rgba(0,0,0,1); -moz-animation-duration: 1s; -webkit-animation-duration: 1s; -moz-animation-name: slidein; -webkit-animation-name: slidein; } @-moz-keyframes slidein { from { margin-left:100%; width:300% } to { margin-left:0%; width:600%; } } @-webkit-keyframes slidein { from { margin-left:0%; width:0% } to { margin-left:0%; width:340px; } } And how can I make it work in the other way too, I mean, when the user is scroll up the animation work again?
accepted answer: http://stackoverflow.com/a/29001025
tagged with: animation
possible better answer: http://stackoverflow.com/a/28999727
tagged with: scroll
tagged with: css

http://stackoverflow.com/comment/46232786
has text: Hi @jeremy, thanks again for your help. I have studied your solution and I like how elegant and concise it is. I have a solution I need to write for multiple documents, but I have one question for you. In your code `update: function(event, ui){ var items = $(this).find("li"),` the `var` is kind of hanging out there and that's something I haven't seen before. What is the purpose of `var` in this example?
type: Comment
comment on: http://stackoverflow.com/a/28975752
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46303128
score: 0
has text: It is, but he doesn't want all the xAxis labels. All he needs to do is use, tickInterval:4. http://jsfiddle.net/4bf06xvv/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29026465

http://stackoverflow.com/a/29061972
answers question: http://stackoverflow.com/q/29061724
has body: Change two lines to: var firstTreeItems = para[1].split(' ', 3) para[1] = _.without(para[1].split(' '), firstTreeItems[0], firstTreeItems[1], firstTreeItems[2]).join(' ') _.without is not looking to remove the elements of the firstTreeItems array you provided, it is looking to remove the array itself, and not finding it. First I'm leaving firstTreeItems as an array so I can access each element individually. Then I'm giving each undesired element to _.without to remove from our temporary para[1].split(' ') array.
type: AcceptedAnswer
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/46361010
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29061724
score: 1

http://stackoverflow.com/comment/46176577
has text: Thank you very much, it worked. I am sorry for not explaining my question 'properly' - I just didn't know how to explain the problem, I only know HTML and CSS well, but quite a beginner with JS. Thank you
comment on: http://stackoverflow.com/q/28962027
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/a/28961786
answers question: http://stackoverflow.com/q/28961406
score: 0
has body: You might move the API call logic to the parent controller, see the JSFiddle demo for an example, or at least replace the modified element in $scope.items array in parent scope. EDIT: Scrap my previous statement here, the reson it is not working is because when you assign $scope.item in the child scope's incr() method, you're not modifying the $scope.items array. You're just changing variable assignment in the child scope. So, before the incr() call the variable assignments in memory could look like: $scope.items = item1 -&gt; [ js obj 1 ] item2 -&gt; [ js obj 2 ] item3 -&gt; [ js obj 3 ] $scope.item -&gt; [ js obj 1 ] After incr() call for the first item: $scope.items = item1 -&gt; [ js obj 1 ] // still obj 1 here! item2 -&gt; [ js obj 2 ] item3 -&gt; [ js obj 3 ] $scope.item -&gt; [ js obj 4 ] // but entirely new obj here! Sample code: angular.module('app', []) .controller('ParentController', ['$scope', function ($scope) { $scope.items = [{ name: "Foo", number: 0 }, { name: "Bar", number: 1 }, { name: "Baz", number: 1 }]; // fake code, would get from API normally var getFromApi = function (item) { return { name: item.name, number: item.number + 1 }; } $scope.updateItem = function (index) { $scope.items[index] = getFromApi($scope.items[index]); }; }]) .controller('ItemController', ['$scope', function ($scope) { $scope.incr = function (index) { $scope.updateItem(index); } }]); Obviously, you can get away without using $index if you want to identify the modified item in another way. Code above is only a simplest fix for your issue. You might event keep the getFromApi() in the child scope and just use the $scope.items[$index] = getFromApi() there (thanks to scope inheritance). I just find keeping that method in parent scope a tad more clean.
type: Answer

http://stackoverflow.com/comment/46333205
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29045759
has text: This looks good and works. Is this compatible with all modern browsers?
type: AnswerComment

http://stackoverflow.com/q/29053894
tagged with: http://stackoverflow.com/tag/json
tagged with: arrays
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Working with Array or Object in jQuery?
has body: I know JavaScript doesn't support associate array. We will create an object with a key as a string. Here is https://jsfiddle.net/maheshwaghmare/sgw07L8L/6/ E.g. "hometitle":[ ["fontsize","12px"], ["lineheight","16px"], ], But, I need to create it like: E.g. ".home-title":[ ["font-size","12px"], ["line-height","16px"], ], So, In this situation how can I store and retrieve values without storing repetitive values in same parent. E.g. (.home-title) doesn't contain another (font-size) NOTE: Parents(.home-title) may be - (.home-title .headings) - (#header .title) etc I know we could not store this kind of keys in object. Any solution..! Thanks in Advance...!
favorite count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: object
has answer: http://stackoverflow.com/a/29053959

http://stackoverflow.com/q/29002749
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46255561
accepted answer: http://stackoverflow.com/a/29004807
has title: download audio on onclick of button using audio.js
type: Question
tagged with: javascript
has body: I want download currently playing audio.. I used http://kolber.github.io/audiojs/demos/test6.html.. function download() { $.ajax( { url: '@Url.Action("Index")', success: function () { alert("success"); var oAudio = document.getElementById('myAudio'); var url = oAudio.getAttribute('src'); var newurl = "http://192.168.0.13:80/" + url; alert(newurl); window.open(newurl); }, error: function () { alert("err"); var oAudio = document.getElementById('myAudio'); var url = oAudio.getAttribute('src'); alert(url); window.open(url); } }); } It doesnot download audio..any solution plz
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29004807
has comment: http://stackoverflow.com/comment/46255527
tagged with: model-view-controller

http://stackoverflow.com/a/29005981
type: Answer
answers question: http://stackoverflow.com/q/29005798
has body: Instead of .. $(".accordion-content:hidden") Do: $(".accordion-content").is(':hidden') There really is no need for the last, "visible", option since you use "else". But if you want to use it then: $(".accordion-content").is(':visible')
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/29005798
has comment: http://stackoverflow.com/comment/46300532

http://stackoverflow.com/comment/46196286
score: 1
has text: You're missing a lot of `"`... plum, green, yellow, green and red are undefined (thinks they're variables without `"`)
type: AnswerComment
comment on: http://stackoverflow.com/a/28972490
type: Comment

http://stackoverflow.com/comment/46226793
has text: It's not clear what problem you're having, although at first glance it doesn't look like the code would do what I suspect you want it to. What happens when you run this? What would you prefer?
score: 1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28989142

bukkit
tag name: bukkit
tags question: http://stackoverflow.com/q/29048932
type: Tag

http://stackoverflow.com/q/29012579
has body: I would like to style my input fields in ember.js like this: http://tympanus.net/codrops/2015/01/08/inspiration-text-input-effects/ It is not just the input field, but is accompanied also by: additional span and label tags for every input field and a general small custom js section that is taking care for visual effects First Name What is a good way to wrap this for a convenient re-use? Do you recommend putting this into an ember component? Thank you, Manuel
tagged with: ember.js
answer count: 1
has answer: http://stackoverflow.com/a/29013289
favorite count: 0
tagged with: input
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29013289
downvote count: 1
has title: Best practice for custom input fields in ember.js
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/46314716
has text: _This doesn't seem to be working_ is not terribly descriptive. Are you getting any errors in the console? Different behavior? Help us help you.
score: 0
comment on: http://stackoverflow.com/q/29035930
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/132904966
score: 0
type: AnswerComment
has text: @Kameneth thanks, edited according your suggestion
comment on: http://stackoverflow.com/a/53913811
type: Comment

http://stackoverflow.com/q/29031003
score: -1
possible better answer: http://stackoverflow.com/a/29031454
tagged with: filter
has answer: http://stackoverflow.com/a/29031454
answer count: 3
has body: For example i have an array var fruits = ["Banana", "Orange", "Apple", "Mango", "App", "Man"]; The code fruits.splice(2, 2); Return me output Banana,Orange,App,Man But how to return only 1,3,4 elements from array without looping? So i will get Orange,Mango,App I imaging must be something like that fruits.splice( fruits.indexOf(Orange,Mango,App), 1 );
has answer: http://stackoverflow.com/a/29031295
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29031274
accepted answer: http://stackoverflow.com/a/29031274
type: AnsweredQuestion
upvote count: 0
type: Question
tagged with: arrays
has title: Javascript Remove specific only needed n-th elements of array
tagged with: javascript

http://stackoverflow.com/q/28968987
tagged with: http://stackoverflow.com/tag/json
type: Question
accepted answer: http://stackoverflow.com/a/28969027
has title: "JSON.parse(str)" returns "Unexpected token c" but str is a string
has comment: http://stackoverflow.com/comment/46189566
has comment: http://stackoverflow.com/comment/46189496
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28969027
has body: I am trying the following (below), but when I want to wrap the JSON.parse then I get an error Unexpected Token C. I checked online for similar problems and it says that the input is already an object, thus the reason for throwing this error. However, I tried typeof str and it returned me String. Also accessing it by piecesString[0].col did not work - thus my input is not an object but indeed a string. What went wrong? function generatePieces(nbPieces) { console.log("** nbPieces: " + nbPieces) var piecesString = ""; var piecesArray = []; var colIter = 0; var rowIter = 0; for (var i = 0; i &lt;= (nbPieces*nbPieces-1); i++) { piecesString = piecesString + "{col:" + colIter + ",row:" + rowIter + "}," colIter = colIter + 1; if (colIter == (nbPieces)) { //console.log("colIter = nbPieces") colIter = 0; rowIter = rowIter +1; } } piecesString = piecesString.substring(0, piecesString.length - 1); piecesString = "[" + piecesString + "]" piecesString = '' + piecesString console.log(piecesString) piecesArray = JSON.parse(piecesString); //console.log(piecesString) }; // end generate pieces
has comment: http://stackoverflow.com/comment/46189530
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/46200455
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46189549

http://stackoverflow.com/q/28989500
possible better answer: http://stackoverflow.com/a/29507233
has answer: http://stackoverflow.com/a/29507233
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28992945
upvote count: 1
has body: I have an application that is in the late stages that uses pickadate.js. It's been reported to me that JAWS does not work with the date picker since the arrow keys are required to select a day and they are already mapped to something else in JAWS. Is there a good way to get around this issue and still make the datepicker accessible for JAWS users? Any insight would be appreciated. Still learning about accessibility on the web.
type: Question
tagged with: javascript
tagged with: accessibility
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28992945
score: 1
favorite count: 0
has title: How do I get pickadate.js working with the JAWS screenreader?

http://stackoverflow.com/comment/46156197
has text: 1,000,000 is the maximum billable. https://developers.google.com/maps/documentation/javascript/usage
type: AnswerComment
comment on: http://stackoverflow.com/a/28950623
score: 0
type: Comment

http://stackoverflow.com/a/28914723
has comment: http://stackoverflow.com/comment/46087588
upvote count: 4
answers question: http://stackoverflow.com/q/28914662
has comment: http://stackoverflow.com/comment/46088307
score: 3
has comment: http://stackoverflow.com/comment/46087605
downvote count: 1
type: Answer
has body: It's usually a convention for API documentations to use [] to denote optional parameters. However, the [] is not part of the syntax on usage. It's just documentation convention.

http://stackoverflow.com/a/58280766
has body: I faced same issue with react project, npm install braintree wasn't working. If it's also not working in your case, then install it globally. npm install -g braintree
score: 0
answers question: http://stackoverflow.com/q/28975589
type: Answer

http://stackoverflow.com/comment/46207384
type: QuestionComment
has text: I have just tested and it worked. Please make sure the reference path of 'jssor.slider.min.js' is correct.
score: 0
comment on: http://stackoverflow.com/q/28966297
type: Comment

http://stackoverflow.com/a/28947658
score: 1
upvote count: 1
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28947562
accepted answer of: http://stackoverflow.com/q/28947562
has body: You can use this single regex using negative lookahead: /^(?!.*?(word1|word2))[\w\s-]{3,50}$/i
type: Answer

http://stackoverflow.com/comment/46123728
comment on: http://stackoverflow.com/q/28933756
has text: what is your question? what isnt working? what do you expect to happen, and what is happening instead? are there errors in the console? have you tried running the initialization code in the console? have you verified if the include files have been loaded?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29027720
downvote count: 0
answers question: http://stackoverflow.com/q/29027685
upvote count: 2
has body: Firstly, you should use change or input instead of keyup. Not everyone uses a keyboard! Second, only jQuery objects have a val() method. Using this you are referring to the &lt;textarea&gt; element which does not: $('#input').on("input", function() { var yourText = $(this).val(); // Only jQuery objects have a .val() $('#text').html(yourText); // Pass your variable in here }); jsFiddle Demo
type: Answer
score: 2

http://stackoverflow.com/comment/46261015
type: Comment
comment on: http://stackoverflow.com/a/28984428
has text: You're unlikely to be able to get these requests to run synchronously - by it's design, Node favours callbacks in order to not block the main application process. I'm sure you can achieve what you're after asynchronously.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46230481
type: QuestionComment
comment on: http://stackoverflow.com/q/28989213
has text: You will need much effort to get two different application/modules/what_ever to work like one. You should probably need to edit every jqx JS file to finalize your need. I just took a quick look of jqxtabs.js and if you search code for "addClass" for example, there is 52 results though those are not pointed to exact classes but to pseudo variables and depending part of code related to extended files and what ever not. If not in documentation there is no easy way. Short answer, don't even try if you don't have adequate amount of time.
score: 0
type: Comment

http://stackoverflow.com/a/28983944
type: AcceptedAnswer
downvote count: 0
has body: Yup, that's just one of the features of || in JavaScript, and it's deliberate. It doesn't return a boolean (necessarily), it works like this: It evaluates the left-hand operand and if that operand is truthy, it returns it; otherwise, it evalutes and returns the right-hand operand. So what's "truthy"? Anything that isn't "falsy". :-) The falsy values are 0, "", null, undefined, NaN, and of course, false. Anything else is truthy. If you need a boolean, just !! the result: var subCond1 = !!(adj.getData('relationEnabled') == 'true' || adj.getData('unhideIfHidden') || adj.getData('hlFixed') == 'true'); ...but you frequently don't need to bother. This behavior of || is really useful, particularly (I find) when dealing with object references that may be null, when you want to provide a default: var obj = thisMayBeNull || {}; Now, obj will be thisMayBeNull if it's truthy (non-null object references are truthy), or {} if thisMayBeNull is falsy. More in this article on my blog: JavaScript's Curiously-Powerful OR Operator (||) Just to round things out: The &amp;&amp; operator has a similar behavior: It evaluates the left-hand operand and, if it's falsy, returns it; otherwise it evaluates and returns the right-hand operator. This is useful if you want an object property from a variable which may be null: var value = obj &amp;&amp; obj.property; value will be the value of obj if obj is falsy (for instance, null), or the value of obj.property if obj is truthy.
type: Answer
accepted answer of: http://stackoverflow.com/q/28983907
upvote count: 7
answers question: http://stackoverflow.com/q/28983907
score: 7

http://stackoverflow.com/comment/46237076
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28993735
has text: Also you should define var sortedIds = [] outside the for loop and then push to it inside the loop as you are doing

http://stackoverflow.com/comment/46241436
has text: Can you call it successfully via fiddler or directly in the browser instead of via Kendo?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28995757
score: 0

http://stackoverflow.com/comment/46311913
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29016489
type: Comment
has text: Folks, cease fire. Stackoverflow is a great resource. The jQuery submitted by Steve? works fine but I find the following code here too and that solved the whole problem.

http://stackoverflow.com/a/29018935
type: Answer
accepted answer of: http://stackoverflow.com/q/29016427
answers question: http://stackoverflow.com/q/29016427
score: 0
has body: Creating a Blob URL for your video is the correct route to take but you also have to be sure that your version of iOS is higher than 8.1.2 . I upgraded to 8.2 and my code seemed to work fine afterwards.
type: AcceptedAnswer

http://stackoverflow.com/q/29000096
tagged with: jquery
has body: I've seen this around lately, mostly in Wordpress, where portfolio listings are filtered but they have this neat animation during the filtering, this is one of the nicer ones I've seen. So my question, how do you create this? I am not really looking for all details but more of the logic behind animating the filtering process. I can't really think of a way to pull that animation off. Each portfolio item has inline positioning so somehow JS is figuring out where each item goes and animating moving it there. I am guessing the solution would include jQuery, AJAX, CSS3...
tagged with: ajax
has comment: http://stackoverflow.com/comment/46271909
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/46248313
has comment: http://stackoverflow.com/comment/46341236
has comment: http://stackoverflow.com/comment/46248078
answer count: 0
tagged with: wordpress
has comment: http://stackoverflow.com/comment/46248172
type: Question
tagged with: javascript
has title: Animating & Filtering a list with images? Wordpress Portolio, Jquery, Ajax
has comment: http://stackoverflow.com/comment/46248125
score: 0

http://stackoverflow.com/comment/46216929
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28983868
has text: Please don't quote w3schools links; most of them are misleading. Read http://w3fools.com

http://stackoverflow.com/a/28977833
has comment: http://stackoverflow.com/comment/46206943
downvote count: 0
has comment: http://stackoverflow.com/comment/46206965
has comment: http://stackoverflow.com/comment/46207056
type: Answer
has comment: http://stackoverflow.com/comment/46206985
answers question: http://stackoverflow.com/q/28977484
score: 2
has body: The issue is that your code expects that your is wrapped inside another element with an id="tutube". getElementsByTagName() won't pick the element on which it has been called even if it matches. So you could either refactor your HTML so that it matches the expectations of your JS: Either rewrite your JS so that it works with your HTML: function stopTheVideo(){ var iframe = document.getElementById("tutube").contentWindow; div.style.display = state == 'hide' ? 'none' : ''; func = state == 'hide' ? 'pauseVideo' : 'playVideo'; iframe.postMessage('{"event":"command","func":"' + func + '","args":""}', '*'); };
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28977484
has comment: http://stackoverflow.com/comment/46206832
type: AcceptedAnswer

http://stackoverflow.com/comment/46128790
type: Comment
has text: There's a bug in your code, Internet Explorer reveals it: `TypeError: Object.keys: argument is not an Object`.
comment on: http://stackoverflow.com/a/28930201
score: 0
type: AnswerComment

http://stackoverflow.com/a/29059684
type: Answer
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29059630
answers question: http://stackoverflow.com/q/29059630
has body: You can use the flag like return { buildUI: function () { var flag = false; el.nav.on({ mouseenter: function () { if (flag) { return; } el.logo.addClass('spin'); }, mouseleave: function () { if (flag) { return; } flag = true; el.logo.removeClass('spin'); setTimeout(function () { flag = false; }, 5000) } }); } }

http://stackoverflow.com/comment/46081365
score: 0
type: Comment
type: QuestionComment
has text: right, that would make sense, but that's not what you are doing.
comment on: http://stackoverflow.com/q/28911259

http://stackoverflow.com/comment/46314541
comment on: http://stackoverflow.com/q/29035852
score: 0
type: Comment
type: QuestionComment
has text: Maybe you can try google.maps.MouseEvent object specification https://developers.google.com/maps/documentation/javascript/reference#MouseEvent

http://stackoverflow.com/comment/46407965
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29046075
has text: Yes, that's correct. i need to add two values from two column. How do I return excost1 from GetExcelData1() in here? function Total(){ var exdata = document.getElementById("TotalCost"); exdata = GetExcelData1(), + GetExcelData2() ;
score: 0

http://stackoverflow.com/comment/59793698
has text: Using `eval` is considered unsafe if your site uses [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives).
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29046739

http://stackoverflow.com/comment/46196237
type: Comment
comment on: http://stackoverflow.com/a/28964890
score: 0
type: AnswerComment
has text: Ah, are you using a jQuery autocomplete library, or are you using the browser input suggestions? It seems to be working fine for me if I use a `datalist` with the input.

http://stackoverflow.com/comment/46194809
score: 0
comment on: http://stackoverflow.com/q/28971642
type: Comment
has text: i want do, a sub array for each invoice, and subarray for item in invoice , like `$invoice[0].items[0].ID`, `$invoice[0].items[1].ID` ..etc
type: QuestionComment

http://stackoverflow.com/comment/46214603
type: Comment
comment on: http://stackoverflow.com/a/28982455
has text: @SumitDeshpande NOTE: my answer only for string with max length = 3
score: 0
type: AnswerComment

http://stackoverflow.com/a/28971262
has body: I would do this: From the select that fires the onchange event we can travel up in the DOM to its parent using jQuery's parent(). Then select all the select elements in that parent. Iterate over each select. First reset the option back to enabled, lastly disable the option that matches the selected value of the select that fired the event. $('.chosen-select').on('change', function() { var self = this; //create a reference to the owner of the event. var selVal = $(this).val(); //selected value var parent = $(this).parent(); //select parent row //traverse all children in that row that are selects parent.children('select').each(function() { $(this).find("option").attr("disabled", false); //set all disabled attributes to false. Basically a reset! if (this != self) //skip the select that is the owner of the event { //set the other options to disabled that matches the value of the select. $(this).find("option[value='"+selVal+"']").attr("disabled", true); } }); });
score: 0
answers question: http://stackoverflow.com/q/28971045
type: Answer
has comment: http://stackoverflow.com/comment/46220655

http://stackoverflow.com/comment/125986385
type: Comment
comment on: http://stackoverflow.com/a/28978543
has text: Love you soo much, you just saved my time a lot. thank you so much
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46088792
type: QuestionComment
has text: @shridhar I want to menu icon become like this http://www.adoratorio.com/
type: Comment
comment on: http://stackoverflow.com/q/28915081
score: 0

http://stackoverflow.com/q/28940579
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/28940629
has answer: http://stackoverflow.com/a/28940678
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28940629
type: Question
possible better answer: http://stackoverflow.com/a/28940670
has answer: http://stackoverflow.com/a/28940670
has body: I am trying to make a Javascript countdown for my website, so as a start I wanted to test the best solution. I now have a code, but when I open the website nothing is on there, I think I might have done something wrong when trying to implement Javascript into html? My code: Home Test Countdown
has comment: http://stackoverflow.com/comment/46135850
has comment: http://stackoverflow.com/comment/46135845
tagged with: javascript
tagged with: countdown
has title: Javascript countdown won't work
score: 0

http://stackoverflow.com/a/29026912
answers question: http://stackoverflow.com/q/29026388
has body: It might help you. HTML code-sample AngularJs code-sample
score: 0
type: Answer

http://stackoverflow.com/comment/46198662
type: Comment
has text: The C# code is the actual HTML only. It has a datalist inside
type: AnswerComment
comment on: http://stackoverflow.com/a/28973169
score: 0

http://stackoverflow.com/a/28961700
answers question: http://stackoverflow.com/q/28961582
score: 0
type: Answer
has body: How can I call another Java Script function if I confirm Yes on below window.onbeforeunload event. If by "yes" you mean "Yes, leave" then you might be able to use the unload event on window. Note that you can't do much of anything at that point. If by "yes" you mean "Yes, stay on the page" then you can do that just by setting a timed callback with setTimeout. Here's a complete example which records to local storage whether you left or stayed (tested on Firefox, Chrome, and IE11): Closing

http://stackoverflow.com/comment/46302996
type: QuestionComment
type: Comment
has text: Also see http://stackoverflow.com/questions/5529934/javascript-numbers-to-words
score: 0
comment on: http://stackoverflow.com/q/29030900

http://stackoverflow.com/comment/46129267
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28937069
has text: Right-click, view source. Post server receiving method too
score: 1

http://stackoverflow.com/comment/46352230
type: QuestionComment
score: 0
has text: This line isn't valid javascript. `var allregos = {!customAcctRegLstTXT};` The reason why is because `{}` is an object literal, usually containing a list of properties and values, `!` is a boolean not, and `customAcctRegLstTXT` is undefined here. While it might be text, that line won't decode the JSON into an object. Perhaps you are looking for `var allregos = JSON.parse(customAcctRegLstTXT); ` However, in the rest of the question you act like this works, so I am confused by the question.
type: Comment
comment on: http://stackoverflow.com/q/29057658

http://stackoverflow.com/q/29037538
linked to: http://stackoverflow.com/q/7165395
type: UnansweredQuestion
has title: Accessing a php script using a button on the same page?
tagged with: php
has answer: http://stackoverflow.com/a/29037649
duplicate of: http://stackoverflow.com/q/7165395
tagged with: forms
has answer: http://stackoverflow.com/a/29037816
type: Question
tagged with: javascript
tagged with: jquery
has body: I was wondering how would I make it so that when a button is clicked in my form, it runs a php function that is on the same file? I tried doing something like this: &lt;form&gt; &lt;input type=button name="button" value="Submit" onClick="hello()"&gt; &lt;/form&gt; &lt;?php function hello(){ echo "Hello" } ?&gt; But when the button is clicked, nothing happens, neither of my functions are called. How would I go about doing this?
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/107696330
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28959187
has text: @byMike Can you point me in that direction in how you visualised it ? I can also look into it

http://stackoverflow.com/comment/46196399
type: AnswerComment
comment on: http://stackoverflow.com/a/28962835
score: 0
has text: thanks for ur reply , but see how in the twitter bootstrap code https://github.com/twbs/bootstrap/blob/master/js/modal.js#L48 (Line 48) , only `this.hide()` is used , not `this.container.hide();` .
type: Comment

http://stackoverflow.com/comment/46086187
comment on: http://stackoverflow.com/q/28914033
type: Comment
has text: Submit the form using `method="POST"` instead of using script if the result page is html
type: QuestionComment
score: 0

http://stackoverflow.com/comment/46267194
has text: Even if you preload them by having invisible ` ` elements, you are still going to end up with flickering sometimes. I would probably just have two elements and then make one or the other visible depending on the hover state.
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29011001

http://stackoverflow.com/a/28915678
has comment: http://stackoverflow.com/comment/50254393
score: 54
type: Answer
has comment: http://stackoverflow.com/comment/50328694
has comment: http://stackoverflow.com/comment/46169738
has comment: http://stackoverflow.com/comment/50330064
downvote count: 1
has comment: http://stackoverflow.com/comment/50254356
accepted answer of: http://stackoverflow.com/q/28915677
type: AcceptedAnswer
upvote count: 55
has comment: http://stackoverflow.com/comment/50329234
answers question: http://stackoverflow.com/q/28915677
has body: The issue with your code The problem with the above approach is that if you forget releasing the connection after every single time you perform getDb you have a resource leak that might freeze your app eventually when it runs out of the resource you're leaking. You might, in one place do: var users = getDb().then(function(conn){ return conn.query("SELECT name FROM users"); }); Which will leak a database connection that was never closed. The disposer pattern The disposer pattern is a way to couple a scope of code with owning the resource. By binding the resource to a scope we make sure it is always released when we're done with it and we can't easily forget to release it. It is similar to using in C#, with in Python and try-with-resource in Java as well as RAII in C++. It looks like: withResource(function(resource){ return fnThatDoesWorkWithResource(resource); // returns a promise }).then(function(result){ // resource disposed here }); Applying it here If we wrote our code as: function withDb(work){ var _db; return myDbDriver.getConnection().then(function(db){ _db = db; // keep reference return work(db); // perform work on db }).finally(function(){ if (_db) _db.release(); }); } We could write our above code as: withDb(function(conn){ return conn.query("SELECT name FROM users"); }).then(function(users){ // connection released here }); Examples of users of the disposer pattern are sequelize and knex (bookshelf's query builder). It's also possible to use it for simpler things like hiding a loader when all AJAX requests completed for instance.
has comment: http://stackoverflow.com/comment/50254540
has comment: http://stackoverflow.com/comment/50313312

http://stackoverflow.com/q/28939851
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has body: I have PulsePro as CMS used. The template is on PHP, but the include parts are in HTML. The php mailer contains an Ajax Script, which I have implemented in the layout.php file. I have some different forms with different receiver email addys. Now, I want to define a variable for following string. This variable it will taken from the different include parts, e.g. Here the link in the include files. &lt;?php $variable ="ajax1.php"; ?&gt; This is the ajax code in the layout.php file: ajaxSubmit = function(){ var frmData = $("#ifgForm").serialize(); $.ajax({ **url: "/includes/ajax.php", This is the original part, but here should be the variable data: frmData, type: "POST", dataType: "json", success: function(response){ $("#f1_upload_process").hide(); $(".event-submit-btn").show(); Thanks for your support.
has title: PHP variable pass through Ajax
type: UnansweredQuestion
tagged with: php
type: Question
has answer: http://stackoverflow.com/a/28939986
has comment: http://stackoverflow.com/comment/46134767
has comment: http://stackoverflow.com/comment/46134748

http://stackoverflow.com/comment/46232801
type: AnswerComment
type: Comment
has text: @user3784238 Sorry but it's impossible to tell what they are doing in there code server-side, the original question was what was the javascript function doing and all that does is simulate pressing the button when you hit enter. You could be on a very long time guessing what they do on the server.
comment on: http://stackoverflow.com/a/28972963
score: 0

http://stackoverflow.com/comment/46281650
type: Comment
comment on: http://stackoverflow.com/q/29016485
score: 0
has text: do you actually need to fill out the form? can't you just submit the data via XHR?
type: QuestionComment

http://stackoverflow.com/q/28977130
has body: I'm trying to write a simple conditional statement that checks an element's ID to identify it when dropped onto another element and something is tripping me up... Here's a JSFiddle: http://jsfiddle.net/4kvev05a/ HTML: Drop region 1 Drop region 2 Drag 1 Drag 2 jQuery: $( "#drag1" ).draggable(); $( "#drag2" ).draggable(); $( "#drop1" ).droppable({ drop: function() { if ($(this).attr("id") == "drag1") { alert("drag1 was dropped on drop1"); } else { alert("something else was dropped on drop1"); } } }); $( "#drop2" ).droppable({ drop: function() { alert( "dropped on drop2" ); } }); When either #drag1 or #drag2 are dropped on #drop1, it runs the else{}...
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46205289
type: AnsweredQuestion
tagged with: if-statement
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/28977183
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: drag-and-drop
has title: jQuery if statement not catching #ID
accepted answer: http://stackoverflow.com/a/28977183

http://stackoverflow.com/comment/46325974
type: QuestionComment
has text: Use one template with a dynamic `ng-include` (or if it's simple enough which uses two `ng-if`)
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29043003

http://stackoverflow.com/comment/46273059
type: QuestionComment
has text: not sure if I understand correctly, will this work?: you have mapR that is what the user sees, and map75 that is mapR+75%, initially you do a radar search with map75 bounds and load that data, when user drags mapR out of map75 (you can compare both maps bounds) you perform another search
score: 0
comment on: http://stackoverflow.com/q/29012722
type: Comment

http://stackoverflow.com/a/28991617
downvote count: 0
answers question: http://stackoverflow.com/q/28989301
type: Answer
upvote count: 1
has body: First, ensure that mongo recognizes the create_time property as a date. The easiest way to do that, is to insert standard javascript date instances: db.collection.insert([{ create_time: new Date(), ... }], callback); Then, to query, again use date instances: var now = new Date(); var tenMinutesAgo = new Date(now - 10*60*1000); db.collection.find({ $gt: tenMinutesAgo }).toArray(callback); That should do the trick!
has comment: http://stackoverflow.com/comment/46299015
score: 1

http://stackoverflow.com/comment/46078015
type: Comment
type: QuestionComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/72443/discussion-between-da-rod-and-acbabis).
comment on: http://stackoverflow.com/q/28908445
score: 0

http://stackoverflow.com/comment/46338103
has text: Thanks mate! I had not noticed that in the others scripts!!
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29048381

http://stackoverflow.com/comment/46073703
score: 0
type: QuestionComment
has text: When you reload the page it won't maintain your selection unless you set up some sort of cookie.
type: Comment
comment on: http://stackoverflow.com/q/28907087

http://stackoverflow.com/comment/46364843
type: AnswerComment
has text: I'm not sure if this applies to Map and Set, however as ES6 builtins they may be subclassable github.com/lukehoban/es6features#subclassable-built-ins - there was a post a while ago on subclassing these. There are a whole shed load of other problems though if you are going to identify objects by value.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29053267

http://stackoverflow.com/q/28979691
favorite count: 0
tagged with: cordova
possible better answer: http://stackoverflow.com/a/28980820
has answer: http://stackoverflow.com/a/28980820
type: AnsweredQuestion
score: 1
upvote count: 1
has title: HTML5 database saved details along with a button
has answer: http://stackoverflow.com/a/29210964
type: Question
has body: I am developing an app in Phone gap.. where I am saving all the details of employees including there date of birth and address. In one page I have a save button and recall button. When user press the entered details should be saved... and this is working fine. when user press the recall button this saved details should be display.. when showing this only their names will display and a button will be there in each row. By pressing this button next to the name ..he should able to select the particular row only.. my problem I am not able to display button on each row... button is displaying only after all row.. that means only one button.. but I need one button after each row for selecting that particular row.. I am giving my code below.. I f anyone know how to code it pls help.. HTML Hello World Name javascript
tagged with: database
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29210964
answer count: 2
downvote count: 0
tagged with: button

http://stackoverflow.com/q/28936071
favorite count: 0
tagged with: extjs
type: UnansweredQuestion
tagged with: sencha-architect
tagged with: extjs5
score: 2
answer count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/46128924
type: Question
tagged with: javascript
has title: Has-One Association in Model not working in Ext-js 5
has body: I have upgraded my application from Ext-js 4.2 to Ext-js 5.1.0 In the older version [Ext-js 4.2.1] we used to define Has-One Association in model as shown below. Ext.define('application.model.buildingModel', { extend: 'Ext.data.Model', requires: [ 'Ext.data.field.String' ], idProperty: 'uid', fields: [ { type: 'string', name: 'internalName' }, { type: 'string', name: 'externalName' }, { type: 'string', name: 'uid' }, { type: 'string', name: 'status' }, { name: 'address' } ], hasOne: { model: 'application.model.addressModel', associationKey: 'address', foreignKey: 'address' getterName: 'getAddress', setterName: 'setAddress' } }); Since upgrading the application i am facing some issue with this. I don't see address field present in record when seen by debugging. When i fetch the record the address field is not present. I think there are some changes needed in Ext-js 5 and I am new to Ext-js 5. Can anyone help me in finding solution for this problem. Thanks &amp; Regards Sumanth K.P
downvote count: 0

http://stackoverflow.com/comment/46074446
comment on: http://stackoverflow.com/q/28907189
has text: Can you post the tag examples?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28928577
answers question: http://stackoverflow.com/q/28928513
upvote count: 1
has body: Have an OK button, perhaps: &lt;input type="button" id="the-button" value="OK"&gt; In a script tag somewhere after that HTML (at the end of the document is good), have a timer variable which is initially 0: var timer = 0; ...and add an event handler for the button: document.getElementById("the-button").addEventListener("click", function() { // ...we'll add more here in a moment... }, false); When the user clicks the button, if timer is 0, record the starting time; if not, report the difference and reset it to 0: document.getElementById("the-button").addEventListener("click", function() { var elapsed; if (timer === 0) { timer = Date.now(); } else { elapsed = Date.now() - timer; // In milliseconds alert("Elapsed time: " + elapsed); // Or whatever you want to do with it timer = 0; } }, false); Live Example: (function() { "use strict"; var timer = 0; document.getElementById("the-button").addEventListener("click", function() { var elapsed; if (timer === 0) { timer = Date.now(); } else { elapsed = Date.now() - timer; // In milliseconds alert("Elapsed time: " + elapsed); timer = 0; } }, false); })(); &lt;input type="button" id="the-button" value="OK"&gt; Note: That uses addEventListener, which is supported by all modern browsers (including IE9). To support old IE (such as IE8), you'll have to handle the fact that it uses attachEvent instead of addEventListener. Similarly, Date.now is not in IE8, but can be polyfilled for old browsers: if (!Date.now) { Date.now = function() { return +new Date(); }; }
score: 1
has comment: http://stackoverflow.com/comment/46112946
has comment: http://stackoverflow.com/comment/46113066
downvote count: 0
type: Answer

http://stackoverflow.com/q/28952060
has title: How to replace escape text with other symbols/escape text?
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46157992
has answer: http://stackoverflow.com/a/28952171
has body: So I need replace the escape texts; &amp;gt and &amp;lt in the string to [] and &lt;> for example if I have /&amp;/lt;a href=/&amp;/quot;google.com/&amp;/quot;/&amp;/gt; google /&amp;/lt;/a/&amp;/gt; I want to convert that into [&lt; google.com> google] and it will work as a link. this is my function for escapeText for converting content, which is the text user has entered: var escapeText = function(html) { var result = String(html) .replace(/&amp;/g, '&amp;amp;') .replace(/&lt;/g, '&amp;lt;') .replace(/&gt;/g, '&amp;gt;') .replace(/"/g, '&amp;quot;'); if (result === '' + html) return html; else return result; } content = escapeText(content); if anyone can help, it would be much appreciated!
type: UnansweredQuestion
score: 0
type: Question

http://stackoverflow.com/comment/46183743
score: 1
has text: Works a charm and was definitely much better than using 999. Thanks.
type: AnswerComment
comment on: http://stackoverflow.com/a/28964810
type: Comment

http://stackoverflow.com/q/28961429
type: UnansweredQuestion
tagged with: php
score: 1
has comment: http://stackoverflow.com/comment/46174937
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28964871
has body: A have two forms on one page created by this tutorial on github. One is part of website page, another is in modal window How to make it work independently, now id I press on submit button in on window it works in both HTML &lt;div class="container"&gt; &lt;!-- Contacts --&gt; &lt;div class="contacts" id="contacts"&gt; &lt;div class="container"&gt; &lt;div class="row"&gt; &lt;div class="col-xs-6"&gt; &lt;h1&gt;order a call&lt;/h1&gt; &lt;form id="contactForm"&gt; &lt;div class="form-group"&gt; &lt;input type="text" class="form-control" id="name" placeholder="name" required data-validation-required-message="name" /&gt; &lt;p class="help-block"&gt;&lt;/p&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;input type="email" class="form-control" id="email" placeholder="email" required data-validation-required-message=" email" /&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;input type="tel" class="form-control" id="tel" placeholder="tel" required data-validation-required-message="tel" /&gt; &lt;/div&gt; &lt;div id="success"&gt; &lt;/div&gt; &lt;!-- For success/fail messages --&gt; &lt;button type="submit" class="btn btn-yellow btn-block"&gt;button1&lt;/button&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;br /&gt; &lt;div class="container"&gt; &lt;button class="btn btn-yellow btn-block" type="button" data-toggle="modal" data-target="#myModal" &gt;button2 (modal)&lt;/button&gt; &lt;/div&gt; &lt;!-- Modal --&gt; &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt; &lt;h2 class="modal-title text-center" id="myModalLabel"&gt;order&lt;/h2&gt; &lt;p class="text-center"&gt;please leave your contact details&lt;/p&gt; …
favorite count: 0
has title: Two bootstrap php-js forms on one page
has comment: http://stackoverflow.com/comment/46181056
has comment: http://stackoverflow.com/comment/46179817
downvote count: 0
tagged with: twitter-bootstrap

http://stackoverflow.com/q/28991040
answer count: 2
has answer: http://stackoverflow.com/a/28997239
accepted answer: http://stackoverflow.com/a/28997239
tagged with: datatables
tagged with: jquery
favorite count: 0
has body: I found a problem when putting a Jquery Datatable (with its own responsive plugin) in a bootstrap 3 collapsed panel. Here is the example that works: http://jsfiddle.net/Wc4xt/1804/ Here is the example that does NOT work: http://jsfiddle.net/Wc4xt/1803/ The problem I found is that, if the panel that wraps the table is collapsed at the beginning, i.e. setting the wrapper div like this: &lt;div id="collapseOne" class="panel-collapse collapse"&gt;, the table's columns will not collapse when I resize the browser. if the panel that wraps the table is collapsed at the beginning, i.e. if I either remove "collapse" away from the class, i.e. &lt;div id="collapseOne" class="panel-collapse"&gt;, or add "in" into its class, i.e. &lt;div id="collapseOne" class="panel-collapse collapse in"&gt;, then the table works fine. The columns are able to collapse when window resizes. However, I want the collapsed panel stay closed by default. So I have to add "collapse" to the class without class "in". I also check the bootstrap source code, .collapse { display: none; } .collapse.in { display: block; } I have spent days in this and still cannot see why the class "collapse" will cause this problem. Thank you all in advance.
has answer: http://stackoverflow.com/a/32987015
has title: Jquery Datatable responsive plugin inside bootstrap 3 collapsed panel
type: AnsweredQuestion
score: 2
tagged with: twitter-bootstrap-3
downvote count: 0
tagged with: twitter-bootstrap
possible better answer: http://stackoverflow.com/a/32987015
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/30743177
upvote count: 2

http://stackoverflow.com/comment/46179528
type: Comment
type: QuestionComment
has text: My apologies @JFK. I had clicked on a random notification and so that might have randomized the order of the responses. I do not have the "reputation" to upvote several comments yet. My apologies.
comment on: http://stackoverflow.com/q/28931707
score: 0

http://stackoverflow.com/a/28921608
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28921180
downvote count: 0
has body: Just to add to the solutions options, you can use Lodash, or a custom array find function to iterate on the set and find the object you want. Using Array.prototype.findIndex or It's polyfill function Point(x, y) { this.x = x; this.y = y; } Point.prototype = { equal: function(point) { if (point.x == this.x &amp;&amp; point.y == this.y) { return true; } return false; } } point1 = new Point(6,1); console.log([ new Point(4,0), new Point(6,1), new Point(8,12)].findIndex( function(element, index, array){ return element.equal(point1); })); &gt;&gt; 1 Using Lodash findIndex var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user': 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1, 'active': true } ]; // using the `_.matches` callback shorthand _.findIndex(users, { 'user': 'fred', 'active': false }); // → 1
score: 1

http://stackoverflow.com/comment/46152722
has text: Are you using WebForms or MVC ?
score: 0
comment on: http://stackoverflow.com/q/28947148
type: Comment
type: QuestionComment

http://stackoverflow.com/a/42011064
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: You need to create a div element on your body that has an id, let's say "slider". Then use var slider = document.getElementById('slider')and the function instead of what you have should be noUiSlider.create(slider, { where the "slider" inside the brackets will be name of the variable you have initialised as the element on your HTML code. Hope it helps
answers question: http://stackoverflow.com/q/28999350

http://stackoverflow.com/a/29018806
has body: You can't set ng-change that way. It has to be compiled by angular. Just set a ng-change on your input in your calendar template and have it call a function in your controller. That function will then call the ngChange expression (using "&amp;", not $attrs) from your calendar directive's attribute. http://plnkr.co/edit/RNQYcyq46bex0GPqDPRp In your directive, remove the line that changes the input's ng-change attribute and add the '&amp;' attribute to the isolate scope definition. scope: { ngChange: '&amp;' }, In your calendar controller, add the ngChange call to the function you linked to your input's ng-change attribute: function saveDateToBoundProperty() { $scope.ngChange(); [...] }; You should read about markup compilation ($compile and whatnot) and about directive isolate scopes (and @, =, and &amp;). Also, I would recommend not using ngChange as an attribute for a custom directive, since ngChange is itself a directive. It could lead to some unexpected behavior. you could use dateChange instead for instance.
downvote count: 0
has comment: http://stackoverflow.com/comment/46281800
score: 1
accepted answer of: http://stackoverflow.com/q/29018725
answers question: http://stackoverflow.com/q/29018725
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46281785
type: Answer

http://stackoverflow.com/a/43294507
has body: The accepted answer will fail when you have multi dimentional Maps. One should always keep in mind that, a Map object can take another Map object as a key or value. So a better and safer way of handling this job could be as follows; function arrayifyMap(m){ return m.constructor === Map ? [...m].map(([v,k]) =&gt; [arrayifyMap(v),arrayifyMap(k)]) : m; } Once you have this tool then you can always do like; localStorage.myMap = JSON.stringify(arrayifyMap(myMap))
score: 3
upvote count: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28918232
type: Answer

http://stackoverflow.com/a/29058009
score: 0
has body: I guess you are over engineering it, first you need to correct your HTML something like below. Working jsFiddle Home Services info Contact Add css header ul{ margin:0; padding:0; } header ul li{ list-style:none; display:block; } header ul li a{ display:block; color:black; text-decoration :none } header ul li a.active{ color:red; text-decoration :underline } You can use javascript like function addClass(obj) { var a = document.getElementsByTagName('a'); // loop through all 'a' elements for (i = 0; i < a.length; i++) { // Remove the class 'active' if it exists a[i].classList.remove('active') } // add 'active' classs to the element that was clicked obj.classList.add('active'); }
answers question: http://stackoverflow.com/q/29057810
type: Answer

http://stackoverflow.com/a/28940144
type: AcceptedAnswer
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46195852
has body: You should not be using the change in the URL to trigger any action. That's not the way to do it with fullPage.js. You should be using the callbacks provided by the plugin such as onLeave or afterLoad. Or you could even use the class added to the body element as suggested in this tutorial The reason for it is because fullPage.js doesn't change the location hash but uses the HTML5 History API for mobile phones due to problems with the location hash behaviour in Mobile Chrome: //Mobile Chrome doesn't work the normal way, so... lets use HTML5 for phones :) if (isTouchDevice || isTouch) { history.replaceState(undefined, undefined, '#' + url); } else { var baseUrl = window.location.href.split('#')[0]; window.location.replace(baseUrl + '#' + url); }
accepted answer of: http://stackoverflow.com/q/28931375
answers question: http://stackoverflow.com/q/28931375

http://stackoverflow.com/comment/46293710
type: Comment
has text: ok then for dynamic preview of form data refer this link : http://adrian-alexan.blogspot.in/2009/12/customizing-entities-print-preview-form.html
comment on: http://stackoverflow.com/a/29025480
score: 0
type: AnswerComment

http://stackoverflow.com/q/29045728
tagged with: node.js
has title: Confused about Node, NPM, Bower, and using it for Bootstrap
tagged with: npm
tagged with: twitter-bootstrap
downvote count: 1
tagged with: bower
type: Question
type: AnsweredQuestion
has body: I'm trying to learn the latest technologies for web development. I already know HTML, JS, CSS, and server side programming. But I don't understand where Nodejs, npm, and Bower come in. I want to create a new project. So I created a folder for it. Then I wanted to use bootstrap. So I ran bower install bootstrap. Now I have bootstrap installed in a folder called bower_components. Does this mean, if I want to import Bootstrap, I have to add it like this?: &lt;link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"&gt; Or am I missing something. I honestly don't know where to start with these package managers.
has answer: http://stackoverflow.com/a/29049156
has comment: http://stackoverflow.com/comment/46354215
upvote count: 10
score: 9
answer count: 1
has comment: http://stackoverflow.com/comment/46354227
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29049156

http://stackoverflow.com/q/29059799
score: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46361171
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46359007
tagged with: sqlite
has body: I'm trying to output code from an SQLite3 database with Javascript and Node.js, it selects the correct data and outputs each row to the console but doesn't add it to a JSON file using the code below: var obj; db.serialize(function(){ req = sqlRequest; console.log(req); //sql request to console db.each(req, function(err, row){ console.log(row); //outputs every entry correctly obj += row; }); db.close(); }); console.log(JSON.stringify(obj)); fs.writeFile(sqlRequest, JSON.stringify(obj), function(err){ if(err){ return console.log(err); } else { console.log("Json saved to: " + sqlRequest); } console.log("The file is saved"); }); All it's outputting to the JSON file with this code is 'undefined'. Any suggestions?
type: Question
tagged with: node.js
has title: fs.writeFile(sqlRequest, JSON.stringify(obj)) not outputting SQLite data to JSON file

http://stackoverflow.com/comment/46275896
comment on: http://stackoverflow.com/a/29015577
score: 0
has text: Nice one, but if i change (for example with firebug) class=validated, then i could "hack" this. It means i need to validate form 2 times in php. No other way ?
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46190518
type: AnswerComment
has text: There is no foreach in JS
type: Comment
comment on: http://stackoverflow.com/a/28969459
score: 0

http://stackoverflow.com/q/29055518
favorite count: 0
has answer: http://stackoverflow.com/a/44071809
answer count: 5
has answer: http://stackoverflow.com/a/37037034
tagged with: templates
has comment: http://stackoverflow.com/comment/72502079
has body: Does HTML code generation run measurably faster in modern browsers when using string concatenation or template literals in ES6? For example: String concatenation " "+ " "+ " "+ date +" "+ " "+ " " Template literal ` ${ date } `
possible better answer: http://stackoverflow.com/a/37037034
accepted answer: http://stackoverflow.com/a/29083467
downvote count: 3
has comment: http://stackoverflow.com/comment/46348598
type: AnsweredQuestion
score: 106
has comment: http://stackoverflow.com/comment/110423598
has answer: http://stackoverflow.com/a/56435207
has title: Are ES6 template literals faster than string concatenation?
tagged with: performance
has answer: http://stackoverflow.com/a/46517442
has comment: http://stackoverflow.com/comment/76646624
type: Question
tagged with: ecmascript-6
upvote count: 109
tagged with: javascript
tagged with: string
has answer: http://stackoverflow.com/a/29083467

http://stackoverflow.com/comment/46294861
type: Comment
type: QuestionComment
has text: OK I want let the user to move to login page if he is not signed-in else he/she should move to another page. So if the above condition is satisfied then he should log-in first else he mudt move to another location
comment on: http://stackoverflow.com/q/29026348
score: 0

http://stackoverflow.com/a/29051382
type: Answer
has body: The likely problem is that you're defining your own primary key field, but Waterline is still atuomatically adding its own id field. You can turn off this behavior by adding autoPK: false to your model configuration. Docs for autoPK are here.
score: 0
answers question: http://stackoverflow.com/q/29048743

http://stackoverflow.com/comment/46271038
type: QuestionComment
comment on: http://stackoverflow.com/q/29012913
has text: where is your `init` function?
score: 0
type: Comment

http://stackoverflow.com/comment/46154575
comment on: http://stackoverflow.com/a/28943762
type: Comment
score: 0
type: AnswerComment
has text: I think using `div` is a vector for XSS, eg if someone tried ` `. Assume that since a document fragment is context free, it wouldn't try to load the image (and hence fire the JS) as soon as you add the html to it?

http://stackoverflow.com/q/29001552
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29001616
has title: Getting updated data from angular provider to controller
answer count: 1
tagged with: javascript
score: 0
has body: I created a provider. It gets data from the config of an app, and updates an array links. Now I want to access the links array form the controller. But when controller calls the provider's $get function, it calls only the first time. When data in provider updates, the data is not updated in the controller. Here is the provider this.$get = function () { return self.links; }; this.addLink = function (link) { self.links.push(link); } The addLink function is called in config of the app. And Here is how I am accessing the provider data in the controller : var links = myProvider; How to get updated data from the provider ?
tagged with: angularjs

http://stackoverflow.com/comment/46269623
has text: why `ifram1.document.contentDocument.designMode="on";` and not just `ifram1.designMode="on";`? Also what is the purpose of designMode? What is your goal with enabling designMode?
type: QuestionComment
comment on: http://stackoverflow.com/q/29011853
score: 0
type: Comment

http://stackoverflow.com/a/42053537
upvote count: 4
downvote count: 0
score: 4
has body: Besides using a templating engine like Twig, I highly suggest to implement the Content Security Policy nonce headers. header('Content-Security-Policy', 'script-src 'nonce-randomNonceString' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none'); They forbid running other scripts than those explicitly whitelisted. A downside is that you need to add a randomly generated nonce argument to each &lt;script&gt; tag in your code. I wrote a detailed tutorial how to implement CSP 3 with nonce in Symfony, so the nonce argument is generated automatically per each request. Feel free to use the solution.
answers question: http://stackoverflow.com/q/28952898
type: Answer

http://stackoverflow.com/comment/46250080
has text: I don't know if 'redirect' might have been the wrong word, I basically just want the page to refresh and come back to the same page after the script is ran.
type: AnswerComment
comment on: http://stackoverflow.com/a/28988758
type: Comment
score: 0

http://stackoverflow.com/q/28998619
upvote count: 3
has comment: http://stackoverflow.com/comment/46249557
has comment: http://stackoverflow.com/comment/46662950
tagged with: mysql
has comment: http://stackoverflow.com/comment/46422911
has comment: http://stackoverflow.com/comment/46245485
type: Question
score: 3
has answer: http://stackoverflow.com/a/29112917
has title: Javascript Countdown Timer - Client Time vs mySQL Time
tagged with: javascript
has comment: http://stackoverflow.com/comment/46245295
has comment: http://stackoverflow.com/comment/46245271
has comment: http://stackoverflow.com/comment/46245336
possible better answer: http://stackoverflow.com/a/29209687
answer count: 2
has answer: http://stackoverflow.com/a/29209687
downvote count: 0
accepted answer: http://stackoverflow.com/a/29112917
favorite count: 0
has comment: http://stackoverflow.com/comment/46649714
has body: The following code is a countdown timer. It pulls an ending datetime stamp from mySQL and uses it to count to. The issue is that the mysql time may be in a different time zone than the client who is looking at the page with the timer. I also pull the current timestamp from mySQL with NOW(), thinking that this would allow the timer to count as the user who created it intended. if I put the NOW() value in this snippet var timeDiff = target - (new Date()); like so var nt='2015-03-11 05:12:15'.split(/[- :]/); var timeDiff = target - (new Date(nt[0],nt[1]-1,nt[2],nt[3],nt[4],nt[5])); the counter shows the correct time left when the page loads but does not count interactively any longer. I think I need to get the difference in hours between the clients local time and the mySQL NOW() and adjust the date in this line to get the interactive timer to run. var timeDiff = target - (new Date()); nothing I try seems to work. This is the working script if the client happens to be int he same time zone.
type: AnsweredQuestion

http://stackoverflow.com/comment/46113380
comment on: http://stackoverflow.com/q/28928747
type: QuestionComment
has text: Because my content type in many cases is excel or pdf and I can't write this.
type: Comment
score: 0

http://stackoverflow.com/q/28976802
tagged with: forms
type: Question
has body: So I'm using bootstrap form helpers to make selecting a country and region easier. Here is some of the code. I want to take this and input it into my db. It currently won't. However, this does Email How can I enter the former into the form without wrecking the formatting (its very pretty :) ) As a template, here is a similar setup/strategy: https://scotch.io/tutorials/easy-node-authentication-setup-and-local
has comment: http://stackoverflow.com/comment/46204727
tagged with: javascript
has comment: http://stackoverflow.com/comment/46204756
has comment: http://stackoverflow.com/comment/46204726
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: input
has title: How do you get an item from a dropdown and input it as text?

http://stackoverflow.com/a/30977325
type: Answer
answers question: http://stackoverflow.com/q/29035883
score: 0
has body: Check following code, hope it helps. I have used matchmedia to check screen resolution. IE 10 and above supports it. You can use matchmedia polyfill https://github.com/paulirish/matchMedia.js/ for IE9 and below. "min-width: 53.75em" is from Refills css after this point it changes to mobile navigation. $('li.nav-link').on('click', function(){ if(!window.matchMedia("(min-width: 53.75em)").matches) { menuToggle.trigger('click'); } }) http://codepen.io/praveenvijayan/pen/YXrbKB

http://stackoverflow.com/a/28937858
type: AcceptedAnswer
type: Answer
has body: You can manually trigger input event, when slide is fired, jsFiddle $( "#height_slider" ).slider({ range: "max", min: 100, max: 225, value: 175, slide: function( event, ui ) { $( "#height_value" ).val( ui.value ).trigger('input'); $(ui.value).val($('#height_value').val()); } });
accepted answer of: http://stackoverflow.com/q/28931595
answers question: http://stackoverflow.com/q/28931595
score: 0

http://stackoverflow.com/a/28975602
accepted answer of: http://stackoverflow.com/q/28975481
type: Answer
has body: There are several ways, I would do it like this: int sum(int[] array) { int sum = 0; for(int i = 0; i &lt; array.size(); i++) { sum += distance(array[i], array[i+1], array[i+2], array[i+3]); i +=4; } return sum; }
answers question: http://stackoverflow.com/q/28975481
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/28991756
has comment: http://stackoverflow.com/comment/46231930
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46231918
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has body: i'm creating a simple website for passionates of motorsport full of results of every race type, divided in categories and single races for every championship, for example &lt;div class="box"&gt; &lt;div class="header"&gt;&lt;p&gt;New Zealand National racing Championship&lt;/p&gt;&lt;/div&gt; &lt;div class="races"&gt; &lt;p&gt;&lt;em&gt;January 1&lt;/em&gt; ???&lt;/p&gt; &lt;div class="race"&gt; &lt;p&gt;&lt;strong&gt;Marlborough Circuit&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;1th - James Palmer (Brabham BT7A Coventry-Climax FPF s4 2750cc) &lt;/p&gt; &lt;p&gt;2th - XXXXXXXXXXXX (XXXXXX)&lt;/p&gt; &lt;p&gt;3th - YYYYYYYYYYYY (YYYYYY)&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; now i want to search some results in a search box with a script which examines all pages in the directory with results, extract all the wanted data and format them in another page, for example with the given example New Zealand National racing Championship (January 1 1965) ??? Marlborough Circuit 1th - James Palmer (Brabham BT7A Coventry-Climax FPF s4 2750cc) 2th - XXXXXXXXXXXX (XXXXXX) 3th - YYYYYYYYYYYY (YYYYYY) how i can do it? can i create a PHP page which uses DOm functions to extract these data or i can use javascript or jquery?
type: Question
has title: How to recover data from an html page using DOM HTML javascript or PHP function?
has answer: http://stackoverflow.com/a/28992156
tagged with: javascript
has comment: http://stackoverflow.com/comment/46232048
score: 0
has comment: http://stackoverflow.com/comment/46232236
answer count: 1
has comment: http://stackoverflow.com/comment/46231888

http://stackoverflow.com/a/28996363
answers question: http://stackoverflow.com/q/28995561
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28995561
type: AcceptedAnswer
type: Answer
upvote count: 1
has body: So you got the data with &lt;? tags, it better for you is to replace output of your code serverside with &amp;lt; and &amp;gt; but if you looking for dirty js solution it is would be: $('.php').each(function() { var $this=$(this); $this.text($this.html().replace(/\&lt;\!--\?([\s\S]*?)--&gt;/g,'&lt;?$1&gt;')); }); http://jsfiddle.net/oceog/x974w2d9/ I not remember if any browser do the replacing of the &lt;? with &lt;!--? but chrome does. The js solution will not work if you have some random examples like: http://jsfiddle.net/oceog/x974w2d9/2/.
score: 1

http://stackoverflow.com/q/29013582
has comment: http://stackoverflow.com/comment/46273014
score: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/46272044
downvote count: 1
has comment: http://stackoverflow.com/comment/46281089
favorite count: 0
has comment: http://stackoverflow.com/comment/46278780
type: UnansweredQuestion
tagged with: php
linked to: http://stackoverflow.com/q/19323010
tagged with: advanced-custom-fields
answer count: 0
has title: update_field not working onclick
type: Question
has comment: http://stackoverflow.com/comment/46279383
has body: I have a custom field called count. I am trying to increase and save its value to a post when a vote button is clicked for the image of the post. However, it doesn't update the value of custom field nor does it update on the page...nothing happens <?php // Query the custom post type to display $args = array('post_type' => 'books'); $query = new WP_Query( $args ); while ( $query->have_posts() ) : $query->the_post(); if ( has_post_thumbnail() ): $oldcount=get_field('count'); $newcount=$oldcount+1; ?> <?php the_post_thumbnail('thumbnail'); ?> Vote <?php echo " ".$oldcount;?> <?php endif; endwhile; ?> voteajax.php <?php if($_POST['action'] == 'call_this') { update_field('field_5501', $_POST['tempcount'],$_POST['pid']; } ?>
tagged with: javascript
has comment: http://stackoverflow.com/comment/46272274

http://stackoverflow.com/q/29058471
score: -3
downvote count: 3
has comment: http://stackoverflow.com/comment/46353508
type: Question
has comment: http://stackoverflow.com/comment/46353512
has comment: http://stackoverflow.com/comment/46451616
has answer: http://stackoverflow.com/a/29058504
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46371621
has body: I'm beginner. I tried this online editor https://www.jsoneditoronline.org replacing Hello World with Hello {World} but she does not like. How to include such characters as { and } in json string ? Update : I don't want to have hello as key I do want BRACES as part of my strING so all the Comments and response are not what I want. I do want something like this except it does not work {"myKey": "Hello {World}"}
has comment: http://stackoverflow.com/comment/46370398
upvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46370331
favorite count: 0
has title: Json does not accept {}?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46377756
has comment: http://stackoverflow.com/comment/46370326

http://stackoverflow.com/comment/46175313
comment on: http://stackoverflow.com/q/28960899
has text: @MelanciaUK the problem is I dont know how to do the javascript code to get the price of the book each time a checkbox is checked. I am totally new to javascript
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46092187
score: 0
type: Comment
has text: there are lots and lots of different accordion and tree scripts found doing simple web searches
type: QuestionComment
comment on: http://stackoverflow.com/q/28917119

http://stackoverflow.com/a/29034416
type: Answer
has comment: http://stackoverflow.com/comment/46310692
answers question: http://stackoverflow.com/q/29034268
score: 0
has body: You can use the .clone() method in jQuery to do this pretty simply. for (var i = 0; i < 9; i++) { $('#target').append($('#copied').clone()); } 1 2 3 4 5 6 7 8 9 10

http://stackoverflow.com/comment/46100638
comment on: http://stackoverflow.com/a/28921247
has text: You don't add or remove. In angular its done declaratively. The ng-class expression gets evaluated and the class (or classes) that it evaluates to gets applied.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46159273
type: QuestionComment
has text: More specifically, it complains because single quotes aren't even the correct quoting character in JSON!
comment on: http://stackoverflow.com/q/28952621
score: 0
type: Comment

http://stackoverflow.com/q/29002220
has answer: http://stackoverflow.com/a/79185275
has answer: http://stackoverflow.com/a/29002262
has answer: http://stackoverflow.com/a/40496698
has comment: http://stackoverflow.com/comment/46292769
tagged with: onclick
has answer: http://stackoverflow.com/a/62007159
type: UnansweredQuestion
has title: Button onclick not calling function
score: 8
has comment: http://stackoverflow.com/comment/46251812
downvote count: 0
tagged with: button
tagged with: javascript
has comment: http://stackoverflow.com/comment/46251925
has answer: http://stackoverflow.com/a/39767484
favorite count: 0
has comment: http://stackoverflow.com/comment/46252050
upvote count: 8
type: Question
answer count: 8
has body: My button code looks like this: Submit And my function code like this: function submitFunction() { alert("example"); } I've been looking online for an answer and tried a bunch of things, but nothing seems to work. I'm just putting the alert there to see if the function is being called at all. I'm using the following to link the files.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29002374
has answer: http://stackoverflow.com/a/29002257
has answer: http://stackoverflow.com/a/60117433

http://stackoverflow.com/q/29045251
type: Question
has comment: http://stackoverflow.com/comment/46329894
has comment: http://stackoverflow.com/comment/46333146
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29047000
has comment: http://stackoverflow.com/comment/46329938
answer count: 1
has body: Could someone point me in the right direction on how I could go about allowing a user to click a link on a PHP While Loop created MySQL table and pass that records info to another page. I've looked through all the similar questions and none answer mine. I am new to this type of programming. Ultimately what my ideal scenario would be is this: Currently I have a list of data created with a While Loop. I would like a user to be able to click a text link that says REPORT ERROR. This in turn would take them to an error reporting form and populate a column of spans using getElementbyid... innerhtml. I know how to populate data with PHP on the same page but going to a new page is a different story. Also as a newbie to Stackoverflow too, am I able to hire someone to do certain things for me?
tagged with: jquery
has comment: http://stackoverflow.com/comment/46329911
has title: How to pass MySQL data from one page to another
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29047000
tagged with: mysql
has comment: http://stackoverflow.com/comment/46330272

http://stackoverflow.com/q/29061752
has title: Variable from Childe to Parent ASP
has comment: http://stackoverflow.com/comment/46360600
score: 0
has comment: http://stackoverflow.com/comment/46360341
answer count: 1
has answer: http://stackoverflow.com/a/29061978
has comment: http://stackoverflow.com/comment/46360381
tagged with: asp.net
has comment: http://stackoverflow.com/comment/46359803
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46360439
has comment: http://stackoverflow.com/comment/46359893
type: Question
has body: I am after a simple example/quick fix of passing a single value from dialog to asp parent page using JavaScript - if java script is best option that is! I have made numerous attempts at doing this but failing with each effort so far. lblVarSelectedDate.Text is the value i would like to post back to parent page to displayed as the lblVarChildSelectedDate value. Below is part of Register.aspx page (PARENT) <asp:Label ID="lblDate" runat="server" Text="Selected Date: "></asp:Label><asp:Label ID="lblVarChildSelectedDate" runat="server" ></asp:Label> <asp:Button ID="btnSelectDate" runat="server" Text="Date" /> </tr <asp:Button ID="btOK" runat="server" Text="Ok" /> This is the VB behind register.aspx... Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Sub btnSelectDate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSelectDate.Click Dim Window As String Window = " window.open('selectdate.aspx', 'MsgWindow', 'width=500, height=500');" ClientScript.RegisterClientScriptBlock(Me.GetType, "date", Window, true) End Sub Sub btnOk_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btOK.Click End Sub And now her is my child page selectdate.aspx.. <asp:Calendar ID="calSelecter" runat="server" OnSelectionChanged="SelectionChange"></asp:Calendar> <asp:Label ID="lblConsSelectedDate" runat="server" Text="Selected Date: "></asp:Label><asp:Label ID="lblVarSelectedDate" runat="server" ></asp:Label> </tr <asp:Button ID="btOK" runat="server" Text="Ok" /> Her is the vb behind the child page. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load calSelecter.SelectedDate = Date.Today lblVarSelectedDate.Text = Date.Today End Sub Sub btnOk_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btOK.Click ' .... on click post back to parent page lblVarSelectedDate.Text End Sub Sub SelectionChange(ByVal sender As Object, ByVal e As EventArgs) lblVarSelectedDate.Text = calSelecter.…
has comment: http://stackoverflow.com/comment/46360636
tagged with: javascript
has comment: http://stackoverflow.com/comment/46360140

http://stackoverflow.com/comment/46279116
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29017394
has text: Ok fixed it, I was calling the code above too soon. Thanks, marking correct.
type: Comment

http://stackoverflow.com/comment/46271124
has text: possible duplicate of [Using debounce function in underscore](http://stackoverflow.com/questions/7026000/using-debounce-function-in-underscore)
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29012922

http://stackoverflow.com/q/28954822
has title: Drop down does not come down by clicking on the
has answer: http://stackoverflow.com/a/28954883
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
upvote count: 2
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/28954872
type: Question
has comment: http://stackoverflow.com/comment/46163614
has comment: http://stackoverflow.com/comment/46163533
tagged with: javascript
has comment: http://stackoverflow.com/comment/46163398
answer count: 2
accepted answer: http://stackoverflow.com/a/28954872
has body: This is how I "rents" with boostrap with sass and this is how when I click on my drop down menu which I add to the menu so it will not "come" down in other words showcase itself. I have done so here at the menu. Opret Action Another action Something else here Nav header Separated link One more separated link at the bottom of the page, I add the new version of jquery and the old version which comes with the package when I collect Bootstrap to my visual studio Express 2013 EDIT EDIT 2 Instruktor Panel <asp:ContentPlaceHolder ID="head" runat="server"> </asp:ContentPlaceHolder> EDIT 3 - Problem I found located here: It was me who had written that it was in js but it is all in javascript
downvote count: 0
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/28954883

http://stackoverflow.com/comment/46297048
type: Comment
has text: Ok. Thanks! I created a new question here https://stackoverflow.com/questions/29027477/how-to-optimize-canvas-circle-for-retina-devices
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28985220

http://stackoverflow.com/comment/49298424
comment on: http://stackoverflow.com/a/29578886
type: AnswerComment
score: 0
has text: i was really looking for a way for a single script to output to multiple files in one shot, without having resort to, say, prefixing indicators to each line and then piping the output to appropriate files…
type: Comment

http://stackoverflow.com/a/28909513
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/46078758
has comment: http://stackoverflow.com/comment/46078312
answers question: http://stackoverflow.com/q/28909284
has body: check this out it will help you. Its easy with JFiddle This particular code changes color on size change so you can simply restructure it for your purpose. Test what you want to achieve right there in the code editor and see your result. function red() { $('div').css('background','#B60C0C') .text('Screen Size RED'); } function orange() { $('div').css('background','#EBAE10') .text('Screen Size ORANGE'); } function green() { $('div').css('background','#83ba2b') .text('Screen Size GREEN'); } var bounds = [ {min:0,max:500,func:red}, {min:501,max:850,func:orange}, {min:851,func:green} ]; var resizeFn = function(){ var lastBoundry; // cache the last boundry used return function(){ var width = window.innerWidth; var boundry, min, max; for(var i=0; i&lt;bounds.length; i++){ boundry = bounds[i]; min = boundry.min || Number.MIN_VALUE; max = boundry.max || Number.MAX_VALUE; if(width &gt; min &amp;&amp; width &lt; max &amp;&amp; lastBoundry !== boundry){ lastBoundry = boundry; return boundry.func.call(boundry); } } } }; $(window).resize(resizeFn()); $(document).ready(function(){ $(window).trigger('resize'); });

http://stackoverflow.com/comment/46322872
score: 0
comment on: http://stackoverflow.com/q/29040083
type: Comment
type: QuestionComment
has text: Well thanks for trying to help, but I would beg to differ. My experience is that someone who knew even the basics about webgl would not have a problem parsing that. Like I said, webgl has an awful lot of standard boilerplate. I included it so that someone could see which standard boilerplate I was using and perhaps point out some odd interaction I was not seeing/didn't think of.

http://stackoverflow.com/q/29040418
linked to: http://stackoverflow.com/q/29037916
tagged with: onclick
downvote count: 3
has comment: http://stackoverflow.com/comment/46321430
has title: else and if statements with commission
has answer: http://stackoverflow.com/a/29040562
upvote count: 0
tagged with: javascript
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/46324873
has comment: http://stackoverflow.com/comment/46324901
has body: Given these three statements: 0.1% of the trade value if the total trade value is less than $10,000 0.08% of the trade value if the total trade value is greater than or equal to $10,000 The minimum commission is $5 How do I go about calculating the commission statement?? The answer should be given in a textbox next to the button "commission %"
has answer: http://stackoverflow.com/a/29040726
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/46321558
answer count: 2
has comment: http://stackoverflow.com/comment/46321234
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29034313
tagged with: local
answer count: 1
has answer: http://stackoverflow.com/a/29034503
has title: How can I use local absolute path as a src attribute for an image
tagged with: path
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to make the source of my image like this &lt;img id="testImage" src="C:\images\1.jpg"&gt; but this doesn't work, i also tried changing all the \ with / but it gave me the same not working result the reason for this is that i want to make a web page that can read from many local folders on my HDD with javascript. how can I do this?
tagged with: absolute
type: Question
accepted answer: http://stackoverflow.com/a/29034503
type: AnsweredQuestion
tagged with: javascript
score: 0

kinect
type: Tag
tags question: http://stackoverflow.com/q/28932058
tag name: kinect

http://stackoverflow.com/a/28999864
answers question: http://stackoverflow.com/q/28999819
score: 0
has body: All you need to do to get a collection of those lis (wrapped as jQuery objects) would be var lis = $('.Puzzle li') You were missing the . - jQuery class name selectors should start with a period (as in CSS). If you need an array holding the numbers in these lis, that should be var arr = $('.Puzzle li').map(function() { $(this).text(); }).get(); See this (console): var lis = $('.Puzzle li'); var arr = lis.map(function() { return $(this).text(); }).get(); console.log(arr); 1 2 3 4 5 6 7 8
type: Answer

http://stackoverflow.com/comment/46355230
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29059424
has text: Why mix mootools and jQuery? This smells of an X/Y problem. Perhaps you tell us what you want to achieve, and we can perhaps help you with achieving the end result instead of fixing something that should not have been done from the start. Also we will not download and unzip something and copy it into a file with mootools to see what your porblem might be, Show us some error messages from the console. Please visit [help] to see how to ask a question
type: Comment

http://stackoverflow.com/q/28989974
has answer: http://stackoverflow.com/a/28990483
tagged with: javascript
tagged with: polyfills
type: AnsweredQuestion
tagged with: modal-dialog
accepted answer: http://stackoverflow.com/a/28990483
has answer: http://stackoverflow.com/a/28994847
type: Question
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28994847
tagged with: performance
tagged with: dialog
has body: I'm using the Google dialog-polyfill for modals on my site. I need to have multiple modals on a page that can be launched independently. Right now, the only method that I can get to work is to repeat all of the javascript, which seems completely inefficient: This is the login modal dialog. Close dialog Open login dialog This is the registration modal dialog. Close dialog Open registration dialog I've played around with this and adding name attributes to no avail: var names = document.getElementsByName("modal"); for (var i = 0; i < names.length; i++) { names[i].onchange = function () { document.getElementById('open-dialog').addEventListener('click', function () { dialog.showModal(); }); document.getElementById('close-dialog').addEventListener('click', function () { dialog.close(); }); } } I don't see how classes would solve this. Is there a way to condense the code so that I won't need to repeat it for each and every modal dialog?
has title: Avoid repeating javascript for each element
has comment: http://stackoverflow.com/comment/46230499

http://stackoverflow.com/comment/46301701
type: Comment
comment on: http://stackoverflow.com/q/29030169
has text: Are you getting any error ? Here is one example - http://stackoverflow.com/questions/16397207/iterate-arraylist-in-jsp
score: 0
type: QuestionComment

http://stackoverflow.com/q/29049586
type: Question
tagged with: processing
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29051898
accepted answer: http://stackoverflow.com/a/29051898
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
upvote count: 1
tagged with: processing.js
type: AnsweredQuestion
has title: How to run Processing+Twitter4j sketch in broswer
tagged with: twitter4j
score: 1
has comment: http://stackoverflow.com/comment/46337613
has body: I'm a newbie programmer practicing Processing and I recently developed a sketch that uses Twitter4j. When I run the sketch in Java mode from the Processing Development Environment it works perfectly. Also, when I export the sketch from Java mode the resulting application runs perfectly. However, when I switch to JavaScript mode and try to run the sketch the browser preview does not display anything. I believe the problem is related to Twitter4j because when I remove the Twitter4j-related code from the sketch and run it (in JavaScript mode) the browser preview then displays the Processing visuals. I've been searching for a solution to this now for several hours spanning several days but I cannot find an adequate answer. I've come across posts addressing related issues but the answers have only involved terms like "signing the JAR file" (related, I think, only to Java mode) or have only shed light on problems running Processing sketches in JavaScript mode on the browser -- excluding sketches that involve the use of Twitter4j. I've included a copy of my entire code below and would really appreciate a step-by-step answer, catering to a newbie. I'm searching for an explanation of what it takes, if possible, to get my JavaScript-mode-exported Processing + Twitter4j sketch running in HTML/my website. Thanks for your time and your skills. I've included some notes on the code at the end of this post. import twitter4j.conf.*; import twitter4j.*; import twitter4j.auth.*; import twitter4j.api.*; import java.util.*; Twitter twitter; String searchString = "#brokendreams"; List&lt;Status&gt; tweets; int currentTweet; PFont f; int amount1 = 300; Star[] meteors = new Star[45]; StarDust[] sprinkle = {}; String chatter; void setup() { size(800,600); f = createFont("Tahoma", 13, true); textFont(f, 13); ConfigurationBuilder cb = new ConfigurationBuilder(); cb.setOAuthConsumerKey("---"); cb.setOAuthConsumerSecret("---"); cb.setOAuthAccessToken("---"); cb.setOAuthAccessTokenSecret("---");…

http://stackoverflow.com/q/28997254
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/46242764
has comment: http://stackoverflow.com/comment/46242832
tagged with: javascript
tagged with: angularjs-scope
score: 0
has comment: http://stackoverflow.com/comment/46242986
answer count: 1
has comment: http://stackoverflow.com/comment/46242678
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46242671
has body: Inside my directive link function I have angular.module('BTWebApplication').directive('singleTrack', ['$timeout', '$rootScope', function ($timeout, $rootScope) { return { scope: { top: "&amp;" }, link: function ($scope, element, attrs) { $(element).click(function() { var a =$(element).offset(); $rootScope.top = parseInt(a.top); $rootScope.gridIndex === $(this).index() ? hidePreview(element) : showPreview(element); function showPreview(index) { $rootScope.gridIndex = $(element).index(); console.log('open'); } function hidePreview() { $rootScope.gridIndex = -1; $rootScope.YoutubeID = -1; } }); }, controller: function($scope) { } } }]); This works but I know I shouldn't be using root scope. What I am trying to accomplish is a variable to save the data so the next time another element is click it will know what the previous value was.
has answer: http://stackoverflow.com/a/28997383
has comment: http://stackoverflow.com/comment/46242716
has title: Best way to save a global variable for directives to watch

http://stackoverflow.com/comment/46280005
type: QuestionComment
type: Comment
has text: what doesn't work? are you getting an error? you need to provide more info if anyone is to help you.
comment on: http://stackoverflow.com/q/29015427
score: 0

http://stackoverflow.com/comment/46313887
score: 0
has text: hey thanks so much. The only problem is I'm not that experienced and don't know where to implement the code. I have all the files of code for my site. If you could help me implement this into my site ProTunesaudio.com I will be in your debt. I have 200 for you if you could help me. I know you said you don't care about the money but it's what I have to offer bc this is my only shot at fixing this. Please let me know. Jasonwday121@gmail.com
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29010938

flux
tag name: flux
tags question: http://stackoverflow.com/q/29048164
tags question: http://stackoverflow.com/q/29008729
tags question: http://stackoverflow.com/q/28954533
type: Tag
tags question: http://stackoverflow.com/q/29060172
tags question: http://stackoverflow.com/q/29048604

http://stackoverflow.com/q/29026406
has title: 5 user inputs for a survey, all hidden and then revealed after that last input is answered
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has body: I have a list of 5 questions with most having a yes or no response. I have them all hidden except for the first one. I am trying to figure out a way that once the question is answered it will then show the next one in order.I was hoping to use a switch statement to check the id of the parent div of the button that was clicked. I'm not sure how to check a parents ID from a jquery point of view, of if that's even the proper way to achieve my goal. HTML 1. ARE YOU OVER THE AGE OF 18? Yes No 2. HAVE YOU HAD SHINGLES? Yes No JS $('.yes-no').click(function(){ $(this).closest('div').find('.yes-no').each(function(){ $(this).removeClass('active'); }); $(this).addClass('active'); $(this).val()=='yes'?$(this).closest('div').find('.sub-question').show():$(this).closest('div').find('.sub-question').hide(); // this is where I was trying to turn the next question visible. console.log(this); if(this == $("#q-1")) { questionArray[1].show(); } });
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29027005
has answer: http://stackoverflow.com/a/29027129
type: Question

http://stackoverflow.com/q/28986701
accepted answer: http://stackoverflow.com/a/29023228
has comment: http://stackoverflow.com/comment/46247037
has comment: http://stackoverflow.com/comment/46222839
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46223096
type: Question
tagged with: javascript
has title: Creating a Parse.File with Javascript SDK
score: 0
has body: I've followed the letter of the law (Javscript SDK) along with numerous variations but thus far I have not been able to save an image to a Parse.File. I'm starting think this is code they never finished before they abandoned the platform? This is my error: Failed to construct 'File': 2 arguments required, but only 0 present. This is my code: var base64 = $base64.encode(unescape(encodeURIComponent('a string'))); var file = new Parse.File("logo.png", { base64: base64}); file.save().then(function(){ var newLogo = new Parse.File(); newLogo.set('step2.png', file); newLogo.save().then(function(){ offer.set("Alogo.png", newLogo); offer.save(); }).then(function(){}, function(error){console.log(error);}); }); It saves no image or note of 'Alogo.png' or anything dealing with a logo in my ParseDB. Any help you could offer would be much appreciated!
has comment: http://stackoverflow.com/comment/46230408
answer count: 1
tagged with: parse-platform
has answer: http://stackoverflow.com/a/29023228

http://stackoverflow.com/comment/46277106
has text: I don't have a problem with playlists :) Perhaps my description is misleading? If i query for playlists (/playlists/{playlistID}) i do get the purchase_url for each track. The problem is the main feed / affiliated stream (the users you follow) where each track will have a null value for purchase_url
type: AnswerComment
comment on: http://stackoverflow.com/a/29016202
score: 0
type: Comment

node.js
tags question: http://stackoverflow.com/q/28955835
tags question: http://stackoverflow.com/q/28954237
tags question: http://stackoverflow.com/q/29021359
tags question: http://stackoverflow.com/q/29053532
tags question: http://stackoverflow.com/q/28962328
tags question: http://stackoverflow.com/q/29045728
tags question: http://stackoverflow.com/q/29046003
tags question: http://stackoverflow.com/q/28991573
tags question: http://stackoverflow.com/q/28930237
tags question: http://stackoverflow.com/q/29049587
tags question: http://stackoverflow.com/q/28963733
tags question: http://stackoverflow.com/q/28927279
tags question: http://stackoverflow.com/q/29023671
tags question: http://stackoverflow.com/q/28973807
tags question: http://stackoverflow.com/q/29047069
tags question: http://stackoverflow.com/q/28997699
tags question: http://stackoverflow.com/q/28944761
tags question: http://stackoverflow.com/q/29046828
tags question: http://stackoverflow.com/q/28933412
tags question: http://stackoverflow.com/q/28954728
tags question: http://stackoverflow.com/q/28977661
tags question: http://stackoverflow.com/q/29037307
tags question: http://stackoverflow.com/q/28955743
tags question: http://stackoverflow.com/q/28924467
tags question: http://stackoverflow.com/q/29026328
tags question: http://stackoverflow.com/q/28953720
tags question: http://stackoverflow.com/q/28944185
tags question: http://stackoverflow.com/q/28999365
tags question: http://stackoverflow.com/q/28996610
tags question: http://stackoverflow.com/q/29057438
tags question: http://stackoverflow.com/q/28919667
tags question: http://stackoverflow.com/q/29000772
tags question: http://stackoverflow.com/q/29004192
tags question: http://stackoverflow.com/q/29000484
tags question: http://stackoverflow.com/q/28940040
tags question: http://stackoverflow.com/q/28953172
tags question: http://stackoverflow.com/q/28922340
tags question: http://stackoverflow.com/q/28916923
tags question: http://stackoverflow.com/q/28956080
tags question: http://stackoverflow.com/q/28915697
tags question: http://stackoverflow.com/q/29011583
tags question: http://stackoverflow.com/q/29042728
tags question: http://stackoverflow.com/q/28997502
tags question: http://stackoverflow.com/q/29056151
tags question: http://stackoverflow.com/q/28958933
tags question: http://stackoverflow.com/q/28925304
tags question: http://stackoverflow.com/q/29005309
tags question: http://stackoverflow.com/q/28933580
tags question: http://stackoverflow.com/q/28949020
tags question: http://stackoverflow.com/q/28992112
tags question: http://stackoverflow.com/q/28931258
tags question: http://stackoverflow.com/q/29023068
tags question: http://stackoverflow.com/q/28962584
tags question: http://stackoverflow.com/q/29022961
tags question: http://stackoverflow.com/q/28931511
tags question: http://stackoverflow.com/q/28925417
tags question: http://stackoverflow.com/q/28963071
tags question: http://stackoverflow.com/q/29006815
tags question: http://stackoverflow.com/q/28993520
tags question: http://stackoverflow.com/q/28933266
tags question: http://stackoverflow.com/q/28955170
tags question: http://stackoverflow.com/q/28967521
tags question: http://stackoverflow.com/q/29000488
tags question: http://stackoverflow.com/q/29019615
tags question: http://stackoverflow.com/q/29011783
tags question: http://stackoverflow.com/q/28939279
tags question: http://stackoverflow.com/q/28934526
tags question: http://stackoverflow.com/q/29013531
tags question: http://stackoverflow.com/q/28911289
tags question: http://stackoverflow.com/q/28928601
tags question: http://stackoverflow.com/q/28927588
tags question: http://stackoverflow.com/q/29013899
tags question: http://stackoverflow.com/q/28918845
tags question: http://stackoverflow.com/q/28933457
tags question: http://stackoverflow.com/q/28953359
tags question: http://stackoverflow.com/q/29062129
tags question: http://stackoverflow.com/q/28908788
tags question: http://stackoverflow.com/q/28970572
tags question: http://stackoverflow.com/q/28974989
tags question: http://stackoverflow.com/q/29043746

http://stackoverflow.com/comment/46197512
type: AnswerComment
has text: Updated my answer, please check now
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28972965

http://stackoverflow.com/a/29026128
has comment: http://stackoverflow.com/comment/46395613
has comment: http://stackoverflow.com/comment/46309839
has comment: http://stackoverflow.com/comment/46302368
has comment: http://stackoverflow.com/comment/46386904
has comment: http://stackoverflow.com/comment/46309816
answers question: http://stackoverflow.com/q/29009293
score: 0
type: Answer
has body: I think , the problem is Chromium compatibility and web view. Try to use ionic with the crosswalk browser for a simple test in you nexus 4 lollipop.
has comment: http://stackoverflow.com/comment/46303063
has comment: http://stackoverflow.com/comment/46374111
has comment: http://stackoverflow.com/comment/46294598
has comment: http://stackoverflow.com/comment/46462997

character-encoding
tags question: http://stackoverflow.com/q/28924467
tags question: http://stackoverflow.com/q/28982487
tag name: character-encoding
tags question: http://stackoverflow.com/q/29005084
type: Tag
tags question: http://stackoverflow.com/q/28908856

http://stackoverflow.com/comment/46171080
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28958747
has text: Okay. I'm a huge supporter of JQuery. It's basically just a Javascript library, but it takes a lot of the annoying things about its parent language out of the equation and streamlines the language quite a bit. It's worth looking into! So if you don't mind I'm going to switch to that. :) Add this tag to link to the JQuery library:
type: AnswerComment

http://stackoverflow.com/q/29061141
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/46358678
has title: javascript onclick call a function
has body: I found that code on internet and it works fine to create a button document.write(nomedispositivo) var r=$('&lt;input/&gt;').attr({//início botão type: "button", id: "field" , value: "Liga", But if I insert the line: onclick:switchLED() where switchLED is a function the button not appear where is the problem? document.write(nomedispositivo) var r=$('&lt;input/&gt;').attr({//início botão type: "button", id: "field" , value: "Liga", onclick:switchLED()
has answer: http://stackoverflow.com/a/29061190
accepted answer: http://stackoverflow.com/a/29061190

http://stackoverflow.com/comment/46185816
has text: Scott Kaye, yes I mean posting to JSON file.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28966986
score: 0

http://stackoverflow.com/q/29010548
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46266093
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46278792
tagged with: popup
has title: Woocommerce empty cart button. "Are you sure?"
tagged with: cart
type: Question
tagged with: woocommerce
has body: I have added an [empty cart] button to my Woocommerce cart page. Great. I would like to add a pop up to ask the user "Are you sure?" In case they shop for two hours, and then hit this button by mistake. I think this is custom JavaScript here. Lets pretend the button has an id of myButton.
tagged with: javascript
has answer: http://stackoverflow.com/a/29017778
accepted answer: http://stackoverflow.com/a/29017778

http://stackoverflow.com/a/28963315
answers question: http://stackoverflow.com/q/28963167
type: Answer
has body: you could use a simple get/post variable to tell where the user is coming from and store that in a session variable for later use when the user is to be returned. As far as I know you cant access the users browsing history from the browsing client with Javascript as its a violation of the sandbox design but that may have changed recently
score: 0

http://stackoverflow.com/q/28997392
type: Question
score: 3
tagged with: javascript
has title: Bootstrap Dropdown dynamic ajax list items
accepted answer: http://stackoverflow.com/a/28997849
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28997849
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46243561
has body: I use Bootstrap Dropdown and i'm trying to fill list items dynamically via AJAX before dropdown shown. My script must get available items from database and insert them into I prevents default event, do ajax and make a trigger after, but "data" is undefined and I don't see dropdown. Script like this usually works with forms properly. $(".dropdown").on("show.bs.dropdown", function(e, data){ ths = $(this); if (data == 'okay') return true; e.preventDefault(); $.ajax({ type: 'POST', url: '/core/test.php', data: 'test' }).done(function(response) { $(ths).children('ul').html(response); $(ths).trigger('click.bs.dropdown', 'okay'); }); }); html: My list ...data from ajax puts here... How can I fix it? Thanx.
type: AnsweredQuestion
upvote count: 3

http://stackoverflow.com/comment/46325848
type: Comment
comment on: http://stackoverflow.com/a/29042942
has text: Wouldn't that mess up the bg? Gonna try it anyway
type: AnswerComment
score: 0

http://stackoverflow.com/q/28921609
favorite count: 0
type: UnansweredQuestion
tagged with: module
has comment: http://stackoverflow.com/comment/46102124
has answer: http://stackoverflow.com/a/38112318
has body: I've started using es6 for a project, and quickly discovered that using import as such: import {Account} from 'controllers/account' import {Activity} from 'controllers/activity' import {BillingEdit} from 'controllers/billing-edit' import {BillingSummary} from 'controllers/billing-summary' import {Billing} from 'controllers/billing' import {BillingPlan} from 'controllers/billing-plan' import {Components} from 'controllers/components' import {Dashboard} from 'controllers/dashboard' import {Devices} from 'controllers/devices' import {Feedback} from 'controllers/feedback' import {Frame} from 'controllers/frame' import {Help} from 'controllers/help' import {Login} from 'controllers/login' import {Membership} from 'controllers/membership' import {Navigation} from 'controllers/navigation' import {Notifications} from 'controllers/notifications' import {Password} from 'controllers/password' import {Perks} from 'controllers/perks' import {PlanIssues} from 'controllers/plan-issues' import {PlanClaims} from 'controllers/plan.claims' import {PlanContract} from 'controllers/plan.contract' import {PlanDetails} from 'controllers/plan.details' import {PlanDevices} from 'controllers/plan.devices' import {Plan} from 'controllers/plan' import {PlanTerms} from 'controllers/plan.terms' import {PlanItems} from 'controllers/plan.items' import {Plans} from 'controllers/plans' import {Profile} from 'controllers/profile' Is leading to redundancy, and will become difficult to maintain. I can of course generate this dynamically by making a task that recurses through the directory, but I'm wondering if es6 has a solution to this problem
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46101149
tagged with: ecmascript-6
has title: Reducing redundancy of es6 modules import statement
tagged with: javascript
has comment: http://stackoverflow.com/comment/46101197
answer count: 1
downvote count: 0

http://stackoverflow.com/a/40182994
answers question: http://stackoverflow.com/q/29018682
upvote count: 1
score: 1
has body: Ok, so here's my answer: Use jQuery Use Alertify Use setTimeout These three things got me where I needed to be; hopefully someone else will eventually stumble on this and get some use out of it.
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29018682

http://stackoverflow.com/comment/46231435
has text: What did you try so far to do that in rexexr? actually the selection group does only select the text. I am not 100% sure about what you want to achieve, the regexr helps you to find a solution by reading the cheatsheet and documentation.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28984023
type: AnswerComment

http://stackoverflow.com/q/28975497
score: 0
accepted answer: http://stackoverflow.com/a/28976035
answer count: 1
has title: Django continually checking database for new information
tagged with: ajax
has comment: http://stackoverflow.com/comment/46203054
has answer: http://stackoverflow.com/a/28976035
tagged with: django
tagged with: python
type: AnsweredQuestion
type: Question
tagged with: performance
tagged with: javascript
has body: So, I was running some ideas through my head for a new website to build, and I am going to need something that would continually checks for new information. I looked around the internet and didn't find any django packages that would help me out. What I would do right now is... var timer = setInterval(function() {timerFunc()}, delay); function timerFunc() { //ajax here to check for new stuff... } For some reason, I have this notion that it should be possible to have the server-side alert the client side if there is new information but I have no particular reason to believe that. So, my questions are if there is a better way to do this, and if the code I have written is bad practice?

http://stackoverflow.com/q/28908180
has answer: http://stackoverflow.com/a/32493478
score: 6
type: AnsweredQuestion
tagged with: asynchronous
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28908269
answer count: 2
has title: What is a simple implementation of async.waterfall?
upvote count: 6
tagged with: node.js
tagged with: waterfall
accepted answer: http://stackoverflow.com/a/28908269
has body: I'm using some functions from the async library, and want to make sure I understand how they're doing things internally; however, I'm stuck on async.waterfall (implementation here). The actual implementation uses other functions from within the library, and without much experience, I'm finding it difficult to follow. Could someone, without worrying about optimization, provide a very simple implementation that achieves waterfall's functionality? Probably something comparable to this answer. From the docs, waterfall's description: Runs the tasks array of functions in series, each passing their results to the next in the array. However, if any of the tasks pass an error to their own callback, the next function is not executed, and the main callback is immediately called with the error. An example: async.waterfall([ function(callback) { callback(null, 'one', 'two'); }, function(arg1, arg2, callback) { // arg1 now equals 'one' and arg2 now equals 'two' callback(null, 'three'); }, function(arg1, callback) { // arg1 now equals 'three' callback(null, 'done'); } ], function (err, result) { // result now equals 'done' });
possible better answer: http://stackoverflow.com/a/32493478
linked to: http://stackoverflow.com/q/13600573
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/46335237
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29047863
score: 0
has text: Thanks a lot, I will look on Git. And this is personal website so there will not be another administrator and my "boss" is also my friend and I know him for a some time so I think there should not be problems that you mentioned there.

http://stackoverflow.com/comment/46137162
comment on: http://stackoverflow.com/q/28941225
type: Comment
type: QuestionComment
has text: Short answer is no, a loop is essential here. You might be able to find a library that can simplify the job, but that would still loop over the data.
score: 0

http://stackoverflow.com/comment/46353057
comment on: http://stackoverflow.com/q/29058206
type: Comment
type: QuestionComment
score: 1
has text: Please show your actual code or a complete example that displays the problem. The code you have shown does not behave the way that you have described.

http://stackoverflow.com/a/28945447
answers question: http://stackoverflow.com/q/28945384
score: 4
type: Answer
accepted answer of: http://stackoverflow.com/q/28945384
has comment: http://stackoverflow.com/comment/46145042
has body: try this: . . .
upvote count: 4
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29005342
tagged with: interpolation
type: AnsweredQuestion
has body: I have the following arrangement to fetch helptexts from a single Coffeescript file. Coffeescript: help.ex: '{{example.variable}} identifies enterprise data centers' HAML: %example-directive(attr='{{help.ex}}') Now the example.variable is accessible but it is not getting interpolated on the view. This I guess is happening because the string as a whole is getting interpolated and compile is not running on the variables within. How do I get around this?
has answer: http://stackoverflow.com/a/29006109
has title: Interpolating variables within already interpolated strings in angular
type: Question
accepted answer: http://stackoverflow.com/a/29006109
tagged with: javascript
score: 0
answer count: 1
tagged with: angularjs

http://stackoverflow.com/comment/46295865
type: AnswerComment
type: Comment
has text: Yes, JavaScript is enabled. Don't worry about it, it's not important work! Thanks for your help!
score: 0
comment on: http://stackoverflow.com/a/29026615

http://stackoverflow.com/a/28918635
has body: What about checking for a backslash in the beginning, short and simple "\/.+?"
score: 0
answers question: http://stackoverflow.com/q/28918303
type: Answer

http://stackoverflow.com/q/28943757
has comment: http://stackoverflow.com/comment/46142433
type: UnansweredQuestion
answer count: 0
has body: I need to pass a huge set of data with jquery ajax - image data. In which I can't use the usual way of uploading. Because the image data is from a canvas - literalycanvas. I've tried sent it but it's not get through. The data sample as follow: (pink is image data which is a lot longer than this and yellow is a truncate warning) Well, I need to pass this data along the jquery ajax. So Is there any possibility to do? Can I write it to a cookie instead? Can I pass it through the session? Here's my code : $.ajax({ url: 'print.php', type: 'POST', data: { // convert the image data to base64 filename:'<?=$_GET[file]?>',//photo/2015-03-09/img_00215.jpg image: lc.canvasForExport().toDataURL().split(',')[1], type: 'base64' }, success: function(data) { $('.export_btn').html(" Printed "); }, error: function() { $('.export_btn').html(" Print error! "); } }); return false; }); As you can see, the image: is sending a long line of data. Which is needs to send along the data. Any idea I can send this?
type: Question
tagged with: canvas
has title: How to send 3mb data URL with ajax post?
has comment: http://stackoverflow.com/comment/46141752
tagged with: javascript
has comment: http://stackoverflow.com/comment/46142011
tagged with: jquery
has comment: http://stackoverflow.com/comment/46141633
has comment: http://stackoverflow.com/comment/46141867
tagged with: ajax
has comment: http://stackoverflow.com/comment/46141976
score: 0
has comment: http://stackoverflow.com/comment/46141878
has comment: http://stackoverflow.com/comment/46142103
has comment: http://stackoverflow.com/comment/46142291

http://stackoverflow.com/q/29017793
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46279815
has title: Event ($watch) after input field (ng-modal) has been completed
has comment: http://stackoverflow.com/comment/46279664
tagged with: watch
upvote count: 1
has answer: http://stackoverflow.com/a/29019810
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29019810
possible better answer: http://stackoverflow.com/a/29018448
has answer: http://stackoverflow.com/a/29018448
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
has body: I have a text input field that asks for a name: &lt;input type="text" ng-modal="form.name" placeholder="Enter NAME"&gt; and I have a watch funcition listening to form.name scope.$watch('form.name', function(newValue, oldValue) { //TODO: foo() }); foo is being called every time a letter appears, but I want to be able to only call foo when the input field has been completed(either by deselecting input field or another trigger). foo() is an expensive call that I want to do only when the input field has been done. NOTE: there will be multiple input-fields following this process, so I don't want a button for each or do them all at once.
tagged with: angularjs
type: Question
answer count: 2

http://stackoverflow.com/comment/46344913
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29053326
score: 0
has text: It means you can't request finance.yahoo.com from any other origin. Once solution might be going through yql it solves cross-orgin problem or you can give try from server side request.

http://stackoverflow.com/comment/46179262
type: Comment
comment on: http://stackoverflow.com/a/28963764
has text: @Jai: See the "additional notes" on the [`:last` documentation](http://api.jquery.com/last-selector/) for why `.last()` may be preferred.
type: AnswerComment
score: 3

http://stackoverflow.com/comment/46205746
type: Comment
type: QuestionComment
has text: Well, what does it want? Please post the rest of the error message.
score: 0
comment on: http://stackoverflow.com/q/28977373

http://stackoverflow.com/q/28978454
score: 3
downvote count: 0
has body: I'm trying to create a game where boxes can be dragged into a grid. A box can only be dragged if the space in the grid is empty. I would like to know if there is a way for the grid, to be active with the boxes that will be dragged into the grid. Also, for the boxes to snap and be placed when the mouse is released near the empty grid space. I have started by creating a grid using lines. var canvasBg = document.getElementById('canvas'); var ctxBg = canvasBg.getContext('2d'); var ctx = canvas.getContext('2d'); // height and width of grid var gridWidth = canvasBg.width; //500px var gridHeight= canvasBg.height; //500px //draw grid for (var i = 0; i &lt;= gridWidth; i+= 50) { ctx.beginPath(); ctx.moveTo(50 + i,0); ctx.lineTo(50 + i, gridHeight); ctx.stroke(); } for (var i = 0; i &lt;= gridHeight; i+= 50) { ctx.beginPath(); ctx.moveTo(0,50 + i); ctx.lineTo(gridWidth, 50 + i); ctx.stroke(); } Sorry if this is not much to follow, and thank you for reading, any feedback would be much appreciated. Since this question is ignored and I need an answer, I kept on trying to find other solutions, I think I found one but not sure. If there is a dot or a small circle in the canvas, is it possible to find the location of this dot/circle and would it possible to do what the game intend to, allow a corner of the box to connect to the dot/circle, and then allow that box to be placed in the canvas where the dot is. Thank you for reading, any answer would help a lot.
type: Question
accepted answer: http://stackoverflow.com/a/28983463
has title: Dragging into grid
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/28983463
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/a/28932406
has comment: http://stackoverflow.com/comment/46138007
has comment: http://stackoverflow.com/comment/46139165
answers question: http://stackoverflow.com/q/28932108
type: Answer
has body: You can draw it the same as other lines: if (i != rows - 1 &amp;&amp; j != cols - 1) { context.moveTo( x + radius / sqrt2, y + radius / sqrt2 ); context.lineTo( (j + 1) * offset + center - radius / sqrt2, (i + 1) * offset + center - radius / sqrt2 ); context.moveTo( x + radius / sqrt2, (i + 1) * offset + center - radius / sqrt2 ); context.lineTo( (j + 1) * offset + center - radius / sqrt2, y + radius / sqrt2 ); } http://jsfiddle.net/o256ppwx/2/
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46120656
downvote count: 0

http://stackoverflow.com/comment/46201383
type: Comment
type: QuestionComment
score: 0
has text: @JohnConde, thanks, but it is a mystery when you are learning PHP.
comment on: http://stackoverflow.com/q/28971420

http://stackoverflow.com/comment/46230926
score: 0
comment on: http://stackoverflow.com/q/28989153
type: Comment
type: QuestionComment
has text: Ok. I posted an answer in that thread to that problem. In this case, I don't think checking if throttling is supported is necessary. Just code for it, and if it's not there it's not there.

http://stackoverflow.com/comment/46321674
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29040292
has text: @skidadon yeah you're totally right just added it. Thanks :)
score: 0

http://stackoverflow.com/a/29180077
type: Answer
has body: I don't know why this hasn't been mentioned, but jqueryui has a themeroller, with several pre-made themes, and you can make your own. (http://jqueryui.com/themeroller/) Easiest solution here is to implement a themeswitcher like the one here: https://github.com/harborhoffer/Super-Theme-Switcher Of course, you could write your own switcher as well, basically you're just switching the src of the jqueryui stylesheet...
score: 0
answers question: http://stackoverflow.com/q/29037627

http://stackoverflow.com/q/28959416
answer count: 4
type: AnsweredQuestion
score: 2
tagged with: datatables-1.10
type: Question
has comment: http://stackoverflow.com/comment/46171635
has title: How to get all the td values of a Table in a javascript function
has answer: http://stackoverflow.com/a/28959694
has body: I have a datatable in which i am showing child rows expand collapse functionality.It is working well but i want to get the contents of last td of a table.For now i have create a function which is placing some hard coded value in the datatable expanded place . In that place i want to get those td values. ! Here is the code i am posting Insert title here Name Position Office Age Start date Salary Tiger Nixon System Architect Edinburgh 61 2011/04/25 $320,800 Garrett Winters Accountant Tokyo 63 2011/07/25 $170,750 Ashton Cox Junior Technical Author San Francisco 66 2009/01/12 $86,000 Inside that format function i want to get all td values of datatables.Somebody please help
has comment: http://stackoverflow.com/comment/46418441
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29096224
has answer: http://stackoverflow.com/a/28995872
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
accepted answer: http://stackoverflow.com/a/28959694
possible better answer: http://stackoverflow.com/a/28959975
upvote count: 2
has comment: http://stackoverflow.com/comment/46171504
has answer: http://stackoverflow.com/a/28959975
has comment: http://stackoverflow.com/comment/46171451
tagged with: css

http://stackoverflow.com/a/29049743
score: 0
has body: Instead of trying to change the behavior of Array consider using an object instead of array with the id as the key. var objects = {}; var object = {id: 001, title: 'some title'} objects[object.id] = object; That way you can also retrieve your objects from the parent object by their id. e.g. var result = objects[001];
answers question: http://stackoverflow.com/q/29049704
type: Answer

http://stackoverflow.com/q/28927161
has comment: http://stackoverflow.com/comment/46127900
downvote count: 0
has comment: http://stackoverflow.com/comment/46111060
favorite count: 0
has comment: http://stackoverflow.com/comment/46110938
type: UnansweredQuestion
has body: From a browser, I would like to ask the server if a file that has been selected in a file input is identical to the one that it would replace on the server, if sent in a PUT request. I would use this comparison to decide whether or not to enable a save button. To do that, I figure I should generate an ETag for the blob and then compare that with the ETag header returned by a HEAD request for that resource. My question is, is there a browser API call that will return an ETag for a file-like object? Rough idea: &lt;input type="file" onchange="function( event ) { console.log( ETagUnicorn.generate( event.target.files[0] )); }" /&gt;
has title: Can I get an ETag for file / blob data in the browser?
answer count: 0
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46110886
linked to: http://stackoverflow.com/q/24542959
has comment: http://stackoverflow.com/comment/46145537
tagged with: javascript
tagged with: dom
tagged with: browser

http://stackoverflow.com/a/29058784
answers question: http://stackoverflow.com/q/29058716
upvote count: 1
type: Answer
has body: There's no built in method. You could add to HashMap to make it more clean: Ext.require('Ext.util.HashMap', function() { Ext.util.HashMap.fromObject = function(o) { var map = new Ext.util.HashMap(), key; for (key in o) { map.add(key, o[key]); } return map; } }); Ext.util.HashMap.fromObject({foo: 1, bar: 2});
downvote count: 0
score: 1

http://stackoverflow.com/comment/46274434
has text: don't change your code in the question. Mark Evan's answer as correct
comment on: http://stackoverflow.com/q/29014626
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/29059464
type: Answer
upvote count: 1
has body: Here is a simple solution using to &lt;div&gt; tags only. Setting the width of both container wil set the triangle on different placeses. body { margin:0; width: 100%; } * { box-sizing: border-box; } .right { float: left; border-bottom: 5px solid black; width: 50%; height: 100px; border-radius: 0 0 40px 0; } .left { float: right; border-bottom: 5px solid black; width: 50%; height: 100px; border-radius: 0 0 0 40px; } &lt;div class="right"&gt;&lt;/div&gt; &lt;div class="left"&gt;&lt;/div&gt;
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29055501

http://stackoverflow.com/comment/46080506
score: 0
type: Comment
type: QuestionComment
has text: When you post a link just like the link in `this` how do you do it..instead of putting the entire url you just post the word `this` and when you click it, it still goes to that url
comment on: http://stackoverflow.com/q/28910803

concurrency
tag name: concurrency
tags question: http://stackoverflow.com/q/28917741
type: Tag

http://stackoverflow.com/comment/46098391
type: Comment
type: QuestionComment
has text: @BrockAdams this was correct, Twitter overrides this. I ended up just putting `console.log = console.__proto__.log` at the start of my functions and it works just fine now.
score: 3
comment on: http://stackoverflow.com/q/28917468

http://stackoverflow.com/comment/46096910
has text: That's probably going to be tricky without setting actual values etc, but here's a start -> **http://jsfiddle.net/52pxbfcs/3/**
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28919449
score: 0

http://stackoverflow.com/comment/46114339
comment on: http://stackoverflow.com/q/28929039
type: Comment
type: QuestionComment
has text: You need to use `echo` instead of `die` on your php code.
score: 0

http://stackoverflow.com/a/28982858
score: 0
type: AcceptedAnswer
has body: DOJO plugin is deprecated. To make it work, however, you would need to set the ajax theme in struts.xml, or in &lt;sx:head /&gt;, but this theme is deprecated too, and not even shipped anymore in the Struts2 jar. Use Struts2-jQuery plugin validation instead. Also when talking about client-side validation, reading this might help.
type: Answer
accepted answer of: http://stackoverflow.com/q/28982599
answers question: http://stackoverflow.com/q/28982599

http://stackoverflow.com/q/28922455
has title: Storing javascript variables and displaying their values in HTML?
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28922623
upvote count: 1
type: Question
has body: I'm new to Javascript and I'm using a website's API to try to get some info about a user once they have gone through the website's authorization process but am having trouble understanding how to store (for later access) the response from the website. Let's say this is my request for a 'user' object to a website: // POST for user object $.post("https://api.twitch.tv/kraken/oauth2/token", { client_id: clientID, client_secret: clientSecret, grant_type : 'authorization_code', redirect_uri: redirectURI, code: user_code}, function(data) { grabUserAccessTok(data); }); Right now, I'm passing the response to grabUserAccessTok() but what if I wanted to store this response so that I can display all of the responses different attributes at different times on my webpage? How could I store this response? How would I access the stored response to display it on my webpage in, say, a &lt;div&gt; element?
score: 1
has answer: http://stackoverflow.com/a/28922522
tagged with: post
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0

datetime
tags question: http://stackoverflow.com/q/28992064
tags question: http://stackoverflow.com/q/28997699
tags question: http://stackoverflow.com/q/29021207
tags question: http://stackoverflow.com/q/28948875
tags question: http://stackoverflow.com/q/29004728
tags question: http://stackoverflow.com/q/29047991
tags question: http://stackoverflow.com/q/28979959
tags question: http://stackoverflow.com/q/28917387
tag name: datetime
tags question: http://stackoverflow.com/q/29038781
tags question: http://stackoverflow.com/q/29040686
tags question: http://stackoverflow.com/q/28910995
type: Tag
tags question: http://stackoverflow.com/q/29027524
tags question: http://stackoverflow.com/q/28959808

http://stackoverflow.com/a/29043136
score: 0
has comment: http://stackoverflow.com/comment/46326396
type: Answer
has comment: http://stackoverflow.com/comment/46326420
has comment: http://stackoverflow.com/comment/46326331
has body: If you really have a string and want to use jQuery, then you can parse it, then find all elements with indices higher than 2 and remove them: var $html = $(' test1 testing2 testing3 testing4 testing5 testing6 '); $html.find('li:gt(2)').remove(); $(' ').append($html.clone()).html(); // This returns the new HTML code. $('#wrapper').append($html); // This would append it to a #wrapper element.
answers question: http://stackoverflow.com/q/29043057

http://stackoverflow.com/comment/46206583
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28977853
has text: which the `check_token` one if yes why are you doing that?

http://stackoverflow.com/a/42855223
upvote count: 3
has body: Try AutoCalculator https://github.com/JavscriptLab/autocalculate Calculate Inputs value and Output By using selector expressions Just add an attribute for your output input like data-ac="(#firstinput+#secondinput)" No Need of any initialization just add data-ac attribute only. It will find out dynamically added elements automatically FOr add 'Rs' with Output just add inside curly bracket data-ac="{Rs}(#firstinput+#secondinput)"
type: Answer
answers question: http://stackoverflow.com/q/28985656
has comment: http://stackoverflow.com/comment/93631888
score: 3
downvote count: 0

http://stackoverflow.com/comment/46235116
has text: How did you fix it exactly @PixelStudio?
type: Comment
comment on: http://stackoverflow.com/q/28992560
type: QuestionComment
score: 0

http://stackoverflow.com/a/28927443
has comment: http://stackoverflow.com/comment/46111872
has body: It's not showing up using box.src because it is not defined when drawBox is specified. You need to rethink your structure. A better way of approaching this would be using something like this: function drawBox (parameters) { this.x = parameters.x || 0, this.y = parameters.y || 0; this.image = new Image(); this.image.src = parameters.src || ""; this.render = function (canvas) { canvas.drawImage(this.image, this.x, this.y); } } var box = new drawBox({ x: 50, y: 50, src: "https://www.gravatar.com/avatar/b1c8ae5b2e357e18d61bfb0dfd39136c?s=32&amp;d=identicon&amp;r=PG&amp;f=1" }); function animate(){ box.render(canvasbg); } This way you are sending dynamic parameters to the drawBox function and it can fall back to its default values if they're not specified. The render function is also a bit easier to use as you can specify what canvas to render the image onto in your animate function. Here's a working fiddle.
accepted answer of: http://stackoverflow.com/q/28927189
has comment: http://stackoverflow.com/comment/46111014
has comment: http://stackoverflow.com/comment/46111253
answers question: http://stackoverflow.com/q/28927189
has comment: http://stackoverflow.com/comment/46125873
score: 0
has comment: http://stackoverflow.com/comment/46111225
has comment: http://stackoverflow.com/comment/46111476
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46111095
type: Answer
has comment: http://stackoverflow.com/comment/46111169
has comment: http://stackoverflow.com/comment/46111057

http://stackoverflow.com/comment/46291728
type: QuestionComment
has text: yes ,added config.php
score: 0
comment on: http://stackoverflow.com/q/29024204
type: Comment

http://stackoverflow.com/a/28911164
has body: The for in loop is for enumerating properties but you want to iterate over an array. Use a for loop instead. Or Array.prototype.forEach if it's available to all the browsers you're targetting. See this post for more info - Loop through an array in JavaScript
answers question: http://stackoverflow.com/q/28911112
score: 0
type: Answer

http://stackoverflow.com/q/28971049
possible better answer: http://stackoverflow.com/a/28971213
has answer: http://stackoverflow.com/a/28971358
has answer: http://stackoverflow.com/a/28971213
tagged with: javascript
has body: I have a drop down list like this in my asp.net application, <asp:DropDownList runat="server" ID="ddlChanges" CssClass="selectstyle" onchange="javascript:ddlChangesChanged();"> <asp:ListItem Text="-- Select -- " Value="-1"></asp:ListItem> <asp:ListItem Text="Status Change" Value="1"></asp:ListItem> <asp:ListItem Text="Product Name Change" Value="2"></asp:ListItem> <asp:ListItem Text="Category Change" Value="3"></asp:ListItem> </asp:DropDownList> So, when user selects "Status Change" from the list, another dropdown list with following values appears, <asp:DropDownList runat="server" ID="ddlStatus" CssClass="selectstyle" Style="visibility: hidden;"> <asp:ListItem Text="-- Select -- " Value="-1"></asp:ListItem> <asp:ListItem Text="Pending" Value="1"></asp:ListItem> <asp:ListItem Text="Fixed" Value="2"></asp:ListItem> <asp:ListItem Text="Cancelled" Value="3"></asp:ListItem> </asp:DropDownList> <asp:Button ID="btnUpdate" CssClass="selectstyle" runat="server" Text="Update" OnClick="btnUpdate_Click"></asp:Button> If user does not select any value from the drop down list (ddlStatus), I am displaying an alert message ("You must select a status.") using JavaScript in the btnUpdate click event, if (this.ddlStatus.SelectedItem.Value.Trim() == "-1") { string script = " "; ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script); } But after this, my page refreshes and drop down list ddlChanges has "Status Change" (previously selected item) as selected item and drop down list (ddlStatus) gets hidden. I want ddlChanges drop down list to have -- Select -- as the selected item and ddlStatus should be visible. How can I do that?
score: 0
answer count: 2
tagged with: jquery
has comment: http://stackoverflow.com/comment/46193912
tagged with: asp.net
has comment: http://stackoverflow.com/comment/46194397
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46193840
has comment: http://stackoverflow.com/comment/46193977
has title: How to change drop down list selected index and visibility using another drop down list in asp.net?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28971358
type: Question
tagged with: c#

http://stackoverflow.com/a/28950138
type: AcceptedAnswer
score: 179
upvote count: 179
type: Answer
has body: It's a part of ISO-8601 date representation. It's incomplete because a complete date representation in this pattern should also contains the date: 2015-03-04T00:00:00.000Z //Complete ISO-8601 date If you try to parse this date as it is you will receive an Invalid Date error: new Date('T00:00:00.000Z'); // Invalid Date So, I guess the way to parse a timestamp in this format is to concat with any date new Date('2015-03-04T00:00:00.000Z'); // Valid Date Then you can extract only the part you want (timestamp part) var d = new Date('2015-03-04T00:00:00.000Z'); console.log(d.getUTCHours()); // Hours console.log(d.getUTCMinutes()); console.log(d.getUTCSeconds());
answers question: http://stackoverflow.com/q/28949911
has comment: http://stackoverflow.com/comment/46154699
accepted answer of: http://stackoverflow.com/q/28949911
downvote count: 0

http://stackoverflow.com/comment/46139838
comment on: http://stackoverflow.com/q/28942456
has text: Unfortunately, none of these suggestions worked. I would also imagine that the JSX compiler is not aware of the React API but simply renders the inline HTML into proper JavaScript.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46197085
score: 0
comment on: http://stackoverflow.com/q/28972661
type: Comment
type: QuestionComment
has text: @charlietfl. If I do **$('input:checkbox[id*=cblAvailableWidgetSelector]').eq(1).prop('checked', true);** then a checkbox at the top gets selected. But not the corresponding one for the same row

http://stackoverflow.com/a/28912953
upvote count: 1
has body: In this loop: for (i = 0; i < $('.carousel-dots-nav-item').length; i++) { var dot = $('.carousel-dots-nav-item')[i]; /*...*/ // move to the appropriate slide when a dot is clicked $(dot).click(function(e){ position = i; $('#carousel').animate({ left: -position * 100 + '%' }, 500); }); } You are using i to define the position. But all that is in the click function is not executed inside the loop but when you click on a dot element. So i is equal to $('.carousel-dots-nav-item').length. And you are lucky to have defined it globally. fiddle A solution is to store the position of each item in a data-position attribute. As you are using jquery, I used also it: // var liDot = $(' '); liDot.data("position", index); liDot.addClass('carousel-dots-nav-item').html('o'); liDot.appendTo($('#carousel-dots-nav')); // $(dot).click(function(e){ var position= $(this).data('position'); $('#carousel').animate({ left: -1*position * 100 + '%' }, 500); });
type: Answer
answers question: http://stackoverflow.com/q/28912596
downvote count: 0
has comment: http://stackoverflow.com/comment/46084835
score: 1
has comment: http://stackoverflow.com/comment/46084248

http://stackoverflow.com/comment/46323862
type: QuestionComment
comment on: http://stackoverflow.com/q/29041659
score: 0
has text: @JLRishe, it doesn't *need* to be an array, but that's what's most convenient as it's what's returned by [`getValues`](https://developers.google.com/apps-script/reference/spreadsheet/range#getValues()). I could probably wrap the whole thing in an object, but I think it's an interesting problem anyway.
type: Comment

http://stackoverflow.com/comment/46126303
type: Comment
has text: @NaN - yes you would just use `locations[i].latLng.lat`. Your data is already parsed from JSON into Javascript so `parseJSON()` is not appropriate here. You need the loops if you want to get all values returned in the data. It takes some sort of loop to iterate through the arrays in the data that can hold more than one value.
type: AnswerComment
comment on: http://stackoverflow.com/a/28935249
score: 0

http://stackoverflow.com/comment/46196135
score: 0
comment on: http://stackoverflow.com/q/28972077
type: Comment
type: QuestionComment
has text: //*[CertificateNumber="101234"] ... this is the expression. I also removed the space of Certificate Number from the json file.. Then it works fine as no space both in json and xpath.

http://stackoverflow.com/a/66676797
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28975622
has body: function forgot(){ event.preventDefault(); var email = document.getElementById("fe").value; if(emailArray.indexOf(email) == -1){ if (email == ""){ alert("Email required."); return ; } alert("Email does not exist."); return ; } alert("email is send to your email check it in 24hr. \n Thanks"); document.getElementById("fe").value =""; } document.addEventListener("contextmenu", function(e){ e.preventDefault(); alert("Right Click is not allowed"); }, false);

http://stackoverflow.com/comment/46206694
type: Comment
type: QuestionComment
has text: I'm not sure if you should use `callback : foobar` instead?
score: 1
comment on: http://stackoverflow.com/q/28977944

http://stackoverflow.com/comment/46215606
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28983004
has text: My Language Converter is working Nince without HTML Tag. But HTML tag have to work in result string.

http://stackoverflow.com/comment/46098027
type: Comment
has text: For the record, the second method wouldn't work either if JavaScript's unary ``+`` operator didn't convert an empty string to ``0``.
type: QuestionComment
comment on: http://stackoverflow.com/q/28920090
score: 0

http://stackoverflow.com/q/29056476
has answer: http://stackoverflow.com/a/29056523
type: Question
has body: i need to pass the value of button id to the textfield on onclick function,i have some scratch code below,but am new to javascrip. JSP Page B1 B2 B3 &lt;script type="text/javascript"&gt; function reply_click(clicked_id) { alert(clicked_id); } &lt;/script&gt; &lt;input type="text" name="get"&gt; &lt;/body&gt; &lt;/html&gt;
has answer: http://stackoverflow.com/a/29056519
tagged with: javascript
score: 0
answer count: 3
has title: passing the value of button value to textfield
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29056515

http://stackoverflow.com/q/29051459
tagged with: javascript
has title: replace specific div with some content with regex
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: regex
has body: In my HTML code, I have something like the following: title goes here content goes here With JavaScript, I try to use .replace() to replace the div and everything inside it with something else, but I can't make it work. I'm still new to regex... Does anybody have a regex to solve this issue?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29051493
type: Question
answer count: 1

http://stackoverflow.com/comment/46106645
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28924756
has text: There is a problem with that, It is not printing the value, it is just print the expression as it is : {{project.inrtcvalue}}
score: 0

http://stackoverflow.com/comment/46366754
score: 0
type: Comment
type: QuestionComment
has text: @MuradQaribov at the top of question i wrote about this fix. I need to declare event when chat hub is done
comment on: http://stackoverflow.com/q/29055013

http://stackoverflow.com/comment/46290346
type: QuestionComment
comment on: http://stackoverflow.com/q/29023692
has text: It dont work at all for me, please show me what you did
score: 0
type: Comment

http://stackoverflow.com/a/28971963
has comment: http://stackoverflow.com/comment/46195382
type: Answer
has comment: http://stackoverflow.com/comment/46195515
accepted answer of: http://stackoverflow.com/q/28971881
score: 6
answers question: http://stackoverflow.com/q/28971881
has body: You may not need jQuery to do this. Given the markup you provided, just use plain CSS and utilize the adjacent sibling combinator, +: Example Here .description { display: none; } .title:hover + .description, .description:hover { display: block; } If you need to use jQuery, you can just include the .description element in your jQuery selector: Updated Example $(".title, .description").hover(function () { // ... });
has comment: http://stackoverflow.com/comment/46195290
type: AcceptedAnswer
upvote count: 6
downvote count: 0
has comment: http://stackoverflow.com/comment/46195411
has comment: http://stackoverflow.com/comment/46195242

http://stackoverflow.com/comment/46227928
type: Comment
has text: So how do i have it send the function on confirm?
score: 0
comment on: http://stackoverflow.com/q/28989656
type: QuestionComment

http://stackoverflow.com/a/60934067
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28924551
has body: Write down the following code. success: function(msg) { $("#getCodeModal").modal("show"); $("#getCode").html(msg).show(); }

http://stackoverflow.com/q/29033406
score: 0
has answer: http://stackoverflow.com/a/29033615
tagged with: angularjs
type: UnansweredQuestion
has body: angular.module('print', []). controller('Ctrl', function($scope) { $scope.settingData = [{ "currency": "RM", "fields": { "type": "", "cost": "", "pax": "1" } }] $scope.addNewFields = function() { var row = $scope.settingData.length; if (row < 3) { $scope.settingData.push(row); } } }); Add {{data.fields.type}} {{data.fields.cost}} {{data.fields.pax}} pax 1 pax 2 pax Save I manage the push to add the new html but the new input is not working, I guess I've failed to add a new array object to my existing array object.
has comment: http://stackoverflow.com/comment/46308095
has answer: http://stackoverflow.com/a/29033642
type: Question
has title: push second or more array into array object angularjs
answer count: 2
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/comment/46163535
comment on: http://stackoverflow.com/q/28954457
has text: Oh, and please describe the problem your trying to solve/implement, not issues with your attempted solution. We need to understand the actual problem.
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/46267338
type: QuestionComment
has text: What I provided in the JS section above is all of the code associated with displaying the choropleth. The only thing missing is the data in `us` and `data` which are us.json and id/value pairs like in the data file contained in the choropleth bl.ock. colorScheme by default is the colors contained in the commented out line above it.
type: Comment
comment on: http://stackoverflow.com/q/28990025
score: 0

http://stackoverflow.com/a/29133571
type: Answer
has body: I feel silly about this, but I completely ignored the fact that when using http.createServer(), I had a timeout set of 3000 ms. I misunderstood what this timeout was for and this is what was causing my connection to close prematurely. Increasing this number allowed my most stubborn queries to complete.
answers question: http://stackoverflow.com/q/28972778
score: 0

http://stackoverflow.com/comment/46238241
type: Comment
comment on: http://stackoverflow.com/a/28978619
type: AnswerComment
score: 0
has text: Awesome! I've edited the polyfill path in my answer to avoid confusing others.

http://stackoverflow.com/q/28924190
has answer: http://stackoverflow.com/a/28924218
has body: I have a simple form, when I type in the input, i see the changes. But when I do it dynamically via JS the bind is not changing: type here and see how the binding changes: Changes and binding {{name}} Click and see how the binding is not changing http://jsfiddle.net/hge2hnc4/
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28924218
tagged with: javascript
type: AnsweredQuestion
tagged with: jquery
tagged with: angularjs
tagged with: binding
type: Question
has title: Angularjs input is not changing when updating via JS and not manual

http://stackoverflow.com/comment/46136587
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28940310
has text: So what would happen if somebody selects a child task?

http://stackoverflow.com/q/29026537
tagged with: jquery-plugins
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/46295420
has comment: http://stackoverflow.com/comment/46296515
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: Here in the code i am trying to call this plugin for 2 div elements. But i am only able to see the effects in the last instance only. I see that all the elements coming in the each loop but when i use the window resize event i face this issue. Can someonle please point out what the issue is? I am using the jqueryboilerplate template for this plugin Here is the jquery plugin code. Just copy paste this in your html file and it will work. // the semi-colon before function invocation is a safety net against concatenated // scripts and/or other plugins which may not be closed properly. ;(function ( $, window, document, undefined ) { "use strict"; // undefined is used here as the undefined global variable in ECMAScript 3 is // mutable (ie. it can be changed by someone else). undefined isn't really being // passed in so we can ensure the value of it is truly undefined. In ES5, undefined // can no longer be modified. // window and document are passed through as local variable rather than global // as this (slightly) quickens the resolution process and can be more efficiently // minified (especially when both are regularly referenced in your plugin). // Create the defaults once var pluginName = "vf_resizer", defaults = { propertyName: "value" }; // The actual plugin constructor function Plugin ( element, options ) { this.element = element; this.$element = $( element ); // jQuery has an extend method which merges the contents of two or // more objects, storing the result in the first object. The first object // is generally empty as we don't want to alter the default options for // future instances of the plugin this.settings = $.extend( {}, defaults, options ); this._defaults = defaults; this._name = pluginName; this.init(); } // Avoid Plugin.prototype conflicts $.extend(Plugin.prototype, { init: function () { // Place initialization logic here // You already have access to the DOM element and // the options via the instance, e.g. this.element // and this.settings // you can…
type: Question
has comment: http://stackoverflow.com/comment/46296141
has answer: http://stackoverflow.com/a/29026840
has comment: http://stackoverflow.com/comment/46296055
has comment: http://stackoverflow.com/comment/46376051
tagged with: javascript
has comment: http://stackoverflow.com/comment/46296082
has comment: http://stackoverflow.com/comment/46296344
has title: Plugin always only gets last instance, how to make it work for multiple elements

http://stackoverflow.com/comment/46166795
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28956414
has text: actually the class "solution" won't work: (From documentation) Selector: The draggable element will be contained to the bounding box of the first element found by the selector. If no element is found, no containment will be set.
type: Comment

http://stackoverflow.com/comment/46506764
has text: Market it fav, will look into it tomorrow. Seems not a trivial question, so far I managed to retrieve all-along cookies, but I can't see an easy way to retrieve them on page context. Smells like `tab` functionality.
score: 0
comment on: http://stackoverflow.com/q/29055555
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46282416
comment on: http://stackoverflow.com/q/29017957
has text: I ran accross a few fiddles and all the resources that point to the js and css files seem to point to http:// links, however when I try to run it complains to work on https. how can I get around this problem?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46245089
has text: No. Nothing on page load changes the contactDetail. But when saving a new contact, it is created... after page load, it throws the same error during save.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28991193
score: 0

http://stackoverflow.com/q/28912826
has answer: http://stackoverflow.com/a/28912939
tagged with: javascript
has answer: http://stackoverflow.com/a/28912952
has comment: http://stackoverflow.com/comment/46084085
type: AnsweredQuestion
favorite count: 0
tagged with: multidimensional-array
type: Question
has title: Use php vs Ajax for responsive UI
accepted answer: http://stackoverflow.com/a/28912952
tagged with: php
has comment: http://stackoverflow.com/comment/46084055
score: 0
has answer: http://stackoverflow.com/a/28912876
has body: I am having a data of materials (14 Rows, 6 Columns) and putting in a HTML form of a website. I am designing with with JavaScript as well as PHP. Kindly intimate which one will be best (JavaScript or PHP) in terms of fast loading of pages? Is there any better model for this one? I am providing the raw data in the tabular phone for better readability. SIZE CLASS THICK PRESSURE GRADE PRICE 100 K7 7.3 3.5 3.5 110.45 100 K8 7.9 3.8 4.5 125.50 100 K9 8.1 4.2 5.5 138.65 150 K7 7.7 3.7 3.6 121.50 150 K8 8.3 4.3 4.6 141.00 150 K9 8.8 4.9 5.6 150.00 ... .. ... ... ... ...... ... .. ... ... ... ..... 950 K9 13.3 7.9 7.9 850.00 if some one enters the Pipe dia &amp; class in the HTML form, the Thickness, Pressure, grade &amp; price is appearing. What I require is the speed and any other option apart from JS, PHP
answer count: 3
upvote count: 1
downvote count: 1
possible better answer: http://stackoverflow.com/a/28912876

http://stackoverflow.com/comment/46258782
has text: That sounds like a different thing. *forever* probably kept restarting your script in conjunction with the script being run by you elsewhere, which might have resulted in two separate processes trying to listen on the same port, which would result in, as you said, `EADDRINUSE`. However, my question isn't about `EADDRINUSE`..
comment on: http://stackoverflow.com/a/29005911
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46351663
has text: yes manage wasn't invoked..i want to reload and invoke manage after the reload
comment on: http://stackoverflow.com/a/29057302
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/30024718
has body: When you add your objects, do you add them with group.add() or group.addWithUpdate()? Becase the add function just throws them into the group without recalculating the new border size. But with group.addWithUpdate() it recalculats the size of the bounding box of the group.
type: Answer
answers question: http://stackoverflow.com/q/28963760
upvote count: 2
score: 1
downvote count: 1

http://stackoverflow.com/q/29023888
score: 4
has answer: http://stackoverflow.com/a/29023971
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has title: add bootstrap button by javascript
has body: I am trying to add a bootstrap button into a row dynamically. Below is my code. A button is added but it is not bootstrap style. var cell4 = row.insertCell(3); var element3 = document.createElement("input"); element3.type = "button"; element3.name = "add"; element3.value="Remove"; element3.class="btn btn-danger btn-xs"; cell4.appendChild(element3); Can someone tell the right way to do it? Thanks.
type: Question
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/29023957
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/46308185
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29030275
type: QuestionComment
has text: Could you possibly provide some code, and maybe a mockup of it in a Fiddle or Bootply?

http://stackoverflow.com/q/28932541
has title: Am I using semicolons right in js?
has comment: http://stackoverflow.com/comment/46120770
has comment: http://stackoverflow.com/comment/46153183
type: Question
downvote count: 4
has body: I have been doing some basic js but I am not sure if I am using semicolons correctly. Here is my code: //creates a variable that will start the game var start = confirm("Are you sure want to participate in plonker base alpha?"); //starts and loops the game if(start){ //asks for another person's name var person1 = prompt("Please name one of your best friends.") } //creates a randomizer function var random = function (subject){ return subject[Math.floor(subject.length * Math.random())] } while(start){ //creates array 'person' var person = ["You are ","Your mum is ","Your dad is ", "The world is ",(person1 + " is ")]; var personGenerator = random(person); //creates an array 'offence' var offence = ["an idiot!", "a complete pysco!!!", "a smelly, worthless peice of junk!", "a whale re-incarnated that looks like a squirrel!", "a dumb pile of dirt that has the misfortune of seeing itself in the mirror once in a while!", "a complete and utter plonker!", "a dumbo!", "a right dufus!!!", "a pile of rabbit dung!", "an intelligant, good looking king being... Did I mention - it's opposite day!", "a bum-faced rat!!!", "a fat, lazy oaf!", "a blobfish look-alike!!!!!", "a lump of toenail jelly!" ]; var offenceGenerator = random(offence); //gives out the offence alert(personGenerator + offenceGenerator); } { alert("What a plonker!") } Please correct me in the comments if I am using them wrong. Thanks, Reece C.
possible better answer: http://stackoverflow.com/a/28932630
has answer: http://stackoverflow.com/a/28932630
tagged with: javascript
favorite count: 0
answer count: 3
linked to: http://stackoverflow.com/q/444080
has answer: http://stackoverflow.com/a/28932564
has comment: http://stackoverflow.com/comment/46150399
has answer: http://stackoverflow.com/a/28932622
has comment: http://stackoverflow.com/comment/46120804
has comment: http://stackoverflow.com/comment/46120777
score: -3
has comment: http://stackoverflow.com/comment/46150322
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28932564
has comment: http://stackoverflow.com/comment/46152521

http://stackoverflow.com/q/28906875
score: 2
has title: Control Promise Execution Order
upvote count: 2
has comment: http://stackoverflow.com/comment/46073593
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/28842886
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28907206
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/46076674
has answer: http://stackoverflow.com/a/28915249
type: UnansweredQuestion
has body: I was having a lot of fun using promises to build a highly interactive UI. However, I ran into a tricky situation. I have a function returning a promise that executes a server update. I want to use the follow-on promise handlers to update the client side model and then issue an update event to the UI. Here is my code: function updateServer (action) { return $.post(URL, { action: action }) .fail(function (error) { console.log(error); }); } // An example action that might affect the server _this.freeze = function (mode) { updateServer("freeze").done(function (data) { _this.model.data.status = data.status; }) .done(function () { $(window).trigger(Events.UpdateUI); }); }; You'll notice that I have to issue the update event in the freeze command. I'd prefer to do so inside the updateServer function in order to avoid duplicating the code in each control method. I figured out a way to do this by passing the model updating function as a parameter to updateServer, however, it seems to violate the spirit of promises I think: function updateServer (action, fn) { return $.post(URL, { action: action }) .done(fn) .done(function () { $(window).trigger(Events.UpdateUI); }) .fail(function (error) { console.log(error); }); } // An example action that might affect the server _this.freeze = function (mode) { updateServer("freeze", function (data) { _this.model.data.status = data.status; }); }; I think that another way to do that would be to devise some kind of done handler that had a lower priority, and in that way it would enable me to maintain the spirit of promise compostability. Am I missing something, or am I doing this the "right way"? Thanks guys!

http://stackoverflow.com/a/29031434
accepted answer of: http://stackoverflow.com/q/29015665
answers question: http://stackoverflow.com/q/29015665
type: Answer
score: 2
downvote count: 0
has body: You can run the following query in order to achieve what you are looking for: //findAndModify will always refer to one document db.collection.findAndModify({ //Find the desired document based on specified criteria query: { username: 'mer', pets: { $elemMatch: { name: 'Esa'}}}, //Update only the elements of the array where the specified criteria matches update: { $set: { 'pets.$.name': 'CHANGED'}} }); This query will update the second document: { "username" : "mer", "password" : "mer", "character" : "pet", "visits" : [ ], "pets" : [ { "name" : "Ita", "kind" : "cat", "age" : "6" }, { "name" : "CHANGED", "kind" : "cat", "age" : "1" } ] } You can read more about updating documents using the $ positional operator here
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/q/28923269
has comment: http://stackoverflow.com/comment/46103458
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28924269
answer count: 1
has comment: http://stackoverflow.com/comment/46103416
has comment: http://stackoverflow.com/comment/46103439
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/46103377
type: Question
has body: So I have a script, to which when I provide a image detail and a div size, it calculates a region in the image, and a scale factor in order to show the best area of the image inside the div. This logic of calculating the best region of the div is done in PHP. and it spits a JSON like so: {"scale":1.34,"x1":502,"x2":822,"y1":178,"y2":578} This is against an image that is 1536px width and 1024px height. And the div on which this is to be placed is 500px width and 400px height. Now irrespective of whether the PHP script is doing the right calculations, I want to display this portion of the image in a div of this dimension so that I can see the result visually. And that is where I am having trouble. I tried the following: function showImageInDiv(image,data) { imageSrc = image.attr("src"); data = JSON.parse(data); $('#iDiv').empty().append("&lt;img src='"+imageSrc+"' id='iDivImage'&gt;"); $("#iDivImage").css({ "position": "absolute", "top":0, //&lt;--what should this be? "left":0,// &lt;--? "height":data.scale+"%", //scale is 1.34 - how do i translate here? "width":data.scale+"%", //&lt;--? "clip": "rect("+data.y1+"px,"+data.x2+"px,"+data.y2+"px,"+data.x1+"px)" }); } The above code in any case does not render the image region correctly in the div. I am using clip based on articles I saw online. I do not have a problem using any other technique (like background-image), if that works fine. I am more of a server side programmer and not very good with front end techniques. So I would appreciate if anyone can give me pointers on how to get this thing working! Thanks in advance
has title: display portion of scaled image in div
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28953908
score: 2
type: AnsweredQuestion
has body: I'm just learning to play with html5's canvas property. I discovered an awesome program @ https://developer.mozilla.org/en-US/demos/detail/ghostwriter-art-studio/launch that lets users draw pictures, choosing from a variety of tools and colors. I would like to modify the code so that, rather than give users a rectangular sandbox to play in, they can draw anywhere in an article. For example, imagine an article about physiology with three dozen paragraphs. They could underline or highlight any word or draw a little picture in the margin. Can this be done? In fact, I've already modified the code and it's working almost perfectly...except that I'm still locked in a rectangular box. This particular script has two canvases inside a div... &lt;div id="drawing"&gt; &lt;canvas id="artboard" width="750" height="500"&gt;&lt;/canvas&gt; &lt;canvas id="workboard" width="750" height="500"&gt;&lt;/canvas&gt; Changing the height to 100% doesn't work. If I change #artboard's height to 2500px, the vertical drawing area actually shrinks. I'm not sure if Ghostwriter is the only drawing script available; I haven't yet figured out a good search term. Anyway, can anyone either tell me how to make the vertical drawing area bigger or perhaps recommend another script I can check out?
downvote count: 0
has answer: http://stackoverflow.com/a/28954013
linked to: http://stackoverflow.com/q/4288253
type: Question
upvote count: 2
tagged with: canvas
tagged with: javascript
tagged with: jquery
has title: Ghostwriting - need bigger canvas
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28954013
tagged with: css

http://stackoverflow.com/q/28914181
has comment: http://stackoverflow.com/comment/46086594
has comment: http://stackoverflow.com/comment/46086849
has title: Google Map Marker not displaying
has answer: http://stackoverflow.com/a/28914620
has comment: http://stackoverflow.com/comment/46086758
type: AnsweredQuestion
score: 1
tagged with: wordpress
has body: I've tried adding a marker variable to my Google Map API and it will not show. Any ideas why? The website: http://www.franhaines.co.uk/paddlethewye/ function initialize() { var map = new google.maps.Map(document.getElementById('map'), { zoom: 12, center: new google.maps.LatLng(51.843143, -2.643555), mapTypeId: google.maps.MapTypeId.ROADMAP }); $("#findButton").click(findMe);} function errorCallback() { alert("I'm afraid your browser does not support geolocation."); } function successCallback(position) { var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); var myOptions = { zoom: 15, center: latlng, mapTypeControl: false, navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL}, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById('map'), myOptions); } var marker = new google.maps.Marker({ position: myLatlng, map: map, title:"We are here!" }); function findMe() { if (navigator.geolocation) { console.log(navigator.geolocation.getCurrentPosition(successCallback,errorCallback,{timeout:10000})); } else { alert("I'm afraid your browser does not support geolocation."); } }
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46086799
has comment: http://stackoverflow.com/comment/46087342
tagged with: javascript
has comment: http://stackoverflow.com/comment/46086856
accepted answer: http://stackoverflow.com/a/28914620
tagged with: google-maps
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46087512
favorite count: 0
linked to: http://stackoverflow.com/q/9663375

http://stackoverflow.com/comment/46202670
type: Comment
type: QuestionComment
score: 3
has text: If the code is not that complicated, I would probably just rewrite in javascript.
comment on: http://stackoverflow.com/q/28975761

http://stackoverflow.com/q/28962027
type: Question
score: -9
has comment: http://stackoverflow.com/comment/46175978
has comment: http://stackoverflow.com/comment/46176494
has comment: http://stackoverflow.com/comment/46175996
has comment: http://stackoverflow.com/comment/46176215
tagged with: jquery-ui
has title: TypeError: $(...).accordion is causing all other functions to fail
downvote count: 9
has comment: http://stackoverflow.com/comment/46176122
tagged with: javascript
upvote count: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/46175955
favorite count: 0
tagged with: typeerror
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46176406
has answer: http://stackoverflow.com/a/28962085
has body: I am having trouble with UI Accordion. It keeps on showing this error: TypeError: $(...).accordion is not a function which also causing all of my other Javascript function to stop working. Here is a live test: http://loai.directory/test/modules I changed the according function from: //Accordion $(".accordion").accordion({ header: ".accordionHead", collapsible: true, active: false, heightStyle: "content" }); to //Accordion $(function() { $(".accordion").accordion({ header: ".accordionHead", collapsible: true, active: false, heightStyle: "content" }); }); But it still didn't work.
has comment: http://stackoverflow.com/comment/46176067
has comment: http://stackoverflow.com/comment/46176577

http://stackoverflow.com/a/29112917
upvote count: 6
has comment: http://stackoverflow.com/comment/46739514
has comment: http://stackoverflow.com/comment/46654608
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46597052
has comment: http://stackoverflow.com/comment/46612005
type: Answer
has comment: http://stackoverflow.com/comment/46597095
has body: There are many ways of doing this, but I'll elaborate on two ways. Method 1 : Adjust the time on the client side One way is what you are trying to do which is to get the current time of the server and find the difference with the client's current time. You can simply adjust the server target time to the client's time. This can be done with var serverDifference=Date.parse(mysql_data.now)-Date.now() var target=Date.parse(mysql_data.server_time_in_two_hours)-serverDifference Then you can input it into your function without problem. Method 2: Calculate the times remaining, server side Since you just need a countdown timer, I think it's more appropriate to simply send the seconds left server side. This can be done with SQL using select timestampdiff(SECOND,now(),end_time) seconds_left from timers; Then you simply just make a timer that counts down based on the number of seconds left instead of a target date. You can calculate the number of seconds left by deducting the time that the javascript has run from the time received from the server. So something like var client_start=Date.now() function timeDiff_fromseconds(target) { function z(n) {return (n<10? '0' : '') + n;} var timeDiff =target-(Date.now()-client_start) var hours = timeDiff / 3.6e6 | 0; var minutes = timeDiff % 3.6e6 / 6e4 | 0; var seconds = timeDiff % 6e4 / 1e3 | 0; if (hours<0 || minutes<0 || seconds<0) { return 'EXPIRED'; } else { return '' + z(hours) + ' Hours, ' + z(minutes) + ' Mins, ' + z(seconds) + ' Secs'; } } There is also performance.now() as suggested by @dandavis. This returns the number of milliseconds since the tab opened and is accurate to 1/1000th of a millisecond. And this doesn't change even if the system clock of the client browser changes. For full support, you should use a polyfill (As of the time of this writing, iOS Safari doesn't support it). In this context we can replace Date.now() with it. JSFiddle Demo: http://jsfiddle.net/3o3u5r5j/1/
has comment: http://stackoverflow.com/comment/46679379
accepted answer of: http://stackoverflow.com/q/28998619
has comment: http://stackoverflow.com/comment/46697700
downvote count: 0
answers question: http://stackoverflow.com/q/28998619
has comment: http://stackoverflow.com/comment/46726509
score: 6
has comment: http://stackoverflow.com/comment/46597011
has comment: http://stackoverflow.com/comment/46641022

http://stackoverflow.com/q/29023796
has body: I want A site banner with a navbar below The banner to disappear when scrolling down, but the navbar to remain fixed I found this jsfiddle which provides the above solution: http://jsfiddle.net/DTcHh/541/ Two main points of code: //js $('#topnavbar').affix({ offset: { top: $('#banner').height() } }); //css #topnavbar.affix { position: fixed; top: 0; width: 100%; } My problem now is when you scroll down to the point where the 'affix' happens. If you look carefully at that point it kinda jumps, and now the navbar is overlapping the first 4 lines in the paragraph Any ideas how to get rid of that overlap?
possible better answer: http://stackoverflow.com/a/34488718
has answer: http://stackoverflow.com/a/34488718
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has title: Bootstrap navbar overlapping content when using affix
has answer: http://stackoverflow.com/a/29023891
downvote count: 0
favorite count: 0
upvote count: 2
tagged with: twitter-bootstrap
tagged with: css
accepted answer: http://stackoverflow.com/a/29023891
score: 2
type: AnsweredQuestion

http://stackoverflow.com/a/28991641
accepted answer of: http://stackoverflow.com/q/28988639
answers question: http://stackoverflow.com/q/28988639
has comment: http://stackoverflow.com/comment/46309996
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/46268733
upvote count: 1
has body: I am not the best person to respond to this. However, I have investigated the same question and therefore have some insight that may help you ;-) The way CommonJS modules work is that they are loaded the first time you refer to them. So a subsequent referral is at a very low cost. Therefore, I would say that it is more a question about "flavour". Personally, I tend to use the first approach that you mention, ie. something like this: var UiHelper = require('ui/helper); : : UiHelper.showListBox(.....); So back to your question - I don't think there is a penalty of using one or the other. It is more about how you want to structure your code ;-) /John

http://stackoverflow.com/q/28929927
has answer: http://stackoverflow.com/a/28930003
tagged with: javascript
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28929987
has title: how to call function in seperate files js?
has answer: http://stackoverflow.com/a/28929971
type: AnsweredQuestion
has body: I define some functions in two file js, file1 and file2. In each files, all of the functions are inside a $(document).ready(function(){});. I carefully place file1 above file2 in a php file, and call one function from file1 in file2, but console returns undefined function. What is wrong here?
type: Question
possible better answer: http://stackoverflow.com/a/28930003
accepted answer: http://stackoverflow.com/a/28929987

http://stackoverflow.com/comment/46331787
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29046406
has text: All requests that is being processed on the server take a great deal of time and if they won't be canceled then the server will be working uselessly

http://stackoverflow.com/q/28998383
answer count: 1
has title: Kendo UI Grid - Binding to navigation properties
tagged with: asp.net-web-api
tagged with: kendo-ui
has body: I am using the Kendo UI grid and am display a role of models. Each model has a navigation property, and I am trying to display a field that exists in this navigation property. //schema for my kendo data source schema: { data: function (data) { return data || []; } } ...................................................... $("#FAAFreqGrid").kendoGrid({ dataSource: FAADS, columns: [ { field: "Id", title: "Freq ID", format: "{0:c}", width: "120px" }, { field: "Frequency", title: "Frequency Test" format: "{0:c}", width: "120px" }, { field: "FREQ_POOL", title: "FAATEST", format: "{0:c}", width: "120px" }, { command: ["edit", "destroy"], title: "&amp;nbsp;", width: "250px" } ], toolbar: ["create"], editable: "inline", pageable: true }); If I go to my Web API Url, I get a json response of: [{"$id":"1","Frequency":"164.1375","FREQ_POOL":{"$id":"2","IsAM":true,......etc} FREQ_POOL is my navigation property, and it has the data I want. Frequency exists and displays in my grid properly. But my FREQ_POOL field says [object Object], and if I try to say "FREQ_POOL.IsAM", it says IsAM is not defined. I cannot get it to bind to any property I can bind to any other non-navigation field. How do I make this work? The data exists in the JSON object that is returned, but the binding just isn't working correctly. Thanks.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28999228
linked to: http://stackoverflow.com/q/29015105
type: Question
tagged with: kendo-grid
has answer: http://stackoverflow.com/a/28999228
tagged with: javascript
score: 0

http://stackoverflow.com/a/29038957
has comment: http://stackoverflow.com/comment/46318954
has comment: http://stackoverflow.com/comment/46318814
score: 0
answers question: http://stackoverflow.com/q/29038543
has body: No. This is the first argument past into any function. By passing in null you're saying the this is null. Do this instead. &lt;input onChanged={this.onSomethingChanged.bind(this, "username")} /&gt;
has comment: http://stackoverflow.com/comment/46319255
has comment: http://stackoverflow.com/comment/46318539
has comment: http://stackoverflow.com/comment/46319228
type: Answer
has comment: http://stackoverflow.com/comment/46319176
has comment: http://stackoverflow.com/comment/46319302
has comment: http://stackoverflow.com/comment/46319197

http://stackoverflow.com/q/29019707
type: Question
accepted answer: http://stackoverflow.com/a/29026723
has title: Use dojox.validate on Dijit ValidationTextBox, but not make text required
tagged with: javascript
score: 0
has body: In my Dijit form, I have the following ValidationTextBox: &lt;input data-dojo-type="dijit/form/ValidationTextBox" name="email" data-dojo-props="required: true, validator:dojox.validate.isEmailAddress, invalidMessage: 'Invalid email'" /&gt; However, I would like to make the field not required (i.e. allow it to be empty), but still use the dojox.validate method. Removing required: true or explicitly setting required: false doesn't seem to work; the field still says "Invalid email." How can I only use the validation method if text is present?
answer count: 1
has answer: http://stackoverflow.com/a/29026723
tagged with: dojo
type: AnsweredQuestion
tagged with: dijit.form

http://stackoverflow.com/comment/46087412
score: 3
has text: APIs commonly use brackets to indicate optional parameters. It's not a language feature.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28914662

http://stackoverflow.com/q/28939882
has answer: http://stackoverflow.com/a/44429944
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28940127
tagged with: node.js
tagged with: mongodb-query
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/82585035
has body: Using NodeJS + MongoJS, I have connection to a mongo DB. I set a TTL on a collection with: myCollection.createIndex({createdAt: 1}, {expireAfterSeconds: 60 * 30}) Is it now possible to update the value for expireAfterSeconds ? If so, what's the policy for already existing items in the collection, ie : are their TTL updated automatically or are they left untouched ?
linked to: http://stackoverflow.com/q/28244402
upvote count: 7
has title: How to update the TTL on a collection?
type: Question
tagged with: mongojs
score: 7
tagged with: javascript
has answer: http://stackoverflow.com/a/54931893
tagged with: mongodb
has answer: http://stackoverflow.com/a/28940127
possible better answer: http://stackoverflow.com/a/44429944
answer count: 3

http://stackoverflow.com/q/29049421
tagged with: asp.net-mvc-3
type: Question
has title: Seding date as json response from web api to angularJS
has body: Very simple question. I am working on a angularjs app retrieving data from an asp.net web api. I have a date field (ThisDate) in a table (Model) which has date format like this - 2015-03-14 12:39:32.470 When I send this as a response json string from asp.net - string json = "{\"CreatedAt\": \"" + Model.ThisDate + "\"}"; response.Content = new StringContent(json, Encoding.UTF8, "application/json") ..I am getting it like this in angularjs app - 14-03-2015 12:39:32 And When I send it as a json serialized object from asp.net - JsonConvert.SerializeObject(Model) ..I am getting it like this in angularjs app - 2015-03-14T12:39:32.470 What are the reasons for this to be different? I want both to be in second format, so sorting works correctly. How to achieve this? Thanks in advance.
tagged with: javascript
has answer: http://stackoverflow.com/a/29050137
score: 0
answer count: 1
tagged with: asp.net-web-api
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/28958363
has answer: http://stackoverflow.com/a/28958653
possible better answer: http://stackoverflow.com/a/28958541
favorite count: 0
tagged with: color-picker
has answer: http://stackoverflow.com/a/28958583
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
downvote count: 0
accepted answer: http://stackoverflow.com/a/28958583
has body: in my project I have two buttons that change the color of the entire layout, like font color, background color, hovered color and box shadow color. Now it works like that: $('#red').click(switchRed); $('#green').click(switchGreen); $('#blue').click(switchBlue); function switchRed() { $('.shadow-color').css('box-shadow', '0 0 0 2px #d94d4b, 0 0 0 #d94d4b'); $('.font-color').css('color', '#d94d4b'); $('.bg-color').css('background', '#d94d4b'); $('.hover-color').hover(function(){ $(this).css('background', '#d94d4b'); }, function(){ $(this).css('background', ''); }); $('.focus-color').focus(function() { $(this).css('box-shadow', '0 0 5px #d94d4b'); }); $('.focus-color').blur( function() { $(this).css('box-shadow',''); }); $('.color-icon').attr('src', 'img-v4/dl-button-red.png'); } function switchGreen() { $('.shadow-color').css('box-shadow', '0 0 0 2px #86aa66, 0 0 0 #86aa66'); $('.font-color').css('color', '#86aa66'); $('.ui-tooltip-content').css('box-shadow', '0 0 0 5px #86aa66'); $('.bg-color').css('background', '#86aa66'); $('.hover-color').hover(function(){ $(this).css('background', '#86aa66'); }, function(){ $(this).css('background', ''); }); $('.focus-color').focus(function() { $(this).css('box-shadow', '0 0 5px #86aa66'); }); $('.focus-color').blur( function() { $(this).css('box-shadow',''); }); $('.color-icon').attr('src', 'img-v4/dl-button-green.png'); } It works fine, but if I'd have 4-5 or even more color buttons i'd have to multiply all these functions and my script would be completely unreadable. Could you help me to create a clean and compact script. It should work the next way: We have 2-3 buttons with different color backgrounds. By clicking the button we get it's color attribute and add this color to font, background, hover and so on.
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28958541
answer count: 3
has title: Changing color for different elements
tagged with: css

http://stackoverflow.com/a/29004924
has comment: http://stackoverflow.com/comment/46256175
has comment: http://stackoverflow.com/comment/46256158
type: Answer
has body: This will let you count it: var list = ''; $('table:eq(0) td').each(function() { list += $(this).text() + ":" + $('td:contains(' + $(this).text() + ')').length + " " }); $('h3').append(list); results in: #:2 adam:2 peter:2 danny:2 zack:2 See this in action below. var list = ''; $('table:eq(0) td').each(function() { list += $(this).text() + ":" + $('td:contains(' + $(this).text() + ')').length + " " }); $('h3').append(list); # adam peter danny zack # adam peter danny zack
has comment: http://stackoverflow.com/comment/46256548
answers question: http://stackoverflow.com/q/29004822
score: 0
has comment: http://stackoverflow.com/comment/46256364

http://stackoverflow.com/a/28908014
score: 5
answers question: http://stackoverflow.com/q/28906754
has comment: http://stackoverflow.com/comment/48010193
type: AcceptedAnswer
upvote count: 5
has body: Pattern used by GTM is publish / subscriber Some details in code that helps to recognize it: line 76 and 181 of the https://github.com/google/data-layer-helper/blob/master/src/helper/helper.js And finally line 114 and 119 // Add listener for future state changes. var oldPush = dataLayer.push; var that = this; dataLayer.push = function() { var states = [].slice.call(arguments, 0); var result = oldPush.apply(dataLayer, states); that.processStates_(states); return result; }; Take a look into states variable and how it is passed to this.processStates_()
type: Answer
has comment: http://stackoverflow.com/comment/48003503
has comment: http://stackoverflow.com/comment/48011610
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28906754

http://stackoverflow.com/comment/46135093
type: Comment
has text: @webduvet I am a beginner in Node.js. Could you please elaborate on what you mean by promises here ?
type: QuestionComment
comment on: http://stackoverflow.com/q/28940040
score: 0

http://stackoverflow.com/comment/46351521
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29057091
has text: Those errors should give you plenty of direction. There are some syntax errors there and an error from the `base_url` function you call in your ajax above. Try sorting those out and see if that doesn't resolve your issues first.

http://stackoverflow.com/q/28913569
possible better answer: http://stackoverflow.com/a/28913663
tagged with: jquery
has answer: http://stackoverflow.com/a/28913663
has answer: http://stackoverflow.com/a/28913783
accepted answer: http://stackoverflow.com/a/28913783
has body: We want to make a new select box and copy its options from another select box when an event happens. We use below code: //Create a new select box and add it to a div $('#content').append("&lt;select id='destination'/&gt;"); //Create copy source options var $options = $("#source &gt; option").clone(); //Append source option to destination $("#destination").append($options); http://jsfiddle.net/e8ctkkvL/1/ I have a page with lots of selects(each with lots of options), above code is slow ! Is there any way I can make above JS faster ?!
type: AnsweredQuestion
has title: Create and Copy a select box with jquery
tagged with: select
has comment: http://stackoverflow.com/comment/46085436
has comment: http://stackoverflow.com/comment/46085539
type: Question
tagged with: clone
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/a/29120470
downvote count: 0
type: Answer
has body: Firstly you need add the option "selectable: true" because it create a div inside of slot where you click. Secondly you can use this div as selector (.fc-highlight") for call popover like this: dayClick: function (date, jsEvent, view) { $(".fc-highlight").popover({ title: 'haha', placement: 'right', content: 'haha', html: true, container: 'body' }); $(".fc-highlight").popover('show'); }
score: 2
accepted answer of: http://stackoverflow.com/q/28992871
answers question: http://stackoverflow.com/q/28992871
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/46248407
type: Comment
comment on: http://stackoverflow.com/a/29000258
has text: in your explanaition above you used var answervotes = $("parent-form1"); so the "." is missing i just wanted to point out
score: 0
type: AnswerComment

http://stackoverflow.com/q/29033118
has body: I am trying to enable specific days in a jquery-ui datepicker. So far i have set my sql scripts and json files and everything is working fine except the response time, because i've set async to false. My jquery code is. var today = new Date(); $("#pickDate").datepicker({ minDate: today, maxDate: today.getMonth() + 1, dateFormat: 'dd-mm-yy', beforeShowDay: lessonDates, onSelect: function(dateText) { var selectedDate = $(this).datepicker('getDate').getDay() - 1; $("#modal").show(); $.get("http://localhost/getTime.php", { lessonDay: selectedDate, lessonId: $("#lesson").val() }, function(data) { $("#attend-time").html(""); for (var i = 0; i &lt; data.length; i++) { $("#attend-time").append("&lt;option&gt;" + data[i].lessonTime + "&lt;/option&gt;"); $("#modal").hide(); } }, 'json'); } }); function lessonDates(date) { var day = date.getDay(); var dayValues = []; $.ajax({ type: "GET", url: "http://localhost/getLessonDay.php", data: { lessonId: $("#lesson").val() }, dataType: "json", async: false, success: function(data) { for (var i = 0; i &lt; data.length; i++) { dayValues.push(parseInt(data[i].lessonDay)); } } }); if ($.inArray(day, dayValues) !== -1) { return [true]; } else { return [false]; } } Can anyone help me out? I repeat the above code is working fine but with not good response time due to async=false. Thanks!
linked to: http://stackoverflow.com/q/9480537
tagged with: jquery
has answer: http://stackoverflow.com/a/29033926
tagged with: ajax
has comment: http://stackoverflow.com/comment/46307119
has comment: http://stackoverflow.com/comment/46307318
possible better answer: http://stackoverflow.com/a/73833070
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/73833070
accepted answer: http://stackoverflow.com/a/29033926
has title: Use jQuery UI datepicker with async AJAX requests
type: Question
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery-ui-datepicker
score: 0
answer count: 2

http://stackoverflow.com/q/28986191
favorite count: 0
tagged with: single-sign-on
has body: I have been building a mobile-web-app in HTML5/JQuery and as part of this app I need to require users to log in to Moodle on the app. Unfortunately I have no idea how to do this. I'm not sure if I can create a log in form on my App that will check User details with moodle, or if I need to redirect to moodle and get a response from there. There are a lot of vague, confusing questions about this, so I'm going to be as clear as I can about what the app should do. user opens App A App A asks the user to use their moodle details to log in Moodle tells App if log in was successful App A either displays an error, or allows user access to the app. If somebody could help me out here I would really appreciate it.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
downvote count: 0
has title: Authenticate Moodle User from external website
score: 1
tagged with: moodle
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28986370
upvote count: 1
answer count: 1

http://stackoverflow.com/a/29050649
has comment: http://stackoverflow.com/comment/46339711
type: Answer
has comment: http://stackoverflow.com/comment/46339874
score: 2
answers question: http://stackoverflow.com/q/29050622
upvote count: 2
has comment: http://stackoverflow.com/comment/46339618
has comment: http://stackoverflow.com/comment/46339717
has body: you can try with this code $('body').on('click', 'div[id^="break-"]', function(event) { event.preventDefault(); var NowBreak = moment().format("HH:mm:ss"); console.log(NowBreak); });
has comment: http://stackoverflow.com/comment/46339690
downvote count: 0

http://stackoverflow.com/comment/46270659
score: 0
type: Comment
type: QuestionComment
has text: the 75% change could be interpreted in many ways, take a look at [this question](http://stackoverflow.com/questions/28704994/how-do-i-enlarge-latlngbounds-box-using-latlng-data/28705156) where the user wanted todo something similar (if my interpretation of that 75% change is correct of course)
comment on: http://stackoverflow.com/q/29012722

http://stackoverflow.com/comment/81547842
type: Comment
comment on: http://stackoverflow.com/a/28961865
score: 1
type: AnswerComment
has text: @RedSparr0w I would have done that, but `Object.values` does not have IE support. Also, it's good to pass in `Infinity` to the `.reduce` part in case the array is empty.

http://stackoverflow.com/a/28958807
has comment: http://stackoverflow.com/comment/46174621
accepted answer of: http://stackoverflow.com/q/28917770
upvote count: 3
type: AcceptedAnswer
type: Answer
has body: The following works fine for me, try to strip any differences from your code:
downvote count: 0
has comment: http://stackoverflow.com/comment/46174173
answers question: http://stackoverflow.com/q/28917770
score: 3

http://stackoverflow.com/comment/46434925
type: AnswerComment
comment on: http://stackoverflow.com/a/29036010
type: Comment
has text: replace your javascript code with above i have changed
score: 0

file
type: Tag
tags question: http://stackoverflow.com/q/29017570
tags question: http://stackoverflow.com/q/28920912
tags question: http://stackoverflow.com/q/28913666
tag name: file

http://stackoverflow.com/a/29049796
upvote count: 5
has comment: http://stackoverflow.com/comment/46337777
has comment: http://stackoverflow.com/comment/46337760
score: 5
has comment: http://stackoverflow.com/comment/46338571
downvote count: 0
answers question: http://stackoverflow.com/q/29049384
type: Answer
has comment: http://stackoverflow.com/comment/139622617
has body: As Xan mentioned, try loading it as a new tab. In a web page, you can do either window.open('data:application/pdf;base64,DATA', '_blank') or (to load on same window) window.location.href="data:application/pdf;base64,DATA" Hope this helps. :/

elfinder
tags question: http://stackoverflow.com/q/28915127
type: Tag
tag name: elfinder

http://stackoverflow.com/comment/46091665
type: QuestionComment
score: 0
has text: Ohhh ... Wait a min ... So how can you add an eventListener that uses parameters in the function?
type: Comment
comment on: http://stackoverflow.com/q/28916915

http://stackoverflow.com/comment/46351291
type: Comment
comment on: http://stackoverflow.com/q/29056895
has text: List items can't be children of the body, and your paragraphs aren't closed. Run your code through a validator and you'll see.
score: 0
type: QuestionComment

http://stackoverflow.com/a/28910554
score: 0
accepted answer of: http://stackoverflow.com/q/28910131
has comment: http://stackoverflow.com/comment/46080201
type: Answer
answers question: http://stackoverflow.com/q/28910131
has body: If I understand correctly, here's a fiddle and pure code sample: Untitled Document Tab 1 Tab 2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eu finibus libero. Nulla cursus tempor elit, id luctus nunc pulvinar aliquet. Sed luctus nibh nulla, ut sollicitudin turpis facilisis in. Quisque tempor blandit mi, in ultrices sapien hendrerit in. Sed aliquet, leo quis varius imperdiet, dolor justo vestibulum dui, at vulputate arcu nisl dictum libero. Phasellus eget convallis nibh, vel aliquam nisl. Vestibulum pretium est lacus, ac consectetur tellus vestibulum a. Praesent efficitur sollicitudin nisi. Maecenas id ante at ex semper placerat. Nunc in gravida arcu. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In dictum, est sollicitudin lacinia luctus, urna magna malesuada nisi, et malesuada massa ipsum vel sapien. Integer vel interdum est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent egestas ex et lorem porta feugiat. Nullam pulvinar suscipit leo id posuere. Vestibulum placerat massa massa, a volutpat ex bibendum vitae. Cras hendrerit tortor est. Aliquam at semper purus, ut varius est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam at ex orci. Vivamus eget dignissim dolor, at hendrerit lacus. Nullam facilisis nunc vitae tincidunt interdum. Odnosnik
type: AcceptedAnswer

http://stackoverflow.com/a/29187943
answers question: http://stackoverflow.com/q/29007077
type: Answer
has body: This approach is very useful when you want to center both vertically and horizontally an absolute position div. It work also on IE8 You need to set the both outer and inner divs as position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin:auto; margin:auto it's fundamental to center divs in this case. You could also set the height and width of the .in div and still you would see it centered vertically and centered also when you resize the browser. * { margin: 0; padding: 0; } html, body { position: relative; height: 100%; width: 100%; } .in, .out { position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin:auto; } .in { background-color: red; height: 50%; width:50%; } .out { background-color: blue; } EXAMPLE 1 JSFIDDLE height, width: in percentages: http://jsfiddle.net/a_incarnati/1o5zzcgh/3/ EXAMPLE 2 - JSFIDDLE fixed height, fixed width http://jsfiddle.net/a_incarnati/1o5zzcgh/4/
score: 0

http://stackoverflow.com/comment/46415084
type: AnswerComment
type: Comment
has text: `event.preventDefault();` is preventing the form from being submitted. You should probably move it to the `if` parts.
score: 1
comment on: http://stackoverflow.com/a/29057883

http://stackoverflow.com/q/28923209
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28928788
has body: I am developing a browser extension using Kango Extension Framework By Using Content-scripts i have injected some code into the page like shown below &lt;span onmouseover= "hello('testing_name')" style='width:17%;padding: 3px; background-color: red; color: white; /&gt; I have the hello(str) function definition in the same content-script only, which is like below function hello(test_name) { alert(test_name); } But whenever i am trying to mouseover on the Span element , the ReferenceError: hello is not defined error is occurring. What i am doing wrong here
tagged with: content-script
tagged with: cross-browser
has answer: http://stackoverflow.com/a/28928788
type: AnsweredQuestion
downvote count: 0
type: Question
has title: Popup on mouseover event in Kango browser extension development
score: 1
tagged with: kango-framework
upvote count: 1
answer count: 1

http://stackoverflow.com/q/29006108
has title: Typeahead not working when first letter typed
type: Question
tagged with: twitter-bootstrap
tagged with: typeahead
tagged with: css
score: 0
has body: In my java script, i try to display typeahead. It won't display the countries typing first letter, but it displays when iam typing second letter. my script is $('#country_v1-query').typeahead({ order: "desc", source: { data: [ "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe" ] }, callback: { onInit: function (node) { console.log('Typeahead Initiated on ' + node.selector); } } }); and i call the script using id like this &lt;input type="text" id="country_v1-query" name="country_v1[query]" autocomplete="on" class=" typeahead" data-provide="typeahead" /&gt; the including links are typeahead.js, typeahead.css, jquery-ui.js, jquery-ui.css, bootstrap.min.css
answer count: 1
has answer: http://stackoverflow.com/a/29006723
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/28962237
downvote count: 0
has body: While using d3.time.scale() I am seeing some funny behaviour regarding the formatting of the tick marks. When zooming in from months to days, sometimes I get the date format in the axis to be %H %p (which renders "11 PM" for example, not showing the day.) This renders like so: Wed 11 | Fri 13 | 11 PM | 11 PM | 11 PM ... The dataset I am using has day granularity, and no time information. I would have hoped for %a %d (which would render Sat 15). Actually, some of the tick marks do show the correct formatting, while others do not. Is there a way to avoid this quirk? I was able to see this quirk in, at least, these two Mike Bostock's blocks: Zoomable Area, or Focus+Context via Brushing. I've seen in thread "d3js: time scaling and “1901”" that a tickFormat property can be added to the axis, thus overriding the normal formatting. The issue here is that I want to keep the scaling formats (from years to days). I am not sure how to pass tickFormat a list of formats, or even only override the formatting in some situations.
score: 1
has comment: http://stackoverflow.com/comment/46176880
type: Question
answer count: 2
has title: D3.js time scale quirk with "11 PM" values
tagged with: javascript
has answer: http://stackoverflow.com/a/28965363
upvote count: 1
accepted answer: http://stackoverflow.com/a/28965363
possible better answer: http://stackoverflow.com/a/28965362
favorite count: 0
has answer: http://stackoverflow.com/a/28965362
has comment: http://stackoverflow.com/comment/46181976
tagged with: d3.js
type: AnsweredQuestion

http://stackoverflow.com/q/29049991
has title: Angular ng-class re-evaulate
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46340937
has comment: http://stackoverflow.com/comment/46339152
score: 0
type: UnansweredQuestion
tagged with: ng-class
has body: Im using ng-class to apply the class active when collapseSidebar is set to true revealing my sidebar. js $scope.collapseSidebar = false; $scope.select = function(thing) { $scope.selectedThing = (thing !== $scope.selectedThing) ? thing : null; $scope.collapseSidebar = true; }; However the sidebar can be hidden in other ways (click a menu icon in the top left) removing the class active. When I call select(thing) I was hoping that ng-class would be re-evaluated and the class 'active' would be re-applied, however this does not happen, I have tried setting it to false and then straight back to true which also didn't work. How can I get ng-class to re-evaluate collapseSidebar and apply 'active' even if the value is the same as be
type: Question
has comment: http://stackoverflow.com/comment/46338138
answer count: 1
has answer: http://stackoverflow.com/a/29052637
tagged with: javascript
has comment: http://stackoverflow.com/comment/46338333

http://stackoverflow.com/a/29047839
upvote count: 1
has comment: http://stackoverflow.com/comment/46342559
type: Answer
has comment: http://stackoverflow.com/comment/46334752
has body: There is a list of init callbacks that can be used. I guess you need OmniAuth.config.before_request_phase #config/initializers/omniauth.rb OmniAuth.config.before_request_phase do |env| env['omniauth.auth'] # Your code there end
answers question: http://stackoverflow.com/q/29047737
downvote count: 0
score: 1

http://stackoverflow.com/comment/46295962
has text: I try to integrate but something is wrong. Can you check my code, please? http://pastebin.com/PzdC0vBf if my code integration is wrong can you repaste correctly on pastebin or JSFiddle, please?
comment on: http://stackoverflow.com/a/29008787
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/a/29047745
answers question: http://stackoverflow.com/q/29047645
has comment: http://stackoverflow.com/comment/46334877
has body: you can use the same approach that is applied for removing entry. Pass on the index, grab the target object using the index and set the value. In your HTML : &lt;li&gt;&lt;i ng-click="addQuantity($index)" class="ion-ios7-plus-outline"&gt;&lt;/i&gt;&lt;/li&gt; In your JS : $scope.addQuantity = function(index ){ $scope.cartItemList[index].quantity = 100; // Or whatever you want to put up. } Read more about $index here
score: 0
type: Answer

http://stackoverflow.com/comment/46130531
has text: Have you tried this?: http://jordiburgos.com/post/2014/excellentexport-javascript-export-to-excel-csv.html
type: Comment
comment on: http://stackoverflow.com/q/28937598
score: 0
type: QuestionComment

http://stackoverflow.com/a/28974763
has body: Try defining your regex without the RegEx object. var re = /(http\:\/\/|https\:\/\/)?((www\.)youtube\.com|youtu\.?be)(\/watch\?v=)(\w{11})/; var url = 'https://www.youtube.com/watch?v=xldcf8_XVfQ'; var match = re.exec(url); edit: As @Barmer said, you'll need to double escape your string when using the RegEx object. var regEx = new RegExp("(http\\:\\/\\/|https\\:\\/\\/)?((www\\.)youtube\\.com|youtu\\.?be)(\\/watch\\?v=)(\\w{11})");
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28974701
answers question: http://stackoverflow.com/q/28974701

http://stackoverflow.com/comment/46286462
type: QuestionComment
has text: you find all strings, store them in a list, then replace every string by "some marker NUM", where NUM is their position. Then you do your replacement, and replace the string in the list back afterward.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29017039

http://stackoverflow.com/a/28951015
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28949981
downvote count: 0
answers question: http://stackoverflow.com/q/28949981
has body: As per the nature of this kind of problem, I can't fix it for you, but I can give you a list of things to verify that are very likely to be where the problem comes from. Possible scenario is that a script tag contains calls to jQuery before the application.js file is loaded. Check in your HTML (including template) where is located the loading application.js, and verify is any call to $ is done before it Another scenario is that you are loading several manifest and another manifest is calling to jQuery and is also loaded before application.js. Check on this in your HTML files.
type: AcceptedAnswer

http://stackoverflow.com/a/28978097
downvote count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46242885
answers question: http://stackoverflow.com/q/28978023
has comment: http://stackoverflow.com/comment/46206929
has comment: http://stackoverflow.com/comment/46206972
type: Answer
has comment: http://stackoverflow.com/comment/46219826
has body: To create a function that also acts as an object, you can do something like this: var Example = function(params){ this.params = params; } Example.prototype.prompt = function(){ console.log(this.params); } var test = new Example("Hello, how are you?"); test.prompt(); Now, if you're asking how to create something where you have a function that initiates a new ovject each time it's called, you can impliment something like this: var Example = function(params){ this.params = params; } Example.prototype.prompt = function(){ console.log(this.params); return this; } Example.prototype.change = function(data){ this.params = data; return this; } myInit = function(data){ return new Example(data); } myInit("Hello!").prompt().change("How are you?").prompt(); In your case, you want to create a variable for the initate function, so you'd do something like this: var test = myInit("Default param."); test.prompt(); test.change("Hello!"); test.prompt(); (JS Fiddle Example)

http://stackoverflow.com/q/29027960
tagged with: javascript
tagged with: jquery
tagged with: jqote
tagged with: treetable
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29028094
type: Question
has title: Uncaught TypeError jqute
accepted answer: http://stackoverflow.com/a/29028094
score: 0
linked to: http://stackoverflow.com/q/2213216
has body: I am trying to make a really simple html tableTree. I have no experience regarding html/javascript programming so I'm traversing google to find examples on what I'm trying to achive. I am currently trying to find an easy way to pass a json file into an html document, and I have been successfull by doing that code part my self and using ajax and jquery. However I have found an example using jqote2, though implementing this example gives me an error "Uncaught TypeError: undefined is not a function". I guess I'm missing something though i cannot figure out what so I'm hoping I could get some assistance here :) Test I've build this code based on the example found at http://aefxx.com/jquery-plugin/jqote/ When running this code i get the error on $('#template').jqote(jsondata).appendTo($('#users')); So what am I missing :) I've check and the included files does exist and the path is correct.
answer count: 1

http://stackoverflow.com/q/28919869
score: 1
type: Question
linked to: http://stackoverflow.com/q/494035
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46111219
tagged with: regex
duplicate of: http://stackoverflow.com/q/494035
tagged with: node.js
has title: nodejs variable in regex match()
answer count: 0
type: UnansweredQuestion
has body: how can I use a variable in match() if I want to use regex? This works fine for me: if (message.match('!' + cmd)) { this.client.say(to, myJson[cmd]); } but if I try something like this it will not check the variable. if (message.match(/!cmd/i)) { this.client.say(to, myJson[cmd]); } I already searched for a solution but could only find something for replace. Edit: it's not a duplicate of How do you use a variable in a regular expression? as it explains it for replace not match.
upvote count: 1

http://stackoverflow.com/q/29043748
has answer: http://stackoverflow.com/a/29043790
tagged with: css
type: UnansweredQuestion
has body: I purchased an ebook from SitePoint that seemed pretty legit, but as I work through the code (chapter by chapter) I've gotten stuck after 8 chapters. The code to this point has worked as prescribed, but I've deleted and reworked this code four times and cannot for the life of me find out what happened in the last changes where submit boxes were replaced with forms. Codepen of related codehttp://codepen.io/anon/pen/RNezjb //dom references// var $question = document.getElementById("question"); var $score = document.getElementById("score"); var $feedback = document.getElementById("feedback"); var $start = document.getElementById("start"); var $form = document.getElementById("answer"); //view functio{ns function update(element, content, klass) { var p = element.firstChild || document.createElement("p"); p.textContent = content; element.appendChild(p); if(klass) { p.className = klass; } } quiz = { "name":"Super Hero Name Quiz", "description":"How many super heroes can you name?", "question":"What is the real name of ", "questions": [ { "question": "Superman", "answer":"Clark Kent" }, { "question": "Wonder Woman", "answer": "Diana Prince" }, { "question": "Batman", "answer": "Bruce Wayne"} ] }; //Event Listeners $start.addEventListener("click", function () { play(quiz); }, false); function hide(element) { element.style.display = "none"; } function show(element) { element.style.display = "block"; } //play(quiz); hide($form); function play(quiz) { //hide button and show form hide($start); show($form); $form.addEventListener('submit', function(event) { event.preventDefault(); check($form[0].value); }, false); var score = 0; //initialize score update($score, score); //main game loop var i = 0; chooseQuestion(); function chooseQuestion() { var question = quiz.questions[i].question; ask(question); } //end of main game loop gameOver(); function ask(question) { update($question,quiz.question + question); $form[0].value = ""; $form[0].focus(); } function check(answer) { if(answer …
has title: javascript novice to ninja can't get book code to work
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28959946
tagged with: jquery
has body: When loading an image in the onLoad (to force refresh of the image). If the image is not present it will not load the onerror image. How can I fix that? &lt;img class="small" src="VTVFile4.jpg" onload="this.onload=null; this.src='VTVFile4.jpg?' + new Date();" alt="Image not found" onError="this.onerror=null;this.src='demo.jpg';" /&gt;
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28960054
score: 0
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28960054
has title: onError not called when failing to load picture in onLoad
answer count: 1

http://stackoverflow.com/comment/46233671
type: Comment
comment on: http://stackoverflow.com/a/28992621
type: AnswerComment
has text: @user1667057 Thats a bit harder as now there are a lot of variables you want to contend with. Is the site written in PHP? Does it use wordpress...? Is it custom made? Changing links like that involves a lot. If it was simple changing a text file, easy. Searching and replacing in a database is virtually impossible unless you tell us exactly what tables you have, what columns, where the links are... Also, as a developer I think it unfair to do something like that for you when you admit you dont even want to pay for such service. This site is for learning, not cheap labour. Sorry.
score: 0

http://stackoverflow.com/a/29010349
answers question: http://stackoverflow.com/q/29006375
type: Answer
score: 0
has body: I used both "value" and "dataInit" of editoptions along with edittype:"select" to solve the issue. value : for giving default values dataInit : to initialize as chosen autocomplete/select. Correct Approach { name:"city", index:"city",editable:true,edittype:"select",editrules:{required:true}, editoptions : { style:"width:95%", value:{"Select City":"Select City"}, dataInit: function (elem) { $(elem).addClass('cityChosen'); $(elem).chosen({search_contains:true}); }//END Dataint } Wrong approach {name:"city", index:"city",editable:true,edittype:"select",editrules:{required:true}, editoptions : { style:"width:95%", dataInit: function (elem) { var optionBlank = document.createElement('option'); optionBlank.text = "Select City" ; optionBlank.value = "Select City" ; elem.add(optionBlank); $(elem).addClass('cityChosen'); $(elem).chosen({search_contains:true}); }//END Dataint } 2nd one will destroy id of select element.

http://stackoverflow.com/q/28935811
has body: I am on working on a java script code(Gale Shapley Algorithm). I want to read few entries from a database or spreadsheet and write the output of code in another database or spreadsheet. My inputs are: 2 ranked preference matrices Output: Couples (there are two outputs from code, I need only 'couples' Code: ; Given a complete list of ranked preferences, where the most liked is to the left: bob := ["abi", "dee", "fay", "bea", "jan"] gav := ["abi", "bea", "dee", "jan", "fay"] ian := ["bea", "dee", "abi", "fay", "jan"] jon := ["bea", "abi", "fay", "jan", "dee"] abi := ["gav", "bob", "jon", "ian"] bea := ["bob", "gav", "jon", "ian"] dee := ["jon", "ian", "gav", "bob"] fay := ["bob", "ian", "jon", "gav"] jan := ["gav", "bob", "jon", "ian"] ; of ten males: males := ["bob", "gav", "ian", "jon"] ; and ten females: females := ["abi", "dee", "fay", "bea", "jan"] ; and an empty set of engagements: engagements := Object() freemales := males.Clone() ,s := "Engagements:`n" ; use the Gale Shapley algorithm to find a stable set of engagements: For i, male in freemales ; i=index of male (not needed) { j:=1 ; index of female While (engagements[female:=%male%[j]] != "" and index(%female%, male) &gt; index(%female%, engagements[female])) j++ ; each male loops through all females in order of his preference until one accepts him If (engagements[female] != "") ; if she was previously engaged freemales.insert(engagements[female]) ; her old male goes to the bottom of the list ,s .= female . " dumped " . engagements[female] . "`n" engagements[female] := male ; the new engagement is registered ,s .= female . " accepted " . male . "`n" } ; summarize results: s .= "`nCouples:`n" For female, male in engagements s .= female . " is engaged to " . male . "`n" s .= Stable(engagements, females) Msgbox % clipboard := s Return ; Functions: Index(obj, value) { For key, val in obj If (val = value) Return, key, ErrorLevel := 0 Return, False, Errorlevel := 1 } Stable(engagements, females) { For female, male…
has comment: http://stackoverflow.com/comment/46157332
upvote count: 1
tagged with: algorithm
tagged with: javascript
type: UnansweredQuestion
tagged with: google-apps-script
has comment: http://stackoverflow.com/comment/46207610
answer count: 0
downvote count: 0
score: 1
favorite count: 0
type: Question
has title: Database/spreadsheet linking | Javascript for Gale Shapley Algorithm

http://stackoverflow.com/comment/46285430
type: QuestionComment
comment on: http://stackoverflow.com/q/29020812
has text: yes , but i am just beginner and start learning it , so i think it may be some sort of html functionality without javascript , cannt a beginner think like this ?
score: 0
type: Comment

http://stackoverflow.com/q/29054585
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
tagged with: css
has comment: http://stackoverflow.com/comment/46901989
has answer: http://stackoverflow.com/a/29054793
accepted answer: http://stackoverflow.com/a/29054793
upvote count: 0
has comment: http://stackoverflow.com/comment/46346835
has title: Javascript 'Firefly' background causing website delay lag
type: AnsweredQuestion
has body: For the background of my website i am using a Firefly effect where particles move over the background image randomly, i however find that the script is causing the website to have a delay lag which is very noticeable. Here is a JSfiddle of the firefly effect which i am using: jsfiddle.net/uyk7a711/1/ I have two questions, firstly being is there any way i can optimise this code or change anything to make it have less lag on the viewers computer ? Secondly a rather silly question, can i change the colour of the particles ? Any help would really be appreciated. Thankyou all
score: -1
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/49220272
answers question: http://stackoverflow.com/q/28965395
type: Answer
has comment: http://stackoverflow.com/comment/85444173
score: 0
has body: just simply add defer to your script src at .html like

http://stackoverflow.com/q/28923551
has body: I have some text stored in a POST variable that I need to append to an HTML file. I want to do within my PHP webpage, but it could use HTML, JQuery, Javascript, or anything else that will run natively. I've tried the PHP approach, but it hasn't worked despite my numerous attempts. Always a 500 internal server error. And I can't find anything on writing to files using JQuery, so if anyone out there knows something I don't, it would be appreciated. Thanks :)
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46103801
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28923621
score: 0
accepted answer: http://stackoverflow.com/a/28923621
has title: How can I write text to an external file using JQuery/JavaScript/PHP?
answer count: 1
tagged with: web
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/a/28975354
type: AcceptedAnswer
score: 0
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28975318
has body: Return when the conditions that require you to exit are met
answers question: http://stackoverflow.com/q/28975318
downvote count: 1

http://stackoverflow.com/comment/46093970
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28918148
has text: Do you have a top-level `spooky.then()` call after that block? Maybe the script simply finished and exited.

http://stackoverflow.com/comment/46183142
comment on: http://stackoverflow.com/q/28965112
has text: Of sorts - @Thomas - you still need (given your example input data) to tell us exactly what keys are supposed to appear in the `Set`.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46400916
has text: seem to be having problem with getting the intersect.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29037561

http://stackoverflow.com/q/29025157
has body: I have a parent div called "wrapper", which contains several children divs, each with some jquery attached to them. All the jquery code is contained within the div. Is there a way to cancel all the jquery within #wrapper? To illustrate:
linked to: http://stackoverflow.com/q/4323772
accepted answer: http://stackoverflow.com/a/29025197
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29025236
has comment: http://stackoverflow.com/comment/46292779
has answer: http://stackoverflow.com/a/29025236
type: Question
has title: Can I cancel all jquery events attached to child divs of a parent div?
has answer: http://stackoverflow.com/a/29025197
score: 0
answer count: 2

http://stackoverflow.com/comment/46283035
type: Comment
type: QuestionComment
has text: I meant *elements* object..
comment on: http://stackoverflow.com/q/29016658
score: 0

http://stackoverflow.com/comment/46176943
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28961807
has text: I will go for a simple alert..

http://stackoverflow.com/q/29007269
upvote count: 1
tagged with: php
tagged with: youtube
type: Question
type: AnsweredQuestion
has body: so I currently have this PHP script to get the Youtube IDS set in a mySQL database. This PHP script lists all the Youtube ID's in the database. PHP &lt;?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "songrequests"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn-&gt;connect_error) { die("Connection failed: " . $conn-&gt;connect_error); } $sql = "SELECT * FROM test"; $result = $conn-&gt;query($sql); if ($result-&gt;num_rows &gt; 0) { // output data of each row while($row = $result-&gt;fetch_assoc()) { echo "song: " . $row["link"]. "&lt;br&gt;"; } } else { echo "0 results"; } $conn-&gt;close(); ?&gt; Ok, and after that, I found this script that pushes Youtube IDs to a playlist, this is found here on jsFiddle (Full demo here) So basically, what I am trying to achieve is to push the IDs from my database to the list. I created a json which lists all of the IDs here With this ajax I'm trying to push the ID's from the json to the list, but it does not seem to work. JS $.ajax({ url: 'http://dj.aotikbot.tv/songlist.php', type: 'GET', dataType: 'json', success: function(data) { console.log(data.songs.length); if (data.songs.length != 0) { for (var x = 0; x &lt; data.songs.length; x++) { ytplayer_playlist.push("'" + data.songs[x].link + "'"); } } }, error: function() { console.log('Uh Oh!'); }, }); If you need more info on what I'm trying to do, let me know. Thanks in advance.
score: 1
has answer: http://stackoverflow.com/a/29009233
has title: ajax/jQuery Youtube playlist push
has comment: http://stackoverflow.com/comment/46261098
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46261665
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/46261386
accepted answer: http://stackoverflow.com/a/29009233
has comment: http://stackoverflow.com/comment/46261162
has comment: http://stackoverflow.com/comment/46260774
has comment: http://stackoverflow.com/comment/46261599
has comment: http://stackoverflow.com/comment/46261531

http://stackoverflow.com/q/29005155
type: Question
tagged with: phantomjs
has answer: http://stackoverflow.com/a/29005292
tagged with: canvas
answer count: 1
tagged with: javascript
score: 0
has title: How do I stream a Canvas Object from a child process back to Node.js?
tagged with: child-process
has body: I am using the headless Browser Engine PhantomJS to create a Canvas Object. I've spawned a child process from Node.js to Phantom. How do I get the Canvas in my parent Process (read Node.js)? I've tried stdout.write(sourcecanvas) and then assigning sourcecanvas to a variable, but it doesn't seem to work.
tagged with: node.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46257678

http://stackoverflow.com/comment/46336880
has text: What is `singleBind()`? It sounds like it should be the same as [.one()](http://api.jquery.com/one/).
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29040868
type: Comment

http://stackoverflow.com/q/29024342
answer count: 2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29024628
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29024514
accepted answer: http://stackoverflow.com/a/29024514
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46291906
linked to: http://stackoverflow.com/q/23803743
has title: $http promise always returns original promise?
tagged with: angular-promise
upvote count: 1
has answer: http://stackoverflow.com/a/29024628
type: AnsweredQuestion
score: 1
type: Question
has body: I apologize if this isn't a good question, but it's something that's confusing me a bit. I'm attempting to return specific data from an $http.post() from within a factory, however it would appear that $http always return the original promise. I'm looking to avoid .success and .error given their possible depreciation in v1.5. Given that the factory might do other things such as set items in localStorage etc, I do not want to return $http.post() directly. Anyways, is the following the best way to return specific data from an angular $http promise? function login (email, password) { var deferred = $q.defer(); $http.post('/api/auth', { email: email, password: password }) .then(function (data) { return deferred.resolve('success'); }) .catch(function (data) { return deferred.reject('fail'); }); return deferred.promise; }

http://stackoverflow.com/a/28998968
score: 0
has comment: http://stackoverflow.com/comment/46246404
type: Answer
has comment: http://stackoverflow.com/comment/46245910
answers question: http://stackoverflow.com/q/28998832
has comment: http://stackoverflow.com/comment/46245979
has comment: http://stackoverflow.com/comment/46246128
has comment: http://stackoverflow.com/comment/46246002
has body: I would consider changing how you structure the reponse. See a js fiddle of the code here: http://jsfiddle.net/xrmgeazs/ or http://jsfiddle.net/xrmgeazs/1/ with success option eg from php: $response = json_encode( array( 'success' =&gt; false, 'errors' =&gt; array( 'name =&gt;"Please enter a Name", 'email =&gt; "Please enter a Email" ) ) ); echo $response; The in your js eg: var result = jQuery.parseJSON(response); if( result.success ){ //do your success code here } else { //start by clearing previous errors $('form p.error').hide(); //loop your errors here for (var key in result.errors){ var errorName = key; var errorMessage = result.errors[key]; //now place your error and show accordingly. $( 'div.'+key ).append('&lt;p&gt;'+errorMessage+'&lt;/p&gt;'); } } HTML EG: &lt;form action="something.php" method="post"&gt; &lt;!-- add rel fields as appropriate --&gt; &lt;!-- also note this is a very simple structure and could be expanded for richer ui --&gt; &lt;div class="name"&gt; &lt;input type="text" name="name"/&gt; &lt;/div &lt;div class="email"&gt; &lt;input type="text" name="name"/&gt; &lt;/div &lt;/form&gt;

http://stackoverflow.com/q/29032433
tagged with: javascript
type: UnansweredQuestion
has title: ng-repeat doesn't display anything
upvote count: 0
favorite count: 0
tagged with: angularjs
type: Question
score: -2
has comment: http://stackoverflow.com/comment/46305649
has answer: http://stackoverflow.com/a/29032638
has comment: http://stackoverflow.com/comment/46305694
downvote count: 2
has body: {{data.b.three}} function Ctrl($scope) { $scope.mydata = [{ "a":"", "b":[{ "one":"", "two": "", "three": "1" }] }] } I expect it will return '1' but it didn't, also there is no error message in my console.
answer count: 1
has comment: http://stackoverflow.com/comment/46305722

http://stackoverflow.com/a/28929734
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46179811
downvote count: 0
has body: Most browsers make nonexistent images transparent. Therefore, you can add a background-image to the image element. If the image exists, it will cover up the background image, but nonexistent images will be transparent, letting the background-image show. Demo
type: Answer
answers question: http://stackoverflow.com/q/28929106

http://stackoverflow.com/comment/46219184
has text: I think the script is saying, that the function calls it self over and over again
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28985269
score: 0

http://stackoverflow.com/q/28995600
score: 1
has body: I've created an 8 second animation (.oam) in Edge Animate for a website made with Adobe Muse. When the animation finishes I want the page to automatically scroll down to an anchor I've placed like it would if I clicked an object with a hyperlink. I've inserted a Trigger @ 8000 ms with the following code; window.open("#about", "_parent") When I preview my website the animation works perfectly but at the end of the 8 seconds instead of scrolling down to the anchor, it reloads the entire page at the anchor instead. What is the correct code for the trigger? Thanks
has answer: http://stackoverflow.com/a/28995931
tagged with: adobe-edge
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Automatically scroll to anchor at end of animation
type: UnansweredQuestion
tagged with: animation
tagged with: muse
has comment: http://stackoverflow.com/comment/46241708
upvote count: 1
type: Question

http://stackoverflow.com/q/29036248
tagged with: css
has comment: http://stackoverflow.com/comment/46315618
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46315509
has comment: http://stackoverflow.com/comment/46344578
accepted answer: http://stackoverflow.com/a/29037693
has body: Jsfiddle DEMO HTML JQuery $('.slider').slick({ centerMode: true, centerPadding: '60px', slidesToShow: 9, adaptiveHeight: true, responsive: [ { breakpoint: 768, settings: { arrows: false, centerMode: true, centerPadding: '40px', slidesToShow: 3 } }, { breakpoint: 480, settings: { arrows: false, centerMode: true, centerPadding: '40px', slidesToShow: 2 } } ] }); The slickjs worked as expected, but I couldn't find a way to disable slick in laptop and desktop sizes. How to disable slick when in laptop and desktop sizes? Also, when in mobile size, how to enable slick and also show 9 thumbnails in 2 rows per slide ( 9 x 2 slides) (not one slide row with all 18 thumbnails)? Thought that increasing height would help but apparently not. Help appreciated.
type: Question
has comment: http://stackoverflow.com/comment/46314460
answer count: 1
has comment: http://stackoverflow.com/comment/46315106
has title: Possible to make the slider responsive according to browser size?
tagged with: javascript
has comment: http://stackoverflow.com/comment/46315796
has answer: http://stackoverflow.com/a/29037693
tagged with: jquery
has comment: http://stackoverflow.com/comment/46314999
has comment: http://stackoverflow.com/comment/46314870
has comment: http://stackoverflow.com/comment/46313840
score: 0

loops
tags question: http://stackoverflow.com/q/28939010
tags question: http://stackoverflow.com/q/28930987
tags question: http://stackoverflow.com/q/29042443
tags question: http://stackoverflow.com/q/28961721
tags question: http://stackoverflow.com/q/28933486
type: Tag
tags question: http://stackoverflow.com/q/29037539
tags question: http://stackoverflow.com/q/28978300
tags question: http://stackoverflow.com/q/28936867
tags question: http://stackoverflow.com/q/29056054
tags question: http://stackoverflow.com/q/28921248
tag name: loops
tags question: http://stackoverflow.com/q/29044520
tags question: http://stackoverflow.com/q/28915742
tags question: http://stackoverflow.com/q/28914305
tags question: http://stackoverflow.com/q/28933412
tags question: http://stackoverflow.com/q/28931981
tags question: http://stackoverflow.com/q/28955627
tags question: http://stackoverflow.com/q/28975481

http://stackoverflow.com/q/28936329
favorite count: 0
tagged with: bitcoin
tagged with: node.js
has answer: http://stackoverflow.com/a/78415090
has body: I'm attempting to do a build of Bitcoinjs for browser testing folloing the instructions on the BitcoinJS page (included below). $ npm install -g bitcoinjs-lib $ npm -g install bitcoinjs-lib browserify uglify-js $ browserify -r bitcoinjs-lib -s Bitcoin | uglifyjs &gt; bitcoinjs.min.js When I run this is does generate a file called bitcoinjs.min.js but it is empty. Can anyone explain what I'm doing wrong?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48634582
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/59359552
has answer: http://stackoverflow.com/a/40473683
has title: Bitcoinjs browser compile creating empty file
tagged with: javascript
has comment: http://stackoverflow.com/comment/46151864
score: 0
answer count: 2
tagged with: browserify

http://stackoverflow.com/comment/46321402
score: 0
type: AnswerComment
type: Comment
has text: @t.niese I meant those added not as attributes.
comment on: http://stackoverflow.com/a/29040268

http://stackoverflow.com/q/28946821
has answer: http://stackoverflow.com/a/28946895
has body: consider I have such a structure(a group of fields which repeat); when I click on the delete-image of any Row, I want to get the value of the input field with class name "User" of this specific Row. How can I do this in javascript?
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28946909
accepted answer: http://stackoverflow.com/a/28946895
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28946989
favorite count: 0
has comment: http://stackoverflow.com/comment/46154523
upvote count: 2
type: AnsweredQuestion
score: 1
has title: How do I get the value of a child on clicking another child of a parent Class?
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28946909

http://stackoverflow.com/q/28926997
has body: I was wondering if its possible for localStorage to have a Boolean value instead of a string? Using JS only no JSON if its impossible or can be done in JS a different way please let me know thanks http://jsbin.com/qiratuloqa/1/ //How to set localStorage "test" to true? test = localStorage.getItem("test"); localStorage.setItem("test", true); if (test === true) { alert("works"); } else { alert("Broken"); } /* String works fine. test = localStorage.getItem("test"); localStorage.setItem("test", "hello"); if (test === "hello") { alert("works"); } else { alert("Broken"); } */
has title: How to have localStorage value of true?
upvote count: 10
accepted answer: http://stackoverflow.com/a/28927018
tagged with: boolean
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: string
favorite count: 0
type: Question
score: 10
has answer: http://stackoverflow.com/a/28927018
tagged with: local-storage
answer count: 1
has comment: http://stackoverflow.com/comment/46110003

http://stackoverflow.com/comment/46224679
has text: Guys, thank you very much for your help. I'm having another problem with this context - I don't know how to manage 'directived' element from controller by its dom. I want to have some kind of service, that would handle that, and all I can pass to them is DOM. I've edited the question and described the problem. thanks!
comment on: http://stackoverflow.com/a/28977223
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46360755
has text: You're welcome. @entre, Why'd you add `by $index` back in? It was throwing errors for me, but I'm new to javascript.
type: Comment
comment on: http://stackoverflow.com/a/29062264
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46198989
score: 0
comment on: http://stackoverflow.com/a/28909969
type: Comment
has text: never mind. figured it out. For someone wanting to highlight only a single line in ace editor, specify the type parameter as `line`, instead of specifying it as `fullLine` or leaving it blank.
type: AnswerComment

http://stackoverflow.com/comment/46153924
score: 0
has text: Why did you add spaces to the title?
comment on: http://stackoverflow.com/q/28950051
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46222750
type: QuestionComment
type: Comment
has text: It's not clear what you are trying to do. Please clarify.
comment on: http://stackoverflow.com/q/28987081
score: 2

http://stackoverflow.com/q/28909025
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 1
tagged with: hover
has title: Bind on mouseover or hover to dynamically generated elements
has comment: http://stackoverflow.com/comment/46077402
score: 0
has body: I need to bind a hover for items generated in the javascript. For example when I mouseover an icon element, a unique text would appear about that icon: for (var i = 0; i &lt; items.length; i++) { $('.items').append('&lt;div class="icon' + i + '"&gt;&lt;/div&gt;'); $('.itemInfo').append('&lt;div class="info' + i + '"&gt;' + name + '&lt;/div&gt;'); } I have tried using jQuery .hover() and .on(), and inject the info through javascript when the icon is hovered over, but it would always grab the info of index. I also tried (example below) setting the info and using .hide(), then .show() when the icon is hovered over and nothing appears at all. However, the debugger tells me that it is going into the function and the index is still the last one. for (var i = 0; i &lt; items.length; i++) { $('.items').append('&lt;div class="icon' + i + '"&gt;&lt;/div&gt;'); $('.itemInfo').append('&lt;div class="info' + i + '"&gt;' + name + '&lt;/div&gt;'); $('.icon' + i).on({ mouseenter: function () { $('.itemInfo' + i).show(); }, mouseleave: function () { $('.itemInfo' + i).hide(); } }); } Note that I have the icons and info separated into two different divs, for UI styling purposes. There are other icons being generated, where the number of items are known, so they are able to follow that structure. Not sure if breaking away from the way the html/css is set up and putting both icon and info under the same div would be better in handling this situation where I don't know how many items are being generated.
has answer: http://stackoverflow.com/a/28909304
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46078279
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28909304
type: Question

http://stackoverflow.com/comment/46194096
score: 0
comment on: http://stackoverflow.com/q/28969545
type: Comment
has text: Well - like so many other things on the 'net these days, there seems to be a great polarization. You're an idiot if you use javascript, etc. jquery is nice, but the syntax is a tad atrocious, and I've got to leave this code to those who don't even know javascript that well. Can't say I'm an expert either, but I know about 500% more about it than my co-workers. So, I've got to think "legacy" here...
type: QuestionComment

http://stackoverflow.com/a/29041400
has body: add a delay using setTimeout function before calling next subroutine calculation, else the browser will update the DOM only after all javascript code has been executed
downvote count: 0
answers question: http://stackoverflow.com/q/29041267
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/46256418
score: 0
type: Comment
has text: it doesnot download song.. It download some other page
type: AnswerComment
comment on: http://stackoverflow.com/a/29004807

http://stackoverflow.com/q/28952581
has comment: http://stackoverflow.com/comment/46162841
has comment: http://stackoverflow.com/comment/46163364
tagged with: mongodb-query
favorite count: 0
has comment: http://stackoverflow.com/comment/46162639
has body: I'm new to MongoDB and Mongoose and I'm trying to use it to save stock ticks for daytrading analysis. So I imagined this Schema: symbolSchema = Schema({ name:String, code:String }); quoteSchema = Schema({ date:{type:Date, default: now}, open:Number, high:Number, low:Number, close:Number, volume:Number }); intradayQuotesSchema = Schema({ id_symbol:{type:Schema.Types.ObjectId, ref:"symbol"}, day:Date, quotes:[quotesSchema] }); From my link I receive information like this every minute: date | symbol | open | high | low | close | volume 2015-03-09 13:23:00|AAPL|127,14|127,17|127,12|127,15|19734 I have to: Find the ObjectId of the symbol (AAPL). Discover if the intradayQuote document of this symbol already exists (symbol and date combination) Discover if the minute OHLCV data of this symbol exists on the quotes array (because it could be repeated) Update or create the document and update or create the quotes inside the array I'm able to accomplish this task without veryfing if the quotes already exists, but this method can creates repeated entries inside quotes array: symbol.find({"code":mySymbol}, function(err, stock) { intradayQuote.findOneAndUpdate({ { id_symbol:stock[0]._id, day: myDay }, { $push: { quotes: myQuotes } }, { upsert: true }, myCallback }); }); I already tried: $addToSet instead of $push, but unfortunatelly this doesn't seems to work with array of documents { id_symbol:stock[0]._id, day: myDay, 'quotes["date"]': myDate } on the conditions of findOneAndUpdate; but unfortunatelly if mongo doesn't find it, it creates a new document for the minute instead of appending to the quotes array. Is there a way to get this working without using one more query (I'm already using 2)? Should I rethink my Schema to facilitate this job? Any help will be appreciated. Thanks!
tagged with: node.js
has comment: http://stackoverflow.com/comment/46162986
type: AnsweredQuestion
score: 3
has title: Mongoose find one and push to array of documents
upvote count: 3
has answer: http://stackoverflow.com/a/28956842
type: Question
tagged with: mongodb
downvote count: 0
tagged with: mongoose
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28956842
answer count: 1

http://stackoverflow.com/comment/138725590
score: 1
type: Comment
has text: The old jsperf test can be seen on jsperf.app, here: https://jsperf.app/es6-string-literals-vs-string-concatenation
comment on: http://stackoverflow.com/a/29083467
type: AnswerComment

http://stackoverflow.com/q/29002512
has comment: http://stackoverflow.com/comment/46256493
type: UnansweredQuestion
has title: Getting text part of select instead of value in jqGrid inline editing
has comment: http://stackoverflow.com/comment/46701733
tagged with: jqgrid
has comment: http://stackoverflow.com/comment/46255673
type: Question
has body: In my jqGrid there are 4 select in which two is working fine and two is not working. Issue : When I use the below snippet : var stagevalues = GetStagesValues(); var salesvalues = GetSalesValues(); var owners = GetDataOwnershipValues(); xmlstring = Stages; //.XmlToString(); $("#uxStages").jqGrid({ datatype: 'xmlstring', datastr: xmlstring, mtype: 'GET', ajaxGridOptions: { contentType: 'application/json; charset=utf-8' }, xmlReader: { repeatitems: false, root: "BO&gt;SalesOpportunitiesLines", row: 'row' }, colNames: ['LineNum', 'Star Date', 'Close Date', 'Sales Employee', 'Stage', 'Percentage', 'Potential Amount', 'Document Type', 'Doc. No.', 'Owner'], colModel: [ { name: 'LineNum', key: true, index: 'LineNum', hidden: false, sortable: false, width: 60 }, { name: 'StartDate', key: false, index: 'StartDate', sortable: false, align: "left", width: 90, editable: true, formatter: 'date', formatoptions: { srcformat: 'Ymd', newformat: 'd-M-y' }, formatter: function (cellValue, opts, rawdata, action) { if (action === "edit") { // input data have format "dd-mm-yy" format - "20-03-2015" var input = cellValue.split("-"); if (input.length === 3) { return input[0] + "-" + input[1] + "-" + input[2]; } } else if (cellValue.length === 8) { // input data have format "yymmdd" format - "20150320" var year = cellValue.substr(0, 4), month = cellValue.substr(4, 2), day = cellValue.substr(6, 2); return day + "-" + month + "-" + year; } return cellValue; // for empty input for example }, editoptions: { dataInit: function (elem) { $(elem).datepicker({ dateFormat: 'dd-M-y' }); } } }, { name: 'ClosingDate', key: false, index: 'ClosingDate', sortable: false, align: "left", width: 90, editable: true, formatter: 'date', formatoptions: { srcformat: 'Ymd', newformat: 'd-m-Y' }, formatter: function (cellValue, opts, rawdata, action) { if (action === "edit") { // input data have format "dd-mm-yy" format - "20-03-2015" var input = cellValue.split("-"); if (input.length === 3) { return input[0] + "-" +…
has comment: http://stackoverflow.com/comment/46255541
has answer: http://stackoverflow.com/a/29248594
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46258208
score: 0
has comment: http://stackoverflow.com/comment/46700763

http://stackoverflow.com/comment/46303074
type: QuestionComment
comment on: http://stackoverflow.com/q/29030138
score: 0
type: Comment
has text: Thanks Jordi. That could work nicely in a purely JavaScript situation. But I was looking for something specific to the primefaces/Ajax context.

http://stackoverflow.com/a/29016876
answers question: http://stackoverflow.com/q/29014640
has body: This is a common problem defining references to markers in loops. One way to solve it is with function closure (a function that keeps closure on its arguments): function buildListView() { controlList.innerHTML = ''; for (var i = 0; i &lt; gyms.length; i++) { if (gyms[i]) { clickableLink(i); } } } function clickableLink(i) { var li = document.createElement('li'); li.onclick = function () { google.maps.event.trigger(markers[i], 'click'); //&lt;&lt;--This line! }; li.innerHTML = gyms[i].name; li.style.padding = '15px'; li.style.cursor = 'pointer'; li.setAttribute(&quot;id&quot;, gyms[i].name); controlList.appendChild(li); } More on Function closure working code snippet: var madison, map, infoWindow, autocomplete, service, controlList, messageDiv; var anyInfoWindowSeenAlready = false; var markers = [], gyms = []; var hostnameRegexp = new RegExp('^https?://.+?/'); function initialize() { madison = new google.maps.LatLng(43.0667, -89.4000), mapOptions = { center: madison, zoom: 12, streetViewControl: false, mapTypeControl: false }, autocompleteOptions = { types: ['(cities)'] }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); infoWindow = new google.maps.InfoWindow({ content: document.getElementById('info-content') }); document.getElementById('info-content').style.display = 'none'; var input = document.getElementById('pac-input'); map.controls[google.maps.ControlPosition.TOP_LEFT].push(input); // Create the DIV to hold the control and call the // ListControl() constructor passing in this DIV. var listControlDiv = document.createElement('div'); var listControl = new ListControl(listControlDiv, map); map.controls[google.maps.ControlPosition.LEFT_TOP].push(listControlDiv); // Create the 'Find a gym near you!' message div and // push it onto the map canvas as a map control messageDiv = document.createElement('div'); messageDiv = buildMessageDiv(messageDiv); map.controls[google.maps.ControlPosition.TOP_CENTER].push(messageDiv); autocomplete = new g…
type: Answer
accepted answer of: http://stackoverflow.com/q/29014640
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46208198
type: Comment
type: QuestionComment
has text: Maybe but you didn't pay attention to the second part of the comment. Look at your code after here: `app.post('/InquiryDetails', function(req,res){`. Does not call your `.add` method from the other module. It just does .. what did you say was happening again?
comment on: http://stackoverflow.com/q/28978785
score: 0

http://stackoverflow.com/a/28940127
downvote count: 3
score: 6
accepted answer of: http://stackoverflow.com/q/28939882
has comment: http://stackoverflow.com/comment/122868634
upvote count: 9
answers question: http://stackoverflow.com/q/28939882
type: AcceptedAnswer
has body: You cannot actually "update" an index definition. What you need to here is "delete" the index and then "re-create" it. So use .dropIndex() first myCollection.dropIndex({ "createdAt": 1 },function(err,result) { }); Then recreate with a new interval: myCollection.ensureIndex( { "createdAt": 1 }, { "expireAfterSeconds": 60 * 10 }, function(err,result) { } ); As for when it updates, the mongod service runs at an interval every 60 seconds an event you process a delete for any items where the effective date field ( i.e "createdAt" in this example ) is within the "expiry period" from the current time of the server. So that means it does not matter if you drop the index and re-create it, as the existing server process will just run the same expiry query on each collection that has such an index defined on that interval clock.
type: Answer

umbraco7
type: Tag
tags question: http://stackoverflow.com/q/28953861
tag name: umbraco7

http://stackoverflow.com/q/29053720
score: 0
has body: I'm using a ul with several child lis for navigation with html/javascript and css. Problem is, on tapping, it selects the Menu1 text (like it would when you want to copy text), while opening the menu. Using Windows 8, ie11, on surface tablet. I don't want the text selected, how can I stop this? Page1 Page2 Page3 Menu1 Menu Item 1 Menu Item 2
answer count: 1
has comment: http://stackoverflow.com/comment/46345007
type: UnansweredQuestion
tagged with: touch
tagged with: javascript
tagged with: html-lists
type: Question
tagged with: css
has answer: http://stackoverflow.com/a/29053898
has title: Text selecting on tapping item

google-chrome-app
tags question: http://stackoverflow.com/q/28909075
type: Tag
tags question: http://stackoverflow.com/q/28990123
tags question: http://stackoverflow.com/q/28984640
tags question: http://stackoverflow.com/q/29000767
tag name: google-chrome-app

http://stackoverflow.com/a/28946302
answers question: http://stackoverflow.com/q/28946108
has body: Code has a few errors, try the following var cards = new Array(); for (var i = 0; i &lt; 11; i++) { cards[i] = new Image(); cards[i].src = "imgs/CardBack.jpg" document.theImage.src = cards[i].src; } Hope it works
score: 0
has comment: http://stackoverflow.com/comment/46146909
type: Answer

http://stackoverflow.com/comment/46326003
comment on: http://stackoverflow.com/a/29010874
type: AnswerComment
type: Comment
has text: @magnudae Thanks for your answer, but it doesn't answer my question. I know exactly what is the classical use case with flux actions and stores, but how can I prevent backend call in case I already have the data. I asked whether action can use a store on not.
score: 0

http://stackoverflow.com/a/28967169
has comment: http://stackoverflow.com/comment/46186479
has comment: http://stackoverflow.com/comment/46186164
answers question: http://stackoverflow.com/q/28967106
type: Answer
has comment: http://stackoverflow.com/comment/46186645
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46186239
has body: You can do it like this: 323 525 727 function dd01change(el) { var a = $(el).val(); alert (a); };
upvote count: 1

http://stackoverflow.com/comment/46106924
comment on: http://stackoverflow.com/q/28925259
score: 1
has text: where's your code? you need to write saveStocks.php and then we can help you. Start by searching google or whatever search engine you use for "php form handling"
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46181371
has text: yes Ranjith i need set value according to server
score: 0
comment on: http://stackoverflow.com/q/28964766
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46358866
has text: Yes but you have to call a function onclick of your button then write this code in that function.If you want i can update my answer.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29061078
type: AnswerComment

http://stackoverflow.com/q/28965594
has comment: http://stackoverflow.com/comment/46182864
accepted answer: http://stackoverflow.com/a/28965777
upvote count: 1
has title: Using RegExp to loop through arrays instead of for loops (Javascript)
favorite count: 0
has comment: http://stackoverflow.com/comment/46222745
has answer: http://stackoverflow.com/a/28965777
downvote count: 0
possible better answer: http://stackoverflow.com/a/28966225
tagged with: regex
has body: I have the below code which works. But would using RegExp be a more efficient code? (Return true if the string in the first element of the array contains the letters of the string in the second element of the array.) function mutation(arr) { var first = arr[0].split(""); var second = arr[1].split(""); var answer = false; for (var e = 0; e &lt; second.length; e++) { answer = false; for (var i = 0; i &lt; first.length; i++) { if (first[i] === second[e]) { answer = true; } } } return answer; } mutation(['hello', 'hey']);
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/46182842
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46182934
has answer: http://stackoverflow.com/a/28966225
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/a/29620026
has comment: http://stackoverflow.com/comment/71507281
score: 9
answers question: http://stackoverflow.com/q/28976460
downvote count: 0
has body: One solution is to put a key of the percentage on the element you want to update. That way when react checks to see what in the DOM has changed it sees that the key has changed and thus will rebuild the DOM for the element. See example below: render: function() { var spanPercent = (this.props.a - this.props.b)/this.props.a + '%'; var spanStyle = { width: spanPercent }; return ( ); }
type: Answer
has comment: http://stackoverflow.com/comment/50433117
upvote count: 9

http://stackoverflow.com/comment/46145318
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28945220
has text: I'm loading file from chrome extension options page (tab, locally)

http://stackoverflow.com/a/28930651
score: 1
answers question: http://stackoverflow.com/q/28930318
type: Answer
upvote count: 1
has body: Your code is working fine. You might not have included jquery library. Use this structure Section 1 Section 2 Section 3 Section 1 Section 2 Section 3
downvote count: 0

http://stackoverflow.com/q/29025112
favorite count: 0
has comment: http://stackoverflow.com/comment/47610778
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/46292835
answer count: 0
score: 1
has body: So I'm sure you've seen it before, a vendor JS file that modifies the global space and runs the instant it lands. I have a vendor JS file, that is generated via a CMS (so I can't just copy it and use it locally), that can't be accessed via CORS (so no .exec here). This vendor file runs the instant it lands and sets up it's global variables. One of the functions I need to run depends on a second global variable that may or may not be populated correctly, especially when more than one segment of code modify this variable (the basic problem with global variables). Anyway here's a rough approximation of what the vendor has given me: // I have no control over this code: (function (t) { var critter = function (options) { // Initialize with options return options; }; // I have window that's called "t" t.pollution = critter({ doSomething: function (options) { // Do some stuff with options alert(t.garbage); } }); })(window); // End of my "no control" code... The key point is that I have a global pollution variable and a function from that called doSomething(). I can't modify that code, but I would like to make the t variable inside this function NOT be global. Per the normal specs of how this should work are as follows: // Sometime later... (function () { // Per the spec, I should modify global variable 'garbage' window.garbage = 'wow this is garbage'; // Lots of potential changes could happen here, not something I would want window.pollution.doSomething({}); })(); Ideally I would like to send garbage in as a parameter, but again I can't mess with that code. So is it possible to somehow wrap up the doSomething function right before I call it and alter it's t variable? The minimal, complete and verifiable example: // I have no control over this code: (function (t) { var critter = function (options) { // Initialize with options return options; }; // I have window that's called "t" t.pollution = critter({ doSomething: function (options) { // Do some stuff with options alert(t.g…
type: Question
has title: Alter closure variables, vendor JS file automatically runs on load
tagged with: closures
tagged with: javascript
has comment: http://stackoverflow.com/comment/46371907
downvote count: 0

http://stackoverflow.com/comment/46263455
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29008618
score: 1
has text: Are you using a web server? If you want to load an external file you'll need to serve it from a web server. See [this answer](http://stackoverflow.com/questions/14721945/very-simple-tutorial-example-of-d3-js-not-working)

http://stackoverflow.com/comment/46111038
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28927548
has text: I don't think this is possible using scripts. It's more a computer/mouse settings thing.

http://stackoverflow.com/a/29014409
has body: 1 pax 2 pax Values is {{ data.person }} Here you have a JSFiddle
upvote count: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29014057
answers question: http://stackoverflow.com/q/29014057
downvote count: 0
score: 1

http://stackoverflow.com/a/39297346
has body: I made another aprouch using promises, based on previous responses, think that's more interesting. window.loadScripts = (scripts) =&gt; { return scripts.reduce((currentPromise, scriptUrl) =&gt; { return currentPromise.then(() =&gt; { return new Promise((resolve, reject) =&gt; { var script = document.createElement('script'); script.async = true; script.src = scriptUrl; script.onload = () =&gt; resolve(); document.getElementsByTagName('head')[0].appendChild(script); }); }); }, Promise.resolve()); }; Let's play var scripts = [ "app/resources/scriptDoSomething.js", "app/resources/somethingElse.js" ]; loadScripts(scripts).then(() =&gt; { alert('All scripts were loaded!'); });
type: Answer
accepted answer of: http://stackoverflow.com/q/28936138
score: 5
answers question: http://stackoverflow.com/q/28936138
upvote count: 5
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29012922
accepted answer: http://stackoverflow.com/a/41286377
has answer: http://stackoverflow.com/a/29019038
favorite count: 0
answer count: 5
has comment: http://stackoverflow.com/comment/46271124
has answer: http://stackoverflow.com/a/41021953
has title: How to cancel a debounced function after it is called and before it executes?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46271275
tagged with: underscore.js
downvote count: 1
has answer: http://stackoverflow.com/a/41286377
type: Question
linked to: http://stackoverflow.com/q/7026000
has body: I create a debounced version of a function with underscore: var debouncedThing = _.debounce(thing, 1000); Once debouncedThing is called... debouncedThing(); ...is there any way to cancel it, during the wait period before it actually executes?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/74738879
upvote count: 70
has answer: http://stackoverflow.com/a/74738879
score: 69
has comment: http://stackoverflow.com/comment/46271183
has answer: http://stackoverflow.com/a/56012999

http://stackoverflow.com/a/28942367
score: 3
type: Answer
accepted answer of: http://stackoverflow.com/q/28942072
upvote count: 3
has body: If you want to set just one environment variable, you could use the export command right before the forever command. @reboot export NODE_ENV=production; /usr/local/bin/forever start /path/to/my/app/index.js For more than one variable Sukima's method is better.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46139369
answers question: http://stackoverflow.com/q/28942072

http://stackoverflow.com/a/29006058
answers question: http://stackoverflow.com/q/29005973
accepted answer of: http://stackoverflow.com/q/29005973
has comment: http://stackoverflow.com/comment/46258350
score: 0
type: AcceptedAnswer
has body: DEMO $( "div.data-item").each(function(){ $(this).replaceWith($(this).data('variable')); }) UPD: You can use function as argument to replaceWith (thx @Barmar) $('div.data-item').replaceWith(function() { return $(this).data('variable'); });
type: Answer

http://stackoverflow.com/comment/46241967
type: AnswerComment
score: 0
type: Comment
has text: I do have 2 IDs of the same value. I swear I've done it before, will it work with classes? But for the record, it isn't changing the first one either.
comment on: http://stackoverflow.com/a/28996882

http://stackoverflow.com/comment/46109750
comment on: http://stackoverflow.com/a/28921947
type: AnswerComment
score: 0
type: Comment
has text: It's not to much, it's the exact calculated ratio. look at the code.

http://stackoverflow.com/comment/46348955
type: QuestionComment
comment on: http://stackoverflow.com/q/29043148
score: 0
has text: I don't think JSON permits duplicate key names in an object, so `index: { a_bin: 'A' + i },index: { b_bin: 'B' + i },` isn't valid, and might be interpreted as the second value for `index` superseding the first.
type: Comment

http://stackoverflow.com/comment/46080580
has text: Also please note I omitted other options from the ListView instantiation example above as I presume them to be irrelevant to the question, but I am using layout of ListLayout, selectionMode of none, and a static itemDataSource.
comment on: http://stackoverflow.com/q/28910844
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46127345
type: Comment
comment on: http://stackoverflow.com/q/28935170
has text: @dandavis But if the file has multiple scripts and the error is not in the first script, the line numbers are meaningless.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28945724
tagged with: google-maps
downvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28945862
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/46145502
linked to: http://stackoverflow.com/q/4937517
has title: Google Maps API - Browser always asking for location
has comment: http://stackoverflow.com/comment/46145816
favorite count: 0
tagged with: angularjs
upvote count: 2
has body: We are implementing a website using AngularJS and Google Maps API. The user can enter a keyword and is then redirected to a new page, which contains a map with several markers (representing the results). On this result page the browser always asks for the user location. When the user selects "deny", then the map jumps to the position 0,0 (somewhere in the sea). Is it possible to prevent the browser location check? If not, is there an event that can be catched, so I can change where the map jumps to? Airbnb.com uses Google Maps as well, and there the browser never asks for the user location. Any advices?
type: UnansweredQuestion
score: 2
tagged with: geolocation
type: Question

http://stackoverflow.com/comment/46352844
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29038981
has text: @Dallin Yes, it's quite clear that you want to modify the array. It's also quite clear that you _can't_ modify the array. What's not clear is _why_ you want to want to modify the array, and now you've given us a new mystery, which is in what way "splice = less code". Could you give us a concrete example (with code) of how you intend to use splice and how it is useful for the task at hand (you still have yet to explain this)? Perhaps you have some insight to share that would be beneficial to others. Or perhaps this is just an [XY problem](http://bit.ly/1BAmifZ).

http://stackoverflow.com/a/29048442
type: Answer
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29032059
has body: As said in comments, trying to manually force the creation of an array with data is a bad approach. Because you use MySQL, you can try something like that: // Creamos una array vacía $myDataPoints = array(); // Usa la siguiente variable $conexion... $conexion = mysqli_connect("tuIP","tuUser","tuPassword","tuDB"); // o adapta la siguiente línea con la variable previamente creada por ti $rawData = mysqli_query($conexion, "SELECT * FROM tablaConDatos"); // Ejecutamos el Loop para cada línea de resultados de la consulta while($row = mysqli_fetch_array($rawData)) { /* Calculamos la fecha. En tu ejemplo, parece que sólo quieres variar la hora sustrayendo 1 hora a cada número de línea. Este método sólo funciona si tu tabla de datos tiene menos de 25 líneas */ $fecha = date(DATE_ATOM, mktime($row - 1, 0, 0, 1, 1, 2012)); // Creamos el objeto... $point = array("x" =&gt; $fecha , "y" =&gt; $row['invertir']); // ... y lo mandamos al array array_push($myDataPoints, $point); echo 'var myDataPoints = '.json_encode($myDataPoints).';'; } This approach generates an JSON array (myDataPoints) that you can easily use in a normal canvasjs call: var chart = new CanvasJS.Chart("chartContainer", { data: [ { dataPoints: myDataPoints } ] });

http://stackoverflow.com/a/32682875
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29036383
downvote count: 0
type: Answer
has body: The new version (0.12.5) are not using this settings anymore. You need to set the url inside your controller $auth.login({ Email: $scope.email, Password: $scope.password }) .then(function() { $location.path('your-new-route'); }) .catch(function (response, status, headers) { console.log(response); $scope.error = JSON.parse(response.data); });
has comment: http://stackoverflow.com/comment/82633228

http://stackoverflow.com/q/28971942
has title: Change strokeDashoffset of a SVG line in a for loop
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28983680
accepted answer: http://stackoverflow.com/a/28983680
type: Question
has body: I'm trying to animate a line expanding. I already have it in css, but I need to do it in javaScript, because that is the only way I can get the lenght of the path, which I need. I think I'm very close but it's not working! Any ideas? Following is my code. As you can see I get the length of the path, and give it a strokeDashArray of that length. That means the line will be dashed, but the dash is filling the entire line. The trick is to decrease the strokeDashoffset value, because that determines where the dash starts. So if that also starts at pathLength, the line will be completely invisible, and decreasing the value will reveal the path. I know this is possible btw :) As said, I already have it working in css. var element = document.getElementById("animpath"); var pathLength = element.getTotalLength(); element.style.strokeDasharray = pathLength; element.style.strokeDashoffset = pathLength; function animateRoute (e) { e.style.strokeDashoffset = e.style.strokeDashoffset - 100; } for (i = 0; i &lt; 100; i++) { animateRoute(element); } Thanks in advance!
tagged with: javascript
score: 12
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
upvote count: 12
tagged with: http://stackoverflow.com/tag/svg
tagged with: animation

http://stackoverflow.com/q/28950091
has comment: http://stackoverflow.com/comment/46154242
has comment: http://stackoverflow.com/comment/46154032
has body: I have a strange scenario. I have a combo box that can have multiple selections. My data may contain commas. I'm using Infragistics controls so i'm not in control of the separator. Now, my combo box values are "A*A" "A%A" and "A,A". If the user selects all 3 values, the result looks like this: var arrValues = combo.igCombo('values'); //this retrieves the values //arrValues contains this now: [A*A,A&amp;A,A,A] I'm parsing the values by a comma and you guessed it, i have an array of 4: array[0] = 'A*A' array[1] = 'A&amp;A' array[2] = 'A' //the parse split "A,A" into 2 values array[3] = 'A' array[2] should be array[2] = 'A,A' and array[3] shouldn't exist. I have a function i thought would work but it doesn't. function getComboBoxValues(combo, delim, index) { var arrValues = combo.igCombo('values'); var values = ""; $.each(arrValues, function (i, o) { values += ((delim) ? o.split(delim)[index || 0] : o) + ','; } ); return values; } I call it like this: var array = getComboBoxValues($('#mycombobox'), ',', 0); How can i parse my string: [A*A,A&amp;A,A,A] into an array so it will have only 3 values array[0] = 'A*A' array[1] = 'A&amp;A' array[2] = 'A,A' Keep in mind, this may not be the order in which the string will be, so counting commas won't work. My server side code is C#, so if this can be achieved in C#, please let me know. Thanks
has comment: http://stackoverflow.com/comment/46154154
has answer: http://stackoverflow.com/a/28950313
has title: separating an array with commas, javascript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46154292
has comment: http://stackoverflow.com/comment/46154200
possible better answer: http://stackoverflow.com/a/28950429
type: Question
accepted answer: http://stackoverflow.com/a/28950313
tagged with: c#
has answer: http://stackoverflow.com/a/28950429
has comment: http://stackoverflow.com/comment/46154170
tagged with: arrays
has comment: http://stackoverflow.com/comment/46154290
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/a/28983693
type: AcceptedAnswer
downvote count: 0
has body: detailed configuration given in angularjs for multiple environments. Angularjs config
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/46217896
score: 1
answers question: http://stackoverflow.com/q/28982587
accepted answer of: http://stackoverflow.com/q/28982587

http://stackoverflow.com/comment/46249569
comment on: http://stackoverflow.com/q/29000772
type: QuestionComment
score: 0
has text: By doing it programmatically, I'm doing my research before I make a callback feature request or pull. If it's a non-blocking function call (since it dives down to some system level functions), then there might not really be much of a need for callbacks.
type: Comment

http://stackoverflow.com/comment/67071491
type: Comment
has text: Thanks @kavare....There is no explanation available on the angular material web site as to what does layout-fill , layout-wrap does...or how does it translate to code..So this is helpful
comment on: http://stackoverflow.com/a/38898431
score: 0
type: AnswerComment

http://stackoverflow.com/q/28969814
accepted answer: http://stackoverflow.com/a/28970336
has title: Trouble using mouseover on ad in Chrome extension
tagged with: javascript
tagged with: jquery
type: Question
tagged with: google-chrome-extension
tagged with: ads
score: 0
has answer: http://stackoverflow.com/a/28970336
answer count: 1
has body: As part of a Chrome extension, I'm trying to detect when you hover on an ad. Right now, I'm only testing on the NYT frontpage. The problem area of the content script is as follows: $(document).ready(function (){ setTimeout(function() { console.log("starting..."); console.log(document.querySelectorAll("iframe")); var frames = $("iframe").contents().find(".ad-frame.frame-for-homepage"); console.log(frames); frames.on("mouseover", function(event){ console.log("on ad"); }); }, 10000); }); The setTimeout function is a hack specific to getting the right iframes on the page. The console.log shows that it picks out the correct iframes containing the ads, but the mouseover event doesn't fire. It actually appears that it won't run anything past the querySelectorAll line, because no further console.logs appear. If I move the mouseover outside of the setTimeout function, it fires on mouseover of any element on the page. I've hit a bit of a wall with this so any help is appreciated. Thanks
tagged with: mouseevent
type: AnsweredQuestion

http://stackoverflow.com/comment/46209948
type: QuestionComment
comment on: http://stackoverflow.com/q/28979912
has text: Please indent your code and format it
score: 0
type: Comment

http://stackoverflow.com/comment/46199774
type: QuestionComment
has text: Slightly related http://stackoverflow.com/questions/22521329/nodejs-sockets-sometimes-working but not duplicate
comment on: http://stackoverflow.com/q/28915677
score: 0
type: Comment

http://stackoverflow.com/comment/46118339
type: Comment
comment on: http://stackoverflow.com/q/28931318
score: 0
has text: Post the source code please
type: QuestionComment

http://stackoverflow.com/comment/46360142
has text: Your assumptions are not correct. JavaScript numbers are 64-bit floating point numbers, and that is that.
score: 2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29061937

http://stackoverflow.com/comment/46349168
has text: Well, I did some investigation and then figured I'd answer the question I asked. The site lets you do that, did I do something wrong?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29055969
type: AnswerComment

http://stackoverflow.com/q/28934934
has comment: http://stackoverflow.com/comment/46125483
answer count: 2
downvote count: 2
has title: _.each find value in array return true or false. using underscore js
tagged with: underscore.js
upvote count: 1
has answer: http://stackoverflow.com/a/28934950
has body: //find value in array using function checkValue using underscoreJS _.each. //return true, else false. var helloArr = ['bonjour', 'hello', 'hola']; var checkValue = function(arg) { _.each(helloArr, function(helloArr, index) { if (arg[index] === index) { return true; } return false; }); }; alert(checkValue("hola"));
tagged with: arrays
tagged with: javascript
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/30447784
has comment: http://stackoverflow.com/comment/46125817
accepted answer: http://stackoverflow.com/a/28934950
has answer: http://stackoverflow.com/a/30447784
favorite count: 0
score: -1
has comment: http://stackoverflow.com/comment/46125545
type: Question

http://stackoverflow.com/comment/46338819
type: Comment
has text: Well, then the whole component has this template. I want some shared code inside the popup and the popup's contents should come from a template.
comment on: http://stackoverflow.com/a/29049351
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46322003
type: Comment
comment on: http://stackoverflow.com/a/29039650
has text: Can you post your controller?
score: 0
type: AnswerComment

http://stackoverflow.com/a/29016264
has body: You can use simple regex to extract Google search results. var regex = /&lt;h3 class=\"r\"&gt;([\s\S]*?)&lt;\/h3&gt;/gi; var items = response.getContentText().match(regex); Alternatively, you can use the ImportXML function in sheets. =IMPORTXML(GOOGLE_URL, "//h3[@class='r']") See: Scrape Google Search with Sheets
has comment: http://stackoverflow.com/comment/54469539
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29015427

http://stackoverflow.com/comment/46283793
type: QuestionComment
has text: Well if you are not reusing the url for anything other than that link you might consider having the whole anchor tag being sent e.g. `"url": "<a href..."`?
comment on: http://stackoverflow.com/q/29019925
score: 0
type: Comment

http://stackoverflow.com/q/28956357
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46166875
has answer: http://stackoverflow.com/a/30652424
has body: Can someone help me understand why my ng-click doesn't update the class? heading.onClick() updates the controller's isOpen attribute. When it is false, the class does not remove the collapsed attribute. .... (this is inside a controller aliased `heading`) &lt;div ng-class="{'collapsed': !heading.isOpen}" ng-click="heading.onClick()"&gt;&lt;/div&gt; directive: ... templateUrl: '/that/code/above', controllerAs: 'heading', controller: function(){ var self = this; self.isOpen = false; self.onClick = function(){ self.isOpen = !self.isOpen; }; }
has comment: http://stackoverflow.com/comment/46168679
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46165985
has comment: http://stackoverflow.com/comment/46165883
score: 0
has comment: http://stackoverflow.com/comment/46166094
answer count: 1
has title: Angular ng-class isn't updating
has comment: http://stackoverflow.com/comment/46166142

http://stackoverflow.com/q/28988717
answer count: 1
has answer: http://stackoverflow.com/a/28988929
tagged with: twitter-bootstrap
tagged with: php
type: UnansweredQuestion
type: Question
tagged with: javascript
has title: How to use focus bootstrap popover?
score: 0
has body: I have a popover like this. And i need it to work as focus, the only thing when i click on quantity field it disappears, because the link is not focused. Here is the code: var popover = $("[data-toggle=popover]").popover({ trigger : 'focus', placement : 'right', container: 'body', html: 'true' }).on('show.bs.popover', function() { product_id = $(this).attr('data-product-id'); popover = $(this); $.ajax({ url : '/product/short_description/' + product_id, success : function(html) { popover_id = popover.attr('aria-describedby'); $('#' + popover_id + ' .popover-content').html(html); } }); });

http://stackoverflow.com/comment/46303546
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29030685
has text: i edit the question please read the last part

http://stackoverflow.com/a/28978592
has body: Because mongoose promises do not have a .catch or .fail (Note that q will remove these from their library as well) you can not return a failing mongoose promise on a q stack that ends with either .catch or .fail without turning it into a q promise first. Here is how I did that (this has been answered elsewhere on stack as well): function something(){ return q()//make sure this function returns a promise instead of an unhandled error .then(function(){ //do some stuff }) .then(function(){ return someMongoosePromise .then(function resolve(res){//make sure to return a q promise if this function is called in a stack that has //.then.then.then(function(){return something();}).fail(... return q.resolve(res); },function reject(err){ return q.reject(err); } ); }); } Second problem I encountered was that Model.create([doc1,doc2]) resolves the promise with multiple arguments but when going through q q only calls resolve with one argument: q() .then(function(){ return Model.create([doc1,doc2]); }) .then(function(docs){ docs===doc1;//David Copperfield took doc2 }); the solution is about the same as the first one: q() .then(function(){ return Model.create([doc1,doc2]) .then(function(){//let mongoose resolve the promise var ret=[],i=arguments.length; while(--i&gt;-1){ ret.push(arguments[i]; } return q.resolve(ret); }); }) .then(function(docs){ docs===[doc1,doc2]; });
type: Answer
answers question: http://stackoverflow.com/q/28978485
has comment: http://stackoverflow.com/comment/46220563
score: 0
has comment: http://stackoverflow.com/comment/46219337
has comment: http://stackoverflow.com/comment/46220241

http://stackoverflow.com/q/29030173
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29031572
score: 2
has answer: http://stackoverflow.com/a/29031327
upvote count: 2
has title: Code seperation in AngularJS
type: Question
has body: I'm quite new to AngularJS so please bear that in mind when reading this question... I have some functions that I would like to make globally available to different modules within my website, plan is to have pages performing their own functions in a single page app style (so a user list / create / modify would be one page, and a product list / create / modify would be another). I would like to have some shared logic, say utility functions, and also user authorisation that can be shared between the different page modules. This leads to my question. Assuming I have all the account functions encapsulated within a service (app.factory('account, etc etc...') for example) and separated into it's own JS file, is it better to place it within it's own module and using dependency injection like so: var accountMod = angular.module('accountModule', ['dependencies']); accountMod.factory('account', ['dependencies', function (...) { }]); Or just assume the name of the app variable will always be app and express it like so: app.factory('account', ['dependencies', function (...) { }]); Functionally both of these work, but I am trying to use best practices. The second option seems limited, I have never been keen on assuming variable are the same name throughout, for me the dependency injection method seems better but I have seen many examples of both styles out there! Any help is much appreciated!
has comment: http://stackoverflow.com/comment/46301645
has answer: http://stackoverflow.com/a/29030842
has comment: http://stackoverflow.com/comment/46301717
answer count: 3
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/a/28997864
answers question: http://stackoverflow.com/q/28995270
type: Answer
accepted answer of: http://stackoverflow.com/q/28995270
has body: Update This is how your bloodhound should look like var dataSource = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('item'), queryTokenizer: Bloodhound.tokenizers.whitespace, prefetch: { url: "http://jsbin.com/nixalofara/1.json", filter: function (data) { return $.map(data['num'], function (item) { return { item: item }; }); } } }); And typeahead like this $('.typeahead').typeahead({ highlight: true }, { displayKey: 'item', source: dataSource.ttAdapter() }); Here is a demo `var data = {"num": ["one", "two"]};` This is how your bloodhound should look like for data like above var bloodhound = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), queryTokenizer: Bloodhound.tokenizers.whitespace, local: $.map(data['num'], function(item) { return { value: item }; }) }); And typeahead like this $('.typeahead').typeahead({ highlight: true }, { source: bloodhound.ttAdapter() }); Hope this helps.
score: 2
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/46252497
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46245633
has comment: http://stackoverflow.com/comment/46252979

http://stackoverflow.com/comment/46210391
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28967647
has text: Not sure you can. You can install the Chrome Google Analytics Debugger extension and make sure that the data is sent, but you can't look at it in the reports until it's processed.
type: Comment

http://stackoverflow.com/q/28916008
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: regex
linked to: http://stackoverflow.com/q/7837456
score: 2
type: AnsweredQuestion
upvote count: 2
has title: Using JS .match() to extract number from string, then use the result to test equality
has answer: http://stackoverflow.com/a/28916026
tagged with: match
type: Question
has body: Hope someone can help as I quite new to JS. I need to extract a number from 2 strings then test the result for equality against each other. For example var test1 = "7D" var test2 = "7H" To extract the numbers I'm using the following code, test1.match(/\d+/) = result in the console is "7", I do the same for the test2 variable and this results in 7 also. However when I test for equality using test1.match(/\d+/) === test2.match(/\d+/) it evaluates to false. I'm trying to use this condition in an if statement but cannot get it to work, e.g. if(test1.match(/\d+/) === test2.match(/\d+/)){run some code} Am I doing something wrong or is there a better way to acheive this? Thanks,
accepted answer: http://stackoverflow.com/a/28916026

http://stackoverflow.com/comment/46297995
has text: go to this link http://jquery.com/download/ and download jQuery Migrate Plugin . then check
comment on: http://stackoverflow.com/q/29028177
score: 0
type: Comment
type: QuestionComment

chrome-app-developer-tool
tag name: chrome-app-developer-tool
type: Tag
tags question: http://stackoverflow.com/q/28999240

http://stackoverflow.com/a/28949474
answers question: http://stackoverflow.com/q/28939647
has body: You can use the ngClass directive for that (documentation of ngClass) If you want to add, let's say, green borders to your input element when the form is in the editable state, you will use ngClass as the following : &lt;input type="text" ng-class="{'greenBorder': editable}" ng-model="name" /&gt; This will add the greenBorder css class only if the boolean variable editable is truthy. I simply defined greenBorder for the example as follows : .greenBorder { border: 1px solid green; } Note that ngClass will not remove your existing classes, if any, added with class="...". It will just append or not the class greenBorder to them. Therefore, there is absolutely no problem if you have a form-control or any other class added statically. You can see a demo of that in action
type: Answer
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/a/29019049
answers question: http://stackoverflow.com/q/29018618
accepted answer of: http://stackoverflow.com/q/29018618
score: 0
type: AcceptedAnswer
type: Answer
has body: What type of script is this in? It looks like you are loading the record that the script is deployed on. This is completely unnecessary, and you can just use nlapi* functions instead of record.* functions. Loading an entire record is one of the more expensive operations you can do. Delete your recordid and record variables Replace your record.getLineItemCount calls with nlapiGetLineItemCount

http://stackoverflow.com/comment/46309319
comment on: http://stackoverflow.com/a/29034242
has text: I love to avoid regex if they don't add something but unfortunately converting to lower case is **not culture safe** (of course it may work in **this case** if OP has to compare only us ASCII characters). In your example `"I".toLowerCase() != "i".toLowerCase()` for Turkish. It doesn't handle all locale related issues (eszett in German, for example) but a little bit better is to use `toLocaleLowerCase()`.
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/q/28937069
tagged with: angularjs
has answer: http://stackoverflow.com/a/28938339
answer count: 5
has title: $ and comma should allow on text box but should not save them
has comment: http://stackoverflow.com/comment/46129452
has answer: http://stackoverflow.com/a/28937130
has answer: http://stackoverflow.com/a/28937189
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28937180
type: Question
has body: I have below mentioned requirement. On the text box need to allow any characters like "$" and , but while saving need to strip them and save only numbers and a "." eg: if user enters $14,500.50 save 14500.50 do not show an error in case "$" or "," is entered. How can I do that ? Any help would be highly appreciated. Note : At this moment text box is only allowed numeric characters.
tagged with: c#
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/46129343
has comment: http://stackoverflow.com/comment/46129161
possible better answer: http://stackoverflow.com/a/28937189
has comment: http://stackoverflow.com/comment/46129189
downvote count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28937172
accepted answer: http://stackoverflow.com/a/28937130
has comment: http://stackoverflow.com/comment/46129267
linked to: http://stackoverflow.com/q/16935095
favorite count: 0

http://stackoverflow.com/a/28915261
has comment: http://stackoverflow.com/comment/46088661
has body: No. Cookies are not at all safe and should either contain least amount of data or you should encrypt them very well with salts. One thing to say, anything you send to client , POST , GET or Cookies . Everything can be modified . Yet cookies modification is not know to many. Most people think of eatable cookies rather. So if your data is not important use cookies if you wish. If data matters, it is login info or such , use multiple highly encoded or more precisly hashed . And if it doesn't matter then cookies are no trouble.
type: Answer
answers question: http://stackoverflow.com/q/28915179
score: 0

http://stackoverflow.com/q/28958975
has title: Declaring global variables with a function in python
possible better answer: http://stackoverflow.com/a/28959058
tagged with: global-variables
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28961456
score: 0
has answer: http://stackoverflow.com/a/28959058
answer count: 3
has answer: http://stackoverflow.com/a/28961440
has body: This piece of JavaScript code works well. My issue isn't with fixing the code itself, rather how I can mimic this in Python. function setupSomeGlobals() { // Local variable that ends up within closure var num = 666; // Store some references to functions as global variables gAlertNumber = function() { alert(num); } gIncreaseNumber = function() { num++; } gSetNumber = function(x) { num = x; } } When setupSomeGlobals() is called it declares new functions to be used globally. Could this be mimicked in python somehow? I can't figure out how. Python functions don't really seem to run like JavaScript ones, since anything global needs to be returned somehow.
has answer: http://stackoverflow.com/a/28961456
tagged with: python
type: AnsweredQuestion

http://stackoverflow.com/comment/46252005
score: 0
type: AnswerComment
type: Comment
has text: During android development we use execSQL.http://stackoverflow.com/questions/13893473/how-to-create-table-using-sqlite-database-in-android or http://www.java2s.com/Code/Android/Database/Createtableinsertrecorddeleterecordsquerytableremovetable.htm
comment on: http://stackoverflow.com/a/29002123

http://stackoverflow.com/comment/64261893
score: 1
type: AnswerComment
has text: it probably won't perform equally well because bitmapdata uses another canvas in the background and that means that in #2 you're ~2 times slower.
type: Comment
comment on: http://stackoverflow.com/a/29509820

http://stackoverflow.com/comment/46154986
type: Comment
type: QuestionComment
has text: I know its wrong but I was expecting it access the key for `[person.mother]` and then get the .born value for that respective mother. I see now that I wouldn't necessarily be able access the values that way and I would need to go through the byName object to get the born year. Thanks for the help!!!
comment on: http://stackoverflow.com/q/28906775
score: 0

http://stackoverflow.com/comment/46283831
type: QuestionComment
has text: possible duplicate of [Format number string using commas](http://stackoverflow.com/questions/10810497/format-number-string-using-commas)
score: 2
comment on: http://stackoverflow.com/q/29019992
type: Comment

http://stackoverflow.com/comment/46167395
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28957018
has text: the suggestion you made in your comment about using `vm.search = {}` instead of `vm.search = []` seems logical. Did you try it?
score: 0

http://stackoverflow.com/a/28936382
score: 0
answers question: http://stackoverflow.com/q/28935516
type: Answer
has body: In my opinion, it should be: { "kay1":"value1", "key2":"value2", "key3":["value31", "value32", "value33"] }

variables
tag name: variables
tags question: http://stackoverflow.com/q/29001860
tags question: http://stackoverflow.com/q/28921254
tags question: http://stackoverflow.com/q/29053798
tags question: http://stackoverflow.com/q/28918404
tags question: http://stackoverflow.com/q/28989222
tags question: http://stackoverflow.com/q/28912090
tags question: http://stackoverflow.com/q/28990620
tags question: http://stackoverflow.com/q/28913748
tags question: http://stackoverflow.com/q/28925142
type: Tag
tags question: http://stackoverflow.com/q/28907256
tags question: http://stackoverflow.com/q/28988988
tags question: http://stackoverflow.com/q/28963732
tags question: http://stackoverflow.com/q/29001455
tags question: http://stackoverflow.com/q/28929326
tags question: http://stackoverflow.com/q/28917665
tags question: http://stackoverflow.com/q/28907470
tags question: http://stackoverflow.com/q/28988027
tags question: http://stackoverflow.com/q/28934787

http://stackoverflow.com/a/28972798
has body: It looks like those should be the names of two functions you define, a callback to be run in case of success, and one for in case of error.
type: Answer
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28972758

http://stackoverflow.com/a/28945379
downvote count: 0
has comment: http://stackoverflow.com/comment/46146548
has body: You're not declaring your variables with var autoSlide = setInterval(cycle(), 3000); you are passing the return value of the function to the interval, whereas you want a function reference. autoSlide = setInterval(cycle, 3000); or autoSlide = setInterval(function() { cycle() }, 3000);
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/46144940
answers question: http://stackoverflow.com/q/28945296
has comment: http://stackoverflow.com/comment/46145143

http://stackoverflow.com/comment/46301566
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29028250
has text: Insert it into a CSS file and link that CSS file onto the html page that the jQuery script is located in. Here is an example: [http://www.w3schools.com/tags/tag_link.asp](http://www.w3schools.com/tags/tag_link.asp)
type: AnswerComment

http://stackoverflow.com/comment/46090007
type: QuestionComment
comment on: http://stackoverflow.com/q/28915565
has text: do you try with my answer?
score: 0
type: Comment

http://stackoverflow.com/q/28977701
has comment: http://stackoverflow.com/comment/46206558
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46206426
type: Question
has comment: http://stackoverflow.com/comment/46206622
has comment: http://stackoverflow.com/comment/46206308
has answer: http://stackoverflow.com/a/28978161
tagged with: javascript
has title: Jquery - if condition true, loop through selector and do something
tagged with: jquery
has answer: http://stackoverflow.com/a/28977815
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/28977821
has body: I'm trying to get this piece of code to work: HTML: &lt;div class="content-block blog-post clearfix zoomIn animated" style="position: absolute; left: 0px; top: 0px;"&gt; &lt;div class="content-block blog-post clearfix zoomIn animated" style="position: absolute; left: 451px; top: 0px;"&gt; &lt;div class="content-block blog-post clearfix zoomIn animated" style="position: absolute; left: 0px; top: 466px;"&gt; &lt;div class="content-block blog-post clearfix zoomIn animated" style="position: absolute; left: 451px; top: 476px;"&gt; Jquery: var a = $(".category-susans-personal-blog .archive_page .wpb_thumbnails .blog-post").css("position") == "absolute" &amp;&amp; $(".category-susans-personal-blog .archive_page .wpb_thumbnails .blog-post").css("left") == "0px"; var b = true; var c = a &amp;&amp; b; $(".category-susans-personal-blog .archive_page .wpb_thumbnails .blog-post").each(function(i, obj) { if(c){ $(this).addClass("left"); } else { $(this).addClass("right"); } }); What I'm trying to do is: if .blog-post has position:absolute;left:0, add the class .left else .right. Below is the html output of the current javascript: &lt;div class="content-block blog-post clearfix zoomIn animated left" style="position: absolute; left: 0px; top: 0px;"&gt; &lt;div class="content-block blog-post clearfix zoomIn animated left" style="position: absolute; left: 451px; top: 0px;"&gt; Thanks!
has answer: http://stackoverflow.com/a/28977821
possible better answer: http://stackoverflow.com/a/28977815

http://stackoverflow.com/comment/46336509
has text: No, still nothing is happening :(
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29048330

http://stackoverflow.com/q/29008914
has answer: http://stackoverflow.com/a/29026812
has answer: http://stackoverflow.com/a/57495523
type: Question
type: AnsweredQuestion
tagged with: quill
has answer: http://stackoverflow.com/a/33349263
tagged with: richtext
tagged with: rte
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/40455795
favorite count: 0
upvote count: 28
has title: How to add image in Quill JS?
accepted answer: http://stackoverflow.com/a/40455795
has body: I can't figure out how to get images to work like in the example on http://quilljs.com/. I tried adding &lt;span title="Image" class="ql-format-button ql-image"&gt;&lt;/span&gt; to the toolbar, which adds the button, but clicking on the button does nothing and I can't find anything in the documentation. Any suggestion?
answer count: 4
score: 28
has comment: http://stackoverflow.com/comment/105596205
possible better answer: http://stackoverflow.com/a/29026812

http://stackoverflow.com/q/29055824
has title: Is there a standard way of programming in HTML5/js/PHP/CSS to create reusable objects?
score: 1
tagged with: css
possible better answer: http://stackoverflow.com/a/29055909
upvote count: 1
tagged with: php
has body: I have created (in my free time) a html page that uses PHP to create my dynamic object. This page calls my javascript to receive input from the user with AJAX. My object uses the AJAX for input (PHP does a $_GET) and my object will then open a connection to my PDO mySQL database perform a query and receive the detail. With the detail it displays my object and echos HTML5 and I use CSS to do some nice features. It is working fine. I've learnt so much (CSS is wonderful), but compared to other programming languages, this is very similar to learn, yet sooo different! I find it is different in the way that... for anything I want to do, there are always many many different ways of doing it. Due to this being a group of languages functioning together (PHP, javascript, CSS3, and HTML5). I've somehow avoided jQuery for the moment, as I'm learning and preferred to do everything the hard way. However I have noticed that a lot of these plugins, like for a barchart for example is created in javascript and given the data there too in the form of an array. Now I want a second page that will do the same as the first, but access different data and possibly do different things, but it will be a very similar display. So I want to be able to use my object again and just to give it different parameters, different inputs etc... as if I have just used a plugin. So now I'm thinking of instantiating this in js and feeding the data in from there instead. I just want some good guidance as I'm starting out and the more I learn the more vast this becomes :) So this is where my question is: Q. Is there a standard way of programming in HTML5/js/PHP/CSS to create reusable objects? References and expertise/experience is welcome, I don't want to start a debate, please. I'd like a standard to follow.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29056258
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: github
favorite count: 0
accepted answer: http://stackoverflow.com/a/29056258
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29055909

http://stackoverflow.com/a/29039278
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29038981
has body: The elements property of forms is an HTMLFormControlsCollection, which is a "live" collection, and thus read-only. You can copy it to an array first if you want to modify it: var elem = document.getElementById('display').elements; var elemgroup = Array.prototype.slice.call(elem); elemgroup.splice(0, 1); // or whatever changes you want to make
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29038981

http://stackoverflow.com/comment/46106888
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28925256
has text: It's not that the element is returned once the DOM tree is loaded. jQuery simply searches for the element on each call to `HangUp()`. While this would probably work, it seems OP was trying to get the element once and hold a reference to it.
score: 0

http://stackoverflow.com/comment/46244029
score: 0
type: Comment
type: QuestionComment
has text: Look at the `Enumerator` object.
comment on: http://stackoverflow.com/q/28997975

http://stackoverflow.com/q/28935052
score: 1
has comment: http://stackoverflow.com/comment/46167684
has answer: http://stackoverflow.com/a/28935113
accepted answer: http://stackoverflow.com/a/28935113
answer count: 2
downvote count: 0
tagged with: javascript
has body: I have a tag and I want it to change the value of a hidden input when an option is selected. What I thought was to use this: Option 1 is selected ... And then this function stuff() { document.getElementsByName("asdf").value=opt1slct; } Of course, it doesn't work. What can I do to get a similar effect?
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46125788
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28935867
has comment: http://stackoverflow.com/comment/46125719
upvote count: 1
has title: OnSelect equivalent for ?
type: Question
possible better answer: http://stackoverflow.com/a/28935867

http://stackoverflow.com/comment/46186073
score: 0
type: Comment
type: QuestionComment
has text: you can simplify it slightly, but not too much. i would make the repetitive parts into stand-alone functions, and maybe condense the floating functions into object members, but you still need the function(){} overhead and the setTimeout interval each spec...
comment on: http://stackoverflow.com/q/28966798

http://stackoverflow.com/comment/46340201
type: Comment
has text: Can you give us more info about your db structure? Is this date info stored together with posts, how do you match them?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29043699

http://stackoverflow.com/comment/46262291
type: AnswerComment
comment on: http://stackoverflow.com/a/29008381
type: Comment
has text: I guess you need to mark active menu item. Simple code sample: ` menuItem.name ` Where `menuItems` - array of items with {id:...,name:...} and `currentMenuId` is your current menu item id
score: 0

http://stackoverflow.com/q/29010258
score: 2
type: AnsweredQuestion
type: Question
has body: Simple use case: main.js var tabs = require('sdk/tabs'); tabs.open({ url: 'http://www.openstreetmap.org', onOpen: function (tab) { tab.attach({ contentScriptFile: './content.js' }); } }); content.js console.log("foo"); setInterval(function() { console.log("bar"); }, 1000); output foo I get the same problem with event handlers, which is more problematic…
tagged with: firefox
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29010879
tagged with: firefox-addon
answer count: 1
favorite count: 0
upvote count: 2
has title: setInterval not called in tab content-script
linked to: http://stackoverflow.com/q/5248035
accepted answer: http://stackoverflow.com/a/29010879
tagged with: firefox-addon-sdk

http://stackoverflow.com/comment/46136833
comment on: http://stackoverflow.com/a/28940874
type: AnswerComment
score: 0
type: Comment
has text: well I cant.. when I change it and start to draw on it, everything looks distorted..

http://stackoverflow.com/q/29012733
tagged with: highcharts
tagged with: javascript
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/29013115
has answer: http://stackoverflow.com/a/29013115
accepted answer: http://stackoverflow.com/a/29012823
has title: To add zAxis dynamically, but doesn't work... Highcharts
type: AnsweredQuestion
has body: i want do add min and max of zAxis with a function, but doesn't work, and i don't understand because it doesn't work :( this is the function: function assez(){ var arr=[]; arr.push({ min: -39, max: -35 }); return arr; } this zAxis: zAxis: assez(), and this jsfiddle http://jsfiddle.net/k0ahsch6/ Where is the problem?
has answer: http://stackoverflow.com/a/29012823
type: Question

http://stackoverflow.com/comment/46304111
comment on: http://stackoverflow.com/q/29030944
type: Comment
type: QuestionComment
score: 0
has text: You could also use [localStorage](http://www.w3schools.com/html/html5_webstorage.asp), I think. I added a - not particular aesthetic - solution to a comparable problem: [click](http://stackoverflow.com/questions/28237695/update-two-html-files-at-the-same-time-using-javascript/28484839#28484839)

http://stackoverflow.com/q/28975472
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46202103
linked to: http://stackoverflow.com/q/1379934
score: 2
downvote count: 0
tagged with: largenumber
has comment: http://stackoverflow.com/comment/46202230
has comment: http://stackoverflow.com/comment/46202112
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/46202041
duplicate of: http://stackoverflow.com/q/1379934
upvote count: 2
has comment: http://stackoverflow.com/comment/46202303
has title: Javascript number conversion
has body: why the conversion fail? var ccc=10206229832728593; alert("saveme.php?id="+ccc.toString() ) ; var ccc=10152714408613803; alert("saveme.php?id="+ccc.toString() ) ; the first var is decreased by 1 and the second one is increased by 1. I'm going crazy! what i wrong?
tagged with: double-precision
answer count: 0

http://stackoverflow.com/comment/92317639
score: 0
type: Comment
has text: Use of modulo is genius! I found this example to be quite elegant: https://codepen.io/sergiopedercini/pen/RLJYLj (calculates a HSL colour from string)
type: AnswerComment
comment on: http://stackoverflow.com/a/29013633

http://stackoverflow.com/q/28921127
has body: I'm doing some unit testing. The test framework loads a page into an iFrame and then runs assertions against that page. Before each test begins, I create a Promise which sets the iFrame's onload event to call resolve(), sets the iFrame's src, and returns the promise. So, I can just call loadUrl(url).then(myFunc), and it will wait for the page to load before executing whatever myFunc is. I use this sort of pattern all over the place in my tests (not just for loading URLs), primarily in order to allow changes to the DOM to happen (e.g. mimick clicking a button, and wait for divs to hide and show). The downside to this design is that I'm constantly writing anonymous functions with a few lines of code in them. Further, while I have a work-around (QUnit's assert.async()), the test function that defines the promises completes before the promise is run. I'm wondering if there is any way to get a value from a Promise or wait (block/sleep) until it has resolved, similar to .NET's IAsyncResult.WaitHandle.WaitOne(). I know JavaScript is single-threaded, but I'm hoping that doesn't mean that a function can't yield. In essence, is there a way to get the following to spit out results in the correct order? function kickOff() { return new Promise(function(resolve, reject) { $("#output").append("start"); setTimeout(function() { resolve(); }, 1000); }).then(function() { $("#output").append(" middle"); return " end"; }); }; function getResultFrom(promise) { // todo return " end"; } var promise = kickOff(); var result = getResultFrom(promise); $("#output").append(result); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="output"&gt;&lt;/div&gt;
has comment: http://stackoverflow.com/comment/46100265
has answer: http://stackoverflow.com/a/78322304
has answer: http://stackoverflow.com/a/76971657
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/28921704
has answer: http://stackoverflow.com/a/77875115
possible better answer: http://stackoverflow.com/a/42595284
downvote count: 0
tagged with: asynchronous
has answer: http://stackoverflow.com/a/42595284
linked to: http://stackoverflow.com/q/14220321
favorite count: 0
has comment: http://stackoverflow.com/comment/46100025
tagged with: promise
has answer: http://stackoverflow.com/a/50301141
upvote count: 190
accepted answer: http://stackoverflow.com/a/28921704
type: AnsweredQuestion
tagged with: ecma
score: 190
tagged with: async-await
has title: How to wait for a JavaScript Promise to resolve before resuming function?
type: Question

http://stackoverflow.com/comment/46322611
score: 0
type: AnswerComment
type: Comment
has text: Click the button multiple times and see what happens ;) You should probably add toggle `disabled` on the start button once it's been clicked. Also, if you enter a value like 60, it still counts down from 30. ALSO, if you hit reset while the counter is running, it doesn't actually reset.
comment on: http://stackoverflow.com/a/28997354

http://stackoverflow.com/q/28963648
upvote count: 1
type: Question
tagged with: xampp
has comment: http://stackoverflow.com/comment/46179208
has answer: http://stackoverflow.com/a/28963967
tagged with: javascript
linked to: http://stackoverflow.com/q/5878562
answer count: 1
downvote count: 0
has title: How do i print all image in web page? (Printer)
favorite count: 0
accepted answer: http://stackoverflow.com/a/28963967
linked to: http://stackoverflow.com/q/585254
tagged with: php
type: AnsweredQuestion
score: 1
has body: I have a this code &lt;?php echo '&lt;img border="1" src="data:image/png;base64,' . base64_encode($row['image']) . '" ;/&gt;'; ?&gt;&lt;/br&gt; How do I print the img in a printer?

http://stackoverflow.com/a/28961376
has body: Rather than create another new programming language—Google has already done that with Dart—AtScript is designed to run on top of not only ECMAScript 5 and the upcoming ECMAScript 6, but atop Microsoft’s superset TypeScript language as well. The goal of AtScript is to make type annotation data available at runtime, also known as type introspection, in an effort to enhance JavaScript with type, field and metadata annotations. References http://sdtimes.com/atscript-googles-new-superset-javascript-runtime/ http://techcrunch.com/2015/03/05/microsoft-and-google-collaborate-on-typescript-hell-has-not-frozen-over-yet
upvote count: 18
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28960934
has comment: http://stackoverflow.com/comment/46174869
score: 18
has comment: http://stackoverflow.com/comment/46174827

http://stackoverflow.com/a/28934544
answers question: http://stackoverflow.com/q/28934477
score: 0
type: Answer
has body: The former is a callback, meaning some instructions that will be executed ONLY as soon as the keypress event in your example is triggered. Thus, a function's name is not required. Function expressions, the latter, is mostly used when adding an object's property acting as a method like: var myObject = {}; myObject.sayHello = function() { alert("Hello"); }

http://stackoverflow.com/q/28991746
type: Question
has title: Injecting a $scope.property by ref into a factory instance
has comment: http://stackoverflow.com/comment/46231839
tagged with: javascript
has body: I need a Factory object that can be applied with a $scope.property to get a result. I also need to know if either the modifier in the factory instance, or the $scope.property changes to update the result. How I am seeing this pattern might be wrong of course. app.factory('MyFactory', function () { var MyFactory = function (name, modifier) { this.name = name; this.result = 0; this.modifier = modifier; } //I might want to call this when modifier or MyProperty changes MyFactory.prototype.modifyingMethod = function () { this.result = this.modifier * //externalProperty; } MyFactory.prototype.watcher = function () { //no idea what I will do here or if I need this at all // I need to recalculate the result like with $watch this.modifyingMethod(); } return MyFactory; } ) app.controller('MyCtrl' function($scope, MyFactory) { $scope.MyProperty = 42; $scope.MyFactoryOptions = [ new MyFactory('Option1', 1), new MyFactory('Option2', 2), new MyFactory('Option3', 3), new MyFactory('Option4', 4), new MyFactory('Option5', 5) ]; } So I have the problem that I need to $watch MyProperty and the modifier (it can be changed bu users) so I can change the result. If the Property is a value type passing it into the Factory constructor will not work. Perhaps I could pass a function in the returns MyProperty. Can I set up internal $watch on the factory. If I would do this outside of the factory, in the controller, I would need to do it for each instance. Should I perhaps set up some sort of register method on my factory object? Are there any suggestions, patterns or something I might want to use?
score: 0
has comment: http://stackoverflow.com/comment/46232309
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
tagged with: watch
has comment: http://stackoverflow.com/comment/46232515
has comment: http://stackoverflow.com/comment/46232823
has answer: http://stackoverflow.com/a/28994061

http://stackoverflow.com/a/29013778
has comment: http://stackoverflow.com/comment/46272830
accepted answer of: http://stackoverflow.com/q/29013659
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46272682
answers question: http://stackoverflow.com/q/29013659
has body: Replace input.isString with typeof input === 'string', and get rid of result.toString();. It's not doing anything useful. Edit: Also, your last two tests appear to be redundant.
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/46273352
score: 2

http://stackoverflow.com/q/28974612
type: Question
has comment: http://stackoverflow.com/comment/46214787
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/svg
answer count: 0
type: UnansweredQuestion
has body: I have an &lt;object&gt; that holds an svg file. I want to be able to add animations to it via javascript / jQuery, because the values that I would like to animate are not selectable via CSS transistions (specifically, the r value of &lt;circles&gt;. I would love to be proven wrong, though!). Here's what I'm trying to use: //create the object to hold the svg $(selProject).append('&lt;object id="circleCont" data="imgs/circles-01.svg" type="image/svg+xml"&gt;&lt;/object&gt;') var a = document.getElementById("circleCont"); a.addEventListener("load",function(){ var svgDoc = a.contentDocument; //get the inner DOM of .svg var circ = svgDoc.getElementsByClassName('circ'); $(circ[0]).append('&lt;animate attributeName="r" from="0.01" to="300" dur="0.2" begin="0s" fill="freeze"/&gt;'); },false); However, this doesn't seem to work. What is the better method to handle this?
has comment: http://stackoverflow.com/comment/46201554
has title: Appending code to the contents of an svg in an
has comment: http://stackoverflow.com/comment/46201104

http://stackoverflow.com/comment/46300554
comment on: http://stackoverflow.com/a/29022289
type: AnswerComment
score: 0
type: Comment
has text: Thanks. I have a last question how to add .css("opacity","1") to #ifedit when #custom is chosen, but at another choose it will be opacity=.5 for #ifedit?

http://stackoverflow.com/a/28996480
has comment: http://stackoverflow.com/comment/46241596
has comment: http://stackoverflow.com/comment/46243617
has comment: http://stackoverflow.com/comment/46241246
score: 0
has comment: http://stackoverflow.com/comment/46242215
has comment: http://stackoverflow.com/comment/46241510
answers question: http://stackoverflow.com/q/28995890
has comment: http://stackoverflow.com/comment/46241729
has body: You could sort the objects array, then create a new array by pushing the objects as a and c change: var objects = [{a:'b',c:'d',count:1},{a:'y',c:'d',count:4},{a:'b',c:'d',count:2}], newobj = []; objects.sort(function(a,b) { return a.a+a.c &gt; b.a+b.c ? 1 : a.a+a.c &lt; b.a+b.c ? -1 : 0; }); for(var i = 0 ; i &lt; objects.length ; i++) { if(i === 0 || objects[i].a !== objects[i-1].a || objects[i].b !== objects[i-1].b) { newobj.push({a: objects[i].a, c: objects[i].c, count: objects[i].count}); } else { newobj[newobj.length-1].count+= objects[i].count; } } alert(JSON.stringify(newobj));
has comment: http://stackoverflow.com/comment/46241645
has comment: http://stackoverflow.com/comment/46241658
type: Answer
has comment: http://stackoverflow.com/comment/46242038

http://stackoverflow.com/q/29026688
tagged with: arrays
tagged with: javascript
has body: I have an array with below elements. I am trying to create an object from the array var arr = [ 'find({ qty: { $lt: 20 } } )', 'limit(5)', 'skip(0)' ] Below is my code. where I am getting only values as the output. Any help on this will be helpful for (var i = 0; i &lt; arr.length; i++) { var res = arr[i].search(/\(/ig) if (res!= -1) { var result = arr[i].split("("); result = result[1].slice(0, -1)) } } Expected Output { "action": "find", "value": "{ qty: { $lt: 20 } }", "limit": 5, "skip": 0 }
has answer: http://stackoverflow.com/a/29026752
upvote count: 3
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has title: Creating custom object from array
tagged with: node.js
score: 3
has answer: http://stackoverflow.com/a/29026743
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 2

http://stackoverflow.com/q/29040412
has title: How can I set value at a column in Jtable through javaScript?
has body: updateAction: function(postData) { console.log("updating from custom function..."); return $.Deferred(function($dfd) { $.ajax({ url: 'HallManagementServlet?action=UpdateStudent', type: 'POST', dataType: 'json', data: postData, success: function(data) { var last_payment_date = []; $.each(data, function(entryindex, entry) { last_payment_date.push(entry['payment_expires_on']); }); var current_date = new Date(); if(Date.parse(last_payment_date)&lt;Date.parse(current_date)){ paymentStatus = 'Due'; } else{ paymentStatus = 'Paid'; } $dfd.resolve(data); }, error: function() { $dfd.reject(); } }); }); } Here paymentStatus is that column. It has two options. More precisely this is the column paymentStatus: { title: 'Payment Status', width: '8%', options: {'Paid': 'Paid', 'Due': 'Due'}, create: false, edit: false, list: true }, I want to set the values from updateAction. How can I do that?
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jtable

http://stackoverflow.com/comment/46168521
score: 0
type: AnswerComment
has text: @omerschleifer Can I ask why you aren't using the @Html.BeginForm(){} helper to build your form? Do you want me to link to some examples?
type: Comment
comment on: http://stackoverflow.com/a/28948674

http://stackoverflow.com/comment/46252866
type: Comment
type: QuestionComment
has text: Depending on how your HTML is structured you can simply use :nth-child(9) tag. Worst case scenario that index variable out and have if statement that says if(index == 9){} ... PS you need to define that index as var index = 0 or var index;;
comment on: http://stackoverflow.com/q/29002889
score: 0

http://stackoverflow.com/q/28966142
tagged with: javascript
has answer: http://stackoverflow.com/a/28966234
upvote count: 0
answer count: 1
favorite count: 0
has title: Comparing attribute of an anchor's href with "#"?
downvote count: 2
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/28966234
has comment: http://stackoverflow.com/comment/46183941
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46183890
type: Question
has body: I want to change the css properties of all anchors with href set to "#". Home Applets Tools Gallery Tutorials Fun About so i searched the elements using their tag name and compare the href with "#" using a for loop. Then changed the style properties of the element using javascript. function setnavstat(){ var menul = document.getElementsByTagName("a"); for(var i = 0;i < menul.lenght;i++){ if(menul[i].getAttribute("href") == "#"){ menul[i].style.color = "#000000"; } } } but this doesn't seem to work. help me. thanks in advance. it would help if the response be in JavaScript only.
tagged with: href
has comment: http://stackoverflow.com/comment/46183983
score: -2

http://stackoverflow.com/a/29049614
has body: You don't need to use jQuery for this simple task, especially if you are not already using it. Just put an inline style on the divs, this will override the the pre existing CSS. function overridePosition() { var divs = document.getElementsByTagName('div'), len = divs.length, i = 0; for (; i < len; i += 1) { // static is the default value of possition divs[i].style.position = 'static'; } } window.onload = function() { document.querySelector('button').addEventListener('click', overridePosition); }; div { position: relative; left: 50px; } Click Me To override position: relative Remove my style Remove my style Remove my style Remove my style There is a way to actually delete the rule, but I highly, highly recommend not doing it this way. It is not a cross browser solution and in the long term it is more hassle then it's worth. function deletePosition() { var cssRules = document.styleSheets[0]; // the only reason we know what index the rule is at is because it is the only rule. var ruleIndex = 0; if (typeof cssRules.deleteRule == "function") { cssRules.deleteRule(ruleIndex); } else if (typeof cssRules.removeRule == "function") { cssRules.removeRule(ruleIndex); } else { // don't know how to remove/delete css rule } } window.onload = function() { document.querySelector('button').addEventListener('click', deletePosition); }; div { position: relative; left: 50px; } Click Me To delete css position: relative rule Remove my style Remove my style Remove my style Remove my style
answers question: http://stackoverflow.com/q/29049436
type: Answer
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29049436

http://stackoverflow.com/q/29001647
tagged with: javascript
has comment: http://stackoverflow.com/comment/46250927
has title: Angular Argument 'fn' is not a function, got undefined debug
tagged with: angularjs
type: UnansweredQuestion
has body: I have a fairly large angular app, and I have recently been getting the error: Argument 'fn' is not a function, got undefined But the stacktrace I am given has no relevance to my code - it just gives me where the error is in the angular code. Is there a way to debug this issue so I know where in my code this error is happening? Right now I am simply taking guesses and hoping that it works, which is highly inefficient, obviously.
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/130263189
type: Question
has comment: http://stackoverflow.com/comment/46251057
has comment: http://stackoverflow.com/comment/46250912
has comment: http://stackoverflow.com/comment/46251169
has comment: http://stackoverflow.com/comment/46251155

http://stackoverflow.com/q/29029052
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29031238
type: Question
has title: Onclick causes Server Connection Reset in Joomla 3.3.6
tagged with: javascript
score: 0
answer count: 1
has body: I have been developing a Joomla website locally on MAMP 3.2x and just yesterday I migrated it to the clients server. It is running CentOS 6.5 with Apache 2.2.xx (standard CentOS Package). I have installed php5.5 &amp; php5.5-fpm, along with MySQL etc. The site is working absolutely fine, except for 1 little issue, which I have narrowed down to the word "Onclick" If any article or module or content, somewhere includes the word "onclick", as soon as I click Save, Save Close, Cancel, etc, I get a Server Dropped Connection Error. The weird thing is if its "Onclic" or "Onclik" or anyother variation, then its fine. But somehow "onclick" causes it to fail. Its not a POST Size issue, just a simple line will do it. I have tried Chrome, Safari and Firefox. I have checked my server logs, Apache, FPM &amp; MySql. No errors pertaining to this Also tried disabling fpm and switching to default php switched to php 5.6 but still the same issue The only clue I have is this POST http://example.com/administrator/index.php?option=com_content&amp;layout=edit&amp;id=224 net::ERR_CONNECTION_RESET core.js:1 Joomla.submitform -&gt; core.js:1 Joomla.submitbutton-&gt; index.php?option=com_content&amp;view=article&amp;layout=edit&amp;id=224:534 onclick-&gt; index.php?option=com_content&amp;view=article&amp;layout=edit&amp;id=224:502 --Update-- The issue only happens if onclick is part of a html tag. It seems the HTML filtering portion of Joomla is the culprit, even though its set to No Filtering for SuperAdmins the bare minimujm text required for this issue to show up is &lt; onclick= &gt; The following variations are fine &lt; onclick &lt; onclick= &lt; onclick &gt; Help please!!
has answer: http://stackoverflow.com/a/29031238
tagged with: joomla
has comment: http://stackoverflow.com/comment/46300717
tagged with: joomla3.0
tagged with: php

http://stackoverflow.com/q/28956240
has answer: http://stackoverflow.com/a/28956289
has comment: http://stackoverflow.com/comment/46165595
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28956276
has comment: http://stackoverflow.com/comment/46165694
tagged with: http://stackoverflow.com/tag/html
has title: Change Tabs style, when clicking previous or continue button
tagged with: css
has answer: http://stackoverflow.com/a/28956276
has body: When I clicked on 'continue 1' button on the first page it will direct me to second tabs. But the tab 2 header doesn't change to dark color. How should I do that? -Another question, when i clicked on the 'continue 1' button, it directs me to second tabs, but the second tabs alignment is off. Why is it like that? Here is the FIDDLE example: HTML 1 1 1 Previous 1 Continue 1 2 2 2 Previous 2 Continue 2 3 3 3 Previous 3 Continue 3 CSS .tabs input[type=radio] { position: absolute; top: -9999px; left: -9999px; } .tabs { width: 85%; float: none; list-style: none; position: relative; padding: 0; /* margin: 75px auto; */ } .tabs li{ float: left; } .tabs label { /*display: block;*/ width:30px; height:30px; text-align:center; padding:3px; border-radius: 25px; border:2px solid #d1d9e5; color: #d1d9e5; font-size: 14px; font-weight: normal; background: rgba(255,255,255,0.2); cursor: pointer; position: relative; top: 3px; -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; } .tabs label:hover { background: rgba(255,255,255,0.5); top: 0; } [id^=tab]:checked + label { background: #fff; color: #8a8f96; border: 2px solid #8a8f96; } [id^=tab]:checked ~ [id^=tab-content] { display: block; padding-left: 250px; } .tab-content{ z-index: 2; display: none; text-align: left; width: 100%; font-size: 20px; line-height: 140%; padding-top: 10px; position: absolute; top: 100px; left: 0; box-sizing: border-box; -webkit-animation-duration: 0.5s; -o-animation-duration: 0.5s; -moz-animation-duration: 0.5s; animation-duration: 0.5s; } Javascript $(document).ready(function () { $("#continue1").click(function () { $("#tab-content3").hide(); $("#tab-content2").show(); $("#tab-content1").hide(); }); }); Thank you!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28956399
has comment: http://stackoverflow.com/comment/46165719
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46165619
possible better answer: http://stackoverflow.com/a/28956289
has comment: http://stackoverflow.com/comment/46165732
score: 0
answer count: 3

http://stackoverflow.com/a/28912883
answers question: http://stackoverflow.com/q/28912744
has comment: http://stackoverflow.com/comment/46084407
has comment: http://stackoverflow.com/comment/46085660
score: 0
has comment: http://stackoverflow.com/comment/46084851
has comment: http://stackoverflow.com/comment/46085092
has comment: http://stackoverflow.com/comment/46084237
has body: If you are looking to remove #timelinearea from the DOM, use remove(); $("#timelinearea").remove(); See: http://api.jquery.com/remove/
type: Answer
has comment: http://stackoverflow.com/comment/46084629
has comment: http://stackoverflow.com/comment/46084808

http://stackoverflow.com/q/29018151
downvote count: 0
has answer: http://stackoverflow.com/a/29018581
possible better answer: http://stackoverflow.com/a/42447620
tagged with: google-chrome
type: Question
upvote count: 16
has title: How do I programmatically create a TouchEvent in Chrome 41?
tagged with: javascript
has answer: http://stackoverflow.com/a/29019278
linked to: http://stackoverflow.com/q/5713393
has answer: http://stackoverflow.com/a/42447620
has answer: http://stackoverflow.com/a/29084805
accepted answer: http://stackoverflow.com/a/29084805
favorite count: 0
score: 16
answer count: 4
type: AnsweredQuestion
has body: I am trying to create a touch event for a unit test. After reading https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent, I expected that I would be able to do: document.createEvent('TouchEvent'); But I get this error: Uncaught DOMException: Failed to execute 'createEvent' on 'Document': The provided event type ('TouchEvent') is invalid. I saw Creating and firing touch events on a touch enabled browser?, which also seems to indicate that createEvent() is the way to go. I also tried creating the event via constructor, which works for, say, MouseEvent and WheelEvent: new window.TouchEvent() But I get an error here, too: Uncaught TypeError: Illegal constructor I tried in Firefox 36, but based on http://caniuse.com/#search=touch, I wasn't surprised to see: NotSupportedError: Operation is not supported After running document.createEvent('TouchEvent') There is not event a window.TouchEvent constructor in Firefox, which is, again, not surprising. Any ideas what I am doing wrong?

http://stackoverflow.com/comment/46893594
score: 1
comment on: http://stackoverflow.com/q/28956004
type: Comment
has text: Author of turbo-react here. TurboReact uses react-magic to go from HTML to JSX to React components. It is a Turbolinks plugin that replaces the way Turbolinks writes to the DOM.
type: QuestionComment

http://stackoverflow.com/comment/79793637
type: Comment
comment on: http://stackoverflow.com/a/46333105
score: 0
type: AnswerComment
has text: what do you mean by source? if is a working example nop, if is the author, it's me.

http://stackoverflow.com/q/29015262
downvote count: 0
tagged with: javascript
tagged with: webfont-loader
answer count: 1
favorite count: 0
has body: I want to use Google's WebFontLoader to call a javascript function after all fonts are loaded. The script I want to call is Packery and imagesloaded: var container = document.querySelector('.layouter'); var $pckry; var $pckry = new Packery( container, { // options itemSelector: '.item', gutter: 0, }); // initialize Packery after all images have loaded imagesLoaded( container, function() { $pckry = new Packery( container ); }); My problem is that I have no idea of how to get it to work?
upvote count: 2
type: UnansweredQuestion
score: 2
has title: Use Google WebFontLoader to Call Script after Font is Loaded
has answer: http://stackoverflow.com/a/29015621
tagged with: packery
type: Question
tagged with: masonry

http://stackoverflow.com/comment/46351967
has text: @MatthewNorth : Thanks for your help :) ..and sorry for late reply..i decided to switch to jquery-multiselect dropdown instead of bootstrap..
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28982110

http://stackoverflow.com/a/29060200
has body: Use the fullpage.js function setAllowScrolling with the parameter up like so: //disabling scrolling up $.fn.fullpage.setAllowScrolling(false, 'up'); You can use it on the afterRender callback and the afterLoad to play with it, like this: $('#fullpage').fullpage({ sectionsColor: ['yellow', 'orange', '#C0C0C0', '#ADD8E6'], continuousVertical: true, afterRender: function () { //disabling scrolling up on page load if we are in the 1st section if($('.fp-section.active').index('.fp-section') === 0){ $.fn.fullpage.setAllowScrolling(false, 'up'); } }, afterLoad: function (anchorLink, index) { if (index !== 1) { //activating the scrolling up for any other section $.fn.fullpage.setAllowScrolling(true, 'up'); } else { //disabling the scrolling up when reaching 1st section $.fn.fullpage.setAllowScrolling(false, 'up'); } } }); Demo online This way the visitors won't be able to scroll up on page load. From the docs: setAllowScrolling(boolean, [directions]) Adds or remove the possibility of scrolling through sections by using the mouse wheel/trackpad or touch gestures (which is active by default). directions: (optional parameter) Admitted values: all, up, down, left, right or a combination of them separated by commas like down, right. It defines the direction for which the scrolling will be enabled or disabled.
accepted answer of: http://stackoverflow.com/q/29046386
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/46441416
score: 1
has comment: http://stackoverflow.com/comment/46382947
has comment: http://stackoverflow.com/comment/46374571
answers question: http://stackoverflow.com/q/29046386

http://stackoverflow.com/q/28956891
type: Question
has body: i'm new to highcharts. I already browse in highcharts example. but, every time I look for the sample, it came with the column bar chart like this : All I want is like this : But I dont know how. Maybe you can help me figured it out. Thank you.
tagged with: highcharts
answer count: 1
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28962114
has title: Highcharts Bar Chart Without Column
tagged with: charts
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28962114

http://stackoverflow.com/q/28933021
upvote count: 1
accepted answer: http://stackoverflow.com/a/28933185
has title: Why does my code work with underscore.js but not when I use Ramda.js?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46122264
tagged with: underscore.js
tagged with: ramda.js
score: 1
has body: I am new to Javascript, I am doing a coding challenge to learn more about the language. This is not school related or anything like that, totally for my own personal growth. Here is the challenge: Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number. I have spent the past 2 evenings working on solving this challenge. When I run my code using underscore.js it works. When I use Ramda.js it says NaN. I would think both would return NaN. I'm very surprised that I can get the correct answer from one and not the other. Any insights would be greatly appreciated! var R = require('ramda'); function sumFibs(num) { var fib_Arr = []; var new_Arr = []; var total = 0; // I use this to tell if the fib num is greater than 2 var the_Bit = "false"; // This is used to keep track of when to stop the loop var fib_Num = 0; // THIS WORKS FROM HERE // This loop generates a list of fibonacci numbers then pushes them to the fib_Arr for(var i = 0; total &lt; num; i++){ if (i &lt; 1){ fib_Arr.push(0); } else if (i === 1){ fib_Arr.push(i); fib_Arr.push(1); } else if (i === 2){ fib_Arr.push(2); the_Bit = "true"; } else if (the_Bit === "true"){ temp_Arr = R.last(fib_Arr,2); temp_Arr = temp_Arr[0] + temp_Arr[1]; fib_Arr.push(temp_Arr); total = R.last(fib_Arr); } // Generating the fib Array works TO HERE!!!! } // console.log(fib_Arr); // Print out the generated fibonacci array // if last Array element is greater than the original in var last_Element = R.last(fib_Arr); if (last_Element &gt; num){ console.log("The last element of the array is bigger!"); fib_Arr.splice(-1,1); // This removes the last item from the array if it is larger than the original num input } // This loop removes all of the EVEN fibonacci numbers and leaves all of the ODD numbers for (var j = 0; j &lt; fib_Arr.length; j++){ if (fib_Arr[j] % 2 !== 0){ new_Arr.push((fib_Arr[j])); } } // This checks if the original input num was a if (num % 2 !== 0){ new_Arr.push(num); } else…
type: Question
has answer: http://stackoverflow.com/a/28933199
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28933185
answer count: 3
favorite count: 0
has comment: http://stackoverflow.com/comment/46121865
possible better answer: http://stackoverflow.com/a/28933408
has comment: http://stackoverflow.com/comment/46122067
has answer: http://stackoverflow.com/a/28933408

http://stackoverflow.com/q/29047607
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29047727
type: Question
has title: get data-price of selected value in dropdown in a array
accepted answer: http://stackoverflow.com/a/29047883
tagged with: javascript
tagged with: jquery
has body: I have following code <?php $this->db->order_by('name','asc'); $prod = $this->db->get('product')->result_array(); foreach($prod as $row): ?> <option data-price="<?php echo $row['price'];?>" value="<?php echo $row['prod_id'];?>" > <?php echo ucwords($row['name']);?> <?php endforeach; ?> Now I want to get the value of data-price attribute of selected option on change in Dropdown to the textbox having dynamic id item_price_0. This is changing as I have added the add row button. When I click on Add row, the id will become item_price_1. Kindly help me how can I get these value using jquery or javascript
has comment: http://stackoverflow.com/comment/46333984
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/29047883
has comment: http://stackoverflow.com/comment/46334189
favorite count: 0
downvote count: 0
tagged with: codeigniter
possible better answer: http://stackoverflow.com/a/29047639
tagged with: php
has answer: http://stackoverflow.com/a/29047639

http://stackoverflow.com/comment/46360600
type: QuestionComment
has text: So in my case can i do this .... Window = " window.open('selecteddate.aspx', 'MsgWindow', 'width=500, height=500'); myWindow.opener.document.write(lblVarChildSelectedDate.Text = lblVarSelectedDate.Text );"
type: Comment
comment on: http://stackoverflow.com/q/29061752
score: 0

http://stackoverflow.com/q/28942871
type: Question
has body: I'm creating a collaborative web music platform. At present, i have a simple drum machine working locally, with a JSON file logging all the beats. i.e. after punching in the pattern, the code looks like this when logged to console. A scheduler and play function then iterates through and plays the beat if it's 'on' at the current beat. "kick": [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0], "snare": [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], "hat": [0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1], "tom1": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "tom2": [0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0], "tom3": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] So next i want to network this web app, so two people can edit the pattern at the same time. I'm really struggling and would love some help here. I've looked at meteor and sharejs, but have become quite confused. How can i have a JSON file living on the server, which is edited by two users? (they will take it in turns to edit the pattern, like this game http://sharejs.org/hex.html#9TGAyPGFOy) This JSON file needs to be updated in the code at all times, so the latest version of the track can be played to both users. Any tips would be great, i feel i'm overcomplicating myself here... Thanks
downvote count: 0
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/28943807
answer count: 3
tagged with: meteor
favorite count: 0
has title: How can two users collaboratively edit a JSON file?
has answer: http://stackoverflow.com/a/28943653
accepted answer: http://stackoverflow.com/a/28943653
has comment: http://stackoverflow.com/comment/46140258
has answer: http://stackoverflow.com/a/28943570
tagged with: node.js
has comment: http://stackoverflow.com/comment/46140381
tagged with: share.js
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/28943807
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46140114

http://stackoverflow.com/comment/46175046
has text: possible duplicate of [Create and Call External JS files](http://stackoverflow.com/questions/12710910/create-and-call-external-js-files)
comment on: http://stackoverflow.com/q/28961271
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/46224873
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28987553
has text: when using `client_id as` it returns client_id,I want to client object,how it is possible?
score: 0

http://stackoverflow.com/a/29058819
has body: IndexOf returns the index of the first character of the matched string, or -1 if there is no match. So "abcdef".indexOf("def") would return 3 your if statement reads: if (Text.indexOf(k) == 0) in plain English this reads as, if Text begins with the string k. You probably meant if (Text.indexOf(k) != -1) which in plain English reads as, if Text contains the string k. Since if Text contains k it will return a positive number, otherwise it will return -1.
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/46354134
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29058788

http://stackoverflow.com/q/28946645
type: AnsweredQuestion
has body: As the title says, When the user clicks a button I want to display a form within div tags. HTML PHP echo " "; echo " "; echo " "; JS/AJAX function newAccount(obj){ alert("test"); 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 && xmlhttp.status == 200) { document.getElementById("newaccount_form").innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET","newaccount.php", true); xmlhttp.send(); Now when the "New Account" button gets clicked I want the form on newaccount.php to display within the newaccount_form divs. newaccount.php if (isset($_POST['submit'])) { // Grab the profile data from the POST $accountname = mysqli_real_escape_string($dbc, trim($_POST['accountname'])); if (!empty($accountname)) { // Make sure that this account name doesnt already exist $query = "SELECT * FROM account WHERE account_name = '$accountname'"; $data = mysqli_query($dbc, $query); if (mysqli_num_rows($data) == 0) { // The account name is unique, so insert the data into the database $query = "INSERT INTO account (account_name) VALUES ('$accountname')"; mysqli_query($dbc, $query); // Confirm success with the user echo ' You have succesfully created a new account. Please go back to theadmin panel. '; } else { //Account already exists with the name echo ' An account already exists with this name, Please try another account name. '; $accountname = ""; } } else { echo ' Please enter in all fields. '; } } echo " test "; ?> New Account Account name:
accepted answer: http://stackoverflow.com/a/28947665
type: Question
has title: Display and add a form to a div when a user clicks a button
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/46148767
score: 0
has answer: http://stackoverflow.com/a/28947665
answer count: 1
has comment: http://stackoverflow.com/comment/46148254
tagged with: php

http://stackoverflow.com/comment/46279446
type: Comment
comment on: http://stackoverflow.com/a/29009940
has text: This really has nothing to do with the question.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28992193
answer count: 0
has title: XSLT JavaScript Entity Validation Error
has comment: http://stackoverflow.com/comment/46238538
has comment: http://stackoverflow.com/comment/46265433
has comment: http://stackoverflow.com/comment/46232995
type: Question
has comment: http://stackoverflow.com/comment/46287444
tagged with: javascript
tagged with: entity
score: 0
has body: i've pasted my full xslt: &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:content="http://purl.org/rss/1.0/modules/content/" &gt; &lt;xsl:output method="html"/&gt; &lt;xsl:template match="/"&gt; &lt;!-- Create a Jobs array --&gt; &lt;script type="text/javascript"&gt; var jobs = { &lt;xsl:for-each select="jobs/job"&gt; "&lt;xsl:value-of select='ID'/&gt;" : "&lt;xsl:value-of select='Title'/&gt;", &lt;/xsl:for-each&gt; "0000" : "Test" // Stop IE8 error message }; &lt;/script&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; This results in the following javascript in my html: &lt;script type="text/javascript" xmlns:content="http://purl.org/rss/1.0/modules/content/"&gt; var jobs = { "J123456" : "Teacher - &amp; Blah Blah", "0000" : "Test" // Stop IE8 error message }; &lt;/script&gt; but the &amp; sign is causing w3c validation failure. How do i output it as amp; ?
has comment: http://stackoverflow.com/comment/46259455
has comment: http://stackoverflow.com/comment/46259473
has comment: http://stackoverflow.com/comment/46243270
type: UnansweredQuestion
tagged with: xslt

http://stackoverflow.com/q/29014986
has title: AngularJS custom filter for Pagination
tagged with: javascript
downvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46275227
score: 1
upvote count: 1
has body: I have implemented the following filter(startFrom) in my app.js file: app.filter('startFrom', function () { return function (input, start) { start = +start; return input.slice(start); } }); I revice the data in an asychroneous way and the filter is applied at page load. The problem is that the data is not available when the filter is used. &lt;div class="panel panel-default" ng-repeat="hotel in hotels | filter:search | startFrom:currentPage*itemsPerPage | orderBy:sortBy.Name :order.reverse | limitTo:itemsPerPage"&gt; How can I have filter applied after the data is available?
has answer: http://stackoverflow.com/a/29023518
type: Question

http://stackoverflow.com/q/29035079
answer count: 1
has comment: http://stackoverflow.com/comment/46347569
has comment: http://stackoverflow.com/comment/46338512
has comment: http://stackoverflow.com/comment/46312706
has comment: http://stackoverflow.com/comment/46323323
has comment: http://stackoverflow.com/comment/46310972
has comment: http://stackoverflow.com/comment/46310927
has answer: http://stackoverflow.com/a/29076381
has title: Can I make a javascript getter that relies on an asynchronous call?
has comment: http://stackoverflow.com/comment/46366693
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46325900
has comment: http://stackoverflow.com/comment/46311082
has body: I have a tremendous amount of other people's code that, I'm sorry, cannot be refactored for social reasons. Currently the server generates a variable for this code and delivers it with the page by stuffing it in a script block. Unfortunately, for performance reasons I now want the creation of this variable to be deferred until after the page is loaded, and if I can skip creating the variable altogether, even better. So this is the age old "how do I block?" question for javascript, but since I can't refactor the code, I can't just go in and replace every instance of the variable with a promise. Given how other questions about blocking Javascript tend to be answered, I'm not convinced finding a way to make a getter block until the ajax call is complete is the right answer. I am open to all suggestions but I wanted this to be a specific question. Thank you. Edit: Example. Here's code I can't touch, also, I can't touch it: if (globalObject.someVariable) { doStuff(); } else { doOtherStuff(); } Here's what the server puts in the page: &lt;script type='text/javascript'&gt; jQuery.extend(globalObject, { "someVariable" : true; } &lt;/script&gt; That I can touch. I can make someVariable anything I want. The example just shows true or false, but generating that true or false is a metaphor for 20% of my page load times. All the parts of the page that need the variable to display already fail gracefully, so it's not a problem to tell them "wait for this variable to finish loading" I just don't know how, since I can't touch the part of the code where it would be most appropriate to change it.
has comment: http://stackoverflow.com/comment/46313281
type: Question
has comment: http://stackoverflow.com/comment/46312186
has comment: http://stackoverflow.com/comment/46311527
tagged with: javascript
has comment: http://stackoverflow.com/comment/46311507
score: 0
accepted answer: http://stackoverflow.com/a/29076381

http://stackoverflow.com/comment/46232381
has text: possible duplicate of [Include js file in Go template](http://stackoverflow.com/questions/28899675/include-js-file-in-go-template)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28983221
score: 0

http://stackoverflow.com/a/29014725
has comment: http://stackoverflow.com/comment/46288855
score: 0
has body: what you can do instead of splitting the whole book at once in n splits with each consists of 140 characters is to keep in mind the last position of the last split which is also the total number of splits done before. var lastSplit; // position of the last split that you will cache var limit = book.length - lastSplit &gt; 140 ? 140 : book.length - lastSplit; var urlsToAdd = book.slice(lastSplit, lastSplit + limit); so the lastSplit will hold the position of the last split and also indicates how many character have been also tweeted. Now you need to check how many characters you will tweet just to be sure you will not exceed the book characters length You do the split from the last known position by the number of characters you wish which is either lastSplit + 140 or the books length if you near the end Of course this logic is very dummy, meaning that you don't care if you stop the characters in the middle of the word or the sentence .. etc. Update: The code i provided is a general thought process, it is not necessarily copy/paste thing. However, from the code you pasted after, you can try: var fs = require('fs'); var book = fs.readFileSync('./test.txt'); var lastSplit = 0; function tweet(book) { var limit = book.length - lastSplit &gt; 140 ? 140 : book.length - lastSplit; var tweet = book.slice(lastSplit, lastSplit + limit); lastSplit += limit; return tweet; } while (lastSplit &lt; book.length) { console.log(tweet(book)); } Updated II: Working Code With dummy Book (to convince you that it works !) function tweet(book) { var lastSplit = 0; while (lastSplit &lt; book.length) { var limit = book.length - lastSplit &gt; 140 ? 140 : book.length - lastSplit; var tweet = book.slice(lastSplit, lastSplit + limit); lastSplit += limit; $('body').append('&lt;p&gt;' + tweet + '&lt;/p&gt;'); } } // this will generate a dummy string containing numbers from 0-800 tweet(Array.apply(null, {length: 800}).map(Number.call, Number).join('')); &lt;script src="https://ajax.googleapis.com/aj…
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29014492
has comment: http://stackoverflow.com/comment/46282004
answers question: http://stackoverflow.com/q/29014492
type: Answer
has comment: http://stackoverflow.com/comment/46275464
has comment: http://stackoverflow.com/comment/46274654

http://stackoverflow.com/q/29040023
tagged with: canvas
answer count: 1
tagged with: javascript
has body: I'm using Chart.js for a project (http://www.chartjs.org/). Does somebody know how to draw on the actual canvas new stuff, like a title or add custom images, add 'margin' to the chart?
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/28499475
has title: Chart.js add custom title, subtitle, graphics
favorite count: 0
has answer: http://stackoverflow.com/a/29041275
accepted answer: http://stackoverflow.com/a/29041275
downvote count: 0
tagged with: charts
type: AnsweredQuestion
score: 3
type: Question

http://stackoverflow.com/comment/46092355
has text: thank you for your suggestion. Yes i have, but my dilemna is that I am working within the intel xdk, and not sure how to integrate it within. I am a bit lost, if you wouldn't mind elaborating or a more step by step instructioni would greatly appreciate
score: 0
comment on: http://stackoverflow.com/q/28916931
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29041036
has comment: http://stackoverflow.com/comment/46323103
has title: Click a link to add product but stay on same page
score: 0
has comment: http://stackoverflow.com/comment/46322473
answer count: 0
type: UnansweredQuestion
has body: I have a column of product links in my mySQL database and am trying to get the user to add multiple products in his/her cart and not redirect to the cart when adding a product each time. For some reason, my cart is not updating when the user clicks the link. Can anyone tell me what is wrong with my code? $producturl pulls the link from the database. I would like the link to trigger but stay on the page. <?php $producturl = ProductURL::find(array('Product'=>$tube1->Tube1)); if($producturl[0]->URL!=NULL){ echo 'Add Cart NoRedirect'; } ?>
tagged with: preventdefault
tagged with: php
has comment: http://stackoverflow.com/comment/46391715
has comment: http://stackoverflow.com/comment/46323316
type: Question
tagged with: function
tagged with: javascript
tagged with: click

http://stackoverflow.com/comment/46321464
comment on: http://stackoverflow.com/a/29040268
type: AnswerComment
type: Comment
score: 0
has text: @Isaiah those need to be added when the element is in the DOM, as of that in a script that is e.g. at the bottom of the page, in an `onload` callback or when at an _domready_ event.

http://stackoverflow.com/q/28929609
has body: I want to do two things. The first thing is a click event for an unknown quantity of elements to be added to the DOM later as it will constantly be getting updated. The click even looks like this and is currently working. $("#systemDetails").on("click", "#categoryToggle", function () { $(this).closest('table').next().toggle("slow"); $(this).toggleClass("glyphicon-plus-sign glyphicon-minus-sign"); }); The id is categoryToggle. Now I want to reference each individual item with that ID, however you cannot do that when the ID's are all the same. .each() will just return the first element with that ID. Ideally I want my second piece of code to behave like this: There is a save function before a section of the DOM is replaced by AJAX, then after it is replaced I want to call this: function recallVis() { $("#categoryToggle").each(function (index) { if (categoryVis[index]) { // hide $(this).closest('table').next().hide(); } else { // show $(this).closest('table').next().show(); } }); } Is there a way to iterate through either all ID's of the same name, OR iterate through a list of ID's in say, this format: ID1, ID2, ID3... etc... And maintain a single click event handler that works for all items in the format ID(number)? Or am I stuck using classes in my selector if I want to use JQuery's .each() method?
has comment: http://stackoverflow.com/comment/46115120
tagged with: javascript
has answer: http://stackoverflow.com/a/28929757
has answer: http://stackoverflow.com/a/28929682
score: 2
type: AnsweredQuestion
has title: Reference DOM elements by an iterated ID using JQuery
possible better answer: http://stackoverflow.com/a/28929757
downvote count: 0
has comment: http://stackoverflow.com/comment/46115070
tagged with: jquery
has comment: http://stackoverflow.com/comment/46115183
favorite count: 0
tagged with: ajax
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/46115059
accepted answer: http://stackoverflow.com/a/28929682
has comment: http://stackoverflow.com/comment/46115283
has comment: http://stackoverflow.com/comment/46115228
answer count: 2
tagged with: dom

http://stackoverflow.com/a/31222549
downvote count: 4
score: 26
answers question: http://stackoverflow.com/q/28971088
has comment: http://stackoverflow.com/comment/71356389
upvote count: 30
has comment: http://stackoverflow.com/comment/76244349
has comment: http://stackoverflow.com/comment/88965795
has comment: http://stackoverflow.com/comment/121802392
has comment: http://stackoverflow.com/comment/77937785
has comment: http://stackoverflow.com/comment/69972360
has comment: http://stackoverflow.com/comment/87486432
has body: Try: WKNavigationDelegate - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error You can check the error, usually you will have an error.code -1009: Check this list: Error Codes
type: Answer

http://stackoverflow.com/q/28911621
type: Question
has answer: http://stackoverflow.com/a/28911647
score: 1
has body: actually i have tried with iframe to load embed code of my site in another webpage it is working fine in android mobiles and windows pc , when come to ios it is not working , someone suggested me to load embed code through js without using iframe , when iam loading external webpage through js it is not working , can anyone help how to solve this problem
answer count: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28911670
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has title: loading other webpage in my site with jquery is not working
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28911670
upvote count: 1
possible better answer: http://stackoverflow.com/a/28911647

http://stackoverflow.com/q/28949062
tagged with: http://stackoverflow.com/tag/html
has body: The question is self explanatory. I would like to prevent the keyboard from being shown when i foucus/click on input fields like type="text", number and so on.
tagged with: input
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46154088
has comment: http://stackoverflow.com/comment/46152127
has title: How to prevent the virtual keyboard of mobile devices from showing up with javascript?
has comment: http://stackoverflow.com/comment/46152114
tagged with: virtual-keyboard
type: Question
duplicate of: http://stackoverflow.com/q/10940287
tagged with: javascript
linked to: http://stackoverflow.com/q/10940287
score: 0

transfer
tags question: http://stackoverflow.com/q/28944163
type: Tag
tag name: transfer

http://stackoverflow.com/a/29023993
answers question: http://stackoverflow.com/q/29023956
upvote count: 1
has body: Your if statements are not conditional. You are just dividing i by a number. If you want to check if it's divisible, use the modulus and check for 0. if(i%3 == 0){ //if i can be divided evenly by 3, then do something do something }
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/comment/46366308
type: Comment
comment on: http://stackoverflow.com/q/29060780
score: 0
has text: Thanks to both of you. An addendum: I had to change my code so that, instead of using "triggerHandler", it just called `trigger` on the event. With that change, it works now.
type: QuestionComment

http://stackoverflow.com/a/28935245
answers question: http://stackoverflow.com/q/28935194
type: Answer
has comment: http://stackoverflow.com/comment/46126021
has comment: http://stackoverflow.com/comment/46126325
has body: It's json structure.. You can access elements as I mentioned below.. Assign json to variable and then access object properties. var obj = { "results": [ { "locations": [ { "latLng": { "lng": 24.873108, "lat": 59.389755 }, "adminArea4": "Harju maakond", "adminArea5Type": "City", "adminArea4Type": "County", "adminArea5": "Rae vald", "street": "", "adminArea1": "EE", "adminArea3": "", "type": "s", "displayLatLng": { "lng": 24.873108, "lat": 59.389755 }, "linkId": 0, "postalCode": "", "sideOfStreet": "N", "dragPoint": false, "adminArea1Type": "Country", "geocodeQuality": "CITY", "geocodeQualityCode": "A5XXX", "adminArea3Type": "State" }, { "latLng": { "lng": 24.860184, "lat": 59.38493 }, "adminArea4": "Harju maakond", "adminArea5Type": "City", "adminArea4Type": "County", "adminArea5": "Rae", "street": "", "adminArea1": "EE", "adminArea3": "", "type": "s", "displayLatLng": { "lng": 24.860184, "lat": 59.38493 }, "linkId": 0, "postalCode": "", "sideOfStreet": "N", "dragPoint": false, "adminArea1Type": "Country", "geocodeQuality": "CITY", "geocodeQualityCode": "A5XXX", "adminArea3Type": "State" }, ] } ] }; Travsering Values obj.results[0].locations[0].latLng.lng obj.results[0].locations[0].latLng.lat You can also traverse by using for loop.
upvote count: 2
score: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/46126028
has comment: http://stackoverflow.com/comment/46126035
has comment: http://stackoverflow.com/comment/46126090

http://stackoverflow.com/q/28984511
has comment: http://stackoverflow.com/comment/46217775
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28984759
has comment: http://stackoverflow.com/comment/46217905
has comment: http://stackoverflow.com/comment/46218194
type: Question
has comment: http://stackoverflow.com/comment/46218825
answer count: 2
has comment: http://stackoverflow.com/comment/46218140
tagged with: javascript
has answer: http://stackoverflow.com/a/28985244
tagged with: jquery
score: 0
has body: I have a Li element (dropdown) that gets an Active class when parent div (button) is clicked. When this element have this class I want to give another div the same class. When the li element (dropdown) is clicked again the active class is removed, I then want to remove the active class on the second div aswell. What I got so far: $('document').ready(function() { if ($('li').hasClass('active')) { $("#site-overlay").addClass("active"); } }); This works a bit on the way in console- it gives my second div the correct class. It doesnt work live though, I guess I cant just call it on pageload? It also doesnt remove the class.
has title: Add class to element when second div has class

http://stackoverflow.com/a/28997718
score: 0
type: Answer
has body: I found some bugs in your code. var newScroll = $('body').scrollTop(); replace on var newScroll = $('html, body').scrollTop(); FF return always 0 in your case. Another bug is in your if statement. You forgot {} This is a fix code revealImages: function() { var currentScroll = 0; var totalScroll = $(document).height() - $(window).height(); var newScroll = $('html, body').scrollTop(); $('.image-flip').each(function() { if( ( newScroll + $(window).height() ) &gt;= ( $(this).offset().top + 200 ) &amp;&amp; ( currentScroll &lt; newScroll ) ){ $(this).addClass('flipped'); } }); currentScroll = newScroll; }
has comment: http://stackoverflow.com/comment/46244477
answers question: http://stackoverflow.com/q/28997047

http://stackoverflow.com/q/28949764
has comment: http://stackoverflow.com/comment/46153581
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46153558
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28950157
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46153393
score: 1
tagged with: css
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/46153627
has title: CSS max() function alternative
has answer: http://stackoverflow.com/a/28950157
has body: I would like to set the min-height of a HTML element to the maximum of two values, but unfortunately css doesn't support max(). Here's my css code: #content{ min-height:calc( 100% - 100px); } The other value is constant number (400px). I think I have to use JS, but I cant figure out how to do that. Here is my JS code: function layout(){ var y = document.getElementById("content"); y.style.minHeight = Math.max(parseInt(y.style.minHeight), 400).toString + "px"; } window.onload = layout; window.onresize = layout; alert(parseInt(y.style.minHeight)) gives me naN. What am I doing wrong? Regards

http://stackoverflow.com/a/41286377
type: Answer
score: 126
has comment: http://stackoverflow.com/comment/131926163
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29012922
type: AcceptedAnswer
upvote count: 126
answers question: http://stackoverflow.com/q/29012922
has body: If you use the last version of lodash you can simply do: // create debounce const debouncedThing = _.debounce(thing, 1000); // execute debounce, it will wait one second before executing thing debouncedThing(); // will cancel the execution of thing if executed before 1 second debouncedThing.cancel() Another solution is with a flag: // create the flag let executeThing = true; const thing = () =&gt; { // use flag to allow execution cancelling if (!executeThing) return false; ... }; // create debounce const debouncedThing = _.debounce(thing, 1000); // execute debounce, it will wait one second before executing thing debouncedThing(); // it will prevent to execute thing content executeThing = false;

http://stackoverflow.com/a/29030769
answers question: http://stackoverflow.com/q/29029911
has comment: http://stackoverflow.com/comment/46341207
has body: var ss = SpreadsheetApp.getActiveSpreadsheet(); //Get the spreadsheet var sheet = ss.getActiveSheet() //Get the active sheet After the form is submitted, there will be a new row of data in the sheet. So new data is in last row and you can get the data as - var rowData = sheet.getRange( sheet.getLastRow(), 1 or column number to start to get data, 1(don't change), number of columns to take(use sheet.getLastColumn() to grab all columns) ).getValues()[0]; rowData is an object and you have to iterate through it to get actual cell values. var text=""; for (i in rowData) { text = text + rowData[i] + ", " // format as you need } text = 'name, email, address....' etc Then use 'text' in the 'body' to mail.
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29029911
upvote count: 1

http://stackoverflow.com/q/28977944
score: 0
has comment: http://stackoverflow.com/comment/46206995
has comment: http://stackoverflow.com/comment/46206973
has comment: http://stackoverflow.com/comment/46206694
answer count: 1
accepted answer: http://stackoverflow.com/a/28978737
tagged with: jquery
has comment: http://stackoverflow.com/comment/46206806
has comment: http://stackoverflow.com/comment/46207284
has comment: http://stackoverflow.com/comment/46206750
has title: How to get jQuery callback fire return value?
has answer: http://stackoverflow.com/a/28978737
has comment: http://stackoverflow.com/comment/46206904
has comment: http://stackoverflow.com/comment/46206764
has comment: http://stackoverflow.com/comment/46207324
has comment: http://stackoverflow.com/comment/46206786
has body: I have this problem getting the return value from jQuery.Callback(), below is my code. This code generate using PHP: var data = {text : "Invalid input value", callback : "foobar"} Now using Javascript: function foobar(text){ //Check if empty return (text == '') ? true : false; } var callbacks = $.Callbacks(); callbacks.add(data.callback); var response = callbacks.fire('Hell World'); // I need the return value here form foobar function alert(response) The code above return jQuery $.Callbacks() object and not boolean. Any ideas or alternative to jQuery.Callbacks() ? Thanks in advance.
type: Question
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/46206877

wamp
tag name: wamp
tags question: http://stackoverflow.com/q/29031297
type: Tag

http://stackoverflow.com/q/29047130
has comment: http://stackoverflow.com/comment/46332914
score: 0
tagged with: wysihtml5
has title: Having trouble getting my toolbar to show with the WYSIHTML5 editor?
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46338504
upvote count: 1
has answer: http://stackoverflow.com/a/29050623
has comment: http://stackoverflow.com/comment/46448076
has answer: http://stackoverflow.com/a/34461672
has body: I'm trying to use the Wysihtml5 editor on a textarea on my site. If I use the defaults and don't specify a toolbar I get the default toolbar just fine but if I follow the documentation on the wysihtml5 website I don't get any toolbar. My custom toolbar: bold italic red green blue insert link Link: OK Cancel And my script to make the textarea a wysihtml5 editor: I've now created a jsfiddle of what I have setup. I still can not seem to control the toolbar as the instructions specify.
downvote count: 1
has comment: http://stackoverflow.com/comment/46332861
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/46079459
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28909971
has text: i edited my post and made it more clear, you can see after running the regex it removed the word "E-Mail:" and replaced it with a comma but its not creating a new column in my csv file.
score: 0

http://stackoverflow.com/comment/46179114
type: Comment
score: 2
comment on: http://stackoverflow.com/q/28963690
type: QuestionComment
has text: @NoDownvotesPlz It is the last child of active class

http://stackoverflow.com/comment/46320139
comment on: http://stackoverflow.com/a/29039531
score: 0
type: Comment
has text: still i i think something isnt exactly how it suppose to be, now its compilable but when i try add some contact it give me `Uncaught SyntaxError: Unexpected token`
type: AnswerComment

http://stackoverflow.com/tag/csv
type: Tag
tags question: http://stackoverflow.com/q/28998464
tag name: csv
tags question: http://stackoverflow.com/q/28959947
tags question: http://stackoverflow.com/q/28938568
tags question: http://stackoverflow.com/q/28921096
tags question: http://stackoverflow.com/q/28942878
tags question: http://stackoverflow.com/q/29014976
tags question: http://stackoverflow.com/q/29046228
tags question: http://stackoverflow.com/q/28931362
tags question: http://stackoverflow.com/q/29015201

http://stackoverflow.com/a/29170074
score: 0
type: AcceptedAnswer
type: Answer
has body: I solved my problem. It wasn't in my creation of my liveBroadcast or my liveStream resources, it was that I wasn't making the call to liveBroadcasts.bind() correctly. I was creating two different objects that I was passing as arguments- one containing the id and part of the liveBroadcast, and one containing the id of the liveStream with which I wanted to bind the broadcast. I was doing this: liveBroadcasts.bind({id: broadcastId, part: 'snippet,status'}, {streamId: streamId}); This was giving my request a body that contained the streamId. However, the bind method does NOT have a request body. I needed to include the streamId with the rest of the parameters like so: liveBroadcasts.bind({id: broadcastId, part: 'snippet,status',streamId: streamId});
accepted answer of: http://stackoverflow.com/q/28948327
answers question: http://stackoverflow.com/q/28948327

http://stackoverflow.com/comment/46291731
comment on: http://stackoverflow.com/a/29024497
type: Comment
type: AnswerComment
has text: Opps! sorry everyone for my negligences. Thank you!
score: 0

http://stackoverflow.com/q/28925070
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46106691
upvote count: 2
score: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/46106543
type: Question
has answer: http://stackoverflow.com/a/28925281
has answer: http://stackoverflow.com/a/28925256
tagged with: javascript
tagged with: dom
tagged with: abstraction
has comment: http://stackoverflow.com/comment/46106694
has title: How to write an abstraction layer to hide DOM element in jquery
answer count: 2
has comment: http://stackoverflow.com/comment/46106667
has comment: http://stackoverflow.com/comment/46106635
tagged with: jquery
favorite count: 0
has body: I want to hide all DOM element in my jquery scripts by an abstraction layer. for example HTML elements are like this &lt;input type="button" id="connectButton" value="Connect" /&gt; &lt;input type="button" id="hangupButton" value="Hangup" disabled="disabled"/&gt; and hangup click is like this $('#hangupButton').click(function () { helper.disable($('#hangupButton')); helper.enable($('#connectButton')); }); and I have defined a abstraction layer like following //The NameSpace var LPConnectWeb = LPConnectWeb || {}; //all classes LPConnectWeb.controlPanel = { HangUp: $("#hangupButton"), Connect: $('#connectButton'), } and access these element like following, but I am unable to do LPConnectWeb.controlPanel.HangUp.click();

http://stackoverflow.com/a/29003903
answers question: http://stackoverflow.com/q/29003461
type: Answer
has body: change the regex to var regExp = "^\d+(\,\d+)*$"; It works for any number of comma separated numbers
score: 0

http://stackoverflow.com/q/28991993
has title: Is producing a POS software in HTML/Javascript Viable?
type: Question
has answer: http://stackoverflow.com/a/28992206
tagged with: javascript
has comment: http://stackoverflow.com/comment/46232717
answer count: 2
tagged with: user-interface
downvote count: 0
favorite count: 0
has body: My Family Owns a Restaurant and for various reasons, I want to make a POS software to replace the one they currently use. I am most comfortable making GUI in html/css so, if possible, I would like to take this path. I just have a few concerns. Are There existing API's for dealing with printers, registers and credit card machines? Can I make these applications run on Linux, and if so, how? (I Know Linux Can't Run .hta) How would I go about connecting multiple terminals within the code? I don't expect I walkthrough, but any information would be greatly appreciated. Also, if using html/Javascript isn't viable, I would be open for suggestions. I am comfortable coding in C++ and Python, however I dont know of any easy ways to make GUI's with these languages. Thanks!
tagged with: linux
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46232221
has answer: http://stackoverflow.com/a/44764983
score: 3
upvote count: 3

http://stackoverflow.com/comment/46316023
has text: Thanks bheem raj,I can insert second query correctly,but the problem is on values goes to different id's.you can checkout my attached snapshot now,than you will get understand easily what i am trying to ask.
type: Comment
comment on: http://stackoverflow.com/a/29033675
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46133170
type: QuestionComment
comment on: http://stackoverflow.com/q/28939122
score: 0
has text: What do you mean by `not include other special characters` ? Post some valid and invalid strings.
type: Comment

http://stackoverflow.com/comment/46258471
has text: @jQuery according to the jQuery-Docs this works with the core, [demo](https://jsfiddle.net/n1mj7rer/) here, [.hide()](http://api.jquery.com/hide/): `A string or number determining how long the animation will run.`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29005798

http://stackoverflow.com/a/29006488
has comment: http://stackoverflow.com/comment/46265648
has comment: http://stackoverflow.com/comment/46263658
has comment: http://stackoverflow.com/comment/46268356
has comment: http://stackoverflow.com/comment/46259458
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46482383
has body: If I understand this correctly, you are having script file load multiple times because they are called in multiple elements. Please correct me if this is not right. I do see that the HTML file is what is being parsed twice but the script inside it is actually pulled from cache (on the second reference). If you don't want the HTML file to be parsed again, you'll need to setup caching for the HTML at the server or Service Worker level.
has comment: http://stackoverflow.com/comment/46259860
answers question: http://stackoverflow.com/q/28993429

replace
tags question: http://stackoverflow.com/q/28942550
tags question: http://stackoverflow.com/q/29014473
type: Tag
tags question: http://stackoverflow.com/q/28962308
tag name: replace
tags question: http://stackoverflow.com/q/28940119

http://stackoverflow.com/comment/46231690
type: Comment
has text: https://jsfiddle.net/kennakins/snmbxaLa/ So I got it working fine on click, but I'd like to be able to have it open on Hover and then be able to open on Click when in mobile. :-/
type: QuestionComment
comment on: http://stackoverflow.com/q/28989887
score: 0

regex
tags question: http://stackoverflow.com/q/28925985
tags question: http://stackoverflow.com/q/28963501
tags question: http://stackoverflow.com/q/28910934
tags question: http://stackoverflow.com/q/28951538
tags question: http://stackoverflow.com/q/28916008
tags question: http://stackoverflow.com/q/28965594
tags question: http://stackoverflow.com/q/29060534
tags question: http://stackoverflow.com/q/28909971
tags question: http://stackoverflow.com/q/28935569
tags question: http://stackoverflow.com/q/28926906
tags question: http://stackoverflow.com/q/28918303
tag name: regex
tags question: http://stackoverflow.com/q/28952644
tags question: http://stackoverflow.com/q/29024517
tags question: http://stackoverflow.com/q/29007023
tags question: http://stackoverflow.com/q/28957915
tags question: http://stackoverflow.com/q/28913619
tags question: http://stackoverflow.com/q/29043057
tags question: http://stackoverflow.com/q/28945396
tags question: http://stackoverflow.com/q/29027897
tags question: http://stackoverflow.com/q/28968536
tags question: http://stackoverflow.com/q/29053758
tags question: http://stackoverflow.com/q/28958761
tags question: http://stackoverflow.com/q/29014473
tags question: http://stackoverflow.com/q/28930321
tags question: http://stackoverflow.com/q/28988149
tags question: http://stackoverflow.com/q/28946649
tags question: http://stackoverflow.com/q/29032499
tags question: http://stackoverflow.com/q/29031792
tags question: http://stackoverflow.com/q/28938095
tags question: http://stackoverflow.com/q/28933570
tags question: http://stackoverflow.com/q/28969369
tags question: http://stackoverflow.com/q/29002143
tags question: http://stackoverflow.com/q/29028756
tags question: http://stackoverflow.com/q/28944185
tags question: http://stackoverflow.com/q/29015939
tags question: http://stackoverflow.com/q/28947562
tags question: http://stackoverflow.com/q/28943230
tags question: http://stackoverflow.com/q/28939122
tags question: http://stackoverflow.com/q/28988988
tags question: http://stackoverflow.com/q/28977577
tags question: http://stackoverflow.com/q/28925477
tags question: http://stackoverflow.com/q/28983004
tags question: http://stackoverflow.com/q/28971026
tags question: http://stackoverflow.com/q/28920384
tags question: http://stackoverflow.com/q/28980963
tags question: http://stackoverflow.com/q/29054506
tags question: http://stackoverflow.com/q/29057223
tags question: http://stackoverflow.com/q/28973118
tags question: http://stackoverflow.com/q/29051867
tags question: http://stackoverflow.com/q/28919869
tags question: http://stackoverflow.com/q/28925752
tags question: http://stackoverflow.com/q/29032901
tags question: http://stackoverflow.com/q/28965514
tags question: http://stackoverflow.com/q/29010802
tags question: http://stackoverflow.com/q/29055828
tags question: http://stackoverflow.com/q/28980885
tags question: http://stackoverflow.com/q/28969468
tags question: http://stackoverflow.com/q/29017494
tags question: http://stackoverflow.com/q/28920076
tags question: http://stackoverflow.com/q/28908435
tags question: http://stackoverflow.com/q/28997213
tags question: http://stackoverflow.com/q/28940496
tags question: http://stackoverflow.com/q/29020531
tags question: http://stackoverflow.com/q/28909876
tags question: http://stackoverflow.com/q/29051459
tags question: http://stackoverflow.com/q/28977606
tags question: http://stackoverflow.com/q/28999955
tags question: http://stackoverflow.com/q/28992809
tags question: http://stackoverflow.com/q/28962427
tags question: http://stackoverflow.com/q/28959928
tags question: http://stackoverflow.com/q/28965568
tags question: http://stackoverflow.com/q/28960125
tags question: http://stackoverflow.com/q/28918713
tags question: http://stackoverflow.com/q/28974701
tags question: http://stackoverflow.com/q/28940119
tags question: http://stackoverflow.com/q/29000822
tags question: http://stackoverflow.com/q/29029992
tags question: http://stackoverflow.com/q/29000583
tags question: http://stackoverflow.com/q/29003461

http://stackoverflow.com/comment/46224112
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28977965
type: AnswerComment
has text: Thank you for taking the time to explain :). Very helpful!

http://stackoverflow.com/comment/46329520
score: 0
has text: What is the user entered two spaces?
comment on: http://stackoverflow.com/a/29045030
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29002437
has answer: http://stackoverflow.com/a/29018493
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29013450
has body: I'm having a bit of an issue here. I had a small amount of success with event.target.templateInstance.model.thing syntax to get the value of attributes from within a repeating template but I keep getting back undefined from this bit of code I have here: downloadFunction: function (e) { console.log("dl function clicked"); //get particular id of thing var fu = e.target.templateInstance.model.s.soundId; console.log(fu); //^ returns "TypeError: Cannot read property 'soundId' of undefined" } And my repeating template is here: Where carddata is just an array with my data in it. All of the values are generated fine so I know it's not an issue with my array. I'm just confused how exactly I'm supposed to target someting from within the repeating template? Am I calling it at the wrong time? Or am I messing up the syntax of the templateInstance bit? If it matters, I'm trying to get it to work in an Android 4.4 webView using Apache Cordova. 4.4 webView doesn't appear to enjoy the shadowDOM terribly much. Thanks! edit: After some jiggery pokery with console logs, it appears that the sender value is referring to the div that I apply the on-click="{{downloadFunction}} to. Here's the template that I am repeating, if this provides any insight. //can't target this one either on WebView 4.4, works on ChromeOS {{quotetext}} //I have an 'a' tag for desktop browsers and the div tag is targeting my Android/iOS //apps that I am exporting as a webView to using Apache Cordova. Webonly is hidden //at the point where I'm trying to get my downloadfunction to work. //console.log(sender) in my downloadfunction returns this div v //just a hidden audio thing for web edit2 some console logs.. console.log(sender) and console.log(event.target) are both the same div that has the on-click event for my downloadFunction.. not sure if this should be the case. console.log(e.target.templateInstance.model) returns my object, I believe like it should(?) It's just when I add the specific .s.soundId that it's un…
type: Question
tagged with: polymer
has answer: http://stackoverflow.com/a/29022846
score: 4
upvote count: 4
answer count: 3
downvote count: 0
tagged with: javascript
has title: Polymer - Get data-bound attribute value in repeating template
favorite count: 0

livestamp.js
tag name: livestamp.js
tags question: http://stackoverflow.com/q/28939107
type: Tag

http://stackoverflow.com/comment/46099247
score: 1
type: AnswerComment
has text: It depends on the use-case, but `delete` on an array should normally not be used, because it behaves different then people would expect.
type: Comment
comment on: http://stackoverflow.com/a/28920825

http://stackoverflow.com/comment/46181294
type: QuestionComment
type: Comment
has text: You mean set focus according to the server value?
comment on: http://stackoverflow.com/q/28964766
score: 0

http://stackoverflow.com/q/29024583
score: 0
has comment: http://stackoverflow.com/comment/46291929
tagged with: this
has body: Just wondering if these two are always the same, and if not in what context? I think I understand 'bind' and 'this', I just want to be sure. The context of what I'm trying to understand, above and beyond 'bind' and 'this', I have an object.. var Foo = Class.create({ a: func.bind(this), b: func }); Are and a and b's this the same? What's the difference in the two. If b gets the this, of the callee that callee in the context of Foo.b is Foo. In the case of a we're explicitly saying this is the object at the time we install the method a.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46291766
has comment: http://stackoverflow.com/comment/46291787
tagged with: bind
has comment: http://stackoverflow.com/comment/46291895
has title: Is `this.foo` always the same as `foo.bind(this)`?
has comment: http://stackoverflow.com/comment/46293003
type: Question
has comment: http://stackoverflow.com/comment/46291780
has comment: http://stackoverflow.com/comment/46292671
has comment: http://stackoverflow.com/comment/46291794
has answer: http://stackoverflow.com/a/29024607
answer count: 1
has comment: http://stackoverflow.com/comment/46291835
tagged with: javascript
has comment: http://stackoverflow.com/comment/46291959
has comment: http://stackoverflow.com/comment/46291941

http://stackoverflow.com/a/29066246
accepted answer of: http://stackoverflow.com/q/29018963
upvote count: 1
has comment: http://stackoverflow.com/comment/46368146
downvote count: 1
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/82360103
has body: So this works {resultTitles.map(function(title){ var textAlignLeft = false; if(textLeftMatch.test(title)){ textAlignLeft = true; } title = title.replace(/_/g, " "); return {title} })} {resultData.map(function(tableRow, i) { return ( <TableRow tableRow={tableRow} key={i} /> ); })} var TableRow = React.createClass({ render: function(){ var tableRow = this.props.tableRow; var rowArray = $.map(tableRow, function(value, index){ return [value]; }); return( {rowArray.map(function(tableItem, i){ return {tableItem} })} ); } }); However, after searching for awhile, I found a better starting point found here http://dynamictyped.github.io/Griddle/quickstart.html
type: Answer
has comment: http://stackoverflow.com/comment/46395100
answers question: http://stackoverflow.com/q/29018963

http://stackoverflow.com/comment/46322284
type: AnswerComment
type: Comment
score: 0
has text: Thanks for your detailed answer. I will pay attention to the things you mentioned. I am just a little new to Meteor as you can see :). Anyway, I have updated the question with the Github repo and the test site. The hooks are still running twice even after the changes.
comment on: http://stackoverflow.com/a/29035836

mocha.js
tags question: http://stackoverflow.com/q/29053532
tags question: http://stackoverflow.com/q/29057438
tags question: http://stackoverflow.com/q/28933457
tags question: http://stackoverflow.com/q/28962852
tags question: http://stackoverflow.com/q/28937525
tags question: http://stackoverflow.com/q/28941245
tag name: mocha.js
tags question: http://stackoverflow.com/q/28956295
type: Tag
tags question: http://stackoverflow.com/q/29050720
tags question: http://stackoverflow.com/q/29062374

http://stackoverflow.com/a/28966325
accepted answer of: http://stackoverflow.com/q/28966023
has body: Objects in chrome console get evaluated only when they are first opened. This means that when you console.log an object like the return value of Auth.getCurrentUser(), the console displays a reference to it - this at the time of the log call contains a promise object, but it's most likely resolved by the time you open it on the console, so you see the property you're looking for. On the other hand, when you're logging $scope.getCurrentUser._id, that's the result of a property lookup on the promise object - and it prints the current value of the property, which is undefined. A note about clean code: your scope variable is called getCurrentUser, which makes one think it's a getter function, but it is infact the return value of a getter function. This is confusing.
score: 4
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/66225633
type: Answer
has comment: http://stackoverflow.com/comment/66238127
answers question: http://stackoverflow.com/q/28966023
upvote count: 4

http://stackoverflow.com/comment/46239317
score: 0
has text: @Nielarshi +1 want to up your answer but I need to have 15 reps, thanks very much!
type: Comment
comment on: http://stackoverflow.com/a/28992095
type: AnswerComment

http://stackoverflow.com/q/29057383
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46351698
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29057431
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29057431
score: 0
has body: So I am determining which is a prime number and which isn't, but I am just not understanding how it ends up with the correct output. So the first starts at 2 and loops by 1 to 100. Easy. But the second starts at 0, and loops by y + itself, this would make sense, but in determining the primes, it should mess up, atleast I thought it's like: 1+3 = 4 or 2 + 4 = 6 or 3 + 5 = 8 and that works, but what happens to let's say the 15? that isn't a prime number. How is numbers like that sorted in the loop? var prim = []; var notprim = []; for(var x = 2; x &lt;= 100; x++){ if(!notprim[x]){ prim.push(x); for(var y = 0; y &lt;= 100; y = y+x){ notprim[y] = true; document.write(y); } } }
has comment: http://stackoverflow.com/comment/46351898
answer count: 1
favorite count: 0
upvote count: 1
has title: Sorting out numbers in for loops

http://stackoverflow.com/comment/46168067
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28942607
has text: so that i can pass to controller class

http://stackoverflow.com/a/29134940
score: 1
answers question: http://stackoverflow.com/q/29053927
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29053927
has body: After hours of digging and research I have been able to find out how to resolve this problem... I have done two things. I stopped using Rhino (considering it is outdated) and I switched to Nashorn I also found out how to implement document How to append xml nodes (as a string) into an existing XML Element node (only using java builtins)? That took very unconventional means to find this answer, which would make any programmer go "Oh...That's one way to do it." The way implemented in the question actually worked. DISCLAIMER My problems are not completely solved. Nashorn still gives me this error Exception in thread "main" java.lang.ClassCastException: Cannot cast java.lang.String to org.w3c.dom.DocumentType But, that's another question.
type: Answer

http://stackoverflow.com/q/29033261
has body: I have created a slideshow module for joomla 2.5.x/3.x. It reads image files in specified directory and shows slides. Today I wanted to use it in another template. Joomla shows my slideshow module well but even numbered slides are hidden. 1st is shown and 2nd is hidden, 3rd is shown and 4th is hidden and so on. My html output is as the following:
tagged with: javascript
tagged with: jquery
has title: Even number slides are hidden in Bootstrap's carousel
type: Question
has answer: http://stackoverflow.com/a/29103389
possible better answer: http://stackoverflow.com/a/29037571
tagged with: css
has answer: http://stackoverflow.com/a/29037571
tagged with: joomla
tagged with: twitter-bootstrap
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/29103389
type: AnsweredQuestion

http://stackoverflow.com/a/29063274
score: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29061862
type: Answer
answers question: http://stackoverflow.com/q/29061862
upvote count: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/100509369
has body: Find the below code. When the document is ready you can get input field value. For more info check my jsfiddle link. Note: you can use blur event instead of focus. $(document).ready(function() { var get_val = $("#val").val(); alert("there are " + get_val + " in your cart"); $("#val").blur(function(){ var get_val = $(this).val(); alert("there are " + get_val + " in your cart"); }); }); jsfiddle

http://stackoverflow.com/q/28988135
tagged with: scrollbar
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28988873
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28988873
tagged with: sticky
has answer: http://stackoverflow.com/a/28988331
favorite count: 0
has title: Div to follow scrollbar proportionally on a page
upvote count: 2
has body: I'm now struggling on a sticky element that should scroll proportionally on a page. From top to the footer despite the page's height. So it's actually stick to the top of the scrollbar in the beginning and then to the bottom at the end. Or it just follows the scroll wheel. Is there any chance to do it with jQuery ? Below is the starting code with usual "sticky" div. $(window).scroll(function(){ $("#sticky") .animate({"marginTop":($(window).scrollTop())+"px"}, "fast");}); https://jsfiddle.net/flakessp/cxr78xc8/
tagged with: css
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/28988331

http://stackoverflow.com/comment/46285444
type: Comment
score: 1
has text: You have to use different callback names each time you make a JSONP request - otherwise function for the last one will overwrite the function for the first one before the response for the first one has been received.
comment on: http://stackoverflow.com/q/29020678
type: QuestionComment

http://stackoverflow.com/q/29036180
has answer: http://stackoverflow.com/a/29040735
has comment: http://stackoverflow.com/comment/46314642
has comment: http://stackoverflow.com/comment/46313489
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/29036876
tagged with: http://stackoverflow.com/tag/json
has body: I am trying to search my users table using the jquery ui autocomplete widget. The two fields from my users table, which I would like to search for: TABLE `users` `user_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `user_email` varchar(64) COLLATE utf8_unicode_ci NOT NULL The view &lt;script&gt; $(function() { $.ajax({ url: "/friend/showFriends", //the function in the controller dataType: "json", success: function(response){ var data = $(response).map(function(){ return {value: this.friend_usernames}; //I am pretty sure this is not correct? }).get(); console.log(data); $("#searchFriends").autocomplete({ source: data, minLength: 1 }); }); }); }); &lt;/script&gt; &lt;input type="search" id="searchFriends" placeholder="find friends"/&gt; The controller /** * Show friends */ public function showFriends() { $this-&gt;View-&gt;render('friend/index', array( 'privateFriends' =&gt; FriendModel::displayFriends(), 'searchFriends' =&gt; FriendModel::searchUsers() )); } The model /** * Search users table */ public static function searchUsers() { //if(isset($_GET['term'])) { /* Commented out for testing */ $database = DatabaseFactory::getFactory()-&gt;getConnection(); $query = $database-&gt;prepare("SELECT * FROM users WHERE (user_name LIKE :term or user_email LIKE :term) ORDER BY user_id LIMIT 5"); $query-&gt;execute(array(':term' =&gt; '%'.$_GET['term'].'%')); $friends = $query-&gt;fetchAll(); $friend_usernames = array(); foreach($friends as $friend) { $friend_usernames[] = $friend-&gt;user_name; $friend_usernames[] = $friend-&gt;user_email; } /* output results as json encoded array. */ echo json_encode($friend_usernames); //} } The Output Notice: Undefined index: term ["user1","user1@email.com","user2","user2@email.com"] So I am able to output the JSON on the site, however I am not able to search it with the autocomplete widget! Can anybody help me out, please? I am not using any kind of framework or cms. I would be very happy about any kind of help!
upvote count: 1
has answer: http://stackoverflow.com/a/29036876
type: Question
accepted answer: http://stackoverflow.com/a/29040735
tagged with: jquery-ui-autocomplete
tagged with: autocomplete
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 3
has title: Use jquery ui autocomplete to search JSON output in MVC
has comment: http://stackoverflow.com/comment/46313949
favorite count: 0
has answer: http://stackoverflow.com/a/29038816

http://stackoverflow.com/a/28998410
has comment: http://stackoverflow.com/comment/71051617
accepted answer of: http://stackoverflow.com/q/28998308
type: Answer
answers question: http://stackoverflow.com/q/28998308
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: You should be doing slickAdd and slickRemove each time you load data setInterval(function(){ $.ajax({ url: '../class/Erection.php?createView=1', success: function (html) { $('.erection-carousel').slick('slickRemove',0); //remove elements starting with child 0 $('.erection-carousel').slick('slickAdd',html); //re-add new html }, type: 'GET' }); }, 5000);

http://stackoverflow.com/comment/46291828
type: Comment
comment on: http://stackoverflow.com/a/29024607
score: 0
has text: This is exactly what I was looking for. If no one else has any other exaples of where they're different, I'll accept this. Thanks a ton!
type: AnswerComment

http://stackoverflow.com/comment/46405162
has text: getThumbnailAsync was made specificially to limit the size of an image being loaded, and to draw from image caches on the file system, and thus it performs quite well. When you have a large image, the memory requirements go up dramatically and perhaps that's part of the slowdown. If you have to use a URI, one approach you might take is to automatically make a downsampled copy that's much smaller (i.e. do you own thumbnails), and send the URI to that. Just a thought. Otherwise, if you're just letting the img element load the file, there's not much more you can do.
comment on: http://stackoverflow.com/q/28941520
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46304261
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29028846
type: Comment
has text: No, you cannot do that, because the first throw statement surrenders your command flow. If you want to catch all errors separately, I think you need to chain them somehow, but it would be easier if you caught and handled them all at the same place.

http://stackoverflow.com/comment/46434581
score: 0
type: AnswerComment
type: Comment
has text: Thank you for your answer, but it did not improve. I'll try to find another way while looking that site.
comment on: http://stackoverflow.com/a/29061671

http://stackoverflow.com/comment/46213913
type: AnswerComment
has text: please use file_exist() function before using unlink function
comment on: http://stackoverflow.com/a/28980851
type: Comment
score: 0

http://stackoverflow.com/comment/46221072
type: Comment
comment on: http://stackoverflow.com/a/28985454
type: AnswerComment
score: 0
has text: you cant do this with a standard you will need to roll-your-own or find a menu plugin [Click Here](http://jquery.com)

http://stackoverflow.com/comment/46324118
has text: KJ Prince already answerd. It is working. And it was loading perfectly fine, just couldt figure out how to access the var outside the scope of the loading function.
comment on: http://stackoverflow.com/q/29041216
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/q/29019321
type: Question
has comment: http://stackoverflow.com/comment/46282533
tagged with: javascript
score: 0
upvote count: 1
answer count: 1
downvote count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46282499
has answer: http://stackoverflow.com/a/29019662
tagged with: obfuscation
has title: Which obfuscator generates this javascript code?
has body: I need a javascript obfuscator. I came across this code where the function name and the parameter names have been obfuscated. I've looked UglifyJS and Google Closure but they seam to just minimize the code. Do you know which obfuscator has that capability? function oa(a,b,c){return a.call.apply(a.bind,arguments)}function pa(a,b,c){if(!a)throw Error();if(2&lt;arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function qa(a,b,c){qa=Function.prototype.bind&amp;&amp;-1!=Function.prototype.bind.toString().indexOf("native code")?oa:pa;return qa.apply(null,arguments)} function ra(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var x=Date.now||function(){return+new Date};function y(a,b){var c=a.split("."),d=q;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&amp;&amp;(e=c.shift());)!c.length&amp;&amp;u(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}} function z(a,b){function c(){}c.prototype=b.prototype;a.m=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.th=function(a,c,f){for(var g=Array(arguments.length-2),k=2;k&lt;arguments.length;k++)g[k-2]=arguments[k];return b.prototype[c].apply(a,g)}};var sa;var ta=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};
has comment: http://stackoverflow.com/comment/46282480

openlayers-3
type: Tag
tag name: openlayers-3
tags question: http://stackoverflow.com/q/29045427
tags question: http://stackoverflow.com/q/29006125
tags question: http://stackoverflow.com/q/28968064
tags question: http://stackoverflow.com/q/28944462
tags question: http://stackoverflow.com/q/29032383

http://stackoverflow.com/comment/46267125
has text: Thanks for the idea, but for some reason, that renders different when the template get loaded that way, I suppose I'm gonna put the template in the js, it was not my intention because viewing/editing a multiline string in javascript is not the nicest thing in the world.
type: Comment
comment on: http://stackoverflow.com/a/28997193
score: 0
type: AnswerComment

http://stackoverflow.com/q/28916571
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46114119
has title: Debug var on php inside js
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28917230
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46093296
tagged with: php
has body: I have a script (editablegrid) that loads an php file (loaddata.php) inside a js file(JSON)(demo.js). When i make a js alert on php file: echo '&lt;script language="javascript"&gt;'; echo 'alert("message successfully sent")'; echo '&lt;/script&gt;'; Script stopped and alert it's not show. If i remove this echo's script works fine. How can i make an alert to see a var (an $sql var)? Thanks
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28917781

http://stackoverflow.com/q/28951171
has answer: http://stackoverflow.com/a/28954845
score: 1
type: Question
answer count: 1
tagged with: javascript
has title: jsTree search textbox does not appear
tagged with: jquery
has body: I am using jsTree (http://www.jstree.com/plugins/) with below plugins "plugins" : [ "dnd" , "contextmenu" ,"ui" , "types" , "search" ,"sort" ] All plugins are working fine except search.There is no search textbox added above tree to search node.Is there any other dependency to use search in jsTree. Please help.
favorite count: 0
accepted answer: http://stackoverflow.com/a/28954845
tagged with: jstree-search
upvote count: 2
downvote count: 1
tagged with: jstree
type: AnsweredQuestion

http://stackoverflow.com/q/28933292
tagged with: javascript
tagged with: date
has comment: http://stackoverflow.com/comment/46122475
has body: I have string in this format: var date = "2012-02-12"; I would like return the date in this format: 12.2.2012 What is the easiest way for this? I was trying var date = new Date( "2012-02-12" ).format("dd.m.yy"); but its returning error undefined is not a function.
answer count: 3
has comment: http://stackoverflow.com/comment/46122374
linked to: http://stackoverflow.com/q/3552461
has title: Format string with date by javascript to another format
favorite count: 0
accepted answer: http://stackoverflow.com/a/28933485
has answer: http://stackoverflow.com/a/28933452
tagged with: string-formatting
has comment: http://stackoverflow.com/comment/46122436
possible better answer: http://stackoverflow.com/a/28933452
type: AnsweredQuestion
downvote count: 3
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28933531
has comment: http://stackoverflow.com/comment/46122412
tagged with: format
has answer: http://stackoverflow.com/a/28933485
score: -2
tagged with: date-formatting

http://stackoverflow.com/comment/46277436
score: 0
has text: which page of http://rroyales.webfactional.com/ uses it ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29002963

http://stackoverflow.com/a/50427028
upvote count: 33
score: 33
downvote count: 0
has body: In your webpack.config.js file add below: var webpack = require("webpack"); plugins: [ new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery" }) ], Install jQuery using npm: $ npm i jquery --save In app.js file add below lines: import $ from 'jquery'; window.jQuery = $; window.$ = $; This worked for me. :)
answers question: http://stackoverflow.com/q/28969861
type: Answer
has comment: http://stackoverflow.com/comment/104734628
has comment: http://stackoverflow.com/comment/111925534

http://stackoverflow.com/comment/46164104
comment on: http://stackoverflow.com/q/28954746
score: 0
has text: osx 10.10 although I also want it to work on raspberry PI
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46212150
has text: what is the different of $.ajax({}) and $.post()?
comment on: http://stackoverflow.com/a/28981123
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46341207
type: Comment
comment on: http://stackoverflow.com/a/29030769
has text: Hey Raihan Firoz Thanks a lot for your quick answer. I am trying to make it work and as a newbie I think it is a bit tricky.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28943762
score: 4
has comment: http://stackoverflow.com/comment/46154575
has body: You should not use regex here. var html = ' Ololo - text’s life olololo texttext Filter the events lists by host. Create graphs for separate hosts and for the groups of hosts. bbcvbcvbcvbcvbcvbcvbcvb cvbcbcvbcvbcvbccb '; var div = document.createElement('div'); div.innerHTML = html; function removeAllAttrs(element) { for (var i = element.attributes.length; i-- > 0;) element.removeAttributeNode(element.attributes[i]); } function removeAttributes(el) { var children = el.children; for (var i = 0; i < children.length; i++) { var child = children[i]; removeAllAttrs(child); if (child.children.length) { removeAttributes(child); } } } removeAttributes(div); console.log(div.innerHTML); Working Fiddle Source
type: Answer
has comment: http://stackoverflow.com/comment/46142230
answers question: http://stackoverflow.com/q/28943230
has comment: http://stackoverflow.com/comment/46142096
upvote count: 4
has comment: http://stackoverflow.com/comment/46142400
downvote count: 0

http://stackoverflow.com/comment/46112730
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28928467
has text: Please explain your answers. Else people will downvote.

http://stackoverflow.com/a/29039573
type: Answer
accepted answer of: http://stackoverflow.com/q/29039523
answers question: http://stackoverflow.com/q/29039523
score: 4
upvote count: 4
type: AcceptedAnswer
has body: linkeShowAjax is only defined in the scope of the .ready callback method. Move this function outside of this: $(document).ready(function () { //whatever you want to do here }); function linkeShowAjax(link) { $("#pageview").html("Loading..."); $.ajax({ url: link, success: function(result){ $("#data").html(result); } }); }
downvote count: 0

http://stackoverflow.com/q/29030169
has comment: http://stackoverflow.com/comment/46302735
tagged with: servlets
accepted answer: http://stackoverflow.com/a/29030826
answer count: 1
downvote count: 0
tagged with: jsp
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/16397207
has comment: http://stackoverflow.com/comment/46301701
has answer: http://stackoverflow.com/a/29030826
upvote count: 1
has body: I am developing one sample web application using JSP and Servlets, in this application i have set some object in the Servlets, i can retrieve that value in JSP by using request.getAttribute("Object"). Here i want to iterate that array of value in JSP. How can i achieve this any one help me. My servlet code: ArrayList&lt;Performer&gt; Performerobj=new ArrayList&lt;Performer&gt;(); ResultSet rst = stm1.executeQuery("some query"); while (rst.next()) { Performer obj=new Performer(); obj.setProject(projectname); obj.setCount(rst.getString("COUNT")); obj.setDate(rst.getString("DATE")); obj.setEmpid(rst.getString("empid")); Performerobj.add(obj); } request.setAttribute("Performer", Performerobj); Performer.java public class Performer { private String project; private String empid; private String date; private String count; public String getProject() { return project; } public void setProject(String project) { this.project = project; } /*setter and getter...... for all*/ Perform.jsp &lt;% List&lt;Performer&gt;obj1=List&lt;Performer&gt;)request.getAttribute("Performerobj"); %&gt; &lt;script&gt; var obj=&lt;%=obj1%&gt; for(obj object : list) { /*IS it correct way or how can i iterate*/ } &lt;/script&gt;
type: Question
type: AnsweredQuestion
score: 1
has title: How to retrieve Arraylist object in javascript/jsp?
tagged with: java

three.js
tags question: http://stackoverflow.com/q/28971164
tags question: http://stackoverflow.com/q/28915124
tags question: http://stackoverflow.com/q/28928865
tag name: three.js
tags question: http://stackoverflow.com/q/28945551
tags question: http://stackoverflow.com/q/29043680
tags question: http://stackoverflow.com/q/28941758
tags question: http://stackoverflow.com/q/28948467
tags question: http://stackoverflow.com/q/28970078
tags question: http://stackoverflow.com/q/29015859
tags question: http://stackoverflow.com/q/29016344
tags question: http://stackoverflow.com/q/28930265
type: Tag
tags question: http://stackoverflow.com/q/28946566
tags question: http://stackoverflow.com/q/28951352
tags question: http://stackoverflow.com/q/28950738
tags question: http://stackoverflow.com/q/29034194
tags question: http://stackoverflow.com/q/28912303
tags question: http://stackoverflow.com/q/28957575
tags question: http://stackoverflow.com/q/28939827
tags question: http://stackoverflow.com/q/28996271
tags question: http://stackoverflow.com/q/28966958
tags question: http://stackoverflow.com/q/28989630
tags question: http://stackoverflow.com/q/28998628
tags question: http://stackoverflow.com/q/28998379
tags question: http://stackoverflow.com/q/28915627

http://stackoverflow.com/comment/46351043
type: Comment
has text: Thank you. I know that should work, but I'm still doing something wrong, somehow. This is very frustrating, haha. The only files I have are: init.js (completely blank) index.html style.css The code for index.html is on the left and the code for style.css is on the right: http://i.imgur.com/aGH6xbb.png sorry, I would upload the actual files but I don't know how
comment on: http://stackoverflow.com/a/29056828
type: AnswerComment
score: 0

http://stackoverflow.com/q/28988552
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
type: Question
score: 0
accepted answer: http://stackoverflow.com/a/28988603
has comment: http://stackoverflow.com/comment/46225717
has answer: http://stackoverflow.com/a/28988609
has answer: http://stackoverflow.com/a/28988602
answer count: 3
has body: Is it possible to do the following thing ? I have this div: Title My text is so awesome! I like ponies and cookies. And the following jQuery snippet: $(".articleBoxContent").click(function() { window.location = $(this).find("h2").find("a").attr("href"); return false; }); What I want to do is that when I click on my div, it sends me to the link contained in the H2 elements (myLink) ONLY if the div doesn't contain another link in the p elements. But I can't figure out how to say to jQuery to differenciate links in H2 elements from links in p elements. Any idea ? Thanks !
possible better answer: http://stackoverflow.com/a/28988602
has title: jQuery obtain links from specific child
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28988603

http://stackoverflow.com/comment/46692221
type: AnswerComment
comment on: http://stackoverflow.com/a/29240010
score: 0
type: Comment
has text: Yeah, it opens browser for a moment to get redirected to calendar app. I'll try to prevent default behavior and replace it with `location.href` logic. Will check this a bit later.

http://stackoverflow.com/comment/46500404
type: QuestionComment
comment on: http://stackoverflow.com/q/29035552
has text: I already tried this. But same error browser console
score: 0
type: Comment

rpc
tag name: rpc
tags question: http://stackoverflow.com/q/29021908
type: Tag

http://stackoverflow.com/comment/46109966
type: Comment
has text: There are other elements, so it is necessary to tell apart the .active item from the others...
comment on: http://stackoverflow.com/a/28926981
score: 0
type: AnswerComment

http://stackoverflow.com/q/28917665
type: Question
tagged with: javascript
tagged with: variables
has comment: http://stackoverflow.com/comment/46093418
score: 0
has body: I am using integration NodeJS and PHP, MySQL. And I have problem. When I wan't to save chat message i need to get 'username' from 'index.php'. With javascript i did var username = ""; How can I do that in NodeJS? To use variable from 'index.php'.
type: UnansweredQuestion
tagged with: php
tagged with: node.js
has comment: http://stackoverflow.com/comment/46093402
answer count: 0
tagged with: mysql
has title: PHP/JavaScript variable to NodeJS

http://stackoverflow.com/comment/46224371
has text: @MarkusCoetzee so how come you're setting `initialA` from the component and not from the store?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28984512

http://stackoverflow.com/comment/46227299
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28988978
type: AnswerComment
has text: How does this code get the text back to the original state?

http://stackoverflow.com/a/29023973
accepted answer of: http://stackoverflow.com/q/29023942
type: Answer
score: 2
downvote count: 0
has body: You could simplify it to the following: Example Here $('#agree').on('change', function () { $('#continue').attr('disabled', !this.checked); }); $('#agree').on('change', function () { $('#continue').attr('disabled', !this.checked); }); I agree The reason your code wasn't working was because you were using .attr(). Since there is no value attribute, you needed to use .prop(). This still wouldn't work though because the value will always return on. You need to get the checked property accessing this.checked or .prop('checked') - working example using your original snippet. $('#agree').on('change', function () { if (this.checked) { $('#continue').removeAttr('disabled') } else { $('#continue').attr('disabled', 'disabled'); } });
upvote count: 2
answers question: http://stackoverflow.com/q/29023942
type: AcceptedAnswer

http://stackoverflow.com/q/29016296
tagged with: javascript
type: UnansweredQuestion
has body: I would like to get a select option to hide when the webpage is loaded and I have used s2.style.visibility = "hidden"; To do so but It will only hide the second select button once the first one has been manipulated. I am trying to make it so that when the webpage first loads it isn't there until the category genre has appeared. function populate(s1, s2) { var s1 = document.getElementById(s1); var s2 = document.getElementById(s2); s2.innerHTML = ""; s2.style.visibility = "hidden"; if(s1.value == "genre") { s2.style.visibility = "visible"; var optionArray = ["|", "rap|Rap", "r and b|R And B", "rock|Rock", "indie|Indie", "dance|Dance"]; } else { } for(var option in optionArray) { var pair = optionArray[option].split("|"); var newOption = document.createElement("option"); newOption.value = pair[0]; newOption.innerHTML = pair[1]; s2.options.add(newOption); } }
has answer: http://stackoverflow.com/a/29016367
type: Question
tagged with: http://stackoverflow.com/tag/html
score: 0
has title: How To Get Element To Hide When Webpage Is Loaded
answer count: 1

http://stackoverflow.com/comment/46361237
has text: It is working.. but the entire function is in onchange.. how can i change it in document ready itself
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29062377
type: Comment

http://stackoverflow.com/comment/46078157
type: Comment
comment on: http://stackoverflow.com/a/28909252
has text: thanks so much for the assist. I modified the code and I am trying to understand it. Currently with your changes it is still not working. Updating the code to reflect changes on post.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46107495
score: 0
has text: To `#nav01` tag. Here you have an [example](http://fiddle.jshell.net/y6xmya2k/1/)
type: Comment
comment on: http://stackoverflow.com/q/28925081
type: QuestionComment

http://stackoverflow.com/comment/46117321
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28930727
has text: If you know this question has been asked before, why don't you read the existing answer, learn it, understand how to change it to fit your needs? Answers given are for people to learn from and understand, not a copy/paste into the site.
score: 0

http://stackoverflow.com/a/29049310
score: 5
has body: replace the href value in javascript:void(0); and the click on the link will produce no effect + add stop-point
has comment: http://stackoverflow.com/comment/110821727
answers question: http://stackoverflow.com/q/29049282
type: Answer
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/132161539

http://stackoverflow.com/comment/46181479
score: 0
type: AnswerComment
has text: The call to the hide() function will simply set the following css property: display:none; . So this is a standard. You can also set the css property directly without calling hide() with the following HTML : ...
type: Comment
comment on: http://stackoverflow.com/a/28964778

http://stackoverflow.com/q/28924482
tagged with: javascript
linked to: http://stackoverflow.com/q/28386289
possible better answer: http://stackoverflow.com/a/28925572
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28925572
has body: I try to implement 'stick' scroll on dynamic content, my working example here. This working, but when append new items I see small 'flicker', this is based on timeout 0, but without this timeout example not working when try add new 50 items. Also I can't use virtual/custom scroll, like in ionic example. This is should be native html scroll. Any thinks how to resolve this problem? HTML: Total: {{items.length}} Prepend (1) js: (function(angular) { var app = angular.module('demoApp', []).controller('TestCtrl', function($scope) { $scope.items = []; $scope.count = 0; $scope.manualCount = 0; $scope.prepend = function(count){ for(var i = 1; i <= count; i++){ $scope.count++; $scope.items.unshift({ imageSrc: 'http://placehold.it/90x140&text='+$scope.count }); } }; }).directive('list', ['$timeout', function($timeout){ return { restrict: "EA", transclude: false, replace: false, template: ' ', scope: { itemSource: '=' }, compile: function(){ return { pre: function(scope, element, attrs, ctrl){ ctrl.setElement(element[0]); } }; }, controller: function($scope){ var element = ''; $scope.linesCount = 0; var colcount = 3; this.setElement = function(el){ element = el; }; this.addItem = function(item){ var newLinesCount = Math.ceil($scope.itemSource.length / colcount); var linesInserted = newLinesCount - $scope.linesCount; if(linesInserted > 0){ var prevScroll = element.scrollTop; $timeout(function(){ var newScroll = prevScroll + (item.clientHeight * linesInserted); element.scrollTop = newScroll; }, 0); } $scope.linesCount = newLinesCount; }; } }; }]).directive('listItem', [function(){ return { require: "^list", link: function(scope, element, attributes, listCtrl){ listCtrl.addItem(element[0]); } }; }]); })(window.angular);
favorite count: 0
has answer: http://stackoverflow.com/a/28925341
tagged with: angularjs
upvote count: 2
tagged with: css
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/12729122
accepted answer: http://stackoverflow.com/a/28925341
type: Question
answer count: 2
score: 2
has title: angularjs ng-repeat implement stick scroll
downvote count: 0

http://stackoverflow.com/a/28994160
answers question: http://stackoverflow.com/q/28993644
type: Answer
downvote count: 0
score: 1
has body: You shouldn't use document.ready to often if isn't needed. // Shorthand for $( document ).ready() $(function() { }); If you bind two events to an element, .. it will be executed if you don't stopPropergation or making "cases". So you can check the visibility and decide what to do: $( function () { $("[class^='project']").on( 'click', function () { var $details = $( this ).parent().find( '.details' ); if ($details.is(':visible')) $( this ).parent().find( '.details' ).slideUp(); else $( this ).parent().find( '.details' ).slideDown(); }); } ); https://jsfiddle.net/3738Lnmf/ edit: slideToggle is more elegant :) @Diego López $( function () { $("[class^='project']").on( 'click', function () { $(this).parent().find('.details').slideToggle(); }); } ); https://jsfiddle.net/3738Lnmf/1/
upvote count: 1

http://stackoverflow.com/q/28925142
score: 3
type: Question
tagged with: search
has comment: http://stackoverflow.com/comment/46106757
answer count: 2
has title: if an array contains a specific value, then return the full 'content' of the value
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: variables
tagged with: jquery
linked to: http://stackoverflow.com/q/5424488
has answer: http://stackoverflow.com/a/28925312
favorite count: 0
has comment: http://stackoverflow.com/comment/46106765
has comment: http://stackoverflow.com/comment/46106704
duplicate of: http://stackoverflow.com/q/5424488
has answer: http://stackoverflow.com/a/28925167
has comment: http://stackoverflow.com/comment/46106680
has comment: http://stackoverflow.com/comment/46107675
has body: The idea is this.. var myArray = ['Apple juice','Banana Milkshake','Some Treat']; function search(search_term){ if(myArray.indexOf(search_term) != -1){ return ..... //this is what i want to do. }; // code is run as. search("Apple"); My thought is when i call the search() function and it finds a value, it should return the full length or the full value of the matched term so if i do search("Apple"); it should return 'Apple Juice' but i don't know any way to do this so can anyone help me find a way to do this?
type: UnansweredQuestion
upvote count: 3

http://stackoverflow.com/comment/46138075
comment on: http://stackoverflow.com/q/28941857
type: Comment
type: QuestionComment
score: 7
has text: The page will be completely blocked during the ajax request.. so **bad idea**

http://stackoverflow.com/comment/68795154
has text: With this solution sometimes the cells get lost when the window is resized to smaller. Is there a way to setdimensions for the cell element too during window resize
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/34296218
type: Comment

http://stackoverflow.com/q/28992064
has comment: http://stackoverflow.com/comment/46234375
tagged with: datepicker
tagged with: datetime
tagged with: python
has comment: http://stackoverflow.com/comment/46235128
has body: I am stuck with my time tracking app. I am using django with python 3. At this time, I am calculating a time difference between 2 datetime.datetime objects, which I am combining with datetime.combine. This is my code: dt_start = datetime.combine(self.entry_date, self.entry_start_time) dt_end = datetime.combine(self.entry_date, self.entry_end_time) time_delta = dt_end - dt_start time_delta = time_delta - timedelta(hours=t_daily.hour,minutes=t_daily.minute) self.entry_time_delta = int(time_delta.total_seconds() // 60) profile.overtime = + self.entry_time_delta profile.save() As you see, I am first combining the entry_date with the entry_start_time to get a datetime.datetime object. Then I am combining the entry_date with the entry_end_time to get another datetime.datetime object. Unfortunatly, it is not possible to subtract 2 datetime.time objects. With my new datetime.timedelta object, I can subtract the daily working time (stored in a "profile" class) converted to a timedelta object and save the delta in the profile's "overtime". This is really horrible for me! Later I want to write a form with a timepicker/datepicker Javascript and I don't know, if I am running into problems, because now the model's entry_start_time and entry_end_time is a "models.TimeField" object. All the Javascript code for timepickers and datepickers I saw, expected a textfield in the form. So is there any best practise for calculating times in django/python, if I want to use timepicker/datepickers later on? Thank you all in advance! Edit: Here are my classes: class Entry(models.Model): entry_date = models.DateField('entry date') entry_start_time = models.TimeField('start time') entry_end_time = models.TimeField('end time') entry_vacation = models.BooleanField('took vacation', default=False) entry_overhours = models.BooleanField('took overhours', default=False) entry_time_delta = models.IntegerField('time difference today', editable=False) user_id = models.ForeignKey(User) def __str__(self): re…
has title: How to calculate timedeltas in python with django right?
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46233908
tagged with: django
has comment: http://stackoverflow.com/comment/46234884
has comment: http://stackoverflow.com/comment/46235692
has comment: http://stackoverflow.com/comment/46234476
type: Question
has comment: http://stackoverflow.com/comment/46234960
has comment: http://stackoverflow.com/comment/46235442
tagged with: javascript
has comment: http://stackoverflow.com/comment/46234842
has comment: http://stackoverflow.com/comment/46235265
score: 0

http://stackoverflow.com/comment/46286671
type: QuestionComment
has text: Looks okay on my Nexus 5, what mobile device is giving you issues?
score: 0
comment on: http://stackoverflow.com/q/29021700
type: Comment

http://stackoverflow.com/a/28916973
downvote count: 0
has comment: http://stackoverflow.com/comment/46098627
score: 1
answers question: http://stackoverflow.com/q/28916748
has body: say you want to alert after the div#content is loaded. if you put your javascript after div's closing tag, it will run after loading all the html prior to the script. // your content
has comment: http://stackoverflow.com/comment/46101716
has comment: http://stackoverflow.com/comment/46100400
upvote count: 1
type: Answer

http://stackoverflow.com/q/29028971
linked to: http://stackoverflow.com/q/14461787
has title: jQuery UI autocomplete missing _renderItem
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46300176
type: Question
has comment: http://stackoverflow.com/comment/46299815
has comment: http://stackoverflow.com/comment/46299991
accepted answer: http://stackoverflow.com/a/29029505
tagged with: jquery-ui
tagged with: autocomplete
tagged with: jquery-autocomplete
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46299672
score: 0
has body: This is weird. $.fn.autoList = function () { return this.each(function () { var self = this; // initiate autocomplete $(self).autocomplete({ source: _li_data, minLength: 2, select: function (event, ui) { ui.item.checkbox.prop('checked', true).trigger('change'); ui.item.checked = !ui.item.checked; $(event.target).val(''); return false; } }) .data('autocomplete')._renderItem = function (ul, item) { if (item.checked) { return $("&lt;li&gt;") .text(item.label) .addClass('preselected') .appendTo(ul); } }; });} When typing and just before the results should render, I get the following error. Uncaught TypeError: Cannot read property 'data' of undefined in jquery-ui-1.9.0.js:6672 which has the following code _renderItemData: function( ul, item ) { return this._renderItem( ul, item ).data( "ui-autocomplete-item", item ); }, What I want to do is to add a "preselected" class to a -li- item in the -ul- of the autocomplete dropdown. I am stuck with this...
has answer: http://stackoverflow.com/a/29029505
answer count: 1

http://stackoverflow.com/comment/46124399
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28934256
type: QuestionComment
has text: What if neither textbox has ever had focus when a button is clicked? Also, `type="textbox"` isn't valid for an ` ` element, but (presumably) it "works" because `type="text"` is the default.

http://stackoverflow.com/q/29016564
has answer: http://stackoverflow.com/a/29017904
tagged with: javascript
upvote count: 1
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: Two controllers on a directive
has body: i'm creating a directive that will have methods that the children will access. But at the same time i'm requiring 'form' on my directive. return { restrict: 'A', scope: { object: '=' }, require: 'form', controller: function ($scope, $element) { this.hi = function () { console.log('i am here') } }, link: function (scope, elm, attrs, controllers) { console.log(controllers); } } I've always thought that if i was goign to use two controllers, they would be in one array. But when i log them, i only get the FormController: What should i do?
downvote count: 0
score: 1
tagged with: directive
type: Question

google-app-engine-python
type: Tag
tags question: http://stackoverflow.com/q/28977878
tag name: google-app-engine-python
tags question: http://stackoverflow.com/q/28957814

http://stackoverflow.com/comment/46319704
type: QuestionComment
comment on: http://stackoverflow.com/q/28958496
type: Comment
has text: But the same application is running within all Office-Hosts. SO I don't know if if it is *docx or *pptx
score: 0

http://stackoverflow.com/a/29042005
has comment: http://stackoverflow.com/comment/46324301
type: Answer
answers question: http://stackoverflow.com/q/29041615
score: 0
has comment: http://stackoverflow.com/comment/46337558
has body: One approach that might achieve what you want to do is to set the width of the tooltips explicitly when they are opened. You can do this by adding code for another event open to your existing .tooltip() call, something like: $('.tooltip').tooltip({ position: { my: "center top", at: "center bottom", }, content: function() { var element = $( this ); if ( element.is( "[title]" ) ) { return element.attr( "title" ); } if ( element.is( "img" ) ) { return element.attr( "alt" ); } }, open: function (event, ui) { ui.tooltip.css("width", "400px"); } }); You can adjust this setting to whatever width suits your needs. Here is an updated jsFiddle to see the result: jsFiddle

http://stackoverflow.com/q/28966272
tagged with: javascript
has title: How to display input value of html number input with exactly 2 digits?
upvote count: 2
answer count: 1
tagged with: jquery
has body: I would like to have something like this: &lt;input id="seconds" type="number" value="0" min="0" max="59" /&gt; The only thing I would like to add here is to always show the numbers as 2-digit numbers at all times (showing 0 as '00', 7 as '07' and 53 as '53'). I've looked for plenty of solutions on SO, but none really does the job for me. In particular, hooking up the onChange eventHandler or blur() in jQuery to alter the number doesn't seem to do the job for me (I'm guessing this is because of the min-max-validation which I'm using, but I'm not sure). In the bigger scheme, I would like make a simple and easy-to-change time control, using number inputs to easily change the hours/minutes/seconds. Isn't there any standard thing I could use ? The HTML time controls don't seem to be supported in all major browsers....
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/3605214
score: 2
has comment: http://stackoverflow.com/comment/46184213
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28966526
type: Question

http://stackoverflow.com/a/29044287
type: Answer
has body: Maybe something like this? function myClass(context) { var _$ = $, $ = function() { return _$.find(context).apply(this, Array.prototype.slice.call(arguments)); }; this.getItems = function() { return $('.grid'); } }
answers question: http://stackoverflow.com/q/29044109
score: 0

http://stackoverflow.com/a/29010974
score: 0
has body: You have ng-controller="personController" but no implementation for that controller.
type: Answer
answers question: http://stackoverflow.com/q/29010915

http://stackoverflow.com/comment/46143889
comment on: http://stackoverflow.com/a/28944769
type: AnswerComment
score: 0
has text: Hi, I have many items inside my ` ` table so how could I use this solution for my purpose (I cannot change manually all `id`)
type: Comment

http://stackoverflow.com/comment/46271923
type: Comment
comment on: http://stackoverflow.com/a/29013441
has text: Looks like is related with cookies, chrome is using sqlite internally when working with cookies. So I would also research if you are trying to save cookies ``content::SQLitePersistentCookieStore::Backend::Commit``
type: AnswerComment
score: 0

http://stackoverflow.com/a/28949186
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28948910
answers question: http://stackoverflow.com/q/28948910
has body: There are few ways... This one is easiest to me: function arrow(x){ var ul = document.getElementById('top_menu'); list=ul.getElementsByTagName("li"); for(i=0;i&lt;list.length;i++){ if(list[i]!==x){ list[i].style.background="#ffffff"; } else { list[i].style.background="#000000"; } } } Demo: http://jsfiddle.net/ag9L09sb/1/
type: AcceptedAnswer

postback
tag name: postback
tags question: http://stackoverflow.com/q/29025076
type: Tag

http://stackoverflow.com/q/29000132
has answer: http://stackoverflow.com/a/29011270
accepted answer: http://stackoverflow.com/a/29011270
tagged with: javascript
tagged with: p5.js
upvote count: 13
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: web
favorite count: 0
score: 13
has answer: http://stackoverflow.com/a/49546948
has title: How do you get p5.js into a website?
has answer: http://stackoverflow.com/a/34934503
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/49546948
type: Question
tagged with: processing
has body: I have searched nearly all over the internet, and i've gotten pretty close to an answer, but I still can't figure out how to use p5.js in a website. To be more specific, i want to be able to perhaps create a weebly, and have it display p5 code. i know it involves the website loading the p5.js through a file or the online file, and the sketch.js. If there is no way to use p5.js on the web, is there any way to use processing code in general(or something similar) on the internet? Thanks

http://stackoverflow.com/a/29043601
score: 0
type: Answer
has body: I ended up using a very poor method to solve the issue. I modified the data being returned to typeahead to be in the format value**matched text Then at the top of the highlighter function I simply called split to extract the value from it before outputting.
accepted answer of: http://stackoverflow.com/q/29042989
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29042989

http://stackoverflow.com/comment/46237928
has text: Could you provide more context for this question? Depending on what exactly you're trying to do, you're not really taking a correct approach (the function makes no sense of its own)
comment on: http://stackoverflow.com/q/28994842
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28955134
has comment: http://stackoverflow.com/comment/46190911
has comment: http://stackoverflow.com/comment/46215784
type: Answer
has comment: http://stackoverflow.com/comment/46191192
has comment: http://stackoverflow.com/comment/46188478
has body: This line: var coords = jsonAr[i].coords.coordinates[0]; should be var coords = jsonAr[i].coords.coordinates; A different approach, because your data seems to be perfect for use with the data-layer. Convert it to geoJSON: (Not tested): &lt;?php $json_response=array('type' =&gt;'FeatureCollection', 'features'=&gt;array()); while ($row = pg_fetch_array($result,null, PGSQL_ASSOC)) { $json_response['features'][] = array('type'=&gt;'Feature', 'properties'=&gt;array('gid' =&gt; $row['gid'], 'cost'=&gt; $row['cost'] ), 'geometry'=&gt;json_decode($row['geom'], true) ); } ?&gt; var jsonAr = &lt;?php echo json_encode($json_response); ?&gt;; To draw the lines simply call: //map ist the google.maps.Map-instance map.data.addGeoJson(jsonAr); ...done, no need to parse jsonAr. The difference: Your approach will draw a single line with all points defined in each item of jsonAr, while my approach will draw a separate line for each item.
accepted answer of: http://stackoverflow.com/q/28948581
answers question: http://stackoverflow.com/q/28948581
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46188141

http://stackoverflow.com/a/28969205
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28969021
downvote count: 0
has body: Use a cleaner way as you are using jQuery: Home About Contact $(".menu").click(function(){ var currentId = $(this).attr("id"); alert($.trim($("#"+currentId).text())); }); Home About Contact

http://stackoverflow.com/comment/46178589
has text: Presumably you want to pass the _selected_ id into `ShowSubTypes` ?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28960903

http://stackoverflow.com/comment/46278877
has text: Thanks for your help. That was a mistake in the question, I'll correct. The regex question still stands `console.log(matches[1]);` also returns 'when-winding/' instead of 'when-winding'.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29015983
type: AnswerComment

http://stackoverflow.com/comment/46188894
type: QuestionComment
has text: doing `"table file TABLE FILE ASD".replace(/(\bTABLE\s{1}FILE\b)/g,'$1');` works fine for me in chrome. are you sure your `content` variable is what you expect?
comment on: http://stackoverflow.com/q/28968536
score: 0
type: Comment

http://stackoverflow.com/comment/46232558
type: Comment
type: QuestionComment
has text: what type of selenium bindings are you using?
score: 0
comment on: http://stackoverflow.com/q/28984477

http://stackoverflow.com/a/29136690
type: Answer
has body: You need to use "Meteor.users" for your collection and then in your routes you need to set the data context: Router.route('account', { name: 'Profile', data: function() { return Meteor.users.findOne(Meteor.userId()); } }); If you had an account route for a profile template this is how you'd make it work.
score: 0
answers question: http://stackoverflow.com/q/28960818

http://stackoverflow.com/q/28907662
type: Question
tagged with: sublimetext
tagged with: javascript
has comment: http://stackoverflow.com/comment/46079942
has comment: http://stackoverflow.com/comment/46116389
tagged with: markdown
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28909092
tagged with: sublimetext3
has answer: http://stackoverflow.com/a/28909092
type: AnsweredQuestion
has body: In Sublime Text 3 I am using the package Markdown Extended and Markdown Preview to build the Markdown documents I write. I am trying to get nicely formatted JavaScript code, however, for some reason it isn't being built and displayed correctly. In Sublime, the code is highlighted and looks great, but when I build it and view it in my browser I just see an in-line typical grey piece of code, with javascript still at the front of it. Below is an example of what I am talking about: Example Markdown code ```javascript var s = "JavaScript syntax highlighting"; alert(s); ``` Output &lt;code&gt; ::before javascript var s = "JavaScript syntax highlighting"; alert(s); ::after &lt;/code&gt; MarkdownPreview user settings { "github_mode": "gfm", "guess_language": false, "enabled_extensions": ["codehilite(guess_lang=False,pygments_style=github)"], "enable_highlight": true }
has comment: http://stackoverflow.com/comment/46074936
has title: Markdown syntax highlighting not working as expected
has comment: http://stackoverflow.com/comment/46119256
has comment: http://stackoverflow.com/comment/46074725
tagged with: syntax-highlighting

http://stackoverflow.com/comment/46267982
score: 0
type: AnswerComment
type: Comment
has text: The downvote is because this is _poor design_. What if the API is going to be used on a different page that doesn't use the same IDs? It's the job of the client-side JS to decide which divs to fill, not the job of the server.
comment on: http://stackoverflow.com/a/29011289

http://stackoverflow.com/q/29016486
possible better answer: http://stackoverflow.com/a/29021021
tagged with: asp.net
has comment: http://stackoverflow.com/comment/46285680
has answer: http://stackoverflow.com/a/29021674
type: AnsweredQuestion
has body: i have an anchor tag and through Jquery i am handling the click event on it.onclick i get the x and y position i.e xIndex and yIndex respectively. i want to store this two values in database and for that i have a method StoreXY(string XIndex,string YIndex)at backend in c# test.aspx.cs file . but as i have values of x and y position in javascript variables, i need to call the StoreXY() method through javascript. Following is the code i am using. test.aspx <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></asp:ScriptManager> Build test.aspx.cs [WebMethod] public static string StoreXY(string Xindex, string Yindex) { SiteLogic SL = new SiteLogic(); Site ste = SL.SelectByID(Convert.ToInt32(HttpContext.Current.Request.QueryString["ID"])); Walkable W = new Walkable(); W.X = Convert.ToInt32(Xindex); W.Y = Convert.ToInt32(Yindex); W.SiteID = ste.SiteID; WalkableLogic wlc = new WalkableLogic(); int x= wlc.Insert(W); if (x > 0) return "Successfull"; else return "Unsuccessfull"; } Now i am able to get the alert with x and y position values printed but the c# method in 'test.aspx.cs' file is not called and so no entry is inserted in database. How do i call 'StoreXY()' method from javascript?
score: 0
tagged with: mysql
accepted answer: http://stackoverflow.com/a/29021674
has title: Not able to call a c# function through javascript in asp.net
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29021021

http://stackoverflow.com/comment/46265880
score: 0
has text: jQuery is a factory function not an instance, from within jQuery `$` is scoped so you can name jQuery what ever you want, there is a `noConflict` mode that leaves `$` unassigned. There is absolutely no good reason for knowing the instances variable name from within the instance as this is a clear violation of clean programming principles, its not within the responsibility of the instance to know what the outer code is doing. What if i push the instance into an array, or dont even assign it to a variable?
type: Comment
comment on: http://stackoverflow.com/a/29002081
type: AnswerComment

http://stackoverflow.com/q/29051472
accepted answer: http://stackoverflow.com/a/29055713
type: Question
upvote count: 15
tagged with: nashorn
tagged with: javascript
has body: Is it possible to include one js from another with java nashorn engine? ScriptEngine engine = new ScriptEngineManager().getEngineByName("Nashorn"); InputStreamReader rs = new InputStreamReader(new FileInputStream(new File(.../script.js)); engine.eval(rs); script.js var System = Java.type('java.lang.System'); // document.write("./test.js"); - javax.script.ScriptException: ReferenceError: "document" is not defined // require('./test.js'); - require is not defined test.js System.out.println("reading test.js file"); i want to create top level script (in this example its script.js) and use it as a library for other scripts in same directory.
has title: Java, nashorn accessing another js file
score: 15
tagged with: scope
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/29055713
favorite count: 0
has comment: http://stackoverflow.com/comment/88221023
has answer: http://stackoverflow.com/a/42512713
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/42512713
tagged with: java

http://stackoverflow.com/comment/46117642
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28930845
has text: Hmm that is strange. Is contact.php at the same domain?

http://stackoverflow.com/comment/46336231
type: QuestionComment
comment on: http://stackoverflow.com/q/29048465
has text: I have made some additions to the question to further clarify what i am trying to do. This is my first time coding a chrome extension so i am basically on ground zero. http://markashleybell.com/building-a-simple-google-chrome-extension.html. I have build the base of my extension using this link.
score: 0
type: Comment

http://stackoverflow.com/comment/46185754
has text: Can you show me an example?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28966830

http://stackoverflow.com/a/28923561
score: 0
type: Answer
has body: I assume these are iframes? var frame = $("iframe"); frame.css("height", "500"); frame.css("width", "500"); You can change the second value to anything in pixels. Better would be to use CSS for this: iframe { width: 500px; height: 500px; } If those are not iframes change the iframe tag to any other tag
answers question: http://stackoverflow.com/q/28923502

http://stackoverflow.com/a/29193574
has body: To my knowledge it is not possible to specify at which points the indents will take place - however you can take a look at Code Style - JetBrains Webstorm 9.0.2
score: 0
answers question: http://stackoverflow.com/q/29012026
type: Answer

http://stackoverflow.com/a/29194443
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/46602654
score: 3
has comment: http://stackoverflow.com/comment/46607814
accepted answer of: http://stackoverflow.com/q/29019615
has comment: http://stackoverflow.com/comment/46602065
answers question: http://stackoverflow.com/q/29019615
type: AcceptedAnswer
downvote count: 0
has body: Forever splits the log -l LOGFILE Logs the forever output to LOGFILE -o OUTFILE Logs stdout from child script to OUTFILE -e ERRFILE Logs stderr from child script to ERRFILE Even if you didn't specify the -e file it should be somewhere. Users/{UserName}/.forever on windows. You should check the ERRFILE. Maybe that will bring some light to why the process failed.
has comment: http://stackoverflow.com/comment/46808626

http://stackoverflow.com/q/28945105
has body: I am trying to integrate Royal Slider within my website. However I am having trouble with the first slide when the slider is within tabs on my page. For example, you can see at http://christierichards.co.uk/slidertest/newtemplatefix.php that the slider is working perfectly (there is no styling as of yet). On this page http://christierichards.co.uk/slidertest/newtemplate.php when you click on before and after (this is the tab I want the slider appearing in) the first slide does not show until you click tab 2 and then the height seems to appear. I have managed to fix it within the tabs but this is only by adding a fixed height onto .rsOverflow. I cannot use a fixed height as I need the auto-height feature to work for clients to add their own photos. So I need a different way around it. There must be a piece of conflicting code somewhere however I am stumped! Any help would be appreciated. Thanks
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28946819
tagged with: javascript
tagged with: jquery
score: 0
has title: First slide doesnt show in jQuery Royal Slider within tabs
tagged with: slider
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/46155073

http://stackoverflow.com/q/28981965
upvote count: 2
has title: setInterval - if element has class externd interval
type: Question
has comment: http://stackoverflow.com/comment/46214351
has body: Hi i use the following function which loads a javascript every 10 seconds and changes the visibility of some elements: function folienwechsel(){ if ($("section:last-child").hasClass('active') ) { $("section.active").hide(); $("section.active").removeClass("active").prevUntil("first").show().addClass("active"); } else { $("section.active").hide(); $("section.active").removeClass("active").next().show().addClass("active"); }; } setInterval(function(){ folienwechsel()}, 10000) Now i want to extend this to extend an interval if an element has a class like "video". Do you have any advice how to do that? Thx for your help
tagged with: javascript
downvote count: 0
answer count: 1
tagged with: setinterval
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28982094
score: 2

http://stackoverflow.com/q/29022499
has body: I am using a simple preloading effect over several items by overlapping a DIV that fades out with JavaScript when the page is ready: Because I am using Infinite AJAX Scrolling, it fires only with the first item showing in the page. I also tried the rendered event, but it doesn't seem to work either. This is the code. Note that it gets the images dynamically from a folder: blabla title <?php $dir = 'img/'; // dir for images $filetype = '*.*'; $allow = array('jpg','jpeg', 'JPEG', 'JPG', 'gif', 'GIF', 'png', 'PNG'); // extensions $files = glob($dir.$filetype); $newest_images_first = true; $files = array_reverse($files); // reverse $i=0; $open = opendir($dir); // Get filenames from dir, get extension & store in array while (($file=readdir($open))!==false) { $ext=str_replace('.', '', strrchr($file, '.')); if (in_array($ext, $allow)) $list[$i++]=$file; } $perPage= 20; //images per page $total=count($list); // Number of images $pages=ceil($total/$perPage); $thisPage=isset($_GET['pg'])?$_GET['pg']-1:0; // did user select a specific page? Note, pages on web are counted from 1 (not zero) so must subtract 1 for correct indexing $start=$thisPage*$perPage; // calculate starting index into list of filenames $pageNumber= $thisPage+1; $perRow= 1; // Number images per row $imgCnt=0; // used to count number of images displayed and hence whether to wrap page. note, could use "for" index $i but this is computationally quicker for ($i=$start;$i<$start+$perPage;$i++) { // -+-+-+-+-+-+-+-+-+-+-+-+-+-+- Item -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- // echo " "; // Here is the DIV that covers .item echo ' '; if (isset($list[$i])) { echo " "; echo ' '; $title = substr($files[$i],strlen($dir),strrpos($files[$i], '.')-strlen($dir)); // get filename, ignore path and text since last '.' echo ' '; // image! echo " "; echo " "; echo ' '."". $title .' '; // show title echo " "; echo " "; echo " "; // -> .item } else { echo " "; // create an empty td } $imgCnt+=1; // increment images shown if ($imgCnt%…
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
tagged with: preloader
type: Question
has title: How can I fire preloading effect more than once?
downvote count: 0
tagged with: javascript
tagged with: infinite-scroll

http://stackoverflow.com/q/28933486
tagged with: javascript
has body: I got a problem with this simple piece of code which i cant figure out. Instead of printing the whole array in the console, i get the message "10 undefined". Altough if i put "var i" to 0 or below then it's all good and i get a full list from that number up to 10. Why wont this work when "i" is set to a number above 0? Took a picture of my console in chrome to show how it looks like: var ar = []; for (var i = 1; i &lt;= 10; i++) { ar.push(i); console.log(ar[i]); }
possible better answer: http://stackoverflow.com/a/28933525
favorite count: 0
has answer: http://stackoverflow.com/a/28933525
score: 2
downvote count: 0
has title: JavaScript - Array "undefined" error
tagged with: loops
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28933559
has answer: http://stackoverflow.com/a/28933508
accepted answer: http://stackoverflow.com/a/28933508
upvote count: 2
answer count: 3
has comment: http://stackoverflow.com/comment/46122732
tagged with: arrays

http://stackoverflow.com/q/28955115
tagged with: search
has body: I'm working with collections in backbone and would like to quickly filter based on date range. I'm familiar with collection.comparator, and underscore methods like _.sortBy(), but would like to be able to use a method like collection.where() in conjunction with a filter method to only return models that fall between two values. My initial thought is that it might be best to maintain a sorted collection and employ a sort algorithm, but would like to leverage backbone as much as possible as to not reinvent the wheel if at all possible. Thoughts?
score: 0
has comment: http://stackoverflow.com/comment/46164075
answer count: 1
has title: Selecting based on date range in backbone collections
tagged with: backbone.js
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28989713
tagged with: javascript
tagged with: sorting

http://stackoverflow.com/q/29037916
has body: Can someone help me to get the total price of the stock given prices below?? Using the onclick, once someone puts in the number of stocks they want to buy, how do I go about getting the total price of all 3 stocks choosen?? SHARE PRICE $43.93 $43.87 $26.33 Important information that you should know about these stocks: 0.1% of the trade value if the total trade value is less than $10,000 0.08% of the trade value if the total trade value is greater than or equal to $10,000 The minimum commission is $5 Enter the number of Oracle Corporation stocks you wish to purchase!: Enter the number of Microsoft Corporation stocks you wish to purchase!: Enter the number of Symantec Corporation stocks you wish to purchase!: <br
type: Question
upvote count: 0
tagged with: javascript
score: -3
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: calculator
has answer: http://stackoverflow.com/a/29038198
favorite count: 0
has comment: http://stackoverflow.com/comment/46316454
has title: javascript help using html and calculator
type: AnsweredQuestion
tagged with: onclick
downvote count: 3
accepted answer: http://stackoverflow.com/a/29038198

sql-server
tags question: http://stackoverflow.com/q/29049073
type: Tag
tag name: sql-server
tags question: http://stackoverflow.com/q/28956618
tags question: http://stackoverflow.com/q/29026796
tags question: http://stackoverflow.com/q/28992007

http://stackoverflow.com/comment/46183958
has text: I've Edited the Question, it has more to do with the JavaScript pareFloat-Funktion i assume
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28965693

http://stackoverflow.com/q/29029431
tagged with: javascript
has title: print javascript variable as an attribute in html tag
answer count: 1
accepted answer: http://stackoverflow.com/a/29029485
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: AnsweredQuestion
score: 0
has body: var disabled = ''; if(value.action.length === 0) { disabled = 'disabled="disabled"'; } row += '&lt;td&gt;&lt;input type="checkbox" name="create" value="1" class="checkbox" data-action="'+ value.action + '" data-controller = "'+ value.controller +'" data-role="'+ role +'" document.write(disabled)&gt;&lt;/td&gt;'; I want to print disabled="disabled" based on the truthfulness of my condition. In PHP this can be easily done by the method I used above but I failed to to it in JavaScript. The document.write() is getting printed as it is. How can I do this in JavaScript?
has comment: http://stackoverflow.com/comment/46300187
has answer: http://stackoverflow.com/a/29029485
type: Question

http://stackoverflow.com/a/28996150
downvote count: 0
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28963530
score: 2
has body: I'm a bit new to Angular, so I don't know the best way to fix it, but I can at least tell you why it isn't working. ng-click="ctrl.video()" works because ctrl is defined in the controller's scope. All ng- attributes run within the controller's scope. But onended is a regular built-in HTML5 event handler attribute, so it runs in the global Javascript scope, not the controller's scope. There's no ctrl defined there. (I'm not sure how var ctrl = this; causes ctrl to be defined in the controller's scope, but apparently it does. Still learning Angular...)

http://stackoverflow.com/q/29020894
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/46285415
favorite count: 0
has comment: http://stackoverflow.com/comment/46285624
has comment: http://stackoverflow.com/comment/46312527
type: UnansweredQuestion
has title: Aweber form not collecting leads because of simple jquery code
duplicate of: http://stackoverflow.com/q/5169471
has body: I have a signup form that is having trouble to pass the input fiel data to aweber list. submission takes place in same window without reloading the page, and I can see in the bottom of the browser window how the server is connecting to aweber url but the data is not passing through: html form code that I am currently using: &lt;iframe id="AweberFormSubmitFrame" style="display: none" name="AweberFormSubmitFrame" src="about:blank"&gt;&lt;/iframe&gt; &lt;form method="post" action="http://www.aweber.com/scripts/addlead.pl" class="firstFom" target="AweberFormSubmitFrame" id="formularioaweber"&gt; &lt;input type="hidden" name="meta_web_form_id" value="79676xxxx"/&gt; &lt;input type="hidden" name="meta_split_id" value=""/&gt; &lt;input type="hidden" name="listname" value="tizona_prosp"/&gt; &lt;input type="hidden" name="redirect" value="#" id="redirect_060b3473249d14423a8ed1bb376cdca8"/&gt; &lt;input type="hidden" name="meta_adtracking" value="Tizona_Joyas_Prospectos"/&gt; &lt;input type="hidden" name="meta_message" value="1"/&gt; &lt;input type="hidden" value="email"/&gt; &lt;input type="hidden" name="meta_tooltip" value=""/&gt; &lt;div class="emailinput" &gt; &lt;input type="email" value="" name="email" id="awf_field-44988808" placeholder="Ingrese Su Email" required&gt; &lt;/div&gt; &lt;div class="submitinput"&gt; &lt;input type="submit" value="enviar" id="enviar"&gt; &lt;/div&gt; &lt;/form&gt; Now, this is the code that is changing some styling after the form is submitted: $(function (){ $( "#formularioaweber" ).submit(function( event ) { //alert( "Handler for .submit() called." ); //alert($('input#awf_field-44988808').val()); var a = $('#awf_field-44988808').val(); $("#success-message").removeClass('display-none'); // alert(a); $('#awf_field-44988808').val(''); $('#enviar').css({"background-color": "grey"}); $('#enviar').val('PROCESADO'); $('#enviar').attr('disabled','disabled'); $('#awf_field-44988808').attr('placeholder', 'Catalogo enviado a '+a); $("#awf_field-44988…
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/46285518
upvote count: 1
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/5169471
tagged with: jquery
tagged with: aweber

http://stackoverflow.com/comment/46312540
comment on: http://stackoverflow.com/q/29035864
type: Comment
type: QuestionComment
has text: the `Id`? you don't need a loop. its `data.Id`. for employees its `data.Employees` then use `.each`, then `val.Name`
score: 0

http://stackoverflow.com/comment/46273211
score: 0
comment on: http://stackoverflow.com/a/29000152
type: Comment
has text: hi @GiacomoPaita, by drag do you mean after mousedown and mousemove up/down the slide is dragged with it? When you let go it slides to the nearest slide?
type: AnswerComment

http://stackoverflow.com/q/28972281
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28972318
has answer: http://stackoverflow.com/a/28972318
has title: Immediate function: passing an argument that may be undefined
has body: How can I pass an object to an immediate function not knowing if that object is defined or not? (function(test) { // an exception is thrown: test is not defined. })(test || {});
answer count: 3
has comment: http://stackoverflow.com/comment/46196160
has comment: http://stackoverflow.com/comment/46195821
favorite count: 0
has answer: http://stackoverflow.com/a/28972328
has answer: http://stackoverflow.com/a/28972323
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46196132
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28972328
has comment: http://stackoverflow.com/comment/46196104
downvote count: 0

http://stackoverflow.com/a/29057050
answers question: http://stackoverflow.com/q/29056903
type: Answer
has body: Just use a Session variable or other reactive data source to force the helper to rerun if/when the location is found: Template.pos.helpers({ nearestLocation: function() { var position = Session.get('position'); // only bother doing the find if the position is set if (position) { // use position in the find var location = Locations.findOne(...); return location.name; } } }); Template.post.rendered = function() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { // set the session variable when/if position is found Session.set('position', position); }); } };
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29056903
score: 1
has comment: http://stackoverflow.com/comment/46351178
has comment: http://stackoverflow.com/comment/46351150
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28959213
answers question: http://stackoverflow.com/q/28958875
has comment: http://stackoverflow.com/comment/46175584
has body: You are using a string. Date filter takes a Date object, milliseconds (string or number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). As pointed out in the docs Try setting quotationDetails.quotation_date to new Date('2015-03-17 00:00:00') Here is a working example
has comment: http://stackoverflow.com/comment/46176680
score: 0
type: Answer

http://stackoverflow.com/q/28989340
accepted answer: http://stackoverflow.com/a/28989643
tagged with: mysql
type: Question
tagged with: ng-options
tagged with: javascript
tagged with: jquery
answer count: 1
has answer: http://stackoverflow.com/a/28989643
tagged with: angularjs
has body: I have a table which had a select field in it which I'd like to save into database if it dosnt exist yet through POST data. If it does exist then I'd like to update the already existing row in the database. This can be found in the tbody in which i have my tablerow with an ng-repeat to display all data from a json. &lt;td&gt; &lt;select id="statusSelect{{anime.id}}" ng-model="statusId" ng-options="animeStatus.id as animeStatus.status for animeStatus in animeStatuses" ng-change='addUserAnime( "&lt;?php echo Yii::app()-&gt;user-&gt;id; ?&gt;", anime.id, statusId )'&gt; &lt;/select&gt; &lt;/td&gt; Next this is my code for what im trying to do in the angular controller: $scope.addUserAnime = function( userId, animeId, statusId, userAnime ) { if ( userId == '' ) { //alert user that he/she needs to log in first } else { //loop through my json where i saved from which user which anime is saved with which status for (var i = 0; i &lt; $scope.usersAnime.length; i++) { //if there is an already existing entry then i want to update it if not then i want to introduce it into DB with POST if ($scope.usersAnime[i].anime_id == animeId &amp;&amp; $scope.usersAnime[i].user_id == userId) { $scope.userAnime = $.extend({}, $scope.usersAnime[i]); $scope.userAnime.status_id = statusId; $scope.userAnime.date_modified = today; saveUserAnime(); return; } } $scope.userAnime = { id: 0, user_id: userId, anime_id: animeId, status_id: statusId, rating: '', date_modified: today }; saveUserAnime(); } }; Problem is that if i POST a new entry it gets saved in the database, but if i dont reload the page and i change the select again giving it a new option it gets POSTed again instead of using PUT for update.In the end i end up with two entries instead of one. I want to introduce it to database on first select and i want to update it if its changed after. Is that possible. I tryed doing it with $dirty using the table as form but thats a nono. In the saveUserAnime() function its correctly deffined to us…
type: AnsweredQuestion
has title: Angular js, on select element i want to POST data to save it in the database then i want to update it with PUT without page reload
score: 0

http://stackoverflow.com/q/29030900
tagged with: javascript
has comment: http://stackoverflow.com/comment/46302996
answer count: 1
linked to: http://stackoverflow.com/q/11980087
tagged with: jquery
has title: Get Integer from number-string
has comment: http://stackoverflow.com/comment/46302935
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/5529934
score: 0
has answer: http://stackoverflow.com/a/29031033
type: Question
has body: How can I convert words to numbers in JavaScript? As an example is there a javascript/jQuery library/plugin that will take a string "one hundred and two" and return the int 102. var myInt = stringToInt("one hundred and two"); console.log(myInt); =&gt; 102 I specifically require a string-to-number conversion and not number-to-string conversion. Suggested solutions have come up short: jsfiddle.net/joepegler/g0vwy44n
accepted answer: http://stackoverflow.com/a/29031033

http://stackoverflow.com/comment/46359735
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29056152
has text: can you show wtvapp file ?
score: 0

http://stackoverflow.com/comment/46078788
type: QuestionComment
has text: If that's actually how your html is formatted, then I'd consider myself lucky that the title even showed up :)
comment on: http://stackoverflow.com/q/28909814
score: 1
type: Comment

http://stackoverflow.com/comment/46329786
comment on: http://stackoverflow.com/q/29044996
type: QuestionComment
type: Comment
has text: Yes it worked! Turns out it IS the redundant whitespace that caused all the problems...Thank you very much!
score: 0

http://stackoverflow.com/comment/46080161
comment on: http://stackoverflow.com/a/28910517
type: Comment
type: AnswerComment
has text: I tried that and It wouldn't work quite well, because the includes the entire nav menu.
score: 0

http://stackoverflow.com/comment/46423604
type: AnswerComment
comment on: http://stackoverflow.com/a/29032576
has text: @JamesThorpe i have a doubt. even if i declare name as `var name` outsite the function, it is not working in chrome and firefox. But works fine in IE
score: 0
type: Comment

http://stackoverflow.com/comment/46355072
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29059275
has text: It does return true a lot. it takes random values from array A and puts in into a new array called B. (for example) and then it checks if there is no F near an F2. But sometimes it takes a bit too long I guess and then the browser says: "alright we timeout the script. It takes too long. We think it's an infinite loop."
score: 0

http://stackoverflow.com/a/28956894
accepted answer of: http://stackoverflow.com/q/28952898
answers question: http://stackoverflow.com/q/28952898
type: AcceptedAnswer
score: 1
upvote count: 2
type: Answer
has body: In cases like this I am using this bundle: https://github.com/Exercise/HTMLPurifierBundle probably best performance you will get using it on the form when user sends HTML. (via form data transformer as described in docs) No other option as far as I know will prevent it for all clever ways to put js in html.
downvote count: 1

http://stackoverflow.com/q/29061016
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29061536
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
has body: I wrote script on Raphael JS v2.1 that draws 1000+ circles and many paths. Circles are animated along that paths and then removed. At ~100 circles fps is 40. At 1000+ fps is 1-10. Code example: var r = Raphael("diagram", "100%", "100%"); setInterval(function () { r.moveCircle(lines[Math.floor(Math.random() * 20)]); }, 100); Raphael.fn.moveCircle = function (path) { var circle = this.circle(0, 0, 4).attr({fill: '#000'}); circle.animateAlong({ path: path, duration: 1000 }, function() { circle.remove(); }); }; Raphael.el.animateAlong = function (params, props, callback) { var element = this, paper = element.paper, path = params.path, rotate = params.rotate, duration = params.duration, easing = params.easing, debug = params.debug, isElem = typeof path !== 'string'; element.path = isElem ? path : paper.path(path); element.pathLen = element.path.getTotalLength(); element.rotateWith = rotate; element.path.attr({ stroke: debug ? 'red' : isElem ? path.attr('stroke') : 'rgba(0,0,0,0)', 'stroke-width': debug ? 2 : isElem ? path.attr('stroke-width') : 0 }); paper.customAttributes.along = function(v) { var point = this.path.getPointAtLength(v * this.pathLen), attrs = { cx: point.x, cy: point.y }; this.rotateWith &amp;&amp; (attrs.transform = 'r'+point.alpha); return attrs; }; if(props instanceof Function) { callback = props; props = null; } if(!props) { props = { along: 1 }; } else { props.along = 1; } var startAlong = element.attr('along') || 0; element.attr({along: startAlong}).animate(props, duration, easing, function() { !isElem &amp;&amp; element.path.remove(); callback &amp;&amp; callback.call(element); }); }; QUESTIONS: 1) is it possible to improve performance/speed/fps on Raphael JS? 2) on d3.js will fps be beter? what about 10,000+ animated circles? 3) is there any solutions to visualise 10,000+ animated circles along paths with good fps?
has answer: http://stackoverflow.com/a/29095442
type: AnsweredQuestion
has title: D3/Raphael js draws 1000+ animated circle with slow fps
tagged with: frame-rate
possible better answer: http://stackoverflow.com/a/29095442
accepted answer: http://stackoverflow.com/a/29061536
tagged with: raphael
type: Question
answer count: 2

http://stackoverflow.com/q/28980859
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/28980981
favorite count: 0
has body: I have created form to add data in php-mysql database with ajax, It is working fine, after data is added it shows in html table. Now i am trying to create code for editing those entry, I had created code as below for edit with AJAX, $(document).ready(function() { var table = $('#categorylist').DataTable(); $('#categorylist tbody').on( 'click', 'tr', function () { $(this).toggleClass('selected'); } ); $('#edit_category').on( 'click',function () { document.getElementById('editcategory').style.display = "block"; /*do some task here to get values of ID*/ var catid = $("#cat_id").val(); jQuery.ajax({ url: "<?php echo base_url(); ?>index.php/tools/edit_category", data: {category:catid}, type: "POST", success:function(data){ var objData = jQuery.parseJSON(data); console.log(objData); $("#cname").html( objData.category_name ); } }); }); }); Above code will send request to PHP to get information for that ID and return me data in json format, Below is returned data, category_id: "38" category_name: "Test Conveyance" Now i want to show this values in html form so that user can see what are current values, then user will edit values and click on save. Below is my html form, how can i show category ID and name in html input form as value? Thanks, Cancel
has answer: http://stackoverflow.com/a/28980999
accepted answer: http://stackoverflow.com/a/28980999
upvote count: 1
tagged with: php
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
has title: Add ajax success return json object data in html form
answer count: 2
possible better answer: http://stackoverflow.com/a/28980981

http://stackoverflow.com/a/29014559
score: 1
accepted answer of: http://stackoverflow.com/q/29013035
answers question: http://stackoverflow.com/q/29013035
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: There are a couple of different solutions. For some reason it has to do with the table display and how chrome calculates the height of table cells (or doesn't). You can either switch off of the table display, which I'm assuming you don't want to do, or you can trigger the height recalculation with a javascript function. $(document).on("click", ".col1-link", function () { $("#col2").html(' \ \ Col2 \ \ ').height(0); }); html, body { height: 100%; overflow: hidden; } .table-div { display: table; width: 100%; } .table-row { display: table-row; width: 100%; } .table-cell { display: table-cell; float: none; padding: 0; vertical-align: top; } .full-height { height: 100%; } .relative-wrapper { position: relative; height: 100%; } .scroll-wrapper { overflow: hidden !important; position: absolute; top: 0; right: 0; bottom: 0; left: 0; } #col1 { width: 15%; } #col2 { width: 25%; padding: 0; } #col3 { width: 60%; } Click Here After click, "Col2" will only be visible after resizing the window on Chrome, but works fine in IE and Firefox Now, because it's a table display, setting a height of 0 should not actually affect the element's height, but will cause chrome to recalculate the height correctly.
downvote count: 0

http://stackoverflow.com/q/28959612
has body: I am new with highcharts and javascript. I am trying to make a boxplot with drilldown. Chart type 'boxplot' requires data to be a array of 5 element(min 1st-quatile median 3st-quatile max), as follows: data: [ [760, 801, 848, 895, 965], [733, 853, 939, 980, 1080], [834, 836, 864, 882, 910] ] While drilldown requires that data should have many members, including "drilldown" member, as follow: data: [{ name: 'namey', y: 49.9, drilldown: 'tokyo 1' }, { y: 71.5, name: 'namex', drilldown: 'tokyo 2' }] I have tried many ways to make them together, yet nothing works. The following is an example I tried by combining other people's drilldown and boxplot. $(function () { $('#container').highcharts({ chart: { type: 'boxplot' }, title: { text: '' }, legend: { enabled: false }, xAxis: { categories: ['Actuaries111', 'Computer and Information Research Scientists', 'Computer and Mathematical Occupations'], title: { text: '' } }, yAxis: { title: { text: 'Wage' } }, series: [{ id : 'a1', name: 'Computer and Information Research Scientists', data: [ [1,68834.77, 85124.14, 107734.77, 131196.33, 157504.48] ], tooltip: { headerFormat: '{point.key} ' }, drilldown: 'a' }, { name: 'Computer and Mathematical Occupations', data: [ [2,46943.39, 64711.77, 90199.38, 117247.03, 144365.60] ], tooltip: { headerFormat: '{point.key} ' } }], drilldown: { series: [{ id: 'a', type: 'column', data: [{ y: 39.9, name: 'name1' }, { y: 31.5, name: 'name2' }] }] } }); }); How can I add drilldown to boxplot? thanks! The method the correct answer adopted is not ideal. For the boxplot are not in the correct x position as expected. this may not be a problem in his example because his boxplot is narrow. But it is extremly harmful when I added outliers. They do not match. sorry I have no reputation for posting images and more than 2 links. https://i.sstatic.net/YTXbY.png Highcharts.setOptions({ colors: ['#33FFFF', '#3399FF' , '#3333FF' , '#9933FF' , '#FF33FF' , '#FF3399' , '#FF3333' , '#FF9933' , '#FFFF33' , '#99FF…
has comment: http://stackoverflow.com/comment/46509592
accepted answer: http://stackoverflow.com/a/28961173
has title: How to make highcharts boxplot with drilldown?
tagged with: highcharts
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
tagged with: boxplot
tagged with: drilldown
has answer: http://stackoverflow.com/a/28961173
upvote count: 1
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/29162967

http://stackoverflow.com/a/28952536
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/46159098
has comment: http://stackoverflow.com/comment/46159256
has comment: http://stackoverflow.com/comment/46158914
has comment: http://stackoverflow.com/comment/46167360
has body: The bug might be the first > not being escaped, depending how you did put your function on the XPage. Move the function into a script library, which is best Practise anyway. Alternative use an ScriptBlock to keep it on the page. To get the format right add it to the page and paste your script through the properties. If you go for pasting into the source directly you might miss a tag. Make sure it is static, not computed.
upvote count: 2
has comment: http://stackoverflow.com/comment/46159399
answers question: http://stackoverflow.com/q/28951101
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46159713
accepted answer of: http://stackoverflow.com/q/28951101
has comment: http://stackoverflow.com/comment/46159037

http://stackoverflow.com/a/29040528
has comment: http://stackoverflow.com/comment/46323918
score: 1
answers question: http://stackoverflow.com/q/29040202
has comment: http://stackoverflow.com/comment/46322312
type: AcceptedAnswer
downvote count: 0
has body: Here's some suggestions: You can use document.getElementById( id ) to get specific elements where id is the HTML's element id &lt;element id="id_name"&gt;. Events allow you to trigger actions based on user input. It works basically the same, but you no longer need to name the functions: element_variable.event = function() { /* ... */ } See if the inner functions are really neccessary; see if you can edit the code where you no longer need that function (document.getElementById will probably be able to let you do that stuff) Example: &lt;form id="factorials" name="factorials"&gt; &lt;!-- Skipping input --&gt; &lt;input type="submit" &lt;!-- ... -&gt; /&gt; &lt;/form&gt; // Javascript file var fact = document.getElementById( "factorials" ); fact.onsubmit = function() { /* Your code here */ }
type: Answer
accepted answer of: http://stackoverflow.com/q/29040202
has comment: http://stackoverflow.com/comment/46321609
upvote count: 1

http://stackoverflow.com/a/28947261
has body: It's blunt but here is your code fixed to update both: http://jsfiddle.net/TheMcMurder/r0ptsfLr/ Note: You weren't following d3's enter, update, exit methodology. You had your enter and your exit, but you didn't have the implicit update anywhere for the bars that existed on the page but needed to be changed with the new data. Here's a simplified example: var data =[45, 10] var data2 =[45, 10, 20, 25, 30, 45] /*The purpose of this JSfiddle is to show how enter, update, and exit works in d3js. The data values above are the data. The image had three manually created black circles. My update will resize them to the appropriate size (based on data) and change their color to blue. All newly drawn objects will be turned green and any object that is exiting will be turned red. The transitions are delayed to make it easier to see. No delay is needed for this to work. */ //creating the svg so I can draw objects on it var svg = d3.select("body").append("svg") .attr("width", 500) .attr("height", 5000) //creating initial circle objects var circle1 = svg.append("circle") .attr("cx", 100) .attr("cy", 100) .attr("r", 25) // another circle object var circle2 = svg.append("circle") .attr("cx", 100) .attr("cy", 200) .attr("r", 25) // another circle object var circle3 = svg.append("circle") .attr("cx", 100) .attr("cy", 300) .attr("r", 25) setTimeout( function(){ enter_update_exit(data) }, 2500 ) setTimeout( function(){ enter_update_exit(data2) }, 10000 ) setTimeout( function(){ enter_update_exit(data) }, 15000 ) function enter_update_exit (data){ var circle_array = svg.selectAll("circle") .data(data); //********************************************************************************** // Enter: all pieces of data that do not have a node to bind to. In this case where // there are already three circles ('nodes') there would have to be more than 3 // data points in our dataset to have enter run at all; //********************************************************************************** c…
answers question: http://stackoverflow.com/q/28934702
downvote count: 0
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/46151536

http://stackoverflow.com/comment/46343808
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29052962
has text: What makes you think `textillate` uses a canvas? It appears to involve only CSS3 and javascript.
score: 0

http://stackoverflow.com/comment/46284039
has text: Those 2 ways end up with the same result, but they have different pros and cons. One creates a controller, the other one creates an isolate scope...
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29020109

http://stackoverflow.com/q/28915179
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: xss
has title: Are cookies safe?
favorite count: 0
possible better answer: http://stackoverflow.com/a/28915261
score: 2
downvote count: 0
has body: I want to create a webpage which redirects a user if some cookies are previously set by my webpage. Like this: (I am using a jquery cookie plugin) // get cookies var email = $.cookie("email_addr"); var postcode = $.cookie("post_code"); if(email != undefined &amp;&amp; postcode != undefined) { // insert cookies into redirect url var redirect = "https://docs.google.com/forms/d/1BofVyLFj9-Y2RQ8LxZuaptS071yHDqW4cdZhvvqTNz8/viewform?entry.139029761=" + email + "&amp;entry.1727046863=" + postcode; console.log(redirect); } (URL character replacement omitted for readability) Can I assume the cookies are safe, and are cannot be modified by anyone but the user and the application, so xss attacks are not possible, or do I need to validate them anyway? I will validate the cookies when they are set, my question is if I can trust my own cookies.
has answer: http://stackoverflow.com/a/28915211
accepted answer: http://stackoverflow.com/a/28915211
type: AnsweredQuestion
tagged with: cookies
has answer: http://stackoverflow.com/a/28915261
type: Question
upvote count: 2
tagged with: jquery-cookie

http://stackoverflow.com/comment/46170018
comment on: http://stackoverflow.com/a/28946502
score: 0
type: AnswerComment
has text: I tried this, but it seems incompatible with something in my meteor/mongodb files, since it caused the error described here http://stackoverflow.com/questions/15610385/meteor-unexpected-mongo-exit-code-100
type: Comment

http://stackoverflow.com/a/28995698
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46240859
has body: Looking at web.xml it seems that org.springframework.js.resource.ResouceServlet should be there, but make sure it exists in the classpath. You could also try following this link and perform these steps: https://stackoverflow.com/a/28170853/2748793 Hope this helps!
answers question: http://stackoverflow.com/q/28995348

http://stackoverflow.com/a/28974087
has comment: http://stackoverflow.com/comment/46234625
has comment: http://stackoverflow.com/comment/46237224
type: Answer
has comment: http://stackoverflow.com/comment/46234454
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/46234205
has comment: http://stackoverflow.com/comment/46200424
accepted answer of: http://stackoverflow.com/q/28974006
answers question: http://stackoverflow.com/q/28974006
has comment: http://stackoverflow.com/comment/46201890
score: 4
has comment: http://stackoverflow.com/comment/46203163
has body: If they both have the same length, indexes, and values how is one iterable but the other isn't? These functions are explicitly documented to perform this way. Both arrays are iteratable, but forEach/map/etc explicitly skips indices which are not in the array: var sparse = new Array(3); var dense = Array.apply(null, Array(3)); // See dense array link belo 1 in sparse; // false 1 in dense; // true // Sparse can still be iterated over sparse[100] = 'a' sparse.forEach(function (n, i) { console.log(n, i) }); // a 100 What is the reason for the difference? Presumably an explicit decision was made to omit indices which don't exist What is the best way to determine if an array is sparse or dense? You can use the following: function isSparse(array) { for (var i = 0; i &lt; array.length; ++i) { if (!i in array) return true; return false; } RE: Your comment There has got be a reason for why [,,,] doesn't have indexes but [undefined, undefined, undefined] does. There doesn't have to be a reason, that's just the way they're built. One has keys, the other doesn't. Look: Object.keys(Array(3)) // =&gt; [] Object.keys(['a','b']) // =&gt; ["0", "1"]
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46235480
has comment: http://stackoverflow.com/comment/46235017

http://stackoverflow.com/a/28932687
answers question: http://stackoverflow.com/q/28932643
score: 0
has body: EDIT: After reading your comment, what you want is to operate in the callback after the data arrives: $("#tech_feed").rss("http://www.feedforall.com/sample.xml", { limit: 1, entryTemplate: '&lt;h1 id="blog_title"&gt;{title}&lt;/h1&gt;'}, function() { }); as seen here: http://jsfiddle.net/heavyhorse/rz59L0r2/ if you want to modify the inner html of the element try something like this after the data has arrived: $('#blog-title').text(newTitleData); http://jsfiddle.net/heavyhorse/y78phrv5/
type: Answer
has comment: http://stackoverflow.com/comment/46121082

http://stackoverflow.com/q/28921072
accepted answer: http://stackoverflow.com/a/28921158
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 1
downvote count: 0
favorite count: 0
has title: Parse JSON with AJAX
has answer: http://stackoverflow.com/a/28921158
upvote count: 1
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46099612
has body: I am trying to parse a JSON result with AJAX. My JSON looks like this [{ "_id" : "54fb09b7d059bdf3107f9486", "lastName" : "Record", "firstName" : "First", "__v" : 0 }, { "_id" : "54fb0a2fd059bdf3107f9487", "lastName" : "Record", "firstName" : "First", "__v" : 0 } ] I call this in Javascript $.getJSON('api/people', function(data) { item3="+data.item3+"&lt;/p&gt;"); $.each(data,function(i,j){ content ='&lt;span&gt;'+j[i].firstName+'&lt;br /&gt;'+j[i].lastName+'&lt;br /&gt;&lt;/span&gt;'; }); alert(content); }); Unfortunately I get "Uncaught TypeError: Cannot read property 'firstName' of undefined" in the console. Can someone please tell me how to properly parse this JSON?
type: Question

http://stackoverflow.com/a/28987430
has comment: http://stackoverflow.com/comment/46224123
accepted answer of: http://stackoverflow.com/q/28987290
upvote count: 1
type: Answer
has body: You could do this: $select = $('select'); $.each(adultAgesArr, function(index, value){ $select.append($('&lt;option/&gt;', {text: value, value: value})); }) Before it appeared that you were coercing the jQuery objects to a string. I think this way, if you cache select beforehand, is just as efficient. DEMO
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28987290
type: AcceptedAnswer

http://stackoverflow.com/comment/46587900
score: 0
type: AnswerComment
type: Comment
has text: Oh, sorry i'm new at this :) Thanks for the tip
comment on: http://stackoverflow.com/a/28929741

combobox
tags question: http://stackoverflow.com/q/28984952
tags question: http://stackoverflow.com/q/29029451
tags question: http://stackoverflow.com/q/29011753
type: Tag
tag name: combobox

http://stackoverflow.com/comment/46321460
type: QuestionComment
has text: You could try using `ng-checked` on the ` ` so that it's checked whenever hideClosed is true (or false) to set up the initial checkbox state.
comment on: http://stackoverflow.com/q/29039866
score: 0
type: Comment

http://stackoverflow.com/q/28922340
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/46102819
tagged with: angularjs
type: UnansweredQuestion
has title: Angular js Route Errors
has body: I'm trying to create a navigation menu..... this is how my html looks like..... @{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Layout.cshtml"; } hello{{2+2}} Registration Courses Instructors When i try to run this my web browser console gives me two errors saying..... Error: [ng:areq] http://errors.angularjs.org/1.3.14/ng/areq?p0=CoursesController&p1=not%20aNaNunction%2C%20got%20undefined at Error (native) at http://localhost:49516/Scripts/AngularJs.js:7:500 at Sb (http://localhost:49516/Scripts/AngularJs.js:57:23) at tb (http://localhost:49516/Scripts/AngularJs.js:59:66) at http://localhost:49516/Scripts/AngularJs.js:303:231 at A.link (https://code.angularjs.org/1.3.14/angular-route.min.js:7:268) at Z (http://localhost:49516/Scripts/AngularJs.js:281:137) at A (http://localhost:49516/Scripts/AngularJs.js:242:276) at g (http://localhost:49516/Scripts/AngularJs.js:210:393) at http://localhost:49516/Scripts/AngularJs.js:206:510 And....... GET http://localhost:49516/Scripts/angular.min.js.map 404 (Not Found) I have already inserted my AngularRoute JS file and AngularRoute Map JS file in my layout page............ This is how my Module js looks like............. var registrationModule = angular.module("registrationModule", ['ngRoute']); registrationModule.config(['$routeProvider', function ($routeProvider) { $routeProvider. when('/Courses', { templateUrl: '/Templates/Courses.html', controller: 'CoursesController' }). when('/Instructor', { templateUrl: '/Templates/Instructors.html', controller: 'InstructorsController' }). otherwise({ redirectTo: '/Courses' }); }]);
tagged with: node.js
tagged with: performance
answer count: 0
has comment: http://stackoverflow.com/comment/46102073

http://stackoverflow.com/q/29031135
score: 0
has answer: http://stackoverflow.com/a/29031982
has title: Javascript Adding function to custom elements in the shadow root
tagged with: custom-element
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29031982
tagged with: shadow
type: Question
answer count: 1
tagged with: javascript
has body: I'm writing an app using shadow root, I found my self using shadow.children[i].addEventListener('click', fn); so much, so I tried to create a custom function to shorthand it, so I wrote: var $shadow = function(shadow, el, fn){ console.log(shadow); console.log(el); var children = shadow.children; for (var i = 0; i &lt; children.length; i++) { var child = children[i]; console.log('child '+child.id+', el '+el); if (child.id === el) { console.log('match'); return shadow.children[i].addEventListener('click', fn); break; } } } and calling it from the custom element as; $shadow(shadow, 'd', alert('yap!')); the problem is the function executed directly once the element is called, and not waiting to "listen" to a "click" action on the specified element. any thought how to fix it?

http://stackoverflow.com/comment/46337659
type: QuestionComment
comment on: http://stackoverflow.com/q/29049704
has text: Javascript arrays are "sparse" (Google fodder...) - if your id's are always numeric you could take advantage of this behaviour instead of creating an object/map.
score: 0
type: Comment

http://stackoverflow.com/q/29018622
tagged with: telerik
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29022621
has body: I am getting the following javascript error but weird thing is it only happen when I run the application through code on my local machine. Code is running fine on servers. Any suggestion or help would be appreciated. Unhandled exception at line 6, column 74203 in <a href="http://localhost/CCSS/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager_TSM&amp;compress=1&amp;_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:fa6755fd-da1a-49d3-9eb4-1e473e780ecd:ea597d4b:b25378d2;Telerik.Web.UI,+Version=2012.1.215.40,+Culture=neutral,+PublicKeyToken=121fae78165ba3d4:en-US:b29b07e8-2c1e-44e5-9e1b-59bb6459fb01:16e4e7cd:ed16cbdc:f7645509:24ee1bba:f46195d3:2003d0b8:1e771326:aa288e2d:b7778d6c:e085fe68:7165f74:e330518b:c8618e41:8e6f0d33:6a6d718d:7c926187:8674cba1:c08e9f8a:59462f1:a51ee93e:82923ac3:2e42e72a:ef347303:cb4a7569:30f1f089:874f8ea2:19620875:490a9d4e:58366029:bd8f85e4" rel="nofollow">http://localhost/CCSS/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager_TSM&amp;compress=1&amp;_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:fa6755fd-da1a-49d3-9eb4-1e473e780ecd:ea597d4b:b25378d2;Telerik.Web.UI,+Version=2012.1.215.40,+Culture=neutral,+PublicKeyToken=121fae78165ba3d4:en-US:b29b07e8-2c1e-44e5-9e1b-59bb6459fb01:16e4e7cd:ed16cbdc:f7645509:24ee1bba:f46195d3:2003d0b8:1e771326:aa288e2d:b7778d6c:e085fe68:7165f74:e330518b:c8618e41:8e6f0d33:6a6d718d:7c926187:8674cba1:c08e9f8a:59462f1:a51ee93e:82923ac3:2e42e72a:ef347303:cb4a7569:30f1f089:874f8ea2:19620875:490a9d4e:58366029:bd8f85e4 0x800a138f - JavaScript runtime error: Unable to set property 'control' of undefined or null reference Update: This is the line that throws the error Sys.Application.add_init(function() { $create(Telerik.Web.UI.RadComboBox, {"_dropDownWidth":0,"_height":0,"_skin":"Default","_text":"5","_uniqueId":"ctl00$MainContent$AddressUpdate$…
has comment: http://stackoverflow.com/comment/46281385
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29022621
answer count: 1
has title: JavaScript runtime error only on local machine
has comment: http://stackoverflow.com/comment/46281188

http://stackoverflow.com/comment/46089564
type: QuestionComment
comment on: http://stackoverflow.com/q/28915127
type: Comment
has text: I've added mistakes which I see when I try to delete or cut. I've used tidy up function of jsfiddle. Do you know if a, b and others not informative variables are normal in not minimized func?
score: 0

http://stackoverflow.com/q/29002585
answer count: 1
downvote count: 0
tagged with: javascript
has body: I have a JavaScript function which is taking the src value &lt;div&gt; &lt;img src="theUrl" id="imgID" onclick="myImageUrl()" /&gt; &lt;/div&gt; &lt;script&gt; function myImageUrl() { var q = document.getElementById(imgID).src; google.script.run .imageCell(); } &lt;/script&gt; I just can't seem to figure out how to pass this into a Google apps function so I can implement the image URL into a cell such as function imageCell() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var range = ss.getActiveRange(); range.setValue(q); } UPDATE: Thank Amit but unless I'm missing something this didn't allow for the value to be used a saved var. I ran it both ways HTML &lt;div id="theImageUrl"&gt; &lt;img src="http://placekitten.com/100/100" id="theImageUrl" onclick="getImage()" /&gt; &lt;/div&gt; &lt;script&gt; function getImage() { q = document.getElementById( 'theImageUrl ).src; google.script.run.imageCell(q); } &lt;/script&gt; Verified by my fiddle Fiddle Server Side function imageCell(q) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var range = ss.getActiveRange(); range.setValue(q); } *Both .setValue(q) &amp; .setValue();
has title: Pass Javascript variable to Google Script function (Google Sheets)
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46284534
favorite count: 0
has answer: http://stackoverflow.com/a/29004767
type: UnansweredQuestion
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/46284801
tagged with: image
type: Question
tagged with: google-apps-script
tagged with: google-sheets

http://stackoverflow.com/q/29007077
has answer: http://stackoverflow.com/a/29216279
has body: I am trying to center in height a div, however it does not work when I resize the browser screen. How to edit this to achieve the adjustable margin-top on resize? Thank you &lt;script&gt; var h = $(window).height(); var parentHeight = h; var childHeight = $('#a-middle').height(); $('#a-middle').css('margin-top', (parentHeight - childHeight) /2); &lt;/script&gt; Edit: The answer should be in js since flexbox won't work on IE-9
tagged with: css
has answer: http://stackoverflow.com/a/29187943
has comment: http://stackoverflow.com/comment/46259806
downvote count: 0
has answer: http://stackoverflow.com/a/29007190
has answer: http://stackoverflow.com/a/29208167
has answer: http://stackoverflow.com/a/29095601
has answer: http://stackoverflow.com/a/29211355
upvote count: 8
type: Question
linked to: http://stackoverflow.com/q/5703552
has answer: http://stackoverflow.com/a/29095562
tagged with: internet-explorer-9
has answer: http://stackoverflow.com/a/29166976
tagged with: javascript
has answer: http://stackoverflow.com/a/29101209
has answer: http://stackoverflow.com/a/29217106
answer count: 14
has title: How to keep div in center-height when I resize the browser window?
tagged with: jquery
has comment: http://stackoverflow.com/comment/46552869
has answer: http://stackoverflow.com/a/29007165
favorite count: 0
score: 8
has answer: http://stackoverflow.com/a/29204121
has answer: http://stackoverflow.com/a/29211690
has answer: http://stackoverflow.com/a/29095458
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29052574
tagged with: ember-data
tagged with: javascript
score: -1
has body: Hi i am an ember noob and when i upgraded to the latest ember data i got these warnings: Update: I have two versions of my app one built without ember-cli and the other one with ember cli both apps are exactly the same they both log these messages out to the console: DEPRECATION: Usage of snapshot.constructor is deprecated, use snapshot.type instead. DEPRECATION: Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead. The first one pops up twice and the second one once right after i click the alert here is the code: The difference is that the app built without ember-cli works! It seems to me that this must be a problem with ember-cli import Ember from 'ember'; export default Ember.Controller.extend({ sortProperties:["time"], sortAscending:true, start:new Date(), count:0, incorrect:0, startReview:true, showHighScores:false, actions:{ startReview:function(){ this.set('startReview',false); this.set("showHighScores",false); this.start = new Date(); this.count = 0; this.incorrect = 0; console.log(this.count); }, showHighScores:function(){ this.toggleProperty("showHighScores"); }, checkCorrectness:function(word){ var textArray = this.get("model.text").split(" "); var length = textArray.length; if(word === textArray[this.count]){ console.log("correct"); this.count++; console.log(this.count); }else{ console.log("Incorrect"); this.incorrect++; } if(length === this.count){ var finish = new Date(); var time = finish-this.start; var accuracy = (this.count/(this.count+this.incorrect)*100); **alert("You took "+time/1000+" seconds! With "+accuracy+"% accuracy!");** Right after i click this alert the deprecation warnings appear this.saveResult(time); this.set('startReview',true); } }, }, I think the set and get in the code below must be the offenders but i dont know how to change them to comlply with the latest update to ember data randomizer:function(){ this.set("randomArray",this.get("model.text").split(" ").randomize()); }.observes("startReview"),…
answer count: 1
downvote count: 1
tagged with: ember-cli
favorite count: 0
type: UnansweredQuestion
tagged with: ember.js
has comment: http://stackoverflow.com/comment/46458127
tagged with: firebase
upvote count: 0
has answer: http://stackoverflow.com/a/29216458
has title: Ember cli broken by new release of ember data?
type: Question
has comment: http://stackoverflow.com/comment/46345806

http://stackoverflow.com/q/28936644
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46128424
score: 1
has body: I have a pie chart for which I want to populate the data. I have been able to set the data in jQuery like this var data = [ { label: "Abc", data: 12 }, { label: "xyz", data: 15 }, { label: "Setwet", data: 85 }, { label: "DashOut", data: 30 }, ]; I want to be able to set the same data from my code behind file from database, and access it in jQuery. How can I do that? My database does have all the information. I have created a class with two members label and data. I have created a collection of this class and added values from database table to this collection like this private List&lt;myData&gt; _myData; public List&lt;myData&gt; MyData { get { if (_myData == null) { _myData = new List&lt;myData&gt;(); _myData.Add(new myData() { label = "abc", data = "10" }); _myData.Add(new myData() { label = "def", data = "20" }); } return _myData; } set { _myData = value; } } My jQuery is expecting an array but in code i have created a Collection of user defined class. Will that be ok? or how should I go about it?
has comment: http://stackoverflow.com/comment/46129100
answer count: 3
has answer: http://stackoverflow.com/a/28955043
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/28938158
possible better answer: http://stackoverflow.com/a/28937545
has answer: http://stackoverflow.com/a/28937545
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28955043
has title: Access array of server side in jQuery

http://stackoverflow.com/q/28977412
score: 0
answer count: 1
type: UnansweredQuestion
has body: I'm having an issue where I have a phantom game object floating around in my JavaScript program that's still attached to my keyboard input handler (keymaster.js). In the code below, I run startGame in demo mode when the page first loads, in order to display a simulated game while the user is reading the splash screen. Then when the user presses the "Start" button, I rerun startGame. However, at this point, whenever the user presses a keystroke, two bullets are fired instead of one. I've discovered that there are two separate 'game' objects responding to the keystrokes, and each is firing a bullet. How can I completely reset my game state between games and kill all associated objects in memory? var startGame = function(demoMode) { this.game = new TypingFrenzy.Game({ "ctx": ctx, "ctx_kbd": ctx_kbd, "demoMode": demoMode }); this.currentGameView = new TypingFrenzy.GameView(this.game, ctx); this.currentGameView.start(); } startGame(true) Below is the code where I bind my event handlers, in response to meager's comment: GameView.prototype.bindKeyHandlers = function () { var ship = this.ship; for (i = 33; i &lt;= 64; i++) { var chr = String.fromCharCode(i); key(chr, function (event, handler) { ship.processKeystroke(event, handler) }); } }; Unbinding my key listeners from my game object allowed my game object to be deleted. I used the following command: key.unbind('a'); Thanks meager!
has comment: http://stackoverflow.com/comment/46205789
tagged with: zombie-process
has title: How to kill JS object with attached keymaster.js listeners
type: Question
has comment: http://stackoverflow.com/comment/46207677
tagged with: javascript
has answer: http://stackoverflow.com/a/28980065

http://stackoverflow.com/q/29000484
upvote count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46248925
answer count: 0
has comment: http://stackoverflow.com/comment/46248737
type: UnansweredQuestion
has title: Node.js http.get in a loop get status codes for all the requests
tagged with: request
tagged with: http
tagged with: node.js
downvote count: 0
score: 1
type: Question
has body: When I run a http.get request like this, it returns the status code for 5 entries var http = require("http"); var i = 10; while (i--) { (function (i) { http.get("http://localhost", function (res) { /*res.on('data', function (data) { //console.log( i + "#data# " + data) });*/ console.log(i + " #status# " + res.statusCode); }); })(i); console.log("requested " + i); } But if I add the res.on() event handlers, it shows all the requests. var http = require("http"); var i = 10; while (i--) { (function (i) { http.get("http://localhost", function (res) { res.on('data', function (data) { //console.log( i + "#data# " + data) }); console.log(i + " #status# " + res.statusCode); }); })(i); console.log("requested " + i); } From what I understand - in the first script, I'm not attaching any handlers for any of the res events, so it terminates as soon as the while loop finishes executing. Only 5 calls complete within that time and I get the status codes for them. My question is if I am only interested in the status code of my requests, is there a way to get them instead of adding handlers for the "res" events?

http://stackoverflow.com/q/28954684
possible better answer: http://stackoverflow.com/a/28954779
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46163185
linked to: http://stackoverflow.com/q/22519784
linked to: http://stackoverflow.com/q/22539815
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28954929
tagged with: javascript
answer count: 2
has body: I am confused by this async behavior. When token is false, refreshToken() function runs but the createTokenFile() doesn't wait for it to finish. Shouldn't var tokenDate = new Date(token.expires); wait after callApiToken().then(function() {refreshToken();}) to finish before executing? function createTokenFile() { console.log("No token-file.json file found. " .red + "Please complete for a new one." .red); return callApiToken().then(function() { refreshToken(); }); } function checkExpiredToken() { return new Promise(function(resolve, reject) { if (!token) { refreshToken(); } var tokenDate = new Date(token.expires); var utc = new Date().toUTCString(); var now = new Date(utc); } function refreshToken() { try { var tokenFile = path.join(__dirname, 'token-file.json'); console.log(tokenFile); return token = JSON.parse(fs.readFileSync(tokenFile, {encoding: 'utf-8'})); } catch (err) { if (err.code !== 'ENOENT') { throw err; } else { return createTokenFile(); } } } UPDATED with refreshToken()
has comment: http://stackoverflow.com/comment/46163159
downvote count: 0
has title: Node.js Promise - Shouldn't code wait until .then is complete()?
score: 1
favorite count: 0
tagged with: promise
accepted answer: http://stackoverflow.com/a/28954929
linked to: http://stackoverflow.com/q/23803743
has answer: http://stackoverflow.com/a/28954779
has comment: http://stackoverflow.com/comment/46162948
tagged with: node.js
has comment: http://stackoverflow.com/comment/46162949

http://stackoverflow.com/a/28989591
downvote count: 0
has comment: http://stackoverflow.com/comment/46227570
has comment: http://stackoverflow.com/comment/46227911
type: Answer
has comment: http://stackoverflow.com/comment/46227789
has comment: http://stackoverflow.com/comment/46227685
has comment: http://stackoverflow.com/comment/46227841
has comment: http://stackoverflow.com/comment/46227865
has comment: http://stackoverflow.com/comment/46227896
has body: I'm pretty certain this is the culprit: if (whc == 0) { s = txt.value; } else { s = txt;//This is a Node object } ... m1 = s.replace(/\s/g, '+'); You are sometimes trying to get .replace out of an HTML element object which does not exist. Edit: I'm not entirely sure what you hope to achieve here. The most obvious fix is to make sure that you are working with a string, so to avoid calling .replace on the node object, add another check to your if statement: if (!s.replace || s.length == 0) { Although, this might still be missing the underlying problem that s probably should be a string to begin with.
has comment: http://stackoverflow.com/comment/46227659
has comment: http://stackoverflow.com/comment/46227650
has comment: http://stackoverflow.com/comment/46228009
answers question: http://stackoverflow.com/q/28989519
score: 4
upvote count: 4

currency
tag name: currency
tags question: http://stackoverflow.com/q/29003461
tags question: http://stackoverflow.com/q/29032382
type: Tag
tags question: http://stackoverflow.com/q/28936150

http://stackoverflow.com/comment/46201310
type: Comment
type: QuestionComment
has text: They're completely different.
score: 1
comment on: http://stackoverflow.com/q/28975086

http://stackoverflow.com/q/28937162
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46132086
has comment: http://stackoverflow.com/comment/46130726
has comment: http://stackoverflow.com/comment/46130614
tagged with: datatables
tagged with: datatable
has body: I have a data table where I have a list of 6 data but it's still returning "0" rows. Why I am not getting the exact list of rows? var rowCount = $('#stockDetailModal >tbody >tr').length; alert(rowCount); if(rowCount=="0") { $("#serviceDetailModal").find("tbody").html(" No Records Found "); } This is my code. Can someone help me to solve the problem?
has title: jquery .length does not return actual length?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46130154
type: Question
score: 0
has comment: http://stackoverflow.com/comment/46130532
has answer: http://stackoverflow.com/a/28937957

http://stackoverflow.com/comment/46216575
type: Comment
type: QuestionComment
score: 1
has text: So what 'does not work' currently?
comment on: http://stackoverflow.com/q/28983477

http://stackoverflow.com/comment/46247207
type: Comment
comment on: http://stackoverflow.com/q/28991602
type: QuestionComment
score: 2
has text: @UtherTG I worked on this problem last year. This post might help you. You'll just need to tweak the code a bit: http://codereview.stackexchange.com/questions/57976/deep-pick-using-lodash-underscore

http://stackoverflow.com/q/28999738
has comment: http://stackoverflow.com/comment/46247329
answer count: 1
has comment: http://stackoverflow.com/comment/46247841
favorite count: 0
accepted answer: http://stackoverflow.com/a/28999838
has body: I'm running JavaScript from a node.js build I implemented into Sublime Text 3. From ReferenceError: "alert" is not defined, I understand that since the script isn't run from a browser, alert boxes are disabled. Are there any alternatives to this? I don't mind losing the alert popup, but I want Sublime Text to print out the alert and not catch an error on it.
has title: Simulating alerts in Sublime Text
has comment: http://stackoverflow.com/comment/46247465
upvote count: 4
tagged with: node.js
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/28999838
tagged with: build
has comment: http://stackoverflow.com/comment/46247433
tagged with: alert
has comment: http://stackoverflow.com/comment/46248247
type: Question
tagged with: sublimetext
has comment: http://stackoverflow.com/comment/46247381
tagged with: javascript
linked to: http://stackoverflow.com/q/11258888
has comment: http://stackoverflow.com/comment/46247527
has comment: http://stackoverflow.com/comment/46247447
downvote count: 2

http://stackoverflow.com/q/28939827
has title: how to convert 2d drawings to 3drawing using three.js/webgl
tagged with: webgl
answer count: 2
downvote count: 0
tagged with: javascript
has body: Hi i am trying to draw the 2d objects in the canvas using js.if click the button it will change to 3d object in another canvas which is in same page. I tried using three.js.if i want draw 3d object,i am giving the points manually in the code.but i dont know how to convert into 3d coordinates. please suggest any ideas this is my code for drawing geomentry plan function init() { // SCENE scene = new THREE.Scene(); // CAMERA var SCREEN_WIDTH = window.innerWidth, SCREEN_HEIGHT = window.innerHeight; var VIEW_ANGLE = 45, ASPECT = SCREEN_WIDTH / SCREEN_HEIGHT, NEAR = 0.1, FAR = 20000; camera = new THREE.PerspectiveCamera( VIEW_ANGLE, ASPECT, NEAR, FAR); scene.add(camera); camera.position.set(0,150,400); camera.lookAt(scene.position); // RENDERER if ( Detector.webgl ) renderer = new THREE.WebGLRenderer( {antialias:true} ); else renderer = new THREE.CanvasRenderer(); renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT); container = document.getElementById( 'ThreeJS' ); container.appendChild( renderer.domElement ); // EVENTS THREEx.WindowResize(renderer, camera); THREEx.FullScreen.bindKey({ charCode : 'm'.charCodeAt(0) }); // CONTROLS controls = new THREE.OrbitControls( camera, renderer.domElement ); // STATS stats = new Stats(); stats.domElement.style.position = 'absolute'; stats.domElement.style.bottom = '0px'; stats.domElement.style.zIndex = 100; container.appendChild( stats.domElement ); // LIGHT var light = new THREE.PointLight(0xffffff); light.position.set(0,250,0); scene.add(light); // FLOOR var floorTexture = new THREE.ImageUtils.loadTexture( 'images/checkerboard.jpg' ); floorTexture.wrapS = floorTexture.wrapT = THREE.RepeatWrapping; floorTexture.repeat.set( 10, 10 ); var floorMaterial = new THREE.MeshBasicMaterial( { map: floorTexture, side: THREE.DoubleSide } ); var floorGeometry = new THREE.PlaneGeometry(1000, 1000, 10, 10); var floor = new THREE.Mesh(floorGeometry, floorMaterial); floor.position.y = -0.5; floor.rotation.x = Math.PI / 2; scene.add(floor); // SKYBOX/FOG va…
favorite count: 0
has answer: http://stackoverflow.com/a/28944339
tagged with: three.js
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/32857435
score: 2
upvote count: 2
type: UnansweredQuestion
type: Question

http://stackoverflow.com/q/29017337
has answer: http://stackoverflow.com/a/29019967
tagged with: ruby-on-rails
type: AnsweredQuestion
tagged with: heroku
tagged with: production
has body: I'm deploying a website with Heroku, though really struggling to get the jQuery firing when it goes live. Locally, all works fine. I've had a play and haven't found any solution - it's all loading in the asset pipeline, shows as a source on the live page (albeit without working) and I've tried all of the solutions I've found on the web. I've performed rake assets:precompile, have config.assets.compile = true and, thinking it might be a problem due to Turbolinks, installed the jquery-turbolinks gem. With every change I thought I'd have this running, though nothing has affected the site's behaviour yet. Here's some code: Gemfile ... gem 'bootstrap-will_paginate' gem 'bootstrap-sass' # Use jquery as the JavaScript library gem 'jquery-rails' gem 'jquery-ui-rails' gem 'jquery-turbolinks' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks gem 'turbolinks' ... Application.js ... //= require bootstrap //= require jquery //= require jquery.turbolinks //= require jquery_ujs //= require jquery-ui //= require turbolinks //= require_tree . ... Application.html.erb &lt;head&gt; &lt;link href='http://fonts.googleapis.com/css?family=Slabo+27px' rel='stylesheet' type='text/css'&gt; &lt;%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' =&gt; true %&gt; &lt;%= javascript_include_tag 'application', 'data-turbolinks-track' =&gt; true %&gt; &lt;%= csrf_meta_tags %&gt; &lt;/head&gt; Home.js var validBox = function(x, y){ ... }); }; var main = function(){ $('.toggle').click(function(){ $('.about-me').toggle(); }); //Carosel $('.arrow-next').click(function(){ ... }); $('.arrow-prev').click(function(){ ... }); //Comments $('.btn').click(function() { ... }); $('.status-box').keyup(validBox('.status-box', '.name-box')); $('.name-box').keyup(validBox('.name-box', '.status-box')); $('.btn').addClass('disabled'); } $(document).ready(main); Could it be a problem with the $(document).ready(main); line? I've a f…
linked to: http://stackoverflow.com/q/22658015
type: Question
accepted answer: http://stackoverflow.com/a/29019967
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Rails - jQuery not working in production with Heroku
score: 2
upvote count: 2

http://stackoverflow.com/a/29316290
answers question: http://stackoverflow.com/q/28959580
has body: I'm a bit of confused about what you really want to do, but if you want to have new posts on the bottom and scroll to them, you can do something similar to what I've been doing in this app using scrollTo for Meteor. First, add scrollTo package into meteor app $ meteor add natestrauser:jquery-scrollto Inside template events for submiting posts from your form into collection, add setTimeout function with scrollTo that will fire few miliseconds after new post was added to collection and it will scroll to new post: Template.posts.events({ "submit .new-post": function (event) { var title = event.target.postTitle.value; var text = event.target.postText.value; Posts.insert({ title: title, text: text, date: new Date() // current time }); setTimeout(function(){ $(".posts-wrapper").scrollTo("max", 500); // change 500 miliseconds to whatever speed you want }, 100); // Clear form event.target.postTitle.value = ""; event.target.postText.value = ""; // Prevent default form submit return false; } }); Template helper where we fetch posts, do sorting, etc.: Template.posts.helpers({ posts: function() { return Posts.find({}).fetch; } }); Template with form to add posts and those posts rendered in div with class .posts-wrapper: Post title: Post text: {{#each posts}} {{> post}} {{/each}} You can see this in action here and check the code inside this Meteorpad. If you need scroll whole , just use: setTimeout(function(){ $("body").scrollTo("max", 500); // change 500 miliseconds to whatever speed you want }, 100);
score: 0
type: Answer

http://stackoverflow.com/comment/46129970
score: 0
type: Comment
type: QuestionComment
has text: Thanks a lot for the replies guys! Wrestling with Promises now, never used them before.
comment on: http://stackoverflow.com/q/28933457

http://stackoverflow.com/q/29017358
has title: Update one textbox using javascript function when another changes
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/29020066
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46279768
has comment: http://stackoverflow.com/comment/46280508
has comment: http://stackoverflow.com/comment/46279714
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29020066
has answer: http://stackoverflow.com/a/29017867
type: Question
possible better answer: http://stackoverflow.com/a/29017867
has answer: http://stackoverflow.com/a/29019019
has comment: http://stackoverflow.com/comment/46280612
tagged with: javascript
tagged with: jquery
tagged with: asp.net
has body: I have a javascript function that counts characters in 2 different textboxes and puts the value in a third textbox. This is the function is as follows: function CountChars() { var subjectLength = document.getElementById("txtBoxSubject").value.length; var msgLength = document.getElementById("txtBoxMsg").value.length; document.getElementById("txtBoxCnt").value = subjectLength + msgLength; } I call it from the Message text box using 'onkeyup' and it works fine. &lt;asp:TextBox ID="txtBoxMsg" runat="server" ClientIDMode="Static" TextMode="MultiLine" onkeyup="CountChars()"&gt;&lt;/asp:TextBox&gt; The Subject textbox can be changed using a dropdown list or a user adding text to it. So using 'onkeyup' will not work for the Subject textbox. I tried using 'onchange' and nothing is entered in the Count text box. This is the Subject html: &lt;asp:TextBox ID="txtBoxSubject" runat="server" ClientIDMode="Static" onchange="CountChars()"&gt;&lt;/asp:TextBox&gt; What am I doing wrong? How can I call the javascript function whenver the text changes in the Subject textbox? Thanks. UPDATE This is the Subject dropdown and the function that is called when it changes. &lt;asp:DropDownList ID="ddListSubject" runat="server" ClientIDMode="Static" AutoPostBack="true" onchange="SubjectChanged();"&gt; &lt;/asp:DropDownList&gt; function SubjectChanged() { var strSubject = document.getElementById("ddListSubject").value; if (strSubject == "Custom") { document.getElementById("txtBoxSubject").value = ""; document.getElementById("txtBoxSubject").focus(); } else { document.getElementById("txtBoxSubject").value = strSubject; } CountChars(); //number appears for a second then disappears }

http://stackoverflow.com/comment/46369047
type: Comment
comment on: http://stackoverflow.com/a/29054795
has text: not to be a pedant, but conditionally require usually means 0 or 1, not 1 or another 1, so no, a fallback file was never really an option to begin with.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/49024488
has text: I have created something very similar to your code, but ready for use as a service. It might be useful for the OP as another example; https://github.com/gammasoft/zipper
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28986508

http://stackoverflow.com/q/28989797
has comment: http://stackoverflow.com/comment/46229218
type: Question
accepted answer: http://stackoverflow.com/a/29004203
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29004203
has comment: http://stackoverflow.com/comment/46228796
answer count: 1
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has body: I am using Jquery Autocomplete to fetch a list of tags from a mysql table. When the user picks one tag from the list, it gets saved on the page. I am trying to prevent the already saved tag from being displayed again. Here is my code: HTML &lt;input type="text" id="tag"&gt; &lt;input type="text" id="tags" style="display:none;"&gt; Jquery $('#tag').autocomplete({ source : function(request, response) { $.ajax({ url : 'tags.php', dataType : "json", method : 'post', data : { searchQuery : request.term, selectedTags: $('#tags').val() //sends already selected terms }, success : function(data) { response($.map(data, function(item) { var code = item.split("|"); return { label : code[0], value : code[0], data : item } })); }, error: function(jqxhr, status, error) { alert(error); } }); }, autoFocus : true, minLength : 1, select : function(event, ui) { var names = ui.item.data.split("|"); tag_ids = []; tag_names = []; tags = $('#tags').val(); if(tags != '')tag_names = tags.split(','); tag_ids.push(names[1]); tag_names.push("'" + names[0] + "'"); $('#tags').show(); $('#tags').val( tag_names.join( "," ) ); $('#tag').val(''); } PHP $searchQuery = $_POST['searchQuery']; $selectedTags = $_POST['selectedTags']; if(!empty($selectedTags)) { $query = $db-&gt;prepare("SELECT * FROM tags WHERE name LIKE ? AND name NOT IN ?"); $query-&gt;execute(array($searchQuery . "%", $selectedTags)); } else { $query = $db-&gt;prepare("SELECT * FROM tags WHERE name LIKE ?"); $query-&gt;execute(array($searchQuery . "%")); } When I select the first suggestion, it gets saved in #tags but then no other suggestion is displayed. If there is any other suggestion to achieving this, that'd be great.
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46228952
has title: Prevent already selected option Jquery autocomplete with MYSQL
tagged with: mysql

http://stackoverflow.com/q/28911928
possible better answer: http://stackoverflow.com/a/28911980
has comment: http://stackoverflow.com/comment/51776523
type: Question
has answer: http://stackoverflow.com/a/28911980
has answer: http://stackoverflow.com/a/28912012
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Variable declaration using short circuiting
has answer: http://stackoverflow.com/a/28911947
answer count: 4
favorite count: 0
upvote count: 2
has body: I was just going through a JQuery plugin and came across the following line of code: var doAnimate = $.support.transition &amp;&amp; animate I do understand short circuiting, but is that a variable declaration using short circuiting ?? On asking somebody more experienced then me, I got the following reply: If they loaded the transition library, use it, otherwise use animate. I guess the value returned is not true or false , because i've heard short circuiting does't return true or false . So if $.support.transition is undefined, animate gets stored in doAnimate? Is that how it works? I am really confused about this variable declaration and how it works. I do understand short circuiting in conditionals .
has answer: http://stackoverflow.com/a/36659283
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28911947
has comment: http://stackoverflow.com/comment/46082637

http://stackoverflow.com/a/29056094
type: Answer
answers question: http://stackoverflow.com/q/29055083
has comment: http://stackoverflow.com/comment/46350869
downvote count: 1
has body: I can do this with setImmediate. https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate setImmediate implementation via window.postMessage or process.nextTick or MessageChannel or script.onreadystatechange https://github.com/YuzuJS/setImmediate/blob/master/setImmediate.js
score: -1
upvote count: 0
accepted answer of: http://stackoverflow.com/q/29055083
type: AcceptedAnswer

http://stackoverflow.com/comment/46325526
type: QuestionComment
type: Comment
score: 1
has text: If its not async why use callbacks? This just increases your stack depth and makes code harder to read.
comment on: http://stackoverflow.com/q/29042728

http://stackoverflow.com/comment/46261699
has text: I can't I am at work and this a problem I am having at home. A simple example would be appreciated..
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29008052

http://stackoverflow.com/comment/46092942
comment on: http://stackoverflow.com/q/28917366
has text: Your problem might be with `canvas.toDataURL` which is disabled if you draw cross-domain images to your canvas. Are you getting a security violation in your console when calling `canvas.toDataURL`?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28955848
has body: Please, play with teh fiddle below. ONE bug goes as it should - turns its "head" and crawls in proper direction. But several bugs (starting with two and up) destroy it all. Jquery "each" returns coordinates twice so instead of two sets of coordinates for two bugs FOUR are generated. $(document).ready(function () { function bug() { $('.bug').each(function () { //var bugs = $('.bug').length; var h = $(window).height() / 2; var w = $(window).width() / 2; var nh = Math.floor(Math.random() * h); var nw = Math.floor(Math.random() * w); //$this = $(this); //var newCoordinates = makeNewPosition(); var p = $(this).offset(); var OldY = p.top; var NewY = nh; var OldX = p.left; var NewX = nw; var y = OldY - NewY; var x = OldX - NewX; angle = Math.atan2(y, x); angle *= 180 / Math.PI angle = Math.ceil(angle); console.log(p); $(this).delay(1000).rotate({ animateTo: angle }); $(this).animate({ top: nh, left: nw }, 5000, "linear", function () { bug(); }); }); }; bug(); }); http://jsfiddle.net/p400uhy2/ http://jsfiddle.net/p400uhy2/4/
has answer: http://stackoverflow.com/a/28956366
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28956051
upvote count: 1
tagged with: each
type: Question
tagged with: jquery-animate
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/28956051
downvote count: 0
tagged with: jquery
favorite count: 0
has title: jQuery each loop returns data twice
possible better answer: http://stackoverflow.com/a/28956366

http://stackoverflow.com/comment/46187257
has text: Yes Mouser, nothing to do with my problem :x . I know the difference, but when i had written as title 'javascript traverse json', someone would have said 'no it is not only a javascript function, it also uses jQuery' .. Think it's of minor priority, Eyal 's answer really helped me.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28949409
score: 0

backbone.js
tags question: http://stackoverflow.com/q/29000129
tags question: http://stackoverflow.com/q/29040189
tags question: http://stackoverflow.com/q/29017312
tags question: http://stackoverflow.com/q/29047625
tags question: http://stackoverflow.com/q/28955115
tags question: http://stackoverflow.com/q/29026149
tags question: http://stackoverflow.com/q/28988551
tags question: http://stackoverflow.com/q/29011526
tags question: http://stackoverflow.com/q/28970541
tags question: http://stackoverflow.com/q/28910297
tags question: http://stackoverflow.com/q/28922754
tags question: http://stackoverflow.com/q/28993791
tags question: http://stackoverflow.com/q/28912795
tags question: http://stackoverflow.com/q/29043329
tags question: http://stackoverflow.com/q/28912386
tags question: http://stackoverflow.com/q/29054986
tags question: http://stackoverflow.com/q/29001510
tags question: http://stackoverflow.com/q/29019440
tags question: http://stackoverflow.com/q/28937863
tags question: http://stackoverflow.com/q/28996204
tags question: http://stackoverflow.com/q/29020704
tags question: http://stackoverflow.com/q/28961867
tags question: http://stackoverflow.com/q/28968379
tags question: http://stackoverflow.com/q/28997778
tags question: http://stackoverflow.com/q/28953263
tags question: http://stackoverflow.com/q/29018057
tags question: http://stackoverflow.com/q/28979519
tags question: http://stackoverflow.com/q/28943337
tags question: http://stackoverflow.com/q/28932924
tags question: http://stackoverflow.com/q/28974534
tags question: http://stackoverflow.com/q/28985038
tags question: http://stackoverflow.com/q/28998845
tags question: http://stackoverflow.com/q/28991739
tags question: http://stackoverflow.com/q/29002039
tags question: http://stackoverflow.com/q/29032936
tags question: http://stackoverflow.com/q/29023352
tags question: http://stackoverflow.com/q/29055763
tags question: http://stackoverflow.com/q/29045343
tags question: http://stackoverflow.com/q/29043622
tags question: http://stackoverflow.com/q/28971604
type: Tag
tags question: http://stackoverflow.com/q/28943528
tags question: http://stackoverflow.com/q/28929728
tags question: http://stackoverflow.com/q/29046254
tags question: http://stackoverflow.com/q/29015954
tag name: backbone.js

http://stackoverflow.com/comment/51627102
comment on: http://stackoverflow.com/a/29022068
type: AnswerComment
score: 0
type: Comment
has text: props mutation is bad practice

http://stackoverflow.com/comment/46273012
type: Comment
type: QuestionComment
has text: setTimeout() method doesn't accept two 'callbacks'. What behaviour are you expecting here?
comment on: http://stackoverflow.com/q/29014070
score: 2

http://stackoverflow.com/a/29015179
has body: Try next : $("#mydiv").tabs(); $("#mydiv").find(".test a").trigger("click"); Or, if you need only switch tab - use active property: $("#mydiv").tabs(); $("#mydiv").tabs({ active:1 }); p.s. in my opinion second method is better, if you not need to emit click event for something other.
score: 1
answers question: http://stackoverflow.com/q/29015099
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/a/28947647
downvote count: 0
type: Answer
has body: As per my suggestion, I have made a basic rough fiddle. It is not quite smooth yet but this is just to give proof of concept to my suggestion. All I am doing is change the background image based on which area is hovered by using a transparent screen for image map Fiddle link here Snippet as follows.. $("#area_image1").mouseover(function(e) { $('.mandala').css("background", "url('https://i.sstatic.net/xypLJ.png') no-repeat center"); }); $("#area_image1").mouseout(function(e) { $('.mandala').css("background", "url('https://i.sstatic.net/A690W.png')"); }); .mandala { background-image: url("https://i.sstatic.net/A690W.png"); display: inline-block; } #mandala_img { opacity: 0.5; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="mandala"&gt; &lt;img id="mandala_img" src="http://dummyimage.com/600x541.png&amp;text=sample" width="600" height="541" usemap="#mandala_map"&gt; &lt;map name="mandala_map" id="mandala_map"&gt; &lt;area shape="poly" coords="310,10,422,33,498,87,430,154,383,121,310,106" href="#area_image1" id="area_image1" /&gt; &lt;area shape="poly" coords="498,87,430,154,479,274,576,274,557,178" href="#area_image2" id="area_image2" /&gt; &lt;area shape="poly" coords="479,275,576,275,553,383,499,462,430,393,463,348" href="#area_image3" id="area_image3"&gt; &lt;area shape="poly" coords="499,462,430,393,310,442,310,540,420,516" href="#area_image4" id="area_image4" /&gt; &lt;area shape="poly" coords="310,442,310,540,206,518,124,462,192,393" href="#area_image5" id="area_image5" /&gt; &lt;/map&gt; &lt;/div&gt; Again this is just a proof of concept. Please do not tell me that this does not work the way you want exactly Hope this helps.
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28946234
answers question: http://stackoverflow.com/q/28946234
type: AcceptedAnswer

http://stackoverflow.com/q/29023209
has comment: http://stackoverflow.com/comment/46290027
has body: The following code produces the result one would expect: &lt;script&gt; function Show_Visibility(){ p = document.getElementById("i_button_2"); alert(p.style.visibility); } &lt;/script&gt; &lt;INPUT TYPE = "button" id = "i_button_1" value = "This is Button 1" onclick="Show_Visibility()"&gt; &lt;br&gt; &lt;INPUT TYPE = "button" id = "i_button_2" value = "This is Button 2"&gt; &lt;script&gt; p = document.getElementById("i_button_2"); p.style.visibility = "hidden"; &lt;/script&gt; However if we define the visibility of button 2 as hidden in CSS, the button is indeed hidden when the page is loaded, but the Javascript alert message is blank. #i_button_2{visibility: hidden;} &lt;script&gt; function Show_Visibility(){ p = document.getElementById("i_button_2"); alert(p.style.visibility); } &lt;/script&gt; &lt;INPUT TYPE = "button" id = "i_button_1" value = "This is Button 1" onclick="Show_Visibility()"&gt; &lt;br&gt; &lt;INPUT TYPE = "button" id = "i_button_2" value = "This is Button 2"&gt; Why is this happening?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29023242
type: UnansweredQuestion
upvote count: 1
type: Question
score: 1
has title: Visibility values defined in CSS not showing in Javascript
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/29053652
upvote count: 0
has comment: http://stackoverflow.com/comment/46344972
score: -2
answers question: http://stackoverflow.com/q/29053602
downvote count: 2
has body: Can you try this? You had "P" in capital letters, and the p element is lowercase. if (difference &lt; 1) { document.getElementsByTagName("p").style.color = "red"; } else { document.getElementsByTagName("p").style.color = "green"; }
has comment: http://stackoverflow.com/comment/46344959
type: Answer

http://stackoverflow.com/a/28992849
has body: Try this, not tested: What I've done is wait until the image is loaded to call the print then close functions newWin = window.open(""); newWin.document.write(' Amuse Me TV '); newWin.document.write(' ');
answers question: http://stackoverflow.com/q/28992432
score: 0
type: Answer

http://stackoverflow.com/q/28975761
has comment: http://stackoverflow.com/comment/46202670
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28975813
has comment: http://stackoverflow.com/comment/46202790
has comment: http://stackoverflow.com/comment/46202783
tagged with: java
has comment: http://stackoverflow.com/comment/46205594
type: Question
tagged with: javascript
tagged with: ajax
score: 0
has body: I have some java class files that I would like to run from javascript. They take in a string and spit out a string. I am trying to figure out the best/easiest way to execute them the class files from javascript so I can get/use its response. So as far as I know now here are my options. Javascript ajax request to php then maybe exec() the jar Javascript ajax request to my class files re implemented as servlet Rewriting the class files as javascript and call it a day 1 is not ideal because I don't avoid using php, if I can. 2 sucks cause I don't want to run Apache Tomcat. 3 sucks naturally. Long story short, I wrote a beautiful implementation of A* in java and I want to use it in a game I wrote in js without rewriting it. What would you do?
has comment: http://stackoverflow.com/comment/46214805
answer count: 1
has title: How to run java code from javascript?

http://stackoverflow.com/comment/46209403
has text: we need to see the code, until and unless we cant give suggestions, try to show some demo / code.. with only image cant give answer..
comment on: http://stackoverflow.com/q/28979281
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/46126775
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28935594
type: Comment
has text: It does, partially, yes, though I am still trying to figure out the javascript to get the selected file from the dropdown and fill the form or just display it.

http://stackoverflow.com/comment/46091988
type: QuestionComment
comment on: http://stackoverflow.com/q/28917120
has text: But they both work, just not at the same time ?
score: 0
type: Comment

http://stackoverflow.com/comment/46104425
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28923823
type: Comment
has text: Where you declare your app and controller?

http://stackoverflow.com/comment/49886146
type: Comment
has text: I would disagree on the last paragraph, the whole purpose of directives is getting extra functionality compiled into the dom using the angularjs framework.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28947407

http://stackoverflow.com/a/28957217
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46168286
has comment: http://stackoverflow.com/comment/46168622
answers question: http://stackoverflow.com/q/28955547
has comment: http://stackoverflow.com/comment/46168770
accepted answer of: http://stackoverflow.com/q/28955547
type: Answer
has body: Bulletproof is a nice PHP image upload class which encorporates common security concerns and practices, so we will use it here as it also makes the whole process much simpler and cleaner. You will want to read the approved answer on this question here (https://security.stackexchange.com/questions/32852/risks-of-a-php-image-upload-form) to better understand the risks of accepting file uploads from users. The PHP below is really basic and really only handle the image upload. You would want to save the path or the file name that was generated in a database or in some kind of storage if the image is uploaded successfully. You may also want to change the directory in which the image is uploaded to. To do this, change the parameter for -&gt;uploadDir("uploads") to some other relative or absolute path. This value "uploads" will upload the image to the libraries/ajax/uploads directory. If the directory does not exist, bulletproof will first create it. You will need to download bulletproof (https://github.com/samayo/bulletproof) and make sure to upload or place it in libraries/bulletproof/. When you download the class from github it will be in a ZIP archive. Extract the zip archive and rename bulletproof-master director to just plain bulletproof. Place that directory in the libraries directory. HTML &lt;form id="avatar_form" action enctype="multipart/form-data" method="post"&gt; &lt;input name="image_file" id="imageInput" type="file" /&gt; &lt;input type="submit" id="submit-btn" value="Upload" /&gt; &lt;/form&gt; JS $('#avatar_form').submit(function( event ){ event.preventDefault(); var formData = new FormData($(this)[0]); //use form data, not serialized string $('#avatarDialog').fadeIn(); $('#avatarDialog').html("Logging in, please wait...."); $.ajax({ type: "POST", url: site_url + "/libraries/ajax/image-upload.php", data: formData, cache: false, contentType: false, processData: false, success: function(data){ if(data.code != 200){ //response code other than 200, error $('#…
has comment: http://stackoverflow.com/comment/46168753
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/46168702
has comment: http://stackoverflow.com/comment/46168581
has comment: http://stackoverflow.com/comment/46343382
has comment: http://stackoverflow.com/comment/46340179
has comment: http://stackoverflow.com/comment/46168756
has comment: http://stackoverflow.com/comment/46711478
has comment: http://stackoverflow.com/comment/46168697
upvote count: 2
has comment: http://stackoverflow.com/comment/46168125

http://stackoverflow.com/comment/46157651
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28951850
has text: Because per documentation [ajaxError](http://api.jquery.com/ajaxerror/) your anonymous function is missing the first parameter, which is `event`, not `xhr`. Should be `$(document).ajaxError(function(event, xhr, status) {...});`
type: Comment

leaflet
tags question: http://stackoverflow.com/q/29044325
type: Tag
tags question: http://stackoverflow.com/q/29018125
tags question: http://stackoverflow.com/q/28994352
tags question: http://stackoverflow.com/q/29044878
tags question: http://stackoverflow.com/q/28970095
tags question: http://stackoverflow.com/q/29004617
tags question: http://stackoverflow.com/q/28930962
tags question: http://stackoverflow.com/q/28930217
tags question: http://stackoverflow.com/q/28908326
tags question: http://stackoverflow.com/q/28914931
tags question: http://stackoverflow.com/q/29035896
tags question: http://stackoverflow.com/q/28983958
tags question: http://stackoverflow.com/q/29000768
tag name: leaflet

http://stackoverflow.com/a/28998151
has body: Seems like the body of your question is asking a different question than the title. In an academic context, e.g. a data structures textbook, "abstract data type" refers to things like Linked Lists, Stacks, Binary Trees, etc. These are not necessarily implemented in an Object Oriented language (in my Data Structures university course, we used C) -- they could consist of a group of structs an functions. So to answer the question in your title, no they're not the same.
type: Answer
answers question: http://stackoverflow.com/q/28997643
has comment: http://stackoverflow.com/comment/46244824
score: 0

http://stackoverflow.com/q/28929815
tagged with: arrays
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28930201
has comment: http://stackoverflow.com/comment/46115524
has answer: http://stackoverflow.com/a/28930201
upvote count: 1
has title: Retrieve Path of Object items
linked to: http://stackoverflow.com/q/15690706
favorite count: 0
has answer: http://stackoverflow.com/a/28930020
accepted answer: http://stackoverflow.com/a/28930020
tagged with: object
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I'm wondering if its possible to retrieve all paths a javascript object contains Example: obj = { prop1 : { x: 19 y: 43 } prop2 : { another: { here: 1 } } prop3: "hello" } Where the result would be an array with following elements: Result: ["prop1.x", "prop1.y", "prop2.another.here", "prop3"] Is this possible? Thanks!
type: Question
answer count: 2

http://stackoverflow.com/comment/46276204
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28966162
type: Comment
has text: uhmm... I found this https://github.com/less/less.js/issues/1957 but I couldn't make it work either. I suggest that you open a issue in their repository.

http://stackoverflow.com/q/28909327
has answer: http://stackoverflow.com/a/28952150
has title: Javascript/jQuery: toggle (vjs-fade-out) when userActive value changes (video.js)
type: Question
tagged with: javascript
tagged with: jquery
answer count: 1
tagged with: css
tagged with: video.js
has body: I am using video.js to create a player that needs to be played on multiple devices. I have an custom (return to menu) button that is placed on top right corner of the video. I need to add/remove (vjs-fade-out) class to it according to the user interaction (mouseover, mouseout, tap, playe, pasue, ...). I have this so far that has some bugs... HTML: &lt;div class="menu-btn"&gt; &lt;a href="../index.html"&gt; &lt;img src="../img/back.svg" width="50"&gt; &lt;/a&gt; &lt;/div&gt; &lt;video id="myPlayer" class="video-js vjs-sublime-skin" width="1024px" height="768px" controls autoplay preload data-setup='{"nativeControlsForTouch": false}'&gt; &lt;source src="../video/test.mp4" type='video/mp4' /&gt; &lt;track class="caption" kind="captions" src="../video/test.vtt" type="text/plain" srclang="en" label="English" default /&gt; &lt;/video&gt; CSS: .menu-btn { z-index: 1000; position: absolute; top: 10px; left: 10px; } jQuery: videojs("myPlayer").on('mouseout', function() { $(".menu-btn").addClass('vjs-fade-out'); }); videojs("myPlayer").on('mouseover', function() { $(".menu-btn").removeClass('vjs-fade-out'); }); videojs("myPlayer").on('tap', function() { if (videojs("myPlayer").userActive()) { $(".menu-btn").removeClass('vjs-fade-out'); } else { //do nothing } }, 1500); and I want to change it to something like this using userActive: $(document).ready(function() { if (videojs("myPlayer").userActive()) { $(".menu-btn").removeClass('vjs-fade-out'); } else { $(".menu-btn").addClass('vjs-fade-out'); } });
type: UnansweredQuestion
score: 0
tagged with: video

http://stackoverflow.com/q/28930394
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has body: I'm trying to get rid of the "put your password in again to confirm it" field in my sign up form. The design pattern I've seen to get around this is a checkbox which will reveal the password to the user - so they can verify it. However, implementing it seems to be a pain. Here's my relevant html: Show password Sign Up Back And the accompanying javascript: function showPass() { document.signup.passwordInput.type=(document.signup.show-pass.value=(document.signup.show-pass.value==1)?'-1':'1')=='1'?'text':'password'; } However, when I try it in firefox, I get the following console error: Password fields present on an insecure (http://) page. This is a security risk that allows user login credentials to be stolen. The error is a little cryptic seeing as the issue isn't with having a password field on a non-https website (I had it working before). Is there something I'm missing here?
has answer: http://stackoverflow.com/a/28930516
tagged with: http://stackoverflow.com/tag/html
tagged with: input
has title: Toggle password input using a checkbox (not working due to security risks)
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28930516
type: Question
tagged with: passwords

http://stackoverflow.com/comment/46335277
has text: That is not how setTimeout works. It is for executing a function asynchronously after a delay. Setting that delay to 0 results in executing the function at the next tick, ie asynchronously as soon as the browser can.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29048237
type: Comment

http://stackoverflow.com/q/29040651
has title: jQuery prop("disabled") is not functioning
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46322020
has answer: http://stackoverflow.com/a/29041054
favorite count: 0
has comment: http://stackoverflow.com/comment/46321937
has answer: http://stackoverflow.com/a/29040791
has comment: http://stackoverflow.com/comment/46322295
answer count: 5
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has body: I know this question has been asked and answered many times, but none of the solutions work for this example, even though I know they should. Perhaps other pairs of eyes will help resolve this. I have placed alerts before and after the code that sets the disabled property, which is indeed set correctly, but the element remains disabled. I have excerpted the code necessary to reproduce this issue: jsfiddle Here's some code just to satisfy the SO rule. $(function () { var dbVendor = $("#database-vendor"); $("#uses-db").on("change", function (event) { event.preventDefault(); dbVendor.prop("disabled", ($(this).val() == "Yes" ? false : true)); }); });
possible better answer: http://stackoverflow.com/a/29040926
downvote count: 2
has comment: http://stackoverflow.com/comment/46321833
type: Question
has comment: http://stackoverflow.com/comment/46321869
has answer: http://stackoverflow.com/a/29041060
accepted answer: http://stackoverflow.com/a/29041060
has comment: http://stackoverflow.com/comment/46321972
score: -2
has comment: http://stackoverflow.com/comment/46321804
has answer: http://stackoverflow.com/a/29041128
has comment: http://stackoverflow.com/comment/46321921
upvote count: 0
has answer: http://stackoverflow.com/a/29040926
tagged with: jquery-mobile

http://stackoverflow.com/a/29041428
answers question: http://stackoverflow.com/q/29041267
type: Answer
has body: Well, if your updates are asynchronous they may be fast and appear to happen at the same time. You could chain the calculations, so the next starts only after each before it ends.
score: 0

http://stackoverflow.com/comment/46179216
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28963645
has text: @caustic - I think what is meant by that is that usually a user will show the attempts that were made including the relevant code. Placing this information into your question shows that you have made an effort to research the problem and have tried to solve it yourself first before posting here.
type: Comment

http://stackoverflow.com/a/29064418
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28985174
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28985174
type: Answer
has body: I think you've got the right idea. When you create the button, you could set its id to the right name, and set its click callback, like so: return &lt;button id={i[0]} onClick={this.handleClick}&gt;{i[0]}&lt;/button&gt; (In this case the ID is the same as the name, but you can do it however you like.) Then you'd have your handler inside the class: handleClick: function(e) { e.preventDefault(); var buttonName = e.target.id; // buttonName is the name of the button clicked }
score: 3

http://stackoverflow.com/q/28991578
has answer: http://stackoverflow.com/a/28991740
has body: I have the code below, where I am wanting to set a variable within the html. For some reason, when I remove the JQuery, it works, but then when I put the JQuery script in, it doesn't. I think it may be because the JQuery is being called on loading the page, as I can get it to work if the JQuery is called from a button. I've tried %s, %(currentDate)s, {0} and then their relating output, but none of them seem to have worked. The first two throw ValueError: unsupported format character ''' (0x27) at index 952, and then {0} causes KeyError: "\n $('" class Fitbit(object): @cherrypy.expose def index(self): currentDate = (time.strftime("%d/%m/%Y")) return """ Fitbit {0} """ .format(currentDate) #return html index.exposed = True If I remove the JQuery, it's definitely working fine and displaying the date. Any other ideas of what to try would be greatly appreciated.
tagged with: python
type: AnsweredQuestion
score: 0
has title: Python throwing KeyError when JQuery included
accepted answer: http://stackoverflow.com/a/28991740
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28914000
answers question: http://stackoverflow.com/q/28913666
has comment: http://stackoverflow.com/comment/46086736
has comment: http://stackoverflow.com/comment/46086429
accepted answer of: http://stackoverflow.com/q/28913666
type: Answer
has comment: http://stackoverflow.com/comment/46086780
score: 2
downvote count: 0
has body: According to the official angularjs docs as in https://docs.angularjs.org/api/ng/directive/input Note: Not every feature offered is available for all input types. Specifically, data binding and event handling via ng-model is unsupported for input[file]. So you may try binding this file select event as a change event over element link: function($scope, element, attrs, ctrl) { element.bind('change', function(value){ console.log("5555"); console.log("Hurray"); }); });
has comment: http://stackoverflow.com/comment/46086298
has comment: http://stackoverflow.com/comment/46086393
upvote count: 2
has comment: http://stackoverflow.com/comment/46086649
has comment: http://stackoverflow.com/comment/46086469
type: AcceptedAnswer

http://stackoverflow.com/a/28935671
has body: This is likely to be some problem related to require() caching, but regardless of the cause, YOU SHOULD NOT USE BABEL/REGISTER IN A REQUIRED LIBRARY. From Babel documentation: Not suitable for libraries The require hook automatically hooks itself into all node requires. This will pollute the global scope and introduce conflicts. Because of this it's not suitable for libraries, if however you're writing an application then it's completely fine to use.
type: Answer
answers question: http://stackoverflow.com/q/28933198
has comment: http://stackoverflow.com/comment/46827662
score: 0
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28933198
type: AcceptedAnswer
downvote count: 1

http://stackoverflow.com/comment/46117153
type: Comment
type: QuestionComment
has text: 1. Input *what* into the value? 2. What?
comment on: http://stackoverflow.com/q/28930747
score: 2

http://stackoverflow.com/q/28956231
has comment: http://stackoverflow.com/comment/46294716
has comment: http://stackoverflow.com/comment/46250127
score: 0
has comment: http://stackoverflow.com/comment/46486767
has title: Getting my box collision function to recognise arguments passed to prototype constructor
has comment: http://stackoverflow.com/comment/46637950
has comment: http://stackoverflow.com/comment/46310426
has comment: http://stackoverflow.com/comment/46178221
has comment: http://stackoverflow.com/comment/46166970
has comment: http://stackoverflow.com/comment/46618606
has comment: http://stackoverflow.com/comment/46212353
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46236688
has comment: http://stackoverflow.com/comment/46339045
has comment: http://stackoverflow.com/comment/46430891
has body: I'm a noob learning to work in JavaScript &amp; HTML5 Canvas and I'm working on my first 2D game. Thank you in advance for any tips you can provide me with. For some reason after I change the enemy constructor function to accept object dimensions as parameters, the dimensions of Enemy are not passed to the collision detection function. This results in my Player object not being affected when crossing paths with the Enemy object. Here is my Enemy constructor function: // Create subclass Enemy function Enemy(x, y, speed, leftSide, rightSide, top, bottom) { Sprite.call(this, x, y); this.speed = speed; // Set variables for enemy dimensions this.leftSide = leftSide + this.x; this.rightSide = rightSide + this.x; this.top = top + this.y; this.bottom = bottom + this.y; this.sprite = 'images/enemy-bug.png'; } Here are the arguments I pass through it: var allEnemies = [ new Enemy(0, 225, 60, 0, 70, 0, 75) ]; Here's my collision detection function: function checkCollisions () { allEnemies.forEach(function(enemy) { if(enemy.leftSide &lt; player.rightSide &amp;&amp; enemy.rightSide &gt; player.leftSide &amp;&amp; enemy.top &lt; player.bottom &amp;&amp; enemy.bottom &gt; player.top) { console.log('collision!'); //Reset player position player.startOver(); } }); } How can I get my collision detection function to recognise the dimension values? My player is walking around with impunity =( Again, many thanks for any assistance you can provide and I do apologise if my post doesn't conform to question standards. This is my first post on StackOverflow.
answer count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46404688
has comment: http://stackoverflow.com/comment/46250304
has comment: http://stackoverflow.com/comment/46500688
type: Question
has comment: http://stackoverflow.com/comment/46167985
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28946247
has comment: http://stackoverflow.com/comment/46147975
type: Question
tagged with: bubble-chart
tagged with: javascript
has comment: http://stackoverflow.com/comment/46147609
has answer: http://stackoverflow.com/a/28948925
accepted answer: http://stackoverflow.com/a/28948925
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46146718
has comment: http://stackoverflow.com/comment/46147725
has body: I am trying to create a Bubble Chart using D3 but can't figure out why my data is not processing correctly. I have imported the processed data from PHP and am now trying to run bubble.node in order to apply relevant graphical data for the circles of the chart (radius, x-coord, y coord etc.). Instead I am currently getting the error: Error: Invalid value for &lt;g&gt; attribute transform="translate(undefined,undefined)" Here's the code (so far; have stopped here because of the error): $(document).ready(function() { // pull data from php file var topFrequency = '&lt;?php echo json_encode($frequencyJSON)?&gt;'; var diameter = 510; // create new pack layout var bubble = d3.layout.pack() .sort(null) .size([diameter, diameter]); // select chart3 div and append svg canvas for graph var canvas = d3.select(".chart3").append("svg") .attr("width", diameter) .attr("height", diameter) .append("g"); jsonData = JSON.parse(jsonData); // should return array of nodes associated with data // computed position of nodes &amp; graphical data for each node var nodes = bubble.nodes(topFrequency); var node = canvas.selectAll(".node") .data(nodes) .enter() .append("g") // give nodes a class name for referencing .attr("class", "node") .attr("transform", function (d) { return "translate(" + d.x + "," + d.y + ")"; }); }); topFrequency looks like this in console.log: {"name":"frequencyData", "children":[ { "author1":"TUYTTENS, FAM", "frequency":7 }, { "author1":"REVILLA, E", "frequency":7 }, { "author1":"ROPER, TJ", "frequency":7 }, { "author1":"MACDONALD, DW", "frequency":6 }, { "author1":"WOODROFFE, R", "frequency":5 }, { "author1":"CHEESEMAN, CL", "frequency":4 }, { "author1":"GALLAGHER, J", "frequency":4 }, { "author1":"KOWALCZYK, R", "frequency":3 }, { "author1":"HANCOX, M", "frequency":3 }, { "author1":"VIRGOS, E", "frequency":3 } ] } So far as I can tell I'm getting the undefined error above because the x and y attributes aren't being created in the array of nodes but I can't figure out w…
tagged with: d3.js
has title: D3: `bubble.nodes` not applying correct graphical data to dataset
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46148796
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/46273074
has text: basically, when the function is done adding the class "visible" to each span inside of the h1, I want to run "$('header').addClass('visible');"
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29014070
type: Comment

http://stackoverflow.com/a/29036024
has body: Try to install jQuery update Module. If you are using Drupal 6, you are not be able to use on function. One option is to include your custom version of jQuery in your page.tpl.php, another option (not recommended) is to use live, but now is deprecated.
answers question: http://stackoverflow.com/q/29035913
type: Answer
score: 0

http://stackoverflow.com/comment/46187271
comment on: http://stackoverflow.com/q/28967756
score: 5
type: Comment
type: QuestionComment
has text: Because `"40000000 "` isn't a number, but instead a string? `isNaN(parseInt("40000000"))` on the other hand returns `false` as expected.

http://stackoverflow.com/comment/46210475
has text: give the complete function, but the solution might be passing event as argument.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28980175

http://stackoverflow.com/q/29016561
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29016939
score: 1
accepted answer: http://stackoverflow.com/a/29016939
has body: I would like to increase the speed of my element #Object when I press a key. The HTML code: &lt;path d="M 0,70 A 65,70 0 0,0 65,0 5,5 0 0,1 75,0 75,70 0 0,1 0,70Z" fill="#FF6600"&gt; &lt;animateTransform id="object" attributeName="transform" type="rotate" from="360 0 0" to="0 0 0" dur="3s" repeatCount="indefinite" /&gt; &lt;/path&gt; The Script: window.addEventListener("keydown", checkKeyPressed, false); function checkKeyPressed(e) { if (e.keyCode == "38") { var getTheSpeed = parseInt(document.getElementById("object").dur, 10); getTheSpeed = isNaN(getTheSpeed) ? 3 : getTheSpeed; getTheSpeed++; document.getElementById("object").dur = getTheSpeed; } } My problem is that dur doesn't only take a number value. The seconds "s" must be specified. So, I cannot actually use isNaN property :( I'm a beginner in JavaScript ^^' Anyone have a solution to run this script? Ty &lt;3
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: keycode
favorite count: 0
has title: jQuery/Svg : increment value "dur" when key is pressed
tagged with: increment

http://stackoverflow.com/comment/46159625
has text: I use Firefox 36.0 and have to click twice _sometimes_.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28952762
type: QuestionComment

http://stackoverflow.com/comment/56365371
has text: Thank you for showing the use of `bind` in the async task. I was just trying to figure out how to pass arguments.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28977661

http://stackoverflow.com/comment/112956821
comment on: http://stackoverflow.com/a/52166201
type: AnswerComment
type: Comment
score: 1
has text: moment("01-01-2000 23:45", "DD-MM-YYYY HH:MM", true) may help avoid unexpected behaviour

http://stackoverflow.com/comment/46340708
type: QuestionComment
has text: @JLRishe I'm extracting parts of HTML anchor tags. An input field is generated containing different attributes such as `href` and `alt`. Thus there are groups of inputs that are related. I want to be able to do things like delete a group of related input tags as well as take each group and convert each group back into an HTML anchor tag. I'm using splice to split them into said groups. I'm not sure what else to tell you.
comment on: http://stackoverflow.com/q/29038981
score: 0
type: Comment

http://stackoverflow.com/q/29011717
has title: Update fabric.js Path points dynamically
favorite count: 0
has answer: http://stackoverflow.com/a/29028608
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/56952754
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/58516750
type: Question
score: 5
has answer: http://stackoverflow.com/a/69253363
has answer: http://stackoverflow.com/a/79523885
upvote count: 5
tagged with: javascript
tagged with: fabricjs
answer count: 6
has body: I'm trying to add points to a path object dynamically. When I do, the path renders correctly, but the bounding rectangle never gets updated, making it nearly impossible for a user to select and move the path on canvas. As you can see in the code below, the path is initially created with a single point, then I dynamically add a second point as well as a control point. After doing this, the bounding rectangle never updates: var canvas = new fabric.Canvas('c'); canvas.backgroundColor = '#f5f5f5'; var path = new fabric.Path('M 0 20',{ left: 100, top: 100, stroke: 'black', fill: '' }); canvas.add(path); var commandArray = []; commandArray[0] = 'Q'; commandArray[1] = 50; commandArray[2] = 100; commandArray[3] = 100; commandArray[4] = 20; path.path[1] = commandArray; canvas.renderAll(); I also tried calling path.setCoords(), but that did not make any difference. How can I get the bounding rectangle to update its dimensions after adding points to a path? Here's a fiddle: http://jsfiddle.net/flyingL123/17ueLva2/2/
downvote count: 0
possible better answer: http://stackoverflow.com/a/58516750
has answer: http://stackoverflow.com/a/29042934
accepted answer: http://stackoverflow.com/a/29042934

http://stackoverflow.com/q/29035718
type: Question
has answer: http://stackoverflow.com/a/29095272
tagged with: javascript
has comment: http://stackoverflow.com/comment/46389186
possible better answer: http://stackoverflow.com/a/29036031
has answer: http://stackoverflow.com/a/29036031
answer count: 2
downvote count: 0
has body: In language part i am using javascript . Code sample provided by youtube v3 is for web view (contains html + js) and in titanium i am not using alloy my current code is a titanium classic app . For using rest api i have first integrated google oauth then on calling upload api it is throwing error mention below, apart from upload api other api for channel listing ,activities , search all are working fine. error thrown are sometimes 401/400 /500 depends on different hit and trial cases. `var videofile = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory,'phone.mp4'); var args = { file : videofile.read(), description : 'test video' }; var xhr = Ti.Network.createHTTPClient({ onload : function(e) { try { console.log(this.responseText); var data = JSON.parse(this.responseText); if (params.callback) { params.callback(data); } else { for (var thing in data) { Ti.API.info("data." + thing + ' = ' + data[thing]); } Ti.API.warn("Data received but no callback specified."); } } catch(e) { Titanium.UI.createAlertDialog({ title : 'Error', message : 'Error accessing data: ' + JSON.stringify(e) }); Ti.API.error('RESPONSE: ' + JSON.stringify(e)); } }, // function called when an error occurs, including a timeout onerror : function(e) { Titanium.UI.createAlertDialog({ title : 'Error', message : 'Error accessing data: ' + JSON.stringify(e) }); Ti.API.error('HTTP: ' + JSON.stringify(e)); }, timeout : 5000 }); console.log(propertyUrl); var urlString = "https://www.googleapis.com/upload/youtube/v3/videos?" + propertyUrl + "&amp;key="+Titanium.App.Properties.getString('accessTokenGoogle'); xhr.open("post",urlString); xhr.setRequestHeader("Authorization", "Bearer " + Titanium.App.Properties.getString('accessTokenGoogle')); ind.show(); xhr.setRequestHeader('Content-Type', 'video/*'); xhr.send(args); ` error log ` [WARN] : TiBaseFile: (KrollRuntimeThread) [8660,8660] Method is not supported org.appcelerator.titanium.io.TiResourceFile : getParent [INFO] : {"file":{"file":{"hidden":false,"nat…
favorite count: 0
has comment: http://stackoverflow.com/comment/46390819
accepted answer: http://stackoverflow.com/a/29095272
tagged with: titanium
has title: youtube restapi (v3) integration in titanium for video upload
tagged with: youtube-javascript-api
type: AnsweredQuestion
score: 2
upvote count: 2
tagged with: youtube-data-api
tagged with: youtube-api

http://stackoverflow.com/comment/46400279
has text: Unless I'm misunderstanding something, neither .innerHTML() nor .text() will return just the text a person has selected.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29070079
type: AnswerComment

http://stackoverflow.com/comment/46146312
comment on: http://stackoverflow.com/q/28931707
has text: @Connor : although you have the right to choose whatever answer you consider correct, it would be appropriate to give preference to those that were answered first and they are also correct. Alexandander's answer and mine work as good as the chosen one, however If they didn't work for you it may be because the method `.on()` requires jQuery v1.7+ and you might be using an older version. Just for the record.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28927732
tagged with: http://stackoverflow.com/tag/html
tagged with: php
score: 2
has title: Enable iframe on specified host
has answer: http://stackoverflow.com/a/28927884
downvote count: 0
tagged with: iframe
has body: I do currently run a website. On this website I have a few videos which are iframed from my video server. I'm hosting the video's in JWplayer on the video server, which I then iframe into my own website. Now I have found some websites which iframe my player into their site, or just re-direct them to the play on the video server. I know I can just put the player into the page but I do not want that. Basically my question is how do I redirect people to http://www.server1.com/video1.html (this is the site where server2.com/videoplayer.html is iframed) if the Jwplayer is not loaded with server1 as URL. So I want people to only see the player if the main url is server1.com I can change the player to the second site if needed, I just want to iframe the player without others being to iframe it or watch the player trough the iframe URL.
type: Question
has answer: http://stackoverflow.com/a/28936606
tagged with: javascript
upvote count: 2
answer count: 2
favorite count: 0
type: UnansweredQuestion

web-services
type: Tag
tags question: http://stackoverflow.com/q/29038320
tags question: http://stackoverflow.com/q/29053326
tag name: web-services
tags question: http://stackoverflow.com/q/28951391
tags question: http://stackoverflow.com/q/28913346
tags question: http://stackoverflow.com/q/28938629

http://stackoverflow.com/q/29030482
has comment: http://stackoverflow.com/comment/77664356
tagged with: visualforce
upvote count: 1
answer count: 1
tagged with: salesforce
favorite count: 0
type: UnansweredQuestion
has title: form validation not working in visualforce which working in html
tagged with: jquery-form-validator
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/53173168
tagged with: javascript
has body: Form validation is not working but same code is running in html and form validation also works i have uploaded all static resources please suggest me what changes in code are required. 1. I have uploaded static resourced successfully. 2. All files path is correct. 3. Suggest me if any changes necessary for html tag to visualforce tag <apex:stylesheet value="{!URLFOR($Resource.validation, 'valid/bootstrap.min.css')}"/> <apex:stylesheet value="{!URLFOR($Resource.validation, 'valid/formValidation.min.css')}"/> <apex:includeScript value="{!URLFOR($Resource.validation,'valid/bootstrap.min.js')}"/> <apex:includeScript value="{!$Resource.bootstrapjs}"/> <apex:includeScript value="{!URLFOR($Resource.validation,'valid/bootstrap1.min.js')}"/> <apex:includeScript value="{!URLFOR($Resource.validation,'valid/formValidation.min.js')}"/> <apex:includeScript value="{!URLFOR($Resource.validation,'valid/jquery.min.js')}"/> Full name Submit

http://stackoverflow.com/comment/46250871
score: 0
comment on: http://stackoverflow.com/q/29001604
type: Comment
type: QuestionComment
has text: check your browser console... there will be error message

http://stackoverflow.com/a/29035030
type: Answer
has comment: http://stackoverflow.com/comment/46311139
answers question: http://stackoverflow.com/q/29034918
downvote count: 0
has body: What about doing : var responseJSON = JSON.parse(response); var dataEquip = responseJSON ['data'] // get the data from json obj var komvosName = dataEquip['TrenchType']; a JSON object (responseJSON ) is nothing more than an associative array.
accepted answer of: http://stackoverflow.com/q/29034918
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/28957049
has comment: http://stackoverflow.com/comment/46174549
has body: Hover over me and it scrolls down the page You will need stuff here to see the scroll work
has comment: http://stackoverflow.com/comment/46166943
downvote count: 3
has comment: http://stackoverflow.com/comment/46221833
score: -3
answers question: http://stackoverflow.com/q/28925529
type: Answer
has comment: http://stackoverflow.com/comment/46208683
upvote count: 0
has comment: http://stackoverflow.com/comment/46167584

http://stackoverflow.com/comment/46177921
type: Comment
comment on: http://stackoverflow.com/a/28962973
has text: I have it with my key and it doesn't work. I have also tried what you have said, and still doesn't work
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46112946
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28928577
score: 0
has text: Good answer. But I think OP wanted to measure the time between two alerts. (But I might be wrong, question is not that clear in my opinion)

http://stackoverflow.com/a/28993781
has comment: http://stackoverflow.com/comment/46236857
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28993322
has comment: http://stackoverflow.com/comment/81685521
answers question: http://stackoverflow.com/q/28993322
score: 3
type: Answer
has body: UPDATE: Looks like this is possible with MariaDB 5.3+ now. anyway, I wouldn't suggest doing this because you'll use vendor-specific extensions. Referring to MySQL Long Query Progress Monitoring, it isn't possible to monitor a MySQL query. The only thing you could do is to split queries and then check how many queries ran through already.
upvote count: 3

http://stackoverflow.com/q/29027724
favorite count: 0
tagged with: angularjs
answer count: 5
has answer: http://stackoverflow.com/a/29923517
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47898787
upvote count: 16
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29950267
score: 16
has comment: http://stackoverflow.com/comment/47902570
has answer: http://stackoverflow.com/a/29937992
has answer: http://stackoverflow.com/a/29950267
has answer: http://stackoverflow.com/a/29936996
type: Question
has comment: http://stackoverflow.com/comment/47894456
has body: In my app I use an interceptor to catch all http response errors, like: var response = function(response) { if(response.config.url.indexOf('?page=') &gt; -1) { skipException = true; } return response; } var responseError = function(rejection) { if (rejection.status === 401 || rejection.status === 403) { /**/ } else if (rejection.status &gt;= 500 || rejection.status === 0) { /**/ } else if (rejection.status === 404 &amp;&amp; !skipException) { /**/ } else if (rejection.status === 404 &amp;&amp; skipException) { /**/ } else{ /**/ } return $q.reject(rejection); }; And when I go to my controller (when my getArticles method returns some data, not 404 - when articles array is empty) all is OK: 404 with skipException == true is caught. But when my articles array is empty the server returns a 404 and when I enter this controller I cannot get response.config.url -- no response is caught, but why? I thought that interceptor would catch all of the responses. $timeout(function() { $scope.getArticles(); }, 100); and $scope.getArticles has such code: getDataService.getArticles($scope.pageNum).then(function(response) { /**/ }); service: var getEventsByScrollService = function(num) { var deferred = $q.defer(); $http.get(***, { }) .success(function(response) { deferred.resolve(response); }).error(function(err, status) { if (status === 404){ deferred.resolve([]); } else{ deferred.reject(err); } }); return deferred.promise; }; How can I conditionally catch 404's depending on the URL? Because this: if(response.config.url.indexOf('?page=') &gt; -1) { Doesn't always work.
tagged with: javascript
has comment: http://stackoverflow.com/comment/47933798
has title: angularJS: custom 404 interceptor handle - response with url
has comment: http://stackoverflow.com/comment/47958289
accepted answer: http://stackoverflow.com/a/29937992
has answer: http://stackoverflow.com/a/29936851
downvote count: 0
has comment: http://stackoverflow.com/comment/47985346

http://stackoverflow.com/comment/46156866
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28951264
score: 1
has text: Yes, this sounds like a problem. You don't have to declare `ng-controller` in partial templates, route configuration already has controller to be instantiated. Remove the one from template.

http://stackoverflow.com/a/29049346
has body: So I think I figured out what is going on here. The code in jquery.caption was doing this: $(this).bind('mouseenter.caption mouseleave.caption', function(){ $(this).data('caption').figcaption.stop().fadeToggle(); }); fadeToggle works by changing the opacity. Because I had so many images close together, when the user moused around there were a lot of mouseenter and mouseleave events, and each time one occurred it would call stop on the existing fadeToggle. This would leave the opacity at whatever it was at at the moment. I changed this to: $(this).bind('mouseenter.caption mouseleave.caption', function(){ if ($(this).data('caption').figcaption.css('display') == 'none') { $(this).data('caption').figcaption.show(); } else { $(this).data('caption').figcaption.hide(); } }); And now it's working perfectly.
type: Answer
answers question: http://stackoverflow.com/q/28975035
score: 0

http://stackoverflow.com/a/28960345
has body: Solved by myself.... I had just to declare myarray as: var myarray = {}; so everything worked in this way. Thanks anyway to all!! Cheers Luigi
accepted answer of: http://stackoverflow.com/q/28959614
answers question: http://stackoverflow.com/q/28959614
type: Answer
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/46300567
comment on: http://stackoverflow.com/q/29028995
score: 1
has text: I've done a console.log after the fisrt_iteration=false; and the result is option1 , it seems that span in the HTML interference with the :selected that does not never appear
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29128307
has body: fixed by using data: JSON.stringify(pos) Thanks to Nico O for answer
answers question: http://stackoverflow.com/q/29038594
accepted answer of: http://stackoverflow.com/q/29038594
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/a/29031238
type: AcceptedAnswer
type: Answer
has body: Turned out to be a restrictive firewall blocking the POST. Gonna have to move my listeners to the JS files and remove the onclick tags.
accepted answer of: http://stackoverflow.com/q/29029052
answers question: http://stackoverflow.com/q/29029052
score: 0

http://stackoverflow.com/q/29053038
tagged with: authentication
upvote count: 1
tagged with: registration
type: Question
score: 1
downvote count: 0
has title: Login in and registration function in Javascript not working
tagged with: javascript
has body: I'm trying to make a simple registration and login function in Javascript. I want to have 6 input elements and 2 buttons in the html code. (Login Section) 1 input for username, 1 for password and 1 button for running the login function. (Registration section) 1 for new username, 1 for new email, one for new password , 1 for repeat password and 1 button for running the registration function. First, a user fills in the registration fields, if a field is empty, alert "fill the field"s, else if new password is different from repet password, password and repet password dont match, else, alert you are registered. Here i want new password and new username to be saved in new password and use it in the login section. Second, a user knows what the new password and new username is and can loggin. if, username is logged in, alert you are in, else if username and password is the same as new username and new password, alert you are logged in, redirect to index.html. This is what i have done so far. var username = document.form.username.value; var newusername = document.form.newusername.value; var password = document.form.password.value; var newpassword = document.form.newregpw.value; var newregemail = document.form.newregemail.value; var loggedin = "outside"; function login() { if (loggedin == "inside") { alert("You are already on the inside. Go shopping!"); } else if (username == newusername && password == newregpw) { loggedin = "inside"; window.location = "index.html"; alert("Logged in, go shopping!"); } else { alert("Wrong Username or Password. Try again."); } } function reg() { if (newusername === null || newregemail === null || newregpw === null || reppw === null) { alert("Fill out all the fields."); } else if (newregpw != reppw) { alert("The password and repet password field dosen't match. Try again!"); } else { alert("Congraulations you are now registerd"); } } HOME ABOUT CONTACT ACCOUNT LOGIN MEN WOMEN CHILDREN Login/New account Login Usernamn/E-mail Password Login New Ac…
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: input
answer count: 0

http://stackoverflow.com/q/29058845
has comment: http://stackoverflow.com/comment/46354192
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46354187
has comment: http://stackoverflow.com/comment/46354231
tagged with: jquery-mobile
has answer: http://stackoverflow.com/a/29058927
has comment: http://stackoverflow.com/comment/46354155
has body: I have this wordpress site which i am trying to get the header to hide when the user scrolls. I have tried different codes but i cant seem to get it working. The reason i am trying to do this is because on mobile the header causes scroll problems and if i hide the header then the scroll is normal. This is the JS i was using: jQuery(function($) { $(window).scroll(function () { if ($(this).scrollTop() > 100) { $('#topContainer').hide(); } else { $('#topContainer').show(); } }); }); Home How it works Features Screens Download Contact Blog <img class="ls-l ls-preloaded" style="top: 4px; left: -7px; white-space: nowrap; width: 530px; height: 680px; padding: 0px; border-width: 0px; visibility: hidden; margin-left: 0px; margin-top: 0px; transform-origin: 50% 50% 0px; transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1); opacity: 1; filter: none;" data-ls="offsetxin:0;offsetyin:100;durationin:2000;offsetxout:0;" src="http://lendenapp.com/wp-content/uploads/2015/01/iphone_hand_slider1.png" data-src="http://lendenapp.com/wp-content/uploads/2015/01/iphone_hand_slider1.png" alt=""><p class="ls-l sliderText" style="top: 73px; left: 631px; line-height: 65px; white-space: nowrap; width: auto; height: auto; font-size: 70px; padding: 0px; border-width: 0px; visibility: hidden; margin-left: 0px; margin-top: 0px; transform-origin: 50% 50% 0px; transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1); opacity: 1; filter: none;" data-ls="offsetxin:0;offsetyin:50;durationin:2000;offsetxout:0;">LenDen Your neighbourhood marketplace Download for Android Download for Apple IOS <img class="ls-l ls-preloaded" style="top: 4px; left: -7px; white-space: nowrap; width: 600px; height: 600px; padding: 0px; border-width: 0px; margin-left: 0px; margin-top: 0px; transform-origin: 50% 50% 0px; transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1); opacity: 1; visibility: hidden; filter: none;" data-ls="offsetxin:0;offsetyin:100;durationin:2000;offs…
type: Question
accepted answer: http://stackoverflow.com/a/29058927
has title: Cannot hide fixed header on scroll Mobile?
tagged with: css
has comment: http://stackoverflow.com/comment/46354169
score: 0
tagged with: wordpress
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/28923453
has comment: http://stackoverflow.com/comment/46103621
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I don't have a ton of web-dev experience, just enough to know syntax etc. As part of a project I've been asked to provide a hosted link to a small web app in which I use PHP5/HTML5/MySQL/Javascript to leverage various API's. The issue is I don't have a registered domain name at the moment, and no way of hosting my response. I would really prefer not to spend any money just to submit a single project if possible. Sorry if this seems like a dense question, but time is a factor and the research I've done hasn't yielded anything concrete. Found Free Hosting Sites Here: http://www.prchecker.info/web-hosting/top-10-free-web-hosting-sites/ And I'm thinking http://www.biz.nf/ might be the best choice... Only issue is it seems to suggest that it only hosts Wordpress sites, which seems odd to say the least. I would really appreciate any clarification, thanks!
favorite count: 0
upvote count: 2
has title: How can I host HTML/PHP/MySQL for a short project
has answer: http://stackoverflow.com/a/28923802
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/73583481
accepted answer: http://stackoverflow.com/a/28923802
downvote count: 3
tagged with: web-hosting
score: -1
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/46103660
tagged with: javascript

http://stackoverflow.com/q/29019362
type: Question
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/29019420
accepted answer: http://stackoverflow.com/a/29019420
has title: How can I change the below function to output alphanumerically?
downvote count: 2
answer count: 1
favorite count: 0
type: AnsweredQuestion
upvote count: 0
has body: If I change the values to say 100a or 1a2b the input into the field track stops working. I am wondering how I can make this work with alphanumeric values. none visa mastercard discover americanexpress jcb

http://stackoverflow.com/comment/46210144
type: QuestionComment
has text: comments can't select as answer glad if it worked for you :)
comment on: http://stackoverflow.com/q/28979662
score: 0
type: Comment

header
type: Tag
tags question: http://stackoverflow.com/q/28926529
tag name: header
tags question: http://stackoverflow.com/q/28970534

http://stackoverflow.com/q/28977606
score: 0
has body: I created a regular expression to test if an input is within the range 1-99. It tests correctly, but when I input 10, it shows there is an issue. I am guessing since the range [1-9] does not include '0'. How do I change the syntax to include "0" so that 10 is not rejected as an input between 1-99? var regex = /^(\b[1-9]{1,2}\b)$/;
has title: Reg Ex Testing Number Range Using \b
type: UnansweredQuestion
tagged with: regex
has answer: http://stackoverflow.com/a/28977631
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/28972486
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/46196376
has title: Need help in javascript array
score: 0
type: Question
has answer: http://stackoverflow.com/a/28972700
tagged with: javascript
has comment: http://stackoverflow.com/comment/46196284
answer count: 1
favorite count: 0
has body: I am working on javascript based functionality for showing user emotion through smiley for 7 days. 1 Smiley for 1 day. I did this for user 1 for day 1 by javascript if else. But this is not a good way for doing this task. Because here we have 7 days and as per enter value in text field it will show smiley. Somehow I feel array will be good option. But I don't know how to achieve this task through by array. What I am thinking first I have to call 7 smiley background in array, then match them as per user entered value. But the problem is for user2 and user3. I think I have to twice time duplicate user1 code for user2 and user3. Anyone can suggest some good solution. My working jsfiddle code function checkvalue() { var iuser1 = document.getElementById("user1").value; var iuser2 = document.getElementById("user2").value; var iuser3 = document.getElementById("user3").value; if ( iuser1 == 1 ) { document.getElementById("c1day1").style.backgroundImage = "url('https://cdn2.iconfinder.com/data/icons/very-emotional-emoji/64/18_EmoticonsHDcom.png')"; } else if ( iuser1 == 2 ) { document.getElementById("c1day1").style.backgroundImage = "url('https://cdn2.iconfinder.com/data/icons/very-emotional-emoji/64/53_EmoticonsHDcom.png')"; } else if ( iuser1 == 3 ) { document.getElementById("c1day1").style.backgroundImage = "url('https://cdn2.iconfinder.com/data/icons/very-emotional-emoji/64/69_EmoticonsHDcom.png')"; } else if ( iuser1 == 4 ) { document.getElementById("c1day1").style.backgroundImage = "url('https://cdn2.iconfinder.com/data/icons/very-emotional-emoji/64/42_EmoticonsHDcom.png')"; } else if ( iuser1 == 5 ) { document.getElementById("c1day1").style.backgroundImage = "url('https://cdn2.iconfinder.com/data/icons/very-emotional-emoji/64/72_EmoticonsHDcom.png')"; } else if ( iuser1 == 6 ) { document.getElementById("c1day1").style.backgroundImage = "url('https://cdn2.iconfinder.com/data/icons/very-emotional-emoji/64/26_EmoticonsHDcom.png')"; } else if ( iuser1 == 7 ) { document.get…
type: UnansweredQuestion

http://stackoverflow.com/q/28922268
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/28924303
upvote count: 1
answer count: 1
has title: Is there any javascript construction block script/library alike Appinventor or Scratch?
has comment: http://stackoverflow.com/comment/46101700
tagged with: math
tagged with: app-inventor
accepted answer: http://stackoverflow.com/a/28924303
has body: I was wondering if there is any javascript script or library that i could install on my site that would work much alike Appinventor or Scratch design blocks. I am trying to create a small formula creator from blocks, so i don't need something too complicated. Need just basic math functions. Not to be confused, I am not looking for either other math formula creators like Latex, nor to similar sites like Appinventor or Scratch. Just a visual design block alike script. Thank you.
tagged with: javascript
has comment: http://stackoverflow.com/comment/46106257
tagged with: formula
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/comment/55051516
score: 0
comment on: http://stackoverflow.com/a/28954300
type: Comment
type: AnswerComment
has text: This question was so long ago I don't even recall how I fixed it, but re-reading it your solution will in fact work so I've marked it as the answer.

http://stackoverflow.com/comment/46093044
score: 1
comment on: http://stackoverflow.com/q/28917528
type: Comment
type: QuestionComment
has text: Go to [that author's Github repository](https://github.com/erikzaadi/jQuery.printElement) - the version of the library you're using appears to be quite out of date.

http://stackoverflow.com/q/28988175
has answer: http://stackoverflow.com/a/28988930
has title: AngularJS onClick of button. I want to change color of another element
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/46225015
type: Question
accepted answer: http://stackoverflow.com/a/28988930
score: 0
answer count: 1
tagged with: jquery
has body: I am new to angular. i developed app like I successfully developed next and previous button functionality. Now I want to write submit button.my idea is when submit button pressed the response will be captured and validate finally after all questions answered.and also if i press submit button corresponding pagination tab color changes to green like if I attended 1 and 2 means the first two tab color changes to green. how can I implement this. Any ideas? my quizcontroller.js angular.module('app').controller('Quizcontroller',function($scope,updateservice){ $scope.$watch(function($scope){ $scope.count=updateservice.getupdate(); }); $scope.questions=[ { id:1, question:'When a gas is turned into a liquid, the process is called', options: [ {option:'condensation'}, {option:'evaporation'}, {option:'deposition'}, {option:'sublimation'} ] }, { id:2, question:'Which of the following parts of the sun is easily visible only during a total solar eclipse? ', options: [ {option:'core'}, {option:'photosphere'}, {option:'sunspots'}, {option:'corona'} ] }, { id:3, question:'The accumulation of stress along the boundaries of lithospheric plates results in which of the following? ', options: [ {option:'Earthquakes'}, {option:'Magnetic reversals'}, {option:'Hurricanses'}, {option:'Increased deposition of deep-sea sediments'} ] }, { id:4, question:'Pollination by birds is called ', options: [ {option:'autogamy'}, {option:'ornithophily'}, {option:'entomophily'}, {option:'anemophily'} ] } ]; updateservice.settotal($scope.questions.length) $scope.next=function($scope){ var val=updateservice.getupdate(); updateservice.setupdate(val&lt;updateservice.gettotal()-1?++val:0); }, $scope.prev=function($scope){ var val=updateservice.getupdate(); updateservice.setupdate(val&gt;0?--val:updateservice.gettotal()-1); } })
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46224783

http://stackoverflow.com/comment/46123199
type: Comment
type: QuestionComment
score: 0
has text: @thefourtheye - added. Essentially: (1) if data for `FieldName` exists (not covered here) use it, otherwise... (2) if a default exists use it, otherwise... (3) display the field name (without brackets).
comment on: http://stackoverflow.com/q/28933570

http://stackoverflow.com/comment/46116747
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28930423
has text: That won't work cross browser unfortunately.
score: 0

http://stackoverflow.com/comment/46152656
has text: But they don't, only the tweets that are in the first selection appear there, and none of the following ones.
comment on: http://stackoverflow.com/a/28946544
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46321335
comment on: http://stackoverflow.com/q/29037655
score: 0
type: QuestionComment
has text: What does "doesn't work" mean here? I suspect it means that the function continues to reload the page instead of reloading in place. If so, that's probably because you're calling `submit()` on your form. Default behavior when submitting a form is to reload the entire page. What you'll want to do is serialize the data from the form into your ajax call without calling `submit()`.
type: Comment

http://stackoverflow.com/comment/46207005
type: QuestionComment
has text: If you want something to apply to a group of elements then I recommend you use a class. `id` should be given to one element and only that element, for groups of elements you should assign them with a class attribute.
comment on: http://stackoverflow.com/q/28978108
score: 0
type: Comment

http://stackoverflow.com/comment/46109265
type: AnswerComment
comment on: http://stackoverflow.com/a/28926113
type: Comment
has text: @RickHitchcock, Strictly that's what the OP is doing in his example, only for the entire HTML string. However the last can be omitted from the solution, the answer is really about serializing the HTML into an element and than use DOM manipulation to do your sanitizing.
score: 0

http://stackoverflow.com/a/29031958
has body: Please see demo below In select change your model to cutomer and in inputs use customer.id customer.name function DemoCtrl($scope) { $scope.content = [{ name: "Bireysel", id: 1 }, { name: "Kurumsal", id: 2 }, { name: "Bireysel & Kurumsal", id: 3 }]; }
accepted answer of: http://stackoverflow.com/q/29031394
score: 2
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29031394
has comment: http://stackoverflow.com/comment/46307063
upvote count: 2
type: Answer

http://stackoverflow.com/q/28970779
has comment: http://stackoverflow.com/comment/46193199
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/46193197
tagged with: javascript
has title: Check all checkbox by clicking on 1 checkbox
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28971342
has answer: http://stackoverflow.com/a/28971055
has comment: http://stackoverflow.com/comment/124182159
tagged with: jquery
tagged with: asp.net
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46193328
tagged with: datalist
linked to: http://stackoverflow.com/q/28928636
has answer: http://stackoverflow.com/a/70244127
has comment: http://stackoverflow.com/comment/46195153
has body: <asp:DataList runat="server" ID="dl1" OnItemDataBound="cb1"> <asp:CheckBox ID="Cb1" runat="server"/> <asp:CheckBox ID="cb2" runat="server" /> </asp:DataList> Here, I want a jquery/javascript where If I select cb1 then cb2 should be selected automatically and not vice versa. I am trying this: But can anyone please help me.

http://stackoverflow.com/q/28942878
tagged with: http://stackoverflow.com/tag/csv
tagged with: node.js
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
has body: I have a random text data, and I need to determine its filetype, such as .xls, .csv, .tsv, .json and .html. Currently I am using a brute force to parse the file against all different format. My problem occurs when the file is slightly broken, and will fail in the parsing process. In these cases, is there a reasonably good heuristics that can guess the filetype, so that I can further "lint" the data according to this format? I am using node.js, in case there is already a library for that. I am open to solution outside of node.js. I tried to use mmmagic, but it only return "text/plain", instead of the information I need (.tsv, .json, .xml), sample code in livescript: useMagic = (res)-&gt; buf = new Buffer res.body magic = new mmmagic.Magic! ##return UTF-8 Unicode text, with very long lines, with no line terminators #magic = new mmmagic.Magic mmmagic.MAGIC_MIME ## return text/plain; charset=utf-8 #magic = new mmmagic.Magic mmmagic.MAGIC_MIME_TYPE ##text/plain err, magicalres &lt;- magic.detect buf magicalres |&gt; console.log url = "https://sheethub.com/data.fda.gov.tw/%E4%B8%8D%E7%AC%A6%E5%90%88%E9%A3%9F%E5%93%81%E8%B3%87%E8%A8%8A%E8%B3%87%E6%96%99%E9%9B%86/i/96/%E7%B3%AF%E7%B1%B3?page=1&amp;format=json" err, res, body &lt;- request {"url": url, "encoding": null} result = res |&gt; useMagic I am adding the compiled javascript code, maybe this will be easier: request = require('request'); mmmagic = require('mmmagic'); useMagic = function(res){ var buf, magic; buf = new Buffer(res.body); magic = new mmmagic.Magic(); return magic.detect(buf, function(err, magicalres){ return console.log( magicalres); }); }; url = "https://sheethub.com/data.fda.gov.tw/%E4%B8%8D%E7%AC%A6%E5%90%88%E9%A3%9F%E5%93%81%E8%B3%87%E8%A8%8A%E8%B3%87%E6%96%99%E9%9B%86/i/96/%E7%B3%AF%E7%B1%B3?page=1&amp;format=json"; request({ "url": url, "encoding": null }, function(err, res, body){ var result; return result = useMagic( res); }); I have been using a combination of methods including res.headers['cont…
score: 0
has answer: http://stackoverflow.com/a/28943182
tagged with: validation
answer count: 1
has title: If the format of a data is slightly broken, is it still possible to determine its filetype?
type: UnansweredQuestion

http://stackoverflow.com/q/28945140
has answer: http://stackoverflow.com/a/28945292
type: Question
answer count: 2
has body: I have tow code parts that I would like to make it a bit more simple. Both of them JQuery codes, and I would like to make it less in the code. There should be some other way to do this... The First: $(document).ready(function(){$(".floorplan0").click(function(){ $(".layout0").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan1").click(function(){ $(".layout1").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan2").click(function(){ $(".layout2").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan3").click(function(){ $(".layout3").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan4").click(function(){ $(".layout4").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan5").click(function(){ $(".layout5").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan6").click(function(){ $(".layout6").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan7").click(function(){ $(".layout7").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan8").click(function(){ $(".layout8").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan9").click(function(){ $(".layout9").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan10").click(function(){$(".layout10").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan11").click(function(){$(".layout11").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan12").click(function(){$(".layout12").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan13").click(function(){$(".layout13").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan14").click(function(){$(".layout14").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan15").click(function(){$(".layout15").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan16").click(function(){$(".layout16").slideToggle(0); }); }); $(document).ready(function(){$(".floorplan17").click(functio…
has comment: http://stackoverflow.com/comment/46144494
score: -1
downvote count: 2
possible better answer: http://stackoverflow.com/a/28945452
upvote count: 1
has answer: http://stackoverflow.com/a/28945452
has comment: http://stackoverflow.com/comment/46144490
accepted answer: http://stackoverflow.com/a/28945292
tagged with: javascript
has title: Simplify two jquery codes
type: AnsweredQuestion
tagged with: simplify
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/46155403
type: Comment
type: AnswerComment
has text: YES! This is exactly right. Yes, that makes total sense now. Thank you!
comment on: http://stackoverflow.com/a/28950496
score: 0

http://stackoverflow.com/comment/46271913
score: 0
type: Comment
has text: I think it's a bad edit that you made there. Your question doesn't make sense without the code or the context of the API.
type: QuestionComment
comment on: http://stackoverflow.com/q/28993515

http://stackoverflow.com/comment/46085593
type: Comment
type: QuestionComment
has text: I don't understand why you even retrieve the value from the element's style when you already store it neatly in a variable. https://jsfiddle.net/2gnoq5hx/1/
score: 3
comment on: http://stackoverflow.com/q/28913571

http://stackoverflow.com/q/29056720
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I'm working on a little project, and I'm making a content show with radio buttons, something like a slideshow gallery, but what i'm trying to do is a big container with many divs inside with a opacity:1; all this overlapping 3 containers more with the same characteristics, so when somebody give a clic in a radio button, the container with opacity:1; will get a opacity:0; and the overlapped container by the container with opacity:1; will be visible. the main problem that I get is when I clic in a radio button to change the content, this (content) doesn't appears until I reload the page, can somebody tell me why this happen? and how to solve it? Thanks! $(document).ready(function(){ $("#op1").prop('checked',true); $("#op2").prop('checked',true); $("#op3").prop('checked',true); $("#op4").prop('checked',true); //$("#x").prop('checked',false); if ($("#op1").is(':checked')) { if ($('#cont1').hasClass('contenedor-fotos-opacity')) { $('#cont1').removeClass('contenedor-fotos-opacity').addClass('contenedor-fotos1'); } $('.contenedor-fotos2').removeClass('contenedor-fotos2').addClass('contenedor-fotos-opacity'); $('.contenedor-fotos3').removeClass('contenedor-fotos3').addClass('contenedor-fotos-opacity'); $('.contenedor-fotos4').removeClass('contenedor-fotos4').addClass('contenedor-fotos-opacity'); } if ($("#op2").is(':checked')) { if ($('#cont2').hasClass('contenedor-fotos-opacity')) { $('#cont2').removeClass('contenedor-fotos-opacity').addClass('contenedor-fotos2'); } $('.contenedor-fotos1').removeClass('contenedor-fotos1').addClass('contenedor-fotos-opacity'); $('.contenedor-fotos3').removeClass('contenedor-fotos3').addClass('contenedor-fotos-opacity'); $('.contenedor-fotos4').removeClass('contenedor-fotos4').addClass('contenedor-fotos-opacity'); } if ($("#op3").is(':checked')) { if ($('#cont3').hasClass('contenedor-fotos-opacity')) { $('#cont3').removeClass('contenedor-fotos-opacity').addClass('contenedor-fotos3'); } $('.contenedor-fotos1').removeClass('contenedor-fotos1')…
has answer: http://stackoverflow.com/a/29056771
score: 0
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29056771
type: Question
has title: Refresh content jQuery

requirejs
tags question: http://stackoverflow.com/q/28918292
tag name: requirejs
tags question: http://stackoverflow.com/q/29056152
tags question: http://stackoverflow.com/q/29033187
type: Tag
tags question: http://stackoverflow.com/q/29000153
tags question: http://stackoverflow.com/q/29005285
tags question: http://stackoverflow.com/q/28919076
tags question: http://stackoverflow.com/q/28989766
tags question: http://stackoverflow.com/q/29013179
tags question: http://stackoverflow.com/q/28919209
tags question: http://stackoverflow.com/q/28931908
tags question: http://stackoverflow.com/q/29032099
tags question: http://stackoverflow.com/q/28947344
tags question: http://stackoverflow.com/q/28918031
tags question: http://stackoverflow.com/q/28913733
tags question: http://stackoverflow.com/q/28917462

http://stackoverflow.com/q/28935312
has answer: http://stackoverflow.com/a/28937055
score: 3
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
upvote count: 3
has body: I'm working on an application with a force layout on large circles. To each node in that force layout, I attach another force layout on smaller circles, which appear inside the large circles (fiddle here). D3.js's force layout allows one drag nodes with the mouse. However, although the smaller, inner circles move in relation to the larger, outer circles because of the inner force layouts, I've unable to drag the inner circles in any way that seems independent of the larger circles. That is, dragging an inner circle is exactly like dragging the outer circle. (Setting the fixed property of the data attached to the outer node doesn't help--as in this slightly more complicated fiddle.) Is it possible to allow the inner circles to be dragged within the larger circles? Allowing the inner circles to be dragged independently of the outer circle--even past its edge--would be very acceptable behavior, too, although not ideal.
type: Question
accepted answer: http://stackoverflow.com/a/28937055
answer count: 1
has title: Force layout inside force layout: How to drag inner nodes
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/28954790
type: AnsweredQuestion
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46163225
type: Question
has comment: http://stackoverflow.com/comment/46163208
has title: JavaScript function evaluating itself and calling itself at the same time
tagged with: javascript
has answer: http://stackoverflow.com/a/28954820
accepted answer: http://stackoverflow.com/a/28954820
duplicate of: http://stackoverflow.com/q/8228281
answer count: 1
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/8228281
has body: I am learning about JavaScript functions on MDN I came across an example that looks similar to this: var saySomething = ( function(){console.log("hello")} )(); I have also seen this in the jQuery source. I have not found any explanation of this style of function calling/definition on the MDN function reference. I know from running the code that it calls itself immediately upon interpretation by the JavaScript engine. Is this the Grouping Operator in action? Where it says: First evaluate the body of this function and return it Since the parentheses () immediately follow it it gets called ?

http://stackoverflow.com/comment/46289803
has text: What is `ng-controller-params` ?
score: 0
comment on: http://stackoverflow.com/q/29023440
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46149666
comment on: http://stackoverflow.com/q/28921471
score: 0
has text: Well i realize that ember doesn't care about the rest end point but i don't tjo
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46270507
comment on: http://stackoverflow.com/q/29012626
type: Comment
type: QuestionComment
has text: you can use [`ng-init`](https://docs.angularjs.org/api/ng/directive/ngInit) and set the `$scope` variable `viaRoute` there.
score: 0

ecmascript-6
tags question: http://stackoverflow.com/q/28974784
tags question: http://stackoverflow.com/q/28963263
tags question: http://stackoverflow.com/q/29022413
tags question: http://stackoverflow.com/q/29012830
tags question: http://stackoverflow.com/q/28971227
tags question: http://stackoverflow.com/q/29030747
tags question: http://stackoverflow.com/q/29053238
tags question: http://stackoverflow.com/q/29051011
tags question: http://stackoverflow.com/q/28931904
tag name: ecmascript-6
tags question: http://stackoverflow.com/q/29046635
tags question: http://stackoverflow.com/q/28935110
tags question: http://stackoverflow.com/q/28922435
tags question: http://stackoverflow.com/q/28933198
tags question: http://stackoverflow.com/q/29047625
tags question: http://stackoverflow.com/q/29017485
type: Tag
tags question: http://stackoverflow.com/q/28918232
tags question: http://stackoverflow.com/q/28946977
tags question: http://stackoverflow.com/q/28950760
tags question: http://stackoverflow.com/q/28908527
tags question: http://stackoverflow.com/q/28921609
tags question: http://stackoverflow.com/q/29055518
tags question: http://stackoverflow.com/q/28967074
tags question: http://stackoverflow.com/q/28963599

http://stackoverflow.com/comment/46111172
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28927510
has text: btw, do not use "for in" loops to iterate over arrays because the for-in loop has no guaranteed iteration order and it also can iterate over non-integer properties. Use a regular `for(i=0, i<arguments.length, i++)` loop instead.

http://stackoverflow.com/comment/46298742
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29021542
type: Comment
has text: On button click what is your exact need?

http://stackoverflow.com/q/28971742
tagged with: jsp-tags
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46195926
type: Question
has comment: http://stackoverflow.com/comment/46396672
tagged with: jakarta-ee
tagged with: javascript
has answer: http://stackoverflow.com/a/29089060
has body: this is my jsp code: EMAIL.JSP <%@page contentType="text/html" pageEncoding="UTF-8"%> JSP Example Enter the information To Address Subject AttachFile <td<inputtype="text"value=".\ogc\hb1_800.jpg"id=".\ogc\hb1_800.jpg" /> and on clicking the submit button i need to execute the java code: final.java which is below:- FINAL.JAVA package com.grid; public class final { public static void main(String[] args) { String ToAddress = new String[]{"8789951@gmail.com"}; String Subject = "Hi this is test Mail"; String AttachFile = {".\ogc\notepad\styles\thumbs\hb1_800.jpg"}; new Email().sendMail(ToAddress,Subject,AttachFile); } } it calls the email.java package com.grid; import java.io.*; import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; import javax.mail.Authenticator; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Multipart; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; public class Email{ private String SMTP_HOST = "smtp.gmail.com"; private String FROM_ADDRESS = "n123f@gmail.com"; private String PASSWORD = *****"; private String FROM_NAME = "Abc"; public boolean sendMail(String ToAddress,String Subject,String AttachFile) { try { Properties props = new Properties(); props.put("mail.smtp.host", SMTP_HOST); props.put("mail.smtp.auth", "true"); props.put("mail.debug.auth", "true"); props.put("mail.smtp.ssl.enable", "true"); Session session = Session.getInstance(props, new SocialAuth()); MimeMessage msg = new MimeMessage(session); InternetAddress from = new InternetAddress(FROM_ADDRESS, FROM_NAME); msg.setFrom(from); InternetAddress[] ToAddress = new InternetAddress[recipients.length]; for (int i = 0; i < recipients.length; i++) { ToAddress = new InternetAddress(recipients[i]); } msg.setRecipients(…
score: 0
has title: how to execute java code from a jsp page using a button?
answer count: 1
tagged with: jsp
has comment: http://stackoverflow.com/comment/46396694

visual-studio-2012
tags question: http://stackoverflow.com/q/28971604
type: Tag
tag name: visual-studio-2012

http://stackoverflow.com/a/29024015
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29023950
has comment: http://stackoverflow.com/comment/46291786
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46291573
has body: If the url that you want to redirect to is a route in your angular app, you need to inject the $location service into the controller, then in your function, set the path property on $location. &lt;li ng-click="openLink(location)" ng-repeat="location in locations"&gt; {{location.name}} &lt;/li&gt; $scope.openLink = function(location){ $location.path(location.link); } If the location link is a complete url, you should inject the $window service into your controller, and change the openLink function to set $window.location.href. $scope.openLink = function(location){ $window.location.href = location.link; }
answers question: http://stackoverflow.com/q/29023950
has comment: http://stackoverflow.com/comment/46291593

http://stackoverflow.com/comment/85736882
type: AnswerComment
type: Comment
has text: For others that are super new at webpack (like me!) "resolve" goes in your webpack.config.js under module.exports = {} just like entry, output, plugins, module, etc..
comment on: http://stackoverflow.com/a/45404761
score: 2

http://stackoverflow.com/a/28947146
has body: Not sure why this is an issue, but try adding this rule: .dropdown-backdrop { z-index: -1; }
accepted answer of: http://stackoverflow.com/q/28907570
answers question: http://stackoverflow.com/q/28907570
type: AcceptedAnswer
type: Answer
score: 0

http://stackoverflow.com/q/28997744
linked to: http://stackoverflow.com/q/17788990
has body: I've generated this CSS for a bubble from http://www.ilikepixels.co.uk/drop/bubbler/ .bubble { position: relative; width: 250px; height: 120px; padding: 0px; background: #FFFFFF; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; border: #70CAF3 solid 2px; } .bubble:after { content: ''; position: absolute; border-style: solid; border-width: 15px 15px 0; border-color: #FFFFFF transparent; display: block; width: 0; z-index: 1; bottom: -15px; left: 110px; } .bubble:before { content: ''; position: absolute; border-style: solid; border-width: 16px 16px 0; border-color: #70CAF3 transparent; display: block; width: 0; z-index: 0; bottom: -18px; left: 109px; } What I'd like to do, is to use this bubble for several different texts with different lengths and images (different ways of showing the bubble). From what I understand, I want to modify the "width" and "height" from .bubble and the "left" from bubble::before and bubble::after. But when I got the element var bubbleElem = document.getElementById('bubble-element-id'); bubbleElem.style.?? I don't know how to access the pseudo-element ::before and ::after I have tried this too: bubbleElem.shadowRoot null bubbleElem.childNodes [] bubbleElem.children [] bubbleElem.innerHTML "" bubbleElem.hasAttribute('::before') false bubbleElem.prefix null It'd be great to be able to easily modify the bubble's dimensions and position of the little triangle. Thank you! UPDATE: I forgot to tell that I didn't want a solution with JQuery. But, I've found the solution for my problem. .bubble { position: relative; width: 250px; height: 120px; padding: 0px; background: #FFFFFF; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; border: #70CAF3 solid 2px; } .bubble .after { content: ''; position: absolute; border-style: solid; border-width: 15px 15px 0; border-color: #FFFFFF transparent; display: block; width: 0; z-index: 1; bottom: -15px; left: 110px; } .bubble .before { content: ''; position: absol…
answer count: 1
favorite count: 0
linked to: http://stackoverflow.com/q/5041494
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/3743513
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28997863
has comment: http://stackoverflow.com/comment/46243791
tagged with: pseudo-element
type: Question
has title: How to modify programmatically with javascript the css ::before and ::after
has answer: http://stackoverflow.com/a/28997863
tagged with: javascript
duplicate of: http://stackoverflow.com/q/3743513
upvote count: 2
score: 0
downvote count: 2

http://stackoverflow.com/q/29032381
type: Question
tagged with: javascript
score: 0
has body: I'm currently working on a project that involves displaying a table of records to a user. Each record has the potential to display multiple embedded youtube videos. Initially I loaded all of the embedded iframes and just did a show/hide depending on the active record. This was obviously horrendous for performance. My current solution is to load a placeholder image, and then inject the iframe into the dom when the user clicks on the image. This works great for the first load, however if a user loads a second record, and has to load in a second iframe, the performance starts to suffer. I've tried removing the element from the dom using $('iframe').remove(); however this doesn't seem to offer any performance benefit. Is there a way of removing the previous iframe when clicking on a new record, that will perform efficiently? Thanks
tagged with: jquery
type: UnansweredQuestion
has title: Adding / removing elements from the DOM and it's effect on performance
answer count: 0
has comment: http://stackoverflow.com/comment/46305572
has comment: http://stackoverflow.com/comment/46306080

http://stackoverflow.com/a/29054795
answers question: http://stackoverflow.com/q/29000153
accepted answer of: http://stackoverflow.com/q/29000153
upvote count: 3
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46369047
type: Answer
score: 3
has body: From my colleague, who provided the correct solution to my problem, and kindly told me to RTFM: http://requirejs.org/docs/api.html#errbacks Keeping "normal" declaration of require.config, just add an error callback to handle the case when the module can't be found. require(['lodash', 'utils'], function (_, utils) { ...code and stuff require(['analytics'], function (analytics) { // normal execution }, function (error) { // continue with stub of analytics // or not run analytics dependent code at all });

http://stackoverflow.com/q/28920307
has comment: http://stackoverflow.com/comment/46098114
type: UnansweredQuestion
has body: I have a index.html page that includes a header and a footer. The content of it is changed dynamically through the use of the following function. In order to easily share the URL, I have included / implemented history.pushState. Please have a look at the following script: This menu also in index.html Home Test About Me The problem that I am experiencing is that the header and the footer within this index.html cannot not be visible after refresh; therefore, my question is, how could I be able to solve this problem so that the header and the footer re-appear again after refresh?
has comment: http://stackoverflow.com/comment/46103861
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/46103864
has comment: http://stackoverflow.com/comment/46101761
tagged with: javascript
tagged with: jquery
score: 0
has title: Jquery/js - load header and footer back after refresh page
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46098157

json-web-token
type: Tag
tag name: json-web-token
tags question: http://stackoverflow.com/q/28970163

http://stackoverflow.com/a/28932296
score: 1
has body: From theoretical POV this is known as Irwin-Hall distribution Simplest to produce N(0,1) is sum of 12 uniform RN minus 6, no need for scaling In general, to see how variance is computed, take a look at http://en.wikipedia.org/wiki/Irwin%E2%80%93Hall_distribution I would also recommend to look at the Table of Numerical Values in the following article: http://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%9399.7_rule. For example, if one to use sum of 12 uniform numbers (minus 6), then min value would be at -6 (exactly -6*sigma) and max value would be at +6 (exactly +6*sigma). Looking at the table, what would be expected frequency outside the range? Answer: 1/506797346. Thus, one out of ~half a billion events shall land outside the +-6sigma, but Irwill-Hall(12) rng will miss it. Thus, you could judge if it is ok or not for your particular simulation
upvote count: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28926903
has comment: http://stackoverflow.com/comment/46281980

http://stackoverflow.com/comment/46267087
has text: I thought about this but I have no idea about this method. Have you any detail solved. Thank u.
comment on: http://stackoverflow.com/q/29010995
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28993515
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46235570
has body: I'm trying to load a JSON file using the DataPoint API of the Met Office by calling the URL: http://datapoint.metoffice.gov.uk/public/data/val/wxfcs/all/json/sitelist?key=[MY_API_KEY_GOES_HERE] A sample of the returned JSON would look like this: { "Locations": { "Location": [ { "elevation": "228.0", "id": "3063", "latitude": "57.206", "longitude": "-3.827", "name": "Aviemore", "nationalPark": "Cairngorms National Park", "region": "he", "unitaryAuthArea": "Highland" }, { "elevation": "1245.0", "id": "3065", "latitude": "57.116", "longitude": "-3.642", "name": "Cairn Gorm Summit", "nationalPark": "Cairngorms National Park", "region": "he", "unitaryAuthArea": "Moray" }, { "elevation": "146.0", "id": "3238", "latitude": "55.02", "longitude": "-1.88", "name": "Albemarle", "region": "ne", "unitaryAuthArea": "Northumberland" } ] } } What I need to do is display the list of locations. And for that I have this code: $(document).ready(function() { $("#driver").click(function(event){ $.getJSON('http://datapoint.metoffice.gov.uk/public/data/val/wxfcs/all/json/sitelist?key=' + MY_API_KEY_GOES_HERE, function(jd) { $('#stage').html(' locations: ' + jd.locations + ' '); $('#stage').append(' location: ' + jd.location + ' '); $('#stage').append(' name: ' + jd.name + ' '); }); }); }); But it fails to load every time, I've followed many tutorials, all of which seem to have been no help. Why is the list of locations failing? Thanks.
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/46235680
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28994019
has title: Loading JSON with jQuery, then displaying it to the viewer
has comment: http://stackoverflow.com/comment/46235241
has answer: http://stackoverflow.com/a/28994030
type: UnansweredQuestion
tagged with: getjson
has comment: http://stackoverflow.com/comment/46271913

http://stackoverflow.com/q/29021490
score: 1
accepted answer: http://stackoverflow.com/a/29025660
has body: I get the image data from canvas as follows: var img = mycanvas.toDataURL("image/png;base64;"); then i pass de image data to the href attribute of anchor $("#imagenMapa2").prop("src",img); The problem is that when i try to download the image chrome crash, I tried with other smaller canvas and that work, buth with the size of width="2600" height="3400" doesn't work appreciate any help
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/19959072
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29025660
has title: How export img data with javascript
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46286334

http://stackoverflow.com/comment/46331398
comment on: http://stackoverflow.com/q/28981994
type: Comment
type: QuestionComment
has text: do u mean async $.ajax task? no..
score: 0

http://stackoverflow.com/comment/46101066
has text: And what is your question? Is the error not clear?
score: 1
comment on: http://stackoverflow.com/q/28921853
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46112643
score: 0
has text: How is the python in the PHP? Shouldn't it be in a variable?
comment on: http://stackoverflow.com/q/28928412
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46330546
type: Comment
comment on: http://stackoverflow.com/q/29045616
has text: What does "blocking each other" mean?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/46298199
has text: In answer to your question - yes, it's possible by using relative and absolute positioning, you can read up on positioning here: http://learnlayout.com/position.html With this it's possible to define a left/top/bottom/right offset against the relatively positioned parent by using absolute positioning on a link attribute against an image attribute (link would be absolute, image would be relative).
comment on: http://stackoverflow.com/q/29028268
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/46245385
comment on: http://stackoverflow.com/a/28995218
score: 1
type: AnswerComment
type: Comment
has text: Updated my answer. I gave the wrong solution because I was only focused on the function you provided, but that's not actually the right place to do this. The percentage in that function was being calculated just fine. By the way, when programming I recommend percentage multipliers (0-1) instead of percent (0-100). Percent is easier to understand for regular folk, but a multiplier is more useful for calculations. Forget about percentages until you really need it (the css part).

http://stackoverflow.com/a/28914344
has body: please check following example: Click the button to return the number of tr elements in the table. cell 1 cell 2 cell 3 cell 4 Try it Submit function myFunction() { var x = document.getElementById("myTable").rows.length; if(x == 0){ document.getElementById("buy").disabled = true; }else{ document.getElementById("buy").disabled = false; }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28914239

http://stackoverflow.com/q/28953720
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28954120
has answer: http://stackoverflow.com/a/28954120
accepted answer: http://stackoverflow.com/a/28954140
type: Question
tagged with: nonblocking
has body: I'm writing a naive implementation of async.parallel as a learning exercise. Here is the description from the docs: parallel(tasks, [callback]) Run the tasks array of functions in parallel, without waiting until the previous function has completed. If any of the functions pass an error to its callback, the main callback is immediately called with the value of the error. Once the tasks have completed, the results are passed to the final callback as an array. I'm not sure how to exit early, in the event that one of the functions returns with an error. I'm passing the callback an error, but of course the other functions continue executing. Below is what I have so far; feel free to try it out on your machine. function parallel(tasks, cb) { cb = cb || function() {}; if (!Array.isArray(tasks)) return cb('tasks must be an array'); if (!tasks.length) return cb(); var res = []; var completed_count = 0; for (var i=0; i&lt;tasks.length; i++) { (function(ind) { tasks[ind](function(err, val) { if (err) return complete(err); // &lt;--- ! res[ind] = val; completed_count++; if (completed_count === tasks.length) complete(null, res); }); } (i)); } }; // ===== test functions ===== function slow(time, cb) { setTimeout(function() { cb(null, time); }, time); }; function slowError(time, cb) { setTimeout(function() { cb('Some Error', time); }, time); } function complete(err, results) { if (err) return console.log(err); else return console.log(results); }; // ===== tests ===== // should return [1000, 2000, 3000] parallel([slow.bind(null, 1000), slow.bind(null, 2000), slow.bind(null, 3000)], complete); // should exit early parallel([slowError.bind(null, 1000), slowError.bind(null, 2000), slow.bind(null, 3000)], complete);
tagged with: javascript
score: 0
answer count: 2
tagged with: asynchronous
has answer: http://stackoverflow.com/a/28954140
has title: How to exit outer function early from one of many inner non-blocking function calls?
tagged with: node.js

http://stackoverflow.com/a/29031426
answers question: http://stackoverflow.com/q/29031365
has comment: http://stackoverflow.com/comment/46303801
upvote count: 1
score: 1
has body: you need to listen change event for autocomplete. $("#CompanyList").autocomplete({ change: function() { $(this).trigger("change"); } });
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46304178
accepted answer of: http://stackoverflow.com/q/29031365
type: Answer

http://stackoverflow.com/q/28997029
has body: The expression "abcb".replace(/(?:a)b/, 'x') returns "xcb". What I want it return is "axcb"; that is, the "a" is not captured. Is this possible in a single regex?
tagged with: regex
upvote count: 3
has comment: http://stackoverflow.com/comment/46242961
has comment: http://stackoverflow.com/comment/46242811
has comment: http://stackoverflow.com/comment/46245688
type: Question
type: AnsweredQuestion
score: 3
has title: Using Javascript non-capturing group in a replace
linked to: http://stackoverflow.com/q/7376238
has answer: http://stackoverflow.com/a/28997080
has comment: http://stackoverflow.com/comment/46242663
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/46245617
downvote count: 0
has comment: http://stackoverflow.com/comment/46242320
favorite count: 0
has comment: http://stackoverflow.com/comment/46242413
accepted answer: http://stackoverflow.com/a/28997080

http://stackoverflow.com/comment/47367963
score: 0
type: AnswerComment
has text: val will have empty string `""` try it yourself
type: Comment
comment on: http://stackoverflow.com/a/29590980

http://stackoverflow.com/comment/46142814
type: Comment
comment on: http://stackoverflow.com/a/28944312
has text: Are you suggesting that the OP's approach won't work?
score: 0
type: AnswerComment

http://stackoverflow.com/q/29023013
type: Question
has answer: http://stackoverflow.com/a/29023259
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/29023259
has title: How to apply JS to user added rows in tabel
type: AnsweredQuestion
has body: I'm using rails to generate a form that allows the user to click a button to add a new row to a table. As of right now, the user can click the add button and a new row appears. The trouble I'm having is with a column that is using autoNumeric to mask percent values. The JS isn't applied to the columns that the user creates dynamically. I'm using classes so I'm confused why the autoNumeric masking isn't being applied to the new rows as the user is adding them. The 'percentage' class is working on other parts of the form. # JS $(function() { $('.percentage').autoNumeric('init', {aSign: '%', pSign: 's'}); }); # the field is set to the proper class # link that adds a new row Add a field Each row that is added has class="fields" on it. I have tried JS's onClick but didn't get successful results.

http://stackoverflow.com/q/29053448
has title: How does using document.write() to load JS files work? Is it async?
has comment: http://stackoverflow.com/comment/46344726
has comment: http://stackoverflow.com/comment/46344549
has comment: http://stackoverflow.com/comment/46344712
type: Question
score: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46344494
has body: I've used HTML5 BoilerPlate for a while now and it has the lines: I've always assume document.write() loaded the script synchronously, but this proved otherwise: I expected either both to be defined (synchronous) or both undefined (asynchronous). However, it seems like the entire It produced: second first So it looks like the browser continues executing the current script.php: <?php header('content-type:application/x-javascript'); sleep(1); ?> console.log(2); Console: 1 2 3
tagged with: asynchronous
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/28968105
downvote count: 0
has body: As a general rule, calling out to DOM access or (!!) manipulation facilities from inside a .sort() comparator function is something to avoid with all possible effort. In this case, you should make a single pass through the nodes and extract the text content once. That will make your sort much, much faster, particularly when there are more than a few rows. Here's an example of how to do this: function testSort(s) { var column = s; var parent = document.getElementById('mycollection'); var rows = parent.children; // NodeList rows = Array.prototype.slice.call(rows, 0); // change NodeList to array var top = rows.shift(); // remove title row var extracted = rows.map(function(row) { return { text: row.getElementsByClassName(column)[0].textContent, row: row }; }); // sort extracted.sort(function(a, b) { if(a.text &lt; b.text) return -1; if(a.text &gt; b.text) return 1; return 0; }); // recreate div parent.innerHTML = ''; // clear parent.appendChild(top); // add title row for(var i=0, l=extracted.length; i&lt;l; i++) { // add rows parent.appendChild(extracted[i].row); } } Before sorting, that code transforms the rows array into another array, one consisting of plain objects. Each object has the text extracted from the column and a reference back to the DOM node. The sort function therefore can refer directly to the string without having to call .getElementsByClassName(). If you have 100 rows, that will probably save several hundred calls to .getElementsByClassName; for 1000 rows, it'll save several thousand. As to sorting by the numeric value of content, you'll have to either detect that the text looks numeric (by whatever criteria you like) and implicitly convert it, or else allow for an extra parameter to be passed to indicate that should be done. Personally I would go the second route, and change the function signature: function testSort(s, numeric) { Then the extraction array would be built similarly, but now it would convert to numeric when told to do so: var extracted …
accepted answer of: http://stackoverflow.com/q/28967876
type: Answer
has comment: http://stackoverflow.com/comment/46188540
answers question: http://stackoverflow.com/q/28967876
upvote count: 3
has comment: http://stackoverflow.com/comment/46188978
score: 3
has comment: http://stackoverflow.com/comment/46188518
has comment: http://stackoverflow.com/comment/46188915
type: AcceptedAnswer

http://stackoverflow.com/q/28920214
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28920333
has answer: http://stackoverflow.com/a/28920405
has body: This is my first time working with JavaScript exceptions and exception handling in general. OK I have the following simple code. function getMonth( month ) { month = month -1; var months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; if( month != null ) { if( months.indexOf( month ) ) { return months[month]; } else { throw "Invalid number for month"; } } else { throw "No month provided"; } } Basically it first checks to see if an argument was provided to the function and if not, throw and exception. Second, it checks to see if the provided number matches a valid month number and if not throw an exception. I ran it as follows: try { month = getMonth(); } catch( e ) { console.log( e ); } Console does not log the exception, "No month provided". Why is this? I am currently reading about exceptions here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Control_flow_and_error_handling#Exception_Handling_Statements
has answer: http://stackoverflow.com/a/28920333
type: Question
answer count: 2
tagged with: javascript
score: 0
has title: JavaScript Exception handling not working as expected
accepted answer: http://stackoverflow.com/a/28920405
tagged with: exception

http://stackoverflow.com/q/28955602
has body: I have this format of JSON output but I could not figure out how to check the key and the value. Here is my JSON output: [ {"msgone": {"msgId":"1", "custName":"MYCUST"} }, {"msgtwo": {"msgId":"2", "custName":"MYCUST"} }, {"msgtwo": {"msgId":"2", "custName":"MYCUST"} } ] There you go. Now what I want to do is first I want to loop each of them and check if it is msgone then do something. If it is msgtwo then do something. If let's say current loop is msgone then I want to take all the object msgId and custName to do further processing. This is part of the code that I have at this moment: success: function(msg){ $('#res').val(msg); //just echo to debug var returnedRep = $.parseJSON(msg); $.each(returnedRep, function(index, value) { if(returnedRep[index] === 'msgone'){ //give me the values } if(returnedRep[index] === 'msgtwo'){ //give me the values } }); } Appreciate your feedback on this. I am new to JSON. But with different form of it, I could not able how to read through it. Thank you. UPDATE: This is how I code that outputs my JSON data: $globArr [] = array( "type" =&gt; "msgone", "data" =&gt; array( "msgId" =&gt; $details[0], "custName" =&gt; $details[1] ) ); Each time the message comes, I will store them in $globArr. I could not figure out how to make structure like @DemoUser suggested. Anybody please help me.
has comment: http://stackoverflow.com/comment/46164513
has comment: http://stackoverflow.com/comment/46165102
has answer: http://stackoverflow.com/a/28955838
has comment: http://stackoverflow.com/comment/46164889
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46165560
has comment: http://stackoverflow.com/comment/46177240
score: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46164702
has comment: http://stackoverflow.com/comment/46165357
type: Question
has title: jQuery Loop JSON Result with Object as Value
accepted answer: http://stackoverflow.com/a/28955838
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28968922
tagged with: javascript
has answer: http://stackoverflow.com/a/28970259
has body: Evening all. Could anyone tell me how to set a radio button to checked in an ng-repeat when it loads? In the table below I have a list of prices with a sort function I created. It sorts from the lowest price down. Is there a way I can set the lowest price radio button to 'checked' each time the table loads? &lt;table&gt; &lt;tr ng-repeat="prices in productVariant.prices | orderBy: tcoSort"&gt; &lt;td&gt;&lt;strong&gt;{{prices.code }}&lt;/strong&gt;&lt;/td&gt; &lt;td ng-click="displayFullPricing(prices)"&gt; &lt;input type="radio" name="{{variant.code}}" ng-click="displayFullPricing(prices, $index)"&gt; &lt;/td&gt; &lt;/tr&gt; $scope.tcoSort = function (productVariant) { return productVariant.nonRecurring.retailPrice + (productVariant.monthly.retailPrice * $scope.productAttributesObj.Term); }; Thanks
upvote count: 2
answer count: 3
has title: Set a radio button in an ng-repeat to checked
has answer: http://stackoverflow.com/a/28968975
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28968975
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/28969549
accepted answer: http://stackoverflow.com/a/28969549
downvote count: 0
type: Question

http://stackoverflow.com/q/29024820
has answer: http://stackoverflow.com/a/29024867
has comment: http://stackoverflow.com/comment/46292209
has comment: http://stackoverflow.com/comment/46292319
type: Question
has comment: http://stackoverflow.com/comment/46292270
possible better answer: http://stackoverflow.com/a/29024851
tagged with: javascript
has comment: http://stackoverflow.com/comment/46292455
answer count: 2
has title: Insert text within two brackets - Javascript
upvote count: 1
has body: I want to have a typewriter effect so that I start with {} and each letter of the word is typed in every 120 ms. I've almost accomplished this with the following code : Javascript &lt;script type='text/javascript'&gt; var index = 0; var text = 'hello' // Here you can put in the text you want to make it type. function type() { document.getElementById('screen').innerHTML += text.charAt(index); index += 1; var t = setTimeout('type()',120); } &lt;/script&gt; HTML &lt;html&gt; &lt;body onload="type()"&gt; ... &lt;div id='screen'&gt;{&lt;/div&gt; ... &lt;/body&gt; &lt;/html&gt; My problem is that while the word is typing, there's no closing brace. So after the first 120 ms it looks like this: {h But I want it to look like this {h} How can I fix this?
has comment: http://stackoverflow.com/comment/46292216
favorite count: 0
has answer: http://stackoverflow.com/a/29024851
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29024867
has comment: http://stackoverflow.com/comment/46292221
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/a/28929591
has comment: http://stackoverflow.com/comment/46115442
has body: My final answer is look like this: $(document).ready(function () { $("#submit").click(function () { var domain = $('#domains').val().split("\n"); var all_suffix = ["com","net","org","ir","biz","info","us","name","pro","eu","in","me","tv","cc"]; var counter = 0; var TableDataString = ' ID Domain Name .Com .Net .Org .Ir .Biz .Info .Us .Name .Pro .In .Me .Tv .Cc '; var domain_count = domain.length; $.each(domain, function (i, val) { //increase i counter counter++; TableDataString += ' '+ counter +' '+ val +' '; $('input[type=checkbox]:checkbox:checked').each(function () { var flag = false; var suffix = $(this).val(); $.ajax({ type: "POST", url: "includes/ajax/ajax.php", dataType: "json", data: {domain: val, suffix: suffix}, success: function (msg) { flag = msg.suc; if(flag){TableDataString += ' ';}else{TableDataString += ' ';} TableDataString += ' '; }, error: function (err) { $('#domain_tables').html(err.error); } });//end $.ajax });//end get each suffix });//end each domain if(counter === domain_count){ TableDataString += ' '; $('#domain_tables').append(TableDataString); } }); }); I think this will solve your last two mentioned problem.
has comment: http://stackoverflow.com/comment/46115564
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46115103
answers question: http://stackoverflow.com/q/28929039

http://stackoverflow.com/a/28929130
answers question: http://stackoverflow.com/q/28929094
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28929094
score: 4
has body: This will retrieve the values of the form fields when the page is loaded and they're still empty. You need to set those variables inside the button.onclick function instead, so they get the values of the fields as of the time the button is pressed. You only need to parseInt the values once.
type: AcceptedAnswer
type: Answer
upvote count: 4

http://stackoverflow.com/comment/46260407
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29006623
has text: What does a var_dump($_SESSION) get you on those pages?

http://stackoverflow.com/q/29031002
answer count: 0
tagged with: java
linked to: http://stackoverflow.com/q/20044554
type: Question
has title: Not allow storing URL in browser history
has body: I have a java application where the url gets changed for almost all the different pages and browser is storing them as browser history. Is there any way out not to save the url in browser history? Any javascript snippet will help me. Thanks in advance, Amit
has comment: http://stackoverflow.com/comment/46305606
tagged with: javascript
tagged with: browser
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46305671
has comment: http://stackoverflow.com/comment/46303307

http://stackoverflow.com/comment/46348680
type: QuestionComment
comment on: http://stackoverflow.com/q/29055069
score: 1
type: Comment
has text: the first entry is added the first time, you just don't remove it from the list before the 2nd one is added. i would not use the connection events, but rather manually send an event from the client once it's connected.

http://stackoverflow.com/a/28999750
type: Answer
has body: You should have it inside of $(document).ready: &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#down").mouseover(function(){ $("#down").animate({backgroundColor: "#a34545"}, 5000) }); }); &lt;/script&gt;
answers question: http://stackoverflow.com/q/28999722
score: 0

http://stackoverflow.com/comment/46184115
has text: @NewToJS Strange since the aren't any answers
comment on: http://stackoverflow.com/q/28965584
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29044651
has body: Your function is only in the local scope. Make it global like this: enterUsername = function(){... JSFIDDLE
score: 0
answers question: http://stackoverflow.com/q/29044497
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29044497
type: Answer

http://stackoverflow.com/a/28918846
score: 1
has body: The code you are looking for is in the generate method of lib/ttsapi.js. Here is an excerpt from the method. var $this = this, command = '/usr/bin/say', options = { "cwd": "/tmp/", "env": { "ENV":"development" }, "customFds":[-1, -1, -1] }, args = [ '-o', filename, '-v', voice, text ], output = ''; if (debug) util.log('|tts|generating|voice='+voice+'|format='+this.format+'|text='+text); var child = spawn(command, args, options); Here we can see it is using the built-in say command-line utility on OS X, which is located under /usr/bin/say. It should be possible to modify the arguments to produce a WAV file, but is a bit tricky. For whatever reason, contrary to what the documentation on the say command suggests, specifying --file-format=WAVE produces the following error. Looking up file extensions for type failed: typ? This can be worked around using the --data-format argument however. You will need to modify the code to execute a command like the following. say -o "testing123.wav" --data-format=LEF32@22050 "testing 123"
answers question: http://stackoverflow.com/q/28918610
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28918610
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/46117079
downvote count: 0

http://stackoverflow.com/q/29032900
score: 0
tagged with: ios
answer count: 1
tagged with: javascript
has title: Black screen video (mobile devieces)
tagged with: android
tagged with: http://stackoverflow.com/tag/html
has body: Video does not work on android chrome ( tested in 38-40 version ), i have black screen in chrome and opera in firefox all works, and i have same problem on ios safari. var v = document.createElement( "video" ); v.type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'; v.src = "http://cyberua.16mb.com/player/data/video3.mp4"; https://jsfiddle.net/0du7LmfL/3/embedded/result/ [Update] I finded fix, but why dont work with document.create? var video = ' ' document.body.innerHTML = video; https://jsfiddle.net/0du7LmfL/10/
tagged with: video
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29041002
accepted answer: http://stackoverflow.com/a/29041002

http://stackoverflow.com/q/29011233
has answer: http://stackoverflow.com/a/29011715
has body: In Java script I want to extract bits 13 to 16 from integer number. Example: If I extract bits 13 to 16 from number 16640 then output will be 2 I have searched on google and found few links but they are in C language.
has answer: http://stackoverflow.com/a/29097722
has comment: http://stackoverflow.com/comment/46267610
type: Question
possible better answer: http://stackoverflow.com/a/29011715
tagged with: javascript
has answer: http://stackoverflow.com/a/29011392
has comment: http://stackoverflow.com/comment/46267609
answer count: 3
downvote count: 0
linked to: http://stackoverflow.com/q/8011700
has title: Extract bits from start to end in javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46268120
upvote count: 1
accepted answer: http://stackoverflow.com/a/29011392
type: AnsweredQuestion
score: 1

http://stackoverflow.com/q/28915672
has answer: http://stackoverflow.com/a/28915703
has title: Why is undefined appearing at the end of my for loop? (Javascript)
type: UnansweredQuestion
has body: Ive written this function for loop to display the numbers once the answer to the prompt is give, but everytime the loop appears, it displays the numbers and then the term undefined at the end. Is there a particular reason why? function numbers(){ var i=2; while(i&lt;=20){ document.write("This is the number "+i+"&lt;br&gt;"); i+=2; } } var age = 21; var age = prompt("How old are you?"); if(age==21){ document.write(numbers()); }
tagged with: if-statement
type: Question
tagged with: for-loop
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46089499
has comment: http://stackoverflow.com/comment/46089462
score: 0

http://stackoverflow.com/comment/46214668
type: Comment
type: QuestionComment
has text: @ʰᵈˑ I am still getting empty in `$_FILES` . I have tried solution in linked question
comment on: http://stackoverflow.com/q/28982260
score: 0

http://stackoverflow.com/comment/46107259
score: 0
type: Comment
type: QuestionComment
has text: If the javascript code is placed after the form element, there is no need to put it inside the `$(document).ready()` function.
comment on: http://stackoverflow.com/q/28925394

http://stackoverflow.com/a/29061514
score: 16
has body: Dependency injection order is wrong app.controller('LoginCtrl', ['$scope', 'admin', '$http',function($scope, $http, admin) { ... should be app.controller('LoginCtrl', ['$scope', '$http', 'admin', function($scope, $http, admin) { ...
has comment: http://stackoverflow.com/comment/46359315
type: AcceptedAnswer
upvote count: 16
has comment: http://stackoverflow.com/comment/46359366
accepted answer of: http://stackoverflow.com/q/29061460
type: Answer
answers question: http://stackoverflow.com/q/29061460
downvote count: 0

http://stackoverflow.com/a/28927777
has body: Define your function in same scope. Currently you have defined your function A in another scope. $(document).ready(function() { function A() { $.ajax({ url: "url", type: "post", datatype: "html", data: {var1: "123"}, // remove this}, complete: function() { setTimeout(A, 60000); } }); } $('#Button1').click(function() { $.ajax({ url: "url", type: "post", datatype: "html", data: {var2: "123"}, success: function(data){ console.log( "Function Successful!" ); A(); //CALL FUNCTION A }, }); //End of AJAX }) });
has comment: http://stackoverflow.com/comment/46118299
has comment: http://stackoverflow.com/comment/46112863
score: 0
answers question: http://stackoverflow.com/q/28927737
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28927737
type: Answer
has comment: http://stackoverflow.com/comment/46115148
has comment: http://stackoverflow.com/comment/46115510

http://stackoverflow.com/comment/46319176
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29038957
has text: Are you just calling validate on each field?

http://stackoverflow.com/a/29167415
has body: The answer is no, you cannot trigger a second page's javascript from the first page. I ended up having to create color folders for each of the images so that I could remove the second page (the page with the javascript to color each of the grey scaled images), and instead have the first page direct immediately to the final step of combining all of the colored images into one.
answers question: http://stackoverflow.com/q/28997003
upvote count: 1
has comment: http://stackoverflow.com/comment/46553803
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46564865
accepted answer of: http://stackoverflow.com/q/28997003
type: Answer

http://stackoverflow.com/comment/46205221
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28975735
has text: Absolutely.. that's what the site said where i got the code! No worries, very informal site and it does not matter! Thank you though!
type: AnswerComment

http://stackoverflow.com/q/28921171
has answer: http://stackoverflow.com/a/28921352
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28921247
has title: conditionally apply ngClass in AngularJS
has body: any way to make an expression for ngClass to be a conditional. For example, I have tried the following using javascript: $scope.setEnabled = function(status){ $scope.filterEnabled = status; if(status){ angular.element(document.querySelector( '#enabledFalse')).removeClass('active-btn'); angular.element(document.querySelector( '#enabledTrue')).addClass('active-btn'); } else { angular.element(document.querySelector( '#enabledTrue')).removeClass('active-btn'); angular.element(document.querySelector( '#enabledFalse')).addClass('active-btn'); } } And view : div class="buttons"> No Yes What's the best way to apply this using ngClass?
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/46099562
comment on: http://stackoverflow.com/a/28920879
type: AnswerComment
has text: Or should I just transition to a user 404 page?
score: 0
type: Comment

http://stackoverflow.com/a/28984546
answers question: http://stackoverflow.com/q/28983704
type: Answer
has body: The height may not be calculated right not because of the table, but because of the images. If you run your code on document.ready. My guess is that jQuery calculates it before the images get downloaded. A similar effect can be seen here: http://jsfiddle.net/z2eounmt/1/ (notice it disappears on page refreshing if cache is not cleared). The first time the output is 40, so the height of the image is not included. To solve this issue, either use imagesLoaded, or change your function to be run on window.load. or change the way your accordion works.
score: 0

http://stackoverflow.com/q/29012355
type: Question
upvote count: 15
downvote count: 0
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/29012684
favorite count: 0
has body: I have a div with overflow: scroll; And I would like to put a button. When you press it, the content of the div scrolls. Something like: function scrollDiv() { document.getElementById("d").scrollBy(100, 100); } Click the button to scroll by 100px. Click me to scroll! This works in FF, but not in Chrome. In Chrome I get Uncaught TypeError: undefined is not a function The scrollBy function seems to be defined as window function, so I guess this is the problem, and it's working in FF not by standard. But is there another way to do that? I am not using jQuery, and I'd rather not.
possible better answer: http://stackoverflow.com/a/52677328
has answer: http://stackoverflow.com/a/52677328
type: AnsweredQuestion
score: 15
accepted answer: http://stackoverflow.com/a/29012684
has answer: http://stackoverflow.com/a/73538378
tagged with: scroll
has title: Javascript: scrollBy function executed on a div

http://stackoverflow.com/comment/46226334
has text: @mdemir I am trying to figure out where to put a demo for you
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28987034
score: 0

http://stackoverflow.com/q/29026521
has title: Complex JSON structure + Dojo Selects
tagged with: javascript
score: 0
has body: I have a data structure and i don't know how to manage it properly. I must use Dojo, so i chose JSON to solve this problem. The structure i'm talking about is on the bottom of this post. Go check it before you read the following text. The problem: i must have 3 Selects. The first select will contain the "first level" (a, b, c). The second one will contain the "second level" (aa, ab, ...) and so on. The data in each Select (except the first one) should vary depending on what was chosen in the previous Select. For example, if i choose "a" in the first Select, i should only see the "aa, ab, ac" in the second Select. Then if i choose "ac" in the second one, i should only see "aca, acb, acc". Note that there are cases when there is no "third level". In this case, the third select should be hidden (OR if it's too hard to manage, just be empty). Now for the references. If i choose "d" in the first Select, i should only see "aa, bc, ca" as options of the second Select. Then, if i choose "cc" in the second Select, i should see "cca, ccb, ccc" in the third Select. This should not be static of course. In my example, if the "c -> cc" subtree will change, the contents of "d -> cc" should change too. Now for the questions: 1) How do i make something like that work using Dojo? If it was Vanilla JS it would be obvious for me, but i can't figure how to make it work with all these object stores and such things. 2) How do i make References work with that kind of structure? I could make it work on a simple JSON, but when it gets so complex i'm completely lost. 3) How do i present the structure? As a single JSON? Or should i split it into several parts? Thanks in advance! a aa aaa aab ab aba ac aca acb acc b ba bb bc bca c ca caa cab cb cba cbb cc cca ccb ccc d &lt;ref to aa subtree&gt; &lt;ref to bc subtree&gt; &lt;ref to ca subtree&gt;
answer count: 1
has answer: http://stackoverflow.com/a/29029006
tagged with: dojo
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29029006
tagged with: http://stackoverflow.com/tag/json
tagged with: select
type: Question

http://stackoverflow.com/a/29039624
has body: Your solution should work fine except you're using console.log('value=' + selectedValue); instead of actually returning the value. return selectedValue; Example
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/29039424
accepted answer of: http://stackoverflow.com/q/29039424

http://stackoverflow.com/a/29058186
has body: I'd probably include a div in the structure as the overlay and then toggle the class. div#overlay { height:100%; width:100%; overflow:hidden; display:none; background-color:rgba(0,0,0,0); -webkit-transition: background-color 600ms ease; -moz-transition: background-color 600ms ease; -ms-transition: background-color 600ms ease; transition: background-color 600ms ease; } div#overlay.active { display:block; background-color:rgba(0,0,0,.8); } Then you could use .toggleClass on click $('a').on('click', function(e){ $('div#overlay').toggleClass('active'); }); Note, because of display:none; this method wont fade back. It will simply disappear.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29057425

http://stackoverflow.com/a/29028311
has body: Can you try the same in 'window.onload' event instead of in 'documen.ready' ? As, you are trying to refer the window object to get height &amp; width. Unless its not loaded you wont get that value. Try using code like: $(window).load(function () { $(this).adjustOuterStripLayout(); });
type: Answer
has comment: http://stackoverflow.com/comment/46298227
upvote count: 1
downvote count: 1
score: 0
answers question: http://stackoverflow.com/q/29028177

http://stackoverflow.com/q/28933266
tagged with: parsing
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46128271
type: Question
has body: I have a standard login page. When the database validates the credentials entered by the user I want to make changes to the page, example: create element saying "Login Successful", using a static javascript file. How do I communicate to a static javascript file that the login was successful thus triggering the changes? I'm using Parse right now for my database. html: Username: Password: Node with Express and Parse: login.post('/login', function (req, res) { Parse.User.logIn(req.body.username, req.body.password, { success: function(user) { console.log("Login Successful!"); res.redirect('/'); }, error: function(user, error) { res.redirect('/login'); console.log("Login Unsuccessful! " + error.message); } }); });
answer count: 1
tagged with: javascript
has title: How to trigger javascript on node events?
tagged with: express
score: 0
has comment: http://stackoverflow.com/comment/46126619
has answer: http://stackoverflow.com/a/28952458
accepted answer: http://stackoverflow.com/a/28952458

dialog
tag name: dialog
tags question: http://stackoverflow.com/q/29027047
tags question: http://stackoverflow.com/q/28989974
tags question: http://stackoverflow.com/q/29019593
type: Tag
tags question: http://stackoverflow.com/q/28962153

http://stackoverflow.com/comment/46222080
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28975650
score: 1
has text: Thanks @JesseBuitenhuis a lot! Yes, I intend to listen to it even if it's not in focus. I tried with form first, but the reason I removed it was: if input is focused and I hit enter, both the form and the listener will fire the event and my function get's called twice. Your plunker is a great help!

http://stackoverflow.com/q/28975647
favorite count: 0
has answer: http://stackoverflow.com/a/28976559
has title: Gallery of divs with float-left
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 2
upvote count: 3
tagged with: css-float
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28976559
tagged with: javascript
answer count: 1
has body: In my case I have a popup "window" with a title and a close button which is controlled with some script. What I want to do is to put gallery of divs with left-float so when the screen resizes they will stacked accordingly (eg. in very small screens they will go just 1 under another) so that's why I think that float is the best option here. I am not sure how to do it and I would like your help as I want it to be to the center covering a specific percentage of area (so it can be more responsive). I would like you to just tell me what steps I should follow. I was thinking on making a custom class .gallery set float to left but I don't know how to set everything else in order to work nice. HTML &lt;script&gt; document.write('&lt;div class="js"&gt;'); &lt;/script&gt; &lt;nav&gt;&lt;ul&gt;&lt;li id="buttonc"&gt;&lt;a href="#"&gt;click&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/nav&gt; &lt;div class="vidar-bg"&gt; &lt;div id="vidar"&gt; &lt;span&gt;my divs&lt;a href="#closevid" id="closevid"&gt;&amp;#215;&lt;/a&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;script&gt; document.write('&lt;/div&gt;'); &lt;/script&gt; CSS .js .vidar-bg{ position:fixed; left:0;right:0; top:0;bottom:0; z-index:100; background-color:rgba(50,50,50,0.5); display:none;} #vidar{ position:absolute; top:50%; left:50%; z-index:101; width:80%px; height:80%px; left:10%;right:10%; top:10%;bottom:10%;} #vidar span{ display: block; background:#5DC3A7; padding: 10px; color: #fff !important; background: #f00; z-index:100;} #closevid{ float: right; color: #fff; font-family: serif; font-size: 18px;} #closevid:hover{color: #000;} Live code here: http://codepen.io/mariomez/pen/OPBVxY thank you all in advance for your help :)
tagged with: gallery

http://stackoverflow.com/comment/46555881
comment on: http://stackoverflow.com/a/29061716
has text: I did it, but I have one more problem. When I open the code in firefox at the first time its okay. But when I press ctrl+f5 it doesn't show the brightened pictures. Internet Explorer shows just some of the pictures, and Chrome doesn't show anything except for when i press enter on the link. I'm using a plugin which preloads sprites called pxLoader but doesn't help. What would u recommend ?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46165512
score: 0
type: QuestionComment
has text: I have removed syntax highlighting by using tag, because there are no code for highlight. Also, reformatted input and output lines to make it more clear.
type: Comment
comment on: http://stackoverflow.com/q/28955089

http://stackoverflow.com/comment/46164510
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28955472
has text: Use a jquery validation plugin.

angularjs-ng-repeat
tags question: http://stackoverflow.com/q/29051476
tags question: http://stackoverflow.com/q/28933450
tags question: http://stackoverflow.com/q/29049827
tags question: http://stackoverflow.com/q/29044125
tags question: http://stackoverflow.com/q/29062195
tags question: http://stackoverflow.com/q/29015965
tags question: http://stackoverflow.com/q/28938344
type: Tag
tags question: http://stackoverflow.com/q/28937712
tags question: http://stackoverflow.com/q/28968716
tags question: http://stackoverflow.com/q/29060960
tags question: http://stackoverflow.com/q/29039983
tags question: http://stackoverflow.com/q/29010023
tags question: http://stackoverflow.com/q/29009388
tags question: http://stackoverflow.com/q/28909192
tags question: http://stackoverflow.com/q/28994513
tags question: http://stackoverflow.com/q/28954478
tags question: http://stackoverflow.com/q/29060696
tag name: angularjs-ng-repeat
tags question: http://stackoverflow.com/q/29046997
tags question: http://stackoverflow.com/q/28989783
tags question: http://stackoverflow.com/q/29026044
tags question: http://stackoverflow.com/q/29028609
tags question: http://stackoverflow.com/q/28938293
tags question: http://stackoverflow.com/q/28931074
tags question: http://stackoverflow.com/q/29059578

http://stackoverflow.com/comment/46243551
has text: That was the missing piece! I appreciate your time and the detailed plunker.
type: Comment
comment on: http://stackoverflow.com/a/28997488
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46236197
has text: I shall give this a go now
comment on: http://stackoverflow.com/a/28993974
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28960919
type: Answer
has comment: http://stackoverflow.com/comment/46174544
score: 0
has body: Media query will trigger only when particular point (width or height) mentioned in your media query, whereas javascript resize will trigger at every pixel changed during resize. And, JS is more resource intensive IMO whereas CSS is not and faster. Have a read here So, in your case, instead of removing and adding classes, have one class and override it's properties based on the screen size in your media query. Something like: .my-class { width: 400px; } @media(min-width: 768px){ .my-class { width: 200px; } } OR You can have 2 classes all the time, but only one will take effect based on the screen size. This way you don't override properties (which is a bit ugly, but, that's just me) // screen &lt;= 767 @media(max-width: 767px){ .nav-small { width: 320px; } } // screen &gt;= 768 @media(min-width: 768px){ .nav-large { width: 100%; } }
answers question: http://stackoverflow.com/q/28960546

http://stackoverflow.com/q/28933090
answer count: 1
has body: Using sequelize, I have two models with associations: var Assessment = sequelize.define("Assessment", { name: DataTypes.STRING }); var User = sequelize.define("User", { sid: DataTypes.STRING }); Assessment.belongsTo(User); User.hasMany(Assessment); After some application logic, I have a User: User.findOrCreate( { where: {sid: "123"} } ).spread(function (user, created) { // user is a User }); At this point, I cannot get sequelize to associate the User as part of a Assessment.findOrCreate. This code will create a new Assessment record in the database (if one does not exist), but it will not include the User key as part of the record (instead it's just NULL): Assessment.findOrCreate( { where: { }, include: [ { model: User, where: user.primaryKeyValues } ] } ).spread( function (assessment, created) { // ... }); I have a workaround working by adding: assessment.setUser(user).then( function(assessment) { ... }); ...however, this results in a SQL UPDATE that should just be part of creating the record. I'm fairly certain there should be way to do this, but unable to find anything in the docs/so/etc.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28957078
downvote count: 0
tagged with: javascript
tagged with: express
favorite count: 0
type: Question
score: 14
tagged with: sequelize.js
has title: sequelize findOrCreate with include association
upvote count: 14

http://stackoverflow.com/q/29029062
score: 2
downvote count: 0
has title: How do I format the rows and the month names in Angular UI date picker?
type: Question
upvote count: 2
answer count: 1
tagged with: javascript
tagged with: angular-ui
favorite count: 0
has body: I cant seem to find it in the documentation, and my last resort is to override the template. Currently, I am using the view mode months, and its showing the whole month name. I just want the short version, for example, Jan, Feb, Mar. Also, the default grid for months seems to be 4x3, but I want it to be 3x4. Does anyone know how to do this? &lt;div ng-model="vm.currentDate" datepicker-popup="MMM yyyy" is-open="vm.pickerOpen" min-date="vm.minDate" max-date="vm.maxDate" show-button-bar="false" datepicker-options="{minMode:'month', maxMode:'month', class:'green-date-picker' }" datepicker-mode="'month'" ng-click="vm.openDatePicker($event)"&gt;
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/31602215

http://stackoverflow.com/q/28989493
score: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/46229830
answer count: 1
downvote count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28991770
accepted answer: http://stackoverflow.com/a/28991770
has title: HTML5 Canvas Flip Card Animation
favorite count: 0
tagged with: turnjs
has comment: http://stackoverflow.com/comment/46229787
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/128384195
tagged with: phaser-framework
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46227810
has body: I am trying to create flip card effect using html canvas by drawing it in the canvas. no ccs3 tricks needed. It should be done in a native manner; this is my initial test using phaser.js by changing the scale and what i want to attain is like this using the canvas http://www.turnjs.com/#samples/steve-jobs/10 anyone has any idea on how to do it would be a great help thanks in advance here is the current demo http://sopronioli713.github.io/test/
type: Question

http://stackoverflow.com/comment/46277604
comment on: http://stackoverflow.com/a/29015579
type: AnswerComment
has text: It was kinda different than what I said, but at least I got you looking into the right place. I saw you had different callbacks for the before-load and the after-load and you probably don't need that, just for the record. You should be able to define it once for all of them.
score: 0
type: Comment

http://stackoverflow.com/a/28989956
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46229166
has comment: http://stackoverflow.com/comment/46228376
type: Answer
has body: Have you considered implementing your directive in a more angular compatible way instead of dealing with the $apply on you own? These kind of errors usually come when a piece of code is being executed outside angular context,e.g., jquery code. I will suggest avoiding jQuery as much as possible to write your directive. If required, consider using link function.
accepted answer of: http://stackoverflow.com/q/28989239
answers question: http://stackoverflow.com/q/28989239
score: 0

http://stackoverflow.com/comment/46249494
type: AnswerComment
comment on: http://stackoverflow.com/a/28999863
has text: @NewDev Learn something new every day, thank you :) Edited to reflect this new knowledge
type: Comment
score: 0

http://stackoverflow.com/q/29051509
favorite count: 0
has answer: http://stackoverflow.com/a/29087388
type: UnansweredQuestion
upvote count: 0
has title: How to read the JavaScript developer console with IE.au3
tagged with: autoit
type: Question
tagged with: internet-explorer
score: -2
tagged with: javascript
has body: I have a website which sends info to the developer console of the IE with a funtion called: console.info("spawned", t.name) in javascript. I want to read whats in the console and react to it. I have no idea. I tried it with $oIE.console.log but there is just no output. /edit sorry for the short discription here is more: I tried to get the value of a variable in the javascript with the chrome console not it always says "not defined". $oIE.document.getElementByID("t").type and $o_object.document.parentwindow.eval($s_eval) did not work either. Here is the pastebin auf the js: http://pastebin.com/8w4zi7ns
linked to: http://stackoverflow.com/q/11849562
downvote count: 2
answer count: 1

http://stackoverflow.com/a/28991740
score: 2
accepted answer of: http://stackoverflow.com/q/28991578
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/46232026
upvote count: 2
answers question: http://stackoverflow.com/q/28991578
has body: You are having a problem because of all the curly braces in your JavaScript. This is confusing the format function. You would be much better off using a templating engine to render your HTML. However, if you want to continue with your current code, try putting the JavaScript/jQuery code into its own variable and then inserting it into your HTML with your format call. currentDate = (time.strftime("%d/%m/%Y")) javascript = """ $('document').ready(init); function init(){ $('.bar-percentage[data-percentage]').each(function () { var progress = $(this); var percentage = Math.ceil($(this).attr('data-percentage')); $({countNum: 0}).animate({countNum: percentage}, { duration: 2000, easing:'linear', step: function() { // What todo on every count var pct = ''; if(percentage == 0){ pct = Math.floor(this.countNum) + '%'; }else{ pct = Math.floor(this.countNum+1) + '%'; } progress.text(pct) && progress.siblings().children().css('width',pct); } }); }); }; """ return """ Fitbit {1} """.format(javascript, currentDate)

http://stackoverflow.com/q/28997213
favorite count: 0
has body: I'm trying to create a regular expression that ensures the user inputs 8 characters, including an uppercase letter, and one number. HTML &lt;input type="password"&gt; So far I have this JS var validator = '^(?=.*[A-Z])(?=.*[0-9]).{8,}$' What I'd like to do is this: $('input').on('blur', function() { if ($(this).val().match(validator)) { alert('Correct!') } }); But for some reason it won't go through. Any ideas?
accepted answer: http://stackoverflow.com/a/28997258
tagged with: regex
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28997258
type: Question
upvote count: 2
has title: RegExp literal not being recognized
answer count: 1
tagged with: javascript
tagged with: jquery
downvote count: 0

http://stackoverflow.com/a/28971213
answers question: http://stackoverflow.com/q/28971049
type: Answer
downvote count: 1
has body: btnUpdate click event raises the server side code, and the server does not know about what the user has selected on client. one option could be use client side validation to avoid Post back and preserve the selections at client
score: -1
has comment: http://stackoverflow.com/comment/46194158
upvote count: 0

http://stackoverflow.com/comment/46340005
type: QuestionComment
score: 0
has text: thanks for your clarification. How would i be able to set the date in the controller?
comment on: http://stackoverflow.com/q/29050996
type: Comment

http://stackoverflow.com/a/35169454
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/28923792
downvote count: 0
score: 4
has body: When using webpack-dev-server your bundled files are served up from memory and not written to disk for faster iteration while you are developing. This is also allows hot module replacement and such. If you want to output static files you can use the webpack command from the command line (not webpack-dev-server).

http://stackoverflow.com/comment/46289931
comment on: http://stackoverflow.com/a/29023427
type: Comment
score: 0
type: AnswerComment
has text: @DylanDaicySiao Do you mind setting up a [JSFiddle](http://jsfiddle.net/) reproducing the issue? It will help us to identify the issue.

google-maps-api-3
tags question: http://stackoverflow.com/q/29022964
tags question: http://stackoverflow.com/q/28907559
tags question: http://stackoverflow.com/q/28932139
tags question: http://stackoverflow.com/q/28927610
tags question: http://stackoverflow.com/q/28982920
tags question: http://stackoverflow.com/q/29018321
tags question: http://stackoverflow.com/q/29026796
tags question: http://stackoverflow.com/q/29045336
tags question: http://stackoverflow.com/q/28956822
tags question: http://stackoverflow.com/q/29012722
tags question: http://stackoverflow.com/q/28975015
tags question: http://stackoverflow.com/q/28948965
tags question: http://stackoverflow.com/q/29015024
tags question: http://stackoverflow.com/q/28921638
tags question: http://stackoverflow.com/q/28921096
tags question: http://stackoverflow.com/q/28999884
tags question: http://stackoverflow.com/q/28963487
tags question: http://stackoverflow.com/q/28991541
tags question: http://stackoverflow.com/q/29023429
tags question: http://stackoverflow.com/q/28915489
tags question: http://stackoverflow.com/q/28945724
tags question: http://stackoverflow.com/q/29040511
tags question: http://stackoverflow.com/q/29003120
tags question: http://stackoverflow.com/q/28978913
tags question: http://stackoverflow.com/q/28998743
tags question: http://stackoverflow.com/q/28972688
tag name: google-maps-api-3
type: Tag
tags question: http://stackoverflow.com/q/28915449
tags question: http://stackoverflow.com/q/28997678
tags question: http://stackoverflow.com/q/28998430
tags question: http://stackoverflow.com/q/28906722
tags question: http://stackoverflow.com/q/28917848
tags question: http://stackoverflow.com/q/28951499
tags question: http://stackoverflow.com/q/28962879
tags question: http://stackoverflow.com/q/29014640
tags question: http://stackoverflow.com/q/28944871
tags question: http://stackoverflow.com/q/28964573
tags question: http://stackoverflow.com/q/29026237

http://stackoverflow.com/a/29018513
type: AcceptedAnswer
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28999571
answers question: http://stackoverflow.com/q/28999571
score: 1
has body: TL;DR What you are looking for does not exist in the browser Sound like you are developing a game, If that is true, then what you could do is completely take over the announcements that are happening - essentially implementing your own screen reader. This could be achieved by implementing an application region with a virtual "cursor" on the controls manipulated by the keyboard. This calendar widget shows how this can be achieved for both keyboard and gesture control. http://dylanb.github.io/datepicker/datepicker.html Audio output could be implemented through your own audio pipeline. If you have the ability to play audio, then writing this should be reasonably trivial but mixing choices and priorities might be the hard part. You should not only be announcing the controls a user moves to when they move to different controls, but you should also have an "audio description" track that describes what is happening in the animations if these are important. How you mix the sounds depends on what is most important at any given time and whether there is any "real-time" component to the user's interactions with the game.
downvote count: 0

http://stackoverflow.com/a/28948445
answers question: http://stackoverflow.com/q/28948162
upvote count: 2
score: 2
has body: You have a scoping problem. There are different kind of scopes within Javascript. Global Scope: a variable / function that is scoped global is accessible in each function. Normally you don't want to scope anything global, because in times where everyone uses different frameworks, you never know who writes a variable into the global scope. Example for a global scope: window.bla = "I am global scoped"; var globalVar = "I am also global scoped"; function accessGlobal(){ console.log (globalVar) } Now there's also a function scope: variables declared within a function are locally scoped and are not accessible from outside (If you are more like the Java guys, think of it as a private variable) function private(){ var privateVar = "I am a private var"; } Your required function is NOT globally accessible due to the fact that you used jQuery's onReady function. See this: $( document ).ready(function() { You see the function? Because of this, your required function is function scoped. In your case, I would recommend the Module Pattern to prevent polluting the global scope. Try this: var myModule = {}; myModule.required = function(){ var x = document.forms["loginForm"]["inputName"].value; document.write (x); if(x.length === 0) { alert("Please input a value"); return false; } else { alert("Correct"); return true; } } and in your HTML code, use replace required() with myModule.required(); By the way, in your required function, you made another mistake. You tried to check wether a variable is empty like this: if (x = " ") In Javascript you need to check variables using == or better ===. (I've changed this in your code) The difference between == and === is simply that === also checks for the correct type. E.g. "1" == 1 //true "1" === 1//false because string and number are different
downvote count: 0
type: Answer

http://stackoverflow.com/q/29005674
type: Question
has answer: http://stackoverflow.com/a/29006702
has title: Getting the string out of a string
has body: I am having a string as: var Str = "&amp;nbsp;text"; I want only "text" out of Str. My output should be: Str = "text" from "&nbsp;text" how can I get the output i am expecting from the given String
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46257795
answer count: 3
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29009674
has answer: http://stackoverflow.com/a/29009420

http://stackoverflow.com/q/29014974
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I have something like this: loop through the ids and for each one, make an ajax request (async:true) to the server (same domain) and append received data to a DOM element. Not a hard task to accomplish, it works. Example code: $.each(ids, function (index, id) { $.ajax({ type: 'POST', url: "http://localhost/example/"+id, success: function (data) { $('#content').append(data); } }); }); My problem is: when I have to many IDs to loop through (1000 for example), it sends a lot of ajax, and the browser "freeze", when I click on a link, it waits all ajax requests to finish, then is opens the clicked link. Timeout isn't an option, because I need to show as many received data as possible. If it takes 1 second to finish or if it takes 100 seconds, no problem with this, because the user will see the others requests that has finished So, what's the best way to handle this ? Stop the ajax requests when a link is clicked like this ? Or there's a better way to do this
has answer: http://stackoverflow.com/a/29015318
has comment: http://stackoverflow.com/comment/46274857
tagged with: each
accepted answer: http://stackoverflow.com/a/29015318
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29015250
score: 0
has comment: http://stackoverflow.com/comment/46274823
linked to: http://stackoverflow.com/q/1802936
has title: $.ajax inside $.each blocking browser
has comment: http://stackoverflow.com/comment/46274702
has comment: http://stackoverflow.com/comment/46275020
possible better answer: http://stackoverflow.com/a/29015250
type: Question
has comment: http://stackoverflow.com/comment/46275782
answer count: 2
has comment: http://stackoverflow.com/comment/46274747

http://stackoverflow.com/a/28955883
has body: You could put the objects in an Array and filter what's worth a look. Return that object instead of a boolean. function worthALook(){ return ([].filter.call(arguments, prequal) || [false])[0]; /* remove [0] from the above line and change [false] to false if you want to return multiple cars that satisfy a condition. Use indexes if you do that */ } var car = worthALook(chevy, fiat, audi, bmw); // pass inas many as you want if(car) // check if it's a car console.log("You gotta check out this " + taxi.make + " " + taxi.model); The return statement is used with || so even if none of the cars satisfy the condition, then you could return false. Also, we are using arguments object, so you can pass in as many car objects to the worthALook function, which will make use of prequal function to filter 'em.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46165265
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28955828
accepted answer of: http://stackoverflow.com/q/28955828
has comment: http://stackoverflow.com/comment/46165206

http://stackoverflow.com/q/28950693
possible better answer: http://stackoverflow.com/a/28950734
type: Question
has title: Get the ClientID of a div container in aspx page with javascript?
tagged with: clientid
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28973440
score: 0
answer count: 3
tagged with: asp.net
has answer: http://stackoverflow.com/a/28973597
has body: I need to get the client id from a contentplaceholder on an aspx page... I know a div is not a control, but I was wondering if there was a way to do this outside of the master page. (Code displayed is not in Master). This just tells me that 'map' does not exist: <asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="server">
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46155753
has answer: http://stackoverflow.com/a/28950734
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28973440

codemirror
tags question: http://stackoverflow.com/q/28940404
tags question: http://stackoverflow.com/q/29022186
type: Tag
tags question: http://stackoverflow.com/q/28925265
tags question: http://stackoverflow.com/q/28980400
tag name: codemirror

http://stackoverflow.com/comment/46234615
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28992963
has text: Thanks for your comment. I added an update as it may be adding the data-rule-required attribute. Unfortunately I cannot test this myself directly as I'm away from a computer.
type: AnswerComment

http://stackoverflow.com/comment/46255987
comment on: http://stackoverflow.com/q/29004822
score: 1
type: Comment
type: QuestionComment
has text: So is it the copy of same table?? I mean values don't change??

http://stackoverflow.com/q/29046363
type: Question
has body: I use select list in HTML: A Mart Angular resets selected value to firts option, when I added: ng-model="formData.day" ng-required="true" What is a reason?
has comment: http://stackoverflow.com/comment/46334545
has answer: http://stackoverflow.com/a/29048261
tagged with: javascript
score: 0
answer count: 1
has title: Why Angular resets selected value?
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/a/29061954
answers question: http://stackoverflow.com/q/29061885
downvote count: 0
score: 1
has body: Assuming that you are just looking to display text in a file. You can build a string with Javascript and then open a new window with that code below. Please note, that popup blockers do not like window.open. var str = 'hello world'; window.open('data:text/plain;charset=utf-8,' + str);
has comment: http://stackoverflow.com/comment/122022992
upvote count: 1
type: Answer

http://stackoverflow.com/comment/46303783
type: AnswerComment
has text: no. that's not a typo. wrapping the element in $() ensures it's treated as it should be. i think a version of IE (or maybe jquery?) doesn't like it when you don't do that.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29031342

http://stackoverflow.com/q/29001205
has comment: http://stackoverflow.com/comment/46250507
has comment: http://stackoverflow.com/comment/46252196
score: 0
has answer: http://stackoverflow.com/a/29024157
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I sunk way too much time into fixing this and i'm still not too sure what to make of it. The issue: I have an input tag &lt;input type="number" max="{{ theMax }}"&gt; with a dynamic max value that should be set on the template load. The max tag will prevent you from going above that number when you click the little up/down arrow icons in the input box, but not if you type it in. On my local, if I typed in a number higher than the maximum value I was still able to read that value from the input fine. On my server however (which has the exact same codebase), when I typed in something above the value and queried the input for it, it would give me undefined. Both behaviours could make sense (I'm not sure what the actual spec is supposed to be with the max attribute) it's the oddness of the inconsistency that bewilders me (same browser and everything). At first i'm thinking it was some kind of race condition and perhaps because {{ theMax }} is dynamically set perhaps the live code was slower at fetching it or something, but the fact is it still recognises the max value because the input value only returns undefined if you put something it it that is above the max. What could explain this inconsistency? Is there something obvious or perhaps something in the rest of my code that's having this effect? Note: yes, same browser used for both tests. Thanks
has comment: http://stackoverflow.com/comment/46250188
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46281505
has comment: http://stackoverflow.com/comment/46262268
has comment: http://stackoverflow.com/comment/46262343
has comment: http://stackoverflow.com/comment/46290916
has comment: http://stackoverflow.com/comment/46262369
type: Question
linked to: http://stackoverflow.com/q/15656617
has title: input[max={{number}}] issue very odd behaviour
tagged with: javascript
linked to: http://stackoverflow.com/q/24831259

http://stackoverflow.com/q/28936485
has comment: http://stackoverflow.com/comment/46128149
answer count: 0
has comment: http://stackoverflow.com/comment/46132225
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46172469
score: 0
has body: When I run this example in Chrome on my machine it does not display the table. I have saved the required XML file and this source file in the same folder. What could be the reason for this?
has title: How to read from XML file using AJAX
tagged with: ajax
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/xml

http://stackoverflow.com/a/29000489
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46264914
upvote count: 1
answers question: http://stackoverflow.com/q/28971979
downvote count: 1
has comment: http://stackoverflow.com/comment/46430931
has body: Pebble SDK 2 or 3? Prior to 3, image resources had to be pre-converted from PNG to PBI. Pebble's image docs have more details on what formats are supported on the original (aka Aplite) and Time (aka Basalt) Pebbles.

http://stackoverflow.com/q/28997693
tagged with: javascript
score: 0
has title: BxSlider: "next" on last slide leads to homepage?
answer count: 1
type: UnansweredQuestion
tagged with: bxslider
has answer: http://stackoverflow.com/a/28997957
has body: I'm using bxslider, found here and I'm wondering how I can get the last slide to lead back to the homepage. Right now I'm using bxslider out of the box: $('.bxslider').bxSlider({ auto: true, autoControls: true }); Any ideas are greatly appreciated. Thanks!
type: Question

http://stackoverflow.com/comment/46244201
comment on: http://stackoverflow.com/a/28997107
has text: map is native javascript method. What is content of the `responseData`?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46359754
type: QuestionComment
has text: Then why `para` is excluded?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29061724

http://stackoverflow.com/q/29042067
possible better answer: http://stackoverflow.com/a/29042295
type: Question
has answer: http://stackoverflow.com/a/29042295
downvote count: 0
accepted answer: http://stackoverflow.com/a/29042388
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29042689
has answer: http://stackoverflow.com/a/29042291
tagged with: http://stackoverflow.com/tag/html
answer count: 4
favorite count: 0
has body: I want my tabs to be correctly correlated when I click either the Join button or the sign in button. Currently, when the join button is clicked, the li tag with id="signin-tab" always has the class="active" and also id="signin-pane" has an active class as well. I thought my function joinIsSelected would handle this but it is not doing so. The tab is being active on the Sign in tab even when I click on the Join button. It is only supposed to active when I either click on the Sign in tab or Sign in button Here is a jsfiddle: http://jsfiddle.net/s5vcx0we/ HTML: LOGO Join Spark Sign in Sign in New Account {% csrf_token %} {% csrf_token %} JS: var join_btn = document.getElementById("join-btn"), signin_btn = document.getElementById("signin-btn"), signin_tab = document.getElementById("signin-tab"), new_account_tab = document.getElementById("new-account-tab"), signin_pane = document.getElementById("signin-pane"), signup_pane = document.getElementById("signup-pane"), reset_password_pane = document.getElementById("reset-password-pane"); join_btn.addEventListener("click", joinSelected()); signin_btn.addEventListener("click", signInSelected()); function joinSelected() { $(new_account_tab).addClass("active"); $(signup_pane).addClass("active"); $(signin_pane).removeClass("active"); $(signin_tab).removeClass("active"); $(reset_password_pane).removeClass("active"); } function signInSelected() { $(new_account_tab).removeClass("active"); $(signup_pane).removeClass("active"); $(signin_pane).addClass("active"); $(signin_tab).addClass("active"); $(reset_password_pane).removeClass("active"); }
tagged with: twitter-bootstrap
upvote count: 1
has title: active class does not change with javascriptfunction
has answer: http://stackoverflow.com/a/29042388
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/46353393
score: 0
comment on: http://stackoverflow.com/q/29058371
type: Comment
type: QuestionComment
has text: @Urahara That's basically it, sendObviousData sends headers, stylesheets, etc. These are static. The actual content is generated by beginAsyncProcess, and takes time to generate. The idea is to send the headers, stylesheets, etc. while waiting for the content to be generated, and then send that when it's ready. The problem is that there's always the chance that the content will outrun the headers and cause an error that would be really annoying to catch and try to handle. I'm trying to take advantage of asynchronous code while avoiding race conditions.

http://stackoverflow.com/q/29026845
has title: How do you highlight the active page in your header using bootstrap3 and php?
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46328537
tagged with: twitter-bootstrap-3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29026958
tagged with: php
downvote count: 1
score: -1
has body: I wanted to take this time to post something that would have helped me greatly and saved me hours of time if an article such as this existed on Stack Overflow. I was advised to post this as a question and answer my own question. The Problem: I wanted to have a navbar using bootstrap 3 that would recognize the page I was on and highlight the correct tab in the header. I tried many things, including creating functions that use file paths, file names, and more. Because of my project, I couldn't get anything to work. I also hit a point where I was able to highlight the tab I clicked on, but it would no longer switch pages. I will post my solution as an answer to my own question. If anyone has a better way of sharing my strategy with the community, please feel free to point me to the proper place and I will move my information.
type: Question

http://stackoverflow.com/q/28993673
tagged with: asynchronous
accepted answer: http://stackoverflow.com/a/28994043
favorite count: 0
tagged with: promise
tagged with: angularjs
tagged with: node.js
possible better answer: http://stackoverflow.com/a/28993938
type: AnsweredQuestion
score: 2
has title: When to make a function deferred using Promises
has answer: http://stackoverflow.com/a/28993938
upvote count: 2
linked to: http://stackoverflow.com/q/22519784
has body: I'm using the Q node library for Promises, question I think can apply to the Bluebird lib as well. Context I have a few function calls to make to both my own custom functions and node.js fs style async functions. if I'm making a call to a function like this: sync function do_something = function (input) { // assign variables, do other sync stuff } and need the above to take place before this function: sync function do_something_else = function (input) { // assign variable, do other sync stuff } and then need to call a native node function similar to: async function writeData = function (obj, callback) { var deferred = Q.defer(); fs.writeFile(obj.file, obj.datas, function (err, result) { if (err) deferred.reject(err); else deferred.resolve('write data completed'); }); return deferred.promise.nodeify(callback); } and finally need the above to take place before this function: sync function do_something_last = function (input) { // assign variable, do other sync stuff } Question Is the 'right' thing to do here, to make all my functions 'deferred' or promise aware so I can make sure that they are called in sequence or in the correct order? like so: do_something(variable) .then(do_something_else) .then(writeData) .then(do_something_last) .done(); or should I just do this instead and keep the ordering (sequencing)? Like so: var variable1 = 'test1.txt' var variable2 = 'test2.txt' var return_value = do_something(variable1); var return_another_value = do_something_else(return_value); &lt;--sync writeData(return_another_value); &lt;-- async function var final_value = do_something_last(variable2); &lt;-- sync function // could potentially have async calls again after a sync call writeDataAgain(return_another_value); &lt;-- async function Clarifications What I thought was since some of these sync functions are going to need to be fired after the async, I needed to make them Promise aware in order to keep the sequence straight, like so: sync functions made promise aware do_someth…
type: Question
has answer: http://stackoverflow.com/a/28994043
has comment: http://stackoverflow.com/comment/46236265
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/46236862
downvote count: 0

http://stackoverflow.com/comment/46148318
comment on: http://stackoverflow.com/q/28946525
score: 0
type: Comment
type: QuestionComment
has text: yup I saw your reply and that's almost 100% what was going wrong. I just thought that maybe the selection could somehow be bugged and consider the whole class as one element and so return just the grey. In his/her case tho there are no other rect elements so it's not that much of a problem I guess

http://stackoverflow.com/comment/46081632
comment on: http://stackoverflow.com/q/28911430
score: 1
has text: What does your css animation code look like?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29054891
score: 1
upvote count: 1
has body: JQuery: jQuery('#hideshow').click(function(event) { jQuery('.menu-content').toggle(); });` HTML: &lt;div style="display:none" class="menu-content"&gt; hi &lt;/div&gt; &lt;input id="hideshow" type="button" value="show/hide"&gt; Fiddle: http://jsfiddle.net/42rwkhL0/ you need to set the display attribute to "none" in the style of your menu-content item(s)
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29054646

http://stackoverflow.com/a/29042592
has body: That does too work in chrome. document.getElementById('myUniqueButtonId').onclick=function(){ document.getElementById('myUniqueId').innerHTML = 'text was changed'; }; text
has comment: http://stackoverflow.com/comment/46345495
score: 0
has comment: http://stackoverflow.com/comment/46325396
answers question: http://stackoverflow.com/q/29042497
type: Answer

http://stackoverflow.com/comment/46105970
has text: Uff, sorry, I´m no frontend-developer, so I don't really know about printing HTML. You probably need some special CSS just for the print, but maybe google a tutorial for this or something.
type: AnswerComment
comment on: http://stackoverflow.com/a/28920477
score: 0
type: Comment

http://stackoverflow.com/comment/46114815
type: QuestionComment
has text: /** * Created by User on 3/8/2015. */ var express = require("express"); var router = express().Router; var stores = require ("../models/store"); stores.methods(["get","post","put","delete"]); stores.register(router,"stores"); module.exports = router;
comment on: http://stackoverflow.com/q/28928601
score: 0
type: Comment

http://stackoverflow.com/q/29059588
tagged with: jquery-mobile
tagged with: javascript
has body: I am building a website for my phone using JQuery mobile. I am using the "Filterable inside custom select" from the 1.4.5 demo. It works when I manually add the option values in to the code. San Francisco Los Angeles It works when I create one from a php file. <option value="<?php echo $PositionID ?>"><?php echo $position ?> However when I populate more than one by looping them foreach($getAllComp as $row) { $PosID = $row["CompanyID"]; $Pos = $row["Company"]; $AllPositions .= " ".$row['Company']." \n "; } by creating <option value="<?php echo $PositionID ?>"><?php echo $position ?> <?php echo $AllPositions ?> I get the following error, TypeError: listview is undefined it refers to form = listview.jqmData( "filter-form" ) from the function supplied from the demo When looking at the browsers inspection console it shows the php populating the "option values" perfectly as they are in the previous two attempts. I have tried moving the function to different places on my page etc amongst a heap of other things. Maybe it just can't be done? Thanks in advance. The code is ( function( $ ) { function pageIsSelectmenuDialog( page ) { var isDialog = false, id = page && page.attr( "id" ); $( ".filterable-select" ).each( function() { if ( $( this ).attr( "id" ) + "-dialog" === id ) { isDialog = true; return false; } }); return isDialog; } $.mobile.document.on( "selectmenucreate", ".filterable-select", function( event ) { var input, selectmenu = $( event.target ), list = $( "#" + selectmenu.attr( "id" ) + "-menu" ), form = list.jqmData( "filter-form" ); if ( !form ) { input = $( " " ); form = $( " " ).append( input ); input.textinput(); list .before( form ) .jqmData( "filter-form", form ) ; form.jqmData( "listview", list ); } selectmenu .filterable({ input: input, children: "> option[value]" }) .on( "filterablefilter", function() { selectmenu.selectmenu( "refresh" ); }); }) .on( "pagecontainerbeforeshow", function( event, data ) { var listview, form; if ( !pageIsSelectmenuDialog( d…
has comment: http://stackoverflow.com/comment/46355683
has title: Filterable inside custom select error using php created select menu "option value"
downvote count: 0
has comment: http://stackoverflow.com/comment/46355586
has comment: http://stackoverflow.com/comment/50039951
favorite count: 0
type: UnansweredQuestion
tagged with: php
answer count: 0
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/a/29002466
has comment: http://stackoverflow.com/comment/46256581
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/28994591
accepted answer of: http://stackoverflow.com/q/28994591
has body: This is covered is Closure Compiler FAQ. https://github.com/google/closure-compiler/wiki/FAQ#closure-compiler-inlined-all-my-strings-which-made-my-code-size-bigger-why-did-it-do-that Closure Compiler assumes that you are using gzip compression. If you do not, you should. Configuring your server to gzip your code is one of the most effective and easiest optimizations that you can possibly do. The gzip algorithm works by trying to alias sequences of bytes in an optimal way. Aliasing strings manually almost always makes the compressed code size bigger, because it subverts gzip's own algorithm for aliasing. So Closure Compiler will (almost) always inline your strings when it can, because that will make your compressed code smaller.
score: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46286415
type: QuestionComment
comment on: http://stackoverflow.com/q/29021573
score: 1
has text: If you have an explicit order, you should list them in that order. Otherwise, use a dependency manager like [Require](http://requirejs.org/) to order them as needed.
type: Comment

http://stackoverflow.com/q/28991119
score: 0
has comment: http://stackoverflow.com/comment/46239724
has comment: http://stackoverflow.com/comment/46240832
has title: Open new Tab or Window with POST [PHP]
answer count: 1
linked to: http://stackoverflow.com/q/178964
linked to: http://stackoverflow.com/q/4907843
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/46231797
has comment: http://stackoverflow.com/comment/46243356
type: UnansweredQuestion
tagged with: php
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28991787
has body: This is the situation: I have 2 files, reportCaller.php and report.php. From the reportCaller.php, the user is going to press a button with the method "onclick", this will call the function that is going to do the ajax/post stuff (this is with what im having problems), report.php is going to catch some parameters by POST and has to be opened on a new Tab or Window, this is going to display a report. (Note: May be not important, but im using HTML2PDF). reportCaller (HTML): &lt;input type="button" onclick="generateReport()"&gt; reportCaller (JS): function generateReport(){ var id = '¡I must reach the report FILE!'; //I tried a couple stuff, but didnt work, this is one: $.ajax({ type: "POST", url: "report.php", data: {id:id}, cache: false, success: function (html) { myWindow = window.open(encodeURIComponent(true), "_blank"); myWindow.focus(); }); } report: $id = $_POST['id']; //This file (report.php) must catch $_POST, will not help if i only open the file in a new Tab/Window Thanks for reading.
tagged with: javascript

http://stackoverflow.com/a/28995770
has comment: http://stackoverflow.com/comment/46239768
has body: ng-click expression (or any other expression in angular) will be evaluated in the context of the scope. As doSomethingElse is not defined on scope it will not work. Use onclick instead of ng-click Click Me Click Me
type: Answer
answers question: http://stackoverflow.com/q/28995714
score: 19
has comment: http://stackoverflow.com/comment/53023032
downvote count: 0
upvote count: 19

http://stackoverflow.com/a/28981622
has body: Try replacing the die; with exit; the 0 error is a default error in wordpress for ajax most of the time it is die; will break everything. hope this helps
answers question: http://stackoverflow.com/q/28978756
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/46214048
score: 1

http://stackoverflow.com/a/28957136
has comment: http://stackoverflow.com/comment/46167424
score: 2
has comment: http://stackoverflow.com/comment/46169837
upvote count: 2
answers question: http://stackoverflow.com/q/28957079
has comment: http://stackoverflow.com/comment/46167383
has comment: http://stackoverflow.com/comment/46167408
has comment: http://stackoverflow.com/comment/46168083
downvote count: 0
has comment: http://stackoverflow.com/comment/46167283
has body: This isn't array, this is Object. Array defined in this way: [1,2,3]. If you want retrieve the "length" of object you can do this in this way: var students = {job:92, adam:67,sara:83}; var studentNames = Object.keys(students); var studentsLength = studentNames.length; If you want split object to array you can do this in this way: var students = {jon:92, adam:67,sara:83}; var studentNames = Object.keys(students); var studentArray = studentNames.map(function(name){ var student = {}; student.name = name; student.grade = students[name]; return (student); }); // [{name:jon,grade:92},{name:adam,grade:67},{name:sara,grade:83}]
type: Answer
has comment: http://stackoverflow.com/comment/46167200

http://stackoverflow.com/comment/46342784
score: 0
comment on: http://stackoverflow.com/q/29052439
has text: @Banana the inner text of the hyperlinks are different ones, you saw "cars" in my example because I left them like that when I did the copy, I just corrected it. Thanks for the observation.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46296572
type: Comment
comment on: http://stackoverflow.com/a/29027305
type: AnswerComment
has text: That's not true — OP has already delegated the `$` to the jQuery object (in the first line, `jQuery(document).ready(function($)...`), so using `$` to stand in for the jQuery object should have no issue.
score: 0

http://stackoverflow.com/comment/46203597
type: AnswerComment
has text: I don't think I'm stating my problem correctly.. What I meant was that when the page is loaded with javascript, the url of the page doesn't change therefore if I use jSoup, i can't get the download link because it's not there. the download link only appears after I click a button and the javascript code is executed..
type: Comment
comment on: http://stackoverflow.com/a/28971614
score: 0

http://stackoverflow.com/comment/46414854
has text: Wayne: 5000 is in milliseconds, while "a.linkclass" corresponds to any blah blah. You would use variableToCancelInterval only if you wanted it to stop, via clearInterval(variableToCancelInterval);
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29055878

http://stackoverflow.com/comment/46250439
type: AnswerComment
has text: li colors the bullet and text, span only colors text
type: Comment
comment on: http://stackoverflow.com/a/29001346
score: 0

appium
tags question: http://stackoverflow.com/q/29012268
tag name: appium
tags question: http://stackoverflow.com/q/28971673
type: Tag

http://stackoverflow.com/comment/46084426
type: Comment
comment on: http://stackoverflow.com/a/28912952
has text: jQuery is just javascript library, you never used it?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46203052
type: AnswerComment
score: 0
type: Comment
has text: So it's not only the background image but actually the entire theme / CSS. So on each page, load your CSS ideally from a CDN, and in the link pass the theme name to the final domain through a query parameter or hash. Then decide on the final domain which CSS to load based on that information. And don't do evil to the Internet. :-)
comment on: http://stackoverflow.com/a/28975660

http://stackoverflow.com/q/29044212
downvote count: 0
answer count: 1
favorite count: 0
tagged with: language-lawyer
upvote count: 8
has body: Configurable properties seem to be deletable: var o = {}; Object.defineProperty(o, 'prop', { configurable: true, value: 'val' }); delete o.prop; // true o.prop; // undefined But it doesn't work in the following case, at least on Firefox and Chrome: var form = document.createElement('form'), input = document.createElement('input'); form.appendChild(input); var elems = form.elements; Object.getOwnPropertyDescriptor(form, 0) .configurable; // true &lt;────────────────────── !!! delete elems[0]; // false │ elems[0]; // input │ (function(){ 'use strict'; // V delete elems[0]; // TypeError: property 0 is non-configurable })(); // and can't be deleted But this seems to contradict the spec. The delete operator is defined like this: 11.4.1 - The delete Operator The production UnaryExpression : delete UnaryExpression is evaluated as follows: Let ref be the result of evaluating UnaryExpression. [...] If IsPropertyReference(ref) is true, then Return the result of calling the Delete internal method on ToObject(GetBase(ref)) providing GetReferencedName(ref) and IsStrictReference(ref) as the arguments. So the result of using delete depends on Delete. Now let's see what Delete does: 8.12.7 - Delete (P, Throw) When the Delete internal method of O is called with property name P and the Boolean flag Throw, the following steps are taken: Let desc be the result of calling the GetOwnProperty internal method of O with property name P. If desc is undefined, then return true. If desc.Configurable is true, then Remove the own property with name P from O. Return true. Else if Throw, then throw a TypeError exception. Return false. Therefore, if the property is configurable, it should be deletable. But wait, maybe Object.getOwnPropertyDescritor is a troll and says that a property is configurable, but Configurable is false. Let's see: 15.2.3.3 - Object.getOwnPropertyDescriptor ( O, P ) When the getOwnPropertyDescriptor function is called, the following steps are t…
tagged with: properties
score: 8
tagged with: ecma262
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29044213
type: Question
tagged with: javascript
has title: Why is this configurable property not deletable?
accepted answer: http://stackoverflow.com/a/29044213

http://stackoverflow.com/a/29003211
score: 3
downvote count: 0
upvote count: 3
answers question: http://stackoverflow.com/q/29003057
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29003057
has body: Try this var available = ["A", "B", "C", "D", "E"]; var selected = ["B", "C"]; var finalAvailable = _.filter(available, function (el) { return _.indexOf(selected, el) === -1 }); console.log(finalAvailable); // or you can use _.difference console.log(_.difference(available, selected));
type: Answer

http://stackoverflow.com/a/28909635
downvote count: 0
has body: Your array of promises just contains undefined values, as the callback function doesn't return anything. As there are no Deferred objects in the array, the when method doesn't have anything to wait for, so it runs the then callback right away. Create a Deferred object to return, and resolve it when the image is loaded: var promises = $('.images').map(function(index, element) { // created a Deferred object to return var deferred = $.Deferred(); var src = $(element).attr('src'); var canvas = document.createElement('CANVAS'); var ctx = canvas.getContext('2d'); var img = new Image; img.crossOrigin = 'Anonymous'; img.onload = function(){ canvas.height = img.height; canvas.width = img.width; ctx.drawImage(img,0,0); var base64Img = canvas.toDataURL('image/png'); // Clean up canvas = null; // Resolve the Deferred object when image is ready deferred.resolve(base64Img); }; img.src = element.src; // return the Deferred object so that it ends up in the array return deferred; });
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28909557
score: 1
answers question: http://stackoverflow.com/q/28909557
has comment: http://stackoverflow.com/comment/112440447
has comment: http://stackoverflow.com/comment/46079280
type: AcceptedAnswer

http://stackoverflow.com/comment/46290313
comment on: http://stackoverflow.com/q/29023692
score: 0
has text: I tested it and it works fine
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28951187
has comment: http://stackoverflow.com/comment/46156482
has body: Here is my sample data $(function(){ $('#slider-date').noUiSlider({ behaviour: 'drag', connect: true, range: { 'min': timestamp('2015-03-08 11:52:30'), 'max': timestamp('2015-03-09 11:52:02') }, // Steps of one week step: 7 * 24 * 60 * 60 * 1000, // Two more timestamps indicate the handle starting positions. start: [ timestamp('2015-03-08 11:52:30'), timestamp('2015-03-09 13:29:34') ], // No decimals format: wNumb({ decimals: 0 }) }); $("#slider-date").Link('lower').to($("#event-start"), setDate); $("#slider-date").Link('upper').to($("#event-end"), setDate); // Create a new date from a string, return as a timestamp. function timestamp(str){ return new Date(str).getTime(); } // Create a list of day and monthnames. var weekdays = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; // Append a suffix to dates. // Example: 23 =&gt; 23rd, 1 =&gt; 1st. function nth (d) { if(d&gt;3 &amp;&amp; d&lt;21) return 'th'; switch (d % 10) { case 1: return "st"; case 2: return "nd"; case 3: return "rd"; default: return "th"; } } // Create a string representation of the date. function formatDate ( date ) { console.log(date.getDate()); return weekdays[date.getDay()] + ", " + date.getDate() + nth(date.getDate()) + " " + months[date.getMonth()] + " " + date.getFullYear(); } // Write a date as a pretty value. function setDate( value ){ return $(this).html(formatDate(new Date(+value))); } }); This is the plugin page and where I got the code structure from http://refreshless.com/nouislider/examples/#section-dates In the example they provided a year as the start/end min/max. I am providing a timestamp. May be the issue. Not sure. Here is a screenshot of my console where the error is happening. It is performing the check on the 2015-03-08 date during the error, which is a Sunday which corresponds to 0. Not sure what the problem i…
has title: Uncaught TypeError: Cannot read property '0' of undefined noUiSlider
downvote count: 0
has comment: http://stackoverflow.com/comment/46156245
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/46156329
type: UnansweredQuestion
tagged with: nouislider
answer count: 0
score: 1
upvote count: 1
type: Question

validation
tags question: http://stackoverflow.com/q/28931983
tags question: http://stackoverflow.com/q/28977798
tags question: http://stackoverflow.com/q/28957915
tags question: http://stackoverflow.com/q/29013596
tags question: http://stackoverflow.com/q/28974174
type: Tag
tag name: validation
tags question: http://stackoverflow.com/q/28940527
tags question: http://stackoverflow.com/q/29031827
tags question: http://stackoverflow.com/q/28944861
tags question: http://stackoverflow.com/q/28937841
tags question: http://stackoverflow.com/q/29006667
tags question: http://stackoverflow.com/q/28942878
tags question: http://stackoverflow.com/q/29013105
tags question: http://stackoverflow.com/q/28965922
tags question: http://stackoverflow.com/q/28992764
tags question: http://stackoverflow.com/q/28964769
tags question: http://stackoverflow.com/q/28915526
tags question: http://stackoverflow.com/q/29061810
tags question: http://stackoverflow.com/q/29014908
tags question: http://stackoverflow.com/q/28962769
tags question: http://stackoverflow.com/q/28918093
tags question: http://stackoverflow.com/q/29057869
tags question: http://stackoverflow.com/q/28916640
tags question: http://stackoverflow.com/q/29006486
tags question: http://stackoverflow.com/q/28923769
tags question: http://stackoverflow.com/q/29005159
tags question: http://stackoverflow.com/q/28935519
tags question: http://stackoverflow.com/q/28973831
tags question: http://stackoverflow.com/q/29045745
tags question: http://stackoverflow.com/q/28992601

http://stackoverflow.com/comment/46303009
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29021548
score: 0
has text: checking body class is common but placing your methods in global namespace seems like what you were wanting to avoid. Question is probably better suited for http://codereview.stackexchange.com/

http://stackoverflow.com/comment/46266545
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29005239
has text: If the problem is solved, please post the solution so that other people can benefit from it.
type: QuestionComment

http://stackoverflow.com/comment/46190668
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28969138
has text: Now I've noticed... It should be `n / 1 == n / 1`. (You don't have to use `===` since you are already comparing if 2 `Number`s are equal or not). Sorry, My mistake.

http://stackoverflow.com/q/29014195
score: 0
has comment: http://stackoverflow.com/comment/46273491
tagged with: http://stackoverflow.com/tag/html
has title: href link doesn't work after I added javascript
answer count: 1
has body: I have a simple drop down list that I want to use as language selector, the html code works fine but when I add the script below, the href don't work anymore. When mouse over, I can see the link but click doesn't work !!!! here is my code : Deutsch Deutsch English ​ JSFiddle
has comment: http://stackoverflow.com/comment/46273433
has answer: http://stackoverflow.com/a/29014912
has comment: http://stackoverflow.com/comment/46273387
has comment: http://stackoverflow.com/comment/46273770
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46273744
type: Question
tagged with: href
accepted answer: http://stackoverflow.com/a/29014912
tagged with: javascript

http://stackoverflow.com/q/28997964
has body: I have a string like this: "I went to :Rome: last night, now I'm in :Florence:" I want to get with regex the word between the colon, excluding them, so I want this output Rome Florence At the moment I wrote this :(.*?):\g but it keeps colons in.
tagged with: javascript
has answer: http://stackoverflow.com/a/28998936
type: AnsweredQuestion
score: 2
downvote count: 0
has title: Match with regular expressions words between colon (excluding colon)
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/28998936
possible better answer: http://stackoverflow.com/a/28998083
tagged with: regex
has comment: http://stackoverflow.com/comment/46246276
has answer: http://stackoverflow.com/a/28998083
upvote count: 2
answer count: 2

http://stackoverflow.com/q/29006860
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29060615
favorite count: 0
score: 0
tagged with: reverse
accepted answer: http://stackoverflow.com/a/29060615
has body: I am having a Java web application which uses the javascript function window.print() for printing receipts using a browser. The Printer is a dot-matrix printer(TVS MSP 450 STAR). However, after I print and tear off the first receipt, the printer does not automatically reverse feed, and so the second receipt does not print in the correct position. Could you please suggest a way how to reverse feed a paper in dot-matrix printer using javascript.
has title: Reverse Feed in Dot matrix Printer using Javascript
upvote count: 2
downvote count: 2
type: AnsweredQuestion
tagged with: feed

http://stackoverflow.com/comment/46194731
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28971656
has text: you also aren't waiting for the answers to be collected.

http://stackoverflow.com/q/28965372
has body: I'm using x-editable to inline edit some text. As long as I click on the label directly everything works fine. But, if I implement a button and want label to be edited on button click, then it won't work. The reason being, clicking the label edits it and clicking anywhere outside label resets it. Here, when I click the button, its considered as a click outside and editable-label doesn't edit. What to do? I don't want to go with setTimeout().
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28980799
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28980799
tagged with: javascript
has title: Edit a editable label on button click
score: 0

http://stackoverflow.com/q/28994212
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28994262
accepted answer: http://stackoverflow.com/a/28994262
has title: AJAX: Simple post not working
has body: I recently asked a question about javascript and php together and I got pointed into the direction of ajax. I did some learning, and now I'm trying to do something really simple. &lt;input type="text" id="txt"&gt; &lt;input type="button" onclick="functionPost();" value="test123"&gt; &lt;div id="result"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; function functionPost() { var input = ('#txt').value; $.post('search.php', {postname: input}, function (data) { $('#result').html(data); }); } &lt;/script&gt; Basically, I get the value from the text input, I post it to the search.php page. If I echo something simple on this page, for example: echo "hello"; the whole thing works. My div shows "hello". But if I try to use the $inputvalue = $_POST['postname']; on search.php, I get nothing at all, not even if I echo $inputvalue;. I must be missing something small here.. I have no idea how ajax actually works, but I need this done. Any ideas on why it won't get my posted value? I'm very inexperienced. Thank you
tagged with: php
has comment: http://stackoverflow.com/comment/46236776
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46236543
type: Question

http://stackoverflow.com/comment/46232864
comment on: http://stackoverflow.com/q/28992219
score: 0
type: Comment
type: QuestionComment
has text: How can you expect `substring(0, tally)` to take any text if tally ==0 ??

httpbackend
tags question: http://stackoverflow.com/q/28927491
tag name: httpbackend
type: Tag

http://stackoverflow.com/comment/46329383
has text: It's returned as part of some HTML. I'm extracting the SST and putting it in a string.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29044698
type: QuestionComment

http://stackoverflow.com/comment/46257978
has text: So show the `list-waiting` DIV before you do the AJAX call, and hide it in the `success` and `error` functions.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29005914

http://stackoverflow.com/a/29060615
answers question: http://stackoverflow.com/q/29006860
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29006860
type: Answer
has body: I have found the solution for the above problem. There is a printer setting called 'Tear Off' which if enabled automatically reverses the feed for every print to the starting position of the next receipt. Thus, this does not require any software change. It can be easily handled by making changes in the hardware configuration.
score: 1
upvote count: 1

http://stackoverflow.com/comment/46082692
score: 0
has text: Possible duplicate: http://stackoverflow.com/questions/6668776/download-file-through-an-ajax-call-php
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28912005

http://stackoverflow.com/q/29026237
score: 0
has title: can able to pick suburbs from google address
favorite count: 0
answer count: 0
upvote count: 2
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/46301058
has comment: http://stackoverflow.com/comment/46298585
type: Question
tagged with: google-maps
tagged with: javascript
tagged with: jquery
has body: https://www.google.com/maps/place/Peninsula+Rd,+Kelvin+Heights,+Queenstown+9300,+New+Zealand/@-45.0354441,168.7038649,17z/data=!4m2!3m1!1s0xa9d51e030d9eb623:0x5376ee763169f01e Can you tell me what type is use for kelvin heights? like peninsula = street queenstown = city 9300 = postal code New Nealand = country kelvin heights = ? because i used neighbourhood, sublocality, and so on but nothing get the kelvin heights from address, though everything else is getting like country, locality/city, postal code, and so on. this is main code. jQuery(document).ready(function ($) { "use strict"; var autocomplete,autocomplete2; var options = { types: ['(cities)'], componentRestrictions: {country: 'uk'} }; var componentForm = { establishment:'long_name', street_number: 'short_name', route: 'long_name', locality: 'long_name', administrative_area_level_1: 'long_name', administrative_area_level_2: 'long_name', country: 'long_name', postal_code: 'short_name', postal_code_prefix:'short_name', neighborhood: 'long_name' }; if ( google_map_submit_vars.enable_auto ==='yes' ){ autocomplete = new google.maps.places.Autocomplete( /** @type {HTMLInputElement} */(document.getElementById('property_address')), { types: ['geocode'], "partial_match" : true } ); // When the user selects an address from the dropdown, // populate the address fields in the form. google.maps.event.addListener(autocomplete, 'place_changed', function() { var place = autocomplete.getPlace(); fillInAddress(place); }); autocomplete2 = new google.maps.places.Autocomplete( /** @type {HTMLInputElement} */(document.getElementById('property_city_submit')), { types: ['(cities)'] } ); google.maps.event.addListener(autocomplete2, 'place_changed', function() { var place = autocomplete2.getPlace(); fillInAddress(place); }); } function fillInAddress(place) { for (var i = 0; i &lt; place.address_components.length; i++) { var addressType = place.address_components[i].types[0]; var temp=''; var val = place.address_components[i][component…
tagged with: google-maps-api-3

http://stackoverflow.com/comment/46280242
type: QuestionComment
has text: Check. Also, remove the '#' in the `document.getElementById("#plant").disabled = true;`. It's already grabbing by the ID, so the "#" is not needed.
score: 0
comment on: http://stackoverflow.com/q/29017788
type: Comment

http://stackoverflow.com/q/28969900
downvote count: 0
has comment: http://stackoverflow.com/comment/46191377
tagged with: javascript
score: 6
has comment: http://stackoverflow.com/comment/46191436
possible better answer: http://stackoverflow.com/a/28969980
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46191349
has answer: http://stackoverflow.com/a/67041161
favorite count: 0
has title: How can I parse a string as an integer and keep decimal places if they are zeros?
has body: I have these strings: "59.50" &amp; "30.00" What I need to do is convert them to integers but keep the trailing zeros at the end to effectively return: 59.50 30.00 I've tried: Math.round(59.50 * 1000) / 1000 Math.round(30.00 * 1000) / 1000 but ended up with 59.5 30 I'm assuming I need to use a different method than Math.round as this automatically chops off trailing zeros. I need to keep these as integers as they need to be multiplied with other integers and keep two decimals points. T thought this would be fairly straight forward but after a lot of searching I can't seem to find a solution to exactly what I need. Thanks!
has answer: http://stackoverflow.com/a/71542394
has answer: http://stackoverflow.com/a/28970004
upvote count: 6
has comment: http://stackoverflow.com/comment/46191450
tagged with: math
answer count: 5
has answer: http://stackoverflow.com/a/28970566
accepted answer: http://stackoverflow.com/a/28970004
has comment: http://stackoverflow.com/comment/46191441
has answer: http://stackoverflow.com/a/28969980

http://stackoverflow.com/q/29012712
tagged with: asp.net
favorite count: 0
linked to: http://stackoverflow.com/q/5619202
accepted answer: http://stackoverflow.com/a/29012987
tagged with: visual-studio-2013
type: AnsweredQuestion
has body: Hi I'm trying to hide a panel (which acts as a button to access Registration) on the front end, it should be only visible in the certain time of the year. I'm trying to use DateTime function to get the current date but it doesn't seem to work for me - it says cannot find name 'DateTime'. Any advice appreciated. Here is my code module PrestigeWorldWide.Scripts.ViewModels { export class IndexViewModel extends BaseViewModels.BaseViewModel { public panels: KnockoutObservableArray&lt;IPanelObject&gt; = ko.observableArray&lt;IPanelObject&gt;(); public events: KnockoutObservableArray&lt;FullCalendar.EventObject&gt; = ko.observableArray&lt;any&gt;(); constructor() { super(); this.panels.push({ Name: "My Transcript", Desc: "View your unofficial QUB transcript", Icon: "fa-file-text", Link: "/PrestigeWorldwide/Grade/ViewTranscript" }); this.panels.push({ Name: "Module Info", Desc: "View the information on all modules including pre-requisites and course content", Icon: "fa-folder-open", Link: "/PrestigeWorldwide/Module/ModuleInfo" }); var cutOffStart1 = "14/09/2015"; var cutOffEnd1 = "12/10/2015"; var cutOffStart2 = "18/01/2016"; var cutOffEnd2 = "15/02/2016"; if (DateTime.Now &gt;= cutOffStart1 &amp;&amp; DateTime.Now &gt;= cutOffEnd1) { this.panels.push({ Name: "Enrollment Wizard", Desc: "Enroll for modules and enter further information about yourself - emergency contacts etc.", Icon: "fa-magic", Link: "/PrestigeWorldwide/Registration/Index" }); } this.getEvents(); } getEvents() { var url = "/PrestigeWorldwide/Class/GetStudentClasses"; this.loading(true); $.ajax(url).done((events: FullCalendar.EventObject[]) =&gt; { this.loading(false); _.each(events, (event) =&gt; { this.events.push(event); }); }); } } export interface IPanelObject { Name: string; Desc: string; Icon: string; Link?: string; } } Update - I've got to the following stage: (is there any easy way to change the formats of dates without using Moments.js? Seems like an overkill for such a tiny piece of code?) //Befor…
upvote count: 2
tagged with: knockout.js
type: Question
tagged with: asp.net-mvc
has title: Hiding panel on certain dates using JavaScript
tagged with: javascript
has answer: http://stackoverflow.com/a/29012987
score: 2
answer count: 1
downvote count: 0

http://stackoverflow.com/q/28986717
tagged with: ajax
has body: I am doing a periodical Updater with prototype js and i would like to make it hide every element of the page having the class='robot' based on the response sent by the ajax request. If the response is equal to hidethemall i want every class='robot'to be hidden but if it is not, then we do nothing and perform no update So far I was able to make my function reset after a number of periodical update in order not to load the server. So far this is how my function looks like function mettreajour_periodique(span_id, url_traitement, nos_parametres, our_frequency, our_decay, our_decay_to_reset) { var ajax = new Ajax.PeriodicalUpdater({success: span_id}, url_traitement, { method:'get', frequency: our_frequency, decay: our_decay, parameters: nos_parametres, evalScripts: true, onSuccess: function(r) { //or onComplete if (ajax.decay &gt;= our_decay_to_reset) { ajax.decay = our_decay; } } }); } mettreajour_periodique('nombre_nouveaux_messages', 'messages_compter_non_lus_actualise.php', '&amp;membre=lesucces', 10, 2, 1800); Questions How to stop this from Updating the div and rather make it hide every div with the class class='robot' if the ajax response is equal to hidethemall ?
has comment: http://stackoverflow.com/comment/46921422
has title: Prototype js How to make periodical Updater hide element of a class based on ajax response
type: UnansweredQuestion
tagged with: prototypejs
tagged with: javascript
has comment: http://stackoverflow.com/comment/47337086
has answer: http://stackoverflow.com/a/29390091
type: Question
has comment: http://stackoverflow.com/comment/46830831
score: 0
answer count: 1

http://stackoverflow.com/a/28907001
has body: The problem is here, return person.born - [person.mother].born person.born is a number &amp; [person.mother] is supposed to be array (since []) (as per your definition). and [person.mother].born should be a number too (as per requirement). So, you cannot use [person.mother].born, you should find value for "person.mother" key in your object. When you do this, console.log(average(ageDifferences)); method 'average' is meant for taking array of number as parameter. Since, ageDifferences is not having number as element, its giving NaN error.
type: Answer
answers question: http://stackoverflow.com/q/28906775
score: 0

http://stackoverflow.com/q/28914526
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46087163
has title: Javascript function to show div with php content only flashes up
answer count: 0
has body: I've written a javascript function to show a PHP within a Div. It seems to work, except that the php to be shown only flashes up for a brief second. Is there any way to get it to stay shown until I select an option to close it. Many thanks function showBiog(keysop){ $.ajax({ url: 'test2.php?number=' + keysop, type: 'POST', dataType: 'html', data: $('#SubmitForm').serialize(), success: function(content) { $("#DisplayDiv").html(content); } }); event.preventDefault(); $('#submit_btn_id').click(); }
type: UnansweredQuestion
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/46087448
has comment: http://stackoverflow.com/comment/46087261
score: 1
tagged with: forms
type: Question

http://stackoverflow.com/comment/75602241
type: Comment
comment on: http://stackoverflow.com/a/39979198
has text: Thanks. Exactly what I was looking for! Should be set as correct answer.
score: 1
type: AnswerComment

http://stackoverflow.com/q/28917703
has answer: http://stackoverflow.com/a/28917823
answer count: 4
has answer: http://stackoverflow.com/a/28917795
score: 8
type: AnsweredQuestion
has body: I want to wrap an href around a vimeo or youtube video and prevent the default playback click events of the embed and just go to the href. Does anyone know how to do this?
has answer: http://stackoverflow.com/a/58632665
tagged with: iframe
linked to: http://stackoverflow.com/q/3820325
type: Question
tagged with: href
has answer: http://stackoverflow.com/a/43970142
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28917795
has title: Wrap href around an iframe
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/46093126
possible better answer: http://stackoverflow.com/a/28917823
upvote count: 8

http://stackoverflow.com/comment/46246276
type: Comment
type: QuestionComment
has text: At the end, by replacing the old string I need to have "I went to Rome last night, now I'm in Florence"
comment on: http://stackoverflow.com/q/28997964
score: 0

http://stackoverflow.com/q/28933839
has title: I am getting an unusual behavior with a Google script that calculates a time difference
type: UnansweredQuestion
score: 0
type: Question
tagged with: google-apps-script
tagged with: google-sheets
tagged with: javascript
answer count: 1
has body: The following is my spreadsheet: This is my spreadsheet script: function onFormSubmit(e) { //Retrieving the Timesheet Table sheet for reading and writing var spreadsheet = SpreadsheetApp.openById('15U8dQIPeYkIiA6B4iHXRe3gEoGGRHy25Qv06jHAJ43_QA'); var Timesheet_Table = SpreadsheetApp.setActiveSheet(spreadsheet.getSheetByName('Timesheet Table')); //Extract response dataSets from the current form submission var timeStamp = e.values[0]; var formID = e.values[1]; var inOutChoiceResponse = e.values[2]; var tsParse = timeStamp.split(" "); var tsDate = tsParse[0]; var tsTime = tsParse[1]; var lastRow = Timesheet_Table.getLastRow(); if (inOutChoiceResponse == "Check in") { Timesheet_Table.getRange(lastRow, 1).setValue(ID); Timesheet_Table.getRange(lastRow, 2).setValue(timeStamp); Timesheet_Table.getRange(lastRow, 3).clearContent(); } else if (inOutChoiceResponse == "Check out") { Timesheet_Table.deleteRow(lastRow); var dataRange = Timesheet_Table.getDataRange(); var dataSet = dataRange.getValues(); for (var i = 1; i &lt; dataSet.length; i++) { var volunteerID = dataSet[i][0]; var sheetDate = dataSet[i][1].getMonth() + 1 + "/" + dataSet[i][1].getDate() + "/" + dataSet[i][1].getFullYear(); if (volunteerID == formID &amp;&amp; sheetDate == tsDate) { var rowToEdit = i + 1; Timesheet_Table.getRange(rowToEdit, 3).setValue(timeStamp); var diff = ((dataSet[i][2] - dataSet[i][1]) / (60 * 1000)) / 60; var hoursWorked = precise_round(diff, 2); Timesheet_Table.getRange(rowToEdit, 4).setValue(hoursWorked); break; } } } }; function precise_round(num, decimals) { var t = Math.pow(10, decimals); return (Math.round(num * Math.pow(10, decimals)) / Math.pow(10, decimals)).toFixed(decimals); }; The problem is that when ever I try to check out a volunteer for the first time through the volunteer check in/out form, it writes -396071.9625 into the Total Hours Worked column. But, if I check-out the same volunteer a second time, it returns the right positive number value into the Total Hours Worked …
has answer: http://stackoverflow.com/a/28944774

http://stackoverflow.com/a/28953108
has comment: http://stackoverflow.com/comment/46159923
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28953045
has comment: http://stackoverflow.com/comment/46159987
type: Answer
has comment: http://stackoverflow.com/comment/46159997
has comment: http://stackoverflow.com/comment/46159968
has comment: http://stackoverflow.com/comment/46159821
accepted answer of: http://stackoverflow.com/q/28953045
has body: You need to learn to love the parseInt function. The default radix is 10, but you can specify other bases as well (for example, sometimes it's handy to parse hexadecimal with parseInt(hexString, 16)). If you expect real numbers, you may prefer parseFloat instead. It takes the same parameters. As to why this worked for multiplication, Javascript is notorious for doing type conversions behind your back. Strings have a + operator (concatenate), so when you get the value of an input (which is a string before parsing) it will perform concatenation. However, strings do not have a * operator. Behind your back, the Javascript runtime attempts to parse the strings as decimal numbers and then multiply. This is not behavior I would count on, so I'd prefer to explicitly parse all inputs first and then perform arithmetic operations on them. //sum() function sum() { var val1 = document.getElementById('sumMulti').value; var array = val1.split(','); var arraySum = 0; for (var i = 0; i < array.length; i++) { arraySum += parseInt(array[i], 10); } document.getElementById('displayLabel').innerHTML = "The sum of your numbers is: " + arraySum.toString() + "."; } Enter Numbers Seperated by ",": Sum()

http://stackoverflow.com/comment/46204486
type: Comment
comment on: http://stackoverflow.com/a/28967768
type: AnswerComment
has text: In an object literal (those `{...}` things), if the keys (left hand sides) are pure strings (like `directive`, `file`, and `allFrames`), then the quotes are optional. I've gone to putting them in quotes in my code because (1) they're strings, not variables, and (2) they're not optional in json
score: 0

http://stackoverflow.com/comment/46356787
type: Comment
has text: ok, then use ``'.contact_form'``. see edited answer. I also edited the codepen.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29060142

http://stackoverflow.com/comment/46080903
has text: So do you just want it to be printed in UTC? The Z at the end is code for Zulu, eg UTC timezone. Also, the 2 datetimes are equivalent, 2015-02-22T10:00:00.000Z is the same instant as Sun Feb 22 2015 05:00:00 GMT-0500 (EST)
comment on: http://stackoverflow.com/q/28910995
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46331293
score: 0
has text: Just press f12 on your browser to open your developer tool, switch to Network, select your request and see the response header.
comment on: http://stackoverflow.com/a/29046022
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/46133809
score: 0
comment on: http://stackoverflow.com/q/28938933
type: QuestionComment
has text: @LShetty yeah, pretty much, just some sort of visual aid that the print.css has been changed to printacrf.css and for it to set back to print.css if it's clicked again.
type: Comment

http://stackoverflow.com/q/28910362
has body: I'm not a web developer and I try yo use d3js. I have an issue with d3.select. I tried to display the results from "p_total" at but this do not work. I use a template to test my code and its workng fine except, for d3.select method. PLease see below the code: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;TEST&lt;/title&gt; &lt;meta charset="UTF-8"&gt; &lt;meta content="UTF-8" http-equiv="encoding"&gt; &lt;link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" /&gt; &lt;link rel="stylesheet" type="text/css" href="css/keen-dashboards.css" /&gt; &lt;/head&gt; &lt;body class="application"&gt; &lt;div class="navbar navbar-inverse navbar-fixed-top" role="navigation"&gt; &lt;div class="container-fluid"&gt; &lt;div class="navbar-header"&gt; &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"&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="../"&gt; &lt;span class="glyphicon glyphicon-chevron-left"&gt;&lt;/span&gt; &lt;/a&gt; &lt;a class="navbar-brand" href="./"&gt;Domosint &lt;/a&gt; &lt;/div&gt; &lt;div class="navbar-collapse collapse"&gt; &lt;ul class="nav navbar-nav navbar-left"&gt; &lt;li&gt;&lt;a href="https://keen.io"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="https://keen.io/team"&gt;Team&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="https://github.com/keenlabs/dashboards/tree/gh-pages/examples/starter-kit"&gt;Source&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="https://groups.google.com/forum/#!forum/keen-io-devs"&gt;Community&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/tagged/keen-io?sort=newest&amp;pageSize=15"&gt;Technical Support&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="container-fluid"&gt; &lt;div class="row"&gt; &lt;d…
tagged with: d3.js
upvote count: 1
downvote count: 1
has title: d3.select do not append
type: Question
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28911348
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/46302435
score: 0
type: Comment
type: QuestionComment
has text: I think you need to change the ctx to ctx2 at the = new chart(ctx)... line for your second chart.
comment on: http://stackoverflow.com/q/29030674

http://stackoverflow.com/comment/46203864
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28976326
has text: The approach suggested in your linked question seems sound - can you not just wrap that in a filter?
score: 0

http://stackoverflow.com/q/29018322
has answer: http://stackoverflow.com/a/29019396
accepted answer: http://stackoverflow.com/a/29019396
has title: Parse XML catch block not catching exception in JS
type: Question
tagged with: try-catch
has comment: http://stackoverflow.com/comment/46280775
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/46280883
answer count: 1
has comment: http://stackoverflow.com/comment/46280873
tagged with: http://stackoverflow.com/tag/xml
type: AnsweredQuestion
has body: I have a function that takes an XML file (obtained via AJAX) as input, parses it as XML and then execute some functions on it. A stripped down version can be found below. AJAX $.ajax({ type: "GET", url: "./default.xml", dataType: "xml", success: function(data) { parseMech(data); } }); parseMech function function parseMech(xml) { try { var xmlObject = $(xml); // See the output function below $(".tree.base").html(treeBuilder(xmlObject.find("node").first())); console.log("succes?"); } catch(e) { $("#error-msg &gt; .the-msg").text(" Invalid XML structure").parent().fadeIn(250); console.log("Failed"); } } treeBuilder function function treeBuilder(nodes) { var newList = $("&lt;ol&gt;"); nodes.each(function (x, e) { var newItem = $('&lt;li&gt;&lt;a href="#"&gt;&amp;nbsp;&lt;/a&gt;&lt;/li&gt;'); for (var i = 0, l = e.attributes.length, a = null; i &lt; l; i++) { // Don't forget to add properties as data-attributes a = e.attributes[i]; newItem.attr("data-" + a.nodeName, a.value); if (a.nodeName == "cat" || a.nodeName == "word") { newItem.html('&lt;a href="#"&gt;' + a.value + '&lt;/a&gt;'); } } if ($(this).children('node').length) { newItem.append(output($(this).children('node'))); } newList.append(newItem); }); return newList; } This works as it should when default.xml is a valid xml file. However, when it's not (for instance when I leave out a closing tag) the catch blok is not executed. In other words: when executing all functions with an invalid XML as source, neither console logs are executed, even though you would expect at least one (in try or in catch) to be logged. Am I missing something here?
has comment: http://stackoverflow.com/comment/46280726
has comment: http://stackoverflow.com/comment/46281179

http://stackoverflow.com/comment/46225259
has text: Don't set the`multipart/form-data` header and pass formdata to send()
comment on: http://stackoverflow.com/q/28988308
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29052962
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: How to get the HTML5 canvas when using jquery?
has comment: http://stackoverflow.com/comment/46345194
score: 2
has body: I am very new in the web world. Please pardon me if my questions sound stupid? My main aim is to capture the animation on HTML5 canvas to a video, in which I succeeded to some extent. I am able to record a video using this module https://github.com/spite/ccapture.js . This is possible only when the code has HTML5 and plain javascript drawing APIs having a canvas element. Next, I 've been trying to capture text animations using textillate.js which is jquery based. I have no idea how to get the handle to the canvas in this case. Since jquery is based on javascript, don't all the jquery based animation render on HTML5 canvas? Here is the example code below. Where in this code can I get the canvas handle and how? There's also no mention of the canvas name. Animate me with textillate effects
has answer: http://stackoverflow.com/a/30928718
has comment: http://stackoverflow.com/comment/46343808
downvote count: 0
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46353249
upvote count: 2
linked to: http://stackoverflow.com/q/2925130
tagged with: canvas
has comment: http://stackoverflow.com/comment/46344856

http://stackoverflow.com/comment/46223434
comment on: http://stackoverflow.com/a/28987308
has text: I don't see the file being uploaded. In the old case, was it uploaded to `/tmp`. No errors in webserver log or Firefox debugger.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29053582
type: Question
tagged with: uglifyjs
has answer: http://stackoverflow.com/a/29053850
tagged with: javascript
tagged with: gruntjs
has title: Why is Grunt Uglify keeping my function names?
tagged with: grunt-contrib-uglify
score: 2
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has body: I have a grunt configuration for grunt-contrib-uglify as so: options: { mangle: { topLevel: true }, compressor: { sequences: true, dead_code: true, conditionals: true, booleans: true, unused: true, if_return: true, join_vars: true, drop_console: true }, dist: { cwd: 'public', expand: true, src: ['**/*.js'], dest: 'public' } } Here is some sample code as to what I have: (function (Core, $, undefined) { Core.Dom = { AddItem: function() { ... code ... } }; ... etc ... }(window.Core = window.Core || {}, jQuery)); After I run my grunt task the compression works in terms of getting rid of white space and such, but the code still has the functions label with it's names. For example, in the compressed file Core.Dom.AddItem would be a.Dom.AddItem. Is there a way to mangle the names to where it would be a.b.c where b=Dom and c=AddItem? I have tried mangle: true as well, but it keeps the names of the functions. Anyone have any clue as to what I have done wrong?
upvote count: 2
has comment: http://stackoverflow.com/comment/66739952

http://stackoverflow.com/comment/46271072
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29013026
type: Comment
has text: i changed that, but still not displaying lines.

http://stackoverflow.com/comment/46179382
score: 0
has text: Why do you need an href on a element? Why do you have an ancor list?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28963766

http://stackoverflow.com/comment/46270133
type: AnswerComment
type: Comment
has text: I think, yes. Anyway you can use `JSON.parse` to convert to array.
score: 0
comment on: http://stackoverflow.com/a/29011327

http://stackoverflow.com/comment/46093758
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28918057
has text: can you give your folder / path structure as well as html code and js code.?

http://stackoverflow.com/comment/46342318
score: 0
type: Comment
type: QuestionComment
has text: There is a lot I don't understand about your JQuery syntax here, but you might try this: var msg = $.parseHTML(this.message) and then using msg in your JQuery function .
comment on: http://stackoverflow.com/q/29040972

http://stackoverflow.com/a/29004812
has body: Current date: $this-&gt;pass_meta_data['title'] = "Welcome to our website, " . date("d/m/Y");
has comment: http://stackoverflow.com/comment/46257016
answers question: http://stackoverflow.com/q/29004728
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/29004728
type: Answer

http://stackoverflow.com/q/28940676
has body: I want to achieve the double click event on a specific div like this: &lt;div id="divID" ondblclick = 'alert("double click!!");' &gt; it worked on the google chrome browser but when I open it with phone it didn't work, by the way the single click worked. ps: i added this two things &lt;meta name="viewport" content="width=device-width, initial scale=1,user-scalable=no"&gt; and this body { -ms-touch-action: manipulation; touch-action: manipulation;} but it didnt work!
possible better answer: http://stackoverflow.com/a/28942041
tagged with: javascript
has answer: http://stackoverflow.com/a/28941748
accepted answer: http://stackoverflow.com/a/28941748
upvote count: 11
has answer: http://stackoverflow.com/a/28942041
has title: How to make ondblclick event works on phone?
has answer: http://stackoverflow.com/a/76241178
tagged with: http://stackoverflow.com/tag/html
answer count: 7
has answer: http://stackoverflow.com/a/67047168
favorite count: 0
has answer: http://stackoverflow.com/a/73530086
score: 11
has answer: http://stackoverflow.com/a/28943163
type: AnsweredQuestion
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/77852018

http://stackoverflow.com/q/28962417
has answer: http://stackoverflow.com/a/28962458
type: AnsweredQuestion
type: Question
tagged with: javascript
has body: div[id^=image]:target{ /*some styles here*/ } I found the above mentioned code part on http://www.inserthtml.com/2012/04/css-image-gallery/ what does this code mean? Thanks.
score: 0
accepted answer: http://stackoverflow.com/a/28962458
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: What does this css stands for?
tagged with: css

http://stackoverflow.com/a/28921971
has comment: http://stackoverflow.com/comment/46101571
has body: Assuming your object is named obj, you can access the value with : obj.bbb.ccc.ddd But this has nothing to do with jQuery. This is pure javascript. See fiddle.
answers question: http://stackoverflow.com/q/28921962
has comment: http://stackoverflow.com/comment/46101481
score: 0
has comment: http://stackoverflow.com/comment/46101778
has comment: http://stackoverflow.com/comment/46101311
has comment: http://stackoverflow.com/comment/46101292
has comment: http://stackoverflow.com/comment/46101236
type: Answer
has comment: http://stackoverflow.com/comment/46101441

http://stackoverflow.com/comment/46279865
type: Comment
has text: @Oliver Watkins Actually, you already have functions returning promises, they're called methodB and methodC. So we can just use those functions directly as the thing .then() calls. That is the shorter and simpler solution because it doesn't add an extra unnecessary set of function wrappers to the mix. See my corrected answer for the simplest solution.
comment on: http://stackoverflow.com/a/29010129
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46270644
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29012590
has text: You have an explicit time for your animation, so you could say something like `setTimeout(function() { ele.style.display = 'none'; }, 1000);`
score: 0

http://stackoverflow.com/comment/46199847
has text: @matthew `.teaser` wraps the `video` tag. Post updated with html.
score: 0
comment on: http://stackoverflow.com/q/28973897
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46106646
score: 0
comment on: http://stackoverflow.com/q/28924961
type: Comment
type: QuestionComment
has text: Yup, there are other libraries also which use native rendering, i gave you only one example of such library.

http://stackoverflow.com/comment/46263631
type: QuestionComment
comment on: http://stackoverflow.com/q/29008925
has text: thanks for your help, I am new to the web and I'm learning to use, being English I have some difficulties to understand it, I'll do it slowly but I will have to do
score: 0
type: Comment

http://stackoverflow.com/q/28962341
has body: I have google map embedded in a page with a Dropdown list containing a number of cities. I have stored the lat and lang values of those cities in a database. A user will select a city and the map will load with respective lat and lang values upon clicking the submit button. Please note that I don't want the geocoding technique. Here is a snippet of my effort. var map; var cntr; var zm; &lt;?php if(!empty($position['lat']) &amp;&amp; !empty($position['lang'])){ ?&gt; var latValue = &lt;?php $position['lat']; ?&gt; ; var langValue = &lt;?php $position['lang']; ?&gt; ; cntr = {lat: latValue , lng: langValue }; zm = 8; &lt;?php} else{ ?&gt; cntr = {lat: 30, lng: 70}; zm = 7; &lt;?php } ?&gt; function initialize() { var mapOptions = { center: cntr, zoom: zm }; //And the rest of the code for markers and infowindows etc. This doesn't work. It even stops the rest of the code to work which perfectly works when I remove this section and assign the default values to the var cntr. (I am using MVC organization and the $position is an associative arrray of the cities lat and lang in the controller. The query works perfectly.)
tagged with: javascript
downvote count: 5
has answer: http://stackoverflow.com/a/28966079
has comment: http://stackoverflow.com/comment/46183609
answer count: 4
has answer: http://stackoverflow.com/a/28971044
favorite count: 0
has title: loading a map by lat and lang stored in a database
has answer: http://stackoverflow.com/a/28967544
score: -4
upvote count: 1
tagged with: php
possible better answer: http://stackoverflow.com/a/28967544
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28967767
accepted answer: http://stackoverflow.com/a/28971044
has comment: http://stackoverflow.com/comment/46177823
type: Question
tagged with: google-maps

http://stackoverflow.com/comment/46108081
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28925477
has text: yes. I agree with you.. can you place this as an answer to agree..? Possibly put your implementation. that may make sense.
score: 0

http://stackoverflow.com/comment/46198896
comment on: http://stackoverflow.com/q/28973685
type: Comment
has text: DST's depend on the timezone. For example, here, in France, we go forward in April (not March), and back in October (not November).
type: QuestionComment
score: 1

http://stackoverflow.com/comment/46244080
comment on: http://stackoverflow.com/q/28997975
has text: Direct translation: `for (objNameID in colNameIDs) { wscript.echo( colNameIDs[objNameID].Division); ... }` or easier to read: `for (objNameID in colNameIDs) { var obj = colNameIDs[objNameID]; wscript.echo(obj.Division); ... }`
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/46148766
has text: @Xufox I added shorted version to exclude the version of wrong working script http://jsfiddle.net/ut1pyf3x/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28946307
score: 0

http://stackoverflow.com/comment/46113457
type: AnswerComment
has text: Fixed the Fiddle in post, now the master checkbox will override the child checkbox states.
type: Comment
comment on: http://stackoverflow.com/a/28928738
score: 0

http://stackoverflow.com/comment/46257937
type: Comment
type: QuestionComment
has text: What's `loadXMLDoc`? https://code.google.com/p/dingweiwang/downloads/detail?name=loadXMLDoc.js&can=2&q= maybe?
comment on: http://stackoverflow.com/q/29005909
score: 0

http://stackoverflow.com/q/28947548
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28948647
has title: Place an iframe in a blog and make it fit correctly
score: 0
answer count: 2
has body: Ok, so I have made a blog for my wife who is in real estate. I am familiar with html and css, but I seem to have hit a wall. I have been researching it for a little now and would like some direction. I removed the side bars using css, but somehow I missed something and cant figure out how to expand the center post section to make it the full width. Thats one, the second issue is getting the iframe to fit right which probably ties into the first one. so the site is: http://tamapabayrealestate.blogspot.com/p/blog-page_79.html and the code i used to get it there is: ` All help is greatly appreciated. Thanks in advance.
possible better answer: http://stackoverflow.com/a/28948625
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28948625
tagged with: iframe
accepted answer: http://stackoverflow.com/a/28948647
tagged with: blogger
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/q/28976760
answer count: 0
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46204603
type: Question
score: 3
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46204669
has comment: http://stackoverflow.com/comment/46204651
tagged with: jsonp
has body: I've spent hours and hours in this problem and I can't get it working. The problem is as follows: I have to fetch a JSON from a certain address. I have validated that server's response and it is a valid JSON. On top of that, it works just fine as far as my network is concerned. (I'd put an image proving it if I had enough reputation hehe) On my client-side application, though, I keep getting a 404 code. Here is my code: (function(){ var app = angular.module('queryApp', ['ngRoute']) .controller('queryController', ['$scope', '$http', function ($scope, $http){ this.inputChange = function (){ $http.jsonp('http://localhost:3000/orders?callback=JSON_CALLBACK'). success(function(data, status){ console.log(status) }). error(function(data, status){ console.log(status) }); }; }]); })(); Title {{input}} The funny thing is if I change the URL of the request to, let's say, the one on the AngularJS JSONP tutorial (https://docs.angularjs.org/api/ng/service/$http#jsonp) it works just fine! I can simply fetch the data. Having said that, I repeat: the JSON I'm trying to fetch IS valid. Any help will be much appreciated. Thanks!
tagged with: javascript
favorite count: 0
tagged with: ajax
upvote count: 3
tagged with: angularjs
has title: Valid JSON with status 200 always returns 404 on the application
has comment: http://stackoverflow.com/comment/46204791
has comment: http://stackoverflow.com/comment/46204832

http://stackoverflow.com/a/29037649
has body: PHP is a server side language. You need a client side language "JavaScript". If you need really php execution : You need ajax requests on a url (script.php).
type: Answer
has comment: http://stackoverflow.com/comment/46879641
score: 0
answers question: http://stackoverflow.com/q/29037538

http://stackoverflow.com/comment/46355517
type: AnswerComment
has text: Tab key is still not working now with your solution. Please see snippet, When Double click on a list li item it make a new sub li, But when I click On Tab key it is still nothing. I want create sub-list with press TAB Key.
comment on: http://stackoverflow.com/a/29059529
score: 0
type: Comment

http://stackoverflow.com/comment/46264152
comment on: http://stackoverflow.com/a/29009131
type: Comment
has text: Thanks for your answer. When I click the menu icon, it reveals. When I click again, it doesn't close. Help?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/77890811
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29085895
has text: wow what a gem I had to add 'main' not 'main.js' and it worked fine.
type: Comment

http://stackoverflow.com/q/28915697
has title: Using Browserify to Import Smooth Scroll
has body: I'm not sure if I'm understanding Browserify correctly, but am I able to essentially require() this smooth-scroll plugin (installed via npm) in my app.js file and Browserify will bundle it all together in my final app.js file? app.js var ss = require('./smooth-scroll'); $(document).ready(function(){ ss.init(); }); gulpfile.js gulp.task('js', function () { var browserified = transform(function(filename) { var b = browserify(filename); return b.bundle(); }); return gulp.src('./src/js/app.js') .pipe(browserified) .pipe(sourcemaps.init({loadMaps: true})) .pipe(sourcemaps.write('./')) .pipe(gulp.dest('./_site/public/js')) }); Update So, I'm trying to create my own module using the answer below but I'm having a problem in getting it to work with jquery.adaptive-backgrounds.js. adaptive-backgrounds.js var $ = require('jquery/dist/jquery'); module.exports = function(){ /* jshint debug: true, expr: true */ ;(function($){ /* Constants &amp; defaults. */ var DATA_COLOR = 'data-ab-color'; var DATA_PARENT = 'data-ab-parent'; var DATA_CSS_BG = 'data-ab-css-background'; var EVENT_CF = 'ab-color-found'; ... }; app.js var $ = require('jquery/dist/jquery'); var ab = require('./vendors/adaptive-backgrounds'); $(function(){ $.ab.run(); }); For some reason the adaptive backgrounds plugin doesn't seem to be running on the page.
answer count: 1
tagged with: npm
tagged with: node.js
accepted answer: http://stackoverflow.com/a/28917955
type: AnsweredQuestion
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28917955
tagged with: browserify

http://stackoverflow.com/q/28963690
tagged with: css
has answer: http://stackoverflow.com/a/28963764
has comment: http://stackoverflow.com/comment/46179206
linked to: http://stackoverflow.com/q/2113075
has comment: http://stackoverflow.com/comment/46179486
has comment: http://stackoverflow.com/comment/46179091
duplicate of: http://stackoverflow.com/q/2113075
has comment: http://stackoverflow.com/comment/46179588
type: Question
has body: I want to target the last child of the active class either with jQuery or CSS I used the last-of-type pseudo class but it didn't work HTML CODE Element Element Element Element Element This What I want to target Element Element CSS CODE .owl-item { background-color: green; color:#FFF; margin: 10px 50px; padding: 10px } .owl-item.active:last-of-type { background-color: red; } This is a live demo JsFiddle
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46179362
has comment: http://stackoverflow.com/comment/46179380
tagged with: javascript
score: -1
upvote count: 2
linked to: http://stackoverflow.com/q/6401268
has title: How to target last child of specific class
answer count: 1
tagged with: jquery
duplicate of: http://stackoverflow.com/q/6401268
accepted answer: http://stackoverflow.com/a/28963764
favorite count: 0
has comment: http://stackoverflow.com/comment/46179114
downvote count: 3
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/72497902
type: Comment
has text: I had it with false and it still doesn't work in either latest Chrome (56.0) or latest Firefox (52.0)
comment on: http://stackoverflow.com/a/41889191
type: AnswerComment
score: 2

http://stackoverflow.com/comment/46305212
score: 0
type: AnswerComment
type: Comment
has text: thank you for your reply i tried doing as you suggested but then ran into the issue of cfinputs not been able to exist outside cfforms. I then wrapped the cfinput field in a html commented cfform(worked but don't think its best practise). After appending the ajax generated form to the page the datefield calendar icon would still not trigger the calendar when clicked on. Please help with more suggestions will be really appreciated.
comment on: http://stackoverflow.com/a/29015034

http://stackoverflow.com/comment/46076798
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28908672
has text: Works fine here: http://jsfiddle.net/seyenaz/q5xv9yqp/
type: QuestionComment

http://stackoverflow.com/comment/46140612
has text: [Don't try to parse HTML with regexs](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454). (Unless it's very limited, known html)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28943230
score: 4

http://stackoverflow.com/q/28930692
has title: Detecting IP and Selecting state
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28931020
favorite count: 0
upvote count: 1
tagged with: php
downvote count: 1
type: AnsweredQuestion
has body: Can anybody tell me how the state can be selected in the drop-down by recognizing automatically the IP address? I haven't tried anything so if you have any formula please help me. Thanks
accepted answer: http://stackoverflow.com/a/28931020
type: Question

http://stackoverflow.com/q/28971451
type: UnansweredQuestion
has body: I want to change the content of a selectbox based on a radio button. I'm using AngularJS. So, my select box looks like this: &lt;select ng-controller="MyController"&gt; &lt;option ng-repeat="o in array_of_values" value="{{o.id}}"&gt;{{o.value}}&lt;/option&gt; &lt;/select&gt; Now, depending on wether my radio button is checked or not, I want a different set of values loaded in the select box. I don't have much experience with Angular, but I suspect I could dynamically change $scope.array_of_values in MyController. Something similar to this example (official documentation) I've seen another example, where you can change the content of a div based on a radio button, just using ng-model + ng-show EDITED: But I have another difficulty: I really have several pairs radio button / select box, as table's rows, and they are dynamically generated. I could use plain jQuery plus a javascript function to get the id of each radio button and just change a specific select box based on the onClick event of the radio button. But I tend to think there is a more elegant way to do this, using AngularJS. Am I right? Any clues? What approach should I follow? Many thanks in advance
has answer: http://stackoverflow.com/a/28971828
type: Question
tagged with: javascript
score: 0
has title: Change selectbox depending on radio button checked
answer count: 1
tagged with: jquery
tagged with: angularjs

http://stackoverflow.com/comment/46256686
type: Comment
has text: Can you provide the code that used for hiding options?
comment on: http://stackoverflow.com/q/29005170
score: 1
type: QuestionComment

http://stackoverflow.com/comment/46267453
score: 0
comment on: http://stackoverflow.com/a/29011101
has text: Thanks for your answer. I didn't need to use promises, but after some testing this also works. Thanks for your answer again, I hope some other people can also make use of this. Promises are a bit of a brainbender imo. Thanks!
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28971494
score: 1
upvote count: 1
has body: Looking in the docs they only offer examples with data attributes, I need to write a different js file for a form and do something like: $('#myform').parsley(options); I want to know the available methods in options, and apply validators to inputs and then print custom messages. It is possible?
type: Question
tagged with: parsley.js
has comment: http://stackoverflow.com/comment/46924218
accepted answer: http://stackoverflow.com/a/28973702
tagged with: javascript
linked to: http://stackoverflow.com/q/21392813
answer count: 1
downvote count: 0
tagged with: jquery
linked to: http://stackoverflow.com/q/29246268
favorite count: 0
has answer: http://stackoverflow.com/a/28973702
has title: How to use ParsleyJS 2.* using javascript and not data attributes
type: AnsweredQuestion

http://stackoverflow.com/q/28998464
type: AnsweredQuestion
tagged with: d3.js
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29002821
tagged with: java
has body: I'm new to d3js, and I'm successfully using example here: https://gist.github.com/d3noob/4414436 That's quite nice, because it works remotely, the CSV being stored on server side. Now, I'd like to go further, and add the ability to select the source CSV from a list and the redraw the chart. I'm stuck in writing php and java, and java echo'ed by php, so I think that I'm totally on the wrong way. Would you have an example that illustrates how to perform the chart update reading a new CSV selected from a dropdown list containing the server side's CSV pathes? Kind regards, Sylvain
has title: d3js dynamic csv switch from dropdown list
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/csv
has answer: http://stackoverflow.com/a/29002821

http://stackoverflow.com/q/28981264
downvote count: 0
score: 1
type: Question
upvote count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28981530
favorite count: 0
linked to: http://stackoverflow.com/q/18307323
has body: I have a checkbox ,when the checkbox clicks it will display a div ,if unchecked the div has to hide,I have tried this code but it is not working properly,oncheck it is showing the div but it's not hiding Code: Schedule Campaign Select date & time to schedule And the JS code: $('#schedulecheck').on('ifChecked', function(event){ // alert(); if($(this).attr("value")=="red"){ $(".red").show(); } }); $('#schedulecheck').on('unChecked', function(event){ if($(this).attr("value")=="red"){ $(".red").hide(); } });
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/28981427
has title: How to hide a div on unchecking the checkbox
has answer: http://stackoverflow.com/a/28981336
type: UnansweredQuestion
tagged with: checkbox
has comment: http://stackoverflow.com/comment/46212260
has answer: http://stackoverflow.com/a/28981279

http://stackoverflow.com/comment/46321577
type: QuestionComment
has text: If either of you can provide an explanation for my answer below, I will give you mark yours as the answer.
score: 0
comment on: http://stackoverflow.com/q/29039983
type: Comment

http://stackoverflow.com/comment/46213227
comment on: http://stackoverflow.com/q/28981704
score: 0
type: Comment
type: QuestionComment
has text: Add a status to the element that has already been hovered on, such data-ajax="done" and then on the next hover, if ajax==done do nothing.

http://stackoverflow.com/comment/46147058
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28946330
type: Comment
has text: [Or this one](http://stackoverflow.com/questions/16554136/setting-correct-this-value-in-requestanimationframe)

http://stackoverflow.com/q/28918404
downvote count: 0
favorite count: 0
has title: How do I calculate percentage difference in JS?
has body: I'd like to calculate percentage differences between two values. The thing I'm struggling with is the variables, I don't understand how to make it work, I don't even know how to get started.. so I'm sorry if there's a lot wrong with my code. I want the user to be able to compare the birth rates and/or death rates between two countries. There should be a first option, where the user selects if he wants to know the birth rate or death rate. Then an option to select the first country to compare, and a third option where the user selects the second country. But I really don't know how to actually do this. So far I got this: var choice = { birth: { holland: 11, brasil: 17, irannie, 19, //amount of people who are born every 1000 citizens }, death: { holland: 8, brasil: 6, irannie: 6, //amount of people who die every 1000 citizens, note two values are the same.. so what should the result show? I don't understand } document.getElementById('calculate').addEventListener('click', function () { var first= +document.getElementById('onecountry').value; var second= +document.getElementById('secondcountry').value; // var snelheid = +document.getElementById('vervoer').value; var percentage = first / second * 100; var resultaat=Math.round(percentage*10)/10 Another problem I'm facing here is that I don't know how to make the result appear based on the first option, so if the user chose birth rate it should show the first birth rate as a percentage of the second birth rate, and the same for death rate. document.getElementById('div2').innerHTML = "Het verschil van het geboortecijfer ten opzichte met het andere land is " + resultaat + "; This is in the HTML: Birth rate Death rate Nederland Brazillie Het tweede land dat je wil vergelijken Nederland Brazillie Iran Het percentageverschil is difference is ...
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28918536
has answer: http://stackoverflow.com/a/28918829
has comment: http://stackoverflow.com/comment/46094676
score: 1
tagged with: rate
tagged with: equation
upvote count: 1
tagged with: percentage
type: Question
has comment: http://stackoverflow.com/comment/46094466
tagged with: javascript
tagged with: variables
has comment: http://stackoverflow.com/comment/46094751
answer count: 2
has comment: http://stackoverflow.com/comment/46094506

http://stackoverflow.com/a/68664023
score: 2
answers question: http://stackoverflow.com/q/28995597
upvote count: 2
has body: To better illustrate the opted solution from RedactedProfile's comment, here's the code. models.User .create(newuser, {include:[{ all: true }]}) .then(user =&gt; { user.reload().then(user =&gt; { res.json(user); }) });
downvote count: 0
type: Answer

http://stackoverflow.com/a/28928725
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46113269
has comment: http://stackoverflow.com/comment/46113461
accepted answer of: http://stackoverflow.com/q/28928434
type: Answer
answers question: http://stackoverflow.com/q/28928434
downvote count: 0
score: 3
has body: You lack a () at the end to make the enclosing function an IIFE. var MyChooser = (function () { var constructor = function(select,...stuff){...} // Note we're using constructor.prototype rather than MyChooser.prototype constructor.prototype.foo = function... ... return constructor; }()); // Note the () Without it, your constructor won't be assigned/returned to MyChooser. You end up with MyChooser being a function that returns constructor, rather than constructor itself. Also, change your prototype methods to point to constructor instead of MyChooser. Also, all this confusion reasulted from the fact that the constructor and it's method definitions are placed in a closure - which is not necessary. You can simply go with: function MyChooser(select,...stuff){...} MyChooser.prototype.moarStuff = function(){...}; ... var fp = new MyChooser(...);
upvote count: 3

http://stackoverflow.com/a/29014194
score: 1
answers question: http://stackoverflow.com/q/29013486
has comment: http://stackoverflow.com/comment/46277689
accepted answer of: http://stackoverflow.com/q/29013486
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46273227
type: Answer
has body: You could write a custom Protocol that handles a request from the browser opening some kind of program in the OS. Something like the mailto://youremail@gmail.com works. I'm not an expert at it but you can check this Out. https://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx Also this answer... how do I create my own URL protocol? (e.g. so://...)
upvote count: 1

http://stackoverflow.com/comment/46156806
type: Comment
has text: Please update the question with additional information that describes what it is you want to accomplish that is not already working.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28951191

http://stackoverflow.com/comment/46273536
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29014292
has text: Doing it on the client side, with javascript, is probably "bad practice" because a) it's browser dependent, some users may not have javascript enabled and for something as simple as a link there's no reason to require it b) it messes with how Google sees the link, so they may not crawl it. Using something like PHP where you could abstract it away on the server side and client side sees no difference would probably be fine.
score: 0

http://stackoverflow.com/a/28985071
score: 0
type: Answer
downvote count: 2
has body: This website has various different methods to solve your problem Controlling the width of SELECT lists I think I found somewhat similar problem on stackoverflow itself. Use of css should resolve your problem How can change width of dropdown list?
answers question: http://stackoverflow.com/q/28984952
has comment: http://stackoverflow.com/comment/46218986
upvote count: 2
has comment: http://stackoverflow.com/comment/46218856

http://stackoverflow.com/comment/46259737
type: Comment
type: QuestionComment
has text: I think you need to be more clear about what you're asking. The answers so far have suggested using the `:visited` selector, but I'm not sure if you mean something else.
comment on: http://stackoverflow.com/q/29006908
score: 0

google-sheets
tags question: http://stackoverflow.com/q/29019004
tags question: http://stackoverflow.com/q/28933839
tags question: http://stackoverflow.com/q/29002585
tags question: http://stackoverflow.com/q/29057517
type: Tag
tags question: http://stackoverflow.com/q/29029911
tags question: http://stackoverflow.com/q/28950882
tags question: http://stackoverflow.com/q/28914542
tags question: http://stackoverflow.com/q/28971987
tags question: http://stackoverflow.com/q/28921967
tag name: google-sheets

http://stackoverflow.com/comment/46128608
type: Comment
has text: Oh and hint 2: There is jsperf.com, you don't have to use jsFiddle for measuring performance. http://jsperf.com/retrieve-path-of-object-items
comment on: http://stackoverflow.com/a/28930020
score: 0
type: AnswerComment

http://stackoverflow.com/a/28955487
type: Answer
score: 2
has body: My guess would be that you're repeatedly calling either the if or the else condition, whereas you just want to call them just once. Try something like this: var compactHeader = false; $(window).on('scroll', function() { scrollPosition = $(this).scrollTop(); if (scrollPosition &gt;= 130 &amp;&amp; !compactHeader) { compactHeader = true; // Code to collapse header... } else if (scrollPosition &lt; 130 &amp;&amp; compactHeader) { compactHeader = false; // Code to expand header... } }); As well as checking the scroll position we check whether the header is collapsed or expanded, to ensure the animation is only performed once.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28955351
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28955351
upvote count: 2

http://stackoverflow.com/comment/46182943
has text: There was a useful comment. Dude pls go back.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28965470

http://stackoverflow.com/q/29028177
type: UnansweredQuestion
has body: I am working on MVC application and I have jQuery plugin, calculating width and height of page and I am calling this from document.ready function. I am getting following error ReferenceError: getPreventDefault is not defined MyCustomScript:1:115 Use of getPreventDefault() is deprecated. Use defaultPrevented instead. jquery-1.10.2.js:5389:0 no element found my plugin (function($) { $.fn.adjustOuterStripLayout = function () { alert("strip"); $(window).bind('load resize', function () { var viewport_height = $(window).height(); var viewport_width = $(window).width(); var webPage_containerWidth = $('.container').width(); alert("viewport_width " + viewport_width + "container " + webPage_containerWidth); }); }; })(jQuery); main function $(document).ready(function () { alert("hello"); $(this).adjustOuterStripLayout(); }); sometime it alert and sometime it not. I have also clear browser cashed and testing this on firefox and jquery version 1.10.2
downvote count: 0
tagged with: asp.net-mvc
score: 1
type: Question
has title: Calling jQuery plugin from document.ready throw getPreventDefault error
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46297909
has comment: http://stackoverflow.com/comment/46297995
favorite count: 0
has answer: http://stackoverflow.com/a/29028311

http://stackoverflow.com/q/28913346
has body: I am creating a secure payment system in a SPA application and the process I currently use is: CREATE HIDDEN FORM -> FILL FORM WITH DATA -> SUBMIT FORM &amp;&amp; REDIRECT USER TO 3RD PARTY SECURE PAYMENT GATEWAY I was wondering if there is a way with JavaScript or jQuery to simulate a form submit+redirect, without creating a hidden form, because this solution feels a little "dirty". Ajax request is not an option here, because of cross origin restrictions
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28913428
type: UnansweredQuestion
tagged with: web-services
type: Question
has answer: http://stackoverflow.com/a/48053909
has title: Simulate hidden form submit & redirect with JavaScript for secure payment

http://stackoverflow.com/comment/46259738
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29006840
type: Comment
has text: I have tired adding the runat=server like this And then in the code behind how do i access the date that has been input? var offerStartString = couponDatetimepickerEnd.[what here] There is no .Text or .Value properties available

http://stackoverflow.com/comment/46113432
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28928135
has text: I didn't realize that the Schema limits what kind of information gets defined in the document. My understanding of Schemas is still fuzzy. You and @Prontto really helped! Thanks.
score: 0

http://stackoverflow.com/q/28915645
has comment: http://stackoverflow.com/comment/46090567
answer count: 4
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/50727296
has answer: http://stackoverflow.com/a/28916468
has comment: http://stackoverflow.com/comment/46090872
has comment: http://stackoverflow.com/comment/46090707
tagged with: javascript
score: 2
has body: I'm currently running into a problem you guys might be able to help me with.. I'm using websockets to connect to a custom server. Now i want to integrate a second Server IP if the first one isn't available. How is it possible to detect, that the connection couldn't be made because the server isn't reachable? When I enter a wrong ws://url in my script, Chrome for example gives me the following error: WebSocket connection to 'wss://1234/' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED in Firefox it's something complete different. Do you guys of any method to catch this error with Javascript? Basically when the ws:// url can't be reached, i want to change a variable with a different Server-IP and try it with this one again... Thanks for your help!
downvote count: 0
has answer: http://stackoverflow.com/a/28916551
tagged with: websocket
tagged with: jquery
has answer: http://stackoverflow.com/a/28919214
favorite count: 0
has comment: http://stackoverflow.com/comment/46090164
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46089438
has title: If Websocket connection can't be established do something else

http://stackoverflow.com/comment/46109331
type: QuestionComment
comment on: http://stackoverflow.com/q/28926466
score: 0
has text: the network console should tell you if the status was `200 ok`. anything else goes to the error handler.
type: Comment

http://stackoverflow.com/comment/46229929
has text: On the risk that I'm embarrassing myself now... Yeah, outside of it. Isn't that possible?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28990588
score: 0

http://stackoverflow.com/comment/46188579
score: 0
type: QuestionComment
has text: What do you mean "open every page"? Do you mean: open a new window (or tab) for every link on the current page that contains the URL fragment?
type: Comment
comment on: http://stackoverflow.com/q/28968436

http://stackoverflow.com/comment/46250006
score: 0
type: Comment
has text: `var bar = function foo(){}`... Can you explain how this "named anonymous function" syntax works?
comment on: http://stackoverflow.com/a/29001135
type: AnswerComment

http://stackoverflow.com/q/28915809
tagged with: javascript
downvote count: 0
has body: This code is supposed to share a link on LinkedIn, but for some reason it's not working - I'm not sure why. Can anyone help? &lt;!-- NOTE: be sure to set onLoad = onLinkedInLoad --&gt; &lt;script type="text/javascript"&gt; function onLinkedInLoad() { IN.Event.on(IN, "auth", function() {onLinkedInLogin();}); IN.Event.on(IN, "logout", function() {onLinkedInLogout();}); } function onLinkedInLogout() { // do nothing } function onLinkedInLogin() { IN.Event.on("shareAPI", "click", doSharingTest); } function doSharingTest() { IN.API.Raw("/people/~/shares") .method("POST") .body( JSON.stringify( { "content": { "submitted-url": "http://developer.linkedinlabs.com/jsapi-console", "title": "JSAPI Console", "description": "JSAPI Developer Console", "submitted-image-url": "http://developer.linkedin.com/servlet/JiveServlet/downloadImage/102-1101-13-1003/30-25/LinkedIn_Logo30px.png" }, "visibility": { "code": "anyone" }, "comment": "This is a test posting from the LinkedIn JSAPI Console" }) ) .result(function(r) { alert("POST OK"); }) .error(function(r) { alert("POST FAIL"); }); } I got this code from http://developer.linkedinlabs.com. I have registered my application on the LinkedIn developer network. Can anybody tell me is this right code, or do I need to modify anything?
favorite count: 0
type: UnansweredQuestion
has title: share a post on linkedin using linkedin javascript api
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: jakarta-ee

http://stackoverflow.com/comment/46112048
comment on: http://stackoverflow.com/q/28927199
has text: what do you mean filter on your list? do filter on ng-repeat? I was not familiar with that
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46134109
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28937788
has text: @BenjaminGruenbaum can't u simply do `.then( x => x.foo ).then( y => y.baz ).then( z => z.bar ); ` ? afaik its supposed to be synchronous ? Or am i missing something ?
score: 0

http://stackoverflow.com/q/29017629
favorite count: 0
tagged with: constructor
has comment: http://stackoverflow.com/comment/46279650
has answer: http://stackoverflow.com/a/29018232
type: AnsweredQuestion
tagged with: object
has body: I cannot stop running into problems with this code. I figure I'm doing something monumentally wrong, and I figure asking people who know what they're doing would be the best thing to do. The actual "problem" or assignment is to create a simple TV object. It has three characteristics. Make one. Call it. Display all the characteristics. Then it's done. I declare variables and make a constructor. As per the rules of the assignment, both of these things must remain in the header of the document. Next is the body. I want to create a new television object, called myTV, with those parameters. I create a function to recall the data back. Then I actively call the data back. Somewhere along the lines I have logic problems, possible syntax problems, and who knows what else. My mind is reeling from staring at the same code for so long, so I'm going to grab something to drink and check back here in like 15. ugh.
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46279394
has comment: http://stackoverflow.com/comment/46279502
tagged with: javascript
score: -1
has title: Basic Constructors - Entry Level Javascript
accepted answer: http://stackoverflow.com/a/29018232
linked to: http://stackoverflow.com/q/2653299
upvote count: 0
answer count: 1

http://stackoverflow.com/comment/46287616
has text: I added the html code. I'm changing it by hand with my keyboard but that is not updating the value
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29021632
type: Comment

slick.js
tag name: slick.js
tags question: http://stackoverflow.com/q/28950755
type: Tag
tags question: http://stackoverflow.com/q/29043562
tags question: http://stackoverflow.com/q/28998308

http://stackoverflow.com/comment/46317965
comment on: http://stackoverflow.com/q/29038031
score: 0
type: Comment
has text: I know It is possible to fetch the iframe HTMLElement and set its src dynamically. I was looking for minimal way to fo the same task.
type: QuestionComment

http://stackoverflow.com/comment/46193154
has text: @talemyn, thanks for the update. Updated my answer to match your comment so it's technically correct.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28970567
type: AnswerComment

http://stackoverflow.com/comment/46352612
has text: `JSON (JavaScript Object Notation) is a lightweight data-interchange format[...]` and is delivered as string or buffer. What you are talking about are normal JavaScript objects and arrays but not `JSON`.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29057658
score: 0

http://stackoverflow.com/comment/46244253
has text: hm, your fiddle works for me, too, but doesn't fix it in my website. The script even (partially) works when I take the styling off the button. I was getting the chrome double scrollbars, where for whatever reason the button was being treated like an iframe, and it _would_ scroll to the top of its messed up frame. But then, there's the issue with tablesorter not functioning either..
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28997270

http://stackoverflow.com/comment/46337256
score: 2
comment on: http://stackoverflow.com/a/29049491
type: AnswerComment
has text: @MukundKumar **why** do you "have to" remove it completely? What difference does it make?
type: Comment

http://stackoverflow.com/comment/46108190
has text: You're right, it works, but I had to declare a function for this, here is the code: `realtime.on('update', function(e) { updateFeatureIcon = function (fId) { var feature = e.features[fId], mynumber = feature.properties.mynumber; status = feature.properties.status; realtime.getLayer(fId).setIcon(new L.AwesomeNumberMarkers({ number: mynumber, markerColor: status.toLowerCase() })); }; Object.keys(e.update).forEach(updateFeatureIcon); });`
comment on: http://stackoverflow.com/a/28915384
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/28929705
type: Question
has comment: http://stackoverflow.com/comment/46115340
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46116182
tagged with: http://stackoverflow.com/tag/html
has body: Whether this drop down to the different categories. Such as supermarket, car showroom, hardware shop. I'll drop down to select from the supermarket which will be a new drop-down Visible vegetable Area, Area clothes, perfume Area. And when I do I select a new vegetable to be Visible drop down to the different vegetables. It also trains are similar. As the car company's car showroom to select drop-down to select Visible and company car model
has answer: http://stackoverflow.com/a/28929823
has comment: http://stackoverflow.com/comment/46115197
type: AnsweredQuestion
score: 0
has title: multi category drop down for multiple use in javascript
accepted answer: http://stackoverflow.com/a/28929823

http://stackoverflow.com/q/28969015
type: UnansweredQuestion
score: 8
has comment: http://stackoverflow.com/comment/46191681
tagged with: onunload
has comment: http://stackoverflow.com/comment/46190879
has comment: http://stackoverflow.com/comment/46191030
downvote count: 1
type: Question
upvote count: 9
has answer: http://stackoverflow.com/a/29899626
tagged with: javascript
has comment: http://stackoverflow.com/comment/46190752
has comment: http://stackoverflow.com/comment/46190701
has comment: http://stackoverflow.com/comment/46191395
has body: I'm talking about a styled dialog, instead of the default 'beforeunload' dialog that can't be styled. See Facebook: What is the most unobtrusive way to make this? Preferrable some script that I declare once, and magically always works. I'm think about something in the line of: function showCustomDialog() { [...] } var unfinished = true; $('a').click(function() { if ( unfinished ) { window.showCustomDialog( { originalUrl: $(this).attr('href') } ); return false; } } But I'm affraid this will break cases where i.e. a &lt;a&gt; element is used for triggering JS-behaviour, or where JavaScript triggers a window.location.href change. Is there a better, non-obtrusive way? Extra note - They also got it working for the back button. Extra note - Apparently they fall back to the default dialog when it's out of their control.
has comment: http://stackoverflow.com/comment/46191229
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/46189674
tagged with: onbeforeunload
favorite count: 0
has title: What is the most unobtrusive way to implement a custom 'beforeunload' dialog?

http://stackoverflow.com/q/28970572
tagged with: javascript
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28975786
accepted answer: http://stackoverflow.com/a/28975786
has title: How to include typescript class in node.js app?
favorite count: 0
has comment: http://stackoverflow.com/comment/46192874
tagged with: node.js
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: typescript
has body: What's the best way to include typescript class definition in node.js file? Let's say I have this code: class Car{ public Color; constructor(aColor:string){ this.Color = aColor; } } I want to be able to make an instance of a Car this way: var MyCar = new Car("green"); I know that require() will return an object, but I dont need an object I only need to know the definition of a Car. What's the best way to do this?

http://stackoverflow.com/comment/46355573
type: QuestionComment
score: 0
has text: @hamed already Done ^^ dfsq Yes
comment on: http://stackoverflow.com/q/29059546
type: Comment

http://stackoverflow.com/q/29034208
has answer: http://stackoverflow.com/a/29035002
tagged with: ruby-on-rails
type: Question
type: AnsweredQuestion
has body: I am following section 4 (Server Side Concerns) to set up ajax on a page. I've copied the tutorial text completely (replacing the model names with my own) and it creates and saves my "Participants" record and refreshes the partial....but it posts this weird code below the just submitted form: $(" \n\n Helper:sampleemail@sample.com \n<\/li>\n\n").appendTo("#participants"); This seems to be some sort of weird mash-up of my partial information and my creat.js. It's not really an error...just extra code. Here's my code class ParticipantsController < ApplicationController def new @participant = Participant.new @participants = @participants.recently_updated end def create @participant = Participant.new(participant_params) respond_to do |format| if @participant.save format.html { redirect_to @participant, notice: 'Helper Invited!' } format.js {} format.json { render json: @participant, status: :created, location: @participant } else format.html { render action: "new" } format.json { render json: @participant.errors, status: :unprocessable_entity } end end end _form.html.erb <%= render @participants %> <%= form_for(@participant, remote: true) do |f| %> <%= f.label :email %> <%= f.email_field :email %> <%= f.submit 'SUBMIT' %> _participant.html.erb <%= participant.email %> <%= link_to participant, remote: true, method: :delete, data: { confirm: 'Are you sure?' } do %>REMOVE<% end %> create.js.erb $("<%= escape_javascript(render @participant) %>").appendTo("#participants"); destroy.js.erb $('#participants').html("<%= j (render @participants) %>");
has title: Extra Javascript code posting under Form after Ajax Rails form submit ( \n\n...etc)
accepted answer: http://stackoverflow.com/a/29035002
tagged with: ruby-on-rails-4
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0

http://stackoverflow.com/comment/49791362
type: Comment
comment on: http://stackoverflow.com/a/30846128
type: AnswerComment
has text: @MikeHarrison I've updated my code hope it meets your exception.
score: 0

http://stackoverflow.com/q/29054506
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: string
has title: Regex: Exclude capturing a pattern which may or may not be present
favorite count: 0
has answer: http://stackoverflow.com/a/29054576
has comment: http://stackoverflow.com/comment/46347010
tagged with: regex
has body: I have a few variations of similar strings: #This is a string #This is another string (with some info in parentheses) I want to run them all through a Regex and capture "#This" in the first capture group, and "a string" or "another string" in the second capture group. Notice in the second string I don't want the parentheses' or its content. I've tried a bunch or Regexes that give the following outputs /#(.*) is (.*)/: simplest regex, but doesn't exclude the parentheses and its contents String1 Match1: This String1 Match2: a string String2 Match1: This String2 Match2: another string (with some info in parentheses) /#(.*) is (.*)\(/ adding an opening parentheses works only for string that actually has it String1 Match1: null String1 Match2: null String2 Match1: This String2 Match2: another string /#(.*) is (.*)\(*/ making it optional with a * (this is incorrect I guess) String1 Match1: This String1 Match2: a string String2 Match1: This String2 Match2: another string (with some info in parentheses) /#(.*) is (.*)\(?/ making it optional with a ? (same result) String1 Match1: This String1 Match2: a string String2 Match1: This String2 Match2: another string (with some info in parentheses) /#(.*) is (.*?)\(*/ making it non-greedy String1 Match1: This String1 Match2: null String2 Match1: This String2 Match2: null var string1 = "#This is a string"; var string2 = "#This is another string (with some info in parentheses)"; // var regex = /#(.*) is (.*)/; // var regex = /#(.*) is (.*)\(/; // var regex = /#(.*) is (.*)\(*/; var regex = /#(.*) is (.*)\(?/; // var regex = /#(.*) is (.*?)\(*/; var match1 = string1.match(regex); var match2 = string2.match(regex); alert('String1 Match1: \t' + ((match1&amp;&amp;match1[1])?match1[1]:'null') + '\nString1 Match2: \t' + ((match1&amp;&amp;match1[2])?match1[2]:'null') + '\nString2 Match1: \t' + ((match2&amp;&amp;match2[1])?match2[1]:'null') + '\nString2 Match2: \t' + ((match2&amp;&amp;match2[2])?match2[2]:'null') );
score: 2
upvote count: 2
accepted answer: http://stackoverflow.com/a/29054576
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/46133279
score: 0
type: Comment
has text: yes i am looking for the similar code but only for 1 checkbox and this code is not working in my case :(
type: AnswerComment
comment on: http://stackoverflow.com/a/28937601

http://stackoverflow.com/comment/46558245
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29055625
has text: Hello @guest271314, just need a way to make this script more flexible, the actual values of the json are changing from time to time and can't always target/filter '/Americas|APJ|Asia/' values.

http://stackoverflow.com/comment/46174950
type: QuestionComment
comment on: http://stackoverflow.com/q/28960827
type: Comment
score: 1
has text: No, they are not sent.

http://stackoverflow.com/q/29002143
answer count: 1
accepted answer: http://stackoverflow.com/a/29002183
tagged with: javascript
has body: So Im having trouble with my form. There are numurous validation techniques set up. Two of my most obvious problems are an alert that pops upen at the start of the program but should only pop up if an onblur() is activated and my update() function returns a false value. And aswell, my regular Expressions insist on providing me with false condition when I test them against my strings. The finished form should validate various information and update values placed in the expenses inputs. Really stuck on this... window.onload = initPage; /*initPage() Initializes the contents of the Web page */ function initPage() { //declare array variable dataFields points to input elements from the expenseEntry class var dataFields = new Array(); var allElems = document.getElementsByTagName("*"); for( var i = 0; i < allElems.length; i ++) { if(allElems[i].className == "expenseEntry") dataFields.push(allElems[i]); } //add onblur event that runs update() function whenever focus leaves a datafield. for(var i = 0; i < dataFields.length; i++) { dataFields[i].onblur = update(); } //event handler that runs validateForm() upon submitting the form. document.forms[0].onsubmit = validateForm; } /* testLength() Tests a field for its length. */ function testLength(field) { if (field.value.length == 0) { // Change the background color to white or yellow depending on the lenght. field.style.backgroundColor = "yellow"; return false; } else field.style.backgroundColor = "white"; return true; } /* testPattern() Tests a field for its pattern. */ function testPattern(field, regx) { if (regx.test(field)) { field.style.backgroundColor = "white"; field.style.color = "black"; return true; } else field.style.backgroundColor = "yellow"; field.style.color = "red"; return false; } /* validateForm() Validates a Web form */ function validateForm() { var isValid = true; //testLength function with lname field also for fname, address, and summary to make sure an entry has been made. if (testLength(document.forms[0].l…
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29002183
type: Question
tagged with: regex
has title: Regular Expression not working - Online form validation and submission
score: 0
tagged with: forms

http://stackoverflow.com/comment/46298090
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/29028192
has text: Saying something didn't work isn't helpful. What precisely did you expect? What precisely happened?
type: Comment

http://stackoverflow.com/comment/46286559
type: AnswerComment
comment on: http://stackoverflow.com/a/29021601
type: Comment
has text: I did understand what you said, but I don't know how to execute it, so I'll be doing this: instead of putting `$('img').attr('src','img/image.jpg');` inside I'll put a variable with it so I can change the value of the variable, thanks anyway for replying!
score: 1

http://stackoverflow.com/comment/46089528
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28915695
type: QuestionComment
has text: More smaller request will get you your core data faster. But altogether, you will have more overhead and probably more loading time.

http://stackoverflow.com/q/28914239
has comment: http://stackoverflow.com/comment/46086883
type: Question
tagged with: html-table
has comment: http://stackoverflow.com/comment/46086565
has answer: http://stackoverflow.com/a/28914274
has comment: http://stackoverflow.com/comment/46086608
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28914276
has comment: http://stackoverflow.com/comment/46086577
has comment: http://stackoverflow.com/comment/46086614
has answer: http://stackoverflow.com/a/28914276
score: 0
answer count: 3
has body: I have an external Javascript and I want to enable a button when the table is not empty. But I cannot seem to make it work. This is my code: $(function(){ var rowCount = $('#uploadsTable tbody tr').length; if(rowCount != 0){ document.getElementById("finalizeButton").disabled = false; } });
has answer: http://stackoverflow.com/a/28914344
has comment: http://stackoverflow.com/comment/46086636
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28914274
has title: JavaScript disable button when table is empty

http://stackoverflow.com/comment/46293671
comment on: http://stackoverflow.com/q/29025662
has text: Well programming part math too right?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46258071
type: AnswerComment
comment on: http://stackoverflow.com/a/29001323
score: 0
type: Comment
has text: If i remove it newly added angularjs ng-required directive wont work. I need to add need to add directives dynamically. see http://jsbin.com/wubomoruli/1/edit that it wont work.

http://stackoverflow.com/q/28985573
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46220425
downvote count: 0
score: 1
has title: Firefox SDK context menu. Add item that reacts according to type of selection or node clicked
type: Question
has comment: http://stackoverflow.com/comment/46220405
has comment: http://stackoverflow.com/comment/46237798
tagged with: javascript
has comment: http://stackoverflow.com/comment/46220677
tagged with: firefox-addon
upvote count: 1
has body: I'm trying to build a Firefox plug-in that adds to FF context menu a item that reacts defferently according to what the user has right clicked on: First behaviour = the user selects some text and right-clicks on it Second behaviour = the user right-clicks on and image Third behaviour = the user right-clicks on a link As soon as the user right-clicks an element the plugin launches an external EXE with as parameter a string with the selected text of with the link (link or link to image). Up to now I managed to work it out by my self BUT the issue I'm having is that now I have two separate working plug-ins. I don't know how to tell javascript that "if you detected a selected text do this", "if you detected a image or a link do that". I mean, I don't know how to put the two snippets together! Plug-in #1: TEXT SELECTION: var {Cc,Ci} = require("chrome"); var contextMenu = require('sdk/context-menu'); var selection = require('sdk/selection'); var menuItem = contextMenu.Item({ label: "send selected text to...", context: contextMenu.SelectionContext(), contentScript: 'self.on("click", function() {' + 'var text = window.getSelection().toString();' + 'self.postMessage(text);' + '});', onMessage: function(args) { var args = [selection.text]; var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); file.initWithPath("c:\\cmdline.exe"); var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); process.init(file); process.run(false, args, args.length); } }); Plug-in #2: LINK and IMAGE: var {Cc,Ci} = require("chrome"); var cm = require("sdk/context-menu"); cm.Item({ label: "send link/image to...", context: cm.SelectorContext("a[href], img"), contentScript: 'self.on("click", function (node, data) {' + ' self.postMessage(node.src);' + '});', onMessage: function(imgsrc) { var args = [imgsrc]; var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); file.initWithPath("c:\\cmdline.exe"); var process = Cc["@mozilla.org/process/ut…
tagged with: firefox-addon-sdk
favorite count: 0

http://stackoverflow.com/comment/46336581
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29049001
type: Comment
has text: Can you paste your JS code?

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

http://stackoverflow.com/comment/46164508
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28955475
has text: Thanks. And may I say nicely done on using a closure.
score: 0

http://stackoverflow.com/a/29047305
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29047289
upvote count: 2
answers question: http://stackoverflow.com/q/29047289
type: AcceptedAnswer
has body: Instead of reading table cell innerHTML you can find inner input element and then read its value property: var quantity = Number(row.cells[2].querySelector('input').value); Here row.cells[2] is a td element. Using querySelector('input') you can find the first children input. Also note, that since the value of the field is a string, you might want to cast it to number, for example with Number function.
type: Answer

http://stackoverflow.com/a/28945650
accepted answer of: http://stackoverflow.com/q/28945048
answers question: http://stackoverflow.com/q/28945048
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/46147397
type: Answer
has body: Hello World! Link Home Button Continue Load html into web view: // html path NSString *htmlPath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]; // html data NSData *htmlData = [NSData dataWithContentsOfFile:htmlPath]; // load html in webview [self.mainWebView loadData:htmlData MIMEType:@"text/html" textEncodingName:@"utf-8" baseURL:nil]; In Delegate method: - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if (navigationType == UIWebViewNavigationTypeFormSubmitted) { NSString *destination = [request.URL lastPathComponent]; if ([destination isEqualToString:@"home"]) { NSLog(@"go to home"); //[self performSegueWithIdentifier:@"homePage" sender:self]; return NO; } } else if (navigationType == UIWebViewNavigationTypeLinkClicked) { // todo } return YES; } Hope it helps.

http://stackoverflow.com/q/28927508
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/46112958
has comment: http://stackoverflow.com/comment/46124998
has comment: http://stackoverflow.com/comment/46111248
has comment: http://stackoverflow.com/comment/46111469
answer count: 0
score: 1
has title: External server html using javascript and php
has body: I am unable to write external HTML using JavaScript. Can anyone help me using php and JavaScript like this way. in this i want to put HTML from another server. var a = "SRC='http://demoserver.com/read_files.php?f1=headermenu.html"; document.write (" "); document.write("</scr"+"ipt>"); here is my php code on my server <?php $url = 'http://demoserver.com/headermenu.html'; $htm = file_get_contents($url); echo $htm; ?> and html code is Menu1 Menu2 Menu3 Menu4
has comment: http://stackoverflow.com/comment/46111301
type: Question
has comment: http://stackoverflow.com/comment/46111399
tagged with: javascript
linked to: http://stackoverflow.com/q/2067472
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/46111364
favorite count: 0

http://stackoverflow.com/comment/46211426
has text: Ok, now it returns `[1,5]`
score: 0
comment on: http://stackoverflow.com/a/28980596
type: AnswerComment
type: Comment

webforms
tags question: http://stackoverflow.com/q/28972707
tags question: http://stackoverflow.com/q/28991986
tags question: http://stackoverflow.com/q/29006724
tags question: http://stackoverflow.com/q/28971382
tags question: http://stackoverflow.com/q/28966529
type: Tag
tag name: webforms
tags question: http://stackoverflow.com/q/28981825

http://stackoverflow.com/comment/81546186
score: 1
type: AnswerComment
type: Comment
has text: @RedSparr0w Thank you for pointing that out. I've modified the example to something that works, while not quite as succinct.
comment on: http://stackoverflow.com/a/28961865

http://stackoverflow.com/a/29052554
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29052013
downvote count: 0
has body: In order to listen for an event on an element that has been dynamically added to the DOM, you have to use a event delegate and not a directly bound event handler. As mentioned in the jQuery api documentation for .on, "Event handlers are bound only to the currently selected elements; they must exist at the time your code makes the call to .on()". http://api.jquery.com/on/ This is true for .change and other direct bound event types. So this: $("#chkoffre").change(function () { Must be changed to this: $("#select_prix").on("change", "#chkoffre", function () { Here's a fiddle that demonstrates this fix when applied to your code: https://jsfiddle.net/uuvcyf9o/ Here's the full code: $('#prix').on('change', function() { if ($(this).val() < 2) { $("#select_prix").empty(); } var stroffre =' Offre ? '; stroffre +=' '; stroffre +=' '; stroffre +=' '; stroffre +='Autoriser les offres'; stroffre +=' '; if ($(this).val() == 2) { $("#select_prix").append(stroffre); } }); $("#select_prix").on("change", "#chkoffre", function () { alert( 'CheckboxOffre' ); // or $(this).val() if($(this).is(":checked")) { }else{ } });
type: Answer

http://stackoverflow.com/q/28960458
tagged with: chart.js
score: 1
has comment: http://stackoverflow.com/comment/46173396
type: Question
has answer: http://stackoverflow.com/a/28960576
tagged with: arrays
downvote count: 0
answer count: 1
has body: I am working on Angular and i use Chart.js, to prepare my data for the chart, I rank them in a table template formated like this : my_table[2014] [[01] = {array},[02] = {array},...,[12] = {array}] my_table[2015] [[01] = {array},[02] = {array},[03] = {array}] when i log this table with a console.log, the table is good , but when i do my populate code the order of my index changes automatically : for(year in my_table){ for(month in my_table[year]){ labels_list.push(month+'/'+year); total_nb_order.push(my_table[year][month]["nb_orders"]); total_data.push(my_table[year][month]["amount_ttc"]); vegetal_data.push(my_table[year][month]["amount_ttc_vgt"]); manufacture_data.push(my_table[year][month]["amount_ttc_manu"]); } } my chart is good but not in the right chronological order ... indexes out in this order : [10],[11],[12],[01],[02],[03],... any idea to help me ? :p
tagged with: javascript
tagged with: sorting
accepted answer: http://stackoverflow.com/a/28960576
favorite count: 0
tagged with: angularjs
upvote count: 1
has title: Javascript: problems with the order of my index
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46173438

http://stackoverflow.com/q/28994900
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28995145
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28995145
has title: Updating data in a simple reusable D3 chart
type: AnsweredQuestion
type: Question
has body: In the book "Data Visualization with D3 Cookbook" (chapter 8) appears an example where the author plots two lines. Basically, the data is created randomly: var numberOfSeries = 2, numberOfDataPoint = 11, data = []; for (var i = 0; i &lt; numberOfSeries; ++i) data.push(d3.range(numberOfDataPoint).map(function (i) { return {x: i, y: randomData()}; })); Then, the author creates an instance of the chart and defines the scales' domain: var chart = lineChart() .x(d3.scale.linear().domain([0, 10])) .y(d3.scale.linear().domain([0, 10])); After that, the data is introduced using the addSeries() method: data.forEach(function (series) { chart.addSeries(series); }); And finally, the chart is rendered calling the render() method: chart.render(); Additionally, the plot has an Update buttom that allows to update the data showed by calling this function: function update() { for (var i = 0; i &lt; data.length; ++i) { var series = data[i]; series.length = 0; for (var j = 0; j &lt; numberOfDataPoint; ++j) series.push({x: j, y: randomData()}); } chart.render(); } My problem is that I can't understand how the data is updated in the plot without calling the addSeries() method again, after press the Update button, i.e., in the update() function. The data internally is stored in the variable _data, which can be modified with the method addSeries(). Any ideas? Many thanks! The complete code is here, but following I've copied the most important parts: function lineChart() { // &lt;-1A var _chart = {}; var _width = 600, _height = 300, // &lt;-1B _margins = {top: 30, left: 30, right: 30, bottom: 30}, _x, _y, _data = [], _colors = d3.scale.category10(), _svg, _bodyG, _line; _chart.render = function () { // &lt;-2A if (!_svg) { _svg = d3.select("body").append("svg") // &lt;-2B .attr("height", _height) .attr("width", _width); renderAxes(_svg); defineBodyClip(_svg); } renderBody(_svg); }; // Axis rendering functions ... function renderBody(svg) { // &lt;-2D if (!_bodyG) _bodyG = svg.append("g") .a…
tagged with: d3.js

http://stackoverflow.com/a/29012366
has comment: http://stackoverflow.com/comment/46269762
accepted answer of: http://stackoverflow.com/q/29012207
has body: Please, try the below var id = parseInt($("[id$='ddl1']").val(), 10); To handle the NaN situation, you need to evaluate that too if(id != id || id &lt; 0) and you should have value of element 'Please select an answer' as a blank.
has comment: http://stackoverflow.com/comment/46270090
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/46270413
upvote count: 2
has comment: http://stackoverflow.com/comment/46270506
answers question: http://stackoverflow.com/q/29012207

http://stackoverflow.com/comment/46327080
score: 0
type: Comment
has text: `window.onload=BlockOne=BlockTwo=BlockThree;` <-- does not do what you think it does.
type: QuestionComment
comment on: http://stackoverflow.com/q/29043529

http://stackoverflow.com/a/29022621
has comment: http://stackoverflow.com/comment/46307280
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/29018622
accepted answer of: http://stackoverflow.com/q/29018622
has body: Usually disabling Visual Studio browserlink resolves that problem - Here's a link showing how to disable it http://www.poconosystems.com/software-development/how-to-disable-browser-link-in-visual-studio-2013/

http://stackoverflow.com/comment/46230499
comment on: http://stackoverflow.com/q/28989974
score: 0
type: Comment
type: QuestionComment
has text: I wonder if a foreach would be possible...

http://stackoverflow.com/comment/46133146
type: Comment
type: QuestionComment
has text: you can look at you'r own previous questions, in case you wanted to link to it, and make it easier for everyone.. [http://stackoverflow.com/questions/28897149/how-to-print-web-page-with-a-different-stylesheet-other-than-print-css]
score: 0
comment on: http://stackoverflow.com/q/28938933

http://stackoverflow.com/comment/46381375
score: 1
comment on: http://stackoverflow.com/a/29034850
type: AnswerComment
has text: [Check this plunkr](http://plnkr.co/edit/lVkfC5jI4YMtyXd5yN1d?p=preview). Use `ng-if` than `ng-switch`. I have removed the first solution which had the drawback with trs getting repeated and updated the answer with new plunkr.
type: Comment

http://stackoverflow.com/comment/46298915
type: AnswerComment
comment on: http://stackoverflow.com/a/29014590
type: Comment
has text: `index.php?PAGE=specials`is what you write in the HTML? does it have to be converted to a PHP page? I'm familiar with the concept of PHP but never actually used it. thanks!
score: 0

http://stackoverflow.com/a/29026423
has body: $(".class").mouseover(function(){ $(this).attr('checked',true); }); });
downvote count: 0
answers question: http://stackoverflow.com/q/28929822
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/28934273
answers question: http://stackoverflow.com/q/28933981
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46124400
has comment: http://stackoverflow.com/comment/46124374
has comment: http://stackoverflow.com/comment/46124324
type: Answer
has body: function requestDispatcher() { //default version was set to v1 var defaultVersion = 'v1', re = /\/v\d/; return function(request, response, next) { var version = request.get('version'); debug(request.url); // test if request.url has already contained version number if (!re.test(request.url)) { // if not define version number in http header then set default version // otherwise use the version number in the http header if (version === null || version === undefined) { request.url = ['/', defaultVersion, request.url].join(''); } else { request.url = ['/', version, request.url].join(''); } } debug(request.url); next(); }; } I use this trick to dispatch the request to specified version, and route to default version if not specified. this work for me app.use(requestDispatcher()); app.use('/v1', require('./v1')); app.use('/v2', require('./v2'));
has comment: http://stackoverflow.com/comment/46124404
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46124364
accepted answer of: http://stackoverflow.com/q/28933981

http://stackoverflow.com/comment/46080477
type: Comment
has text: So I went through the trouble of trying to replicate your scenario. However, you haven't provided enough information to do so accurately. The biggest problem is that the slider settings you are using do not create the same type of sliders in the images you provided.
comment on: http://stackoverflow.com/q/28910297
score: 0
type: QuestionComment

http://stackoverflow.com/comment/107645740
has text: Being a _prettier_ fan, love this solution. Thanks!
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/59147511

http://stackoverflow.com/comment/46231918
type: Comment
has text: No, it's a simple HTML 5 page with informations copied from a lot of magazines
score: 0
comment on: http://stackoverflow.com/q/28991756
type: QuestionComment

http://stackoverflow.com/a/29006171
score: 2
has comment: http://stackoverflow.com/comment/46261429
has comment: http://stackoverflow.com/comment/46261642
upvote count: 2
has comment: http://stackoverflow.com/comment/46261528
accepted answer of: http://stackoverflow.com/q/29005909
has comment: http://stackoverflow.com/comment/46261307
answers question: http://stackoverflow.com/q/29005909
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46258380
has body: If you are only using Chrome (or Firefox, Opera, or Safari), then you can use XPath to perform this selection: var found = xmlDoc.evaluate("/*/item[KlasId = '101010']", xmlDoc); This will return a node iterator that you can use to iterate through the nodes as described here. function getNodes(iterator) { var nodes = [], next = iterator.iterateNext(); while (next) { nodes.push(next); next = iterator.iterateNext(); } return nodes; } getNodes(found).forEach(function (node) { node.parentNode.removeChild(node); }); var xmlDoc = $.parseXML(" 101010 101010 202020 "); var found = xmlDoc.evaluate("//item[KlasId = '101010']", xmlDoc); function getNodes(iterator) { var nodes = [], next = iterator.iterateNext(); while (next) { nodes.push(next); next = iterator.iterateNext(); } return nodes; } getNodes(found).forEach(function (node) { console.log('Removing node.'); node.parentNode.removeChild(node); }); Internet Explorer does not support .evaluate() (or any XPath functionality as far as I can tell), so if you need cross-browser support, I think you'll need to use a third party library. I recommend xpath.js, on which I am a contributor. One more option is to use jQuery's extended CSS selectors to perform the selection: var $nodes = $(xmlDoc).find('item > KlasId:contains("101010")'); $nodes.remove(); var xmlDoc = $.parseXML(" 101010 101010 202020 "); var $nodes = $(xmlDoc).find('item > KlasId:contains("101010")'); console.log($nodes.length); $nodes.remove(); This is also a cross-browser solution, but it will select the elements based on a contains comparison rather than an equality comparison. Unrelated side note: .map() is intended for projecting one array onto another. To just carry out a series of side effects, use .forEach().
type: Answer

http://stackoverflow.com/comment/46107345
comment on: http://stackoverflow.com/q/28924867
type: Comment
has text: @ArturFilipiak please see `EDIT 2` which has clear code.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/46218856
comment on: http://stackoverflow.com/a/28985071
type: AnswerComment
has text: Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline.
type: Comment
score: 1

http://stackoverflow.com/a/29017323
has body: elements is an "array-like" object so you shouldn't access .value from it. Instead, you can take one of its referenced elements and use that elements[0].value.
answers question: http://stackoverflow.com/q/29017213
type: Answer
score: 0

apache
tag name: apache
tags question: http://stackoverflow.com/q/28994764
tags question: http://stackoverflow.com/q/28993791
tags question: http://stackoverflow.com/q/29056394
tags question: http://stackoverflow.com/q/28942583
type: Tag

highcharts
tags question: http://stackoverflow.com/q/29032190
tags question: http://stackoverflow.com/q/28957500
tags question: http://stackoverflow.com/q/28970913
tags question: http://stackoverflow.com/q/29025789
tags question: http://stackoverflow.com/q/29020232
tags question: http://stackoverflow.com/q/28940573
tags question: http://stackoverflow.com/q/29033316
tags question: http://stackoverflow.com/q/28936943
tags question: http://stackoverflow.com/q/28944412
tags question: http://stackoverflow.com/q/28989321
tags question: http://stackoverflow.com/q/28918567
tags question: http://stackoverflow.com/q/28956891
tags question: http://stackoverflow.com/q/28991644
tags question: http://stackoverflow.com/q/28927741
tags question: http://stackoverflow.com/q/28988608
tags question: http://stackoverflow.com/q/29026465
tags question: http://stackoverflow.com/q/28992591
tags question: http://stackoverflow.com/q/28941225
tags question: http://stackoverflow.com/q/29002451
tags question: http://stackoverflow.com/q/28916944
tags question: http://stackoverflow.com/q/28939828
tags question: http://stackoverflow.com/q/28933713
tags question: http://stackoverflow.com/q/28957162
tags question: http://stackoverflow.com/q/29029641
tags question: http://stackoverflow.com/q/28959612
tags question: http://stackoverflow.com/q/29012733
tags question: http://stackoverflow.com/q/28917387
tags question: http://stackoverflow.com/q/29015883
tags question: http://stackoverflow.com/q/29032353
tags question: http://stackoverflow.com/q/29014494
tags question: http://stackoverflow.com/q/28969365
tags question: http://stackoverflow.com/q/28966364
tags question: http://stackoverflow.com/q/29059966
type: Tag
tags question: http://stackoverflow.com/q/28986037
tag name: highcharts

concatenation
tags question: http://stackoverflow.com/q/29032704
type: Tag
tag name: concatenation
tags question: http://stackoverflow.com/q/29000572

http://stackoverflow.com/a/28965185
answers question: http://stackoverflow.com/q/28964904
downvote count: 0
has body: You can do something like this: $('div').on('click',function(){ $(this).find('input:not([type=button])').prop('checked',true); }); DEMO
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46182136

http://stackoverflow.com/comment/46242764
has text: I was told to use click, I was originally using ng-click, should I switch back?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28997254

http://stackoverflow.com/comment/46083268
comment on: http://stackoverflow.com/a/28911831
has text: Using the .on() method is preferred to listen for the load event. The code on your page is now jQuery(window).load(function() { ... }) which again is deprecated. If it still persist when using .on(), the issue must lie somewhere else than window onload.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28994317
has comment: http://stackoverflow.com/comment/46236872
tagged with: ajax
has comment: http://stackoverflow.com/comment/46237361
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
has title: How could I send data to an HTML file while loading that page with jQuery but without PHP?
has comment: http://stackoverflow.com/comment/46237052
has body: I need to do this for a university assignment. I can only use jQuery and JavaScript. My professor has given us an API for interacting with the database, so that means we have a directory containing a lot of .php scripts we can call from the jQuery and JavaScript. Basically I have an Accounts.html page which will display user information based on the clicked list item in another page called Projects.html which contains an ul with one li for each user. I have everything ready to go up to this point, but I don't understand how I could possibly send data to a .html page then load it from a script within that page without making it a .php page (meaning I'd be able to use POST data). I suppose I could possibly use GET data, but I'd much rather use POST. Or can you use POST with .html pages? Please share your thoughts as to which solution would be best. Thank you!
type: Question
has answer: http://stackoverflow.com/a/28994514
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/46436917
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28964363
has text: It looks like ultimately you want Harp to do some concatenating and minifing for you. I found this [Feature Request on GitHub](https://github.com/sintaxi/harp/issues/127) for similar functionality.

http://stackoverflow.com/a/28922103
accepted answer of: http://stackoverflow.com/q/28922057
answers question: http://stackoverflow.com/q/28922057
has comment: http://stackoverflow.com/comment/46101335
upvote count: 22
has body: Your 2-D array accesses are incorrect, but the main problem is that you're re-using the variable i in an inner loop: for (i = 0; i &lt; strLength; i++){ page = page.concat(spanishTerms[i] + '&lt;br&gt;'); } That i will be the same i as in your outer loop. Thus, the error you're getting is telling you that you're building up a massive string that exceeds the capacity of the runtime system. Declare a new variable for that loop. Accessing a value from an array of arrays requires two sets of [ ]: entry[j][0]
has comment: http://stackoverflow.com/comment/46101321
has comment: http://stackoverflow.com/comment/46101310
score: 21
has comment: http://stackoverflow.com/comment/46101357
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46101383
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/46101359

http://stackoverflow.com/comment/46237979
type: QuestionComment
has text: @JammehCarr that is probably too much. Try to isolate the problem and post an [mcve](http://stackoverflow.com/help/mcve)
score: 0
comment on: http://stackoverflow.com/q/28994842
type: Comment

http://stackoverflow.com/a/29007859
has body: check updated code here on fiddle update in function function myFunction() { $("#demo").addClass("yyy").removeClass("xxx"); $("#demo img").attr('src','http://image.ohozaa.com/i/c70/cLBh71.png'); }
type: Answer
answers question: http://stackoverflow.com/q/29007788
score: 0

model
tags question: http://stackoverflow.com/q/29031394
tag name: model
type: Tag
tags question: http://stackoverflow.com/q/29032878
tags question: http://stackoverflow.com/q/29018057

http://stackoverflow.com/comment/46172219
has text: it's in Javascript: starting from var myarray = []; I try to do console.log(myarray) I get [field1: "content1", field2: "content2"] then I try console.log(JSON.stringify(myarray)); and I get []
comment on: http://stackoverflow.com/q/28959614
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46206426
comment on: http://stackoverflow.com/q/28977701
has text: ok, changed that, but it' still not working, I will update the code here too
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/29011715
score: 3
upvote count: 3
type: Answer
has body: Javascript's bitwise operations work essentially the same way as they do in C: var bits13to16 = (number &gt;&gt; 13) &amp; 15; This shifts the number 13 bits to the right (eliminating bits 0-12) and masks all but the last 4 remaining bits (which used to be bits 13-16). 15 = 2^4 - 1.
downvote count: 0
answers question: http://stackoverflow.com/q/29011233

http://stackoverflow.com/comment/46106577
type: Comment
comment on: http://stackoverflow.com/a/28911947
type: AnswerComment
has text: still does't make sense to me , can you edit the answer to show me the difference between, `var doAnimate = $.support.transition || animate;` and `var doAnimate = $.support.transition && animate;` , I'll accept your answer , if you do so . thanks .
score: 0

http://stackoverflow.com/comment/46163899
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28955159
has text: can u explain in a single statement
score: 0

http://stackoverflow.com/comment/46146177
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28945975
has text: Have you specified a base href in your index file? ``` ```

http://stackoverflow.com/q/29015105
has body: I am trying to call a web api method and return this data to a kendo grid and display this data in my grid. The model that is returned from my web api method has navigation properties that have other objects, and I am just trying to display these navigation elements in my grid using a kendo template. However, I am having problems with it not being able to detect that the navigation property exists, even though I can see it when I debug. //schema for my kendo data source schema: { data: function (data) { //specify the array that contains the data console.log("This object has a FREQ_POOL object, and it contains data"); console.log(data); var tmp = [{ FREQ_POOL: { IsAM: 'Jane', last: 'Doe' } }, { FREQ_POOL: { IsAM: "John", last: 'Doe' } }]; console.log("This object has the same structure and is manually created, and it works if I return it from her in my grid); console.log(tmp); //return tmp; THIS WORKS return data; This throws the error FREQ_POOL is undefined }, } ...................................................... $("#FAAFreqGrid").kendoGrid({ dataSource: FAADS, columns: [ { field: "FREQ_POOL", template: "&lt;strong&gt;#: FREQ_POOL.IsAM# &lt;/strong&gt;", title: "FAATEST", format: "{0:c}", width: "120px" }, { command: ["edit", "destroy"], title: "&amp;nbsp;", width: "250px" } ], toolbar: ["create"], editable: "inline", pageable: true }); When I look at the objects both console.logs return, they look identical in structure. Both have a FREQ_POOL with an IsAM set. But if I return "data" instead of "tmp", I get the error `"Uncaught ReferenceError: FREQ_POOL is not defined"`. So for some reason even though both objects look identical, FREQ_POOL is not being detected in "data", but is in "tmp"
downvote count: 0
tagged with: javascript
tagged with: kendo-ui
has comment: http://stackoverflow.com/comment/46276418
has comment: http://stackoverflow.com/comment/46275564
tagged with: asp.net-web-api
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
has title: Kendo Grid - Child Navigation Binding Issues
upvote count: 1
type: Question
tagged with: kendo-grid

http://stackoverflow.com/a/29007800
has comment: http://stackoverflow.com/comment/46261533
accepted answer of: http://stackoverflow.com/q/29007584
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/29007584
has body: Change Save changes to Save changes and add in a click function in your JS script $( "#btnSubmitModal" ).click(function() { var field1value = $( "#field1" ).val() alert( "Modal submitted with text: " + field1value); });
downvote count: 0
score: 4
type: AcceptedAnswer

http://stackoverflow.com/comment/46162578
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28953085
has text: Sorry mate, I thought it was going but it isn't quite. I have no clue why, but if I run the first one and then the second it works, but not if I try them together
score: 0

http://stackoverflow.com/a/29002625
answers question: http://stackoverflow.com/q/29002530
score: 1
upvote count: 1
has body: Inside your function "display", event.target will give you a reference to whatever the user clicked: function display(test) { alert(event.target.outerHTML); } https://jsfiddle.net/y2y1w24L/2/ You should be able to use that to display the appropriate popup.
downvote count: 0
type: Answer

http://stackoverflow.com/q/28968097
tagged with: javascript
type: UnansweredQuestion
type: Question
has title: SharePoint: Order list by date
score: 0
has answer: http://stackoverflow.com/a/28969362
has body: New to SharePoint. I would like to retrieve items from a "Page" in reverse date order. This the code I am using to obtain the details from the pages. It is currently populating the list by page order created but would like to have it sort the list by listing the most recently added item to the top of the list. var listTitle = "Pages"; function getEvents() { var clientContext = new SP.ClientContext('https://int-canada.wrberkley.com/resources'); //alert("1"); var oList = clientContext.get_web().get_lists().getByTitle(listTitle); var camlQuery = new SP.CamlQuery() camlQuery.set_viewXml(" "); namedListItem = oList.getItems(camlQuery); clientContext.load(namedListItem); clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed)); } function onQuerySucceeded(sender, args) { var count = 0; var count = namedListItem.get_count(); if (count < 1) {} else { var ctrl = document.getElementById("Company Resources"); var listItemTR = " {1} {3} {4} "; var listItemInfo = ""; var listItemEnumerator = namedListItem.getEnumerator(); var CT = 0; while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); var newsTitle = oListItem.get_item('Title'); if (newsTitle != 'Home') //Do not include "default.aspx" { var newsComment = oListItem.get_item('Comments'); var newsImageURL = oListItem.get_item('PublishingRollupImage'); var newsFileRef = oListItem.get_item('FileRef'); var strResult = listItemTR; strResult = strResult.replace("{1}", newsImageURL); strResult = strResult.replace("{2}", newsFileRef); strResult = strResult.replace("{3}", newsTitle); strResult = strResult.replace("{4}", newsComment); listItemInfo += strResult; } CT +=1; if (CT > 1){ break;} } ctrl.parentNode.innerHTML = " " + listItemInfo + " "; } } function onQueryFailed(sender, args) { alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace()); }
answer count: 1
tagged with: sharepoint-2013

http://stackoverflow.com/q/29062005
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29062025
score: 3
upvote count: 3
type: Question
has body: I need the total price from ( the base value + logo value + material value ) I had tried this code mycode condition 1) if select the logo type and material type i need to get the total value. 2) if i selected both the value, now am changing the logo value i need to get the correct total 3) total to be displayed after selecting each option dynamical 4) no submit button to be used. HTML base price :1000 Logo Type : -- Default logo Imported logo Text None Material : -- Nylon Sticker Printed Embroiding None Total Value : JS jQuery(document).ready(function(){ var baseValue = 1000; jQuery('#logotypeprice').change(function(){ var logotypeprice = jQuery(this).val(); jQuery('input.logoTypeVal').val(logotypeprice); }); jQuery('#materialprice').change(function(){ var materialprice = jQuery(this).val(); jQuery('input.materialVal').val(materialprice); var baseprice = "<?php echo $basePrice ?>"; var logoval = logotypeprice; var totalprice = parseInt(baseValue) + parseInt(materialprice) + parseInt(logoval); alert(totalprice); jQuery('input.totalVal').val(totalprice); }); });
tagged with: javascript
has title: change event in jquery
has answer: http://stackoverflow.com/a/29062025
answer count: 1
downvote count: 0

http://stackoverflow.com/q/28978418
has answer: http://stackoverflow.com/a/29068650
score: 1
tagged with: dc.js
type: Question
tagged with: crossfilter
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46304269
has comment: http://stackoverflow.com/comment/46354408
has comment: http://stackoverflow.com/comment/46359066
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46372442
has title: Dc.js double grouping
upvote count: 1
has body: I am new to dc.js. Here is what I am trying to achieve. I want to make a bar chart, by counting the appearances of unique emails, x-axis is number of appearance groups, and y-axis will be number of unique emails fall into the occurrences group.(crossfilter will be involved so it will do auto grouping/counting based on date I am selecting) My data set email date a@gmail.com 1/3/2015 a@gmail.com 1/5/2015 b@hotmail.com 1/4/2015 b@hotmail.com 1/5/2015 c@msn.com 1/3/2015 d@gmail.com 1/3/2015 Thanks for the help!

http://stackoverflow.com/a/28933614
accepted answer of: http://stackoverflow.com/q/28933450
answers question: http://stackoverflow.com/q/28933450
has body: 1) You have it right. $index is the only way to go given your constraints, and it is not optimal. 2) The syntax is "track by expression". Expression can be any valid angular expression, so track by image.src + image.caption is perfectly valid. 3) track by doesn't use watchers. the ngRepeat directive maintains an internal map of models and DOM nodes indexed by the track by expression. It tries to reuse DOM nodes (and scopes) where possible. The only thing it $watches is the collection.
downvote count: 0
score: 6
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46123030
has comment: http://stackoverflow.com/comment/46123058
type: Answer
upvote count: 6

http://stackoverflow.com/a/28941473
accepted answer of: http://stackoverflow.com/q/28940685
answers question: http://stackoverflow.com/q/28940685
has comment: http://stackoverflow.com/comment/46137716
has body: You must set the size of canvas using its correct properties/attributes. Canvas is an element with a bitmap. If you use CSS or style you will only scale the element, not the bitmap. The result is a blurry image. Set correct size by doing this (and CSS is not necessary normally): &lt;canvas width=800 height=800&gt;&lt;/canvas&gt; or in JavaScript: canvas.width = 800; // example size canvas.height = 800; If you use CSS, either using a rule or the style attribute in the element, to scale the canvas you will only scale a 300x150 pixel bitmap to something else which will give bad quality. Always scale the bitmap and then redraw (as the canvas will be cleared).
has comment: http://stackoverflow.com/comment/46137734
upvote count: 7
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 7

http://stackoverflow.com/comment/46095547
has text: Can I use your name in my worK?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28918167

http://stackoverflow.com/a/57751853
upvote count: 8
type: Answer
answers question: http://stackoverflow.com/q/29020722
has body: The following has two functions: _getRedirectUrl - which is a setTimeout object simulation for looking up a single step lookup of a redirected URL (this is equivalent to a single instance of your XMLHttpRequest HEAD request) getRedirectUrl - which is recursive calls Promises to lookup the redirect URL The secret sauce is the sub Promise whose's successful completion will trigger a call to resolve() from the parent promise. function _getRedirectUrl( url ) { return new Promise( function (resolve) { const redirectUrl = { "https://mary" : "https://had", "https://had" : "https://a", "https://a" : "https://little", "https://little" : "https://lamb", }[ url ]; setTimeout( resolve, 500, redirectUrl || url ); } ); } function getRedirectUrl( url ) { return new Promise( function (resolve) { console.log("* url: ", url ); _getRedirectUrl( url ).then( function (redirectUrl) { // console.log( "* redirectUrl: ", redirectUrl ); if ( url === redirectUrl ) { resolve( url ); return; } getRedirectUrl( redirectUrl ).then( resolve ); } ); } ); } function run() { let inputUrl = $( "#inputUrl" ).val(); console.log( "inputUrl: ", inputUrl ); $( "#inputUrl" ).prop( "disabled", true ); $( "#runButton" ).prop( "disabled", true ); $( "#outputLabel" ).text( "" ); getRedirectUrl( inputUrl ) .then( function ( data ) { console.log( "output: ", data); $( "#inputUrl" ).prop( "disabled", false ); $( "#runButton" ).prop( "disabled", false ); $( "#outputLabel").text( data ); } ); } Input: https://mary https://had https://a https://little https://lamb Output: Run As another illustration of recursive Promises, I used it to solve a maze. The Solve() function is invoked recursively to advance one step in a solution to a maze, else it backtracks when it encounters a dead end. The setTimeout function is used to set the animation of the solution to 100ms per frame (i.e. 10hz frame rate). const MazeWidth = 9 const MazeHeight = 9 let Maze = [ "# #######", "# # #", "# ### # #", "# # # #", "# # # ###", "# # # #", "…
score: 8
downvote count: 0

http://stackoverflow.com/a/28927197
type: Answer
has body: I'm going to make an arbitrary selection here, which of course can be debated for many parsecs. The list which I deem modern browsers is based on their compliance to the W3C standard and availability: Firefox (from version 35 and up) Chrome (from version 31 and up) Internet Explorer (from version 10 and up), including mobile Safari (from version 7.1 and up) IOS Safari (from version 7.1 and up) Android Browser (from version 37 and up) Chrome (mobile) (from version 40 and up) These browsers are all capable of using modern CSS selectors, document.querySelector, DOMParser, innerHTML, outerHTML, insertAdjacentHTML and document.getElementsByClassName. Some statistics about browser usage: Global browser statistics from W3Schools.com. (not version specific) 2015 Chrome IE Firefox Safari Opera February 62.5 % 8.0 % 22.9 % 3.9 % 1.5 % January 61.9 % 7.8 % 23.4 % 3.8 % 1.6 % Global browser statistics from StatCounter.com. (not version specific) February 2014 to February 2015 Chrome IE Firefox Safari Opera Others 46.08% 20.78% 17.67% 10.36% 1.42% 3.69% Global browser statistics from CanIuse.com February 2015 IE 8 IE 9 IE10 IE11 2.9% 1.82% 1.44% 8.02% FF 35 FF36 FF37 FF38 FF39 8.93% 0.72% 0.02% 0% 0% Chr 38 Chr 39 Chr 40 Chr 41 Chr 42 0.68% 1.97% 27.38% 0.19% 0.17% Sfr 7.1 Sfr 8 0.59% 1.33% Isfr 7.1 iSfr 8.1 1.6% 5.1% Chrome Android 40 10.51% Backwards compatibility When talking about DOM manipulation and backwards compatibility these are always safe options: On document: document.getElementById, supported since IE5.5/FF1.0/Chrome 1. document.getElementsByTagName, supported since IE5.5/FF1.0/Chrome 1 * document.getElementsByName, supported since IE5.5/FF1.0/Chrome 1 * document.createElement or document.createTextNode On Node: ** childNodes appendChild, removeChild, replaceChild setAttribute, removeAttribute, getAttribute cloneNode, parentNode contains previousSibling, nextSibling To decide you need to support older browser is entirely your call. If you have an employer that stil…
accepted answer of: http://stackoverflow.com/q/28927190
answers question: http://stackoverflow.com/q/28927190
type: AcceptedAnswer
score: 0

http://stackoverflow.com/comment/46237956
comment on: http://stackoverflow.com/q/28994842
score: 0
type: Comment
type: QuestionComment
has text: I can paste my whole code in if that would be nice?

http://stackoverflow.com/a/29050031
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29049761
has body: Unfortunately CSS does not support the animation (via transition) of background images. Why? Actually, I'm not sure why. But it's enough to know they don't. Javascript works directly by extending CSS functionality. In short, what you want to do can't be done with Javascript without writing a very convoluted piece of code designed at hacking its functionality. There is an easy work around using jQuery, however, which will actually make your source less complex too. Make the body relative, add each individual background image to the bottom of your source (to make them load after everything else) inside a named wrapper. Let's go with #backgrounds. &lt;style&gt; body{ height:100%; position:relative } #backgrounds img{ position:absolute; z-index:1; // this is important top:0; left:0; width:100%; height:100%; opacity:0; display:none; } #wrapper{ position:relative; z-index:3; // again, this is important } &lt;/style&gt; We set the z-index of the wrapper to be higher than that of the images so that our content is in front of them, thus giving the illusion the images are background images. Change position:absolute to position:fixed if you want a background-attachment:fixed effect. I'm assuming you want their widths and heights to be that of the viewport; change them to whatever if not. We set the images to display:none to stop them all loading when the page loads. Yuck! &lt;div id="wrapper"&gt; all of your page are belong to us... &lt;/div&gt; &lt;div id="backgrounds"&gt; &lt;img src="background/one.jpg" alt=""&gt; &lt;img src="background/two.jpg" alt=""&gt; &lt;img src="background/three.jpg" alt=""&gt; &lt;/div&gt; And then simply cycle through each image using a counter based on the number of images (so you can easily cut and paste more images in later without any effort): $(function(){ var total = $('#backgrounds img').length; var counter = 1; function cycle(){ // Makes old backgrounds appear beneath new ones $('#backgrounds img').css('z-index','1') // Set it to display a…
answers question: http://stackoverflow.com/q/29049761
upvote count: 2
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46230735
comment on: http://stackoverflow.com/q/28991225
has text: make **Tyson's Corner** become **Tyson\'s Corner**
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29000478
has title: Creating throttling function with Bluebird promises
has answer: http://stackoverflow.com/a/29000651
accepted answer: http://stackoverflow.com/a/29000651
upvote count: 2
favorite count: 0
tagged with: promise
has body: I am attempting to created a throttling function. I have looked at a few SO posts and copied some code but I am unable to get it to delay. Basically I have a number of methods in a class that need to call the Amazon API. They all make use of a common function - doCall which I implemented as follows: Amazon.prototype.doCall = function(func) { var self = this; var queue = P.resolve(); function throttle(fn) { var res = queue.then(function() { // wait for queue return fn(); // call the function }); queue = P.delay(61000).return(queue); // make the queue wait for 61 seconds return res; // return the result } // Create instance of MWS client if (!this.client) { this.client = new mws.Client(key, secret, merchant, {}); } var call = function() { // The library uses a weird signature so I am wrapping it thus return new P(function(resolve, reject) { // The original MWS library call self.client.invoke(func, function(r, e) { // ... stuff resolve(r); }); }); }; return throttle(call); }; Basically I fetch order lists and orders and need to delay each call 60+ seconds. Right now it all happens without a delay whatsoever. Suggestions? I am basically using it like this (contrived but should give the idea) self.doCall(ListOrders).then(function(res) { // parse results self.doCall(ListMoreOrdersByPage).then(function(res) { // Now I might go through each and fetch details var ids = [...] // Parse result for ids return P.map(ids, function(id) { return doCall(GetOrderById); }); ....
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46248715
tagged with: bluebird
downvote count: 0
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/29000683
tagged with: javascript
has answer: http://stackoverflow.com/a/29000683

http://stackoverflow.com/comment/46154939
comment on: http://stackoverflow.com/q/28948581
type: Comment
type: QuestionComment
has text: Sorry, your inconsistent indentation was the issue. Now I get `Uncaught ReferenceError: g is not defined`
score: 0

http://stackoverflow.com/comment/46160241
type: QuestionComment
comment on: http://stackoverflow.com/q/28953291
score: 3
has text: The replacer can be a function too, you should be able do the logic you need.
type: Comment

http://stackoverflow.com/a/28948561
answers question: http://stackoverflow.com/q/28948383
has comment: http://stackoverflow.com/comment/58712974
downvote count: 0
upvote count: 58
type: Answer
has body: Use it like this:- $('input').keyup(debounce(function(){ var $this=$(this); //alert( $this.val() ); var n1 = $this.val(); var n2 = $('#n2').val(); var n3 = $('#n3').val(); var calc = n1 * n2 * n3; alert(calc); },500)); Fiddle
has comment: http://stackoverflow.com/comment/59784802
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/128446042
accepted answer of: http://stackoverflow.com/q/28948383
score: 58

http://stackoverflow.com/comment/46084523
has text: You mean, like [this](http://jsfiddle.net/thefourtheye/8094g8ta/2/)?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28912978
score: 0

http://stackoverflow.com/comment/46216217
type: QuestionComment
has text: Hi Alez, thanks for the response. Maybe its my lack of experience with all this, but I understood that a define() only gets generate if there is an 'export'? And if there is only an 'import', a requirejs() gets generated.
comment on: http://stackoverflow.com/q/28963263
score: 0
type: Comment

http://stackoverflow.com/a/29038908
has body: Because I was calling ns.initialize in a script that was defined after CalculatorLibrary.js this caused didn't cause an error, when I moved this piece of code to the top of CalculatorLibrary.js I got the error I expected
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29038379
answers question: http://stackoverflow.com/q/29038379

http://stackoverflow.com/q/28910224
tagged with: javascript
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/3635924
has comment: http://stackoverflow.com/comment/46079832
tagged with: asynchronous
score: 2
answer count: 0
type: UnansweredQuestion
has title: Wait until a cookie has a value before executing a function
tagged with: cookies
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/46080058
downvote count: 0
has body: I need to wait to run a function until I have a cookie. The setting of the cookie is out of my hands. I'm using the jQuery cookie plugin to retrieve the cookie. I think the cookie is set after the following is executed: $.ajax({ url: '//munchkin.marketo.net/munchkin.js', dataType: 'script', cache: true, success: function() { Munchkin.init('XXX-XXX-XXX'); } }) On server A, it was enough to place the function call inside the success parameter. On server B, the cookie is undefined at the time that the "success" function is executed. I also tried the following on server B: var post = $.ajax({ url: '//munchkin.marketo.net/munchkin.js', dataType: 'script', cache: true, success: function() { Munchkin.init('XXX-XXX-XXX'); } }); post.done(function(p){ makeLeadCall($.cookie('_mkto_trk')); }); How can I wait until the cookie has a value before executing the function?

http://stackoverflow.com/comment/46154292
type: QuestionComment
type: Comment
has text: Use an encoded value `"A%2CA"` in combo-box, and decode it after split.
score: 3
comment on: http://stackoverflow.com/q/28950091

http://stackoverflow.com/a/28960730
has comment: http://stackoverflow.com/comment/46174054
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28960418
type: Answer
has body: As answered here Can&#39;t seem to pass options to Hammer.js Jquery you have to get the options manager and then set the options throught that. $swipe.data('hammer').get('panleft').set({threshold: 0.1});
has comment: http://stackoverflow.com/comment/46174209
has comment: http://stackoverflow.com/comment/46215195
has comment: http://stackoverflow.com/comment/91057528
answers question: http://stackoverflow.com/q/28960418

http://stackoverflow.com/comment/46235536
type: QuestionComment
comment on: http://stackoverflow.com/q/28991602
has text: can you explain a bit more? Lets say I did iteration to build index.. each => each => each and builded new object with positionId: [parentArray, index]; Now I need to manipulate that data via key. So I have my original object where I need to change data. So I need to kinda filter it via my stored index with parentAttay pointer or something?
score: 0
type: Comment

http://stackoverflow.com/q/29026574
tagged with: http://stackoverflow.com/tag/html
has body: I need to create, decorate and append child 'divs' to existing. For example, after the appendChildren is executed, following divs should take the following form (assuming decorateDiv adds text "This is new div" inside new div) "This is new div" "This is new div" Here is my code function appendChildren() { var allDivs = document.getElementsByTagName("div"); for (var i = 0; i < allDivs.length; i++) { var newDiv = document.createElement("div"); decorateDiv(newDiv); allDivs[i].appendChild(newDiv); } } function decorateDiv(div) { var x = document.getElementByTagName("div"); var t = document.createTextNode("This is new div"); x.appendChild(t); } I am completely new to JavaSpript. What am I doing wrong? Please help me to fix bugs
has answer: http://stackoverflow.com/a/29026632
type: AnsweredQuestion
tagged with: appendchild
tagged with: dom
type: Question
has title: Pass 'div' element as parameter to JavaScript function
tagged with: createelement
tagged with: javascript
has answer: http://stackoverflow.com/a/29026670
accepted answer: http://stackoverflow.com/a/29026670
possible better answer: http://stackoverflow.com/a/29026632
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29027550

http://stackoverflow.com/a/29022900
score: 17
type: Answer
upvote count: 17
accepted answer of: http://stackoverflow.com/q/29002979
has body: You can do it that way, but it may give you headaches if you ever want Project 1 and Project 2 to use two different versions of the Shared components. Imagine that you need to release Project 1 with the latest shared components, but Project 2 still relies on a previous version of the shared components. What a mess. Some other options: Make the shared components Bower components that could be included into either project as dependencies (see http://briantford.com/blog/angular-bower) Compile all shared assets into a mutually accessible URL (see https://medium.com/@KamilLelonek/sharing-templates-between-angular-applications-b56469ec5d85) Basically copy/paste components between projects, either manually or using something like gulp (see https://groups.google.com/forum/#!msg/angular/TxE5yoQkG-U/6-vWAZsqn1YJ) The second option has a lot of moving parts and requires changes to your applications, not to mention the inability to deploy different versions of the shared code in each project. The first has the benefit of being easy to slice into 3 repositories: Project 1, Project 2, and Shared. If Shared is a Bower dependency in Project 1 and Project 2, a simple bower update will get you the latest version in either project. Or you can lock a project to particular versions of Shared. Option 3 seems like it gives you the most control, but you will quickly lose track of which version of Shared your project is using. Option 1 solves that.
has comment: http://stackoverflow.com/comment/46295071
answers question: http://stackoverflow.com/q/29002979
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46326479

http://stackoverflow.com/comment/46314210
type: Comment
has text: The anonymous function within map needed a bind call to access props. I added it to the answer and to the fiddle here: http://jsfiddle.net/qkz91124/
comment on: http://stackoverflow.com/a/29013090
type: AnswerComment
score: 0

http://stackoverflow.com/q/28924120
has title: Parse Relation - Add the Missing Details for Javascript SDK
score: 0
linked to: http://stackoverflow.com/q/28900094
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28926878
accepted answer: http://stackoverflow.com/a/28926878
type: AnsweredQuestion
tagged with: parse-platform
type: Question
has body: I've been trying desperately to create a Parse relation with the Javascript SDK but I've found the documentation lacking. Missing parts include, how does the relation know which two classes (tables) are being connected? What is the connection between using Parse.Relation and obj.relation? Having seen a few example of variations on how to get Parse.Relation to work, I'm not even sure what to ask. I do know that my previous question: Saving a basic relation in Parse Has not been answered so maybe getting some detail on the documentation is a better approach.

http://stackoverflow.com/q/28938154
answer count: 2
downvote count: 0
favorite count: 0
tagged with: angularjs
upvote count: 2
has answer: http://stackoverflow.com/a/28938331
has answer: http://stackoverflow.com/a/28938416
has body: JSFiddle I have this AngularJS html for a select/options with a selected item by default according to an external value (selectedGroup). There should be an empty option for this list ('-ROOT-' option): -ROOT- {{group.name}} The problem is: when ng-selected condition causes an option to be selected, the ng-model is not affected by this select, but when u change the option, ng-model get the value. How to let the value of ng-model take the auto selected option directly?
accepted answer: http://stackoverflow.com/a/28938331
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28938416
has title: select/options ng-model is not bound with ng-selected
type: Question
tagged with: javascript

http://stackoverflow.com/comment/46309288
score: 0
has text: regarding keyboard related code..because earlier i tried some thing so asking
type: AnswerComment
comment on: http://stackoverflow.com/a/29010747
type: Comment

http://stackoverflow.com/comment/46204448
type: QuestionComment
comment on: http://stackoverflow.com/q/28976652
score: 0
has text: Why not use a class, then you can use `this` because `this` will = to the element used to trigger the function. Here's something that uses the same method *one function* http://stackoverflow.com/questions/28969021/jquery-js-how-to-get-menu-name-from-a-href-based-class/28969221#28969221 And http://stackoverflow.com/questions/28954143/toggle-yes-no-with-multiple-questions/28954314#28954314
type: Comment

http://stackoverflow.com/q/29041115
has answer: http://stackoverflow.com/a/29052601
downvote count: 0
score: 1
has body: Hi I got a template for instafeed and now I need to limit the length of the caption. I added to js code to do it but it does not work. Is there a way to make the {{caption}} shorter and add ellipsis. Here is my code: $(function(){ $(".caption").each(function(i){ len=$(this).text().length; if(len>10) { $(this).text($(this).text().substr(0,10)+'...'); } }); }); /* Intafeed and SimplyScroll */ var feed = new Instafeed({ target: 'instagram-list', get: 'user', userId: 1713392078, accessToken: '0000000', clientId: '0000000', limit: '30', sortBy: 'most-recent', link: 'true', template: ' <i class"caption">{{caption}} {{likes}} ', resolution: 'low_resolution', after: function() { $("#instagram-list").simplyScroll({ speed: 1, frameRate: 24, orientation: 'horizontal', direction: 'forwards', }) } }) feed.run();
tagged with: instafeedjs
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29041486
tagged with: javascript
type: Question
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/29041486
has title: Text length limit not working in my instafeed template
favorite count: 0
accepted answer: http://stackoverflow.com/a/29052601

http://stackoverflow.com/comment/46338462
type: Comment
type: QuestionComment
has text: I suggest you make another specific question about the pin issue. Its unrelated to extensions. Its just a regular html/dom question.
score: 0
comment on: http://stackoverflow.com/q/29048465

http://stackoverflow.com/a/29051341
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29051208
answers question: http://stackoverflow.com/q/29051208
type: Answer
upvote count: 1
has body: Your first animation does work. You probably don't see it because it starts animating as soon as you start scrolling and when you scroll to the image, animation is already done. Try making your screen height bigger, or remove some text at the beginning. If you want animation to start when the item actually appears on the screen, take a look at documentation. Try to change data-0 to data-bottom-top and data-500 to data-center.

http://stackoverflow.com/comment/46292216
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29024820
has text: Do you want each letter to be surrounded by braces, or the whole text? ie: `{h}{e}{l}{l}{o}` or `{hello}`?

http://stackoverflow.com/a/28917934
upvote count: 6
has comment: http://stackoverflow.com/comment/46093534
answers question: http://stackoverflow.com/q/28917801
score: 6
has body: here days is a observableArray which is nothing but a function , to iterate you need to read the value like days() , this is will give you a javascript array. var days = ko.observableArray([1,3,4,5,6]); days().forEach(function(v,i){ alert(v); });
has comment: http://stackoverflow.com/comment/46093594
has comment: http://stackoverflow.com/comment/46099855
downvote count: 0
has comment: http://stackoverflow.com/comment/46093552
has comment: http://stackoverflow.com/comment/46093630
has comment: http://stackoverflow.com/comment/46093973
type: Answer

http://stackoverflow.com/q/29031023
tagged with: jquery
favorite count: 0
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/29031200
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29031200
score: 1
has title: Unable to generate dynamic input fields on click event in jquery
has body: I have a simple HTML form which contains 5 input fields for adding company details. The HTML form is designed using Twitter-Bootstrap and is kept hidden initially. Along with the form I have two div tags- Clicking on one div tag (div tag with content- Click to Generate Company forms) displays the HTML form and clicking on it again generates the same form once again & again so that the user can add multiple company details together. The other div tag is used to remove an added HTML form. I am able to produce the hidden form only once. I am not able to generate it again & again. I have added a fiddle to show what I have achieved so far. Here's the jQuery code. $(document).ready(function(){ // Function to count total no. of company details added upon clicking add company div. if($('#start_count_value').val()) { var i= $('#start_count_value').val(); } else { var i=0; } // Function to show add company details form section upon clicking add company div. $("#add_company").click(function(){ $('#add_company_div').before($("#add_company_div").clone().attr("id","add_company_div" + i)); $("#add_company_div" + i).css("display","block"); $("#add_company_div" + i + " :input").each(function(){ $(this).attr("name",$(this).attr("name") + i); $(this).attr("id",$(this).attr("id") + i); $(this).attr("count",i); }); $("input[name=class_count]").remove(); $('#add_company_div').append(' '); }); // Function to hide add company details form section upon clicking close div. $(document).on("click","#hide_company",function() { $(this).closest(".addcomp").remove(); }); }); Below given is my HTML code: Click this DIV to Close Click to Generate Company Forms Can anyone tell where I made the mistake?? LINK TO FIDDLE
upvote count: 1
type: Question
tagged with: javascript
downvote count: 0
answer count: 1

http://stackoverflow.com/a/28951789
accepted answer of: http://stackoverflow.com/q/28950532
answers question: http://stackoverflow.com/q/28950532
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/46190143
upvote count: 1
has body: No. Well... theoretically it can be done, but it would be a monumental task. Options... You can read the file into JavaScript as a blob, and then refer to the byte format from Microsoft: https://msdn.microsoft.com/en-us/library/office/gg615407%28v=office.14%29.aspx But you'd need to create custom Microsoft Office viewers in JavaScript and then write code that converts the views to postscript. You can start with someone else's project. WebODF supports many document formats: https://github.com/kogmbh/WebODF and then look at a js PDF generator such as https://github.com/MrRio/jsPDF to see if the two could be combined via a code fork. IMO though, full support from these two example projects for your particular use case may be dubious, especially if the users are making complex documents. I imagine there's some intellectual property issue disallowing upload and server side conversion of an Office document, wherein you need to provide some PDF preview to the user before committing to an upload. Asking them to convert to PDF themselves is not a huge ask with free things like CutePDF, especially if a requirement is intended to protect them. Perhaps though the links and terminology used in this answer will give you a starting point for searching further.
has comment: http://stackoverflow.com/comment/46180599

http://stackoverflow.com/comment/46242479
comment on: http://stackoverflow.com/q/28991986
has text: Yep -- that's the only place. Edit: Gads -- I forgot enter submitted a comment. I've tried setting up events at other points in the post-back lifecycle and just can't get this to go away. I'm refactoring the way I store confirmations in the session right now to see if that's affected it.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29005707
tagged with: angularjs
has answer: http://stackoverflow.com/a/29006487
tagged with: mathjax
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/29006487
upvote count: 1
type: Question
tagged with: javascript
has body: I have a situation that I noticed that everytime I load a page that contain mathjax and when I go to other page with another mathjax, I will wait for almost 2 minutes to load. My opinion is that mathjax load first all the formula from the other page before rendering the formula in the current page... I don't really know what I caused because it is only my opinion but that was I noticed. Im using angularJS and here is my code in directives: app.directive("mathjaxBind", function () { return { restrict: "A", controller: ["$scope", "$element", "$attrs", function ($scope, $element, $attrs) { $scope.$watch($attrs.mathjaxBind, function (texExpression) { $element.html(texExpression); MathJax.Hub.Queue(["Typeset", MathJax.Hub, $element[0]]); }); }] }; }); What might be the cause of this problem? If I'm correct with my opinion, how to stop mathjax in rendering if it I'm now in the next page?
has title: How to stop MathJax in rendering from other page in angularJS
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/46292455
score: 0
type: Comment
has text: jsfiddle.net/p56awrea/2 check it here, the 2 sec delay before looping
type: QuestionComment
comment on: http://stackoverflow.com/q/29024820

http://stackoverflow.com/comment/46245504
type: Comment
comment on: http://stackoverflow.com/a/28997746
score: 0
type: AnswerComment
has text: Took a few attempts but got this working nicely, thanks!

http://stackoverflow.com/q/28967647
accepted answer: http://stackoverflow.com/a/28982546
has title: Data submitted to GA account doesn't appear in there
type: Question
tagged with: browser
tagged with: e-commerce
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/28982806
score: 0
has body: I need to manually submit an ecommerce data to my Google Analytics Account, so I created an html file and opened in a browser: &lt;html&gt; &lt;head&gt; &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','http://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-xxxxxxx-1', 'auto'); ga('send', 'pageview'); ga('require', 'ecommerce'); ga('ecommerce:addTransaction', { 'id': 'storeId123_test_cartId123_test_1426000599', 'affiliation': '', 'revenue': '352429', 'shipping': '334433', 'tax': '3344' }); ga('ecommerce:addItem', { 'id': 'storeId123_test_cartId123_test_1426000599', 'name': 'title_123', 'sku': 'sku_123', 'category': 'some_category', 'price': '444', 'quantity': '33' }); ga('ecommerce:send'); &lt;/script&gt; &lt;/head&gt; &lt;/html&gt; But I don't any data in my GA account. How come?
has comment: http://stackoverflow.com/comment/46214195
has comment: http://stackoverflow.com/comment/46210391
has comment: http://stackoverflow.com/comment/46187331
has comment: http://stackoverflow.com/comment/46189962
has comment: http://stackoverflow.com/comment/46206888
has comment: http://stackoverflow.com/comment/46187499
type: AnsweredQuestion
tagged with: google-analytics
has comment: http://stackoverflow.com/comment/46187695
has answer: http://stackoverflow.com/a/28982546

http://stackoverflow.com/q/28984043
type: Question
tagged with: javascript
tagged with: pdf.js
upvote count: 1
tagged with: http://stackoverflow.com/tag/pdf
has title: Load all pages on startup in PDF.js
has body: Hi Have problem with PDF.js library I need open PDF and render all pages in document. Dont want to wait until user scrools over it. I am using customized PDF.js default viever to do some suff, with document. but i need rendered all pages for this changes to work properly. I tried in viever.js change DEFAULT_PREFERENCES.disableRange set to true, but it doesn't work. Have you any idea to solve my problem?
favorite count: 0
type: UnansweredQuestion
answer count: 0
downvote count: 0
score: 1

http://stackoverflow.com/q/28961698
has comment: http://stackoverflow.com/comment/46188360
has comment: http://stackoverflow.com/comment/46175810
type: Question
linked to: http://stackoverflow.com/q/18080953
has answer: http://stackoverflow.com/a/56713809
linked to: http://stackoverflow.com/q/16472497
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: callback
favorite count: 0
has comment: http://stackoverflow.com/comment/46188333
has body: I am working on a NodeJS application. There is a specific RESTful API (GET) that, when triggered by the user, it requires the server to do about 10-20 network operations to pull information from different sources. All these network operations are async callbacks, and once they ALL are finished, the result is consolidated by the nodejs app and sent back to the client. All these operations are started in parallel via async.map function. I just want to understand, since nodejs is single threaded, and it does not make use of multi-core machines (at least not without clustering), how does node scale when it has many callbacks to process? Does the actual processing of callbacks depend on node's single thread being idle, or are callbacks processed in parallel as well as the main thread? The reason why I ask is, I see the performance of my 20 callbacks deteriorate from the first callback to the last one. For example, the first network operation (out of the 10-20) takes 141ms to complete, whereas the last one takes about 4 seconds (measured as the time from when the function is executed, until the callback of the function returns a value or an error). They are all the same network operation hitting the same data source, so the data source is not the bottleneck). I know for a fact that the data source takes no more than 200ms to respond to a single request. I found this thread, so it looks to me that the one single thread needs to address all callbacks AND new requests coming up. So my question is, for operations that will trigger many callbacks, what is the best practice in optimizing their performance?
has comment: http://stackoverflow.com/comment/46175985
has comment: http://stackoverflow.com/comment/46175440
has comment: http://stackoverflow.com/comment/46188244
type: UnansweredQuestion
upvote count: 7
tagged with: node.js
has title: Performance of NodeJS with large amount of callbacks
score: 7

http://stackoverflow.com/a/61936244
score: 0
answers question: http://stackoverflow.com/q/29032525
type: Answer
has body: Assuming thant the content of mandrill_events is an object (not a string), you can also use shift() function: var req = { mandrill_events: [{"event":"inbound","ts":1426249238}] }; var event-property = req.mandrill_events.shift().event;

http://stackoverflow.com/a/28963813
upvote count: 4
score: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/46179373
has comment: http://stackoverflow.com/comment/46184086
type: Answer
has body: You can use isset() to check for a value. Like so: if(isset($_POST['percent_discount'])){ // do something if its set here }else{ // do something if its not set } To be slightly different from the other answers, you could also use a shorthand if: $myString = (isset($_POST['percent_discount']) ? "You received " .$_POST['percent_discount'] . "!" : "We don't like you. No discount for you!"); etc... Hope this helps!
answers question: http://stackoverflow.com/q/28963732
has comment: http://stackoverflow.com/comment/46179764

http://stackoverflow.com/a/28944664
score: 0
has comment: http://stackoverflow.com/comment/46153810
has comment: http://stackoverflow.com/comment/46172065
has comment: http://stackoverflow.com/comment/46144253
has comment: http://stackoverflow.com/comment/46144463
has comment: http://stackoverflow.com/comment/46144587
has comment: http://stackoverflow.com/comment/46145533
type: Answer
has comment: http://stackoverflow.com/comment/46145655
has comment: http://stackoverflow.com/comment/46144952
has body: When your page loads, bean function will be called and it will fill your JavaScript with return value. You can check that if you view source of the page. After that, when the page is loaded, if you click the button it will use old value, it won't call bean method again. You would need to update/render that part of the script first to update the value, and then call the JS method. I hope I wasn't too confusing... Example: //JSF page &lt;p:commandButton value="button" action="#{bean.doWork}" update="script" oncomplete="fun()" /&gt; &lt;h:panelGroup id="script"&gt; &lt;script&gt; function fun () { var var_value = #{bean.workResult}; … } &lt;/script&gt; &lt;/h:panelGroup&gt; //Bean private int workResult = 0; //so it doesn't report error at the beggining public int getWorkResult() { return workResult; } public void doWork() { … workResult = valueYouWouldReturn; }
has comment: http://stackoverflow.com/comment/46145316
answers question: http://stackoverflow.com/q/28944375
has comment: http://stackoverflow.com/comment/46176604
has comment: http://stackoverflow.com/comment/46146139

http://stackoverflow.com/q/28955469
has comment: http://stackoverflow.com/comment/46581847
has comment: http://stackoverflow.com/comment/122308790
favorite count: 0
has body: According to Facebook's Graph documentation on the user photos edge, it's possible to post a photo from javascript using multipart/form-data encoded binary image. https://developers.facebook.com/docs/graph-api/reference/v2.2/user/photos /* make the API call */ FB.api( "/me/photos", "POST", { "source": "{image-data}" }, function (response) { if (response &amp;&amp; !response.error) { /* handle the result */ } } ); The problem is there doesn't appear to be any sample documentation anywhere on the net on how exactly this is supposed to work. There is a method where you bypass FB.api and post directly to the edge via an xhr request. I've gotten this to work, but I'd really like to know how to do this using the FB.api command. Here is my code (FB app has been registered properly and all javascript sdk included elsewhere in the file): function postImageToFacebook(authToken) { //Capture the image from a canvas var filename = "samplepic.png", mimeType = "image/png", message = "test comment", data = canvas.toDataURL("image/png"), encodedPng = data.substring(data.indexOf(',') + 1, data.length), imageData = Base64Binary.decode(encodedPng); // build the multipart/form-data var boundary = '----ThisIsTheBoundary1234567890'; var formData = '--' + boundary + '\r\n' formData += 'Content-Disposition: form-data; name="source"; filename="' + filename + '"\r\n'; formData += 'Content-Type: ' + mimeType + '\r\n\r\n'; for (var i = 0; i &lt; imageData.length; ++i) { formData += String.fromCharCode(imageData[i] &amp; 0xff); } formData += '\r\n'; formData += '--' + boundary + '\r\n'; formData += 'Content-Disposition: form-data; name="message"\r\n\r\n'; formData += message + '\r\n' formData += '--' + boundary + '--\r\n'; //METHOD #1: send the data using xhr request var xhr = new XMLHttpRequest(); xhr.open( 'POST', 'https://graph.facebook.com/me/photos?access_token=' + authToken, true ); xhr.onload = xhr.onerror = function() { console.log( xhr.responseText ); }; //vvv This right here seems to b…
accepted answer: http://stackoverflow.com/a/49459125
type: Question
upvote count: 1
answer count: 1
has title: Using Facebooks javascript api to post multipart/form-data encoded image
has comment: http://stackoverflow.com/comment/46550567
has comment: http://stackoverflow.com/comment/74429170
has answer: http://stackoverflow.com/a/49459125
has comment: http://stackoverflow.com/comment/46590595
tagged with: javascript
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/16245767
tagged with: multipartform-data
downvote count: 0
score: 1
tagged with: facebook-graph-api

http://stackoverflow.com/comment/46245512
comment on: http://stackoverflow.com/q/28994527
type: QuestionComment
score: 0
has text: Can you post the query?
type: Comment

http://stackoverflow.com/a/29059742
type: Answer
has body: You can use timestamp. Idea: you fix last time when you added/removed class, and compare it with current date. // 5000 - equal to 5 seconds function checkTimestamp(a, b){ return Math.abs(a - b) &lt; 5000; } return { buildUI: function () { var lastTimeStamp = null; el.nav.on({ mouseenter: function () { if(lastTimeStamp &amp;&amp; checkTimestamp(lastTimeStamp, Date.now()) return false; el.logo.addClass('spin'); lastTimeStamp = Date.now(); }, mouseleave: function () { if(lastTimeStamp &amp;&amp; checkTimestamp(lastTimeStamp, Date.now()) return false; el.logo.removeClass('spin'); lastTimeStamp = Date.now(); } }); } }
score: 0
answers question: http://stackoverflow.com/q/29059630

http://stackoverflow.com/a/28955838
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46166098
accepted answer of: http://stackoverflow.com/q/28955602
has comment: http://stackoverflow.com/comment/46166827
type: Answer
has body: If you create the json data by yourself, then you could make the data consistent, something like: [ { "type": "msgone", "data" : [ { "msgId":"1", "custName":"MYCUST" } ] }, { "type" : "msgtwo", "data" : [ { "msgId":"2", "custName":"MYCUST" }, { "msgId":"2", "custName":"MYCUSTSOME" }, ] } ] and you could parse it as: success: function(msg){ $('#res').val(msg); //just echo to debug var returnedRep = $.parseJSON(msg); $.each(returnedRep, function(key, val) { var type = val.type; var dataArr = val.data; $.each(dataArr, function(idx, v) { alert(v.msgId); }); }); } Update for json structure in PHP:: (this gives you the required format like i mentioned), $arr = array(); $arr[] = array( "type" =&gt; "msgOne", "data" =&gt; array( array("msgId" =&gt; 1, "custName" =&gt; "Some name") ) ); $arr[] = array( "type" =&gt; "msgTwo", "data" =&gt; array( array("msgId" =&gt; 2, "custName" =&gt; "Some second name"), array("msgId" =&gt; 3, "custName" =&gt; "Some third name"), ) ); echo json_encode($arr);
answers question: http://stackoverflow.com/q/28955602
has comment: http://stackoverflow.com/comment/46165110

http://stackoverflow.com/a/30904519
has comment: http://stackoverflow.com/comment/75639312
score: 43
has body: I have been working on a similar problem: how to access the rich text formatting tags when pasting into the browser from a desktop application. I have found the following articles and have a solution that may solve your problem, though at the time of this writing it hasn't solved my own. https://www.lucidchart.com/techblog/2014/12/02/definitive-guide-copying-pasting-javascript/ JavaScript get clipboard data on paste event (Cross browser) If all you are looking for is the formatted html (a result of the browser having parsed the rich text for you), the answer is to access the clipboardData object and pass it the 'html' parameter instead of the 'text' parameter. see example below (just paste the following into a file called index.html and run it locally): The above example splits out two versions of clipboardData.getData(), one for IE and one for every other browser. The rough process is: first catch the paste event, then preventdefault, then get the clipboard data as html, then place it into the div. The content of this example is entirely stolen from the two links above, but simplified to exclude the extra things I didn't need (ie: hidden inputs to manage the browser's focus and suport for 'copy' and 'cut' events). Full credit should go to the authors of those articles. In my experience (using mac and chrome) pasting formatted text (even with obscure formats like strikethrough and indent) into the #target div will keep the original formatting fairly well. Good Luck! Now, if anyone can tel me how to get the actual rich text formatting tags from the clipboardData, please feel free to answer this question. Thanks!
downvote count: 0
type: Answer
upvote count: 43
answers question: http://stackoverflow.com/q/28983016

http://stackoverflow.com/comment/46390743
type: AnswerComment
score: 0
type: Comment
has text: You are completely correct about needing a return. I'll be bookmarking the link you included, it was extremely helpful.
comment on: http://stackoverflow.com/a/29024353

http://stackoverflow.com/comment/46196042
has text: no problem. You have been a great help so far. This is what I've got at the moment ` `
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28971752
type: Comment

http://stackoverflow.com/a/28981123
type: Answer
score: -1
has body: try $.post() instead of $.ajax({}) and see. may be it's the cause, $.post is simplified. for more info http://api.jquery.com/jQuery.post/ also try changing: var formData = new FormData($(this)[0]); to: var formData = jQuery('#myform').serialize(); try this code too: $("#form").submit(function(){if(confirm('Are you sure?')) {$.post('schoolFormItem',{data:$('#form').serialize()}, function(){$('#form #resetbtn').trigger('click');alert('success')})} else {alert('not posted');return false;}}); at the top, have: &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; and wrap the code in: jQuery(function(){ //our code goes here })
has comment: http://stackoverflow.com/comment/46212150
has comment: http://stackoverflow.com/comment/46212711
downvote count: 1
has comment: http://stackoverflow.com/comment/46212756
has comment: http://stackoverflow.com/comment/46219883
has comment: http://stackoverflow.com/comment/46212659
upvote count: 0
answers question: http://stackoverflow.com/q/28980624
has comment: http://stackoverflow.com/comment/46213956

http://stackoverflow.com/comment/46283056
comment on: http://stackoverflow.com/q/28997670
has text: @ChristianKuetbach I'm not sure what that means, can you elaborate?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28996811
tagged with: jquery
has comment: http://stackoverflow.com/comment/46241830
favorite count: 0
accepted answer: http://stackoverflow.com/a/28996889
has comment: http://stackoverflow.com/comment/46242249
has comment: http://stackoverflow.com/comment/46241836
has comment: http://stackoverflow.com/comment/46242637
score: 8
upvote count: 11
has title: Error "TypeError: $(...).children is not a function"
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46241805
has comment: http://stackoverflow.com/comment/46242278
has comment: http://stackoverflow.com/comment/46241769
downvote count: 3
has comment: http://stackoverflow.com/comment/46241841
has comment: http://stackoverflow.com/comment/46242319
has answer: http://stackoverflow.com/a/57389727
type: Question
possible better answer: http://stackoverflow.com/a/68683363
has comment: http://stackoverflow.com/comment/46242136
has comment: http://stackoverflow.com/comment/46241985
has comment: http://stackoverflow.com/comment/46242516
has answer: http://stackoverflow.com/a/68683363
has answer: http://stackoverflow.com/a/28996889
tagged with: javascript
has body: I try to select a certain DOM element with jQuery. The HTML content: Nav Header <a >Item #1 Item #2 I want to select Item #1. I used $('.nav-list').children() I got TypeError: $(...).children is not a function What's wrong here?
answer count: 3

database
tags question: http://stackoverflow.com/q/28992196
tags question: http://stackoverflow.com/q/28952264
tags question: http://stackoverflow.com/q/28981130
tags question: http://stackoverflow.com/q/28979691
type: Tag
tags question: http://stackoverflow.com/q/28938504
tags question: http://stackoverflow.com/q/29026031
tag name: database
tags question: http://stackoverflow.com/q/29032797

http://stackoverflow.com/comment/66716960
type: Comment
comment on: http://stackoverflow.com/a/35632668
score: 0
type: AnswerComment
has text: My scenario is a document-management-system. We are embedding th same application into all three hosts (for outlook, we are following a different approach). We want to offer a way to store the open file into our system. Therefor I would need the concrete filetype. But the way to get the filetype buggy for not safed files or files, that are a stored a *.odf not *.doxc. (in Word 2013 you will get file.odf, but the content is docx. In Office 2016, I get file.odf with odf-content.) I cannot store the file to my server, because of the wrong extension. I needed to know, what extension to add.

http://stackoverflow.com/comment/46133157
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28938854
has text: `select` tag has a value, not an `option` tag. When you will set a value to `select` tag, it will automatically set `selected` attribute to `option` subtag. I'm not sure that `jQuery('option').val(archive)` will work fine
type: AnswerComment

http://stackoverflow.com/q/28961831
type: UnansweredQuestion
has title: How to work with Fullcalendar in MVC5 in my file
type: Question
has comment: http://stackoverflow.com/comment/46178912
has comment: http://stackoverflow.com/comment/46383936
tagged with: javascript
tagged with: fullcalendar
has answer: http://stackoverflow.com/a/35218262
tagged with: controller
answer count: 2
tagged with: asp.net-mvc-5
has body: my View: @{ ViewBag.Title = "Index"; } @Scripts.Render("~Scripts/jquery.min.js") @Scripts.Render("~Scripts/moment.min.js") @Scripts.Render("~Scripts/fullcalendar.js") @Scripts.Render("~Scripts/Events.js")` Events JavaScript: $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month' } }); $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month' } }); calendar id does not call the js file. How to enable the javascript file full calendar does not working in mvc5?
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/33878959
score: 2
tagged with: view
upvote count: 2

http://stackoverflow.com/comment/46233283
comment on: http://stackoverflow.com/q/28992590
type: Comment
has text: Do u want AJAX or submit reload?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/46169291
has text: Can you tell me how to trigger the popup again if time elapse (in side the angulajs controller) ?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28958202
type: AnswerComment

http://stackoverflow.com/comment/46230016
has text: "A construct "#" is defined, similar to "*", for defining lists of elements. The full form is "<n>#<m>element" indicating at least <n> and at most <m> elements, each separated by one or more commas (",") and OPTIONAL linear white space (LWS)." — http://tools.ietf.org/html/rfc2616#section-2.1
comment on: http://stackoverflow.com/a/28990793
score: 3
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29044611
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: jQuery dynamic width/height are not being applied
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29044645
upvote count: 0
accepted answer: http://stackoverflow.com/a/29044645
possible better answer: http://stackoverflow.com/a/29044677
has body: I have a jQuery segment where I'm trying to dynamically set the width and height of some div elements based on the width and height of the div they're in: numBlocks = 256; $(document).ready(function () { i = 0; maxArea = $("#container").width() * $("#container").height(); squareSideLength = Math.sqrt(maxArea / numBlocks); $(".square").css("width", squareSideLength); $(".square").css("height", squareSideLength); while(i &lt; numBlocks) { $("#container").append("&lt;div class='square'&gt;&lt;/div&gt;"); i++; } }); I know that the squareSideLength is getting calculated correctly, but the width and height of the .square class is not being set correctly. After the .squares are added, the width and height are showing up as 0.
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29044677
tagged with: javascript
tagged with: jquery
score: -1
answer count: 2

http://stackoverflow.com/comment/46830831
has text: PeriodicalUpdater already does a decay function based on whatever the reply is. If the reply is the same as the last request, it increments the delay, and the moment that the reply is different, it resets the delay. So a bunch of the code above is (apparently) redundant. As to your question, have you tried just putting `$$('.robot').invoke('hide');` in there? That would hide everything with that classname.
comment on: http://stackoverflow.com/q/28986717
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29005509
has title: Angular ng-init function loaded after directive
tagged with: angularjs
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/29029739
type: Question
tagged with: angularjs-directive
tagged with: javascript
has body: THE SITUATION: Hello guys! I have an app where is possible to upload file. In the file page, if the file is a pdf file, the app display a little preview of the file. I am using this very useful directive: angular-pdf-viewer If i hardcode the path into a scope variable initialized in the controller everything works smoothly. But of course i have to get some file info that i need for the path. To do that i have a function that I call with ng-init. The path is taken properly but the problem is that come too late.. In the console first i see the error message coming from the directive (because it does not find the file) and THEN, right after the error message, i see a console test message coming from the function. That means that the path is loaded too late and not found by the directive THE ERROR MESSAGE: Error: Invalid parameter object: need either .data, .range or .url THE DIRECTIVE: app.directive('myPdfViewerToolbar', [ 'pdfDelegate', function(pdfDelegate) { return { restrict: 'E', template: ' ' + ' ' + 'Back' + '' + 'Next' + '' + 'Page ' + ' ' + ' / {{pageCount}}' + ' ' + ' ', scope: { pageCount: '=' }, link: function(scope, element, attrs) { var id = attrs.delegateHandle; scope.currentPage = 1; scope.prev = function() { pdfDelegate .$getByHandle(id) .prev(); updateCurrentPage(); }; scope.next = function() { pdfDelegate .$getByHandle(id) .next(); updateCurrentPage(); }; scope.goToPage = function() { pdfDelegate .$getByHandle(id) .goToPage(scope.currentPage); }; var updateCurrentPage = function() { scope.currentPage = pdfDelegate .$getByHandle(id) .getCurrentPage(); }; } }; }]); THE VIEW: File preview THE FUNCTION: $scope.get_file_path = function() { var deferred = $q.defer(); $http({ method: 'POST', url: base_url + 'api/get_file_detail/' + $stateParams.file_id }) .success( function( data, status, headers, config ) { deferred.resolve( data ); $scope.file_url = base_url + 'data/localhost/drawer/' + data.data_id + '/' + data.filename; console.log($scope.file_url); }) …
accepted answer: http://stackoverflow.com/a/29029739
tagged with: http://stackoverflow.com/tag/pdf
answer count: 1

http://stackoverflow.com/q/29011483
has body: I am trying to test my GUI with Nightwatch. I can not seem to find how to simulate a right click. I went through the API Reference page(http://nightwatchjs.org/api) and searched everywhere. Am I missing something here? Because I believe that right clicking should be one of the most basic functionalities.
score: 4
linked to: http://stackoverflow.com/q/7914684
answer count: 3
possible better answer: http://stackoverflow.com/a/29013405
upvote count: 4
has answer: http://stackoverflow.com/a/30526092
has answer: http://stackoverflow.com/a/29013405
tagged with: nightwatch.js
downvote count: 0
has answer: http://stackoverflow.com/a/29751560
tagged with: javascript
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/30526092
favorite count: 0
has title: Right Click with Nightwatch
type: Question

http://stackoverflow.com/comment/46082814
has text: can u elaborate it little bit more . I'm not getting what do meany by 3 char
type: Comment
comment on: http://stackoverflow.com/a/28912048
type: AnswerComment
score: 0

http://stackoverflow.com/q/28995348
has body: I'm new with Spring Framework, this is my first app using it, so, I have the next problem.. And I'm sorry for my really bad english hehe.. I need to include in my jsp some js and css files. I'm working with spring mvc. I have a NotClassFound exception.. This is all my code: In my web.xml appServlet org.springframework.web.servlet.DispatcherServlet contextConfigLocation /WEB-INF/spring/appServlet/servlet-context.xml 1 appServlet / Resource Servlet org.springframework.js.resource.ResouceServlet 1 Resource Servlet /resources/* default *.css default *.js In servlet-context (I've tried with mvc resource with and without "classpath") <mvc:default-servlet-handler /> <!-- <mvc:resources mapping="/resources/**" location="/, classpath:/META-INF/"/> --> <mvc:resources mapping="/resources/**" location="/resources/" /> in the jsp file <%@ page import="org.springframework.js.resource.*"%> Insert title here <link rel="stylesheet" type="text/css" href="<c:url value='/resources/medico.css'/>" /> <%-- <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"> --%> In 'webapp/resources' is where I have my js and ccs files.. and I think my principal problem is with the org.springframework.js library.. I'm mapping it in the web.xml, but when I run the project I have this: SEVERE: Servlet /springsecurity threw load() exception java.lang.ClassNotFoundException: org.springframework.js.resource.ResouceServlet at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1295) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1147) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:520) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:501) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:120) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.j…
type: Question
tagged with: css
has answer: http://stackoverflow.com/a/28997221
answer count: 2
upvote count: 1
tagged with: spring
tagged with: spring-mvc
accepted answer: http://stackoverflow.com/a/28997221
possible better answer: http://stackoverflow.com/a/28995698
linked to: http://stackoverflow.com/q/24580383
has answer: http://stackoverflow.com/a/28995698
type: AnsweredQuestion
downvote count: 0
tagged with: jsp
has title: Spring MVC integration js and css files
tagged with: javascript
score: 1
favorite count: 0

http://stackoverflow.com/comment/46282503
has text: The reason I have the `clearTimeout` inside the hover event was in the event that the user hovers over the menu before the timer ends, it clears the timeOut and goes back to just being a normal hover event. If I removed the timeout from the hover event then it would jump.
score: 0
comment on: http://stackoverflow.com/q/29019288
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46110080
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28927006
type: AnswerComment
has text: The original regex would be a string that I would want to break apart, so this wouldn't do the trick. Thanks though.

http://stackoverflow.com/comment/46336392
type: AnswerComment
score: 0
has text: You need to return false all the time (therefore not submit by default). In the `done` function if the response has errors display them, else you submit the form manually. You can use form.submit() for that. In your case, it will be `$('#'+formId).submit()`. Updated the answer.
type: Comment
comment on: http://stackoverflow.com/a/29048456

http://stackoverflow.com/comment/46300235
score: 1
comment on: http://stackoverflow.com/a/29029485
has text: Yep, and disabled="disabled" is unnecessary. just "disabled" would suffice, because it's a HTML bool. disabled="false" would also disable it.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28975455
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/46349440
tagged with: javascript
has body: I am now creating a Rails project and I am using select2 for the form. form_for in View: &lt;%= f.fields_for :ingredients do |ingredient_fields|%&gt; Ingredients: &lt;%= ingredient_fields.select(:name, @ingredients, {}, multiple: true)%&gt; &lt;% end %&gt; javascript file: $('#cuisine_ingredients_name').select2(); I set @ingredients in the controller and this is working as it should be, but I don't know how to set the multiple default values for this select2 form. It seems like initSelection method is deprecated in version 4.0.0, and I couldn't find a good example using a new method. Does anyone have an idea? Thank you in advance.
has answer: http://stackoverflow.com/a/29242929
type: Question
tagged with: jquery-select2-4
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: jquery-select2
has comment: http://stackoverflow.com/comment/46511325
has comment: http://stackoverflow.com/comment/46444776
downvote count: 0
type: UnansweredQuestion
score: 1
has title: Select2 initSelection deprecated

http://stackoverflow.com/q/28999825
answer count: 2
has title: Comparing two integers in AngularJS directive
tagged with: angular-ng-if
accepted answer: http://stackoverflow.com/a/28999863
tagged with: javascript
score: 0
tagged with: angularjs
tagged with: ng-show
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28999849
has answer: http://stackoverflow.com/a/28999849
has answer: http://stackoverflow.com/a/28999863
type: Question
tagged with: angularjs-directive
has body: I want to conditionally show or hide an element based on the associated User's graduation_year and the ng-show and ng-if directives aren't working as is. The element should be shown if the graduation_year is greater than or equal to the current year (i.e. the user is "active"), and hidden if less than the current year. In the view I've tried = ">Active and in the controller $scope.date = new Date(); but it treats it as false no matter what, even though the output is showing "2017 >= 2015" and "2014 >= 2015" (just a couple examples), so I should be getting different outcomes. When I tried ng-if, they were both treated as true no matter what.

http://stackoverflow.com/comment/48493233
type: Comment
has text: could it be that your server has register_globals = on ?
score: 0
comment on: http://stackoverflow.com/q/29024204
type: QuestionComment

string
tags question: http://stackoverflow.com/q/28969125
tags question: http://stackoverflow.com/q/28952621
tags question: http://stackoverflow.com/q/28961334
tags question: http://stackoverflow.com/q/29055518
tags question: http://stackoverflow.com/q/29017489
tags question: http://stackoverflow.com/q/28926997
tags question: http://stackoverflow.com/q/29000695
tags question: http://stackoverflow.com/q/29059285
tags question: http://stackoverflow.com/q/29007141
tag name: string
tags question: http://stackoverflow.com/q/29056673
tags question: http://stackoverflow.com/q/29021328
tags question: http://stackoverflow.com/q/28975654
tags question: http://stackoverflow.com/q/29013386
tags question: http://stackoverflow.com/q/28942550
tags question: http://stackoverflow.com/q/28945396
tags question: http://stackoverflow.com/q/29054416
tags question: http://stackoverflow.com/q/28948030
tags question: http://stackoverflow.com/q/28945856
type: Tag
tags question: http://stackoverflow.com/q/28925098
tags question: http://stackoverflow.com/q/29017570
tags question: http://stackoverflow.com/q/28910642
tags question: http://stackoverflow.com/q/29054448
tags question: http://stackoverflow.com/q/29054506
tags question: http://stackoverflow.com/q/28913619
tags question: http://stackoverflow.com/q/28973176
tags question: http://stackoverflow.com/q/29053758
tags question: http://stackoverflow.com/q/28910521
tags question: http://stackoverflow.com/q/28997522
tags question: http://stackoverflow.com/q/28967648
tags question: http://stackoverflow.com/q/28955743
tags question: http://stackoverflow.com/q/28921539
tags question: http://stackoverflow.com/q/29000326

http://stackoverflow.com/comment/46235946
has text: Then you should check your definitions, becaus a [responsive web design](http://en.wikipedia.org/wiki/Responsive_web_design) means flexible image, who are image in relative scales, adapting sizes, etc. If you want to find the best image source, I think you must find some javascript solution
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28992937

http://stackoverflow.com/q/28999697
tagged with: ruby-on-rails-4
answer count: 1
tagged with: best-in-place
tagged with: ajax
has body: I followed Railscast #302 to install the best_in_place gem for my app's shopping cart, and am now able to successfully update the item's quantity inline, as well as use the ajax success binding to update the div containing the total price for that item in my cart. However, I have a weird display issue that arises when trying to iterate over the full list of items in the cart. When the user first lands on the cart, they see the following: . When trying to update the quantity of either item; however, two columns appear for each line item. The first column (in both rows) contains the field matching the value for the first item's total, and the second column in both rows does the same for the second item's total: This stray item continues to update properly if the quantity of the second item changes; however, the two issues are: 1) the stray item should not be where it is, and 2) the proper item on the same line as item #2 does not update. Relevant code samples below, thanks in advance! line_items_controller.rb class LineItemsController &lt; ApplicationController respond_to :html, :json ... def update @line_item = LineItem.find(params[:id]) @line_item.update_attributes(line_item_params) respond_with @line_item end end shopping_carts/show.html.erb &lt;% @shopping_cart.line_items.each do |line_item| %&gt; &lt;div class="row"&gt; &lt;div class="small-6 columns"&gt; &lt;%= line_item.meal.name %&gt; &lt;/div&gt; &lt;div class="small-3 columns"&gt; &lt;%= best_in_place line_item, :quantity, :as =&gt; :select, :collection =&gt; {"1" =&gt; 1, "2" =&gt; 2, "3" =&gt; 3, "4" =&gt; 4, "5" =&gt; 5} %&gt; &lt;/div&gt; &lt;div class="small-3 columns line-item-total"&gt; &lt;%= number_to_currency(line_item.total_price) %&gt; &lt;/div&gt; &lt;/div&gt; &lt;% end %&gt; shopping_carts.js $(function() { jQuery(".best_in_place").bind("ajax:success", function(data) { $(".line-item-total").load(location.href + " .line-item-total"); }); });
has comment: http://stackoverflow.com/comment/46252360
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46273867
accepted answer: http://stackoverflow.com/a/29017421
tagged with: ruby-on-rails
type: Question
has title: Rails 4 best_in_place gem display issues with iterating through list
has answer: http://stackoverflow.com/a/29017421
tagged with: javascript
has comment: http://stackoverflow.com/comment/46250319
score: 0

http://stackoverflow.com/q/28948282
has title: Can a Titanium app access the ios share features?
has answer: http://stackoverflow.com/a/28952807
upvote count: 1
tagged with: appcelerator-mobile
possible better answer: http://stackoverflow.com/a/28952807
has body: I want to let user's of my app share stuff by clicking on a share icon and bringing up the ios share page that pops up from the bottom of the screen and shows share options including message, mail, twitter, and facebook. I notice that apps, including the BBC News app have share icons that do this but I can't find anywhere that says how to do this with a Titanium app. Is it possible? If so how?
type: AnsweredQuestion
tagged with: titanium-alloy
has answer: http://stackoverflow.com/a/28952785
score: 1
tagged with: social-networking
type: Question
tagged with: ios
has answer: http://stackoverflow.com/a/28967457
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28952785
linked to: http://stackoverflow.com/q/22757192
answer count: 3

http://stackoverflow.com/comment/58151727
score: 0
type: AnswerComment
has text: How did you modify it? What was wrong, and what fixed it? C'mon, dude :) I have problems with PreparedStatement leaking connections (mssql.close() does not close all open sockets and process hangs on exit) and am looking for possible related solutions, you have not shown your solution.
comment on: http://stackoverflow.com/a/29050653
type: Comment

http://stackoverflow.com/comment/46270840
comment on: http://stackoverflow.com/q/29012899
has text: possible duplicate of [Pagination on a list using ng-repeat](http://stackoverflow.com/questions/11581209/pagination-on-a-list-using-ng-repeat)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47809563
score: 0
has text: Try this plugin https://github.com/thatisuday/copynote
type: Comment
comment on: http://stackoverflow.com/q/28976317
type: QuestionComment

http://stackoverflow.com/q/28958981
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28959203
favorite count: 0
type: UnansweredQuestion
tagged with: css
downvote count: 1
has title: Change background image color on canvas
type: Question
upvote count: 0
tagged with: javascript
score: -1
has body: I have created a canvas with specific background color (lets say red). Now i want to drawn an image . The image I have is a computer icon but having white background .When I draw the image on my canvas , the canvas background is red but the image background stays white and hence it doesnt look good. Is there any way I can change the background color of image to red or acheive my desired behaviour? Thanks Hasan

http://stackoverflow.com/q/28987356
tagged with: javascript
has body: I'm trying to get the data from the database in real time but facing an issue, the java script is not running, i have tried it multiple times and also searched in stackoverflow for answers for my particular type of code but failed. A simple fetch.php <?php include_once('db.php'); $sql = "SELECT * FROM people"; $res = mysql_query($sql); $result = array(); while( $row = mysql_fetch_array($res) ) array_push($result, array('name' => $row[0], 'age' => $row[1], 'company' => $row[2])); echo json_encode(array("result" => $result)); ?> And the my_script.js $(document).ready( function () { done(); }); function done() { setTimeout( function() { updates(); done(); }, 200); } funtion updates() { $.getJSON("fetch.php", function(data) { $("ul").empty(); $.each(data.result, function() { $("ul").append(" Name: "+this['name']+" Age: "+this['age']+" Company: "+this['company']+" "); }); }); } The data received from the database is not displaying at all, only when it is refreshed and the data from the database is not getting into proper format of table even after using it in the script, and i have established proper database connectivity but i have just not mentioned it here as it is quite simple and since i'm receiving the data but not in the proper format and not in real time. Thank You.
has comment: http://stackoverflow.com/comment/46223254
score: 0
answer count: 1
has title: Get data from database in real time using AJAX
has comment: http://stackoverflow.com/comment/46223174
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46223674
has comment: http://stackoverflow.com/comment/46223227
has answer: http://stackoverflow.com/a/28989200
has comment: http://stackoverflow.com/comment/46223206
has comment: http://stackoverflow.com/comment/46223155
has comment: http://stackoverflow.com/comment/46223829
type: Question
has comment: http://stackoverflow.com/comment/46224448

http://stackoverflow.com/comment/46168188
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28957500
score: 1
has text: you should probably see this link http://stackoverflow.com/questions/7034/graph-visualization-library-in-javascript

http://stackoverflow.com/comment/46099243
type: QuestionComment
comment on: http://stackoverflow.com/q/28920801
has text: That is true, but you can submit the results to a PHP script on your server and use that script to post the data to your database (as you say in your post, I don't consider it "using AJAX techniques" if you aren't using XML and you aren't returning a result to the client...). You can solve the "loop" issue by including an identifier in the data returned.
score: 0
type: Comment

http://stackoverflow.com/q/28924635
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/46106037
tagged with: javascript
has body: I'm developing a chrome extension to receive messages from Gcm push services. I developed the extension to get the channel id and I have the php code to send the message to gcm server. The php code is returning error from gcm server like this. ERROR:{ "error": { "errors": [ { "domain": "global", "reason": "invalidParameter", "message": "Invalid channel ID: {0}", "locationType": "parameter", "location": "channelId" } ], "code": 400, "message": "Invalid channel ID: {0}" } } I have published the chrome extension to chrome web store to public. Here is the link. https://chrome.google.com/webstore/detail/first-test/eooaplfpgeapcnniknheiodecggeipko My php code to send message to gcm server.. &lt;html&gt; &lt;body&gt; &lt;form name="pushform" method="POST" action="sendMessage.php"&gt; Chrome Channel ID :&lt;input type="text" name="channel" size="170" value="" /&gt; Message : &lt;input type="text" name="message" size="100" maxlength="100" value =" "/&gt; &lt;input type="submit" value="Send Message" /&gt; &lt;/form&gt; &lt;?php if(isset($_POST['channel'])) { $channel = $_POST['channel']; $message = $_POST['message']; $url= 'https://accounts.google.com/o/oauth2/token'; //If you would have got refresh token $refresh_token = "MY_REFRESH_TOKEN_FROM_GOOGLE"; //set ehre $data = array(); $data['client_id']="MY_CLIENT_ID"; //set there $data['client_secret']="MY_SECRET_CODE"; //set here $data['refresh_token']=$refresh_token; $data['grant_type']="refresh_token"; // use key 'http' even if you send the request to https://... $options = array( 'http' =&gt; array( 'header' =&gt; "Content-type: application/x-www-form-urlencoded\r\n", 'method' =&gt; 'POST', 'content' =&gt; http_build_query($data), ), ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); $obj = json_decode($result); if(!isset($obj-&gt;access_token)) { die("ERROR: unable to get access token.\n".$result); } $access_token = $obj-&gt;access_token; $url ="https://www.googleapis.com/gcm_…
score: 0
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/46106258
favorite count: 0
answer count: 0
type: UnansweredQuestion
tagged with: chrome-gcm
upvote count: 1
tagged with: php
downvote count: 1
has comment: http://stackoverflow.com/comment/46105965
has comment: http://stackoverflow.com/comment/46105882
has title: invalid channel id error in gcm chrome when trying to send message

http://stackoverflow.com/comment/46185907
has text: non-string keys is a big one, if not the main reason to use Sets...
comment on: http://stackoverflow.com/q/28967074
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28967310
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Add a trusted SSL Certificate to Javascript Request
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28967480
tagged with: xmlhttprequest
score: 2
tagged with: ssl
tagged with: https
has body: I am developing an WebApp, which is communicating with an HTTP-server. Of course I want to use an HTTPS connection instead of the HTTP. With this link Jetty - How to configure SSL I was able to create an certificate for my server with embedded Jetty. Now I want to add the created certificate to my JavaScript client. How does it work? At the moment my Javascript-Request looks like this: How can i add a certifcate? var http = new XMLHttpRequest(); var url = localStorage.getItem("url") + "login"; var params = "username=" + username + "&amp;password=" + password; http.open("POST", url, true); http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.onreadystatechange = function() { if (http.readyState == 4) { // server and request all right } } http.send(params); The Server is only contacted by my WebApp, so there is no need to register my SSL Key on an official authority site. I only have to tell the Javascript function to trust my server.
type: Question

size
type: Tag
tags question: http://stackoverflow.com/q/28912465
tag name: size

http://stackoverflow.com/q/29020812
has comment: http://stackoverflow.com/comment/46285346
has title: javascript functionality with and without
has comment: http://stackoverflow.com/comment/46285295
tagged with: javascript
answer count: 3
possible better answer: http://stackoverflow.com/a/29021035
has comment: http://stackoverflow.com/comment/46285185
has answer: http://stackoverflow.com/a/29021035
has comment: http://stackoverflow.com/comment/46285430
has answer: http://stackoverflow.com/a/29020900
has answer: http://stackoverflow.com/a/29020905
has comment: http://stackoverflow.com/comment/46285162
favorite count: 0
has comment: http://stackoverflow.com/comment/46285403
has comment: http://stackoverflow.com/comment/46285469
has comment: http://stackoverflow.com/comment/46285257
has body: This is the button event of html and it works when the button click The time is? Source of code 1 and this one work too but this time its function is written in script Click the button to display the date. The time is? Source code 2 Both codes are giving the same result. Can we call both the codes are using javascript ? or codes are functional by using javascript functionality ? or javascript code is the only code in html page which is written inside script
type: AnsweredQuestion
score: 1
upvote count: 3
downvote count: 2
accepted answer: http://stackoverflow.com/a/29020905
type: Question

http://stackoverflow.com/comment/46253762
type: Comment
type: QuestionComment
has text: Replace $(this td) to $(this) and textVal = this.value; to textVal = $(this).val();
comment on: http://stackoverflow.com/q/29003462
score: 0

http://stackoverflow.com/comment/46349848
score: 0
comment on: http://stackoverflow.com/q/29056215
has text: @JonathanLonowski `startsWith` is ES6 therefore not yet available for every browsers
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46201870
comment on: http://stackoverflow.com/a/28975361
type: Comment
type: AnswerComment
has text: I 'enabled' location services on the device myself; it also prompts to 'allow/deny' to share location when I access the page. So I assume its working.
score: 0

http://stackoverflow.com/comment/46102199
score: 0
type: QuestionComment
has text: You can ignore that. In the final version there will be two rows above the actual data. That removes those from the array so that no calculations are done on them. In this case, I would just remove the first header. But to your point, is it possible to handle that difference?
type: Comment
comment on: http://stackoverflow.com/q/28922382

http://stackoverflow.com/q/28981922
answer count: 0
has body: My app having JW player and I am sharing one video (embedded code or link) on Facebook so Facebook will play that video with JW player. I shared one video using JM player, video posted successfully on Facebook but not working. Please suggest me how should I do this? We have implemented this with the following reference http://support.jwplayer.com/customer/portal/articles/1409823-social-sharing-overlay &lt;script type="text/javascript"&gt; jwplayer("container").setup({ file: "/uploads/video.mp4", sharing: { code: encodeURI("&lt;iframe src='http://example.com/embed/12345.html' /&gt;"), link: "http://example.com/page/12345/" } }); &lt;/script&gt; jwplayer("container").setup({ playlist: [{ file: "/videos/12345.mp4", mediaid: "12345" },{ file: "/videos/67890.mp4", mediaid: "67890" }], sharing: { code: encodeURI("&lt;iframe src='http://example.com/embed/MEDIAID.html' /&gt;"), link: "http://example.com/page/MEDIAID/" } }); It will share link on social media, but not able to play video with custom player. Basically need to create a custom player like YouTube.
type: Question
tagged with: javascript
has title: How I play video with suggested player inside social app?
upvote count: 3
downvote count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 2

http://stackoverflow.com/a/28925421
type: Answer
answers question: http://stackoverflow.com/q/28924907
score: 0
has body: the answer i find it for whatsapp is : Whatsapp

http://stackoverflow.com/comment/46338026
has text: bhspencer - this is perfect and easy to implement. Thanks for pointing out how the engine will work. I sourced what this means and is important to my use case. To prevent unnecessary writes to the client database, is there an underscore method to check if value exists, _.find(list, predicate, [context])
comment on: http://stackoverflow.com/a/29049803
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29038400
answers question: http://stackoverflow.com/q/28999082
score: 0
has body: If I understand you correctly, you want the hidden class to be permanently removed on all pages after a button in the element is clicked, regardless if the user refreshes the page or chooses another page on the site? There is no way to achieve this on the client side with Javascript, you need to modify your php code. Depending on whether you want the hidden class to be removed in all future sessions or just this session for this particular user, you need to do one of the following things: 1) Removed in the remainder of the session. Set the $_SESSION superglobal and read its value for that user every time he refreshes/changes the page and echo the appropriate html accordingly. See also: http://php.net/manual/en/reserved.variables.session.php Session lost after page redirect in php 2) Removed permanently for that particular user. Save a boolean (tinyInt) in your user database which is read before the template is applied indicating whether that user has (ever) clicked the button or not and then render the appropriate html. In all circumstances, you need to modify your template something like this: &lt;?php "your condition" ? echo &lt;div class="hidden filters row overflow-visible"&gt; : echo &lt;div class="filters row overflow-visible"&gt;; ?&gt;
type: Answer

http://stackoverflow.com/comment/46115314
comment on: http://stackoverflow.com/a/28928787
type: AnswerComment
has text: Do you want it to run twice? using the button starts a second loop. if you don't want that second loop, you have to delete the timeout.
score: 0
type: Comment

http://stackoverflow.com/comment/46124251
has text: You might be able to fake this type of detection, But its something i would have to write myself before i knew an answer. I'd investigate PHP file_get_contents / proxy methods or using a dynamic include / loading of the css from javascript. Perhaps using a timer function that checks how long it takes to load the css resource and compares times show how? perhaps a cookie for the longest/first time... but yea a tricky one.
score: 0
comment on: http://stackoverflow.com/q/28934248
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28946566
linked to: http://stackoverflow.com/q/28736104
favorite count: 0
type: UnansweredQuestion
tagged with: three.js
tagged with: animation
has comment: http://stackoverflow.com/comment/46152872
score: 1
has comment: http://stackoverflow.com/comment/46149703
upvote count: 1
tagged with: transferable
type: Question
linked to: http://stackoverflow.com/q/17442946
has title: Three.js: How to load an animated .json model from a web-worker?
has answer: http://stackoverflow.com/a/28952573
tagged with: javascript
linked to: http://stackoverflow.com/q/28843938
has body: Preamble I've been banging my head against this one for almost two weeks now, and am no closer to a solution. I've asked sub-questions I thought would lead me in the right direction: Three.js - How to deserialize geometry.toJSON()? (where is geometry.fromJSON?) Three.js: How to create new 'morphing' geometry if I have all necessary buffers? Of these, the second is still relevant, but no one seems to be biting, despite the bounty. So I am now asking the full question directly, and I will try not to make any assumptions. (Hints to) a solution would be greatly appreciated. Question I have several large animated 3D models in .json files, such as might be loaded with THREE.JSONLoader. They have a format somewhat like this: { "metadata": { "formatVersion": 3, ... }, "vertices": [...], "normals": [...], "faces": [...], "morphTargets": [ { "name": "...", "vertices": [...] }, ... ], "morphNormals": [ { "name": "...", "normals": [...] }, ... ] } I've been able to get the animation working when doing everything from the main thread. But loading and processing these large files freezes the GUI for a long time. So I need to delegate all this to a web-worker, and then successfully create the animation in the main thread. Moreover, I need to send the result back to the main thread through transferable objects, so that there is no cloning of raw data blocking the main thread. As I understand it, WebGL uses Float32Arrays, the buffers of which are transferable objects. So I'm sure this can be done. The required process, as I see it, is as follows: (UI) ➝ send filename ➝ (worker) (worker) ➝ download ➝ process ➝ send buffers (including morphTargets) ➝ (UI) (UI) ➝ reconstruct animation without copying any buffers It's 2 and 3 I'm having trouble with. What buffers need to be created in the worker, exactly, and how do I make them behave as a proper (Buffer)Geometry on the UI side? What I've Tried I am aware of a related question already existing: How to efficiently convert THREE.Geometry …
tagged with: web-worker
answer count: 1
downvote count: 0

http://stackoverflow.com/q/28916174
has title: How parse string in javascript with html char
answer count: 1
accepted answer: http://stackoverflow.com/a/28916491
tagged with: javascript
favorite count: 0
downvote count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28916491
type: Question
type: AnsweredQuestion
has body: For example: I have this string var s = 'Some text .... &amp;#9749;'. How decode in JavaScript to var s = 'Some text .... \u2615'?
score: -1

http://stackoverflow.com/comment/46126920
score: 0
type: Comment
has text: If you are targeting only for android then eclipse is fine. I have used the cordova plugin for Eclipse. You can also have a look on intel xdk(https://software.intel.com/en-us/html5/tools).
comment on: http://stackoverflow.com/a/28932847
type: AnswerComment

http://stackoverflow.com/comment/46168978
score: 0
type: Comment
has text: @RobertEttinger is second button is submit button?
type: AnswerComment
comment on: http://stackoverflow.com/a/28957883

http://stackoverflow.com/q/28922470
has answer: http://stackoverflow.com/a/33326241
has comment: http://stackoverflow.com/comment/46102193
has body: Okay, so I'm trying to make a shareable hash link with javascript/jQuery only (as in no server side). Is this even possible? I can successfully create the hash, but I can't get the data to populate on a different browser. Here's my site, sorry for no code, let me know if there's something specific you'd like to see. site Before it gets brought up, I don't want to use the History API as of yet.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46102219
has comment: http://stackoverflow.com/comment/46102225
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/33326241
has comment: http://stackoverflow.com/comment/46102145
score: 0
has comment: http://stackoverflow.com/comment/46102209
has title: Making a shareable hash link javascript
has comment: http://stackoverflow.com/comment/46102170
has comment: http://stackoverflow.com/comment/46102155
answer count: 1
tagged with: url
tagged with: jquery
has comment: http://stackoverflow.com/comment/46102171
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46102182
has comment: http://stackoverflow.com/comment/46102198

http://stackoverflow.com/a/28988685
has body: Without underscore, you can do: var colors = options.map(function(item) { return item[Object.keys(item)[0]] });
type: Answer
accepted answer of: http://stackoverflow.com/q/28988587
answers question: http://stackoverflow.com/q/28988587
score: 3
upvote count: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46197923
type: Comment
type: QuestionComment
has text: HTML posted @j08691.
score: 0
comment on: http://stackoverflow.com/q/28973172

sql
tags question: http://stackoverflow.com/q/28992007
tags question: http://stackoverflow.com/q/29034769
tag name: sql
type: Tag
tags question: http://stackoverflow.com/q/28909511
tags question: http://stackoverflow.com/q/29022913
tags question: http://stackoverflow.com/q/29048943
tags question: http://stackoverflow.com/q/28921910

http://stackoverflow.com/comment/46305585
type: QuestionComment
comment on: http://stackoverflow.com/q/29032224
has text: I bet that's what it is: you have an object property called `class`. I reckon if you put that in quotes you'll be golden. Best off quoting all your keys for consistency.
score: 0
type: Comment

http://stackoverflow.com/comment/46097991
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28919433
has text: I just need to delete the html elements. This shows how to delete from a database.

http://stackoverflow.com/a/29000683
answers question: http://stackoverflow.com/q/29000478
has comment: http://stackoverflow.com/comment/46251482
score: 0
has comment: http://stackoverflow.com/comment/46249635
upvote count: 1
downvote count: 1
has body: I wanted to come back after I had created an actual, working solution. The trick that messed me up was that you need to pass the uninvoked function into the queuer. I know this isn't what the OP was asking for, but I'm hoping this might help anyone else who comes along looking for an extensible solution. You can see it in action here: http://jsbin.com/seqeqecate/5/ function asyncFunction(){ var deferred = Promise.defer(); setTimeout(function(){ console.log('ping'); deferred.resolve(); },3000); return deferred.promise; } function AsyncQueuer(){ var queue = [], running = false; function runQueue(){ var first = queue.shift(); running = true; if (first) { first.promisable.apply(first.context).then(function() { first.deferral.resolve(); runQueue(); }, function() { first.deferral.reject(); runQueue(); }); } else { running = false; } } return { add: function(promisable, context) { var deferred = Promise.defer(); queue.push({ promisable: promisable, deferral: deferred, context: context || window }); if (!running) { runQueue(); } return deferred; } }; } var asyncQueuer = new AsyncQueuer(); asyncQueuer.add(asyncFunction); asyncQueuer.add(asyncFunction); asyncQueuer.add(asyncFunction).then(function(){}).fail(function(){});
has comment: http://stackoverflow.com/comment/46264568
has comment: http://stackoverflow.com/comment/46249174
type: Answer
has comment: http://stackoverflow.com/comment/46250383
has comment: http://stackoverflow.com/comment/46251595

http://stackoverflow.com/comment/46221111
score: 1
has text: You can use _.filter from Array, and $.grep from jQuery like so http://jsfiddle.net/10nh59f4/5/
type: QuestionComment
comment on: http://stackoverflow.com/q/28986232
type: Comment

task
type: Tag
tags question: http://stackoverflow.com/q/29045173
tags question: http://stackoverflow.com/q/29029129
tag name: task

http://stackoverflow.com/q/28980582
type: Question
has title: Chrome Extension: How to get user name?
upvote count: 12
tagged with: javascript
has body: I'm creating a Google chrome extension. For some functionality, I need user's system login name (no password). By using JavaScript, it is not possible to do so. Some suggest NPAPI, but I have no idea about it, so I quit. Next thing I'm trying to get user name in Chrome Browser. But still no success. I try to use some thing like: var currentUser; var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function(data) { if (xhr.readyState == 1) { currentUser = null; if (xhr.status == 200) { var re = new RegExp(/[\s]*([^<]+@[^<]+) <\/b>/i); var m = re.exec(xhr.responseText); if (m && m.length == 2) { currentUser = m[1]; } } console.log("Currently logged user (on google.com): " + currentUser); } }; xhr.open('GET', ' https://myaccount.google.com/?pli=1', false); xhr.send(); ` still no success. My whole agenda is to get user name (either desktop login name or Chrome login name), and I'm not able to get it. I need to send this username as parameter to my service, as user name works as primary key.
possible better answer: http://stackoverflow.com/a/33804997
score: 12
has answer: http://stackoverflow.com/a/33804997
answer count: 2
tagged with: google-chrome-extension
accepted answer: http://stackoverflow.com/a/28984616
downvote count: 0
favorite count: 0
type: AnsweredQuestion
tagged with: google-chrome
has answer: http://stackoverflow.com/a/28984616

http://stackoverflow.com/comment/46187893
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28956168
has text: If you found my answer useful, please upvote/accept! It would be much appreciated
type: AnswerComment

jsp
tags question: http://stackoverflow.com/q/28941763
tags question: http://stackoverflow.com/q/28955207
tags question: http://stackoverflow.com/q/28971742
tags question: http://stackoverflow.com/q/28979026
tags question: http://stackoverflow.com/q/28961013
tags question: http://stackoverflow.com/q/28938183
tags question: http://stackoverflow.com/q/28913538
tags question: http://stackoverflow.com/q/28926049
tags question: http://stackoverflow.com/q/29049370
tags question: http://stackoverflow.com/q/28929029
type: Tag
tags question: http://stackoverflow.com/q/28955932
tags question: http://stackoverflow.com/q/28946617
tags question: http://stackoverflow.com/q/28992302
tag name: jsp
tags question: http://stackoverflow.com/q/28993036
tags question: http://stackoverflow.com/q/29030169
tags question: http://stackoverflow.com/q/28919342
tags question: http://stackoverflow.com/q/29035054
tags question: http://stackoverflow.com/q/29007896
tags question: http://stackoverflow.com/q/29036154
tags question: http://stackoverflow.com/q/28942607
tags question: http://stackoverflow.com/q/28995348

http://stackoverflow.com/q/28948910
has comment: http://stackoverflow.com/comment/46151786
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28949186
has comment: http://stackoverflow.com/comment/46154584
type: Question
has body: Hi I am trying to make a horizontal menu bar using CSS and Javascript. When clicked, I want the menu item to background to turn black. Here is a part of HTML code- item no 1 item no 2 item no 3 item no 4 item no 5 JavaScript part- function arrow(x){ x.style.background="#000000"; } Now when someone clicks on the menu, the background turns black.The problem is when any other item is selected(clicked) the previous selected item doesn't goes back to its original background color. How should I implement this feature? Thanks!
answer count: 1
has comment: http://stackoverflow.com/comment/46152063
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28949186
has title: MenuBar using Javascript and css
tagged with: css

http://stackoverflow.com/q/28951707
has answer: http://stackoverflow.com/a/28951867
tagged with: javascript
answer count: 1
tagged with: enter
has title: Cross-component communication via return key
has body: In my React.js to-do app, I'm trying to enable the return key to submit an item from my TextInput component to my ToDoList component. Right now the TextInput.inputSubmit method just console.logs the input value, but I'm wondering if I can have it trigger a prop (enter={that.addToDo}) inside of ToDoList. Or is there a better way? JSFiddle Edit: improved JSFiddle (courtesy of knowbody) /** @jsx React.DOM */ var todos = [{text: "walk dog"}, {text: "feed fish"}, {text: "world domination"}, {text: "integrate return key"}]; var TextInput = React.createClass({ getInitialState: function() { return {text: ''}; }, inputSubmit: function() { //I think I want to trigger ToDoList's addToDo method from here? console.log(this.refs.inputEl.getDOMNode().value); this.setState({text: ''}); }, handleChange: function(evt) { this.setState({text: evt.target.value}); }, handleKeyDown: function(evt) { if (evt.keyCode === 13 ) { return this.inputSubmit(); } }, render: function() { return ( ) } }); var SubmitButton = React.createClass({ render: function(){ return ( Add ) } }); var ToDo = React.createClass({ render: function(){ return ( X - {this.props.text} ) } }); var ToDoList = React.createClass({ getInitialState: function (){ return { todos: this.props.todos.splice(0) } }, deleteToDo: function(todo){ this.state.todos.splice(this.state.todos.indexOf(todo), 1); this.setState({todos: this.state.todos}); }, addToDo: function(){ this.state.todos.push({text: this.refs.textIn.refs.inputEl.getDOMNode().value}); this.setState({ todos: this.state.todos }); this.refs.textIn.setState({text: ''}); }, render: function(){ var that = this; return ( {this.state.todos.map(function(todo) { return ( <ToDo text={todo.text} click={that.deleteToDo.bind(null, todo)} /> ) })} <TextInput ref="textIn" enter={that.addToDo} /> <SubmitButton click={that.addToDo} /> ) } }); React.renderComponent(<ToDoList todos={todos} />, document.body);
accepted answer: http://stackoverflow.com/a/28951867
type: AnsweredQuestion
score: 0
type: Question
tagged with: reactjs

http://stackoverflow.com/comment/46271349
has text: Thanks! I'll mark it solved once I see it in action at 11:30 EST :-)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29012607
type: Comment

http://stackoverflow.com/comment/46283899
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29019854
has text: @OlegSh Yes, with id it should be `# + this.id` to be a correct CSS selector. In this case simple `v` looks nicer.

http://stackoverflow.com/a/28958360
has comment: http://stackoverflow.com/comment/46169673
accepted answer of: http://stackoverflow.com/q/28958155
type: Answer
answers question: http://stackoverflow.com/q/28958155
has body: You can't detect it within myObj without doing something like your example where you call the result, like this: function myObj(){ var rv = function() { snippet.log("default method called"); }; rv.method1 = function() { snippet.log('method 1 is called'); }; return rv; } myObj()(); // call default, note the extra () myObj().method1(); // call method1 [*no* extra ()] &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; In a comment I said requiring the extra () was asking for trouble because it would be so easy to forget, but of course, if myObj itself doesn't do anything but return a function, then if you forget the () you won't see the default functionality and presumably will realize you've forgotten the (). In a comment elsewhere you said you might want to do chaining. You can do that with the above, just add "return rv" to the end of the functions: function myObj(){ var rv = function() { snippet.log("default method called"); return rv; }; rv.method1 = function() { snippet.log('method 1 is called'); return rv; }; return rv; } myObj()(); // call default, note the extra () myObj().method1(); // call method1 [*no* extra ()] myObj()().method1()(); // call default, then method1, then default &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; I'm sure you've already ruled this out, but just for completeness: The usual way to do this would be for the "default" to be explicit, e.g.: function myObj(){ return { _: function() { snippet.log("default method called"); }, method1: function() { snippet.log('method 1 is called'); } }; } myObj()._(); // call default myObj().method1(); // call method1 &lt;!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/1…
has comment: http://stackoverflow.com/comment/46169461
has comment: http://stackoverflow.com/comment/46169563
score: 2
has comment: http://stackoverflow.com/comment/46169745
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46169522

http://stackoverflow.com/a/28932053
answers question: http://stackoverflow.com/q/28931985
downvote count: 0
type: Answer
has body: If you are only trying to apply the transition to the top increase, you can target top intead of all:JS Fiddle -webkit-transition: top 0.5s ease-in-out; -moz-transition: top 0.5s ease-in-out; -o-transition: top 0.5s ease-in-out; -ms-transition: top 0.5s ease-in-out; transition: top 0.5s ease-in-out;
score: 1
upvote count: 1

http://stackoverflow.com/q/28956804
score: 0
has answer: http://stackoverflow.com/a/28957028
has title: How Come public method is not printing in a IIFE?
tagged with: javascript
has comment: http://stackoverflow.com/comment/46166918
answer count: 3
type: AnsweredQuestion
has body: Shouldn't hello be printed in the console because of the return statement? The code is immediately invoked because of the () at the end so why isn't it printing? var Module = (function () { var privateMethod = function () { // private }; var someMethod = function () { // public console.log('hello'); }; var anotherMethod = function () { // public }; return { someMethod: someMethod, anotherMethod: anotherMethod }; })();
has answer: http://stackoverflow.com/a/28956849
possible better answer: http://stackoverflow.com/a/28957012
has answer: http://stackoverflow.com/a/28957012
tagged with: iife
type: Question
accepted answer: http://stackoverflow.com/a/28956849

http://stackoverflow.com/comment/46397442
type: Comment
type: AnswerComment
has text: You are contradicting yourself now (`I want to be able to select anything within the "forkfork" div, and have it returned, ideally the raw HTML.` | `I want the selected HTML within the forkfork div, including any selected nested divs.`)
comment on: http://stackoverflow.com/a/29070079
score: 0

http://stackoverflow.com/a/29055896
score: 1
answers question: http://stackoverflow.com/q/29055752
has body: If you want to trigger anchor as a click so you can use simulate function, jQuery team create this function which will support in in Chrome, Firefox, Opera and IE10. so first you have to download this script for using simulate function after jQuery script. Here is a link and example: $('a').simulate('click'); jquery.simulate.js
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/a/29033984
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46425969
has comment: http://stackoverflow.com/comment/46403121
has comment: http://stackoverflow.com/comment/46383419
has comment: http://stackoverflow.com/comment/46310322
has body: Never access the DOM in the controller, use directives for that. Instead of creating your own directive you might want to have a look at Angular-qrcode. The short version of how to use this library is just this: &lt;qrcode data="{{url}}"&gt;&lt;/qrcode&gt; To get this to work you need to include both the original qr-code generator and the angular wrapper (angular-qrcode) scripts in your html. Also remember to add 'monospaced.qrcode' as a module-dependency.
type: Answer
upvote count: 9
accepted answer of: http://stackoverflow.com/q/29033910
score: 9
answers question: http://stackoverflow.com/q/29033910

http://stackoverflow.com/comment/46302924
type: AnswerComment
has text: @udaya726 You could as well, put the groupFooterTemplate and footerTemplate functions... in any other and they will just work... because on each rendering pass, all values of the current row / group / footer are available through the parameter "data"
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29012970

http://stackoverflow.com/comment/46074251
comment on: http://stackoverflow.com/a/28907171
type: Comment
score: 0
has text: Cool, I'll give the setting in your answer a try and check out your vimrc. I'll let you know what happens.
type: AnswerComment

http://stackoverflow.com/comment/46340868
type: QuestionComment
has text: @cheekybastard using AngularJS v1.3.14
comment on: http://stackoverflow.com/q/29043858
score: 0
type: Comment

http://stackoverflow.com/comment/46241836
comment on: http://stackoverflow.com/q/28996811
score: 1
has text: You need to include jQuery.... https://developers.google.com/speed/libraries/devguide#jquery
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46327973
comment on: http://stackoverflow.com/q/29044002
type: Comment
type: QuestionComment
has text: @JDTLH9 `<ons-list style='margin: -1px 0' id="data">`
score: 0

http://stackoverflow.com/comment/46146394
comment on: http://stackoverflow.com/a/28945911
type: AnswerComment
score: 0
type: Comment
has text: atleast this is the way i know for sure. i searched finding a way to reference object itself from within a function of it, that i couldnt find. And i am currently using this to store my application wide variables that can go together. so i wont pass around tens of variables.

http://stackoverflow.com/comment/46197741
comment on: http://stackoverflow.com/q/28973203
type: QuestionComment
has text: Uncaught TypeError: undefined is not a function
score: 0
type: Comment

http://stackoverflow.com/comment/46233982
type: QuestionComment
has text: and How do I do that please? I am using webmatrix so tough to denug also the same JSON is working on other window.
score: 0
comment on: http://stackoverflow.com/q/28976314
type: Comment

http://stackoverflow.com/comment/46107855
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28925402
type: AnswerComment
has text: Ok, the word "impossible" is a bit harsh, but it really doesn't make sense to handle this type of structure without a recursion.

http://stackoverflow.com/comment/46313126
type: Comment
has text: is there a way to go directly to the value? without the for cycle?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29035752

http://stackoverflow.com/q/28961526
has body: Context: you are running a web site with ads coming from different providers. For an ad you usually get a whole javascript snippet (that inserts everything needed by the client to track the ad). Sometimes you have smaller clients that can only provide the creative (JPG) and an URL to track the impressions (impression pixel). Question: Now you got a client who wants a Click-Pixel in addition to the Impression-Pixel. Means: Whenever the ad is displayed (JPG), also the Impression-Pixel URL is called (easy) but if a user clicks on the ad, the browser should not only open the target URL but should also call the Click-Pixel URL (also an invisible 1x1 px image). How would you implement the click-pixel? My solution so far: Is there any better approach how to implement a click-pixel? Alternatives to a click pixel: I would count clicks on the client side (via Google Analytics) but some clients do not want to use GA or other tracking mechanisms like that. HTML: &lt;a href="TARGET_PAGE_CLIENT" clickpixelurl="CLICKPIXEL_URL_FROM_CLIENT"&gt; &lt;img src="/local/clients/XYZ.jpg"/&gt; &lt;/a&gt; &lt;img src="IMPRESSIONPIXEL-URL_PROVIDED_BY_CLIENT"/&gt; jQuery: $(document).ready(function() { $('a#ad').click(function() { var url = $(this).attr("clickpixelurl"); $.get(url); // this will call a GET async but won't wait for the answer }); }); How would you implement a click pixel?
has title: How would you code a Click-Pixel next to an Impression-Pixel (Tracking)?
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
tagged with: tracking
answer count: 0
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46175346
score: 4
type: Question
has comment: http://stackoverflow.com/comment/46177745
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/28927923
answer count: 3
possible better answer: http://stackoverflow.com/a/34209460
has answer: http://stackoverflow.com/a/28928069
has title: How do I allow bootbox to accept multiple lines of code?
favorite count: 0
accepted answer: http://stackoverflow.com/a/28928069
upvote count: 1
has answer: http://stackoverflow.com/a/54258616
type: AnsweredQuestion
tagged with: bootbox
type: Question
tagged with: textarea
tagged with: modal-dialog
downvote count: 0
tagged with: javascript
score: 1
has answer: http://stackoverflow.com/a/34209460
has body: This code works: &lt;script type="text/javascript"&gt; bootbox.alert("Hello world!"); &lt;/script&gt; This code doesn't work: &lt;script type="text/javascript"&gt; bootbox.alert("Hello world!"); &lt;/script&gt; If you're gonna ask why I need it like the second one, it's because that value will be based off of a textarea which has multiple lines of code, I somehow need to make bootbox run with multiple lines of code. The second one can be a product of a textarea with Hello as the first line and world! as the second line.

http://stackoverflow.com/comment/46391529
comment on: http://stackoverflow.com/q/29039286
has text: Ill provide code for anyone whos interested.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28927685
has comment: http://stackoverflow.com/comment/46111459
has comment: http://stackoverflow.com/comment/46111606
type: AcceptedAnswer
has body: The general approach: Send the image via AJAX or POST to the server. The server receives the image. As you are using Node.js, I found this library. Process the image and send it back to the client Why don't you post the codes that you have worked on so far?
accepted answer of: http://stackoverflow.com/q/28927588
score: 0
answers question: http://stackoverflow.com/q/28927588
type: Answer

http://stackoverflow.com/comment/46100025
has text: if you put the append calls into a reusable function, you can then() as needed to DRY. you can also make multi-purpose handlers, steered by _this_ to feed then() calls, like `.then(fnAppend.bind(myDiv))`, which can vastly cut down on anons.
score: 0
comment on: http://stackoverflow.com/q/28921127
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29004934
type: Answer
answers question: http://stackoverflow.com/q/29004822
upvote count: 3
score: 3
downvote count: 0
has body: Make an object that contains the count of each name: var counts = {}; $('table tr td:nth-child(2)').each(function() { var name = $(this).text(); if (name in counts) { counts[name]++; } else { counts[name] = 1; } } console.log(counts);

http://stackoverflow.com/a/28943182
has comment: http://stackoverflow.com/comment/46141186
downvote count: 0
has comment: http://stackoverflow.com/comment/46166268
has body: Have you tired the mmmagic module, which provides a binding to libmagic? It allows inspection of a file for known "magic" identifiers. Typically it only needs access to the first few bytes of a file to do this. I guess this approach might itself be considered "brute force" but at least it relies on a well-known and well-tested library. Update after initial suggestion of mmmagic failed to deliver the magic: If you're always requesting your data via HTTP(S) using the request module then the response headers may provide a hint: // returns 'text/json' for your data.fda.gov.tw sample var mimeType = res.headers['content-type']; Failing that, the fsql Perl module contains regex-based logic for determining if text is CSV, TSV, YAML or JSON that might be suitable for repurposing in your own code.
type: Answer
answers question: http://stackoverflow.com/q/28942878
upvote count: 2
has comment: http://stackoverflow.com/comment/46140819
score: 2

http://stackoverflow.com/q/29021737
has comment: http://stackoverflow.com/comment/46375587
upvote count: 1
tagged with: getjson
downvote count: 1
has comment: http://stackoverflow.com/comment/46375127
type: Question
tagged with: webpack
tagged with: javascript
tagged with: jquery
score: 0
has body: I want to be able to: Load a module and assign it into the namespace: $.GET("http://path.to.my/library").then(function(jsSourceCode){ return webpack_load('myLibrary', jsSourceCode); }).then(function(){ var myLibrary = require('myLibrary'); ... do stuff; }); Unload a module: $.GET("http://path.to.my/library").then(function(jsSourceCode){ return webpack_load('myLibrary', jsSourceCode); }).then(function(){ var myLibrary = require('myLibrary'); ... do stuff; webpack_unload('myLibrary'); }); Change a modules name: if (webpack_isLoaded('react')){ webpack_rename('react-0.12', 'react'); } webpack_load('react', newReactSourceCode); But I want to be able to do this from the console (i.e. at run time after the compile). How can I do this?
answer count: 1
has answer: http://stackoverflow.com/a/29074179
favorite count: 0
has title: Can I manually manage resolution of requires at run time with webpack?
type: UnansweredQuestion

http://stackoverflow.com/q/28909192
has comment: http://stackoverflow.com/comment/46077747
has comment: http://stackoverflow.com/comment/46077774
score: 0
has comment: http://stackoverflow.com/comment/46077852
answer count: 1
tagged with: javascript
tagged with: angularjs
type: UnansweredQuestion
has body: I'm trying to generate a list of terms and their definitions, but place a header at the start of each letter section. IE A Apple B Banana To do this, I have the following code: &lt;div ng-repeat="definition in definitions"&gt; &lt;div ng-if="firstLetterOfTerm(definitions[$index])!=firstLetterOfTerm(definitions[$index-1])"&gt; &lt;h1&gt;{{firstLetterOfTerm(definitions[$index])}}&lt;hr&gt;&lt;/h1&gt; &lt;/div&gt; &lt;div&gt;{{definition.term}}&lt;/div&gt; &lt;/div&gt; This works great if definitions is ordered. But if it isn't, this doesn't work. IE consider the list ["Banana", "Apple"] Based on my current logic, this would produce the following list: A Banana B Apple Thats because when I do firstLetterOfTerm(definitions[$index]), the $index points to the original, unordered list. Is there any way I can get it the proper positioning of the $index? Or perhaps a different way to architect this solution that produces the same results Note: I do not want to presort the list beforehand as it can be quite large.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28910359
tagged with: angularjs-ng-repeat
tagged with: angularjs-orderby
has comment: http://stackoverflow.com/comment/46078232
has comment: http://stackoverflow.com/comment/46077716
type: Question
has title: Getting the last ng-repeat item after it has been orderBy'd
has comment: http://stackoverflow.com/comment/46077734
has comment: http://stackoverflow.com/comment/46077762

http://stackoverflow.com/q/28917960
tagged with: http://stackoverflow.com/tag/html
has title: Capture image from mobile camera and preview before upload
answer count: 1
has body: Would anyone be able to point me in the right direction, I'm trying to write a small application for a web-site, where by the user can choose either an image, or choose to capture an image with their phone camera. We can then display (preview) the image to them, and they can confirm it and carry on, or restart and take the image again. I've found a few ways to do this using jQuery, which seemed to work well on a computer, However on a phone (tested using a Samsung S5 running the latest chrome) i frequently receive error messages saying that the previous operation could not be completed due to low memory. Here is an example of the current code i'm using, this is stripped down somewhat just to show a basic example, but you can see the method doesn't seem very efficient: $(function() { $("#prev-img-file").on("change", function() { var files = !!this.files ? this.files : []; if (!files.length || !window.FileReader) return; // no file selected, or no FileReader support if (/^image/.test( files[0].type)){ // only image file var reader = new FileReader(); // instance of the FileReader reader.readAsDataURL(files[0]); // read the local file reader.onloadend = function(){ // set image data as background of div $(".up-pic-preview").css("background-image", "url("+this.result+")"); } } }); }); http://jsfiddle.net/fish_r/vnu7661c/ Would anyone know of anything that doesn't hog as much resources? Thanks!
has comment: http://stackoverflow.com/comment/46094078
type: UnansweredQuestion
type: Question
tagged with: camera
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/28918549

http://stackoverflow.com/comment/57254789
type: Comment
has text: Actually, the preferred way is to have a real link, in case JavaScript is turned off.
score: 0
comment on: http://stackoverflow.com/a/29055428
type: AnswerComment

http://stackoverflow.com/comment/46185876
score: 0
has text: I haven't. Is there anything you need me to explain in more detail?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28966798

http://stackoverflow.com/comment/46194744
has text: Need to show sample html of where ID comes from, we can't read minds. Also you are concatenating a string and an array which doesn't make sense
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28971592
type: QuestionComment

http://stackoverflow.com/comment/46082409
type: Comment
comment on: http://stackoverflow.com/q/28911849
type: QuestionComment
score: 0
has text: you need to add timeout for server request, so it will start making request only after 300 ms after user is not pressing anything

http://stackoverflow.com/comment/46111875
score: 1
has text: Why does O in noob have to be capitalized? Captain?
comment on: http://stackoverflow.com/q/28928017
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28992945
type: Answer
upvote count: 1
has body: If you are using pickadate.js version 3.5.5 then the arrow keys will work properly, however it is using aria-activedescendant to track the currently 'focusssed' date and this is not yet supported in all screen readers (does not work for example on OS X with VoiceOver and as far as I know also does not work with JAWS) You could change the code https://github.com/amsul/pickadate.js of the datepicker to use ARIA live regions to announce the dates as the user uses the arrow keys. It is based on jQuery and there is a jQuery library that you could integrate to do this: https://github.com/dylanb/a11yfy You would essentially call jQuery.a11yfy.assertiveAnnounce(msg); every time the aria-activedescendant changed with the contents of that cell.
has comment: http://stackoverflow.com/comment/46237432
score: 1
accepted answer of: http://stackoverflow.com/q/28989500
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28989500
has comment: http://stackoverflow.com/comment/65462587
has comment: http://stackoverflow.com/comment/65412158

http://stackoverflow.com/comment/46115215
type: Comment
comment on: http://stackoverflow.com/a/28928800
has text: Sorry it did work, It was just that I typed the argument inside function() instead of outside :p
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46300541
comment on: http://stackoverflow.com/q/29029611
score: 0
type: Comment
has text: Can you provide ajax body code?
type: QuestionComment

http://stackoverflow.com/comment/46335105
comment on: http://stackoverflow.com/a/29048421
type: Comment
type: AnswerComment
score: 0
has text: You defined a function constructor in report.js

http://stackoverflow.com/q/29011854
has title: Ember: How to get mouse event in a view that's not the target
tagged with: ember.js
type: UnansweredQuestion
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/29011998
tagged with: javascript
has body: I have an Ember.js application with a view where I use mouse events (down, move and up) to allow the user to resize elements by clicking and dragging while holding. Works like a charm - until the mouse pointer leaves the boundaries of the view. Then I don't have any indication what's going on with the mouse. To understand what I want to achieve think of the edit view in Paint - you click and drag to create a rectangle. If you pass the view's top the rectangle's height stops changing but the width changes according to the mouse current location. I'd like to keep getting updates of the mouse moves even if the target is now another view. How can I achieve it in a clean way - without modifying the rest of the views? Ideally, what I'd like to do is run a code in mouseLeave that modifies the way Ember's global event listener delegates events - so that they'll be passed to my view even when it's not the target. Of course - I'll need to clear this when the mouse button is released.
score: 0

http://stackoverflow.com/q/28959149
upvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I need to create a responsive information slider and for each slide, depending on the size of the screen, there would be a different ammount of information, but as far as I know - neither PHP nor MySQL allow me to select data based on screen size, so how could I make this happen? I tried using JavaScript, but so far with not that much success, my idea was that I could use JS to detect screen size and based no that somehow send that info to PHP which could then adjust the slider accordingly, but could you show me a snippet of code on how to do that, please? Edit: I need it in combination with this: How to divide array in parts (without using multidimensional arrays) with php? So the slider works as follows: content for slide 1 content for slide 2 content for slide 3 and I cannot use jquery to hide something, it has to fit as needed for the contents respective slide.
has comment: http://stackoverflow.com/comment/46171571
has comment: http://stackoverflow.com/comment/46170937
has comment: http://stackoverflow.com/comment/46171593
has comment: http://stackoverflow.com/comment/46170865
has answer: http://stackoverflow.com/a/28959627
has comment: http://stackoverflow.com/comment/46171054
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46171174
has comment: http://stackoverflow.com/comment/46171371
tagged with: php
has title: How to get data from database depending on the screen size?
downvote count: 1
has comment: http://stackoverflow.com/comment/46171518
tagged with: responsive-design
has answer: http://stackoverflow.com/a/28959639
score: -1
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/46171669
linked to: http://stackoverflow.com/q/28939010
answer count: 2
has comment: http://stackoverflow.com/comment/46170989

http://stackoverflow.com/q/29001706
has comment: http://stackoverflow.com/comment/46251036
type: AnsweredQuestion
upvote count: 0
score: -5
has comment: http://stackoverflow.com/comment/46251025
type: Question
has title: Defining variables in array javascript
has body: I need to have dataXHip[frameNum] be a number rather than undefined. I've declared it as dataXHip = []; Then, I set a value as: dataXHip[frameNum] = Number(dataX[frameNum]); However, using the "oftype" function, I learn that dataXHip[frameNum] is undefined.
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/46251081
has answer: http://stackoverflow.com/a/29001740
accepted answer: http://stackoverflow.com/a/29001740
tagged with: types
answer count: 1
favorite count: 0
downvote count: 5
has comment: http://stackoverflow.com/comment/46251086
has comment: http://stackoverflow.com/comment/46251003

tracking
tags question: http://stackoverflow.com/q/28961526
tags question: http://stackoverflow.com/q/28963726
tag name: tracking
type: Tag

http://stackoverflow.com/q/28996193
has comment: http://stackoverflow.com/comment/46240821
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29104529
has comment: http://stackoverflow.com/comment/46240716
tagged with: css
has comment: http://stackoverflow.com/comment/46241493
has comment: http://stackoverflow.com/comment/46243696
has body: I'm still learning JS and jQuery, so don't hate on my coding too much! :P Anyways, here's what I am trying to do: I have a database that has all cities and postal codes for a country. Some postal codes have multiple cities. I am first making an auto-complete for the postal code being entered that shows the cities for that postal code in an absolute positioned div. The div is created by a jQuery append to show all of the cities for that postal code. That is all working fine. Once I have the div showing the cities, when I click on a city name, it needs to move the name of that city to the ShipCity input box, then a separate function clears the div and hides it. But this is where I'm running in to issues. Since I'm using a jQuery append to make the div, all the divs created have the same id. I can get the City input box to show a city name, but it only grabs the first one from the append, and not the one I am actually clicking on. I have been working on this for 3 days now and am getting frustrated that I am this close but I can't complete it. :o I hope this makes sense. Any help is appreciated. Here is the code: Also, this is run from an .hta, and php is not an option. Has to be strictly css/html/js. -CSS #container { padding:2; color:black; border-spacing:0px; margin:1px; width:400px; height:400px; white-space:nowrap; float:left; } #container label { width:100px; padding:0; color:black; float:left; font-weight:bold; margin-right:5px; display:table-cell; } #container input { width:170px; padding:0; color:black; margin-left:5px; text-transform:uppercase; } #hiddenDiv { display:none; position:absolute; border:1px solid; top:418px; left:580px; width:250px; background-color:#FFCC00; } -JS window.onload = function() { // autocomplete : this is executed every time we change the text. $( "#ShipZip" ).keyup(function() { var min_length = 3; // min caracters to display the autocomplete var keyword = $('#ShipZip').val(); if (keyword.length >= min_length) { // do something as we …
has comment: http://stackoverflow.com/comment/46245467
tagged with: oledb
has answer: http://stackoverflow.com/a/29104529
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46432923
tagged with: javascript
has title: Javascript: jQuery help getting text from an append to new function for autocomplete (using OLEDB as souce)
type: Question
has comment: http://stackoverflow.com/comment/46240682
score: 0
has comment: http://stackoverflow.com/comment/46241375
answer count: 1

http://stackoverflow.com/a/28956537
accepted answer of: http://stackoverflow.com/q/28956469
type: Answer
downvote count: 0
score: 1
type: AcceptedAnswer
has body: You can add CONFIG to a "parent" scope (an outer elements's scope) or to $rootScope. Note, directives with isolated scopes will not inherit properties from "parent" divs.
answers question: http://stackoverflow.com/q/28956469
upvote count: 1

http://stackoverflow.com/q/29046477
tagged with: javascript
has title: Render Data from Fixtures in Ember
score: 0
has body: I am trying to build simple ember application. I used the cache FIXTURES for rendering the data in template. But, I dont what am doing wrong in this template. Here is the example jsbin Template Code: {{#each}} &lt;option&gt;{{mname}}&lt;/option&gt; {{/each}} Js code: timeZoneApp.CalendarboxRoute = Ember.Route.extend({ model: function() { return this.store.findAll('calendarbox'); } });
answer count: 1
type: UnansweredQuestion
tagged with: ember.js
has answer: http://stackoverflow.com/a/29051910
type: Question
tagged with: ember-data

http://stackoverflow.com/comment/46171105
type: AnswerComment
score: 0
type: Comment
has text: Can you send me link to a fiddle where you can reproduce it? I'll try to see what's causing it.
comment on: http://stackoverflow.com/a/28958097

http://stackoverflow.com/q/29026660
type: Question
has title: How do I send a local variable to a partial rendered only after a link is clicked?
tagged with: simple-form
accepted answer: http://stackoverflow.com/a/29026886
tagged with: twitter-bootstrap
score: 0
tagged with: ruby-on-rails
answer count: 1
has body: I have a Bootstrap Modal that is triggered when this link is clicked: &lt;a class="plus" href="javascript:;" data-toggle="modal" data-target="#myModal"&gt;&amp;nbsp;&lt;/a&gt; I then have this in my _footer.html.erb &lt;%= render 'shared/tag_users_modal' %&gt; Which then has this standard Bootstrap Modal: &lt;!-- Modal --&gt; &lt;div class="modal tagging fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Tag User&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;%= simple_form_for @node, url: add_tagged_user_node_path(@node), method: :post do |f| %&gt; &lt;%= f.error_notification %&gt; &lt;div class="form-inputs"&gt; &lt;%= f.input_field :user, label: "Users", collection: @users, as: :check_boxes, checked: @node.user_tags %&gt; &lt;/div&gt; &lt;div class="form-actions"&gt; &lt;%= f.button :submit %&gt; &lt;/div&gt; &lt;% end %&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; This doesn't work because @node is nil - i.e. it wasn't passed. I can't pass that variable from my _footer partial, so I want to be able to pass it in the original execution of the modal. How do I do that? Or how do I do this in another way? Edit 1 To add more context, The initial link that is calling the Bootstrap Modal is actually in another partial that had a local variable of node passed to it also. That one is called like this: &lt;%= render partial: "shared/box", locals: {node: node} %> But I need to continue the …
tagged with: ruby-on-rails-4
has answer: http://stackoverflow.com/a/29026886
type: AnsweredQuestion
tagged with: javascript

http://stackoverflow.com/q/28994085
has comment: http://stackoverflow.com/comment/46236723
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46237277
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/46273166
has comment: http://stackoverflow.com/comment/46236497
has title: How can I speed up a very large javascript HTML insertion in Chrome
has body: I have some javascript that generates a large set of HTML and then inserts it into a web page. In Firefox the code runs almost instantaneously; but in Chrome, the code blocks the browser and takes approximately 10 seconds to complete. How can I improve the user experience? I would like to either speed up the code in Chrome, or make the code not block so that I can display a spinner. I've tried so many things I won't bother to list them all here. Here is a jsfiddle with a running, simplified example. And below is the code, minus the very large data array: (Note that underscore.js is used for brevity) var optionsHtml = _.map(data, function(value){ return '&lt;option value="' + value.id + '"&gt;' + value.name + '&lt;/option&gt;'; }).join(''); var selectHtml = '&lt;select multiple&gt;' + optionsHtml + '&lt;/select&gt;'; var fieldSet = document.getElementById('myid'); fieldSet.innerHTML = selectHtml;

http://stackoverflow.com/comment/46344070
comment on: http://stackoverflow.com/a/29052526
score: 0
type: Comment
type: AnswerComment
has text: Thank you for your answer! I need it to be clicked because there are nested items won't show up unless the radio button is clicked and not only checked. I see that you commented "overwriting radio if local storage exists", that's what I'm looking for! but I need to overwrites and click if local storage exists. So, if "radio2" exists in local storage, it trigger a click on it. I tried to append this part `.trigger("click");` to the code of local storage but it didn't work. I hope you can help me with this part. Many thanks.

http://stackoverflow.com/comment/46314739
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29021923
has text: I would recommend using the gwt FocusPanel for handling this. It is a great way to help manage the events for things like this without having to use the NativeEvents. This will also allow you to dispatch the events using fireEvent rather than the element dispatch.

http://stackoverflow.com/comment/46105264
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28921342
has text: @JoeEnzminger can you tell more about _Using $rootScope is generally frowned upon as a way to share data across controllers_? I don't want to follow bad practice - is there a better way of doing this?
score: 0

http://stackoverflow.com/comment/46335837
score: 0
type: Comment
type: QuestionComment
has text: Is this supposed to be some feigned security feature? Because that's not going to work. You can differentiate between HTTP ("direct") requests, and PHP includes from a different invocation script. But there's no reliable way to figure out the HTML link origin or discern between include/require/_once etc.
comment on: http://stackoverflow.com/q/29048740

http://stackoverflow.com/q/28952509
has answer: http://stackoverflow.com/a/28953042
score: 7
upvote count: 7
type: Question
has title: jQuery: how to get the index of an element in the selection array?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28953042
answer count: 3
downvote count: 0
tagged with: jquery
has body: I have an HTML structure like this: 1 2 3 4 5 6 I select all the A-s with jQuery, and get a total of 6 objects here. I want to get the index of the A in the array of 6 (so I can detect which A has been clicked, for example), but when I use .index() I get the index of the element relative to its parent. So for the 5th A I get the same index as for the 2nd, because te 5th is actually the second in its group within its div.item: $('a').click(function(){ console.log ( $(this).index() ); // returns "1" for the 5th A }); So is there a way to get the index of the clicked element within the array of the selection, instead of within the parent in the DOM?
favorite count: 0
possible better answer: http://stackoverflow.com/a/28952577
tagged with: frontend
has answer: http://stackoverflow.com/a/28952577
has answer: http://stackoverflow.com/a/28952596
type: AnsweredQuestion

http://stackoverflow.com/comment/46306862
type: Comment
type: QuestionComment
has text: @ajaykumartak — live had a replacement before it was removed from jQuery, there is no need to use an obsolete version of the library.
comment on: http://stackoverflow.com/q/29032841
score: 0

http://stackoverflow.com/comment/46328893
type: Comment
type: AnswerComment
has text: Quick question: why do I have to wrap a `function()` around the `Array.prototype` part to get it to work? If I try `"theArray" : Array.prototype.slice.call(document.querySelectorAll(MyObject.selectorArray.join() ))` it has a `runtime` error
comment on: http://stackoverflow.com/a/29043968
score: 0

http://stackoverflow.com/comment/46143864
score: 0
type: AnswerComment
type: Comment
has text: What RaviH wrote worked and its is exactly like you said Morphilos, i have to handle the returned async call in the controller and not in the service. Thank you for all the help guys.
comment on: http://stackoverflow.com/a/28944164

http://stackoverflow.com/comment/46277765
has text: Ok - I'm still having trouble but this may be my ineptitude with Javascript. I've edited the original question with the entirety of my entry in Qualtrics. Thoughts?
type: AnswerComment
comment on: http://stackoverflow.com/a/28988563
score: 0
type: Comment

http://stackoverflow.com/comment/46287758
type: QuestionComment
has text: @MichaelP. there says ```if(!_.isNull(...))``` so it is not how you say I guess
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29022245

http://stackoverflow.com/comment/46171252
score: 0
type: Comment
has text: do you need json_encode there? Check if $rs['name'] contains anything. Also you may try to `uft8_encode(json_encode($rs['name']))` if there are any "suspoicious" characters
comment on: http://stackoverflow.com/a/28959197
type: AnswerComment

http://stackoverflow.com/comment/46157934
comment on: http://stackoverflow.com/q/28952047
type: Comment
type: QuestionComment
has text: The output from your API should read the file and create a list of lines. `{ "log": [ "line1", "line2", "line3" ] }`
score: 0

http://stackoverflow.com/q/28945384
type: Question
has comment: http://stackoverflow.com/comment/46145167
upvote count: 0
tagged with: javascript
score: -3
has comment: http://stackoverflow.com/comment/46144854
has title: Changing background color using JavaScript using id
has comment: http://stackoverflow.com/comment/46145142
accepted answer: http://stackoverflow.com/a/28945447
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/46144874
favorite count: 0
has body: I am trying to make an onclick button to change the background color of a div, using its id. My JavaScript function is as follows: function changeButton(color) { document.getElementById('button1').style.backgroundColor = color; } and I'm linking to it in the HTML file like this: &lt;script&gt; src="websiteCleanJS.js" &lt;/script&gt; . . . &lt;div id='button1' onclick="changeButton('red')"&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/46145008
has comment: http://stackoverflow.com/comment/46145440
tagged with: css
has comment: http://stackoverflow.com/comment/46144910
type: AnsweredQuestion
downvote count: 3
has comment: http://stackoverflow.com/comment/46145053
has answer: http://stackoverflow.com/a/28945447

http://stackoverflow.com/comment/46177635
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28962584
has text: Questions asking for opinions is off topic for this site. http://stackoverflow.com/help/how-to-ask, but I would say that is not a good approach as it will become hard to maintain if you get hundreds of schools. I would have a school table with foreign key constraints to tables holding the other data that cannot be normalised
type: Comment

http://stackoverflow.com/comment/46209726
comment on: http://stackoverflow.com/q/28978815
type: Comment
type: QuestionComment
score: 0
has text: @MrAnonymous Actually i have the requirement to keep the 'X' icon.

http://stackoverflow.com/q/28950945
linked to: http://stackoverflow.com/q/10288669
has comment: http://stackoverflow.com/comment/46156088
answer count: 0
has title: NativeJSON.stringify via Rhino Compiler
type: UnansweredQuestion
downvote count: 0
tagged with: rhino
score: 1
tagged with: java
has body: Rhino relies on a different implementation of the JSON.stringify method : NativeJSON It can be accessed when calling a script from inside java: Access Rhino&#39;s native JSON.Stringify from Java I have a script using JSON.stringify. What if I want to compile the script? How do I tell Rhino to invoke the propper method?
has comment: http://stackoverflow.com/comment/46155908
type: Question
upvote count: 1
tagged with: stringify
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/28957323
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You cannot use return statements in asynchronous code, i.e, in the success callback of your ajax-call. Instead, try to check if there are already gigs in the store, in which case you return them, and if there are no gigs in the store you do a request to get some and in the success callback you set the store state to the new data and emit a change that will tell your component to try to fetch the store state again. function getGigsList() { if (_gigs.length &gt; 0) { return _gigs; } //return immediately if data exists reqwest({url:'myapi', type:'get', success:function(resp) { console.log(2); _.gigs = resp.gigs; this.emit(CHANGE_EVENT); }.bind(this)}) return _gigs; //currently an empty array. this way you don't have to check for undefined in the component, you can just iterate over it directly }
score: 4
has comment: http://stackoverflow.com/comment/46220927
has comment: http://stackoverflow.com/comment/46213863
accepted answer of: http://stackoverflow.com/q/28950213
answers question: http://stackoverflow.com/q/28950213

http://stackoverflow.com/comment/46230222
has text: Finally, I fixed this issue syncronizing my selenium-webdriver version with the Protractor's one. But, hey, thanks for all your advices! You really saw a lot of things there with only a small portion of the code. Really appreciated! Thanks!
score: 0
comment on: http://stackoverflow.com/q/28915136
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28970078
type: Question
has answer: http://stackoverflow.com/a/28971067
accepted answer: http://stackoverflow.com/a/28971067
has body: Is there other method than assembling a geometry by myself to get control of each face? I want to create something like an explosion effect, but to get this I have to control each face to move them in different dimensions. Is it possible to "dissasemble" premade geometries (cube, polyhedron etc), or do I have to construct them manually?
answer count: 1
has title: Control over each face of a cube or other geometry in three.js
tagged with: javascript
score: 0
tagged with: three.js
type: AnsweredQuestion

http://stackoverflow.com/comment/46168190
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28957670
has text: What is the question and where is the relevant code?

http://stackoverflow.com/comment/46294954
type: Comment
has text: ok your code looking good but how to use it - in any function or only in script? because i used it by putting it in script and also pressed w but didn't worked. :(
comment on: http://stackoverflow.com/a/29026263
score: 0
type: AnswerComment

jquery-ui
tags question: http://stackoverflow.com/q/29028971
tags question: http://stackoverflow.com/q/28947955
tags question: http://stackoverflow.com/q/29018826
tags question: http://stackoverflow.com/q/29004625
tags question: http://stackoverflow.com/q/29033118
tags question: http://stackoverflow.com/q/28938852
tags question: http://stackoverflow.com/q/28993739
tags question: http://stackoverflow.com/q/28915526
tags question: http://stackoverflow.com/q/29025352
tags question: http://stackoverflow.com/q/29000464
tags question: http://stackoverflow.com/q/29004806
tags question: http://stackoverflow.com/q/28995699
tags question: http://stackoverflow.com/q/28956414
tags question: http://stackoverflow.com/q/29004581
tags question: http://stackoverflow.com/q/28948648
tags question: http://stackoverflow.com/q/29061448
tags question: http://stackoverflow.com/q/28979129
tags question: http://stackoverflow.com/q/29042665
tags question: http://stackoverflow.com/q/29059810
tags question: http://stackoverflow.com/q/29059063
tags question: http://stackoverflow.com/q/29016034
tags question: http://stackoverflow.com/q/29041615
tags question: http://stackoverflow.com/q/28964832
tags question: http://stackoverflow.com/q/29011751
tags question: http://stackoverflow.com/q/29005736
tags question: http://stackoverflow.com/q/29008872
tags question: http://stackoverflow.com/q/28917878
tags question: http://stackoverflow.com/q/29006423
tags question: http://stackoverflow.com/q/28952788
tags question: http://stackoverflow.com/q/29021523
tags question: http://stackoverflow.com/q/29009209
tags question: http://stackoverflow.com/q/28962546
type: Tag
tags question: http://stackoverflow.com/q/29027284
tags question: http://stackoverflow.com/q/28951485
tag name: jquery-ui
tags question: http://stackoverflow.com/q/29047318
tags question: http://stackoverflow.com/q/29005798
tags question: http://stackoverflow.com/q/29028693
tags question: http://stackoverflow.com/q/29032190
tags question: http://stackoverflow.com/q/28962027
tags question: http://stackoverflow.com/q/28943008
tags question: http://stackoverflow.com/q/28984736
tags question: http://stackoverflow.com/q/29050611

http://stackoverflow.com/a/28973396
has comment: http://stackoverflow.com/comment/46200478
type: Answer
has body: In order to prevent the event to redirect you, you just need to add event.preventDefault() in your javascript, like this : $("body").on("click", ".mylink", function(event) { event.preventDefault(); alert('ok'); //should alert ok }); The click should then only trigger the alert I would even add, since you're using jQuery, that you could replace the whole by : $(".mylink").click(function(event) { event.preventDefault(); alert('ok'); }); EDIT : I don't understand which link you want to open, but in order to add a redirection once your alert is done, just do it manually : $(".mylink").click(function(event) { event.preventDefault(); alert('ok'); var url = "http://www.google.com/"; //Define your url here window.location = url; }); EDIT EDIT : if your code is $(function(){ $(".addv iframe").load(function(){ var iBody = $(".addv iframe").contents().find("body"); var iDiv = iBody.find("a"); alert(iDiv.html()) /*code to change the div content*/ }); }); And you get both iBody and iDiv correctly, then iDiv is a lits of all available in your iframe, so you need to add : var a = iDiv[0] $(a).click(function(event) { event.preventDefault(); alert("ok"); window.location = a.href; }
has comment: http://stackoverflow.com/comment/46198456
has comment: http://stackoverflow.com/comment/46199384
has comment: http://stackoverflow.com/comment/46200114
score: 0
answers question: http://stackoverflow.com/q/28973140

http://stackoverflow.com/comment/46116818
score: 0
type: QuestionComment
has text: don't access using ajax , access pdf file through browser window.open method, it will work.
comment on: http://stackoverflow.com/q/28930423
type: Comment

http://stackoverflow.com/a/28950744
type: Answer
has body: Towards the end of your js you are calling a function called switchImageTwo, which you haven't defined anywhere yet. The js snippet you are unsure about is an example of what the switchImage function could look like (or switchImageTwo in your case). You can put this function with your existing js, above the line $.when.apply... should work.
answers question: http://stackoverflow.com/q/28948295
has comment: http://stackoverflow.com/comment/46186603
score: 0

http://stackoverflow.com/comment/46253568
type: Comment
type: AnswerComment
has text: It works Thank you. Here source and destination should not be belong to the same termset.
score: 0
comment on: http://stackoverflow.com/a/28992756

http://stackoverflow.com/a/28946319
answers question: http://stackoverflow.com/q/28946210
upvote count: 2
type: Answer
score: 2
downvote count: 0
has body: As far as I know, you just need to make some treatment using the native split() method: var str = "maart 2 2015"; var result = str.split(" "); Gives : maart,2,2015 Then you just need to recreate a new string from this array in the order of your choice.

http://stackoverflow.com/comment/46141715
has text: Write it up as a coffeescript version of an IIFE in an answer then - personally I haven't got a clue what it would look like :)
type: QuestionComment
comment on: http://stackoverflow.com/q/28943176
score: 0
type: Comment

http://stackoverflow.com/comment/46297461
type: Comment
comment on: http://stackoverflow.com/a/29011208
has text: @Yaoming your sample does not seem in JSON format, so your need still is not clear. If you want to keep the statuses in array based structure then you have to give indexes to the elements of that array and you can not give their statuses to them as indexes. And same rule applies to the top based array.
type: AnswerComment
score: 1

http://stackoverflow.com/comment/46351228
comment on: http://stackoverflow.com/a/29056828
has text: I copied the above code exactly into Brackets, and it all worked for me, so it isn't a problem with the code. You'll have to go back through on your end and look for the issue - check to see that all of the files are saved (including the CSS), and then check to see if there any typos you might've overlooked.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28973897
has comment: http://stackoverflow.com/comment/46199847
has comment: http://stackoverflow.com/comment/46199169
possible better answer: http://stackoverflow.com/a/28974122
has answer: http://stackoverflow.com/a/28974002
has answer: http://stackoverflow.com/a/28974122
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28974002
tagged with: javascript
type: Question
score: 0
answer count: 2
has title: Bind mouseenter and mouseleave events to multiple elements with same class
has body: I have a number of elements div.teaser that each contain a video wrapped with mediaelementplayer. On mouseenter and mouseleave I want the video to play media.play and stop media.stop respectively. HTML looks like this: ... ... [... and so on] The problem is that if I hover any of the elements they all fire the event. Current jquery is: $('video').mediaelementplayer({ features: [], loop: false, enableAutosize: true, alwaysShowControls: false, iPadUseNativeControls: false, iPhoneUseNativeControls: false, AndroidUseNativeControls: false, alwaysShowHours: false, showTimecodeFrameCount: false, pauseOtherPlayers: true, success: function(media, domElement, player) { $(".teaser").on({ mouseenter: function() { media.play(); }, mouseleave: function() { media.stop(); } }); } // Success }); // mediaelementplayer At a guess I need to tell the function to bind to $(this) div.teaser. I've tried a number of options but none seem to stick. JSFiddle
tagged with: jquery

http://stackoverflow.com/q/28928601
tagged with: node.js
has comment: http://stackoverflow.com/comment/46114815
has body: I am trying to set mixed Schema in ExpressJs I tried to use mongoose.Schema.Types.Mixed didn´t worked and tried explicit as shown bellow but unfortunately it fails with same error: "C:\Program Files (x86)\JetBrains\WebStorm 9.0.3\bin\runnerw.exe" "C:\Program Files (x86)\nodejs\node.exe" app.js c:\Users\User\Desktop\nodekid\node_modules\node-restful\lib\model.js:247 app.getDetail = app.get; ^ TypeError: Cannot read property 'get' of undefined at Function.Model.register (c:\Users\User\Desktop\nodekid\node_modules\node-restful\lib\model.js:247:22) at Object. (c:\Users\User\Desktop\nodekid\routes\api.js:10:8) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (c:\Users\User\Desktop\nodekid\app.js:18:17) at Module._compile (module.js:456:26) Process finished with exit code 8 /** * Created by User on 3/8/2015. */ var restful = require("node-restful"); var mongoose = restful.mongoose; var storeSchema = new mongoose.Schema({ name: String, products: [new mongoose.Schema({ name : String, description : String })] }); module.exports = restful.model("store", storeSchema); /** * Created by User on 3/8/2015. */ var express = require("express"); var router = express().Router; var stores = require ("../models/store"); stores.methods(["get","post","put","delete"]); stores.register(router,"stores"); module.exports = router; New Error: c:\Users\User\Desktop\nodekid\node_modules\node-restful\lib\model.js:228 app[key](prefix + '/:id([0-9a-fA-F]{0,24}$)?', handlerlist); ^ TypeError: Object function createApplication() { var app = function(req, res, next) { app.handle(req, res, next); }; mixin(app, EventEmitter.prototype, false); mixin(app, proto, false); app.request = { proto: req, app: app }; app.response = { proto: res, app: app }; app.init(); return app; } has no method 'get' at Function.Model.…
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/46113684
tagged with: mongoose
tagged with: javascript
score: 0
answer count: 1
has title: Mongoose Mixed Schema not working
has answer: http://stackoverflow.com/a/28936585
has comment: http://stackoverflow.com/comment/46114852
type: UnansweredQuestion

http://stackoverflow.com/comment/46287709
has text: It shows me the old info. What I think is wrong is that typing the new text directly in the input doesn't change value. How can I get what I typed in the input?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29022122

http://stackoverflow.com/q/28980615
has answer: http://stackoverflow.com/a/28982455
tagged with: arrays
has answer: http://stackoverflow.com/a/28981006
tagged with: javascript
has body: I have an array that I need to sort- var array1 = ["AAA","BB","B+","AA+","CC","AA-","B","A","AA"]; After applying filter/sort I want something like – var array1 = ["AAA","AA+","AA","AA-","A","BB","B+","B","CC"]; Here alphabets having higher precedence over operator like after soring AAA should come before AA+ How can I do it?
score: 0
has comment: http://stackoverflow.com/comment/46214319
has comment: http://stackoverflow.com/comment/46211111
possible better answer: http://stackoverflow.com/a/28980892
answer count: 4
has comment: http://stackoverflow.com/comment/46213962
has answer: http://stackoverflow.com/a/28980888
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28982455
has comment: http://stackoverflow.com/comment/46214645
has answer: http://stackoverflow.com/a/28980892
has title: AngularJS/Javascript: Sorting Strings With Operator
type: Question
has comment: http://stackoverflow.com/comment/46212604
has comment: http://stackoverflow.com/comment/46214587

http://stackoverflow.com/comment/46115486
type: AnswerComment
score: 0
type: Comment
has text: Hello, my website i am making is here: http://mathswiki.org/submit/submit.php and the code section is where you insert some code.
comment on: http://stackoverflow.com/a/28929004

http://stackoverflow.com/q/29050818
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/21578446
answer count: 0
type: UnansweredQuestion
has title: NodeJS global objects: GLOBAL, global and root
duplicate of: http://stackoverflow.com/q/21578446
tagged with: node.js
has comment: http://stackoverflow.com/comment/46339647
type: Question
has comment: http://stackoverflow.com/comment/46339617
has body: I've started using nodejs recently (0.12.0) and I'm surprised by that, there are three global objects: GLOBAL, global and root. What is the reason of that?

http://stackoverflow.com/comment/46211634
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28980624
has text: So this isnt going to answer your specific question, but, are you married to using php and mysqli database for your project, or would you consider other data storage methods?
score: 0

http://stackoverflow.com/q/28934776
tagged with: javascript
tagged with: jquery
has title: scroll doesn't work with css()?
score: 0
has comment: http://stackoverflow.com/comment/46125563
has body: $( window ).scroll(function() { $(".navbar .navbar-default").css({"border-bottom":"1px soild #DDD !important"}); }); }); Why my above code doesn't work? I put an alert() within and try to scroll it worked. I want to show a border when the user scrolled down and hide it when it reached the top.
tagged with: css
has comment: http://stackoverflow.com/comment/46125214
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28935074
has answer: http://stackoverflow.com/a/28935074
answer count: 1

http://stackoverflow.com/comment/46304633
score: 1
type: AnswerComment
has text: @JoeAustin The alerts where returning `undefined`, because `stringToNum` was not returning anything. I corrected that here https://jsfiddle.net/g0vwy44n/2/
type: Comment
comment on: http://stackoverflow.com/a/29031033

http://stackoverflow.com/a/28983367
type: Answer
score: 3
has body: That's normal if you only define handler for your endpoints. You should add to your router the http.FileServer handler pointing to the directory that store your project files. Additionally, think about the &lt;base&gt; that to define the root of your relative links, which will prevent errors such as path nesting.
upvote count: 3
has comment: http://stackoverflow.com/comment/46217218
accepted answer of: http://stackoverflow.com/q/28983221
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28983221

http://stackoverflow.com/q/29051125
has title: Retain changed value of a link when clicked after hitting refresh
score: 0
answer count: 1
has body: How do you retain the changed name of a link after a reload or refresh of that page? $("a").click(function(){ $(this).text("Hello"); }); At the moment, if I hit refresh, the link's name will be back to original. In this case, I want to retain the value hello. Help please.
tagged with: jquery
has comment: http://stackoverflow.com/comment/46349864
linked to: http://stackoverflow.com/q/19867599
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29051252
has comment: http://stackoverflow.com/comment/46392053
has comment: http://stackoverflow.com/comment/46340152
type: Question
tagged with: javascript

http://stackoverflow.com/q/29001727
tagged with: javascript
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/29002421
accepted answer: http://stackoverflow.com/a/29001761
score: 1
has body: I am learning to build a simple API, I have the following code creating the following json: Code: $sql = "SELECT * FROM posts WHERE `user_id` = '$user_id' AND post_date &gt; CURDATE() - INTERVAL 2 YEAR ORDER BY post_date DESC "; $result = $dbc-&gt;query($sql); $rows = array(); while ($row = mysqli_fetch_array($result)) { $rows["posts"][$row['post_date']] = $row['post_content']; } echo json_encode($rows); JSON created: {"posts":{"2015-03-03":"33","2014-03-03":"33 33"}} How do I parse this? I know the following code is a good start, but have not been able to go anywhere from there with success: $.ajax({ url : "http://localhost:8888/290_project/api_write.php", dataType: 'json', type: 'get', cache: false, success : function(data){ } }); Maybe I should then do something like in this w3 schools example? var text = '{"employees":[' + '{"firstName":"John","lastName":"Doe" },' + '{"firstName":"Anna","lastName":"Smith" },' + '{"firstName":"Peter","lastName":"Jones" }]}'; obj = JSON.parse(text); document.getElementById("demo").innerHTML = obj.employees[1].firstName + " " + obj.employees[1].lastName; I have yet to have luck thus far with this though, but I know I am so close!
upvote count: 1
tagged with: php
possible better answer: http://stackoverflow.com/a/29001773
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29001773
tagged with: http://stackoverflow.com/tag/json
tagged with: mysql
has answer: http://stackoverflow.com/a/29001761
type: Question
tagged with: api
has title: Parsing JSON objects to post
downvote count: 0

http://stackoverflow.com/comment/46076879
type: QuestionComment
comment on: http://stackoverflow.com/q/28908771
score: 2
type: Comment
has text: This looks an awful lot like a homework assignment?

http://stackoverflow.com/a/29000016
score: 2
answers question: http://stackoverflow.com/q/28999942
type: AcceptedAnswer
downvote count: 0
has body: You need to read the value of username in the submit handler. You are reading the value of of the field #username when the page is loaded which is blank, once you read the value and assign it to a variable, the variable value will not get updated as you update the input value. //dom ready handler jQuery(function ($) { Parse.initialize("u3BTp3Efoko8hbNhl5MCeli8Kd2iiEk8mE4vYgn4", "tQEGymAWeB8Tr2LA3YDGoq2Lt2xpGMW9ikeFSTtD"); //set the user var user = new Parse.User(); $("form").submit(function (event) { //get the input data var username = $('#username').val();//read the user value in s alert("Error: " + username + " "); user.set("username", " " + username + " "); user.set("password", "my pass"); user.set("email", "email@example.com"); // other fields can be set just like with Parse.Object user.set("phone", "415-392-0202"); user.signUp(null, { success: function (user) { // Hooray! Let them use the app now. }, error: function (user, error) { // Show the error message somewhere and let the user try again. alert("Error: " + error.code + " " + error.message); } }); }); })
accepted answer of: http://stackoverflow.com/q/28999942
type: Answer
upvote count: 2

http://stackoverflow.com/q/28921000
score: 0
has answer: http://stackoverflow.com/a/28921677
answer count: 3
has title: Redirect click on table cell to in it
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46099588
has comment: http://stackoverflow.com/comment/46099399
possible better answer: http://stackoverflow.com/a/28921120
has comment: http://stackoverflow.com/comment/46099362
has answer: http://stackoverflow.com/a/28921120
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46099421
accepted answer: http://stackoverflow.com/a/28921827
has comment: http://stackoverflow.com/comment/46099324
has comment: http://stackoverflow.com/comment/46099315
has body: I have a table that has quite large cells and there's link in some of them (a little button to be exact). I want a click on the whole cell to trigger a click of the little button. Here's what I tried but it doesn't work. $(document).ready(function () { $('td').each(function () { var $this = $(this); var $a = $this.find('a'); if ($a) { $this.css('cursor', 'pointer').click(function () { $a.click(); }); } }); }); td { padding: 20px; border: 1px solid red; } L I N K The style is applied all right, but a click on the cell causes a Stack Overflow error in jQuery.
type: Question
has answer: http://stackoverflow.com/a/28921827
has comment: http://stackoverflow.com/comment/46099314
has comment: http://stackoverflow.com/comment/46099320
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/46332659
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29046846
has text: I'm actually trying to get the index number/string value by clicking on the element ( it's a set of boxes). I think i grid [ i ][ j ] would've worked but it returns "undefined". I must be doing something wrong...
type: AnswerComment

http://stackoverflow.com/q/28942724
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46140345
tagged with: http-post
has comment: http://stackoverflow.com/comment/46140400
has title: Use data as post
tagged with: jquery
tagged with: php
has comment: http://stackoverflow.com/comment/46140070
has body: I have one form in PHP, where I can dynamically add or remove rows using jquery for that, with select boxes. So when I click in a button to add another row, I added the content using the .after method. For example: var cnt_class = 2; var count = 1; // adiciona classe $("#add_line_class").click(function(){ $("#tbl_add_class tr").last().after('&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Classe:&lt;/strong&gt;&amp;nbsp;&lt;select name="classe_letter['+count+']" id="classe_letter"&gt;&lt;?php while(!$rs_main_class-&gt;EOF) { ?&gt;&lt;option value="&lt;?=$rs_main_class-&gt;Fields("class")?&gt;"&gt;&lt;?=$rs_main_class-&gt;Fields("class")?&gt;&lt;/option&gt;&lt;?php $rs_main_class-&gt;MoveNext(); } $rs_main_class-&gt;MoveFirst(); ?&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Lugares:&lt;/strong&gt;&amp;nbsp;&lt;input type="text" name="class_pax['+count+']" id="class_pax" value="0" size="5"&gt;&lt;/td&gt;&lt;/tr&gt;'); alert(class_letter[1]); cnt_class++; count++; }); What I pretend is retrieve the values of select box (by the name class_letter). By doing the post of PHP, the jQuery normally I think doesn't pass the values through the post. Should I use a normal post via ajax? Or there is some easier way to do it?
answer count: 0
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/46139948

http://stackoverflow.com/comment/46107277
has text: Yes, jQuery's trigger won't trigger events which jQuery is not aware of.
comment on: http://stackoverflow.com/q/28925459
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29011670
has comment: http://stackoverflow.com/comment/46269518
type: AcceptedAnswer
has body: I would say, that modules should not stop us... we can split the app into many if needed. But I would suggest: Services should be independent on $state.current. We should pass to them function parameters as needed, but these should be resolved outside of the Service body. Bette would be to show it in action - there is one working example This is the service: angular.module('app.sub',['ui.router']) .service('DataService', ['$state', function($state) { return { get: function(stateName, params){ console.log(stateName); console.log(params); return stateName; } } }]); And here is some adjsuted state def: app.config(['$stateProvider', function ($stateProvider) { $stateProvider.state('index', { url: "/a/{param1}", views: { "general": { templateUrl: "tpl.html" } }, resolve: { data: ['DataService','$stateParams' , function(DataService,$stateParams, $state){ return DataService.get('index', $stateParams) }], }, }); }]) Hope it helps a bit. The plunker link Because this approach is ready to test service without any dependency on some "external" $state.current. We can just pass dummy, testing params
has comment: http://stackoverflow.com/comment/46271825
has comment: http://stackoverflow.com/comment/46269904
score: 0
has comment: http://stackoverflow.com/comment/46270008
answers question: http://stackoverflow.com/q/29009715
type: Answer
has comment: http://stackoverflow.com/comment/46269288
has comment: http://stackoverflow.com/comment/46271279
accepted answer of: http://stackoverflow.com/q/29009715
has comment: http://stackoverflow.com/comment/46269180

here-api
tags question: http://stackoverflow.com/q/29014463
tags question: http://stackoverflow.com/q/29032707
type: Tag
tag name: here-api
tags question: http://stackoverflow.com/q/28973123

http://stackoverflow.com/comment/46317493
has text: i want the php code to run once the user clicks on the list element. im pretty new to php so forgive me if i am going about it in the entirely wrong way :p
comment on: http://stackoverflow.com/q/29037740
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28985991
tagged with: preloader
has answer: http://stackoverflow.com/a/29003158
score: -1
type: Question
answer count: 2
upvote count: 0
accepted answer: http://stackoverflow.com/a/29021831
tagged with: javascript
favorite count: 0
has title: How to preload every page with Infinite AJAX Scroll?
tagged with: infinite-scroll
has body: I made a website using Infinite Ajax Scrolling: &lt;script type="text/javascript"&gt; if($(window).width() &gt;= 600){ //activate ias scrolling for windows bigger than 600px var ias = $.ias({ container: "#base-container", item: ".item", pagination: "#pagination", next: ".next a", delay: 1500 }); ias.extension(new IASSpinnerExtension({ src: 'bundles/spinner.gif' })); ias.extension(new IASTriggerExtension({ offset: 100, text: 'Load more' })); ias.extension(new IASNoneLeftExtension({text: 'You reached the end.'})); ias.extension(new IASPagingExtension()); ias.extension(new IASHistoryExtension({ prev: '.prev a' })); } &lt;/script&gt; It works fine but I don't like the way it renders new pages when it comes to images, making the fadein before they are ready. My solution is waiting for the images by adding a simple preloader. The problem is, of course, that it fires only once!: &lt;script type="text/javascript"&gt; $(window).load(function() { // makes sure the whole site is loaded $('#status').fadeOut(); // will first fade out the loading animation $('#preloader').delay(350).fadeOut('slow'); // will fade out the white DIV that covers the website. $('body').delay(350).css({'overflow':'visible'}); }) &lt;/script&gt; How can I preload not once, but every time a new page is appended to the body? I can't picture the solution.
has answer: http://stackoverflow.com/a/29021831
downvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29003158

http://stackoverflow.com/q/29000522
has body: Hi i'm having problem in calling the below javascript after click of a button. I also need a code to insert button with which I can call the below JS function. The only requirement is that the result of the script should not display in the page before click of a button. Further, the button will stay at its position unchanged even after the execution of the script. The page shouldn't reload after clicking on the button. The resultant feed should run below the button only as a section in the page. RSS Feed Widget Quick help needed please.
type: Question
type: AnsweredQuestion
has title: How to call javascript function after click of a button?
downvote count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/29000559
upvote count: 0
answer count: 1
tagged with: button
has comment: http://stackoverflow.com/comment/46248832
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/46248873
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/29000559
score: -5

http://stackoverflow.com/comment/46240205
has text: I mean pictures slider like this one: http://www.jssor.com For example: slider with pictures is placed as background at full width. I just wondering which way in this case will be more efficient/faster so I asked about yours experience.
score: 0
comment on: http://stackoverflow.com/q/28992870
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46214095
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28982292
has text: @A.Wolff : check user is coming form PC/Smart-phone/ordinatory phone
score: 0

http://stackoverflow.com/comment/46241892
type: AnswerComment
comment on: http://stackoverflow.com/a/28996622
type: Comment
has text: @sebe, I added another option which is printing out the ClientID into the javascript code. This would not require a static clientIDMode, but it means you have to use the asp statement everywhere you currently call the ID.
score: 0

file-upload
tags question: http://stackoverflow.com/q/28917058
tags question: http://stackoverflow.com/q/28960788
type: Tag
tags question: http://stackoverflow.com/q/29028592
tags question: http://stackoverflow.com/q/29008100
tags question: http://stackoverflow.com/q/29031965
tags question: http://stackoverflow.com/q/28921837
tags question: http://stackoverflow.com/q/28968980
tag name: file-upload
tags question: http://stackoverflow.com/q/28992196
tags question: http://stackoverflow.com/q/28918057
tags question: http://stackoverflow.com/q/28962057
tags question: http://stackoverflow.com/q/28991788

http://stackoverflow.com/a/29018554
accepted answer of: http://stackoverflow.com/q/29017809
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/66004147
type: Answer
upvote count: 6
has body: Tested and working: reviews_controller.rb : class ReviewsController &lt; ApplicationController def new @review = Review.new @maximum_length = Review.validators_on( :review_text ).first.options[:maximum] end end review.rb : class Review &lt; ActiveRecord::Base validates :review_text, length: { maximum: 200 } end new.html.erb : &lt;%= form_for @review do |f| %&gt; &lt;%= f.text_field :review_text, maxlength: @maximum_length, id: 'review_text' %&gt; Chars left: &lt;span id="counter" data-maximum-length="&lt;%= @maximum_length %&gt;"&gt;&lt;%= @maximum_length %&gt;&lt;/span&gt; &lt;% end %&gt; &lt;script&gt; $(document).ready(function() { var review_text = $("#review_text"); var counter = $("#counter"); var max_length = counter.data("maximum-length"); review_text.keyup(function() { counter.text(max_length - $(this).val().length); }); }); &lt;/script&gt;
score: 6
answers question: http://stackoverflow.com/q/29017809

http://stackoverflow.com/comment/134523876
type: Comment
comment on: http://stackoverflow.com/a/30049984
has text: Fetch is supported by all modern browsers now (excluding IE) https://caniuse.com/fetch
type: AnswerComment
score: 0

http://stackoverflow.com/q/28990298
downvote count: 0
score: 1
favorite count: 0
tagged with: hammer.js
type: Question
has title: Programmatic Event Trigger using Hammer.js
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/40378976
upvote count: 1
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has body: I am finding it very difficult to create programmatic events using Hammer.js. What I would like is to have two elements, when element one is tapped, I would like to fire or trigger or emit an event on the second element as well. My end goal is to use this technique when dragging items. Basically, hold down on an element to create a clone of it, and then emit the drag event on the clone. This would stop dragging the original element and start the drag on the new cloned element. With that said, I've created a simple jsFiddle http://jsfiddle.net/vk3reu0w/1/. It has two div elements. What I am trying to do is have div one be tapped and an event automatically fire a tap event on div two. var buttonOne = document.getElementById("one"); var buttonTwo = document.getElementById("two"); var mc1 = Hammer(buttonOne); var mc2 = Hammer(buttonTwo); mc1.on("tap", function(event) { alert("MC1 Tapped"); console.log("MC1 Tapped"); mc2.emit("tap"); }); mc2.on("tap", function(event) { alert("MC2 Tapped"); console.log("MC2 Tapped"); }); Any help is much appreciated. Thanks.

http://stackoverflow.com/a/29014021
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/46273305
score: 1
answers question: http://stackoverflow.com/q/29013834
has comment: http://stackoverflow.com/comment/46273117
upvote count: 1
has comment: http://stackoverflow.com/comment/46273187
has body: There are two possible strategies here. Update your UI immediately upon receiving response and then re-render if a new value is received Wait until all ajax replies have finished and then render your UI For (1) you should just keep a running total of all items var $dropdown = $('#dropdown'); var renderDropdown = function(reports) { //use lodash or underscore.js here cause implementing this manually is annoying var sortedSelections = _.sortBy(reports, 'order'); var htmlPerItem = sortedSelections.map(function(item) { return '&lt;li&gt;&lt;a ..... &lt;/li&gt;'; }); $dropdown.html(htmlPerItem.join('')); } var reportSelections = []; payloads.map(function(payload) { $.ajax({ ... }) .then(function(response) { reportSelections.push(response); renderDropdown(reportSelections); }) }) for (2) you can use jquery $.when var gettingResults = payloads.map(function(payload) { return $.ajax({ .... }); }); $.when(gettingResults).then(function() { //the first arg will be response1, the second response2, etc var reportSelections = _.sortBy(arguments, 'order'); renderDropdown(reportSelections); }); Note in (1) you render once per item but get an updating view as items come in. In (2) you render only once but have to wait until all loading is complete. Of course a variation of (1) is that you don't re-render anything, but merely insert items into the correct location as they are loaded. That's going to be more difficult to debug and more code so I leave it as an exercise for the reader (use jquery's $.fn.data to store the original item with the element).

http://stackoverflow.com/a/28971795
downvote count: 0
answers question: http://stackoverflow.com/q/28971662
has comment: http://stackoverflow.com/comment/46195121
type: Answer
score: 2
upvote count: 2
has body: Guys for some reason my problem was resolved by refreshing the page.Before refreshing nothing was working
has comment: http://stackoverflow.com/comment/46195677
has comment: http://stackoverflow.com/comment/46195207

http://stackoverflow.com/a/29030064
accepted answer of: http://stackoverflow.com/q/29028751
has body: This seems to be some kind of particle system. I would start the following way: First create a class for a particle, it should have a random x and y coordinate, and it should change it's postion periodically to a random new postion. Then create a lot of instances of the particle and distribute them over the page. http://jsfiddle.net/aggoh0s1/3/ /* each particle will move in a 100px100px square */ var gutterWidth = 100; /* class definition */ var Particle = function(x, y) { var t = this; t.x = x; t.y = y; t.elem = $('&lt;div class="particle" /&gt;'); t.elem.css({ left: x+"px", top: y+"px"}); $('body').append(t.elem); /* create a new position every 500-1000 milliseconds */ var milliSecs = 500 + Math.random() * 500; t.ptinterval = setInterval(function() { var dx = Math.round(Math.random() * gutterWidth); var dy = Math.round(Math.random() * gutterWidth); t.elem.animate({left: (t.x + dx)+"px", top: (t.y + dy) + "px"}, 600); }, milliSecs); }; /* create a 1000px1000px area where particles are placed each 100px */ var particles = []; var newParticle; for(var x = 0; x &lt; 1000; x = x + gutterWidth) { for(var y = 0; y &lt; 1000; y = y + gutterWidth) { newParticle = new Particle(x,y); particles.push(newParticle); } } CSS: .particle { width: 2px; height: 2px; background-color: black; position: absolute; } Using this logic, you could also use a canvas to display the particles instead of a html div like it is done on whois.domaintools.com. The next step should be to connect the particles with lines to each other, and after that some code should hide all particles that are some distance away from the mouse position.
score: 1
answers question: http://stackoverflow.com/q/29028751
has comment: http://stackoverflow.com/comment/46302322
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/122777744
has text: Having similar issue, a native select with options, like, print, open pdf in a new windows/tab, and the change event is not assuming user interaction trust, in Safari at least, and the new tab is being blocked :(
comment on: http://stackoverflow.com/q/29045928
score: 0
type: Comment
type: QuestionComment

boolean
tags question: http://stackoverflow.com/q/28926997
tag name: boolean
tags question: http://stackoverflow.com/q/28993019
tags question: http://stackoverflow.com/q/29019094
type: Tag

http://stackoverflow.com/q/29019173
score: 0
has comment: http://stackoverflow.com/comment/46283988
tagged with: function
answer count: 1
has comment: http://stackoverflow.com/comment/46282432
tagged with: preprocessor
favorite count: 0
has title: Javascript - Programmatically execute method on input of all functions
accepted answer: http://stackoverflow.com/a/29019359
type: AnsweredQuestion
upvote count: 1
tagged with: methods
has body: I would like to add a parser to a list of functions, for example: var list = { function1: function(input){}, function2: function(input){} } and I would like that all the input params are prepocessed with another function. Is that possible? Any suggestion? Thanks in advance
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29019359

http://stackoverflow.com/comment/46148561
score: 0
type: Comment
type: QuestionComment
has text: FabricJS has `canvas.toDataURL` which serializes the current canvas to a dataUrl. From there you can send the dataUrl to an asset manager of your choosing on your server.
comment on: http://stackoverflow.com/q/28943338

http://stackoverflow.com/q/28927236
has answer: http://stackoverflow.com/a/28927267
linked to: http://stackoverflow.com/q/203198
has title: .on("click") wont work on generated td
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/46110772
answer count: 2
upvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28927273
accepted answer: http://stackoverflow.com/a/28927273
favorite count: 0
has body: I have the following table: Transformations This table is filled with generated tds when a user do something.What i want is when a user click on a generated td to show the text of the td he clicked on.I am using the following javascript code: $("#table_tran td").on("click",function(){ alert($(this).html()) }); This code won't work on generated tds.Any ideas? If i use this: Transformations fxfjjf The code will work only for the td "fxfjjf"
possible better answer: http://stackoverflow.com/a/28927267
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/203198
downvote count: 1
type: Question

http://stackoverflow.com/a/28978128
upvote count: 1
type: AcceptedAnswer
has body: Here's another version of the 3rd answer. This one just moves each FILE INPUT after you click on it, so you can see that the next FILE INPUT is now in place to be clicked. Basically, instead of using z-index to rotate the just-clicked FILE INPUT to the bottom of the stack, I am moving it down the page so you can visually see what is happening. jsFiddle Demo Code: var xx, global_cnt = 1; $('#clicker').button(); //use jQueryUI to auto-style the button $('div').click(function(){ xx = global_cnt * 60; $('#real_uploader_' +global_cnt).css({'position':'absolute','top':xx+'px'}); global_cnt++; if ( $('#real_uploader_' +global_cnt).length ){ $('#real_uploader_' +global_cnt).css('z-index','2'); } });
type: Answer
accepted answer of: http://stackoverflow.com/q/28975629
downvote count: 0
answers question: http://stackoverflow.com/q/28975629
score: 1

http://stackoverflow.com/comment/46195933
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28964890
type: Comment
has text: Yeah sorry, I'm getting just more and more confused with javascript. When i start typing for ex. K it will show up Kalista Karma etc. so you don't have to type it all out you just need to choose one and when you do it validation will not accept it and if i type the name of the same champion without clicking on tooltip it will work which is really odd.

http://stackoverflow.com/comment/46294199
type: Comment
type: QuestionComment
has text: Check the nodejs framework.
comment on: http://stackoverflow.com/q/29026031
score: 0

http://stackoverflow.com/comment/46201759
type: AnswerComment
has text: I've created a fiddle, in hopes of better understanding http://jsfiddle.net/amindunited/reh5p0tg/
comment on: http://stackoverflow.com/a/28974858
score: 0
type: Comment

http://stackoverflow.com/comment/46317531
type: Comment
comment on: http://stackoverflow.com/a/29035151
score: 0
has text: @RobMcDougall I agree, only that the Data URI is limited in size.
type: AnswerComment

http://stackoverflow.com/comment/46163223
type: Comment
has text: thank you. i figured it out. all i have to do next is to add .prev to the first implemented prev call and goes for the rest.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28954731

http://stackoverflow.com/comment/46263674
type: Comment
comment on: http://stackoverflow.com/a/29006610
has text: add this into external js not in page document.ready : $(doc).ready(function() { //alert(22); $(doc).on("click",".logclr",function() { alert('Call success'); }); });
type: AnswerComment
score: 0

http://stackoverflow.com/a/28974122
score: 0
type: Answer
has body: Supposed you have this div#video, which contains all these div.teaser. You can attach an event listener like this $('#video').on('mouseenter', 'div.teaser', function() { //do media play }); $('#video').on('mouseleave', 'div.teaser', function() { //do media stop }); To get the div.teaser object use $(this) inside the function
answers question: http://stackoverflow.com/q/28973897

http://stackoverflow.com/comment/46251613
comment on: http://stackoverflow.com/a/29001761
type: Comment
has text: $rows["posts"]["date"][$row['post_date']] = $row['post_content']; this seems like the right direction, but I am not getting what I need.
score: 1
type: AnswerComment

http://stackoverflow.com/a/29015497
answers question: http://stackoverflow.com/q/29007257
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46277301
type: Answer
has body: You can do this by dynamically defining the start and end of the gradient. What colors you want is up to you, but you can use for example HSL color model to "rotate" through a color range with different speed for start and end. Example 1 var ctx = document.querySelector("canvas").getContext("2d"), angleA = Math.random() * 360, // start angle (for HSL) angleB = Math.random() * 360, stepA = 1.2, stepB = 0.7; // "speed" for change function createGradient() { var gr = ctx.createLinearGradient(0, 0, 500, 0); // create gradient gr.addColorStop(0, "hsl(" + (angleA % 360) + ",100%, 50%)"); // start color gr.addColorStop(1, "hsl(" + (angleB % 360) + ",100%, 50%)"); // end color ctx.fillStyle = gr; // set as fill style ctx.fillRect(0, 0, 500, 150); // fill area } // demo loop (function anim() { createGradient(); ctx.clearRect(8,8,484,134); // =========&gt; DRAW YOUR FRONT OBJECTS HERE &lt;========= angleA += stepA; // increase angles angleB += stepB; requestAnimationFrame(anim) })(); &lt;canvas width=500&gt;&lt;/canvas&gt; In the demo above the start and end colors are more or less random, you can instead just give one a head start so the other follows: Example 2 var ctx = document.querySelector("canvas").getContext("2d"), angle = Math.random() * 360, // start angle (for HSL) angleDlt = 60, // 60° ahead step = 1; // "speed" for change function createGradient() { var gr = ctx.createLinearGradient(0, 0, 500, 0); // create gradient gr.addColorStop(0, "hsl(" + (angle % 360) + ",100%, 50%)"); // start color gr.addColorStop(0.5, "hsl(" + ((angle + (angleDlt/2)) % 360) + ",100%, 50%)"); gr.addColorStop(1, "hsl(" + ((angle + angleDlt) % 360) + ",100%, 50%)"); ctx.fillStyle = gr; // set as fill style ctx.fillRect(0, 0, 500, 150); // fill area } // demo loop (function anim() { createGradient(); ctx.clearRect(8,8,484,134); angle += step; // increase angles requestAnimationFrame(anim) })(); &lt;canvas width=500&gt;&lt;/canvas&gt;
has comment: http://stackoverflow.com/comment/46277488
accepted answer of: http://stackoverflow.com/q/29007257

http://stackoverflow.com/a/64999294
upvote count: 1
answers question: http://stackoverflow.com/q/29043562
type: Answer
downvote count: 0
has body: $('.slider').slick({ slidesToShow: 3, slidesToScroll: 1, speed: 500, dots: true, arrows: true, centerMode: false, focusOnSelect: false, autoplay: false, autoplaySpeed: 2000, slide: 'div', nextArrow: ' Next >', prevArrow: ' previous >', }); Result :
score: 1

http://stackoverflow.com/q/28993043
tagged with: jquery
favorite count: 0
has body: I have two selects, the second one changes according to the value of the first one. I use CoffeScript. &lt;%= f.collection_select :type, RequestType.order(:typeName), :id, :typeName, {include_blank:true }, {:class =&gt; "types"} %&gt; &lt;%= f.grouped_collection_select :subtype, RequestType.order(:typeName), :RequestSubTypes, :typeName, :request_type_id, :subTypeName, {include_blank:true}, {:class =&gt; "subTypes" } %&gt; When select 1 changes the options in the second one reloads (options in the second select depend on the option selected in the first. Here is my CoffeScript code: jQuery -&gt; subTypes = $(".subTypes").html() $(".subTypes").parent().hide() $(".types").change -&gt; type = $(".types :selected").text() options = $(subTypes).filter("optgroup[label='#{type}']").html() if options $(".subTypes").html(options) $(".subTypes").parent().show() else $(".subTypes").empty() $(".subTypes").parent().hide() It works, but only after I reload the page. If I access page from general link_to it seems that CoffeScript is not working. So when a navigate to that page I alway have to reload the page. The navigation to the page using link_to looks like ajax, but i am not using ajax. Here is my link_to: &lt;%= link_to "link", new_request_path %&gt;
has answer: http://stackoverflow.com/a/28993317
type: AnsweredQuestion
score: 1
tagged with: coffeescript
upvote count: 1
tagged with: ruby-on-rails
type: Question
has title: CoffeScript works only after page reload in Rails app
accepted answer: http://stackoverflow.com/a/28993317
tagged with: javascript
answer count: 1
downvote count: 0

http://stackoverflow.com/q/28918610
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28918771
has answer: http://stackoverflow.com/a/28918771
has answer: http://stackoverflow.com/a/28918846
has body: I'm trying to modify the following code to output .wav instead of .mp4: node-tts text to speech synthsizer, (OS X) The issue is, I'm not a node.js developer and have no idea how to make the change, and if it is even possible. I'm attempting to speechify an app so that visually impaired users can use it if they are running the TTS server on their LAN. I need .wav output for my project. Can anyone tell me if this is possible and if so, point out where in the code the audio file is actually generated? Presumably this code uses the Mac's built in speech synthesizer to create an audio file and this code just delivers it to the calling client. Note that this server can deliver audio via the built in speakers on the mac or as a response to a Restful API request. I'm only interested in getting the actual audio file as a .wav via the Rest API.
tagged with: macos
tagged with: node.js
tagged with: audio
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28918846
tagged with: javascript
has title: Modify this node.js code to output .wav instead of .mp4?

http://stackoverflow.com/q/28987693
has comment: http://stackoverflow.com/comment/46223805
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29003044
has comment: http://stackoverflow.com/comment/46253134
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28987820
has body: I've been staring at code too long however when I used a simple script to save a form with: endif; header('Location: http:/mysite.com/evo/codesaveindex.php'); ?&gt; at the end the page redirected back to itself just fine, however now I have a longer script here I can't quite figure out where or how to code my redirect: &lt;?php session_start(); $directory = 'users/'.$_SESSION['username'].'/'; //here you can even check if user selected 'Delete' option: if($_POST['Action'] == "DELETE"){ $file_to_delete = $_POST['CodeList']; if(unlink($directory.'/'.$file_to_delete)) echo $file_to_delete." deleted."; else echo "Error deleting file ".$file_to_delete; } if($_POST['Action'] == "SAVE"){ // If a session already exists, this doesn't have any effect. session_start(); // Sets the current directory to the directory this script is running in chdir(dirname(__FILE__)); // Breakpoint if( empty($_SESSION['username']) || $_SESSION['username'] == '' ) echo 'There is no session username'; if( empty($_POST['CodeDescription']) || $_POST['CodeDescription'] == '' ) echo 'There is no POST desired filename'; // This is assuming we are working from the current directory that is running this PHP file. $USER_DIRECTORY = 'users/'.$_SESSION['username']; // Makes the directory if it doesn't exist if(!is_dir($USER_DIRECTORY)): mkdir($USER_DIRECTORY); endif; // Put together the full path of the file we want to create $FILENAME = $USER_DIRECTORY.'/'.$_POST['CodeDescription'].'.txt'; if( !is_file( $FILENAME ) ): // Open the text file, write the contents, and close it. file_put_contents($FILENAME, $_POST['Code']); endif; } ?&gt;
tagged with: php
has title: PHP redirect after form processing
possible better answer: http://stackoverflow.com/a/28987820
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29003044
tagged with: javascript
has answer: http://stackoverflow.com/a/28988758
has comment: http://stackoverflow.com/comment/46223882
has comment: http://stackoverflow.com/comment/46253716

http://stackoverflow.com/comment/46217767
comment on: http://stackoverflow.com/a/28984408
has text: To learn ajax is not difficoult.... If I have time I will post an example for you.... in the menatime you can use any someone else code or even better learn on the web...
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29032059
score: -2
has answer: http://stackoverflow.com/a/29048442
has body: I have this code (JS + PHP) { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2012, 1, 1, &lt;?php echo $i - 1; ?&gt;), y: &lt;?php echo $invertir[$i]; $i++; ?&gt; }, { x: new Date(2…
type: Question
has title: Loop in js with CanvasJS chart
tagged with: for-loop
upvote count: 0
has comment: http://stackoverflow.com/comment/46334356
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: canvasjs
type: UnansweredQuestion
downvote count: 2
tagged with: php
has comment: http://stackoverflow.com/comment/46317175

http://stackoverflow.com/comment/46342944
score: 0
has text: https://github.com/pupunzi/jquery.mb.YTPlayer/wiki#events `YTPStart` use it with `one`, something like `$('#bgndVideo').one("YTPStart",...`
comment on: http://stackoverflow.com/q/29052506
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46280564
comment on: http://stackoverflow.com/a/29017916
has text: Got it to work thanks, also do you have any idea how I would have to modify the code when adding a second parameter? Because I would need comma between the 1st and 2nd parameter, but not when inputting the first
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46211729
type: QuestionComment
score: 0
type: Comment
has text: @DelightedD0D im using php and mysqli database, everything is working on my localhost, but it only can't function when i put on server. Any idea?
comment on: http://stackoverflow.com/q/28980624

http://stackoverflow.com/comment/46276762
has text: @Enzo ... reedited the answer... if you workaround a bit is not hard to do what you want
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29009477
type: AnswerComment

http://stackoverflow.com/comment/46232514
score: 0
type: Comment
has text: https://developer.mozilla.org/en-US/docs/Web/Events/change: _“The change event is fired […] when a change to the element's value **is committed by the user**. Unlike the input event, the change event **is not necessarily fired for each change to an element's value**.”_
type: QuestionComment
comment on: http://stackoverflow.com/q/28991353

http://stackoverflow.com/comment/46325522
type: Comment
comment on: http://stackoverflow.com/a/29042731
has text: see (here)[https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#send()] is states: "Be aware to stop using a plain ArrayBuffer as parameter. This is not part of the XMLHttpRequest specification any longer. Use an ArrayBufferView instead (see compatibility table for version information)." You propobly used GET method before ? Here you use post ..
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46155677
type: AnswerComment
comment on: http://stackoverflow.com/a/28944240
has text: Sorry, my bad, I have been trying in simulator along with the physical keyboard. Your solution works with soft keyboard. +1
score: 0
type: Comment

http://stackoverflow.com/comment/46230670
comment on: http://stackoverflow.com/q/28990973
score: 0
type: Comment
type: QuestionComment
has text: Give it as an answer. You were right.

http://stackoverflow.com/comment/46153995
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28950069
has text: this might help: http://stackoverflow.com/a/12419667/526704

http://stackoverflow.com/comment/46347860
type: Comment
type: QuestionComment
has text: This may be the wrong question, if the intent is to offer the same confirmation dialog on either the browser's `onbeforeunload` event and/or whichever event (may be?) triggered by `window.close()`. I suspect since it's Javascript invoking the latter, the former is not invoked in a way where it's preventable (since it's not user-originating), so you don't get the dialog. Whatever is calling the `window.close()` should call the confirmation code directly before doing the close.
comment on: http://stackoverflow.com/q/29055221
score: 0

http://stackoverflow.com/q/29000952
score: 1
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
linked to: http://stackoverflow.com/q/12684857
has body: I'm working on the js/JQuery project on The Odin Project with a partner, and we've hit a wall with the very last task, which is to increase the opacity of the squares as the mouse reenters them. We got stuck while trying to achieve this via two css classes, and creating mouseenter events for each. Essentially, we want to start with all of the squares being the grey class, and after entering them for the first time, assigning them the fiftyshades class. When subsequently entering them, we want the event handler for the fiftyshades class to increase the opacity. However, once the element has both classes, it never enters the mouseenter function for fiftyshades, only for grey. We've already worked around it by putting the opacity logic inside the grey.mouseenter, but according to this answer, I would think that our original approach should work. That says that both handlers should be called, but debugging I can clearly see that fiftyshades.mouseenter is never entered. This is where we stand after much fiddling with the relevant javascript for this functionality: $("#fiftyshades").click(function() { reset(); $(".grey").mouseenter(function(){ if (!$(this).hasClass("fiftyshades")) { $(this).addClass("fiftyshades"); console.log("Adding fiftyshades") if ($(this).hasClass("fiftyshades")) { console.log("Add was success"); console.log("Classes: ") var className = $(this).attr('class'); console.log(" " + className); } } }); $(".fiftyshades").mouseenter(function(){ var shade = parseFloat($(this).css("opacity")); console.log("Shade: " + shade); if (shade &lt; 1) { $(this).css("opacity", shade + 0.1); } }); }); Here's a fiddle with the full project. Enter some number to start with, then hit Reset fifty shades to access this functionality.
tagged with: css
favorite count: 0
linked to: http://stackoverflow.com/q/1687296
has answer: http://stackoverflow.com/a/29004598
accepted answer: http://stackoverflow.com/a/29004598
has title: Odin Project Etch a sketch issue with multiple event handlers
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/46183541
score: 0
comment on: http://stackoverflow.com/q/28965798
type: QuestionComment
has text: Small performance tip: use document fragment to store dynamically created divs. When a loop finishes than append the fragment to any element you want.
type: Comment

http://stackoverflow.com/comment/46259981
has text: Oh, I found the following question asked by the same person. Apparently, IE passes the GET parameter correctly, but does not set cookies in iframes: http://stackoverflow.com/questions/1329613/issue-with-passing-querystring-parameters-via-http-get-to-an-iframe-in-ie
comment on: http://stackoverflow.com/q/29006745
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/29018211
tagged with: network-programming
tagged with: javascript
score: 0
tagged with: api
answer count: 1
tagged with: oauth
has title: Securely transfer api response to another server?
has body: I need to send the response of a api call to another server, is there a secure way of doing this? I need to make sure that the client server doesn't tamper with the data too. The goal is to allow the user (with there own api key) to make a request to a 3rd party api, and securely give the response to me to verify information. This needs to be done, given that the the 3rd party api doesn't have oauth support.
tagged with: php
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30150841
type: Question

http://stackoverflow.com/comment/46183228
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28965702
score: 0
has text: @Veverke "what is the difference between a Set object and a plain object", could just read the doc ..

http://stackoverflow.com/q/28959048
has answer: http://stackoverflow.com/a/28959090
tagged with: javascript
has body: var Cart = require('/model/cartSchema'); var Cart = require('./model/cartSchema'); var Cart = require('../model/cartSchema'); var Cart = require('model/cartSchema'); I want to know the difference about the code above.
has title: I want to know the difference between './' and '/'
answer count: 1
tagged with: url
favorite count: 0
type: UnansweredQuestion
score: -3
upvote count: 0
downvote count: 3
type: Question

http://stackoverflow.com/a/29034032
downvote count: 0
score: 1
has body: First at all, it's not needed have submit button on a form if you want to use javascript to check all the fields before submitting. I think the smartest way of doing it will be as follow: Your form (without action, submit button, and method. Only identifing each component with id's): &lt;form id="formId"&gt; &lt;input type='text' id="text1"&gt; &lt;input type='text' id="text2"&gt; &lt;input type='text' id="text3"&gt; &lt;input type='button' id="accept"&gt; &lt;input type='button' id="cancel"&gt; &lt;/form&gt; Your javascript (you have to have jQuery added): jQuery("#formId").on("click", "#accept", function(){ //listen the accept button click if(CheckFields()){ //here you check the fields and if they are correct //then get all the input values and do the ajax call sending the data var text1 = jQuery("#text1").val(); var text2 = jQuery("#text2").val(); var text3 = jQuery("#text3").val(); jQuery.ajax({ url: "bla.php", method: "POST", data: { "someTextField1":text1, //In your example "someTextField1" is the name that the bla.php file is waiting for, so if you use the same here, it's not needed to change anything in your backend. "someTextField2":text2, "someTextField3":text3 }, success: function(){ //here you can do whatever you want when the call is success. For example, redirect to other page, clean the form, show an alert, etc. } }); } }); jQuery("#formId").on("click", "#cancel", function(){ //here listen the click on the cancel button //here you can clean the form, etc }); function CheckFields() { //here I did a little change for validating, using jQuery. var x = jQuery("#text1").val(); var result = true; var text = ""; if (x == null || x == "") { text += "Dont forget about the someTextField1.\n"; result = false; } if(!result) alert(text); return result; } I hope it helps you!
upvote count: 1
answers question: http://stackoverflow.com/q/29033257
type: Answer

http://stackoverflow.com/comment/46115847
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28926466
has text: cross-origin block isn't something you use, it's something that happens if you're trying to access json via a different sub-domain/ domain to that serving your page. have you tried adding the error block?

http://stackoverflow.com/comment/46261196
type: QuestionComment
comment on: http://stackoverflow.com/q/29007584
type: Comment
has text: I edited the post, is the button with the value "Save changes"
score: 0

http://stackoverflow.com/comment/46118381
comment on: http://stackoverflow.com/a/28931360
type: Comment
type: AnswerComment
has text: not only on `absolute` but `relative` too ... as long is not `static`, see my answer
score: 0

http://stackoverflow.com/a/29012376
answers question: http://stackoverflow.com/q/29012207
has comment: http://stackoverflow.com/comment/46270329
has body: Your issue is that the value attribute of is a string, so, if you are trying to compare it to 0, I'm assuming that it is a number and you will need to convert it to one, before doing the compare. Change this: var id = $("[id$='ddl1']").val(); . . . to this: var id = parseInt($("[id$='ddl1']").val(), 10); And, if the values of the &lt;options&gt; are not all numbers (with the default being &lt; 0), then you need to make sure that they are. :)
score: 0
has comment: http://stackoverflow.com/comment/46269815
type: Answer

http://stackoverflow.com/comment/46361849
has text: `$(document).ready` has nothing to with using the dollar sign or not. It is paramount to use a document ready call if you don't want broken functionality *especially* if you are calling the script from your head. If the script is executed when it's loaded (without doc.ready) and the elements haven't been loaded yet, your scripts won't work. Therefore, you can use document ready to wait till the document is ready. I have no idea why you think those things are even closely related.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29058303
score: 0

http://stackoverflow.com/q/29007788
has title: How to change class name and data in element using javascript?
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46261085
score: 0
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29007832
has comment: http://stackoverflow.com/comment/46262517
has body: How to change class name and data in element using javascript ? Now i can change class name from class="xxx" to class="yyy" it's ok. But i want to change &lt;img src="http://iconshow.me/media/images/Mixed/Free-Flat-UI-Icons/png/128/heart-24-128.png"/&gt; to &lt;img src="http://image.ohozaa.com/i/c70/cLBh71.png"/&gt; this my demo http://jsfiddle.net/dFp6f/8/ this is javascript code &lt;script&gt; function myFunction() { $("#demo").addClass("yyy").removeClass("xxx"); } &lt;/script&gt; How to do ?
has answer: http://stackoverflow.com/a/29007849
has answer: http://stackoverflow.com/a/29007859
has answer: http://stackoverflow.com/a/29007978
type: Question
has answer: http://stackoverflow.com/a/29007902

http://stackoverflow.com/q/29001682
has comment: http://stackoverflow.com/comment/46251061
type: Question
has body: I have three select elements: a b c d e f g h All three of them must either be empty (first option), or have a value. So is ok but not a kinda thing. I've tried this, but it isn't working as it doesn't allow all three to be empty and quits on the first case if($("#first").val() === "" || $("#second").val() === "" || $("#third").val() === ""){ return false; } Any help? I would like to do this as short/nice looking as possible
has answer: http://stackoverflow.com/a/29001720
score: 0
answer count: 3
tagged with: javascript
has comment: http://stackoverflow.com/comment/46251049
has answer: http://stackoverflow.com/a/29001726
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29001742
accepted answer: http://stackoverflow.com/a/29001726
tagged with: jquery
has answer: http://stackoverflow.com/a/29001742
has title: Check if all dropdowns are empty or not jQuery

http://stackoverflow.com/comment/46112376
has text: i haven't tried nothing i'm still making the slider
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28928073

http://stackoverflow.com/q/29062088
has answer: http://stackoverflow.com/a/29062377
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
type: Question
possible better answer: http://stackoverflow.com/a/29062241
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29062241
tagged with: php
has body: How can i total the value of all textbox having class 1 , 2 and 3 and put it inside sum_1, sum_2 and sum_3 I tried with this way Jquery here : $(document).on("change", ".1", function() { var sum = 0; $(".1").each(function(){ sum += +$(this).val(); }); $(".total").val(sum); }); HTML here : &lt;input type="text" class="1" value="1" /&gt; &lt;input type="text" class="2" value="2" /&gt; &lt;input type="text" class="3" value="5" /&gt; Here is the fiddle http://jsfiddle.net/5gsBV/36/ which works good for one value But how can i do this for 3 values like i asked in the question which is given in this fiddle http://jsfiddle.net/vL6f2tow/1/ Update : And how can i get those values of sum in a total
accepted answer: http://stackoverflow.com/a/29062377
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/29062233
has comment: http://stackoverflow.com/comment/46360514
has title: How to total the values of textbox having same class and put it inside the another textbox using jquery
tagged with: javascript
has comment: http://stackoverflow.com/comment/46360384

http://stackoverflow.com/q/28919966
accepted answer: http://stackoverflow.com/a/28920284
has body: im sure this is a simple question but can't understand why this isn't working. I simply want to set the current time automatically to an input field. I am using Jquery at the moment to accomplish the task. I know jquery works because if I do alert (time); it shows me the time as expected. Just to add, I set the jquery script in a text then referenced into a Content Editor Webpart under the list. Below is the HTML of my input generated by Sharepoint. I decided to target the title as its the only consisting attribute in there. &lt;input type="text" class="ms-long" title="Current time" id="ctl00_m_g_dd7a368d_cc10_4464_a245_c7fc87ae6650_ff2_1_ctl00_ctl00_TextField" maxlength="255" name="ctl00$m$g_dd7a368d_cc10_4464_a245_c7fc87ae6650$ff2_1$ctl00$ctl00$TextField"&gt; Below is the Jquery script I am trying to run. A the moment this script does nothing to my input text box. &lt;script src="//code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; jQuery(document).ready(function($) { var time = (dNow.getMonth()+1) + '/' + dNow.getDate() + '/' + dNow.getFullYear() + ' ' + dNow.getHours() + ':' + dNow.getMinutes(); $("input[Title='Current time']").val(time); }); &lt;/script&gt; Any help would appreciated on this.
tagged with: javascript
tagged with: sharepoint
has comment: http://stackoverflow.com/comment/46097799
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46097650
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: sharepoint-2007
has title: Autofill input text on Sharepoint 2007 using Jquery
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28920284

http://stackoverflow.com/comment/46225096
comment on: http://stackoverflow.com/a/28988250
type: AnswerComment
score: 0
type: Comment
has text: I don't think that regex does what you think it does. The {1} quantifier is meaningless, as "one match" is the default if you don't use a quantifier. The % is optional, so ? would be the correct quantifier. Also, the grouping parenthesis make no sense.

http://stackoverflow.com/comment/46190927
has text: Put the scripts after the Body tags
type: Comment
comment on: http://stackoverflow.com/q/28969541
type: QuestionComment
score: 0

http://stackoverflow.com/a/28955702
has comment: http://stackoverflow.com/comment/46164863
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28955554
downvote count: 0
score: 1
has body: You can actually do it by adding another copy of the pdf file on your webserver and using tcpdf php class, you can actually restrict pages, by deleting remaining pages. require_once('tcpdf_include.php'); $pdf-&gt;deletePage(6,100);//Deletes pages from 6-100 You can have a good read about the complete tcpdf here This is my choice for any pdf handlers on my site.
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28955554

http://stackoverflow.com/q/28921414
accepted answer: http://stackoverflow.com/a/28921612
answer count: 1
downvote count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/28921612
tagged with: text
type: AnsweredQuestion
upvote count: 0
has body: I try to add a value into the text tag of a svg file that is returned from a function in javascript, something like this: How can I return the text and see it when I open the svg file without d3.js. I want to do it all in the same file svg I create... thanks, beni
type: Question
tagged with: javascript
score: -1
has title: how to add svg text tag a value that return from javascript function

http://stackoverflow.com/comment/46207667
type: Comment
comment on: http://stackoverflow.com/q/28948467
type: QuestionComment
has text: http://threejs.org/examples/#webgl_interactive_raycasting_pointcloud
score: 0

http://stackoverflow.com/q/29005962
tagged with: jsviews
tagged with: http://stackoverflow.com/tag/json
type: UnansweredQuestion
has body: Im using JsRender Library for getting elements from a rest call as json this is my Json structure: { "bugs" : [ { "component" : "Rx", "resolution" : "", "status" : "NEW", "summary" : "There is a big delay" }, { "component" : "Rx", "resolution" : "", "status" : "NEW", "summary" : "problem" } ] } I am trying to the access the status but I cannot, I have tried {{&gt;~status}} but none of these worked for me. any suggestions ?
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
tagged with: jsrender
type: Question
has title: jsrender- access elements from complex structure
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/29006161

http://stackoverflow.com/a/28911425
answers question: http://stackoverflow.com/q/28911259
score: 0
type: Answer
has body: Claies has a good point too. if(kel != ''){ //Kelvin is the chosen one }else if(far != ''){ //Fahrenheit is the chosen one }else if(cel != ''){ //Celcius is the chosen one }else{ //User hasn't written anything alert('You need to write something to convert!'); }

http://stackoverflow.com/q/29060373
tagged with: frame-rate
downvote count: 0
type: Question
tagged with: rendering
has title: Rendering lights in JavaScript so slow. Any idea?
score: 1
has body: I have a light-rendering method written in JavaScript, which can set the brightness of each object. If I call rendering objects with this filter in the main loop, it'll be very slow (8-10 fps). Is it too much for JavaScript, or just an unoptimized solution? If I call it outside of the main loop then it's OK. Here is the Animator class, which has that method I wrote about. You should call the renderImage method with the brightness switch. Animator: { // Animator class renderImage: function(ImageObject,imageX,imageY,filterData = []) { /* filterData [] = 0 -&gt; type 1 -&gt; value for filtering */ switch( filterData[0] ) { case 'none': engComponents.ctx.drawImage(ImageObject,imageX,imageY); break; case 'brightness': engComponents.ctx.drawImage(ImageObject,imageX,imageY); pixels = engComponents.ctx.getImageData(imageX,imageY,imageX+50,imageY+50); data = pixels.data; for (var i=0; i&lt;data.length; i+=4) { data[i] += filterData[1]; data[i+1] += filterData[1]; data[i+2] += filterData[1]; } engComponents.ctx.putImageData(pixels,imageX,imageY); break; } Thank you for any helping!
tagged with: canvas
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29061716
accepted answer: http://stackoverflow.com/a/29061716
tagged with: light
type: AnsweredQuestion

http://stackoverflow.com/q/29020400
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29020598
type: Question
has comment: http://stackoverflow.com/comment/46284555
has body: I want to input prices into multiple boxes, with 1 box defaulting to a certain value. The following code only adds the values as strings. How can I do this? Calculator Package Price Equipment Package Submit Total
tagged with: javascript
has title: Adding multiple items
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/29020598

http://stackoverflow.com/q/28976693
upvote count: 1
tagged with: php
tagged with: css
has answer: http://stackoverflow.com/a/28976762
downvote count: 5
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46204570
tagged with: javascript
has title: How retrieve ID from link?
has body: I'm working on a website with PHP and Javascript. What I so far did is list all the rows from my PhpAdmin database. For each of these row, I have a reply link. For example a person leave a message and as the message is listed on my page I have a reply link on the bottom right. The thing is I can have like 200 rows. What I try to do is create a link for each "reply" link in a while loop so that when I click the link it will open a new page with the good question text. My problem is I can't seem to find how to get the good message (either by ID from the database or the link I created in the loop). <?php // Connexion à la base de données include("BDConnect.php"); $reponse = $bdd->query('SELECT * FROM table_commentaires'); // On affiche chaque entrée une à une while ($donnees = $reponse->fetch()) { ?> From: <?php echo $donnees['pseudo'] ?> <?php echo $donnees['comm'] ?> <?php echo "Répondre" ?> <?php } $reponse->closeCursor(); // Termine le traitement de la requête ?>
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/28977447
type: UnansweredQuestion
score: -4
has comment: http://stackoverflow.com/comment/46205007

http://stackoverflow.com/a/29022846
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29002437
has body: Alright I was able to fit this in a different way. I wasn't able to get e.target.templateInstance.model.s.soundId bit to work, so instead on the div that I call the event on (event.target) I gave it an attribute called data-soundid and passed it {{soundref}} from my original template and then where I repeat that template I simply made a function like so: downloady: function (e) { console.log(e.target.getAttribute('data-soundurl')); } Ta da! Very nice solution. Thanks to Eyal who suggested this to me in a previous question. It works like a charm. :-)

http://stackoverflow.com/q/28950587
has body: I have a web app using filesaver.js to create some files that will be downloaded later to a user's computer. I transfered the same scripts files I am using for this web app in my cordova application. Everything is working perfect except the download button I have in my app. It won't fire anything. Is there any cordova plugin to use to get access to the file system of the device or something else I can do? Here is some markup: html Download code Js $(document).ready(function(){ //some functions }); document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { console.log(cordova.file); } var myFileUrl = "kk"; function saveFile (fileName, fileData) { // Get access to the file system window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSystem) { // Create the file. fileSystem.root.getFile(fileName, { create: true, exclusive: false }, function (entry) { // After you save the file, you can access it with this URL myFileUrl = entry.toURL(); entry.createWriter(function (writer) { writer.onwriteend = function (evt) { alert("Successfully saved file to " + myFileUrl); }; // Write to the file writer.write(fileData); }, function (error) { alert("Error: Could not create file writer, " + error.code); }); }, function (error) { alert("Error: Could not create file, " + error.code); }); }, function (evt) { alert("Error: Could not access file system, " + evt.target.error.code); }); } The problem is that by using this code i get no errors but also nothing happens.Any help would be appreciated
tagged with: cordova
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28966545
tagged with: intel-xdk
score: 2
has comment: http://stackoverflow.com/comment/46161605
has title: filesaver.js not working with cordova apps
type: Question
downvote count: 4
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: file-io
has comment: http://stackoverflow.com/comment/46265078
upvote count: 6

http://stackoverflow.com/comment/46726526
score: 0
type: AnswerComment
has text: I think the downvote was unmerited. The question clarity is to blame.
type: Comment
comment on: http://stackoverflow.com/a/29228485

http://stackoverflow.com/a/28953454
answers question: http://stackoverflow.com/q/28952348
upvote count: 5
score: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/46163013
has comment: http://stackoverflow.com/comment/46163501
type: Answer
has body: The best way to send messages from server to client right now is using webSockets. The basic concept is this: Client A loads web page from server B. Client A runs some javascript that creates a webSocket connection to server B. Server B accepts that webSocket connection and the socket stays open for the duration of the life of the web page. Server B registers event handlers to handle incoming messages from the web page. Client A registers event handlers to handle incoming messages from the server. At any point in time, the server can proactively send data to the client page and it will receive that data. At any point in time, the client may sent data to the server and it will receive that data. A popular node.js library that makes webSocket support pretty easy is socket.io. It has both client and server support so you can use the same library for both ends of the connection. The socket.io library supports the .emit() method mentioned in your question for sending a message over an active webSocket connection. You don't directly call functions from client to server. Instead, you send a message that triggers the server to run some particular code or vice versa. This is cooperative programming where the remote end has to be coded to support what you're asking it to do so you can send it a message and some optional data to go with the message and then it can receive that message and data and execute some code with that. So, suppose you wanted the server to tell the client anytime a temperature changed so that the client could display in their web page the updated temperature (I actually have a Raspberry Pi node.js server that does exactly this). In this case, the client web page establishes a webSocket connection to the server when the page loads. Meanwhile, the server has its own process that is monitoring temperature changes. When it sees that the temperature has changed some meaningful amount, it sends a temperature change message to each connected client with the new…
has comment: http://stackoverflow.com/comment/46163082

http://stackoverflow.com/comment/46326558
has text: It depends on whether or not they are using the same controller.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29043162

http://stackoverflow.com/q/28995757
has answer: http://stackoverflow.com/a/29025578
upvote count: 27
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/52823405
has answer: http://stackoverflow.com/a/70884984
downvote count: 0
has body: I am getting the following exception when calling OData from my Kendo ListView: "A binary operator with incompatible types was detected. Found operand types 'Edm.Guid' and 'Edm.String' for operator kind 'Equal'" DECODED FILTER: $filter=OrganizationId eq '4c2c1c1e-1838-42ca-b730-399816de85f8' ENCODED FILTER: %24filter=OrganizationId+eq+%274c2c1c1e-1838-42ca-b730-399816de85f8%27 HAVE ALSO UNSUCESSFULLY TRIED THESE FILTERS: $filter=OrganizationId eq guid'4c2c1c1e-1838-42ca-b730-399816de85f8' $filter=OrganizationId eq cast('4c2c1c1e-1838-42ca-b730-399816de85f8', Edm.Guid) MY WEB API CALL LOOKS LIKE: // GET: odata/Sites [HttpGet] [EnableQuery] public IHttpActionResult GetSites(ODataQueryOptions&lt;Site&gt; queryOptions) { IQueryable&lt;Site&gt; sites = null; try { queryOptions.Validate(_validationSettings); sites = _siteService.GetAll().OrderBy(x =&gt; x.SiteName); if (sites == null) return NotFound(); } catch (ODataException ex) { TraceHandler.TraceError(ex); return BadRequest(ex.Message); } return Ok(sites); } MY JAVASCRIPT KENDO DATASOURCE LOOKS LIKE: var dataSource = new kendo.data.DataSource({ filter: { field: "OrganizationId", operator: "eq", value: that.settings.current.customer.id }, schema: { data: function (data) { return data.value; }, total: function (data) { return data.length; } }, serverFiltering: true, serverPaging: true, transport: { parameterMap: function (options, type) { var paramMap = kendo.data.transports.odata.parameterMap(options); // Remove invalid Parameters that Web API doesn't support delete paramMap.$inlinecount; // &lt;-- remove inlinecount delete paramMap.$format; // &lt;-- remove format delete paramMap.$callback; // &lt;-- remove callback // PLEASE NOTICE: That I have tried reformatting unsuccessfully //paramMap.$filter = paramMap.$filter.replace("OrganizationId eq ", "OrganizationId eq guid"); //paramMap.$filter = "OrganizationId eq cast('81de6144-987c-4b6f-a9bd-355cb6597fc1', Edm.Guid)"; return paramMap; }, read: { url: buildRoute('odata…
has comment: http://stackoverflow.com/comment/46241800
has comment: http://stackoverflow.com/comment/46265348
possible better answer: http://stackoverflow.com/a/52823405
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/46249594
tagged with: javascript
score: 27
linked to: http://stackoverflow.com/q/3890034
accepted answer: http://stackoverflow.com/a/29025578
answer count: 3
has comment: http://stackoverflow.com/comment/89466640
has comment: http://stackoverflow.com/comment/46240177
tagged with: odata
has title: A binary operator with incompatible types was detected. Found operand types 'Edm.Guid' and 'Edm.String' for operator kind 'Equal'
favorite count: 0
has comment: http://stackoverflow.com/comment/46240047
has comment: http://stackoverflow.com/comment/46241436
tagged with: kendo-ui

http://stackoverflow.com/a/28968707
answers question: http://stackoverflow.com/q/28966476
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28966476
type: Answer
has comment: http://stackoverflow.com/comment/46190537
upvote count: 1
has body: Here you have method just for your needs, copy paste this method: Recursive parse of strings and give char locale compare result not string :) FINAL RESULT Bug Fixed, added compare (incorrect stoppage or recursive loop) to entire strings: String.prototype.MylocaleCompare = function (right, idx){ idx = (idx == undefined) ? 0 : idx++; var run = right.length &lt;= this.length ? (idx &lt; right.length - 1 ? true : false) : (idx &lt; this.length - 1 ? true : false); if (!run) { if (this[0].localeCompare(right[0]) == 0) { return this.localeCompare(right); } else { return this[0].localeCompare(right[0]) } } if(this.localeCompare(right) != this[0].localeCompare(right[0])) { var myLeft = this.slice(1, this.length); var myRight = right.slice(1, right.length); if (myLeft.localeCompare(myRight) != myLeft[0].localeCompare(myRight[0])) { return myLeft.MylocaleCompare(myRight, idx); } else { if (this[0].localeCompare(right[0]) == 0) { return myLeft.MylocaleCompare(myRight, idx); } else { return this[0].localeCompare(right[0]) } } } else { return this.localeCompare(right); } }
has comment: http://stackoverflow.com/comment/46189577
has comment: http://stackoverflow.com/comment/46191065
has comment: http://stackoverflow.com/comment/46190884

http://stackoverflow.com/comment/46349609
comment on: http://stackoverflow.com/q/29056215
has text: sounds like looping through it with regex would be the most straight forward approach
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/a/76924050
has body: It's easy to assign multiple variable names using a returned array, if you don't want to use indexing. Here's how: Write a function foobar() that returns an array: return [foo, bar] assign the returned values to variables with let [myFoo, myBar] = [foo, bar]. now you can use myFoo and myBar elsewhere in your code. Result with your code. (I'm using ECMAScript6 a.k.a. ES6 const rather than var. You could also use let): function getValue(){ const num1 = document.getElementById("firstNum").value; const num2 = document.getElementById("secondNum").value; return [num1, num2]; } function add(){ const [num1, num2] = getValue(); const result = parseFloat(num1) + parseFloat(num2); return result; }
score: 0
answers question: http://stackoverflow.com/q/29044427
type: Answer

http://stackoverflow.com/q/28970323
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28970386
type: Question
has answer: http://stackoverflow.com/a/28970431
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/36141203
has comment: http://stackoverflow.com/comment/46192981
score: 2
has title: jquery functions after append row to table
tagged with: http://stackoverflow.com/tag/html
has body: I need some help so I hope you could help me. I have a table which rows are added this way after click on a button. var row = " some text "; $('#pl_table').append(row); I also have jquery function that adds a class to a row when checkbox is selected. So this class has a .css definition for background color. $('input:checkbox').on('change', function() { if(this.checked) { $(this).closest('tr').addClass('selected'); } else{ $(this).closest('tr').removeClass('selected'); } } The problem is on('change') event is not called for rows added. And it is called for rows that already exist when loading the page. why does this happend? What is wrong on my code? Thank you for your help.
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28970938
upvote count: 2
has answer: http://stackoverflow.com/a/57612783
answer count: 5

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/29036770
tags question: http://stackoverflow.com/q/28959510
tags question: http://stackoverflow.com/q/28916640
tags question: http://stackoverflow.com/q/28920076
type: Tag

http://stackoverflow.com/a/28977223
has comment: http://stackoverflow.com/comment/46206392
has comment: http://stackoverflow.com/comment/46206217
has comment: http://stackoverflow.com/comment/46206345
has comment: http://stackoverflow.com/comment/46206402
has comment: http://stackoverflow.com/comment/46206705
downvote count: 0
has comment: http://stackoverflow.com/comment/46224679
answers question: http://stackoverflow.com/q/28977158
has comment: http://stackoverflow.com/comment/46206410
has comment: http://stackoverflow.com/comment/46206567
has body: There could be multiple ways to solve this, here are a couple of ways. You could use isolated scoped directive (scope:{}) with 2-way (=), based on how you need it. You could also use scope:true, i.e creating a child scope from the directive (if using with ng-repeat you can even use it with no scope since it already creates a child scope). But this approach would be less reusable/flexible as compared to the directive with its own contract(isolate scoped). So you could change your directive to: .directive('myDir', function($compile) { return { scope:{ label:'=myDir' //Set up 2 way binding }, link: function(scope, element, attributes) { // $('.someDiv').jqueryPlugin(...); element.jqueryPlugin(); var el = $compile("&lt;span translate&gt;{{ 'label' }}&lt;/span&gt;")(scope); element.find('.label').html(el); } } }); and bind from your controller, say you have a list of labels. $scope.labels = [{label:'label1'}, {label:'label2'}, {label:'label3'}] then you could just do: &lt;div ng-repeat="item in labels" my-dir="item.label"&gt;&lt;/div&gt;
type: Answer
has comment: http://stackoverflow.com/comment/46206323
has comment: http://stackoverflow.com/comment/46206768
score: 2
has comment: http://stackoverflow.com/comment/46206271
upvote count: 2

http://stackoverflow.com/a/29064880
has body: Like Richard suggests, when a user is created, you can copy the services document to the profile doc. Accounts.onCreateUser(function(options, user) { // We still want the default hook's 'profile' behavior. if (options.profile) { user.profile = options.profile; user.profile.memberSince = new Date(); // Copy data from Facebook to user object user.profile.facebookId = user.services.facebook.id; user.profile.firstName = user.services.facebook.first_name; user.profile.email = user.services.facebook.email; user.profile.link = user.services.facebook.link; } return user; }); Your publication to get their first name and Facebook ID would look like this... /* ============== Single User Data =============== */ Meteor.publish('singleUser', function(id) { check(id, String); return Meteor.users.find(id, {fields: {'profile.facebookId': 1, 'profile.name': 1, 'profile.firstName': 1, 'profile.link': 1}}); }); You can access a user's Facebook avatar with a template helper function... Template.profileView.helpers({ userPicHelper: function() { if (this.profile) { var id = this.profile.facebookId; var img = 'http://graph.facebook.com/' + id + '/picture?type=square&amp;height=160&amp;width=160'; return img; } } }); In your template, you can then use the following helper (provided you are wrapping this in a block that contains user data): &lt;img src="{{userPicHelper}}" alt="" /&gt;
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29056552
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/46609916
answers question: http://stackoverflow.com/q/29056552
upvote count: 3
has comment: http://stackoverflow.com/comment/46448046
downvote count: 0

http://stackoverflow.com/q/29015027
tagged with: javascript
favorite count: 0
tagged with: firefox-addon
has body: I have a content script that listens to event A. But on the local page script, another function listens to this event A and might stop its propagation. The point is that event A is handled by the local script before the content script, so that I cannot always handle it. How can I reorganize the event propagation?
has title: Prioritize content scripts over local scripts for event handling
tagged with: firefox-addon-sdk
type: UnansweredQuestion
upvote count: 1
score: 1
has answer: http://stackoverflow.com/a/29017989
type: Question
has comment: http://stackoverflow.com/comment/46278158
tagged with: firefox
answer count: 1
downvote count: 0

http://stackoverflow.com/a/28922623
downvote count: 0
answers question: http://stackoverflow.com/q/28922455
upvote count: 2
type: Answer
score: 2
has body: You`re already passing the response to a function. This means you already have the data. Do note: according to the twitch API () you dont get a username from this request. So to get the user you need to update your post request. After you get the post request its fairly easy, Twitch return JSON so you can use $.parseJSON to get the data in an object. // POST for user object $.post("https://api.twitch.tv/kraken/oauth2/token", { client_id: clientID, client_secret: clientSecret, grant_type : 'authorization_code', redirect_uri: redirectURI, code: user_code}, function(data) { var obj = $.parseJSON( data ); //parses the JSON var user = obj.user; //reads the element user from the JSON $( body ).append( user ); //I wouldnt advice doing it like this but for demonstrating purposes... grabUserAccessTok(data); }); Best would be to write this code in your grabUserAccessTok and seperate the UI part from the retrieval/parsing part

http://stackoverflow.com/comment/46261085
type: Comment
has text: http://jsfiddle.net/satpalsingh/af2uq3oz/ Use `.prop()` to change src property of img
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29007788

http://stackoverflow.com/q/29041928
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46324426
has body: I am running an ExpressJS application with EJS as my templating engine and I am running into an issue where I want to display the items in my array in a comma separated format like so, test, list, chair, but currently I display all of my items in a vertical list. What is the best way to do this? Here is my loop: Tags: <% for(var i=0; i<blogpost.tags.length; i++) { %> <a href="/tag/<%= blogpost.tags[i] %>"><%= blogpost.tags[i] %> <% } %>
tagged with: ejs
has comment: http://stackoverflow.com/comment/46324280
upvote count: 1
has title: Properly Loop Array Items in Comma Separated Format
type: UnansweredQuestion
tagged with: node.js
answer count: 0
downvote count: 0
score: 1
favorite count: 0

http://stackoverflow.com/a/29009342
has comment: http://stackoverflow.com/comment/46264128
has comment: http://stackoverflow.com/comment/46264011
upvote count: 2
has comment: http://stackoverflow.com/comment/46263949
has body: It is not the problem with angular, its feature/problem of google chrome. In google chrome, when you console any object, it shows name:object, when you expand it, it points to real time memory location, and even if that memory location is updated after console.log, it expands with updated output. var d=[]; for(var i=0;i&lt;100;i++){ d[i]="val_"+i } console.log(d); //d[60] should be val_60 but will get value 'changed value' when you expand console.log(d[60]); //will print 'val_60' d[60]='changed value' Here is a sample code which you can run in browser and you will get strange result in console. In your case, you are printing an array, google chrome's console will point to that array's memory location. and print that array, when you try to expand that array, it will fetch mealtime information from memory and shows you current status of array. The solution is to use debugger in chrome and inspect that variable before that variable gets change. Another solution is to convert that array into a string using JSON.stringify,
has comment: http://stackoverflow.com/comment/120593481
type: Answer
answers question: http://stackoverflow.com/q/29009012
score: 2
has comment: http://stackoverflow.com/comment/46264061
downvote count: 0
has comment: http://stackoverflow.com/comment/46264370

http://stackoverflow.com/q/29012534
has title: Yii2: Getting Id of a field dynamically
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
answer count: 2
upvote count: 1
tagged with: php
tagged with: yii2
has answer: http://stackoverflow.com/a/38733443
has body: I am using the below code for auto-fill of data from another table, which is working well. <?php $this->registerJs("$('#otinstrumententry-0-instrument_name').on('change',function(){ $.ajax({ url: '".yii\helpers\Url::toRoute("ot-note/instrument")."', dataType: 'json', method: 'GET', data: {id: $(this).val(), }, success: function (data, textStatus, jqXHR) { $('#otinstrumententry-0-instrument_code').val(data.instrument_code); }, error: function (jqXHR, textStatus, errorThrown) { console.log('An error occured!'); alert('Error in ajax request'); } }); });"); ?> The Problem I am now facing is I am adding the repeat fields, where the id is generated dynamically, so my solution above works for the first row only as for successive rows the id of the fields get changed like #otinstrumententry-1-instrument_name and #otinstrumententry-2-instrument_name also #otinstrumententry-1-instrument_code and #otinstrumententry-2-instrument_code How I can address this. my code for adding the rows is like this: Instruments Used <?php $id = 0; ?> <?php foreach ($otinstrumentModels as $otinstrument) { ?> <?= $form->field($otinstument, '[' . $id . ']' . 'instrument_name')->DropDownList(ArrayHelper::map(\app\models\Instrument::find()->all(), 'id', 'instrument_name' ), [ 'prompt' => 'Please Select' ])?> <?= $form->field($otinstrument, '[' . $id . ']' . 'instrument_code')->textInput(['maxlength' => 255]) ?> <?= $form->field($otinstrument, '[' . $id . ']' . 'hrs_time')->textInput(['maxlength' => 255])->label('Hrs-Time') ?> <?= $form->field($otinstrument, '[' . $id . ']' . 'total_charges')->textInput(['maxlength' => 255]) ?> <?php ?> <div style="margin-top: 30px;" class="col-md-3 <?php echo ($id < 1) ? 'dnone' : 'dblock'; ?>" id="divDelete" class="row-fluid"> Remove <?php $id++; ?> <?php } ?> Thanks in advance for a suggestion or any alternative solution on this. EDIT Initially the ajax was not firing at all for the subsequent fields, but after change the code - $this->registerJs("$(document).on('c…
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
score: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/29013454
type: Question

http://stackoverflow.com/a/71414324
type: Answer
answers question: http://stackoverflow.com/q/29050004
upvote count: 4
score: 4
downvote count: 0
has body: As I couldn't find this code anywhere around suggested answers for shallow copy/cloning cases, I'll leave this here: // shortcuts const { create, getOwnPropertyDescriptors, getPrototypeOf } = Object; // utility const shallowClone = source =&gt; create( getPrototypeOf(source), getOwnPropertyDescriptors(source) ); // ... everyday code ... const first = { _counts: 0, get count() { return ++this._counts; } }; first.count; // 1 const second = shallowClone(first); // all accessors are preserved second.count; // 2 second.count; // 3 second.count; // 4 // but `first` is still where it was first.count; // just 2 The main difference compared to Object.assign or {...spread} operations, is that this utility will preserve all accessors, symbols, and so on, in the process, including the inheritance. Every other solution in this space seems to miss the fact cloning, or even copying, is not just about properties values as retrieved once, but accessors and inheritance might be more than welcome in daily cases. For everything else, use native structuredClone method or its polyfill

http://stackoverflow.com/q/29045128
downvote count: 1
type: Question
has body: I am getting the following error and am not sure how to resolve it. I have tried looking at similar errors on SO but am not sure they are applicable. I have an array called 'current'. The issue may be related to scope, but I have tried modifying the scopes of a few variables to global, etc. to make it work and it is not yet. currentLen = current.length - 1; ^ TypeError: Cannot read property 'length' of undefined at Object.&lt;anonymous&gt; (/Users/user/Desktop/blabla.js:41:23) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:929:3
tagged with: javascript
score: -1
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/46329677
favorite count: 0
has title: Javascript TypeError Cannot read property 'length' of undefined
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29045221
tagged with: command-line
has answer: http://stackoverflow.com/a/29045158

http://stackoverflow.com/comment/46086216
score: 0
type: AnswerComment
has text: Just tried your code, but for some reason it doesn't appear as it should on the page and when i log the result it gives me an array with the page html http://puu.sh/gq2yC/42b0d09cf4.png
type: Comment
comment on: http://stackoverflow.com/a/28910838

c#-3.0
type: Tag
tag name: c#-3.0
tags question: http://stackoverflow.com/q/29028592

http://stackoverflow.com/comment/46226892
has text: @user2201629, that's a completely different question, I'm afraid. Mark this as answered and then add a new question.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28987992
type: AnswerComment

http://stackoverflow.com/q/28956060
has comment: http://stackoverflow.com/comment/46165425
has comment: http://stackoverflow.com/comment/46165590
has comment: http://stackoverflow.com/comment/46165570
tagged with: null
has comment: http://stackoverflow.com/comment/46165318
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28956144
has comment: http://stackoverflow.com/comment/46165530
has body: var obj = {}; typeof obj; // returns "object" obj instanceof Object // return true typeof null // returns "object" null instanceof Object // returns false And how about typeof undefined // return "undefined" undefined instanceof undefined // ERROR: Uncaught TypeError: Expecting a function in instanceof check, // but got undefined Why is this the case? I have read a lot about related topics on SO but still can't get this. Understand that 'typeof' would return a String, so it pretty much reflects the rules in Javascript.(eg. null is a object... well fine..) But why "null instanceof Object" return false ? "x instanceof y" Does it mean 'x' has to be created by the 'y' constructor? And for null this is not the case ? EDIT Would really appreciate if you could explain the different intention behind instanceof and typeof otherthan then syntax and return value. Difference between null and undefined typeof null // object (bug in ECMAScript, should be null) typeof undefined // undefined null === undefined // false null == undefined // true REF https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
answer count: 3
score: 2
has title: Javascript confusing syntax inconsistence for null, instanceof and typeof?
has comment: http://stackoverflow.com/comment/46165491
favorite count: 0
has comment: http://stackoverflow.com/comment/46165484
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/28956298
has answer: http://stackoverflow.com/a/28956234
tagged with: object
linked to: http://stackoverflow.com/q/801032
tagged with: oop

http://stackoverflow.com/q/29055675
has answer: http://stackoverflow.com/a/29055969
answer count: 1
tagged with: javascript
favorite count: 0
has title: Curl, Node, JavaScript: Unexpected error
tagged with: node.js
tagged with: curl
upvote count: 0
has comment: http://stackoverflow.com/comment/46348845
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46348790
has comment: http://stackoverflow.com/comment/46348701
linked to: http://stackoverflow.com/q/7172784
type: Question
score: -2
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46348640
downvote count: 2
has body: I'm sending some JSON to a Node server via CURL: curl.exe "-i -X POST -H "Content-Type: application/json" -d '{"command":"print \"foo\"","language":"python","procID":"8540"}' http://127.0.0.1:1337/myServer.js?execute=yes I receive the data just fine, and can print it with console.log(...) which would indicate that it's a string. When I run a JSON.parse(...) on it, I get an error: undefined:1 '{command:print "foo",language:python,port:8080}' ^ SyntaxError: Unexpected token ' Any ideas why this happens? I should note that the JSON sent in the command line: {"command":"print \"foo\"","language":"python","procID":"8540"} passes JSONlint.

http://stackoverflow.com/a/29023492
type: Answer
has body: You can't use an anonymous function. You'll have to use a named function instead: function callHandler(){ // invoking the handler here with arguments handler(this.style.color, this.style.backgroundColor); } domNode.addEventListener("click", callHandler); To remove it you can then call removeEventListener: domNode.removeEventListener('click', callHandler);
score: 4
upvote count: 4
accepted answer of: http://stackoverflow.com/q/29023447
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29023447

http://stackoverflow.com/comment/46205813
has text: is it a mistake of copy&paste `res.send(' ')`? or using same thing in your code?
comment on: http://stackoverflow.com/q/28977389
score: 1
type: Comment
type: QuestionComment

papaparse
type: Tag
tag name: papaparse
tags question: http://stackoverflow.com/q/28959947

performance
tags question: http://stackoverflow.com/q/29058297
tags question: http://stackoverflow.com/q/29055518
tags question: http://stackoverflow.com/q/29021745
tags question: http://stackoverflow.com/q/29005548
tags question: http://stackoverflow.com/q/28947605
tags question: http://stackoverflow.com/q/28992937
tags question: http://stackoverflow.com/q/28975497
tags question: http://stackoverflow.com/q/28976071
tags question: http://stackoverflow.com/q/28946317
tags question: http://stackoverflow.com/q/29011813
tags question: http://stackoverflow.com/q/28960651
tags question: http://stackoverflow.com/q/29046452
tags question: http://stackoverflow.com/q/28943538
tags question: http://stackoverflow.com/q/29004245
tags question: http://stackoverflow.com/q/29002982
tags question: http://stackoverflow.com/q/28954525
tags question: http://stackoverflow.com/q/29030714
tags question: http://stackoverflow.com/q/28933984
tag name: performance
tags question: http://stackoverflow.com/q/28922340
tags question: http://stackoverflow.com/q/28989974
tags question: http://stackoverflow.com/q/28959928
tags question: http://stackoverflow.com/q/29015817
type: Tag
tags question: http://stackoverflow.com/q/28994702
tags question: http://stackoverflow.com/q/29047085
tags question: http://stackoverflow.com/q/28962109

http://stackoverflow.com/comment/46243635
type: QuestionComment
comment on: http://stackoverflow.com/q/28997699
has text: Yeah, what are you getting for the output? Also you don't need to convert the diff to hours, you can just check in your `if` if it's bigger than 3600 seconds.
score: 0
type: Comment

http://stackoverflow.com/comment/46220116
type: QuestionComment
has text: What is your question?
comment on: http://stackoverflow.com/q/28984842
score: 0
type: Comment

http://stackoverflow.com/a/28952839
score: 0
answers question: http://stackoverflow.com/q/28952668
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28952668
has comment: http://stackoverflow.com/comment/46160294
has body: Your image arrow doesn't have any ID. You need to give an id such as &lt;img id="flecha_abajo" /&gt; Then in your function JavaScript showHide() you need to do document.getElementById("flecha_abajo").style.display = none;
type: Answer
has comment: http://stackoverflow.com/comment/46160402
has comment: http://stackoverflow.com/comment/46160404
has comment: http://stackoverflow.com/comment/46159597

http://stackoverflow.com/q/29018057
answer count: 1
tagged with: backbone.js
tagged with: model
tagged with: marionette
accepted answer: http://stackoverflow.com/a/29039618
type: AnsweredQuestion
tagged with: view
has body: I am attempting to pass a model to a LayoutView so that the particular model attributes can be edited in the view. In my ItemView I have an event that grabs the selected model and assigns it to my global App- var ItemView = Backbone.Marionette.ItemView.extend({ template: _.template(ItemTemplate), tagName: "tr", attributes: function(){ return { "id": this.model.get('id'), "class": "tr" }; }, events: { "click #edit" : "edit" }, edit: function() { App.EditModel = this.model; console.log(App.EditModel); // &lt;-- prints out the model successfully App.trigger('edit'); } }) Then, I am using the App.EditModel in my edit view to pass to my template- var Layout = Backbone.Marionette.LayoutView.extend({ model: App.EditModel, template : _.template(EditTemplate), regions : { "HomeRegion": "#home" } }); return Layout; }); And in the browser I am getting- "Uncaught ReferenceError: firstName is not defined" because the model is not being mapped correctly. How should I handle this?
has comment: http://stackoverflow.com/comment/46309091
type: Question
has title: Passing a model to a LayoutView Backbone.Marionette
tagged with: javascript
has comment: http://stackoverflow.com/comment/46306847
has answer: http://stackoverflow.com/a/29039618
has comment: http://stackoverflow.com/comment/46313772
score: 0
has comment: http://stackoverflow.com/comment/46295202

http://stackoverflow.com/q/28921198
possible better answer: http://stackoverflow.com/a/28921601
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: So I'm working on a website and have no clue where to start for the jquery. There are 2 forms, one with 2 radio buttons, and the other with 5 radio buttons. There are 10 different combinations of shirts and pants that can be shown, but only one at a time depending on the combination of radio buttons they have selected. So lets say that shirt 1 is red and shirt 2 is blue. Pants 1 is red, pants 2 is blue, pants 3 is green, and so on. So img11.jpg would be a red shirt and red pants. Img12.jpg is going to be red shirt and blue pants. img21.jpg is blue shirt and red pants. Img23.jpg is blue shirt and green pants. (I've included a diagram to show this better)! And so on and so forth. Anyone have any good links or would like to help make this possible? I don't have much (if any) experience in javascript or jQuery, but here is my HTML: &lt;form&gt; &lt;input type="radio" id="shirt_Red" name="shirt" value="Red" /&gt; &lt;input type="radio" id="shirt_Blue" name="shirt" value="Blue" /&gt; &lt;/form &lt;form&gt; &lt;input type="radio" id="pants_Red" name="pants" value="Red" /&gt; &lt;input type="radio" id="pants_Blue" name="pants" value="Blue" /&gt; &lt;input type="radio" id="pants_Green" name="pants" value="Green" /&gt; &lt;input type="radio" id="pants_Purple" name="pants" value="Purple" /&gt; &lt;input type="radio" id="pants_Pink" name="pants" value="Pink" /&gt; &lt;/form&gt; I'm not even sure if I would use image tags or a background for a div to do this, depending on how it works out with the jQuery or javascript. Thanks!
has answer: http://stackoverflow.com/a/28921357
accepted answer: http://stackoverflow.com/a/28921357
has title: Show/Hide div based on combination of selected radio buttons
score: 1
has comment: http://stackoverflow.com/comment/46099690
has answer: http://stackoverflow.com/a/28921601
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: forms
answer count: 2
tagged with: radio-button

http://stackoverflow.com/comment/46231770
type: QuestionComment
has text: please keep aside angularJS.. just look at the problem i stated above.. do you have solution for that?
comment on: http://stackoverflow.com/q/28987837
score: 0
type: Comment

http://stackoverflow.com/q/29062090
has body: I've been trying to access and fool around with data frames using OpenCPU's JS library for ages now, but no matter what I try, I can't seem to get it to work. Here's my latest code sample, very straightforward: var dat = [1, 2, 3]; var dat2 = ["a", "b", "c"]; var req = ocpu.call("data.frame", { x: dat, y: dat2 }, function(session) { session.getObject(function(data) { alert(data); }); }); Unfortunately, all I get is [object Object],[object Object],[object Object] as the output. What do? The data frame is being created properly; session.getConsole shows me the correct console output. Why won't it return properly? I've tried calling data.frame, as.data.frame on JSON data as well; same problem. I'd appreciate some help. Cheers.
type: Question
tagged with: opencpu
answer count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/r
score: 0
has title: Use data frames with OpenCPU's JavaScript library
has comment: http://stackoverflow.com/comment/46364823
has comment: http://stackoverflow.com/comment/46361685
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46365644
tagged with: dataframe
has answer: http://stackoverflow.com/a/29085134

http://stackoverflow.com/comment/46243906
type: QuestionComment
comment on: http://stackoverflow.com/q/28993429
score: 0
has text: Since Polymer.html only consumes 700 bytes and is done in like 5ms I wouldn't be that interessted in putting effor to reduce the amount of loads. The big thing is polymer.js and it's loaded once and than read from cache. Seems ok for me...
type: Comment

http://stackoverflow.com/q/28987875
has comment: http://stackoverflow.com/comment/46263830
type: Question
tagged with: fb.ui
has title: FB.ui feed isn't accepting parameters
score: 0
tagged with: javascript
tagged with: share
has body: I created a function for the FB.ui feed dialog. It works just fine, when I use the standard example from the documentation - but as soon as I try other parameters, it only shows a blank share dialog. The function is as shown below. /* Share Dialog */ function shareDialog(url, text, picture) { FB.ui({ method: 'feed', link: url, caption: text, picture: picture }, function(response) {}); } All data are fetched through jQuery using the data-tag through a bound click event. The data is fetched correctly - and is parsed through the function above correctly, it seems. I checked using console.log for each of the variables. jQuery('#share').bind('click', function() { var shareurl = jQuery('#share-dialog').data('shareurl'); var sharetext = jQuery('#share-dialog').data('sharetext'); var shareimg = jQuery('#share-dialog').data('shareimg'); shareurl = shareurl.replace('http://','https://'); shareimg = shareimg.replace('http://','https://'); shareDialog(shareurl, sharetext, shareimg); }); Does anyone have any idea why this isn't working? As mentioned - the function is based on the standard example from the documentation, which works just fine. I've tried both with and without the https correction - to no avail.
tagged with: facebook-javascript-sdk
has comment: http://stackoverflow.com/comment/46226025
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/46315405
score: 0
comment on: http://stackoverflow.com/a/29036576
has text: Thank you! Here's the un-minified Satellizer library: https://raw.githubusercontent.com/sahat/satellizer/master/satellizer.js Satellizer has a `set` and a `get` method for the `loginRedirect` variable but I don't think it's externally available. I could be wrong though... I still have a lot to learn about Javascript.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46218364
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28983849
type: Comment
has text: It's working. However, it's a half of I'm trying to do. I need to execute that code, yes, on the server, but not the normal browser like Chrome - in "headless browser". That's why I've been trying to execute it on localhost in the filesystem first.

http://stackoverflow.com/a/29040000
has body: You should reload after execution of your sql like this. $_SESSION['msg'] = "New record created successfully"; header("Location: $url"); // tell the client to load $url exit(); // stop further execution of the current script the $msg should be set via session to be able to show the msg after reload. If you do it like that it is no problem if the user klicks the back button or do a page reload. After reload do: if(isset($_SESSION['msg'])) { echo $_SESSION['msg']; unset($_SESSION['msg']); }
score: 0
has comment: http://stackoverflow.com/comment/46320912
type: Answer
answers question: http://stackoverflow.com/q/29039987
has comment: http://stackoverflow.com/comment/46320812

http://stackoverflow.com/q/28935853
type: UnansweredQuestion
tagged with: mysql
has title: php script execution timeout
has answer: http://stackoverflow.com/a/28938707
has answer: http://stackoverflow.com/a/28935997
has body: I am creating an application to produce a graph using PHP, highcharts and MySQL. There are two pages. The first page is for inputting fields from the users and area for produce charts. In the second page I perform all the calculations for the graph which is to be called through an AJAX call. I want to have 90 plots in a single graph so there are 90 individual MySQL select statements. Each MySQL query returns around 100 or 150 records. The problem is that by the time the script completes execution it is getting timed out. How can I optimize this?
has comment: http://stackoverflow.com/comment/46127474
has answer: http://stackoverflow.com/a/28935995
type: Question
has answer: http://stackoverflow.com/a/28936157
score: 0
has comment: http://stackoverflow.com/comment/46127091
tagged with: javascript
tagged with: php
answer count: 4

http://stackoverflow.com/comment/46231549
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28987837
has text: May be i was not clear in my question title ... i am simply trying to generate an html code ... in my html i am checking object.required = true than add "required" to rendered html code else dont add.

http://stackoverflow.com/comment/46221312
has text: As suggested, I have added an ID to each input, known as name and url respectively
comment on: http://stackoverflow.com/q/28986244
type: QuestionComment
type: Comment
score: 2

http://stackoverflow.com/a/29014547
has body: You can use the regex /"(.+?)"/g to match all quoted text, with a capture group for the command without the quotes. Then you can use "$1" in the replacement string. 'Please use "command1" to accept and "command2" to ignore' .replace(/"(.+?)"/g, '$1');
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29014473
answers question: http://stackoverflow.com/q/29014473
type: AcceptedAnswer
downvote count: 0
score: 1

http://stackoverflow.com/comment/46160517
comment on: http://stackoverflow.com/q/28950071
type: Comment
type: QuestionComment
has text: @Xan Thanks! I forgot the Content Security Policy.
score: 0

http://stackoverflow.com/comment/46172872
has text: wohhhh.. You have the "build automatically" option checked? See it in Project -> build automatically.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28948618
type: Comment

http://stackoverflow.com/q/28937910
accepted answer: http://stackoverflow.com/a/28938093
type: AnsweredQuestion
has body: I want to remove a class inside of an iframe with javascript. The code is here: once the html loads this is displayed in the developer console: The actual code I listed above is not so important, the key take away is that the iframe loads with some angularjs and I'm not able to access the specific class I want and delete it. When I delete the line of code class="powered-by ng-scope active" in the developer console it removes what I want perfectly. However I can't seem to execute code to remove this class in javascript. I've tried $(".powered-by").remove(); and several other methods, but nothing has been able to remove this class. Any help into removing iframe classes would be greatly appreciated. Thanks. `
tagged with: iframe
has comment: http://stackoverflow.com/comment/46131124
type: Question
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/1451208
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Remove Class within an Iframe
tagged with: angularjs
has answer: http://stackoverflow.com/a/28938093

http://stackoverflow.com/a/36391754
downvote count: 0
answers question: http://stackoverflow.com/q/28979662
upvote count: 2
has body: Ruprit, thank you for the tip. Your example did not work for me (in Firefox), but it helped me a lot. Here is my working solution: $(document).on("click", ".disable-after-click", function() { var $this = $(this); if ($this.closest("form")[0].checkValidity()) { $this.attr("disabled", true); $this.text("Saving..."); } }); Since checkValidity() is not a jQuery function but a JavaScript function, you need to access the JavaScript element, not the jQuery object. That's the reason why there has to be [0] behind $this.closest("form"). With this code you only need to add a class="disable-after-click" to the button, input, link or whatever you need...
type: Answer
score: 2

http://stackoverflow.com/comment/46270299
type: Comment
has text: what version of easyui are you using? Also presuming `mytype` and `mysection` are variables?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29011813

http://stackoverflow.com/comment/46085300
score: 0
type: AnswerComment
type: Comment
has text: Fair enough. For my issue I can set it when I have fetched the data through. So cheers.
comment on: http://stackoverflow.com/a/28913410

http://stackoverflow.com/q/28992498
has body: I want to make browser extension for Firefox that detect the ajax code of of website that load the hidden page and redirect to new page ,like if user visit index.php where ajax load the two pages one is hiddenpage.php and redirect to new.php . Is there any other solution to detect this ajax at client side. if (xmlhttp.readyState==4 && xmlhttp.status==200) { //document.getElementById("myDiv").innerHTML=""; } } xmlhttp.open("GET","hidden.php",true); xmlhttp.send(); } HTML click here
has answer: http://stackoverflow.com/a/29050430
accepted answer: http://stackoverflow.com/a/29050430
tagged with: plugins
tagged with: php
has title: create plugins to detect suspicious ajax
type: AnsweredQuestion
type: Question
answer count: 2
tagged with: javascript
tagged with: ajax
score: 0
tagged with: browser-extension
possible better answer: http://stackoverflow.com/a/28992619
has answer: http://stackoverflow.com/a/28992619

http://stackoverflow.com/comment/46352817
comment on: http://stackoverflow.com/q/29058053
score: 0
type: Comment
type: QuestionComment
has text: FQL is deprecated. Use Graph API instead

http://stackoverflow.com/comment/46169035
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28958102
has text: Have you tried anything already? Where did you get stuck? Does it matter if the user is able to circumvent this 24-hour delay (by for example, using a different browser / computer), or does the solution need to be secure?
score: 0

http://stackoverflow.com/q/28990620
has title: Send a variable from Javascript to Javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46229959
has body: I need to send a variable from a script to another script, i hope you can help me. The variable i want to send is "campos" that is a counter. This is the first script: var campos = 0; function agregarCampophp(hola){ // alert(campos); var data = {}; data.pruebaId = $('#prueba').val(); data.deno = $('#subespecifica-descripcion').val(); data.prep = $('#partidaasociada-presupuestop').val(); data.tot = $('#partidaasociada-totalp').val(); // var datad = $.parseJSON(data); // alert(data.prep); campos = campos+1; var NvoCampo= document.createElement("div"); $('#prueba').attr('value',''); $('#subespecifica-descripcion').attr('value',''); $('#partidaasociada-presupuestop').attr('value',''); $('#partidaasociada-totalp').attr('value',''); NvoCampo.id= "divcampo_"+(campos); NvoCampo.innerHTML= " "+ " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " "+ " "; var contenedor= document.getElementById("contenedorcampos"); contenedor.appendChild(NvoCampo); data.part = $('#articupart_'+campos).val(); data.deno = $('#articudeno_'+campos).val(); data.prep = $('#articuprep_'+campos).val(); data.tot = $('#articutot_'+campos).val(); } I need that variable "campos" in this other Script: $('._save').on('click', function(event){ event.preventDefault(); var data = {}; data.campos = $('#c_2').val(); alert(data.campos); data.pruebaId = $('#prueba').val(); data.secId = $('#Hidden1').val(); data.proId = $('#Hidden2').val(); data.subId = $('#Hidden3').val(); data.proyId = $('#Hidden4').val(); data.actId = $('#Hidden5').val(); data.prep = $('#partidaasociada-presupuestop').val(); data.tot = $('#partidaasociada-totalp').val(); data.desc = $('#subespecifica-descripcion').val(); var success = function(data){ console.log("Success!", data); } var error = function(data){ console.log("Error!", data); } // $.ajax({ // url:'index.php?r=partidaasociada/get-linea', // type:'POST', // dataType:'json', // data:data // }, success, error); }); I am trying to get the var…
has comment: http://stackoverflow.com/comment/46237242
has comment: http://stackoverflow.com/comment/46230085
has answer: http://stackoverflow.com/a/28991254
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46230059
has comment: http://stackoverflow.com/comment/46229756
downvote count: 2
has comment: http://stackoverflow.com/comment/46232855
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46230181
accepted answer: http://stackoverflow.com/a/28991254
tagged with: counter
tagged with: javascript
score: -1
answer count: 1
tagged with: variables

http://stackoverflow.com/q/29027514
has answer: http://stackoverflow.com/a/29207283
has comment: http://stackoverflow.com/comment/46299329
tagged with: email
linked to: http://stackoverflow.com/q/776672
has body: I would like to implement a button that takes screenshot of a graph on the UI and attach that screenshot to an outlook email. With this the user is able to send that attachment to other users instantly. This have to be done on single button click. Any ideas would be highly appreciated.
type: Question
accepted answer: http://stackoverflow.com/a/29207283
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29256878
has answer: http://stackoverflow.com/a/29256878
tagged with: outlook
score: 0
has comment: http://stackoverflow.com/comment/46298817
answer count: 2
has comment: http://stackoverflow.com/comment/46297081
has title: Screenshot and outlook email attachment - Javascript implementation
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46297148

http://stackoverflow.com/q/29057388
tagged with: browserify
has title: Dillinger stuck at "prepping all the things" when running locally
tagged with: angularjs
type: UnansweredQuestion
tagged with: node.js
has body: Update: I have checked the console for error, it catches Uncaught ReferenceError: require is not defined According to some online posts, it is probably due to the use of require on the browser side. require is meant to be a syntax for Node, which is used on the server side. But the use of [Browserify][browserify.org/] made this possible. Im not sure how this works but hope someone may give me some advice. I was trying to run Dillinger on my own Macbook Pro (13-inch) I followed the instructions on the README.md but when running locally it shows this. PS. As suggested by post here, I modified the package.json that the dependency installation can proceed. Dropbox config not found at /Users/[name]/dev/dillinger/plugins/dropbox/dropbox-config.json. Plugin disabled. Github config not found at /Users/[name]/dev/dillinger/plugins/github/github-config.json. Plugin disabled. Google Drive config not found at /Users/[name]/dev/dillinger/plugins/googledrive/googledrive-config.json. Plugin disabled. OneDrive config not found at /Users/[name]/dev/dillinger/plugins/onedrive/onedrive-config.json. Plugin disabled. express deprecated app.configure: Check app.get('env') in an if statement app.js:19:5 connect deprecated multipart: use parser (multiparty, busboy, formidable) npm module instead node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:56:20 connect deprecated limit: Restrict request size at location of read node_modules/express/node_modules/connect/lib/middleware/multipart.js:86:15 connect deprecated methodOverride: use method-override npm module instead app.js:27:19 express deprecated app.configure: Check app.get('env') in an if statement app.js:56:5 Express server listening on port 8080 http://localhost:8080 When I send a request, it shows this : Evernote not implemented yet. GET / 200 34.139 ms - - GET /css/app.css 304 4.351 ms - - Then when I tried to open Dillinger at localhost, it is stuck at "Prepping all the things..." Anyone has any idea why this is …
has comment: http://stackoverflow.com/comment/46360223
answer count: 0
has comment: http://stackoverflow.com/comment/46357208
type: Question
tagged with: javascript
tagged with: express
score: 0

http://stackoverflow.com/comment/46302363
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29030275
type: QuestionComment
has text: @TobyCannon heres a link in cse its not displaying http://imgur.com/O7Hu9ZX

http://stackoverflow.com/comment/46093630
comment on: http://stackoverflow.com/a/28917934
score: 0
type: Comment
type: AnswerComment
has text: for me it is working like what it is, when there is not item in array it is not going to loop and when there are value in array it is going to loop , thats it should react.

http://stackoverflow.com/comment/46188982
type: Comment
has text: i think changing the URL just re-runs the content script on the new page
comment on: http://stackoverflow.com/a/28966354
type: AnswerComment
score: 0

http://stackoverflow.com/a/28938914
has comment: http://stackoverflow.com/comment/46133137
has comment: http://stackoverflow.com/comment/46132866
has comment: http://stackoverflow.com/comment/46132969
score: 0
has body: Just Use this may be You want this $('div').on('changeDate', function(e){ // extra sdate = e.date.getDate() +'/'+ (e.date.getMonth()+1) + '/' + e.date.getFullYear(); var getdate = $('p').html(sdate); window.location.href = 'events.html?date='+getdate; });
has comment: http://stackoverflow.com/comment/46132903
type: Answer
answers question: http://stackoverflow.com/q/28938628

http://stackoverflow.com/comment/46212774
type: QuestionComment
has text: In JavaScript, you do not have support of lookbehinds. In C#, you can use this regex: (?<!(?:\r\n){2}(?:[^\r\n]*(?:\r\n))*)(\-.*)(\d+)(?=\r\n) (replace with $1A$2), provided the line endings are [CR][LF]. See demo here: https://www.myregextester.com/?r=cee4c867. To make it work in JavaScript, you'd have to experiment with lookbehind conversion. Have a look at http://stackoverflow.com/questions/641407/javascript-negative-lookbehind-equivalent [Javascript: negative lookbehind equivalent?]
score: 0
comment on: http://stackoverflow.com/q/28980885
type: Comment

http://stackoverflow.com/comment/46362041
score: 1
type: AnswerComment
has text: @kasperTaeymans: No, he's saying `/^([\s\S]*{10}[^\s]*).*/` is not working. He fixed the original problem himself by changing the `.` to `[\s\S]`, but then he broke it again by changing `{11}` to `*{10}`. However, I think it's a mistake to add the `m` and `g` flags. The way I read it, he wants to do one replacement at the beginning of the string, not multiple replacements at the beginning of each line.
type: Comment
comment on: http://stackoverflow.com/a/29059309

http://stackoverflow.com/q/29016985
accepted answer: http://stackoverflow.com/a/29513553
tagged with: javascript
has title: Open UI5 sap-ui-core.js Failed to load resource
score: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/33248411
possible better answer: http://stackoverflow.com/a/69677634
answer count: 4
has answer: http://stackoverflow.com/a/29513553
has answer: http://stackoverflow.com/a/69677634
has answer: http://stackoverflow.com/a/42853584
has body: I've been trying to get started on building OpenUI5 apps using cordova. The latest issue I am facing is that I can't seem to use my local "resources" folder (where all the OpenUI5 js files are stored). I am running the index.html file on chrome with web security disabled to allow for cross platform calls (as I was getting an error for that when running it on chrome in normal mode). I even tried running the index.html page using http-server, but that wouldn't display the page, instead only downloading it whenever I tried to access it on the browser. Now when I try to load the page, chrome's developer tools gives me these errors. The html page has virtually no code. All I am trying to do is open up a blank page with the title "Hello World". Hello World Any solution as to how I can proceed would be highly appreciated. PS: The library js files seem to work fine when accessed using the openui5.hana.ondemand.com/ or sapui5.hana.ondemand.com/ urls in place of "./resources/" PPS: The issue persists on the android emulator as well, so it's not a browser issue, I think.
tagged with: cordova
tagged with: sapui5
type: Question
type: AnsweredQuestion

http://stackoverflow.com/q/28929728
answer count: 1
favorite count: 0
tagged with: backbone.js
has title: Why are children models added to both parent models?
downvote count: 0
has body: I have an example below that creates two parent models and then uses an custom function to push a child model into an array of the parent. JS Bin: http://jsbin.com/hamuro/4/edit?html,console var Child = Backbone.Model.extend({}); var Parent = Backbone.Model.extend({ defaults: { children: [] }, addChild: function() { var child = new Child(); this.get('children').push(child); return child; } }); var parent1 = new Parent(); var parent2 = new Parent(); parent2.addChild(); parent2.addChild(); console.log('Parent 1 Total Children: ' + parent1.get('children').length); console.log('Parent 2 Total Children: ' + parent2.get('children').length); Expected Output: "Parent 1 Total Children: 0" "Parent 2 Total Children: 2" Actual Output: "Parent 1 Total Children: 2" "Parent 2 Total Children: 2" Question: Why are children being pushed to both parent models even though I have only specified children be pushed to parent2?
score: 1
accepted answer: http://stackoverflow.com/a/28929885
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28929885
tagged with: javascript
upvote count: 1

http://stackoverflow.com/a/28987587
accepted answer of: http://stackoverflow.com/q/28987034
score: 12
answers question: http://stackoverflow.com/q/28987034
upvote count: 12
type: AcceptedAnswer
downvote count: 0
has body: The issue may be that you're using the onClick event which won't register on a mobile device (as you don't click - you tap). This answer explains how to use the "touchstart" event which will work on a mobile. https://stackoverflow.com/a/22015946/2619909
type: Answer

http://stackoverflow.com/a/28908993
type: Answer
answers question: http://stackoverflow.com/q/28908771
score: 0
has body: First you should know that you have to define a variable, before it can be used in an Array, so c in your lockers Array would contain a bunch of undefined values. Here's what you are probably looking for. function openLockers(lockerCount, start, every){ var l = lockerCount, a = []; for(var i=0; i&lt;l; i++){ a[i] = false; } for(var i=start; i&lt;l; i+=every){ a[i] = true; } return a; } // 100 lockers open every 2 starting at Array element 1, which is the second Array element var lockers = openLockers(100, 1, 2); true values in the lockers Array represent open lockers while false values represent closed lockers. Note that start is an Array number.

http://stackoverflow.com/q/28964622
tagged with: javascript
tagged with: angularjs-scope
score: 0
tagged with: angular-bootstrap
answer count: 1
tagged with: bootstrap-modal
accepted answer: http://stackoverflow.com/a/28964902
has title: Variable changes from function call not displaying in angular-bootstrap modal window
tagged with: angularjs
type: AnsweredQuestion
has body: I am trying to use angular and bootstrap to create a modal window that displays a youtube video. Following the modal example on the angular bootstrap page worked fine when I hard coded the youtube URL. However when I try to create a variable with the URL in it when the video is selected, I can't seem to keep that variable declared/changed in the instance of the modal window. Here is a plunker demonstrating my problem in the modal example from the Angular site: http://plnkr.co/edit/n1vfSJUhcJWjNlfVrpxA?p=preview The button that launches the modal window calls two functions when clicked: open() and my testFunction(). Open me! This testFunction simply assigns a new value to a $scope variable: $scope.testFunction = function(){ $scope.testFromFunction = "Hey this is a test that was changed in that function!"; }; How can I get {{testFromFunction}} in the modal window to reflect this variable assignment in the modal window? (should say "Hey this is a test that was changed in that function!", rather than "still unchanged") The testFunction equivalent function in my actual app takes the $index and uses it to create the proper youtube URL. I need to dynamically create individual youtube links and cannot hard code them into the html/js. Thank you very much for your time. Let me know if you need more information or if anything is unclear.
has answer: http://stackoverflow.com/a/28964902
type: Question

http://stackoverflow.com/comment/46294115
has text: If you could add your comment to the answer, I will accept it as answer.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28929494

drupal
type: Tag
tag name: drupal
tags question: http://stackoverflow.com/q/29035638
tags question: http://stackoverflow.com/q/29019104

http://stackoverflow.com/comment/46272489
comment on: http://stackoverflow.com/a/29013485
has text: No worries, I meant **your** answer is better, since it has a working example. I upvoted your answer so that it's at the top, remove your upvote on my answer ;)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46222429
type: Comment
comment on: http://stackoverflow.com/a/28986993
has text: it will help you access child text box by ng-model name
type: AnswerComment
score: 0

http://stackoverflow.com/q/29009532
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
accepted answer: http://stackoverflow.com/a/29009643
has title: json response in ajax is correct, but content doesn't update?
has answer: http://stackoverflow.com/a/29010108
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/29009775
upvote count: 1
has comment: http://stackoverflow.com/comment/46264297
downvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29009775
has comment: http://stackoverflow.com/comment/46264440
has answer: http://stackoverflow.com/a/29009643
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29009918
type: Question
has body: I have a script that gets called like this: success: function(json) { if(json.valid == 1) { // some other show/hide here that works correctly $("#div-response-" + id).html(json.message); } else { // some other show/hide here that works correctly $("#div-response-" + id).html(json.message); } } and returns the response like this: {"valid":"1","message":"&lt;span class=\"icon color-red\"&gt;&lt;\/span&gt;"} or {"valid":"0","message":"&lt;span class=\"icon color-black\"&gt;&lt;\/span&gt;"} and the HTML code is: &lt;div id="div-response-&lt;?=$id;?&gt;" data-id="&lt;?=$id;?&gt;"&gt;&lt;/div&gt; For some reason, I can't figure out why ...everything works correctly up to the point when the div should update the information. It just stays empty.

http://stackoverflow.com/comment/46142366
type: Comment
comment on: http://stackoverflow.com/q/28943812
type: QuestionComment
has text: I agree with @RobinLeboeuf, I'm thinking that `editRerenderFix` is not getting ran but something similar is. Either that or there must be an error on the page that you are not catching. If debugging with Chrome Developer Tools (or similar), make sure that you are not filtering out errors, warnings, etc.
score: 0

http://stackoverflow.com/comment/46104636
score: 0
comment on: http://stackoverflow.com/a/28924024
type: Comment
has text: Obviously you will need to include calls to get the angular libraries in!
type: AnswerComment

http://stackoverflow.com/a/29035935
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29035530
has comment: http://stackoverflow.com/comment/46318944
upvote count: 8
has body: You can get the DOM element for the data item by looking for its UID. var item = // the item out of the DataSource that you want to select var listView = $("#listview").data("kendoListView"); listView.select(listView.element.find('[data-uid="' + item.uid + '"]'));
type: Answer
score: 8
has comment: http://stackoverflow.com/comment/46317901
has comment: http://stackoverflow.com/comment/46318476
has comment: http://stackoverflow.com/comment/65257472
answers question: http://stackoverflow.com/q/29035530
type: AcceptedAnswer

http://stackoverflow.com/q/29012458
has comment: http://stackoverflow.com/comment/46270170
favorite count: 0
has answer: http://stackoverflow.com/a/29013002
score: -3
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/46270722
has comment: http://stackoverflow.com/comment/46270541
has comment: http://stackoverflow.com/comment/46269941
type: Question
has comment: http://stackoverflow.com/comment/46270858
has comment: http://stackoverflow.com/comment/46269945
has title: This JS works on my home PC but not when i put it online. Any idea why or how this is?
tagged with: javascript
has comment: http://stackoverflow.com/comment/46269929
accepted answer: http://stackoverflow.com/a/29013002
has comment: http://stackoverflow.com/comment/46269964
downvote count: 3
has body: This JS works on my home PC but not when i put it online. Any idea why or how this is? At bottom of html page I have &lt;!--JAVASCRIPT--&gt; &lt;script type="text/javascript" src="drawUI.js"&gt;&lt;/script&gt; &lt;/body&gt; in the javascript file drawUI.js I have this. I receive no error message. It's as if the javascript just gets skipped or something. I have had other javascripts running on this same website and they work just fine. I as even using the same animation code. (function(){ var ShieldPMax = 2000; var ShieldPMin = 0; var ShieldP = 1750; var ArmorPMax = 2000; var ArmorPMin = 0; var ArmorP= 1875; var BattPMax = 2000; var BattPMin = 0; var BattP= 1360; var TempPMax = 990; var TempPMin = -990; var TempP= 990; var CPUPercPMax = 100; var CPUPercPMin = 0; var CPUPercP= 75; var CPUPMax = 4039; var CPUPMin = 0; var CPUP= 3010; var ShieldUp = true; var ArmorUp = false; var BattUp = true; var TempUp = true; var CPUUp = false; var progress; var start = null; window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; function step(timestamp) { if (start === null) start = timestamp; progress = timestamp - start; //ANIMATION AND TIME BASED ACTIONS GO HERE incrementStats(); requestAnimationFrame(step); //} } requestAnimationFrame(step); function incrementStats(){ if (ShieldUp === true) {++ShieldP}; if (ShieldUp === false) {--ShieldP}; if (ShieldP &lt;ShieldPMin) {ShieldP = ShieldPMin, ShieldUp = true}; if (ShieldP &gt;ShieldPMax) {ShieldP = ShieldPMax, ShieldUp = false}; PlayerShieldUpdateUI(ShieldP, ShieldPMax); if (ArmorUp === true) {++ArmorP}; if (ArmorUp === false) {--ArmorP}; if (ArmorP &lt; ArmorPMin) {ArmorP = ArmorPMin, ArmorUp = true}; if (ArmorP &gt;ArmorPMax) {ArmorP = ArmorPMax, ArmorUp = false}; PlayerArmorUpdateUI(ArmorP, ArmorPMax); if (BattUp === true) {++BattP}; if (BattUp === false) {--BattP}; if (BattP &lt;BattPMin) {BattP = BattPMin, BattUp =…
has comment: http://stackoverflow.com/comment/46270640
answer count: 1

google-maps
tags question: http://stackoverflow.com/q/28915449
tag name: google-maps
tags question: http://stackoverflow.com/q/29026237
tags question: http://stackoverflow.com/q/28937918
tags question: http://stackoverflow.com/q/28942985
tags question: http://stackoverflow.com/q/29022964
tags question: http://stackoverflow.com/q/28998430
tags question: http://stackoverflow.com/q/28907559
tags question: http://stackoverflow.com/q/28931691
tags question: http://stackoverflow.com/q/28956713
tags question: http://stackoverflow.com/q/28920801
tags question: http://stackoverflow.com/q/28927649
tags question: http://stackoverflow.com/q/28935091
tags question: http://stackoverflow.com/q/28927610
tags question: http://stackoverflow.com/q/28982920
tags question: http://stackoverflow.com/q/28986750
tags question: http://stackoverflow.com/q/28944871
tags question: http://stackoverflow.com/q/29026796
tags question: http://stackoverflow.com/q/29045336
tags question: http://stackoverflow.com/q/28956822
tags question: http://stackoverflow.com/q/29059347
tags question: http://stackoverflow.com/q/29012722
tags question: http://stackoverflow.com/q/28975015
tags question: http://stackoverflow.com/q/28932139
tags question: http://stackoverflow.com/q/28926700
tags question: http://stackoverflow.com/q/29035852
tags question: http://stackoverflow.com/q/29025845
tags question: http://stackoverflow.com/q/29012959
tags question: http://stackoverflow.com/q/28924104
tags question: http://stackoverflow.com/q/28936356
tags question: http://stackoverflow.com/q/28921096
tags question: http://stackoverflow.com/q/29036906
tags question: http://stackoverflow.com/q/28963487
tags question: http://stackoverflow.com/q/29030402
tags question: http://stackoverflow.com/q/29001946
tags question: http://stackoverflow.com/q/28948581
tags question: http://stackoverflow.com/q/28915489
tags question: http://stackoverflow.com/q/28945724
tags question: http://stackoverflow.com/q/29018321
tags question: http://stackoverflow.com/q/29040511
tags question: http://stackoverflow.com/q/29003120
tags question: http://stackoverflow.com/q/29031532
tags question: http://stackoverflow.com/q/28972688
tags question: http://stackoverflow.com/q/28962341
type: Tag
tags question: http://stackoverflow.com/q/29015024
tags question: http://stackoverflow.com/q/28997678
tags question: http://stackoverflow.com/q/29023429
tags question: http://stackoverflow.com/q/28906722
tags question: http://stackoverflow.com/q/28950643
tags question: http://stackoverflow.com/q/28951499
tags question: http://stackoverflow.com/q/29058259
tags question: http://stackoverflow.com/q/28914181

http://stackoverflow.com/a/29026739
has body: Change you code to this, &lt;script type="text/javascript"&gt; function setHref() { var flag = &lt;% if (System.Web.HttpContext.Current.Session["Email"] == null &amp;&amp; System.Web.HttpContext.Current.Session["uid"] == null) { response.write("true"); } else { response.write("false"); } %&gt;; if(flag == true) { document.getElementById("anchr").setAttribute('href', "User Login.aspx"); document.getElementById("anchr").innerText = "Create Your Own Package"; } else { document.getElementById("anchr").setAttribute('href', "Cities.aspx"); document.getElementById("anchr").innerText = "Add to Your Package"; } } &lt;/script&gt; In the code we are assigning the output of your server-side code to a JavaScript variable 'flag' and according to its value JavaScript code will assign the href attribute. And we have placed this code in to a JavaScript function, we will call it when document loads, so that it will change 'href' of anchor properly otherwise the code couldn't access anchor tag before it loads. Call the function in body tag like this, &lt;body onload="setHref();"&gt; Hope it works, let me know if you want more help. Thank you.
downvote count: 0
answers question: http://stackoverflow.com/q/29026348
has comment: http://stackoverflow.com/comment/46302362
score: 1
has comment: http://stackoverflow.com/comment/46302112
has comment: http://stackoverflow.com/comment/46298332
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46298282
type: Answer
accepted answer of: http://stackoverflow.com/q/29026348

http://stackoverflow.com/comment/46306387
has text: Still no luck, it just moves the input box to the bottom of the page. I'm also assuming you mean instead of
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29031884

http://stackoverflow.com/q/28928636
has answer: http://stackoverflow.com/a/28928738
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28928839
score: -3
has comment: http://stackoverflow.com/comment/46113150
upvote count: 0
linked to: http://stackoverflow.com/q/14747408
type: Question
tagged with: html-table
answer count: 2
tagged with: javascript
has body: I want to check/uncheck all check boxes of a particular row in a table if Select all Checkbox is selected for that particular row Here is the html for a single row. Admin - Organization <asp:CheckBox cssclass="selectallAO" runat="server" /> <asp:CheckBox cssclass="checkboxAO" ID="chkbxViewAOrganization" runat="server" /> <asp:CheckBox cssclass="checkboxAO" ID="chkbxAddAOrganization" runat="server" /> <asp:CheckBox cssclass="checkboxAO" ID="chkbxEditAOrganization" runat="server" /> <asp:CheckBox cssclass="checkboxAO" ID="chkbxDeleteAOrganization" runat="server" /> There are 5 other rows like this for other pages as well. So, I want to check/uncheck all checkbox's for a particular row for which Select All was checked/unchecked.
tagged with: jquery
tagged with: asp.net
downvote count: 3
has title: Select all checkboxes using Javascript or jQuery
tagged with: http://stackoverflow.com/tag/html
favorite count: 0

http://stackoverflow.com/a/29131030
accepted answer of: http://stackoverflow.com/q/29048932
upvote count: 8
type: AcceptedAnswer
score: 8
has body: The solution was very simple. I just had to add an header of "Allow-Access-Cross-Origin", and it was solved. httpExchange.getResponseHeaders().set("Access-Control-Allow-Origin", "*"); httpExchange.getResponseHeaders().set("Content-Type", "text/plain");
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29048932

http://stackoverflow.com/comment/46339875
type: Comment
score: 0
has text: Doh! how could i not have noticed that? I extended the array prototype and fogot to add the file now i have to figure out how to add that file...
comment on: http://stackoverflow.com/a/29045511
type: AnswerComment

http://stackoverflow.com/q/29033708
tagged with: php
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29034009
tagged with: mysql
has comment: http://stackoverflow.com/comment/46333543
type: Question
score: 0
answer count: 1
tagged with: javascript
has title: Using auto complete textbox get table record from mysql database and shows in text fields
has body: I need to access the table record from the database when they press enter in the autocomplete textbox (at the time of select value), and it shows data in text element. I have tried this code but cannot get the whole record: html code: &lt;input class="form-control" name="sel_product_name" id="sel_product_name" &gt; &lt;input class="form-control" name="sel_product_id" id="sel_product_id"&gt; javascript code: &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#sel_product_name").autocomplete({ source:'autocomplete.php', minLength:1 }); }); &lt;/script&gt; autocomplete.php &lt;?php mysql_connect("localhost","root",""); mysql_select_db("es_restaurant"); $term=$_GET["term"]; $query=mysql_query("SELECT fld_product_id,fld_product_name FROM tbl_product_master_header where fld_product_name like '%".$term."%' "); $json=array(); while($product_name=mysql_fetch_array($query)) { $json[]=array( 'value'=&gt; $product_name["fld_product_name"] //I want to add one more column value to display fld_product_id in //another text box ); } echo json_encode($json); ?&gt;
has comment: http://stackoverflow.com/comment/46308529

http://stackoverflow.com/q/29060089
tagged with: safari
answer count: 0
type: UnansweredQuestion
tagged with: iframe
type: Question
has comment: http://stackoverflow.com/comment/98323406
tagged with: javascript
upvote count: 11
has title: Are safari extensions subject to CSP?
has body: I was making a safari extension which injects iframes into webpages. On doing so, I came across an error. On some webpages, I get an error, Refused to frame 'safari-extension://abcdefgh/hello.html' because it violates the following Content Security Policy directive: "frame-src https: twitter:". I guess that this happens because safari extensions are subject to CSP. However, the same error is not seen in chrome extension when the iframe.src is set to a local file packaged in the extension. How can I resolve this issue? Also, does this have to do only with content-security-policy but also with X-Frame-Options?
downvote count: 0
favorite count: 0
score: 11

http://stackoverflow.com/comment/46303761
score: 0
has text: @robert see this fiddle http://jsfiddle.net/naeemshaikh27/ob5t6tyx/2/ .. value is retained there, you need to change type to text before user starts inputing values in it.. nut when he enters anything.. usually you do it on page load
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29030810

http://stackoverflow.com/comment/46215777
score: 0
comment on: http://stackoverflow.com/q/28982837
type: QuestionComment
has text: @UlukBiy updated question with selectedClient output..
type: Comment

http://stackoverflow.com/a/28924886
has comment: http://stackoverflow.com/comment/46106311
has comment: http://stackoverflow.com/comment/46106151
type: AcceptedAnswer
has body: Do not escape the single quote, write like this : " "+subcat.name+" "
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28924860
has comment: http://stackoverflow.com/comment/46106274
accepted answer of: http://stackoverflow.com/q/28924860
has comment: http://stackoverflow.com/comment/46106204

http://stackoverflow.com/comment/46370280
score: 0
type: Comment
has text: SO doesn't provide a way to direct message, but there are many people here who are great with react, so it would probably be most effective for you if you post your questions. I'm glad you found my responses helpful!
comment on: http://stackoverflow.com/a/29013090
type: AnswerComment

http://stackoverflow.com/comment/46209255
has text: @zacc206 Ah, you want `stopPropagation` my friend :) (an `a` rather than `o`) - A forked pen: http://codepen.io/anon/pen/EadPGK
type: QuestionComment
comment on: http://stackoverflow.com/q/28978629
type: Comment
score: 1

http://stackoverflow.com/q/28950882
has answer: http://stackoverflow.com/a/28969294
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46159879
has title: Get a Google Sheet script to skip empty rows?
type: Question
tagged with: google-apps-script
has comment: http://stackoverflow.com/comment/46165795
score: 2
tagged with: google-sheets
downvote count: 0
has body: I have a script that sends e-mails from a google sheet. The data in the sheet is populated with a google form. A few fields in the sheet use array formulas to add additional data to the sheet example: array formulas in the sheet to populate fields: =ArrayFormula(IF(ROW(A:A)=1,"link",VLOOKUP($C:C,array!$A$2:$C$9000,3,FALSE))) This causes "#N/A" to show in rows where no user has submitted data. I am ok with that but it is causing the script to take a long time to run. When the user submits data, a timestamp is placed in the first column. Can I use that to get the script to skip to stop if empty? Right now, I have the script checking 1000 rows but ideally it would check rows for timestamp and if no timestamp, stop. /** * Add a menu item that calls this script */ function onOpen() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var menu = [{ name: "Send Email", functionName: "uiSendEmail" }]; ss.addMenu("SCCCounseling", menu); } var EMAIL_SENT = "EMAIL_SENT"; /** * Send the e-mail to everyone listed in the spreadsheet */ function uiSendEmail() { var sheet = SpreadsheetApp.getActiveSheet(); var startRow = 2; // First row of data to process var numRows = 1000; var dataRange = sheet.getRange(startRow, 1, numRows, 1000) // Fetch values for each row in the Range. var data = dataRange.getValues(); for (var i = 0; i < data.length; ++i) { var row = data[i]; var timestamp = row[0]; var username = row[1]; var counselor = row[2]; var date = row[3]; var sName = row[4]; var wNum = row[5]; var toemail = row[6]; var sLName= row[7]; var pin = row[8]; var link = row[9]; var cMail = row[10]; var emailSent = row[11]; var subject = "Online Counseling Appointment Confirmation - " + sName + " " + sLName + " " + wNum + " "; var emailBody = "Online Counseling Appointment " + " - " + sName + " " + sLName + " " + wNum + "\n\nHello " + sName + "\n\n\nYou are scheduled for an online counseling appointment for Sacramento City College: " + "\n\n\nDate: " + date + "\n\nPlease follow the instruction…
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/72213672
favorite count: 0
has answer: http://stackoverflow.com/a/28956356

http://stackoverflow.com/q/29040202
has answer: http://stackoverflow.com/a/29040386
possible better answer: http://stackoverflow.com/a/29040268
has answer: http://stackoverflow.com/a/29040277
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46320944
tagged with: javascript
has answer: http://stackoverflow.com/a/29040528
has body: Hello SO I'm relatively new to html and javascript and I currently want to make a page that will fulfill certain operations such as finding the max number of an array of numbers and factorial of a number as shown below. and here is how I am organizing these sections HTML/CSS Responsive Theme Factorial Enter a number Max of Five Numbers Enter 5 numbers Sum and Multiply Enter numbers to apply operations <input type = "text" name = "operationsfield" What I wanted to ask you all is is there a better way to access those functions in my script without having to create another function just to use them?
has comment: http://stackoverflow.com/comment/46320873
downvote count: 0
has comment: http://stackoverflow.com/comment/46321196
favorite count: 0
has answer: http://stackoverflow.com/a/29040268
accepted answer: http://stackoverflow.com/a/29040528
tagged with: http://stackoverflow.com/tag/html
has title: Better way to apply javascript scripts
answer count: 4
type: AnsweredQuestion

http://stackoverflow.com/q/28973220
has answer: http://stackoverflow.com/a/28986804
type: Question
linked to: http://stackoverflow.com/q/70940235
has comment: http://stackoverflow.com/comment/46197824
tagged with: javascript
tagged with: jquery
has title: Karma: uncaught ReferenceError $ is not defined
has comment: http://stackoverflow.com/comment/125440819
has comment: http://stackoverflow.com/comment/46199103
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28986804
score: 13
upvote count: 13
has comment: http://stackoverflow.com/comment/46198177
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46198152
tagged with: karma-runner
linked to: http://stackoverflow.com/q/20938320
has body: I have seen many other answers on this site but none of them worked for me. The problem: I need to load jQuery with an URL, not with a local path; and I think I can't add thoose to "files" on karma.conf.js. Everything seems to be fine, but when I try to use karma to test it, it returns: Uncaught ReferenceError: $ is not defined. The order of the scripts is fine in the two .html we use.

http://stackoverflow.com/q/28930707
upvote count: 0
has answer: http://stackoverflow.com/a/28930932
tagged with: javascript
has answer: http://stackoverflow.com/a/28930729
favorite count: 0
has comment: http://stackoverflow.com/comment/46117102
type: UnansweredQuestion
downvote count: 1
has title: javascript function not working with my html form
score: -1
type: Question
has body: i have an html code for a form and a javascript function that will perform age calculation and populate it in the next page but the calculation is not working. every other field in the form in being displayed in the next page but the calculation is not just working. &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;body&gt; &lt;script src="text/javascript"&gt; function calculate_age(birth_month,birth_day,birth_year) { var today_date = new Date(); var today_year = today_date.getFullYear(); var today_month = today_date.getMonth(); today_day = today_date.getDate(); age = today_year - birth_year; if ( today_month &lt; (birth_month - 1)) { age--; } if (((birth_month - 1) == today_month) &amp;&amp; (today_day &lt; birth_day)) { age--; } return age--; document.getElementById("myForm").innerHTML = window.calculate_age() } &lt;/script&gt; &lt;form action="new1.php" method="post" id="myForm"&gt; First name:&lt;br&gt; &lt;input type="text" name="firstname"&gt; &lt;br&gt; Last name:&lt;br&gt; &lt;input type="text" name="lastname"&gt; &lt;br&gt; Date of Birth:&lt;br&gt; &lt;input type="date" name="age" id="dob" script="calculate_age"&gt; &lt;br&gt;&lt;br&gt; &lt;input type="submit" onclick="calculate_age(birth_month,birth_day,birth_year)" value="Submit"&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;
answer count: 2

http://stackoverflow.com/comment/46173363
has text: You are able to add click events to the [shapes in kinetic](http://www.html5canvastutorials.com/kineticjs/html5-canvas-path-mouseover/), unfortunately I couldn't find a newer version of the kinetic js that is hosted online so I couldn't give you an example. I do like the css clipping though, looks really useful
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28947124

mysql
tags question: http://stackoverflow.com/q/28967521
tags question: http://stackoverflow.com/q/29006467
tags question: http://stackoverflow.com/q/28996695
tags question: http://stackoverflow.com/q/28989340
tags question: http://stackoverflow.com/q/28931512
tag name: mysql
tags question: http://stackoverflow.com/q/28953545
tags question: http://stackoverflow.com/q/28977252
tags question: http://stackoverflow.com/q/28980624
tags question: http://stackoverflow.com/q/29045891
tags question: http://stackoverflow.com/q/29031405
tags question: http://stackoverflow.com/q/28923453
tags question: http://stackoverflow.com/q/28982971
tags question: http://stackoverflow.com/q/28946553
tags question: http://stackoverflow.com/q/29018550
tags question: http://stackoverflow.com/q/28925728
tags question: http://stackoverflow.com/q/28944973
tags question: http://stackoverflow.com/q/28989797
tags question: http://stackoverflow.com/q/28993322
tags question: http://stackoverflow.com/q/28935853
tags question: http://stackoverflow.com/q/28928736
tags question: http://stackoverflow.com/q/28913494
tags question: http://stackoverflow.com/q/29001727
tags question: http://stackoverflow.com/q/28932702
tags question: http://stackoverflow.com/q/28992671
tags question: http://stackoverflow.com/q/28909511
tags question: http://stackoverflow.com/q/28959149
tags question: http://stackoverflow.com/q/29028468
tags question: http://stackoverflow.com/q/29044325
type: Tag
tags question: http://stackoverflow.com/q/29046203
tags question: http://stackoverflow.com/q/28994352
tags question: http://stackoverflow.com/q/29016486
tags question: http://stackoverflow.com/q/28917665
tags question: http://stackoverflow.com/q/28920801
tags question: http://stackoverflow.com/q/29005610
tags question: http://stackoverflow.com/q/28934174
tags question: http://stackoverflow.com/q/28926405
tags question: http://stackoverflow.com/q/28998619
tags question: http://stackoverflow.com/q/29032797
tags question: http://stackoverflow.com/q/28963316
tags question: http://stackoverflow.com/q/28934782
tags question: http://stackoverflow.com/q/29027470
tags question: http://stackoverflow.com/q/29029018
tags question: http://stackoverflow.com/q/29016944
tags question: http://stackoverflow.com/q/28960788
tags question: http://stackoverflow.com/q/28962218
tags question: http://stackoverflow.com/q/29033708
tags question: http://stackoverflow.com/q/28952407
tags question: http://stackoverflow.com/q/29045251
tags question: http://stackoverflow.com/q/29018861
tags question: http://stackoverflow.com/q/29042494
tags question: http://stackoverflow.com/q/28915565
tags question: http://stackoverflow.com/q/28962584
tags question: http://stackoverflow.com/q/29049373

http://stackoverflow.com/a/29053428
has comment: http://stackoverflow.com/comment/46349069
has comment: http://stackoverflow.com/comment/46345491
has comment: http://stackoverflow.com/comment/46345908
has comment: http://stackoverflow.com/comment/46345088
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46345214
has comment: http://stackoverflow.com/comment/46347728
has comment: http://stackoverflow.com/comment/46346215
has comment: http://stackoverflow.com/comment/46346258
type: Answer
has comment: http://stackoverflow.com/comment/46344829
score: 1
has comment: http://stackoverflow.com/comment/46345520
accepted answer of: http://stackoverflow.com/q/29053186
has body: At first double check your work: Step1, Step2 Then, to add media plugin to your project you need to: (in app/res/xml/config.xml) &lt;feature name="Media"&gt; &lt;param name="android-package" value="org.apache.cordova.media.AudioHandler" /&gt; &lt;/feature&gt; (in app/AndroidManifest.xml) &lt;uses-permission android:name="android.permission.RECORD_AUDIO" /&gt; &lt;uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt; More info And this is a code sample of how to use it (source) // Play audio // function playAudio(url) { // Play the audio file at url var my_media = new Media(url, // success callback function () { console.log("playAudio():Audio Success"); }, // error callback function (err) { console.log("playAudio():Audio Error: " + err); } ); // Play audio my_media.play(); } Finally, you can call the playAudio('path/to/file.mp3') function within your code (after device got ready). document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { console.log(Media); /* call function here */ }
answers question: http://stackoverflow.com/q/29053186
has comment: http://stackoverflow.com/comment/46345716

http://stackoverflow.com/comment/46315154
type: Comment
comment on: http://stackoverflow.com/a/29036876
has text: Your answer helped me a lot! If you could help me over this last hurdle, I would be beyond thankful!
score: 1
type: AnswerComment

http://stackoverflow.com/comment/46110886
comment on: http://stackoverflow.com/q/28927161
has text: You would need to know what hashing algorithm the server is using to calculate the ETag (S3 uses MD5 in most cases, for example) and then simply run that hashing routine on the client side.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29059966
type: Question
has body: I am working on drawing a bubble map using highcharts and i have reached to a certain point where I am successfully plotting the bubble based on the state code (in/RJ) and value (1000). http://jsfiddle.net/voidSO/h2f4ugz4/ $(function () { var mapData = Highcharts.geojson(Highcharts.maps['countries/in/in-all']); var data = [{ "z": 10038, "code": "RJ" }, { "z": 100, "code": "PB" }]; $('#container').highcharts('Map', { chart: { borderWidth: 1 }, title: { text: 'World population 2010 by country' }, subtitle: { text: 'Demo of Highcharts map with bubbles' }, legend: { enabled: false }, mapNavigation: { enabled: true, buttonOptions: { verticalAlign: 'bottom' } }, series: [{ name: 'Countries', mapData: mapData, color: '#E0E0E0', enableMouseTracking: false }, { type: 'mapbubble', mapData: mapData, name: 'Population 2010', data: data, joinBy: ['postal-code', 'code'], minSize: 4, maxSize: '12%', tooltip: { pointFormat: '{point.code}: {point.z} thousands' } }] }); }); But instead of using the state code I want to make the bubble using latitude and longitude, and i am not getting any hint how to do it. For example the lat long of (RJ) Rajasthan (a state of india) using it's lat long 26.5727° N, 73.8390° E.
tagged with: highcharts
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29060330
answer count: 1
downvote count: 0
score: 1
favorite count: 0
has title: Bubble Highmap using Lat Long
upvote count: 1
accepted answer: http://stackoverflow.com/a/29060330
type: AnsweredQuestion

http://stackoverflow.com/comment/46122885
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28933458
has text: Oh that's interesting, I had no idea - where did you learn about that? 'Getting started' didn't mention anything about scope. I thought it was purely pub/sub and each module was completely independent.
type: AnswerComment

http://stackoverflow.com/comment/46249288
type: Comment
has text: @Tommay have you downloaded the `jquery ui plug in`? also change your ` animate({background: "#a34545"} ` to ` animate({backgroundColor : "#a34545"} `.see this http://jsfiddle.net/j7op02ch/2/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28999850

http://stackoverflow.com/a/28979949
has body: use jQuery.trim() to "trim" your string before the split
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28979934
answers question: http://stackoverflow.com/q/28979934
has comment: http://stackoverflow.com/comment/46247405
has comment: http://stackoverflow.com/comment/46248258
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46272782
comment on: http://stackoverflow.com/a/29001886
type: Comment
has text: This means that max-height is only marginally better than height when it comes to transitions.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28986767
has comment: http://stackoverflow.com/comment/46222703
has comment: http://stackoverflow.com/comment/46222596
type: AnsweredQuestion
has title: Drop down in HTML table and have selected value in table data in javascript
upvote count: 2
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46224756
downvote count: 1
has comment: http://stackoverflow.com/comment/46222445
type: Question
has comment: http://stackoverflow.com/comment/46222515
accepted answer: http://stackoverflow.com/a/28989418
tagged with: javascript
has comment: http://stackoverflow.com/comment/46224406
has comment: http://stackoverflow.com/comment/46223424
tagged with: html-table
has comment: http://stackoverflow.com/comment/46223947
has answer: http://stackoverflow.com/a/28989418
has comment: http://stackoverflow.com/comment/46224480
has comment: http://stackoverflow.com/comment/46224618
answer count: 1
has body: I have Dropdown in html Table 1 2 3 Stir Fry stir-fry Stir Fry I return the whole data of HTML table to my controller in json form with ajax call var table = $('#datatable').tableToJSON(); var datatosend = JSON.stringify(table) alert(JSON.stringify(table)); $.ajax({ type: "POST", url: '/SalesContracts/addd', data: datatosend, dataType: 'json', contentType: "application/json; charset=utf-8", success: function () { alert('hii'); }, error: function (ex) { alert('Failed to retrieve states.' + ex); } }); And getting Result like {[ { "Brand": "1\n 2\n 3", "Model": "Stir Fry", "Name": "stir-fry", "Quantity": "Stir Fry", "Unit": "stir-fry", "Price Cost": "Stir Fry", "SubTotal": "stir-fry", "": "" } ]} I am receiving all three options of select(Dropdown) "brand" I just want to get the selected one in Jsondata. Is there any possible solution for this?? . I will be thankfull if someone help me.Thank you. TableTojson Method (function(e){e.fn.tableToJSON=function(t){var n={ignoreColumns:[],onlyColumns:null,ignoreHiddenRows:!0,headings:null};t=e.extend(n,t);var r=function(e){return e!==undefined&&e!==null?!0:!1},i=function(n){return r(t.onlyColumns)?e.inArray(n,t.onlyColumns)===-1:e.inArray(n,t.ignoreColumns)!==-1},s=function(t,n){var r={};return e.each(n,function(e,n){e<t.length&&(r[t[e]]=n)}),r},o=function(t){var n=[];return e(t).children("td,th").each(function(t,s){if(!i(t)){var o=e(s).data("override"),u=e.trim(e(s).text());n[n.length]=r(o)?o:u}}),n},u=function(e){var n=e.find("tr:first").first();return r(t.headings)?t.headings:o(n)},a=function(n,i){var u=[];return n.children("tbody,*").children("tr").each(function(n,a){if(n!==0||r(t.headings))if(e(a).is(":visible")||!t.ignoreHiddenRows)u[u.length]=s(i,o(a))}),u},f=u(this);return a(this,f)}})(jQuery); IF there is another way to get tabledata with selected dropdown value please guide me to that.Thank you.
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/46224031
tagged with: php

http://stackoverflow.com/a/28921503
type: Answer
has comment: http://stackoverflow.com/comment/46101948
has body: Mask and shift Simple shift operation to extract the values as r, g and b - for each value entry: // assumes big-endian byte-order for ARGB var uint32 = argbData_16by16[i], // i represents the iterator r = (uint32 &amp; 0xff0000)&gt;&gt;&gt;16; g = (uint32 &amp; 0xff00)&gt;&gt;&gt;8, b = uint32 &amp; 0xff, a = (uint32 &amp; 0xff000000)&gt;&gt;&gt;24; function drawARGBData(theData) { //theData is an array of size width x height //must be square image, so like 16 by 16 var doc = document; var canvas = doc.createElement('canvas'); doc.body.appendChild(canvas); var ctx = canvas.getContext('2d'); canvas.width = 16; canvas.height = 16; var idata = ctx.createImageData(16, 16); for(var i = 0, t = 0; i &lt; theData.length; i++) { var uint32 = +theData[i]; // convert to number right away (source is string here) idata.data[t++] = (uint32 &amp; 0xff0000)&gt;&gt;&gt;16; idata.data[t++] = (uint32 &amp; 0xff00)&gt;&gt;&gt;8; idata.data[t++] = uint32 &amp; 0xff;; idata.data[t++] = (uint32 &amp; 0xff000000)&gt;&gt;&gt;24; } ctx.putImageData(idata, 0, 0); } var argb_16x16_LONG = [ '16777215', '50331648', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '117440512', '50331648', '16777215', '117440512', '-179727685', '-13794122', '-7501709', '-2579612', '-12091753', '-11689787', '-8663845', '-8729638', '-12612424', '-12360329', '-4941740', '-670645', '-342721', '-106524059', '117440512', '520093696', '-1924502', '-3243974', '-1669338', '-9017258', '-15895118', '-13397058', '-10042412', '-10042412', '-13991247', '-16164456', '-16298359', '-10130877', '-600557', '-137156', '520093696', '587202560', '-2000091', '-2199019', '-2199024', '-8563138', '-15965032', '-11755851', '-10108719', '-10042669', '-13596748', '-16164712', '-15902826', '-16233077', '-12693681', '-669681', '587202560', '587202560', '-2066396', '-2133221', '-2660335', '-3126519', '-2206455', '-5019855', '-10505018', '-11227448', '-…
has comment: http://stackoverflow.com/comment/46101679
has comment: http://stackoverflow.com/comment/46102021
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46100367
has comment: http://stackoverflow.com/comment/46102512
has comment: http://stackoverflow.com/comment/46103408
has comment: http://stackoverflow.com/comment/46101638
has comment: http://stackoverflow.com/comment/46100485
has comment: http://stackoverflow.com/comment/46100440
has comment: http://stackoverflow.com/comment/46101871
answers question: http://stackoverflow.com/q/28919996
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46101730
accepted answer of: http://stackoverflow.com/q/28919996
has comment: http://stackoverflow.com/comment/46102628

http://stackoverflow.com/q/29036383
has body: Here's my case scenario: User is not logged in, and they try to access a /settings page. My Settings controller recognizes based on $auth.isAuthenticated() != true that they aren't logged in, and redirects them to /login User fills out their email and password and hits submit. What I would like to do on this third step is then redirect them to the /settings page, not the home page. I'm thinking I would be changing this variable: $authProvider.loginRedirect = '/'; The problem is that I cannot include $authProvider in my loginCtrl.js file without getting an "unknown provider" error in my console: https://docs.angularjs.org/error/$injector/unpr?p0= In other words, Angular does not recognize $authProvider when I try to include it. Here's what my loginCtrl.js file looks like: /* Everything is blowing up because I'm trying to include $authProvider */ angular.module("PrayerChain") .controller("loginCtrl", ["$rootScope", "$scope", "$state", "$http", "$auth", "$authProvider", loginCtrl]); function loginCtrl($rootScope, $scope, $state, $http, $auth, $authProvider) { $authProvider.loginRedirect = '/settings'; $scope.login = function () { $auth.login({ Email: $scope.email, Password: $scope.password }) .then(function() { }) .catch(function (response, status, headers) { console.log(response); $scope.error = JSON.parse(response.data); }); }; } Is including $authProvider in a controller even possible? If not, what's an alternative solution to changing where people are redirected upon logging in using Satellizer? Thanks.
accepted answer: http://stackoverflow.com/a/29036576
type: Question
has answer: http://stackoverflow.com/a/37258409
downvote count: 0
tagged with: javascript
tagged with: satellizer
answer count: 3
has answer: http://stackoverflow.com/a/29036576
favorite count: 0
possible better answer: http://stackoverflow.com/a/32682875
tagged with: angularjs
has answer: http://stackoverflow.com/a/32682875
score: 6
upvote count: 6
type: AnsweredQuestion
has title: How to change Satellizer's $authProvider.loginUrl inside an Angular controller?

http://stackoverflow.com/comment/46108758
type: QuestionComment
comment on: http://stackoverflow.com/q/28926054
score: 1
has text: How about just storing `req.body`? It's a little bit unclear what you are actually trying to do - save the data you got by the form at once inside a Database or something?
type: Comment

http://stackoverflow.com/comment/46219669
comment on: http://stackoverflow.com/a/28982345
score: 0
has text: I was following this tutorial http://thinkdiff.net/facebook/new-javascript-sdk-oauth-2-0-based-fbconnect-tutorial/. But there is nothing like this. It must be pointing to my own app id. Should have anything from tutorial
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/46255800
comment on: http://stackoverflow.com/a/29004740
score: 0
type: AnswerComment
type: Comment
has text: Where is the explanation?

http://stackoverflow.com/q/28935075
upvote count: 2
has comment: http://stackoverflow.com/comment/46126424
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28935594
type: AnsweredQuestion
score: 2
downvote count: 0
favorite count: 0
has title: How fill form data from Dropdown?
has comment: http://stackoverflow.com/comment/46126486
has body: I have a form on a page where users can save information, and a dropdown that pulls those saved files from the directory they saved them to. What I would like is when they go to that page, is that when they select the filename from the dropdown box, it places the name of the file in the input box "CodeDescription" field and the information on the file in the textarea "Code", however I am unsure how to go about parsing that. Below is my current code. Below is the list of your saved codes. To edit your codes, select it from the list. <?php $directory = $directory = 'users/' . $_SESSION['username']; $files = scandir( $directory ) ; foreach( $files as $file ) { if ( ! is_dir( $file ) ) { echo " " . $file . " "; } } ?> Saved Codes Description: Code: Or, conversely, I wouldn't mind if on select of the right file in the dropdown menu it simply displayed the output beneath the form fields. edited to add javascript I was trying: updated javascript This does not output any errors, however when I inspect element in Chrome it returns: Warning: file_get_contents(users/AddictionAddiction.txt) [function.file-get-contents]: failed to open stream: No such file or directory in /home/revo/public_html/evo/codesaveindex.php on line 141 which I'm not sure where to correct because there should be a / between AddictionAddiction.txt
type: Question
tagged with: php
accepted answer: http://stackoverflow.com/a/28935594

http://stackoverflow.com/comment/46135586
type: QuestionComment
comment on: http://stackoverflow.com/q/28937598
type: Comment
has text: This kind of "faking CSV to seem XLS" works only with tabulation delimited CSV. See http://jsfiddle.net/gte215m6/1/. Using server side approaches which really can create Excel files would be better.
score: 0

http://stackoverflow.com/comment/46322281
comment on: http://stackoverflow.com/a/28992526
type: AnswerComment
score: 0
type: Comment
has text: @SGD I am well aware of what the data property does, writing the answer in the manner that I did was an effort for the OP to realize the error.

http://stackoverflow.com/comment/46262369
type: QuestionComment
comment on: http://stackoverflow.com/q/29001205
score: 0
has text: @yazaki chrome latest version, static max value did seem to work fine
type: Comment

http://stackoverflow.com/q/29025559
has comment: http://stackoverflow.com/comment/46293387
tagged with: http://stackoverflow.com/tag/html
tagged with: node.js
linked to: http://stackoverflow.com/q/4295782
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46293360
has comment: http://stackoverflow.com/comment/46293590
type: Question
has comment: http://stackoverflow.com/comment/46293414
score: 0
has comment: http://stackoverflow.com/comment/46293680
has comment: http://stackoverflow.com/comment/46293623
tagged with: javascript
has body: I tried to add a record to the database using a POST request in Node JS. I tried with the following, &lt;form action="/addDevice?deviceToken=" onsubmit="location.href = this.action + this.token.value; return false;" method="POST"&gt; &lt;input name="token" type="text" value="3456as7dssa65d56da78s9d9sd67"/&gt;&lt;br&gt; &lt;input type="submit" value="Add Device" class="btn btn-success"/&gt;&lt;br&gt; &lt;/form&gt; in Node JS, I did, app.post('/addDevice', function (req, res) { device.addNewDevice(req.data.deviceToken, function (err, result) { if (err) return res.json(err); var msg = 'Added ' + result.affectedRows + ' rows.'; console.log('bode : ' + req.data.deviceToken); // display all devices device.getDevices(function (err, devices) { if (err) return res.json(err); res.render('device_view.html', {devices: devices, msg: msg}); }); }); }); When I'm running this I got the following error, Cannot GET /addDevice?deviceToken=3456as7dssa65d56da78s9d9sd67 How can I fix this? Thanks in Advance!
has title: How to add data to DB using a POST request in Node JS?
has comment: http://stackoverflow.com/comment/46293549
has comment: http://stackoverflow.com/comment/46293475

http://stackoverflow.com/a/29002404
answers question: http://stackoverflow.com/q/29002039
score: 0
type: Answer
has body: You can just attach your environmental properties to your window (or more preferably you application namespace). //Attach and object to the window window.ENV = {}; //Add an environmental variable (that can be written by the server) window.ENV.app_env = 'development'; //Keep all dev/test/prod urls in an object... var server_urls = { development: 'localhost:8080', test: '192.168.0.2:3030', production: 'mysite.co.uk', } //... //Then build the url when you need it. var server_url = server_urls[window.ENV.app_env];

http://stackoverflow.com/a/28993656
score: 4
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28993389
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46236341
type: Answer
has body: The context of document.write must be document, so your lib call to .repeat won't work on functions like document.write or console.log unless you account for a parameter to specify the context, or have already bound a context. Function.prototype.repeat = function(ctx, count, params) { // ^^^ while(count--) this.apply(ctx, params); // ^^^ }; document.write.repeat(document, 4, ["Hi"]); // ^^^^^^^^ or alternatively: Function.prototype.repeat = function(count, params) { while(count--) this.apply(this, params); }; document.write.bind(document).repeat(4, ["Hi"]); // ^^^^^^^^^^^^^^^
has comment: http://stackoverflow.com/comment/46236018
has comment: http://stackoverflow.com/comment/46241578
answers question: http://stackoverflow.com/q/28993389

http://stackoverflow.com/a/29051632
has comment: http://stackoverflow.com/comment/46341613
accepted answer of: http://stackoverflow.com/q/29051467
type: Answer
has body: You have to wait to look at the result until the last fs.readFile() operation has finished. These are async operations and they complete some time in the future. You are examining the result before any of them have finished. There are many ways to approach solving this, but this method would likely cause the least change to your code as it just keeps a counter of how many are done: function parseHTML(files, callback) { var result = [], cntr = 0; files.forEach(function(file) { if (file.match(/\.html$/)) { fs.readFile(file, 'utf8', function(err, data) { if (err) throw err result.push(data) // see if we're done processing all the results ++cntr; if (cntr === files.length) { callback(null, result); } }); } else { ++cntr; if (cntr === files.length) { callback(null, result); } } }); } I'd personally prefer to use promises and Promise.all() to solve this. Here's a version using the Bluebird promise library that retains some of your other structure: var Promise = require("bluebird"); var fs = Promise.promisifyAll(require('fs')); // your other code here function parseHTML(files, callback) { var promises = []; files.forEach(function(file) { if (file.match(/\.html$/)) { promises.push(fs.readFileAsync(file, 'utf8')); }); Promise.all(promises).then(function(results) { // all results in results array callback(null, results); }, function(err) { // error here }); } And, here's a fully promise version: var Promise = require("bluebird"); var fs = Promise.promisifyAll(require('fs')); function parseHTML(files) { var promises = []; files.forEach(function(file) { if (file.match(/\.html$/)) { promises.push(fs.readFileAsync(file, 'utf8')); }); return Promise.all(promises); } fs.readdirAsync(__dirname).then(parseHTML).then(function(results) { // files are in the results array here }).catch(function(err) { // error here });
has comment: http://stackoverflow.com/comment/46341211
answers question: http://stackoverflow.com/q/29051467
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/46341299
has comment: http://stackoverflow.com/comment/46341166
has comment: http://stackoverflow.com/comment/46341765
has comment: http://stackoverflow.com/comment/46341283
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46341376
downvote count: 0
has comment: http://stackoverflow.com/comment/46341129

http://stackoverflow.com/comment/46342303
comment on: http://stackoverflow.com/q/29052240
score: 0
type: QuestionComment
type: Comment
has text: In Java, arrays cannot be added to (grown) . Use `ArrayList` for that.

http://stackoverflow.com/a/79185275
has body: Instead of calling the function inside the onclick property onclick="submitFunction()"❌ just assign the name of the function to the onclick property as below: onclick="submitFunction"✅
answers question: http://stackoverflow.com/q/29002220
type: Answer
score: 0

http://stackoverflow.com/q/28933427
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 1
has answer: http://stackoverflow.com/a/28933590
has title: Z-Index and Positioning: Items keep pushing down upon use of 'Particleground' Jquery Plugin
upvote count: 1
type: Question
tagged with: javascript
tagged with: jquery-plugins
answer count: 1
downvote count: 0
tagged with: jquery
has body: I am kind of confused about z-index and positioning. I have read questions and articles about this, and I have been struggling. I am trying to use a a Jquery Plugin: 'Particleground': https://github.com/jnicol/particleground/find/master I have used the plugin and I am getting the particles on the top of the page. But my entire header page has been pushed down, but I want it to appear on top. Please help!
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/46303012
comment on: http://stackoverflow.com/a/29028002
type: AnswerComment
has text: I've updated my answer to help with this. You need to use the tickInterval option.
score: 0
type: Comment

http://stackoverflow.com/comment/46312645
type: Comment
score: 1
has text: Please check the PHP documentation for the [`header` function](http://php.net/header). You're not using it the right way.
comment on: http://stackoverflow.com/q/28977449
type: QuestionComment

http://stackoverflow.com/q/28925789
has comment: http://stackoverflow.com/comment/46108056
has comment: http://stackoverflow.com/comment/46108476
has comment: http://stackoverflow.com/comment/46109906
has comment: http://stackoverflow.com/comment/46108175
answer count: 0
has comment: http://stackoverflow.com/comment/46108022
tagged with: javascript
type: UnansweredQuestion
type: Question
has title: Individual JSON field to PHP array
has comment: http://stackoverflow.com/comment/46112932
has comment: http://stackoverflow.com/comment/46108116
has comment: http://stackoverflow.com/comment/46108133
has comment: http://stackoverflow.com/comment/46108080
has body: I'm dealing with bootstrap tables and have this script: &lt;script&gt; var $table = $('#table'), $button = $('#button'); $(function () { $button.click(function () { alert('getSelections: ' + JSON.stringify($table.bootstrapTable('getSelections'))); }); }); That function gives me this for example: getSelections: [ { "state": true, "_state_data": {}, "name": "google", "_name_data": {}, "endung": "de", "_endung_data": {}, "regdatum": "2012-03-14 00:00:00", "_regdatum_data": {}, "tags": "kunde wolli test ", "_tags_data": {}, "id": "1", "_id_data": {} }, { "state": true, "_state_data": {}, "name": "prosite", "_name_data": {}, "endung": "de", "_endung_data": {}, "regdatum": "2015-01-02 00:00:00", "_regdatum_data": {}, "tags": "", "_tags_data": {}, "id": "3", "_id_data": {} } ] Now I don't want to get the alert, I need to get only the ID fields and pass them to an PHP array to go on. Unfortunately I'm too dumb for javascript. var selection = JSON.stringify($table.bootstrapTable('getSelections')); console.log(selection); shows me the correct selection. console.log(selection.id); is undefined
score: 0
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/46110419
score: 0
type: Comment
has text: Thanks for that awesome clarification! I'm using a book supposedly written in 2013 and updated in 2014 ... any reason you can think of why they didn't use or even explain using children? I emailed the author but he said he doesn't give help (although it does say in the book to email him questions and comments) ... anyway, I'd upvote your answer but my rep is too low. I appreciate it though!
type: AnswerComment
comment on: http://stackoverflow.com/a/28927071

http://stackoverflow.com/comment/46088000
comment on: http://stackoverflow.com/a/28913428
score: 0
type: AnswerComment
has text: I do need to trigger a form submit, but to simulate the way the browser redirects the user to the form's action, along with the form data, when the user submits a form.
type: Comment

http://stackoverflow.com/a/28992652
has comment: http://stackoverflow.com/comment/46322337
has body: In your example the key should be route_id instead of selectroute &lt;script type="text/javascript"&gt; var route_id = 'travelling-from'; //Route ID $('#'+route_id).change(function(e) { //Grab the chosen value on route change var selectroute = $(this).val(); var data = {}; data[route_id] = selectroute; $.ajax({ type: "GET", url: 'ajax-getvalues.php', data: data } }); &lt;/script&gt;
answers question: http://stackoverflow.com/q/28992422
has comment: http://stackoverflow.com/comment/46322588
has comment: http://stackoverflow.com/comment/46274468
has comment: http://stackoverflow.com/comment/46276252
score: 0
type: Answer

http://stackoverflow.com/comment/46246658
type: QuestionComment
comment on: http://stackoverflow.com/q/28999006
has text: @Arazam Checked that `/` is not already at end of `href` before appending another `/` at `"/?id=10261204"`
score: 0
type: Comment

http://stackoverflow.com/q/28929081
type: Question
tagged with: angularjs-directive
tagged with: javascript
tagged with: angularjs-scope
score: 0
has comment: http://stackoverflow.com/comment/46120982
has comment: http://stackoverflow.com/comment/46120937
has body: What is the best way to create a start date and end date in Angularjs? I have the following code below which uses the same controller for both. Is it best practice to create a separate controller for each datepicker? My intent is to have a search button that will take input from both datepickers and then do some backend processing. My HTML &lt;input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="startdt" is-open="opened" datepicker-options="dateOptions" ng-required="true" close-text="Close" /&gt; &lt;span class="input-group-btn"&gt; &lt;button type="button" class="btn btn-default" ng-click="startopen($event)"&gt; &lt;i class="glyphicon glyphicon-calendar"&gt;&lt;/i&gt; &lt;/button&gt; &lt;/span&gt; My Javascript ///////////// BEGIN Datepicker code $scope.today = function () { $scope.startdt = $filter('date')((new Date()), "dd-MMMM-yyyy"); $scope.enddt = $filter('date')((new Date()), "dd-MMMM-yyyy"); }; $scope.today(); $scope.clear = function () { $scope.dt = null; }; $scope.startopen = function ($event) { $event.preventDefault(); $event.stopPropagation(); $scope.opened = true; }; $scope.endopen = function ($event) { $event.preventDefault(); $event.stopPropagation(); $scope.opened = true; }; $scope.dateOptions = { formatYear: 'yy', startingDay: 1 }; $scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate']; $scope.format = $scope.formats[0];
tagged with: angularjs
type: UnansweredQuestion
tagged with: datepicker
has title: Start date and end date in Angularjs in same controller
answer count: 0
has comment: http://stackoverflow.com/comment/46114511
has comment: http://stackoverflow.com/comment/46117752

http://stackoverflow.com/q/29034564
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has body: I'm using this function: $(window).bind('load resize scroll',function(e) { var y = $(window).scrollTop(); $('.tm-parallax').filter(function() { return $(this).offset().top &lt; (y + $(window).height()) &amp;&amp; $(this).offset().top + $(this).height() &gt; y; }).css('background-position', '50% ' + parseInt(-y / 50) + 'px'); }); to achieve parallax effect on background images when scrolling down. I would like to limit y position to certain value (for example 100px), so background image center stays visible after reaching this value. Here is the code: http://jsfiddle.net/esedic/vw2n16r8/4/ Because bakcground images are quite large it's best seen on fullscreen: https://jsfiddle.net/esedic/vw2n16r8/4/embedded/result/ Because I'm using parallax background images on multiple elements, I'm looking for solution to set different values for each element (maybe using data attributes?). Thanks for your help!
tagged with: jquery
tagged with: parallax
type: Question
score: 0
has answer: http://stackoverflow.com/a/29034642
tagged with: background-image
has title: Limit vertical background position on scrolling with jQuery
tagged with: scroll

http://stackoverflow.com/comment/46313398
has text: Just to throw it out there, an API is usually a term that refers to a web call or web request of some sort, and not a specific code like the one you found for javascript. What you have found seems to be a javascript library that calls a facebook API.
comment on: http://stackoverflow.com/q/29036141
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/46340791
has text: Where is the code for `openPopup`?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29051039
score: 0

http://stackoverflow.com/a/28954876
has comment: http://stackoverflow.com/comment/46163522
has comment: http://stackoverflow.com/comment/46164070
accepted answer of: http://stackoverflow.com/q/28954780
has comment: http://stackoverflow.com/comment/46164874
has comment: http://stackoverflow.com/comment/46163569
answers question: http://stackoverflow.com/q/28954780
has comment: http://stackoverflow.com/comment/46163588
score: 0
type: AcceptedAnswer
has body: You may try to change localStorage to sessionStorage like I have done In this Fiddle. localStorage is meant for longterm use where as sessionStorage is more shortterm. Here is another post with some answers explaining them further. It shows up once until you either clear your cache or restart your browser. Also the I was able to close the pop-up from my phone in the fiddle. Hope this helps.
type: Answer
has comment: http://stackoverflow.com/comment/46163619
has comment: http://stackoverflow.com/comment/46163745

http://stackoverflow.com/comment/46253193
type: Comment
has text: Try looking into the HSL colour model. More specifically, look into specifying colours with Hue(0-360) Saturation(0-100%) Luminance(0-100%) Alpha(0-1). E.g a lime-green colour would be: `hsla(73, 100%, 50%, 1)`
type: QuestionComment
comment on: http://stackoverflow.com/q/29002716
score: 0

http://stackoverflow.com/comment/46273393
type: Comment
comment on: http://stackoverflow.com/q/28983779
type: QuestionComment
score: 0
has text: Most likely need to bind to the textbox and `stopPropagation` so Bootstrap doesn't detect it as an out-of-context click.

http://stackoverflow.com/comment/46357747
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29060558
has text: Thanks for your time! When I call the JS function `$("#fuse").search(...);` Safari (debugger) comes up with an error `TypeError: undefined is not a function (evaluating '$( "#fuse" ).search')`. See here http://atmosx.clarify-it.com/d/lwlk4a

http://stackoverflow.com/comment/46095459
comment on: http://stackoverflow.com/a/28918916
score: 0
type: AnswerComment
type: Comment
has text: Nope, prints the non-interpolated string up onto the first escape like this: {{ 'PLURAL' | translate:\

http://stackoverflow.com/q/28972125
has body: when I try to eval a JSON {"DS_JUSTIFICATIVA":"Oxigen 30mg Cp. Item não padronizado : testes"} I getting an error, I would like to know if this error is a safeEval error or I should no permit to such thing on my JSON objects? Obs: probably copying and Paste will note simulates the error because the HTML render as spaces, but you can edit on notepad put a tab on it and copy past from there.
tagged with: java
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
type: Question
upvote count: 2
has title: JsonUtils.safeEval getting error when trying to evaluate "\t" "tab" character
favorite count: 0
score: 2
answer count: 0
downvote count: 0
type: UnansweredQuestion
tagged with: gwt

http://stackoverflow.com/q/28959808
possible better answer: http://stackoverflow.com/a/28965221
has body: How can I get the day's name by giving the date format 'yyyy-mm-dd' ? I have this date '2015-03-03' which is in the correct format according to MDN for the new Date(dateString); constructor. How do I get the day's name which is Tuesday?
has answer: http://stackoverflow.com/a/28966624
downvote count: 2
type: AnsweredQuestion
has title: How to get day's name from date format 'yyyy-mm-dd'?
accepted answer: http://stackoverflow.com/a/28966192
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/28965221
duplicate of: http://stackoverflow.com/q/17964170
has answer: http://stackoverflow.com/a/28966192
tagged with: javascript
score: 0
answer count: 3
tagged with: datetime
tagged with: dayofweek
linked to: http://stackoverflow.com/q/17964170
favorite count: 0

http://stackoverflow.com/comment/46132526
comment on: http://stackoverflow.com/q/28938628
has text: you need to direct the page what u last clicked ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/39767484
score: 2
has body: Give your function at the very beginning of your external js file .
upvote count: 2
answers question: http://stackoverflow.com/q/29002220
downvote count: 0
type: Answer

http://stackoverflow.com/a/73402475
has body: The best way, I think, is to simply write all ES6 scripts as modules, and use nomodule script tags for any fallbacks. Trying to code inline detection is not needed. Of course, this begs the question of how to detect new syntax from post-ES6 versions, such as the &quot;??&quot; and &quot;?.&quot; operators.
score: 0
answers question: http://stackoverflow.com/q/29046635
type: Answer

http://stackoverflow.com/q/28914536
score: 0
answer count: 2
has body: I am collapsing table rows and using jQuery to toggle them. However, when the hidden rows are shown, the width of the td elements in the first tr are recalculated. This is exhibited on my example: $("tr:first").click(function(){ $(this).next('tr').toggle(); }); tr{ display: none; } tr:first-of-type{ display: table-row; } Hello World foo foo foo foo foo foo foo foo (Fiddle if preferred: http://jsfiddle.net/8u070tkf/) How can I force the flow of the hidden row, but still toggle the visibility of the second tr?
has comment: http://stackoverflow.com/comment/46087282
has comment: http://stackoverflow.com/comment/46087286
tagged with: html-table
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28914692
has answer: http://stackoverflow.com/a/28914618
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Prevent a hidden tr from breaking the td widths

http://stackoverflow.com/a/29007874
type: Answer
upvote count: 29
accepted answer of: http://stackoverflow.com/q/29006214
score: 29
has comment: http://stackoverflow.com/comment/90388839
answers question: http://stackoverflow.com/q/29006214
has comment: http://stackoverflow.com/comment/46795366
has comment: http://stackoverflow.com/comment/46631185
has comment: http://stackoverflow.com/comment/137486615
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/124052231
has comment: http://stackoverflow.com/comment/124052516
has body: This can be done using CSS transforms For 12 equal slices, each slice angle will be 30 degrees. We need to rotate each slice according to the angle between vertical axis and start of the slice. So the first slice will be rotated by 0deg and the last by 330deg Additionally we need to skew each slice by minus (90deg - slice angle) In this case, it is -(90deg - 30deg) = skewY(-60deg) Regarding the text: a) We need to unskew slice contents with skewY(60deg) b) In order to center the text in the slice we need to rotate it by half the slice angle, hence: rotate(15deg) FIDDLE .circle { position: relative; border: 1px solid black; padding: 0; margin: 1em auto; width: 20em; height: 20em; border-radius: 50%; list-style: none; overflow: hidden; } li { overflow: hidden; position: absolute; top: 0; right: 0; width: 50%; height: 50%; transform-origin: 0% 100%; } .text { position: absolute; left: -100%; width: 200%; height: 200%; text-align: center; transform: skewY(60deg) rotate(15deg); padding-top: 20px; } li:first-child { transform: rotate(0deg) skewY(-60deg); } li:nth-child(2) { transform: rotate(30deg) skewY(-60deg); } li:nth-child(3) { transform: rotate(60deg) skewY(-60deg); } li:nth-child(4) { transform: rotate(90deg) skewY(-60deg); } li:nth-child(5) { transform: rotate(120deg) skewY(-60deg); } li:nth-child(6) { transform: rotate(150deg) skewY(-60deg); } li:nth-child(7) { transform: rotate(180deg) skewY(-60deg); } li:nth-child(8) { transform: rotate(210deg) skewY(-60deg); } li:nth-child(9) { transform: rotate(240deg) skewY(-60deg); } li:nth-child(10) { transform: rotate(270deg) skewY(-60deg); } li:nth-child(11) { transform: rotate(300deg) skewY(-60deg); } li:nth-child(12) { transform: rotate(330deg) skewY(-60deg); } li:first-child .text { background: green; } li:nth-child(2) .text { background: tomato; } li:nth-child(3) .text { background: aqua; } li:nth-child(4) .text { background: yellow; } li:nth-child(5) .text { background: orange; } li:nth-child(6) .text { background: …
has comment: http://stackoverflow.com/comment/46630093

http://stackoverflow.com/comment/80207203
has text: @Sawtaytoes it's about the arguments that are passed to the function not the number of arguments the function takes by its signature. The idea is that if you only pass - in this case - the first of two arguments, that a new function is returned saving the first argument. `addition.length` would always be `2`, no matter if one or two arguments are passed.
type: AnswerComment
comment on: http://stackoverflow.com/a/28912232
score: 0
type: Comment

http://stackoverflow.com/q/28976286
answer count: 1
tagged with: javascript
score: 0
has title: Integrating keyboard use with answer randomization in Qualtrics
tagged with: qualtrics
has body: I'm using qualtrics to present a user with two choices, one on the left and one on the right. I'd like to have them use the keyboard arrow keys to make a selection and I currently have code to let them do this using the following: Qualtrics.SurveyEngine.addOnload(function() { /*Place Your Javascript Below This Line*/ this.hideNextButton(); this.hidePreviousButton(); var that = this; Event.observe(document, 'keydown', function keydownCallback(e) { var qid = this.questionId; var order = $("QR~"+qid+"~DisplayOrder").value.split("|"); var left = order[0]; var right = order[1]; switch (e.keyCode) { case 37: // 'L' was pressed choiceID = left break; case 39: // 'R' was pressed choiceID = right break; } if (choiceID) { Event.stopObserving(document, 'keydown', keydownCallback); that.setChoiceValue(choiceID, true); that.clickNextButton(); } }); }); If the answers are randomized and questions are not reversed it works fine. If the answers are reversed it will select the option on the right when the left arrow key is pressed, and vice versa. I suspect I need some way to set the choice ID to the ID of what is actually presented, or completely change the third and sixth lines, but some of the more promising functions in the API don't seem to pan out. Suggestions?
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28988563
accepted answer: http://stackoverflow.com/a/28988563

http://stackoverflow.com/comment/46082833
comment on: http://stackoverflow.com/q/28912030
score: 0
has text: @dfsq sorry i just got your point, yes at the first time, the tree list will all redered, then ill check, if the value inside the list was match with value i had given ill set it to show, if it isnt set to hide
type: QuestionComment
type: Comment

html-table
tags question: http://stackoverflow.com/q/28994215
tag name: html-table
tags question: http://stackoverflow.com/q/29041583
tags question: http://stackoverflow.com/q/29015044
tags question: http://stackoverflow.com/q/29024838
tags question: http://stackoverflow.com/q/28914536
tags question: http://stackoverflow.com/q/28987470
tags question: http://stackoverflow.com/q/29020257
tags question: http://stackoverflow.com/q/29022534
tags question: http://stackoverflow.com/q/28955909
type: Tag
tags question: http://stackoverflow.com/q/28928636
tags question: http://stackoverflow.com/q/28931408
tags question: http://stackoverflow.com/q/28954331
tags question: http://stackoverflow.com/q/28934878
tags question: http://stackoverflow.com/q/29042140
tags question: http://stackoverflow.com/q/28914239
tags question: http://stackoverflow.com/q/28986767
tags question: http://stackoverflow.com/q/29032084
tags question: http://stackoverflow.com/q/29017397

http://stackoverflow.com/q/29001946
answer count: 4
tagged with: angularjs-scope
type: Question
tagged with: angularjs-directive
tagged with: google-maps
tagged with: javascript
has answer: http://stackoverflow.com/a/29002294
has answer: http://stackoverflow.com/a/29005343
has answer: http://stackoverflow.com/a/29018747
score: 0
has answer: http://stackoverflow.com/a/29001994
tagged with: angularjs
type: UnansweredQuestion
has body: I have an issue where in the Angularjs directive where the initialize() in the controller is called first before the template is rendered. That means I can't retrieve the dynamic id. I am trying to have a different id for each map but currently crashing on the code below because of the dynamic id. map = new google.maps.Map(document.getElementById('addressMap-' + $scope.mapId), mapOptions); Full Code, Any idea? cheers app.directive('googleMap', function ($compile) { var mapId = 1; var linker = function (scope, element) { scope.mapId = mapId++; }; return { require: '^addressBasedGoogleMap', restrict: "EA", scope: { address: "=", zoom: "=", mapId: "=" }, template : '&lt;div id="addressMap-" style="height: 200px;"&gt;&lt;/div&gt;', link: linker, controller: function ($scope) { var geocoder; var latlng; var map; var marker; var initialize = function () { geocoder = new google.maps.Geocoder(); latlng = new google.maps.LatLng(-34.397, 150.644); var mapOptions = { zoom: $scope.zoom, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('addressMap-' + $scope.mapId), mapOptions); }; var markAdressToMap = function () { geocoder.geocode({ 'address': $scope.address }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); } }); }; $scope.$watch("address", function () { if ($scope.address != undefined) { markAdressToMap(); } }); initialize(); } }; });
has title: Getting Div id in angularjs directive

http://stackoverflow.com/a/29049696
upvote count: 1
has body: A good way to solve this is to use promises: https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Promise I prefer to use this polyfill: https://github.com/jakearchibald/es6-promise ...because as soon as i can stop supporting older browsers, the only thing i need to do is remove the polyfill. Another (and probably better) way is to use batch requests in Facebook. You can find information about that in the docs: https://developers.facebook.com/docs/graph-api/making-multiple-requests
has comment: http://stackoverflow.com/comment/46337871
accepted answer of: http://stackoverflow.com/q/29049665
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29049665
has comment: http://stackoverflow.com/comment/46338552
has comment: http://stackoverflow.com/comment/46346017
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/46338520
has comment: http://stackoverflow.com/comment/46338378

http://stackoverflow.com/a/28926754
answers question: http://stackoverflow.com/q/28926308
has body: Please see the following code. It is not a very elegant approach but it works fine. I have implemented it for the second dropdown, you can implement similarly for the third dropdown as well. None Maths Bio Physics Chemistry A lot of things could be generically/dynamically driven here avoiding the use of the hard code. Hope this helps
type: AcceptedAnswer
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46111556
accepted answer of: http://stackoverflow.com/q/28926308
has comment: http://stackoverflow.com/comment/46109731

http://stackoverflow.com/q/29033854
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29034449
has comment: http://stackoverflow.com/comment/46308658
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46317533
has comment: http://stackoverflow.com/comment/46308673
tagged with: image-processing
possible better answer: http://stackoverflow.com/a/29034449
linked to: http://stackoverflow.com/q/25630811
type: Question
has comment: http://stackoverflow.com/comment/46312740
has answer: http://stackoverflow.com/a/29034599
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29034599
has body: I use an Image to load a picture onto a canvas. I would then like to be able to my User the option to save the image to their hard drive. I have searched around and there are plenty of ways to do this IF I use Ajax and retrieve from my server. Is there a way to avoid any trips to my server and to save directly onto my hard drive either via the image control or the canvas control
has comment: http://stackoverflow.com/comment/46308547
has title: Save image to hard drive
has comment: http://stackoverflow.com/comment/46308527
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46317565
has comment: http://stackoverflow.com/comment/46316728
has comment: http://stackoverflow.com/comment/46308617

http://stackoverflow.com/comment/46218677
type: Comment
type: QuestionComment
score: 1
has text: You've asked about "selecting" checkboxes but shown code *creating* them...?
comment on: http://stackoverflow.com/q/28984959

http://stackoverflow.com/q/28965568
has answer: http://stackoverflow.com/a/28965752
has comment: http://stackoverflow.com/comment/46183247
has comment: http://stackoverflow.com/comment/46183167
answer count: 3
has comment: http://stackoverflow.com/comment/46182900
has comment: http://stackoverflow.com/comment/46261987
score: -2
tagged with: regex
has answer: http://stackoverflow.com/a/28966102
has comment: http://stackoverflow.com/comment/46183038
has comment: http://stackoverflow.com/comment/46182806
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/46182912
has body: I have a string like this ?i_am=busy&amp;need=fun&amp;s= The busy and fun parts can change to be strings with dashes. I'd like to extract these two into variables to use with jquery. What I need is a regex that will extract them, but my regex knowledge is limited at best. Any help is appreciated.
linked to: http://stackoverflow.com/q/22937618
type: Question
has answer: http://stackoverflow.com/a/28966093
upvote count: 0
has title: regex extract from string
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/29007934
has body: use below code . its event delegation issue. $(document).on('ready page:change', function(){ $(document).('click','a',function(){ $("#refresh").load( "/home #content", function() { }); }); });
type: Answer
answers question: http://stackoverflow.com/q/29007895
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29007895

http://stackoverflow.com/comment/46209262
has text: @DeepakPrasanna - I had to run a jQuery `grep` on the list of all `_todoItems` to remove the deleted Todo. Then I fired the change event and the page updated beautifully. Thank you!! You are a scholar and a gentleman. =)
comment on: http://stackoverflow.com/q/28978761
type: Comment
type: QuestionComment
score: 1

getparameter
tag name: getparameter
type: Tag
tags question: http://stackoverflow.com/q/28946617

http://stackoverflow.com/comment/46347748
type: Comment
comment on: http://stackoverflow.com/a/29055021
score: 0
type: AnswerComment
has text: The first solution is the easiest, don't even need javascript, just use `data-toggle="modal" data-target="#modal1"`, but its not so cheap...it needs to write a new modal for every button, but what if the structure of the modal is very complex? That's why I would like to recycle the code as much as possible. The second solution is probably what I will do: is much easier to take the content of a hidden div and put it inside the modal then to play hiding and showing elements inside the same modal, thanks.

http://stackoverflow.com/q/28918579
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28918674
upvote count: 2
tagged with: html5-appcache
has title: External resources fail to load when using HTML5 cache
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28918674
has body: I'm trying to get app cache to work: CACHE MANIFEST /css/style.css /js/colors.js /js/dropzone.js /js/jquery.min.js /js/script.js /img/icon_analytics.png /img/icon_exit.png /img/icon_expand.png /img/icon_list.png /img/icon_lock.png /img/icon_menu.png /img/icon_more_content.png /img/icon_settings.png /img/icon_settings_black.png /img/svg_icons/close_fullscreen.svg /img/svg_icons/go_fullscreen.svg /img/loader.gif But here is what I'm getting in the console: GET https://www.google.com/jsapi net::ERR_FAILED (index):517 Uncaught ReferenceError: google is not defined (index):524 GET http://www.google-analytics.com/analytics.js net::ERR_FAILED 0.s3.envato.com/files/115114837/profile.jpg:1 GET https://0.s3.envato.com/files/115114837/profile.jpg net::ERR_FAILED jquery.min.js:3 GET http://fonts.gstatic.com/s/roboto/v15/mnpfi9pxYH-Go5UiibESIpBw1xU1rKptJj_0jans920.woff2 net::ERR_FAILED Apparently, it refuses to load any resources which are not specified in the .appcache file. I even tried to specify only the images, it still throws errors for the stylesheet and all .js files. What's going on?
answer count: 1
downvote count: 0

http://stackoverflow.com/q/29043858
tagged with: angularjs
score: 0
has body: The setup is as follows. All fields are filled out and form is valid. Submit is executed, BUT there are a server side check on the provided data, and it returns "error, duplicate found". A hidden (ng-hide is used here) input field is now shown and this field is set to required. Now the problem occurs. The submit button is still enabled, even though the form is invalid! Question is, how can I revalidate/update the validation state for the form after the serial number field is shown? I have tried with the following without any luck; if (status == 413) { $scope.hide_serial_number = false; if ($scope.hide_serial_number == false) { document.getElementById("serial_no").required = true; $scope.myForm.serial_no.$invalid(); }; }; status code 413 = duplicate was found in DB. My submit button; Submit Please no jQuery answers, I'm doing all plain javascript – Thanks in advance!
answer count: 1
accepted answer: http://stackoverflow.com/a/29052145
tagged with: forms
has comment: http://stackoverflow.com/comment/46328656
type: AnsweredQuestion
has title: Revalidate form after post response
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/29052145
has comment: http://stackoverflow.com/comment/46340868

http://stackoverflow.com/q/29015286
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Control how content is copied to clipboard
linked to: http://stackoverflow.com/q/2026335
tagged with: http://stackoverflow.com/tag/html
tagged with: css
duplicate of: http://stackoverflow.com/q/2026335
answer count: 0
downvote count: 0
has body: I am making a web-based chat program. When users select from the chat log, and copy to clipboard, I would like to control the format of the text better. For example here is what the chat log looks like: When the user selects this and copies to clipboard, here's what they get: Alice Springs 12:45 PM Hi this is some text, what's up? Boo Radley 12:47 PM Whoa, didn't see ya there... not much. This is actually not that bad, but as the application gets more complex this will get more and more obfuscated. I would like to be able to control this better, and copy something more friendly for text-based chat log: [12:45] <Alice Springs> Hi this is some text, what's up? [12:47] <Boo Radley> Whoa, didn't see ya there... not much. Here is the markup for a single message: Boo Radley 12:47 PM Whoa, didn't see ya there... not much. Is this possible? How is this accomplished?
tagged with: clipboard
type: UnansweredQuestion
type: Question
score: 1
upvote count: 1

http://stackoverflow.com/comment/46101232
score: 0
has text: It is actually a 2D array iteration...
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28922057

http://stackoverflow.com/comment/46354408
type: QuestionComment
has text: You are the expert but it doesn't seem like an ordinary group reducing to me, I can just reduce and group by date but that is not what I want. I want them grouped in number of of appearances. Or am I overthinking here, care to share the code? Thanks.
comment on: http://stackoverflow.com/q/28978418
score: 0
type: Comment

http://stackoverflow.com/comment/46261148
has text: You are welcome! The column `"role"` will be filled not dynamically. Why you not use just `value:"Select Role:Select Role"`? If you need to load the data from the server you can use `editoptions.dataUrl` and optionally `editoptions.buildSelect`. If you use [free jqGrid 4.8](https://github.com/free-jqgrid/jqGrid) you can use [editoptions.selectFilled](https://github.com/free-jqgrid/jqGrid/wiki/New-callbacks-and-jQuery-events#new-selectfilled-callback-and-jqgridselectfilled-event) additionally. You should first comment all **optional parts** like `dataInit` and `dataEvents` and see `postData`.
comment on: http://stackoverflow.com/a/29006514
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28908007
tagged with: css
has answer: http://stackoverflow.com/a/28908060
has title: Javascript Child Selector Not Being Called
type: UnansweredQuestion
tagged with: selector
linked to: http://stackoverflow.com/q/12088460
has comment: http://stackoverflow.com/comment/46075360
type: Question
has comment: http://stackoverflow.com/comment/46075457
duplicate of: http://stackoverflow.com/q/12088460
answer count: 1
tagged with: javascript
tagged with: jquery
has body: http://jsfiddle.net/w8ak1yyy/7/ The project is to create colors based off the child. I am focusing on fixing the LEFT div (GREEN box). However when I try to create more divs off of the left most box (GREY), it keeps calling the parent div (GREEN). It does not create a div off the child clicked. Now I am trying to stop propagation to limit the event call only on the child, but the specific selectors never select the child. LINE 38: $(".left-child").click(function(event){ propStopped( event ); event.stopPropagation(); propStopped( event ); alert("Found child"); }); this code should target the child element but doesn't, and I also tried the following selectors below and they also didn't find the child. $(".left-child") $(".left &gt; .left-child") $("div.left" &gt; .left-child") The end result for now should be making more divs to the left by clicking the left most div. Line 63 begins appending the left div. I placed a counter that displays on the div being clicked on, which updates the parent div(GREEN) rather than the child.
score: 0

http://stackoverflow.com/comment/46342345
type: AnswerComment
has text: Now I'm thinking about `substring()` method. We'll see.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29052279

http://stackoverflow.com/q/29019085
has comment: http://stackoverflow.com/comment/46308250
has comment: http://stackoverflow.com/comment/46308932
tagged with: autocomplete
tagged with: fuelux
has body: I have a situation where I have a jquery autocomplete field that I would also like to make a placard for (http://getfuelux.com/javascript.html#placard). I've got everything set up fine. When I click the field, the placard shows up, and I can still type into the field to receive suggestions. The problem comes in when I attempt to click one of the suggestions. It calls my select: function as expected, which populates the text input. But then as the event cascades it triggers the "cancel" (I'm guessing here) event on the placard, which resets the value of the input to default and removes the placard visual. Here's the gist of the code: HTML Select User: Cancel Confirm JS $(".autocomplete-web-users").autocomplete({ source: function (request, response) { var $element = $(this.element).parent().first(); var $loader = $(""); $element.append($loader); //start loading spinner $loader.loader(); $loader.loader('play'); $.ajax({ url: '/Search/SearchWebUsers', data: { term: request.term }, success: function (data) { var results = $element.data('results'); //data loaded, destroy data spinner $loader.loader('destroy'); response($.map(data, function (item) { return { label: item.Name, value: item.Id, tag: item.UniqueId, id: item.Id } })); } }); }, minLength: 2, select: function (event, ui) { event.preventDefault(); $(event.target).parents().find(".placard").placard('setValue', ui.item.tag); } }); JS PLACARD INITIALIZATION $(".placard").placard(); I've fiddled with the "explicit" and "externalClickAction" options, but can't seem to get anything to work. Any ideas? I can't find anything about fuel ux on the intertubes.
has title: Using Fuel ux placard on jQuery autocomplete field
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46285353
score: 0
answer count: 0
type: UnansweredQuestion
type: Question

http://stackoverflow.com/a/29045262
answers question: http://stackoverflow.com/q/29045024
type: Answer
has comment: http://stackoverflow.com/comment/46330152
has comment: http://stackoverflow.com/comment/46330012
has comment: http://stackoverflow.com/comment/46330212
has comment: http://stackoverflow.com/comment/46330259
has comment: http://stackoverflow.com/comment/46330087
has comment: http://stackoverflow.com/comment/46330258
has comment: http://stackoverflow.com/comment/46329980
upvote count: 1
has body: The simples would be to use height and width img tag attributes. var span = document.createElement('span'); span.innerHTML = ['&lt;img height="7" width="15" class="thumb" src="', e.target.result, '" title="', escape(theFile.name), '"/&gt;'].join(''); document.getElementById('list').insertBefore(span, null); If you really would like to use .css for this task you can use background-size, but then background property must be set with url to the image in css. You can also simply override the img tag in css like this: img{ max-width: 100px; max-height: 100px; } Here you can test both approaches : http://www.w3schools.com/cssref/tryit.asp?filename=trycss3_background-size
score: 1
has comment: http://stackoverflow.com/comment/46330218
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29045024
has comment: http://stackoverflow.com/comment/46329966

http://stackoverflow.com/q/29047737
tagged with: ruby-on-rails
type: Question
score: 0
tagged with: omniauth
has answer: http://stackoverflow.com/a/29047839
answer count: 1
tagged with: javascript
has title: Omniauth authentication - catch the moment when the user gets redirected to google
has body: # Gemfile gem 'omniauth' gem 'omniauth-google-oauth2' gem 'devise' # view - if user_signed_in? Signed in as = current_user.oauth_name = button_to('Sign out', destroy_user_session_path, method: :delete) - else = link_to('Sign in with Google', user_omniauth_authorize_path(:google_oauth2)) What's the best way to catch the moment when the user gets redirected to google for authentication? It could be by "javascript onclick", but I want to catch the moment on the server somehow (if it's possible) because I need to save some variable to the session.
tagged with: ruby
tagged with: oauth
type: UnansweredQuestion

http://stackoverflow.com/q/28930727
answer count: 2
tagged with: soundcloud
has answer: http://stackoverflow.com/a/28930767
tagged with: javascript
has comment: http://stackoverflow.com/comment/46117139
score: 0
has comment: http://stackoverflow.com/comment/46117154
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46117124
has body: I am trying to add to my Tumblr page a way for when a youtube video or a SoundClouds is clicked, it shall open into another window. I am unable to figure out how to do this. Here is a example of them code I am using for SoundCloud &lt;a href="{text:Link Two}" target="_blank"class="links"&gt;{text:Link Two Title}&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
has title: Youtube/SoundCloud video open in new tab when clicked
has comment: http://stackoverflow.com/comment/46117138
tagged with: youtube
has comment: http://stackoverflow.com/comment/46117321
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28930767
has comment: http://stackoverflow.com/comment/46117156
possible better answer: http://stackoverflow.com/a/28930780
type: Question
has answer: http://stackoverflow.com/a/28930780

http://stackoverflow.com/a/29019967
has body: In my case, I found the answer here: Bootstrap won't detect jQuery 1.11.0 - Uncaught Error: Bootstrap's JavaScript requires jQuery The Java console was throwing up the error mentioned there, and after lord knows how much hunting, simply changing the order the js files were loaded made the difference. Bootstrap after jQuery, everything works perfectly!! //= require jquery //= require jquery_ujs //= require bootstrap //= require turbolinks //= require_tree .
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29017337
type: Answer
answers question: http://stackoverflow.com/q/29017337
downvote count: 0

http://stackoverflow.com/comment/46268222
type: Comment
has text: I want to say problem is not solved, It's work as same before. Thank u.
comment on: http://stackoverflow.com/a/29011080
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46113588
comment on: http://stackoverflow.com/a/28923910
score: 1
type: AnswerComment
has text: Here is the modified code that flips triangle: http://jsfiddle.net/yp6j5qem/15/ Hope this helps!
type: Comment

http://stackoverflow.com/comment/46150890
has text: How do you call `testRefresh`? if its on a button click, you need to return false so that it doesnt post back. Or set `AutoPostBack = false`
score: 0
comment on: http://stackoverflow.com/q/28948433
type: QuestionComment
type: Comment

sequelize.js
type: Tag
tags question: http://stackoverflow.com/q/28921074
tags question: http://stackoverflow.com/q/28995597
tags question: http://stackoverflow.com/q/28933090
tag name: sequelize.js

http://stackoverflow.com/comment/46235430
score: 1
has text: Yes, `new this.constructor()` is one use case. No `getPrototypeOf` required, though :-)
type: AnswerComment
comment on: http://stackoverflow.com/a/28985934
type: Comment

http://stackoverflow.com/a/29038198
has comment: http://stackoverflow.com/comment/46317664
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29037916
has comment: http://stackoverflow.com/comment/46318590
answers question: http://stackoverflow.com/q/29037916
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46319925
has comment: http://stackoverflow.com/comment/46317157
has comment: http://stackoverflow.com/comment/46317105
has comment: http://stackoverflow.com/comment/46317599
type: Answer
has body: I would suggest storing the price information as a numeric value somewhere, like in hidden input fields or data- attributes on the table cells, and create IDs on those elements that you can associate with the inputs for stock purchases. Then it's just a matter of doing some simple math. Here's an example using hidden inputs: SHARE PRICE $43.93 $43.87 $26.33 Important information that you should know about these stocks: 0.1% of the trade value if the total trade value is less than $10,000 0.08% of the trade value if the total trade value is greater than or equal to $10,000 The minimum commission is $5 Enter the number of Oracle Corporation stocks you wish to purchase!: Enter the number of Microsoft Corporation stocks you wish to purchase!: Enter the number of Symantec Corporation stocks you wish to purchase!: Here's the code for putting the total into a textbox. This would go at the end of your form and replace the
score: 1
has comment: http://stackoverflow.com/comment/46320275
has comment: http://stackoverflow.com/comment/46317485

http://stackoverflow.com/comment/46189696
has text: @LarsKotthoff I saved the css locally from the nvd3 site. I just took the link out and the chart was completely smushed and bad looking.... so I know that the css is being linked properly
score: 0
comment on: http://stackoverflow.com/q/28968928
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28978108
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/46206955
tagged with: javascript
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/46227540
has comment: http://stackoverflow.com/comment/46207005
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: textbox
favorite count: 0
has comment: http://stackoverflow.com/comment/46231530
upvote count: 1
has title: Populate any textbox in an HTML table with one javascript function
has body: I have not posted on Stack in a long time so my apologies if my question is missing any obvious details for a solution. Here is my problem: I have an html table with 20 rows, 5 columns of textboxes in each row. I have the rows populating values in 3 specific textboxes (Total pipes, total fitting, total other items) using the 'onchange' event in javascript functions. The way it works is you type in either 'pipe', 'fitting', or 'other' in a textbox, then you select the value 1,2,3,4, or 5 from a select drop-down. The select drop-down has an 'onchange' event. The 'onchange event then populates another textbox with 'total pipes being ordered' , 'total fitting items' being ordered or 'total other items ordered' based on if you typed 'pipe', 'fitting' or 'other' and which row you indicated this in. For example, if you select 'pipes' and a quantity of '3' in row 1, then select 'pipes' and a quantity of '5' in row 7, the value in the 'total pipes' textbox has to show '8'. My code is going to get out of hand quickly the direction I am going and I am sure there is a much simpler way to make this week. Any help is appreciated. Below is my code: HTML ----- 1 2 3 4 5 ----- 1 2 3 4 5 JavaScript var stotal; var s1, s2, s3, t1, t2, t3; function populateUPrice() { // declare variable to hold quantity amount s1 = document.getElementById("txtItemBoxVal2").value; t1 = document.getElementById("seltype").value; stotal = s1; if (t1 == "pipe") { document.getElementById("seltype").innerHTML = "pipe" document.getElementById("pipeFt").value = s1; document.getElementById("fittingsCt").value = ""; document.getElementById("otherVal").value = ""; } else if (t1 == "fitting") { document.getElementById("seltype").innerHTML = "fitting" document.getElementById("fittingsCt").value = s1; document.getElementById("pipeFt").value = ""; document.getElementById("otherVal").value = ""; } else if (t1 == "other") { document.getElementById("seltype").innerHTML = "other" document.getElementById("otherVal").value …
tagged with: function

http://stackoverflow.com/comment/46115334
has text: A little explanation of what you did would make this a better answer. As it is now, we're left to try to compare this code to the original to figure out what you did.
comment on: http://stackoverflow.com/a/28927013
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29058858
answers question: http://stackoverflow.com/q/29051039
has body: Thanks to suggestion from instantNoodles, I was able to solve the problem. As soon as a selection was made from pop up, the pop up was getting closed and focus came to my input text. I captured the onfocus event and that solved my problem.
score: 0
type: Answer

http://stackoverflow.com/a/28942057
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28941972
upvote count: 1
answers question: http://stackoverflow.com/q/28941972
score: 1
has body: submit() is a function of a element, so just get the form instead of the button element. For example: document.forms["myform"].submit();

http://stackoverflow.com/comment/46229757
comment on: http://stackoverflow.com/q/28990588
score: 0
type: Comment
has text: You mean, outside the angular app ?
type: QuestionComment

http://stackoverflow.com/q/28994842
has comment: http://stackoverflow.com/comment/46237898
possible better answer: http://stackoverflow.com/a/28995346
has answer: http://stackoverflow.com/a/28995346
has comment: http://stackoverflow.com/comment/46237956
type: Question
has title: How to expel a rect from inside another rect - Javascript
has comment: http://stackoverflow.com/comment/46238637
has body: I am trying to make rect1 move out from inside rect2. I have tried to look around for an awsner but i am unable to find a satisfactory awnser. I can detect the rectangles intersecting, but i cannot expel rect1 so it goes outside rect2. Can you provide some code to help me do this? I will provide my detection code so far. Code: var DoCollision = function(rect1, rect2, objectToMove){ if (rect1.x + rect1.w &gt; rect2.x &amp;&amp; rect1.x &lt; rect2.x + rect2.w &amp;&amp; rect1.y + rect1.h &gt; rect2.y &amp;&amp; rect1.y &lt; rect2.y + rect2.h){ // Expel rect1 from rect2 here using objectToMove as the object being expelled (In this case, rect1). }; }; Thank you for responding if you do. i should tell you the bigger picture. I am trying to make a function where i input 3 rect objects, to test if they are colliding or not, and if so, i want the third rect object to move accordingly. For example, the function parameters are rect1, rect2, rect1, meaning when rect1 intersects rect2 on the left side, i want the third parameter rect1 to move left
answer count: 2
tagged with: function
accepted answer: http://stackoverflow.com/a/28996001
has comment: http://stackoverflow.com/comment/46238017
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46237973
has comment: http://stackoverflow.com/comment/46238786
score: 1
has comment: http://stackoverflow.com/comment/46237928
favorite count: 0
has comment: http://stackoverflow.com/comment/46238006
has comment: http://stackoverflow.com/comment/46238157
has comment: http://stackoverflow.com/comment/46238605
upvote count: 1
has answer: http://stackoverflow.com/a/28996001
has comment: http://stackoverflow.com/comment/46237979
tagged with: rect
tagged with: collision
type: AnsweredQuestion

http://stackoverflow.com/comment/46154172
type: AnswerComment
type: Comment
has text: so there is no version history, but commit history.. Like in here - by commits: https://github.com/DefinitelyTyped/tsd#tsdjson not as nice as it could be. Not like in package.json, bower.json - the dependencies by version. But now.. this question is more related to 'psd'
score: 0
comment on: http://stackoverflow.com/a/28950095

http://stackoverflow.com/comment/46086592
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28914028
has text: Assume you have tons of (possibly) big files. Splitting into arrays all of them doesn't seem to me like a good thing. But there is optimalization for the snippet I gave. You can actually save the regex so you won't iterate through file every time.
score: 0

http://stackoverflow.com/comment/46122080
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28930222
has text: Any example of free web service that allow to store few Hundred megabytes of webiste + Database and HTTPS? If you give the example then the problem is invented else not

http://stackoverflow.com/comment/46180187
has text: Have you got any examples of problem situations that could occur? And any suggestions on what to use in combination or instead to strip comments.
score: 1
comment on: http://stackoverflow.com/q/28963501
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46145533
has text: I meant to refresh it on button click. But, anyway, can you explain to me why do you need to use JavaScript?
type: AnswerComment
comment on: http://stackoverflow.com/a/28944664
score: 0
type: Comment

http://stackoverflow.com/q/29020264
answer count: 2
has comment: http://stackoverflow.com/comment/46284471
tagged with: javascript
favorite count: 0
tagged with: submit-button
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29020444
has answer: http://stackoverflow.com/a/29020444
accepted answer: http://stackoverflow.com/a/29020824
score: 2
type: AnsweredQuestion
has title: Cannot re-set form submit button to disabled
has comment: http://stackoverflow.com/comment/46284441
downvote count: 0
tagged with: disabled-control
has body: On a webpage I have a form: &lt;form action="/SignUp.py" method="post"&gt; &lt;input required type="text" name="fullName" onKeyPress="checkFinished()" autofocus&gt; &lt;input type="submit" name="submitButton" value="Sign Up" disabled&gt; &lt;/form&gt; and script: &lt;script&gt; function checkFinished() { if (document.getElementsByName("fullName")[0].value.match(/. ./).length &gt; 0) { document.getElementsByName("submitButton")[0].disabled = false; } else { document.getElementsByName("submitButton")[0].disabled = true; } } &lt;/script&gt; If I step through the code using Firebug, I can see the execution path is correct. However, when the code hits the else clause and should be (re-)disabling submitButton, it does not get disabled. What am I doing wrong here?
has answer: http://stackoverflow.com/a/29020824
tagged with: forms
type: Question
upvote count: 2

http://stackoverflow.com/comment/46329499
comment on: http://stackoverflow.com/q/29044852
type: QuestionComment
type: Comment
has text: @guest271314: While the exact timing is certainly useful to know, I'm not sure it's crucial.
score: 0

selectors-api
tag name: selectors-api
type: Tag
tags question: http://stackoverflow.com/q/28912064

meta-tags
tags question: http://stackoverflow.com/q/29045621
tag name: meta-tags
type: Tag

http://stackoverflow.com/comment/46317402
comment on: http://stackoverflow.com/a/29032919
score: 0
has text: I tried this but I got an error in console 'Error: Syntax error, unrecognized expression: /#about' (/#about is the value of href attribute in one of my menu items).
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29039036
has answer: http://stackoverflow.com/a/29043968
favorite count: 0
has comment: http://stackoverflow.com/comment/46319412
tagged with: google-chrome-extension
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/29043968
upvote count: 1
has comment: http://stackoverflow.com/comment/46327252
type: Question
has title: Restructuring DOM searching method?
tagged with: javascript
has comment: http://stackoverflow.com/comment/46319261
has comment: http://stackoverflow.com/comment/46319236
has body: As part of a Chrome extension I am searching the entire DOM for elements containing specific words inside each ID/Class. Currently it looks something like: "allSelectors": document.querySelectorAll("[id*='example'][class*='example']"), "collapse": function () { for (var i = 0; i &lt; MyObject.allSelectors.length; i++) { // Manipulate MyObject.allSelectors[i] etc } }, First, I would like to restructure it somehow (possibly using an array?) so that it is easy to add new selectors as doing it like this: document.querySelectorAll("[id*='example'][class*='example'][id*='other'][class*='other']") Isn't easily scaleable or good. Secondly, I think document.querySelectorAll is very slow - the reason I am using it is because I need to search anywhere in an id/class (hence the use of *=) and cannot use a big external library (such as jQuery), as this is a small file and is being injected user side. Is there an any solution to either of these problems? because if there are many matches then this slowness might become an issue.
answer count: 1
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/46319194

http://stackoverflow.com/q/29045336
has comment: http://stackoverflow.com/comment/46334633
has answer: http://stackoverflow.com/a/29315101
has comment: http://stackoverflow.com/comment/46339975
type: AnsweredQuestion
has title: Rails Google maps javascript api v3 setIcon() url can't locate image
has body: I'm changing the marker image upon mouseover of an element on the page, using the setIcon() method. It works fine when the url is something like this: marker.setIcon('https://www.google.com/mapfiles/marker_green.png'); but when I try to get it to find an image in my local application directory, it can't find the image (the original marker image disappears but the new one doesn't appear): marker.setIcon('images/myMarker.png'); I've tried every possible url (app/assets/images/myMarker.png, /images/myMarker.png, assets/images/myMarker.png, etc), and also placed the image in many different locations, it still doesn't work. How do I get the javascript to find my png??
accepted answer: http://stackoverflow.com/a/29315101
tagged with: ruby-on-rails
type: Question
possible better answer: http://stackoverflow.com/a/29198048
has answer: http://stackoverflow.com/a/29198048
tagged with: javascript
tagged with: google-maps-api-3
score: 0
answer count: 2
tagged with: google-maps

http://stackoverflow.com/comment/48584484
has text: Thanks for your help. I never managed to get this to work so I've given up on Angular with Drupal for now!
type: Comment
comment on: http://stackoverflow.com/a/29019970
type: AnswerComment
score: 0

http://stackoverflow.com/a/28977261
score: 0
has body: I can't find anything wrong with the initial script or the call to it to display the button. With Facebook you can have a personal page and you can also be an admin on other pages as well. Where this is embedded at your site the button will not display unless you are logged into Facebook. If not logged into Facebook you'll get a small clickable link that says login. Once you then login to Facebook that login link will disappear and the like button will pop up. Just to be thorough I pasted your code into my website and your like button displayed just fine...
type: Answer
answers question: http://stackoverflow.com/q/28977075

http://stackoverflow.com/comment/46173828
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/28960788
has text: But doing this all from a web request is going to be slow with large volumes of data.... use a web request to upload the file, then trigger a background task to actually do the file/database checking so that the user isn't left waiting and wondering what's happening
type: Comment

http://stackoverflow.com/a/28934035
score: -1
has body: yes. just delete or modify it. its a javascript object.
upvote count: 0
has comment: http://stackoverflow.com/comment/46124054
has comment: http://stackoverflow.com/comment/46123834
answers question: http://stackoverflow.com/q/28933981
has comment: http://stackoverflow.com/comment/46123868
type: Answer
has comment: http://stackoverflow.com/comment/46124081
downvote count: 1

http://stackoverflow.com/q/29037655
tagged with: ruby-on-rails-4
has body: I have an order form on an item show page: &lt;%= form_for(Order.new, remote: true) do |f| %&gt; &lt;%= f.number_field :quantity_requested, value: 0, max: @item.quantity, min: 1, class: "item-quantity form-control" %&gt; &lt;%= f.hidden_field :item_id, value: @item.id %&gt; &lt;% end %&gt; I have to reload the page in order for the new quantity to update in the database. I would like for it to update in the db without having to refresh the page. This is what I have in my item coffeescript: $ -&gt; $('.item-quantity').click () -&gt; $(this).closest('form').submit(); $.ajax(url: item_url).done (html) -&gt; $('.item-quantity').append html And this is what I have in my order controller: def create @order = Order.find_or_initialize_by(user_id: current_user.id, item_id: params[:order][:item_id]) @order.update_attribute(:quantity_requested, params[:order][:quantity_requested]) @order.save respond_to do |format| format.html { redirect_to :back } format.js { redirect_to :back } end end I suspect my error is in coffeescript. I've tried adding return false and prevent default but that doesn't work. Can anyone help? Thanks a lot in advance.
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has title: Ajax/Coffescript form update without reloading page
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46322398
has comment: http://stackoverflow.com/comment/46321335
tagged with: coffeescript
type: Question

http://stackoverflow.com/q/28924429
upvote count: 1
has comment: http://stackoverflow.com/comment/46105610
has body: Given an array of self-contained JavaScript functions is there a way to access their respective indexes from within the function code? I would like to avoid having to hard-code those indexes in the function code: var testArr = [ (function(){return 0})(), (function(){return 'how to return/access ARRAY INDEX (=1)??'})() ] console.log(testArr[0]) // 0 console.log(testArr[1]) // how to return/access ARRAY INDEX (=1)??
score: 0
has comment: http://stackoverflow.com/comment/46105667
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46106260
tagged with: function
tagged with: arrays
tagged with: self-contained
tagged with: javascript
has answer: http://stackoverflow.com/a/28924969
has title: JavaScript Array of Self-Contained Functions access to index of self
has comment: http://stackoverflow.com/comment/46106012
has comment: http://stackoverflow.com/comment/46105633
answer count: 1
has comment: http://stackoverflow.com/comment/46105396
has comment: http://stackoverflow.com/comment/46105696
favorite count: 0
has comment: http://stackoverflow.com/comment/46105776
type: UnansweredQuestion

http://stackoverflow.com/q/28954780
has title: Popup not showing once per session as wanted (as mentioned by client)
tagged with: css
has body: I'm trying to get a popup to show on load once per session. I'm seeing it okay from my end but my client is saying that he's not seeing it after the first time even after restarting his browser and clearing the cache. Is there something I should change with the code below? Also, I'm unable to click the close button on mobile with touch. How can I make #popup-close respond to touch? HTML &lt;div id="popup-wrap"&gt; &lt;div id="popup"&gt; &lt;div id="popup-close"&gt;&amp;times;&lt;/div&gt; &lt;a href="http://google.com/" target="_blank"&gt; &lt;img src="image.jpg" width="100"&gt; &lt;/a&gt; &lt;h2&gt;We are featured this month in Architectural Digest!&lt;/h2&gt; &lt;a href="http://www.architecturaldigest.com/" target="_blank"&gt;Read the article &amp;raquo;&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; JS if (localStorage.getItem('popState') != 'shown'){ $("#popup-wrap").delay(2000).fadeIn(); localStorage.setItem('popState','shown') } $('#popup-close').click(function(e) { e.preventDefault(); $('#popup-wrap').fadeOut(); // Now the pop up is hidden. }); CSS #popup-wrap { background: #fff; box-shadow: 1px 0 3px #999; display: none; font-family: 'montserrat', sans-serif; height: 210px; left: 50%; margin-left: -250px; margin-top: -105px; opacity: .8; position: absolute; text-transform: uppercase; top: 50%; width: 500px; z-index: 11; } #popup { padding: 40px; position: absolute; } #popup-close { cursor: pointer; font-size: 36px; position: absolute; right: 10px; top: 0; } #popup img { float: left; margin-right: 20px; } #popup h2 { color: #222; font-size: 20px; margin-bottom: .5em; } #popup a { font-size: 12px; text-decoration: none; } http://jsfiddle.net/23gu3L0h/
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28954876
linked to: http://stackoverflow.com/q/5523140
type: Question
tagged with: mobile
has answer: http://stackoverflow.com/a/28954876
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/20204255
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/46088759
comment on: http://stackoverflow.com/q/28914706
score: 0
has text: Can you clarify what you mean by "call functions from the text"? I wonder if manually calling `$compile` is unnecessary...
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46188047
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28967581
type: QuestionComment
has text: @epascarello okay, the correct code is probably : $(document, window.opener.document).trigger('myEvent') ? I've tried it and the event seems not trigger in the parent window.

http://stackoverflow.com/q/28992219
tagged with: substring
has title: Can anyone help me with why .substring() isn't working with setInterval roll out text?
downvote count: 3
has comment: http://stackoverflow.com/comment/46233120
answer count: 1
tagged with: setinterval
has comment: http://stackoverflow.com/comment/46232884
has answer: http://stackoverflow.com/a/28992607
accepted answer: http://stackoverflow.com/a/28992607
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
score: -3
has body: the idea is to target a pre-defined invisible P element with text inside in the document and to make it roll out and visible again(the function that makes the text-invisible upon body load event isn't included). I've commented the line of code that doesn't work with the substring method on it. var tally = 0; //global. var rollTextOut = function(x){ //make re-usable for all roll-outs. var anim = setInterval(function(){sequence()}, 50); function sequence(){ tally++; if(x===1){ var pHidden1 = document.getElementById("roll1"); pHidden1.style.background="#fff"; pHidden1.style.zIndex="2"; pHidden1.style.visibility="visible"; var text = pHidden1.innerHTML; //targets the p text inside html doc. pHidden1.innerHTML = text.substring(0, tally); //&lt;why doesn't this work? } else if(x===2){ var pHidden2 = document.getElementById("roll2"); pHidden2.style.background="#fff"; pHidden2.style.zIndex="2"; pHidden2.style.visibility="visible"; pHidden2.innerHTML = tally; } else if(x===3){ var pHidden3 = document.getElementById("roll3"); pHidden3.style.background="#fff"; pHidden3.style.zIndex="2"; pHidden3.style.visibility="visible"; pHidden3.innerHTML = tally; } else{ var pHidden4 = document.getElementById("roll4"); pHidden4.style.background="#fff"; pHidden4.style.zIndex="2"; pHidden4.style.visibility="visible"; pHidden4.innerHTML = tally; } if(tally===15){ clearInterval(anim); tally=0; } }; }; Any help and suggestions greatly appreciated.
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/46233111
type: Question
has comment: http://stackoverflow.com/comment/46233061
has comment: http://stackoverflow.com/comment/46232864
tagged with: javascript
has comment: http://stackoverflow.com/comment/46233652

http://stackoverflow.com/a/28954856
type: Answer
answers question: http://stackoverflow.com/q/28940540
upvote count: 1
has comment: http://stackoverflow.com/comment/46167814
has comment: http://stackoverflow.com/comment/46167953
has comment: http://stackoverflow.com/comment/46167619
score: 1
type: AcceptedAnswer
downvote count: 0
has body: You first need to remove everything relating to storing and retrieving your collection in session. The workflow should be In the GET method, get the collection and render it in the view. In the Delete() method, call the database and delete the object based on the ID value. If successful, return Json(true);, if not return Json(null);. In the ajax success function, test if data was returned, if so, delete the row, if not, display error message (refer my answer to your previous questions here and here). The View2() method should save the collection to the database (remove the string button parameter) and should have no relationship to an Add method. In order to dynamically add a new item to the DOM which can be bound to your collection, two options are: Call a method that returns a partial that uses BeginCollectionItem() so that the new item includes an indexer (in the same way that your current for loop is doing). If you use this method, then you could replace your for loop with a simple foreach loop that calls the partial for each item. Include a html template in the view (inside a hidden element) that you clone and update the Indexer and add it to the DOM. Both options are discussed in this answer. Note also the need to re-parse the validator each time a new item is added.
accepted answer of: http://stackoverflow.com/q/28940540

http://stackoverflow.com/comment/46337413
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29049587
has text: Are media-left and media-body overlapping somehow? A click event might fire for both of the links in that case.
score: 0

http://stackoverflow.com/q/28933457
has comment: http://stackoverflow.com/comment/46129970
tagged with: unit-testing
linked to: http://stackoverflow.com/q/20931737
type: Question
has title: Chai expected [Function] to throw an (error) not passing the test (Using Node)
has comment: http://stackoverflow.com/comment/46123288
tagged with: javascript
tagged with: mocha.js
score: 4
has comment: http://stackoverflow.com/comment/46123179
has comment: http://stackoverflow.com/comment/46123334
has comment: http://stackoverflow.com/comment/46123236
accepted answer: http://stackoverflow.com/a/28936665
has comment: http://stackoverflow.com/comment/46125717
answer count: 1
has comment: http://stackoverflow.com/comment/46123269
favorite count: 0
has answer: http://stackoverflow.com/a/28936665
upvote count: 4
has body: The question: I'm using Chai to do the tests and I seem to be stuck on testing an expected error: Chai expected [Function] to throw an (error) Current code: Here's the code of the test: describe('Do something', function () { it('should remove a record from the table', function (done) { storage.delete(ID, done); }); it('should throw an error when the lookup fails', function () { expect(storage.delete.bind(storage, ID)).to.throw('Record not found'); }); }); Here's the code of the function: delete: function (id, callback) { // Generate a Visitor object visitor = new Visitor(id); /* Delete the visitor that matches the queue an cookie provided. */ tableService.deleteEntity(function (error, response) { // If successful, go on. if (!error) { // Do something on success. } // If unsuccessful, log error. else { if (error.code === 'ResourceNotFound') { throw new Error('Record not found'); } // For unexpected errros. else { throw new Error('Table service error (delete): ' + error); } } if (callback) callback(); }); }, Attempted solutions: I've tried multiple variations of calling expect function (including calling anonymous function: expect(function() {storage.delete(ID);}).to.throw('Record not found'); Bind, as provided in the example, and the basic one of expect(storage.delete(ID)).to.throw('Record not found'); I've also tried substituting the throw parameter from 'Record not found' to multiple things including directing the input to an already created error (Error), and creating a new error in the parameter (new Error('Record not found')); Possible causes: I have a suspicion that the error is not being thrown because it takes a while for the test to communicate with the database to delete the record, however I am not sure of how I could remedy that. Additionally, it seems that the test that runs right after this one actually returns the error that was supposed to be returned on THIS test.
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
tagged with: chai
has comment: http://stackoverflow.com/comment/46122876

http://stackoverflow.com/comment/46728145
has text: Awesome :) Almost what I'm looking for.... Is it possible to set all selectboxes to `null` when you change a selectbox? So when sb1 + sb2 + sb3 is selected and I change sb1 to something else that sb2 and sb3 are set to `null`? Right now only sb2 is set to null... Anyway thx for your heads up....
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29260174
type: Comment

http://stackoverflow.com/comment/46163619
type: Comment
comment on: http://stackoverflow.com/a/28954876
has text: I have a Samsung Galaxy Note 4, Let me do some digging. Ill let you know what I find.
type: AnswerComment
score: 0

http://stackoverflow.com/q/29060039
has answer: http://stackoverflow.com/a/29060118
tagged with: javascript
has answer: http://stackoverflow.com/a/29060112
score: 0
answer count: 3
has body: I am having problem to show my hidden div once I select either of my options. Currently I have done the javascript code for it. This is my HTML code: Customer Type: Customer Type? Customer Trade Company Name This is my current Javascript code: function custType(val) { if (val == "trd") { document.getElementById("tradeCustDetails").style.visibility = "visible"; document.getElementById("retCustDetails").style.visibility = "hidden"; } if (val == "ret") { document.getElementById("tradeCustDetails").style.visibility = "hidden"; document.getElementById("retCustDetails").style.visibility = "visible"; } } I did some research through stackoverflow and found a solution through the JSFiddle but that code is not working on my file. Can anyone help me out with this. Thank you.
accepted answer: http://stackoverflow.com/a/29060118
has comment: http://stackoverflow.com/comment/46356391
tagged with: http://stackoverflow.com/tag/html
has title: Cannot display hidden div once an option is selected
possible better answer: http://stackoverflow.com/a/29060081
tagged with: css
has answer: http://stackoverflow.com/a/29060081
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/46115088
type: Comment
comment on: http://stackoverflow.com/a/28929218
has text: Always the way. It's either ", ', ), }, ] or >. Glad you found the problem.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46123334
has text: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise and any implementation, like `Q` or `Bluebird`
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28933457
type: QuestionComment

http://stackoverflow.com/comment/46305250
has text: This should address the question asked but as pointed out by Daniel, there are other problems with your code
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29032178

http://stackoverflow.com/q/28933184
type: AnsweredQuestion
type: Question
score: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/32395093
tagged with: ember.js
has title: Bootstrap responsive table doesn't work with Ember.js
has body: I'm new to Bootstrap and Ember. I'm trying to generate a responsive table using Ember.js. The problem is that when my application is running if I change the browswer's size to an small one, I don't see the horizontal scroll at the table as expected. However if I save the web page and open it from disk, then it works ok. Very odd :) I'm pasting my page code here in case it helps. It's a simple example I'm using to learn. Thanks in advance. Cheers!! Gonzalo
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/32395093

http://stackoverflow.com/comment/46338378
score: 0
type: AnswerComment
type: Comment
has text: we´re not here to program for you, i´m afraid ;) but there are hundreds of very good tutorials about using promises, just use google and you will find a LOT of them.
comment on: http://stackoverflow.com/a/29049696

http://stackoverflow.com/q/28979026
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28985843
has comment: http://stackoverflow.com/comment/46209391
type: Question
has title: Display values of properties file in jsp without using scriptlet
tagged with: java
tagged with: javascript
has comment: http://stackoverflow.com/comment/46209503
has comment: http://stackoverflow.com/comment/46209543
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28979917
tagged with: jsp
has body: I am having a jsp with a dropdown, when the dropdown value is changed other textboxes in the jsp must be populated with the properties value based on a condition. I have achieved this by using scriptlet in my jsp. Can anyone provide me a solution to achieve the same without using scriptlet. JSP <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="java.io.FileInputStream"%> <%@ page import="java.util.Properties"%> <%@ page import="java.io.FileNotFoundException" %> <%@ page import="java.io.InputStream" %> <% Properties prop = new Properties(); String propFileName = "server_url.properties"; InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(propFileName); if (inputStream != null) { prop.load(inputStream); } else { throw new FileNotFoundException("property file '" + propFileName + "' not found in the classpath"); } String demoApp = prop.getProperty("DemoApps_name"); String relDashboard=prop.getProperty("RelDashBoard_name"); String demoAppLinks = prop.getProperty("DemoApps_Links"); String demoAppsdb=prop.getProperty("DemoApps_DataBase"); String demoAppservice=prop.getProperty("DemoApps_WebServices"); %> Monitoring Dashboard Application Name: Select Application Demo Application Reliability DashBoard Application Link:* Application Database:* Application Webservices:* Javascript

http://stackoverflow.com/comment/137398321
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28974042
type: Comment
has text: @S.W.G. - addEventListener is a function on the document object - it takes two arguments: 1: a string name of the event to listen for ('contextmenu' in this case), and 2: a function to be called when that named event fires, whose argument is an event object (in this case, a PointerEvent). You can experiment with this by opening the developer tools javascript console on a web page and running: `document.addEventListener("contextmenu", function(e) { console.dir(e); }); ` and then right click on some element in that page. The console will print a handle to a PointerEvent which you can examine.

http://stackoverflow.com/a/28926574
answers question: http://stackoverflow.com/q/28926049
score: 0
type: Answer
has body: for @charlietfl It's not right, look the function used to add an employee in JS array. $scope.AddInList = function () { var nome = $("#nome").val(); var cognome = $("#cognome").val(); var matricola = $("#matricola").val(); $("#nome").val(""); $("#cognome").val(""); $("#matricola").val(""); nDip = nDip + 1; listEmployees.push(new Employee(nome, cognome, matricola)); $("#cont").text(nDip); $scope.listaDipendenti = JSON.parse(JSON.stringify(listEmployees)); };

http://stackoverflow.com/comment/76335839
type: AnswerComment
comment on: http://stackoverflow.com/a/29802434
type: Comment
has text: When I use this snipped, I get alle the infos. But mocha also prints everything to stdout. Is there a way to suppress this behavior and only get data of the tests without any output? Thanks in advice!
score: 0

http://stackoverflow.com/q/28955207
tagged with: javascript
score: 0
tagged with: jsp
tagged with: jquery
has comment: http://stackoverflow.com/comment/46372793
has comment: http://stackoverflow.com/comment/46164891
has title: How to check if particular check box is checked in JSP
has body: Based on the checkbox I have to modify my JSP contents.How should I check if particular checkbox is checked or not.As far I have tried: &lt;c:choose&gt; &lt;c:when flag="${idName==true}"&gt; contents &lt;/c:when&gt; &lt;c:otherwise&gt; alternate contents &lt;/c:otherwise&gt; idName is the id of the checkbox lets say. Updated: &lt;% boolean flag=false; %&gt; &lt;script type="text/javascript"&gt; if (document.getElementById("idName").checked) { &lt;% flag=true %&gt; } &lt;/script&gt; &lt;% if(flag==true) { %&gt; content &lt;% } else { %&gt; alternate content &lt;% } %&gt; But still its not working.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46165696
has comment: http://stackoverflow.com/comment/46278116
has comment: http://stackoverflow.com/comment/46293457
answer count: 0
has comment: http://stackoverflow.com/comment/46261955
type: Question
has comment: http://stackoverflow.com/comment/46261984

http://stackoverflow.com/comment/46311957
type: AnswerComment
has text: added example of using an observer
comment on: http://stackoverflow.com/a/29013622
type: Comment
score: 1

http://stackoverflow.com/comment/46243497
type: Comment
type: QuestionComment
has text: @phari Nope. Put the .vbhtml on a server, still getting cut off at the # on window.open.
comment on: http://stackoverflow.com/q/28997205
score: 0

http://stackoverflow.com/comment/46151157
comment on: http://stackoverflow.com/q/28948467
type: QuestionComment
has text: You can't. Vertices are infinitely small representations of a point. If you want to color them, add a geometry/mesh at the same location and associate to the vertex.
score: 0
type: Comment

http://stackoverflow.com/comment/46204603
type: QuestionComment
comment on: http://stackoverflow.com/q/28976760
has text: It is probably because your api call is not supporting jsonp, i.e it does not return wrapped(callback) object. But i am not sure if you will get 404 for that though
score: 1
type: Comment

math
tags question: http://stackoverflow.com/q/28942837
tags question: http://stackoverflow.com/q/28971026
type: Tag
tags question: http://stackoverflow.com/q/28994347
tags question: http://stackoverflow.com/q/28978909
tags question: http://stackoverflow.com/q/28969900
tags question: http://stackoverflow.com/q/28973258
tags question: http://stackoverflow.com/q/29025662
tags question: http://stackoverflow.com/q/29007997
tags question: http://stackoverflow.com/q/29008083
tags question: http://stackoverflow.com/q/28922268
tags question: http://stackoverflow.com/q/28943708
tags question: http://stackoverflow.com/q/28974770
tags question: http://stackoverflow.com/q/29019464
tag name: math

http://stackoverflow.com/q/28984021
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 1
has title: Css put a full line at the bottom of every row with angular ng repeat
has answer: http://stackoverflow.com/a/28984304
has answer: http://stackoverflow.com/a/28984858
type: AnsweredQuestion
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28984858
possible better answer: http://stackoverflow.com/a/28984304
has body: I have a loop with ng repeat over divs, every div has a width and margin right, they need to be two divs in a row, my problem is that i need a full line at the bottom of every row, not like how it is now with break, how can i do this? This is the plunker: http://plnkr.co/edit/IGYwgVOhc1eJ24UqROgZ?p=preview &lt;div ng-repeat="person in persons" class="personBox"&gt; &lt;p&gt;{{person.name}}&lt;/p&gt; &lt;/div&gt; .personBox { width: 45%; float: left; margin-right: 10%; border-bottom:1px solid #000; } .personBox:nth-child(even) { margin-right: 0; } app.controller('testCtrl', function($scope) { $scope.persons = [{ name: 'avi' }, { name: 'tom' }, { name: 'john' }, { name: 'ben' }, { name: 'ben2' }, { name: 'ben3' }, { name: 'ben4' }, { name: 'ben5' }] })
type: Question
has answer: http://stackoverflow.com/a/28984207
answer count: 3
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/28944761
accepted answer: http://stackoverflow.com/a/28944975
tagged with: proxy
type: AnsweredQuestion
has title: node-http-proxy proxy.on('proxyReq'...) never fires
has body: I am using node.js proxy. It works successfully, however: proxy.on('proxyResponse', function (proxyRes, req, res) { console.log("hi"); }); Never fires even though I see in the browser my api request was proxied successfully and I successfully got my json. Why isn't the proxyResponse firing?
type: Question
answer count: 1
tagged with: node.js
score: 0
has answer: http://stackoverflow.com/a/28944975
tagged with: javascript

http://stackoverflow.com/q/28962859
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28963470
has body: I'm working on fixing a site that has been built by someone other than me. I am required to fix the menu scroll in mobile view. So far all I really know is that if you resize the browser then you are suddenly able to scroll, but if you are using a mobile then this is not the case. The site is called clasado.com If you change to mobile view by reducing your browser view port, then open the menu, you will see you can not scroll until you resize the browser. The javascript for this menu is as follows: /** * Navigation.js */ (function() { var Console = window.Console || (function() { return { name: function() { return "Console" }, defaultConfig: function() { return this; }, config: function() { return this; }, to: function() { return this; }, in: function(m) { console.log(m); return this; }, out: function() { return this; }, log: function(m) { console.log(m); return this; }, reset: function() { return this; } } })(); var search = { open: "[data-open]", toggler: "&gt;a&gt;[data-toggle]", group: "li &gt; ul[data-collapsible]", collapsible: "[data-collapsible]", sidebarLeft: ".is-data .sidebar-left", sidebar: ".sidebar" } /** * The data-open attribute denotes that the menu block should open the sidebar */ $(search.open).on("click", function(evt) { var sidebar = $(search.sidebar); var toggler = UUID.generateFor(this); var Log = toggler.data("log"); if(window.handyHint) { handyHint.hide(); } var isVertical = (function(sidebar, Log) { return function() { Log.in("checkIfSidebarIsVertical"); var isVertical = sidebar.find(".visible.vertical").css("display") !== "none"; return Log.out(isVertical); } })(sidebar, Log); var sidebarControl = (function(sidebar, Log, isVertical) { return { /* * Check to see if the sidebar is currently open */ isOpen: function() { return sidebar.data("open") === true &amp;&amp; sidebar.hasClass("open"); }, isClosed: function() { return sidebar.data("open") !== true &amp;&amp; !sidebar.hasClass("open"); }, /* * Opens the passed sidebar */ open: function(…
has title: Menu when in mobile will not scroll
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 0
type: Question
has answer: http://stackoverflow.com/a/28963470
tagged with: javascript
answer count: 1

http://stackoverflow.com/comment/46090897
comment on: http://stackoverflow.com/q/28915721
type: Comment
type: QuestionComment
has text: liely a bad idea using a mini framework that interacts with history on top of angular. Why not just use angular for the ajax?
score: 0

http://stackoverflow.com/comment/46241577
comment on: http://stackoverflow.com/a/28977640
score: 0
type: Comment
type: AnswerComment
has text: Your code seems to be working fine in Internet Explorer and Firefox, but in Google Chrome it won't display the cookies "test" or "mediaType" when they have expiration dates. How do I fix this?

http://stackoverflow.com/comment/46313019
score: 0
comment on: http://stackoverflow.com/q/29035960
has text: Cannot see `ng-click="logoff"` set on the provided button..
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46321591
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29039866
has text: Perfect, thank you! I just had to set the value of hideClosed to true in the controller.
type: Comment

http://stackoverflow.com/q/28907557
has answer: http://stackoverflow.com/a/28907584
has comment: http://stackoverflow.com/comment/46074627
has title: How to create a javascript object that has a space?
downvote count: 3
has body: I have a javscript object that I want to look like the following: myObject = {the key:["value","value2","value3"]} If I remove the space from the object such that it looks like this: myObject = {thekey:["value","value2","value3"]} there is no issue. How can I create an object with the above formatting?
has comment: http://stackoverflow.com/comment/46074624
type: Question
has answer: http://stackoverflow.com/a/28907587
score: -2
tagged with: javascript
linked to: http://stackoverflow.com/q/2940424
answer count: 2
upvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/46074519
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46074603

http://stackoverflow.com/q/28926049
answer count: 1
downvote count: 0
tagged with: jsp
tagged with: jquery
has comment: http://stackoverflow.com/comment/46108584
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46109153
has answer: http://stackoverflow.com/a/28926574
type: UnansweredQuestion
has body: I have a jsp with a bootstrap wizard, like this: http://s3.amazonaws.com/creativetim_bucket/products/22/original/wizard_template.png?1407329794 With this wizard, I can add the employees element collected in Javascript array (I also use AngularJS). After that, in the last step of wizard there is the summary of the employees shown in a table. For each row of the table, I have been added an href link to delete the current employee element. This href link calls a function managed by AngularJS. Ok, it work. But, after the deletion, the table is not refresh. And the deleted element is present in table yet, but not in array. So, how can I refresh the table? Here's the code of the table: # Nome Cognome Matricola {{$index + 1}} {{employee.nome}} {{employee.cognome}} {{employee.matricola}} Delete Here's the code in JS: //Classe di tipo Employee function Employee(nome, cognome, matricola) { this.nome = nome; this.cognome = cognome; this.matricola = matricola; } var listEmployees = []; var nDip = 0; function Controller($scope) { $scope.DeleteEmployees = function (n) { if (n > -1) { listEmployees.splice(n, 1); } }; }
has comment: http://stackoverflow.com/comment/46109382
score: 1
upvote count: 1
has title: How to refresh bootstrap wizard
has comment: http://stackoverflow.com/comment/46109180
type: Question
tagged with: javascript

http://stackoverflow.com/a/29004807
has comment: http://stackoverflow.com/comment/46256418
has comment: http://stackoverflow.com/comment/46256558
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29002749
answers question: http://stackoverflow.com/q/29002749
score: 1
has comment: http://stackoverflow.com/comment/46257004
has comment: http://stackoverflow.com/comment/46256608
has body: Working Demo Remove var newurl = "http://localhost:56596/" + url; Append file url on download link on list item click event $('ol li').click(function(e) { e.preventDefault(); $(this).addClass('playing').siblings().removeClass('playing'); audio.load($('a', this).attr('data-src')); $('#download').attr('href', $('a', this).attr('data-src')); audio.play(); }); Use HTML5 download attribute for that: $('#download').attr({'href' : $('a', this).attr('data-src'), 'download' : $('a', this).attr('data-src')});
downvote count: 0
has comment: http://stackoverflow.com/comment/46256058
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46256761

http://stackoverflow.com/comment/46090113
has text: no you need to do this yourself.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28914479
score: 0

http://stackoverflow.com/q/28913139
downvote count: 0
has comment: http://stackoverflow.com/comment/46084733
tagged with: javascript
has body: I've multiple geo string like geo:0,0q=1+a+bc, and I'm gonna assign this to ng-href of the anchor tag. Like below I'm doing it. HTML Location Above tag is rendering fine on HTML but adding unsafe: string geo:0,0q=1+a+bc inside href attribute Rendered HTML Location Plunkr with demonstrating issue. I don't want unsafe: inside href, Any idea why it is pre-appending unsafe: before geoString & How do i remove it?
has title: Why ng-href behaving weird while parsing geo string
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: geo
favorite count: 0
tagged with: angularjs-ng-href
has answer: http://stackoverflow.com/a/28913295
tagged with: angularjs
upvote count: 2
type: AnsweredQuestion
score: 2
linked to: http://stackoverflow.com/q/15606751
accepted answer: http://stackoverflow.com/a/28913295
type: Question

http://stackoverflow.com/comment/47862180
type: AnswerComment
score: 4
type: Comment
has text: Although the code you proposed shows the alert, you should clearly understand why would the main process want to ask `mainWindow`(renderer process) to display the alert. I think that the separation of concerns between main process and the renderer is quite an important question here. For that reason controlling of the UI behavior of the renderer process from the main process is most probably the thing one should avoid. In case your main goal with `alert()` was the tracing of `main.js`, you can read my answer for this question. Some other debugging techniques are noted there.
comment on: http://stackoverflow.com/a/28932588

http://stackoverflow.com/comment/46165458
score: 0
type: Comment
type: QuestionComment
has text: What does `loop` do?
comment on: http://stackoverflow.com/q/28956097

http://stackoverflow.com/q/28946593
has comment: http://stackoverflow.com/comment/46147608
type: UnansweredQuestion
has title: Set slider automatically to a default start value
has comment: http://stackoverflow.com/comment/46147769
has comment: http://stackoverflow.com/comment/46147507
type: Question
has answer: http://stackoverflow.com/a/28946772
has body: I want to be able to create a default value for a slider. Underneath I have simplified my code as much as I figured possible. I want to be able to adapt the start position of the slider. In underneath example i'd like to see my slider start at 2007 in stead of the standard 2006. I got the slider from an example. Working with the $ sign is new to me. Anybody got an idea how to do this? Lineair Jaar 2006 2007 Gegeven (Selecteer een optie) Option 1 Option 2
tagged with: javascript
tagged with: default
score: 0
has comment: http://stackoverflow.com/comment/46147849
tagged with: slider
has comment: http://stackoverflow.com/comment/46148038
answer count: 1

http://stackoverflow.com/comment/46130965
comment on: http://stackoverflow.com/a/28937337
score: 0
has text: Try with integer document.getElementById("CodeId").value = 0;
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46091595
comment on: http://stackoverflow.com/q/28916909
type: Comment
type: QuestionComment
has text: Can't you just give the Path to your JS Plugin as parameter to `require()`, like in: `require('PATH/TO/MY/JSFILE.js')`?
score: 0

http://stackoverflow.com/a/33113232
answers question: http://stackoverflow.com/q/29023616
type: Answer
has body: For your output use var output = cordova.file.externalRootDirectory + fileOutputPath; cordova.file.externalRootDirectory should give you something like "file:///storage/emulated/0/"
score: 0

http://stackoverflow.com/a/29027171
downvote count: 0
answers question: http://stackoverflow.com/q/28999571
has comment: http://stackoverflow.com/comment/46367979
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/46367811
score: 1
has comment: http://stackoverflow.com/comment/46367403
has body: You have to read audio control part of the WCAG (http://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-dis-audio.html) In fact, what you want is quite the opposite of what a people with disabilities would want. What is needed is to be able to stop the audio in your application, and to start it again on demand. What I would do is giving a control to pause the audio in your application, giving the user the ability to know that your application want to tell him something with a little beep (&lt;3s) when audio mode is turned off. Screenreaders are not fully integrated with browsers, so it's quite difficult to find a better solution if you want to have full support of accessibility devices.

http://stackoverflow.com/comment/46105599
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28924551
has text: And what happens? Some errors in console?
score: 0

http://stackoverflow.com/comment/46102701
type: AnswerComment
has text: @MichaelJarvis you got some advance?
type: Comment
comment on: http://stackoverflow.com/a/28915590
score: 0

http://stackoverflow.com/a/29784797
score: 2
upvote count: 2
has body: when you store tinymce content, simply remove these tags from output similar like this: $tinyOutput = str_replace(array("// &lt;![CDATA[", "// ]]&gt;"), array("", ""), $_POST['tinyOutput']); ..then save to db..
downvote count: 0
has comment: http://stackoverflow.com/comment/49897154
answers question: http://stackoverflow.com/q/28983735
type: Answer

http://stackoverflow.com/q/28932648
tagged with: android
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28933589
type: Question
tagged with: ios
answer count: 1
tagged with: javascript
has title: How do you control which field iOS/Android will focus to when you click next while you're filling out a form?
has body: The scenario is that I have a modal with a multi-step process that I show one at a time, but not every step has a form field. So when I'm ready to move on from Step 1 (which has a form field) and I click the next helper icon in the keyboard's toolbar (a function of iOS) it forwards me to an unavailable/translucent field in Step 4. Step 1: Ask for age Step 2: Choose a gender (these are LI elements) Step 3: Choose interests (these are also LI elements) Step 4: Enter a name I've tried tabIndex, but that doesn't have any affect. I'm not certain this is even possible since this is really an iOS control. If it's not possible can you hide that? The undesirable fix would be to do a check when the user has focused on the Step 4 field and if the elements in Step 3 and Step 4 have not been chosen focus the user on the applicable previous step.
score: 0

http://stackoverflow.com/comment/46308529
type: QuestionComment
comment on: http://stackoverflow.com/q/29033708
score: 0
has text: First of all stop using depreacted `mysql` try to use `mysqli_` or 'PDO'
type: Comment

http://stackoverflow.com/q/29029190
has comment: http://stackoverflow.com/comment/46299687
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has body: I am trying to consume a WCF Rest Service from javascript using $.ajax, I am aware that there are issues with cross-domain calls. After googling it for more than a day, I have come quite far but the last mile is missing. First off, here is my client-code: $.ajax({ url: "https://myurl-here/api/test?param1=x&amp;param2=y&amp;callback=?", type: 'GET', dataType: 'json', headers: { "Authorization": "Basic xxxxxxxxx" }, success: function(data) { alert(data); }, error: function(data, errorThrown) { alert(errorThrown); } }); Note that I added the callback=? parameter and set the dataType='json'. I am debugging this using Chrome, which has some powerful tools. The response from the server is 200 OK. However, I get an error saying: Uncaught SyntaxError: Unexpected token : After googling some more, I think this error might be because the server respose is set to content-type "application/json" and the client expects "application/javascript". Here is what the debugging tool returns: If I click on this and go to the response tab, I even see the plain json string from the response, which is correct and just what I want. Now my question is: What can I do? Is there a way to tell ajax that I dont expect a script but it should just take the content and parse it as plain json? Or is there a way of ignoring the parse error and get hold of the content afterwards? The chrome debugger tool seems to somehow get hold of the content. Or is there a way to completely get rid of this callback=? which I suspect makes the contentType to jsonp (I'm not entirely sure how this all works). I can also change code on the server side, however there are some constraints: the server side code cannot be hosted in IIS, it is a self-hosted WCF service.
has answer: http://stackoverflow.com/a/29029580
accepted answer: http://stackoverflow.com/a/29029580
type: Question
has comment: http://stackoverflow.com/comment/46299726
has title: AJAX get cross-domain with WCF leads to parseerror
tagged with: javascript
has comment: http://stackoverflow.com/comment/46300043
has comment: http://stackoverflow.com/comment/46300330
has comment: http://stackoverflow.com/comment/46315743
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: wcf

http://stackoverflow.com/q/29057710
has comment: http://stackoverflow.com/comment/46352433
score: 0
has answer: http://stackoverflow.com/a/29057797
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46352308
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46352362
has answer: http://stackoverflow.com/a/29057818
has body: I'm doing the odin project and for the front-end webdev project, I have to create a grid using javascript/jQuery. I tried using the createElement method but I was wondering how I would be able to make the div visible in html? Am I going about this all wrong? HTML: Etch-a-Sketch JS: var div = document.createElement("div"); div.style.width = "100px"; div.style.height = "100px"; div.style.color = "blue"; document.body.appendChild(div);
type: Question
answer count: 2
has title: Div not showing up in javascript?
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28966085
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28963599
has body: Aurelia never sees the camelcased markup because the DOM lower-cases the element and attribute names. Check out this answer for more information. Here's an excerpt: One other thing to be aware of though: In all browsers, when the browser loads the HTML document and parses it, it converts it into a DOM (Document object model). If you then use the browser's built-in developer tools to inspect the site, when you view the DOM, all elements in the DOM will be shown as lower case, regardless of how they were written in the actual source code. Another approach: If you name your class XxxAaaCustomElement Aurelia conventions will kick in and you'll be able to use &lt;xxx-aaa&gt;&lt;/xxx-aaa&gt; in your markup.
answers question: http://stackoverflow.com/q/28963599
has comment: http://stackoverflow.com/comment/46193508

http://stackoverflow.com/comment/46439057
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/29029681
type: Comment
has text: Take a look at the SMTP plugin here: https://www.rabbitmq.com/community-plugins.html

jaydata
tag name: jaydata
type: Tag
tags question: http://stackoverflow.com/q/28986488

http://stackoverflow.com/comment/46205122
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28976559
has text: the divs should behave like in the image. I don't know which one must have the float setting.. the container or the divs inside the container :/

http://stackoverflow.com/a/29051252
has body: . you can use jquery cookie pluing or you can use local storage plugin . for better understand difference between local storage and cookie you can refer this link $("a").click(function(){ $(this).text("Hello"); $.cookie('text', "Hello"); }); /// code to get value when page load $(document).ready(function(){ if($.cookie('text')){ $("element").text($.cookie('text')); } })
answers question: http://stackoverflow.com/q/29051125
type: Answer
has comment: http://stackoverflow.com/comment/46340515
has comment: http://stackoverflow.com/comment/46340399
has comment: http://stackoverflow.com/comment/46340908
has comment: http://stackoverflow.com/comment/46341392
has comment: http://stackoverflow.com/comment/46340825
downvote count: 1
has comment: http://stackoverflow.com/comment/46340626
score: -1
has comment: http://stackoverflow.com/comment/46340538
upvote count: 0

http://stackoverflow.com/comment/46111077
type: QuestionComment
comment on: http://stackoverflow.com/q/28927548
has text: I think it is possible because i've seen being implemented in the conduit website: http://conduit.com .
score: 0
type: Comment

http://stackoverflow.com/comment/46238378
type: AnswerComment
has text: thank you, but how about if I want to store that in my own server rather than a third party server?
comment on: http://stackoverflow.com/a/28994518
score: 0
type: Comment

http://stackoverflow.com/comment/46330152
has text: @Urahara, what do you mean override the image tag? I mean, there is not img tag in the css.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29045262
type: AnswerComment

http://stackoverflow.com/comment/46085395
type: AnswerComment
type: Comment
has text: Bingo for the doc link :-)
comment on: http://stackoverflow.com/a/28913295
score: 1

http://stackoverflow.com/comment/46159788
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28952743
has text: In other words, how do I style it? I placed style commands via my CSS page, but with no success.

http://stackoverflow.com/comment/46330906
type: QuestionComment
has text: What have you tried? You need to try by yourself than ask queries if you not could solve.
score: 1
type: Comment
comment on: http://stackoverflow.com/q/29045891

http://stackoverflow.com/q/29062116
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/29062133
tagged with: php
has body: I have an array JSON encode respond when the ajax JSON throw a post request (refer below). requestparser.php: $array = array("phweb" =&gt; "yes", "phemail" =&gt; "yeeess"); echo json_encode($array); And this Ajax JSON use for sending post request to requestparser.php and processing the return response. $.ajax({ type: 'POST', url: 'requestparser.php', data: { "request" : "pull" }, contentType: "application/json; charset=utf-8", dataType: 'json', cache: false, success: function(result) { alert(result[0]); alert(result[1]); } }); I want to get the value of array key phweb and the value of array key phemail yet when an alert box popup, it says undefined. What seems the problem? Any help, ideas, clues would be greatly appreciated. So far what I tried is: $.ajax({ type: 'POST', url: 'requestparser.php', data: { "request" : "pull" }, contentType: "application/json; charset=utf-8", dataType: 'json', cache: false, success: function(result) { alert(result[0]-&gt;phweb); alert(result[1]-&gt;phemail); } }); And sadly, it doesn't work.
has title: Ajax JSON access array from the array JSON encode server respond
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29062133
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
downvote count: 0
answer count: 1
tagged with: jquery

http://stackoverflow.com/a/29015886
has comment: http://stackoverflow.com/comment/46276495
has comment: http://stackoverflow.com/comment/46276368
upvote count: 1
has comment: http://stackoverflow.com/comment/46276472
answers question: http://stackoverflow.com/q/29015824
has comment: http://stackoverflow.com/comment/46276591
downvote count: 0
has comment: http://stackoverflow.com/comment/46276439
score: 1
type: Answer
has body: In modern browsers this property is called textContent: document.getElementById('mydiv').textContent // " I want to get this text only, not the image element before me" If you want to support rocks and dust (IE8), you also need to check the innerText property. Together you can create a function to anonymously get the text: function getText(el){ return el.textContent || el.innerText; }

http://stackoverflow.com/q/28924551
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/60934067
has comment: http://stackoverflow.com/comment/46105785
has answer: http://stackoverflow.com/a/73935354
score: 18
tagged with: javascript
has body: I want to open bootstrap modal through jquery. I know ajax in running to success as it throws alerts. But cannot open modal. These are my code. $.ajax({ type: "POST", url: "&lt;?php echo base_url() . 'index.php/application/requestCode'; ?&gt;", data: { 'apiName': apiName, 'api': api, 'hotel': hotel, 'payment':payment, 'template': template }, success: function(msg) { $("#getCodeModal").modal("toggle"); $("#getCode").html(msg); } }); And my modal HTML is: &lt;!-- Modal --&gt; &lt;div class="modal fade" id="getCodeModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog modal-lg"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt; API CODE &lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body" id="getCode" style="overflow-x: scroll;"&gt; //ajax success content here. &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; In error in console: modal is not a function.
has answer: http://stackoverflow.com/a/28924613
has title: How to open bootstrap modal in ajax success
has answer: http://stackoverflow.com/a/47760350
has comment: http://stackoverflow.com/comment/46105599
has comment: http://stackoverflow.com/comment/46105622
tagged with: jquery
has comment: http://stackoverflow.com/comment/46105831
favorite count: 0
tagged with: ajax
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28924587
has comment: http://stackoverflow.com/comment/46105804
tagged with: css
upvote count: 19
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/46139369
has text: Excellent thanks. It's just the one variable I need so I'll try this. Is the semi-colon required after the `NODE_ENV=production`?
type: Comment
comment on: http://stackoverflow.com/a/28942367
score: 0
type: AnswerComment

http://stackoverflow.com/a/28916142
upvote count: 1
answers question: http://stackoverflow.com/q/28916070
has comment: http://stackoverflow.com/comment/46090474
has body: Really, you should do work this complicated in a controller rather than the HTML, but if you insist, you could do this: &lt;tr ng-class="project.total &lt; 35 ? 'danger': (project.total &lt; 71 ? 'partial' : 'success')"&gt;
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46094425
type: Answer

http://stackoverflow.com/comment/46336871
type: QuestionComment
comment on: http://stackoverflow.com/q/29048465
has text: Then you need to be more specific in what you want to re-highlight. Set up rules that survive the change of structure. What factors are you going to look for to find the "same" place?
score: 0
type: Comment

http://stackoverflow.com/comment/46255287
has text: use delegate function `$('.disabled').on('click',function(e){`
comment on: http://stackoverflow.com/q/29004409
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46268639
type: QuestionComment
has text: You would have to change your calling method to something like: `func({name:'objectXYZ',value:objectXYZ})`
comment on: http://stackoverflow.com/q/29011712
score: 0
type: Comment

http://stackoverflow.com/a/28931222
type: Answer
has body: This is how you'd make a 3D array, but I'd recommend against mixing data types in your array, that's not exactly a common or standard practice. // just filler stuff, ignore the body of this function function getStringOrNumber(row, col, cat) { var thing = row * cols * cats + col * cats + cat; return Math.random() &lt; .5 ? thing : thing.toString(); } // something to deal with each value function doSomething(value) { switch (typeof value) { case 'string': // logic for string type break; case 'number': // logic for number type break; default: // unexpected? break; } } // here's how you make your 3D array var rows = 10, cols = 10, cats = 10, array3d = new Array(rows), i, j, k; for (i = 0; i &lt; rows; i++) { array3d[i] = new Array(cols); for (j = 0; j &lt; cols; j++) { array3d[i][j] = new Array(cats); for (k = 0; k &lt; cats; k++) { array3d[i][j][k] = getStringOrNumber(i, j, k); doSomething(array3d[i][j][k]); } } } If you want to check whether an index exists on the 3d array, try a function like this: function setValue(array3d, row, col, cat, value) { if (array3d[row] &amp;&amp; array3d[row][col] &amp;&amp; array3d[row][col][cat]) { array3d[row][col][cat] = value; } else { throw new RangeError("Indices out of range"); } }
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28931092
upvote count: 1
answers question: http://stackoverflow.com/q/28931092
type: AcceptedAnswer

http://stackoverflow.com/comment/46168602
comment on: http://stackoverflow.com/q/28957908
score: 0
type: QuestionComment
type: Comment
has text: [This SO question](http://stackoverflow.com/questions/17979696/javascript-tiff-image-conversion) and [this answer](http://stackoverflow.com/a/16311760) might be of interest to you (btw, haven't you even googled for your problem ?)

http://stackoverflow.com/comment/46327439
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29043529
has text: @Simlofi that `var` statement declares just **one** variable - `d`.
score: 0

http://stackoverflow.com/comment/46348067
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29055411
has text: What do you mean by not working?
score: 0

http://stackoverflow.com/comment/46073455
score: 3
comment on: http://stackoverflow.com/q/28906965
has text: jsfiddles are helpful but should only be included in addition to adding the relevant code within the question. Please add the relevant code to your question body.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28980354
score: 0
has title: how to get word starting from particular letter in a search box
has answer: http://stackoverflow.com/a/28981266
type: UnansweredQuestion
has body: var items = ['Television', 'Music System', 'Car', 'Bus','Train', 'Computer', 'Lap Top', 'I-Phone', 'Tablet', 'Electronics', 'Watch','Mouse'] function fillData() { var data = []; for (var i = 0; i &lt; items.length; i++) { var row = Ti.UI.createTableViewRow({ height : 50, title : items[i], color : 'pink', hasChild : true, font : { fontSize : 14 }, }); data.push(row); } $.table.setData(data); } fillData(); $.tabGroup.open(); When I am typing particular letter it will show all the word which contain that letter in any sequence.... but I want that words only which start from that particular letter....
linked to: http://stackoverflow.com/q/28739496
tagged with: titanium-alloy
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/76330885
tagged with: javascript

http://stackoverflow.com/a/29003223
has body: You must use Ajax (here is the example: http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_suggest_php ) The loading symbol you can get by jQuery Lazy ( http://plugins.jquery.com/lazy/ )
score: 0
answers question: http://stackoverflow.com/q/29002953
type: Answer

http://stackoverflow.com/q/29054986
score: 2
type: AnsweredQuestion
has body: I have a view which has a property called headerClass which I define at the top of the view and in various methods I change the value by doing this.headerClass = 'new value'. But how can I watch for changes to this variable? I tried add this.headerClass.on("change", this.render, this); but I get an error when doing this. Below is my code MyView = Backbone.View.extend({ el: $(".header"), template: _.template($("#header-template").html()), headerClass: 'normal', initialize: function () { this.render(); //This doesn't seem to work this.headerClass.on("change", this.render, this); }, render: function () { this.$el.html(this.template({headerClass: this.headerClass})); return this; }, changeClass: function () { //When the value changes I want to re-render the view this.headerClass: 'fluid'; } });
upvote count: 2
type: Question
has title: How to watch for variable changes in Backbone
possible better answer: http://stackoverflow.com/a/29060276
has answer: http://stackoverflow.com/a/29060276
tagged with: backbone-views
answer count: 2
has answer: http://stackoverflow.com/a/29060382
has comment: http://stackoverflow.com/comment/46356194
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29060382
favorite count: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/46357197

http://stackoverflow.com/comment/46348303
comment on: http://stackoverflow.com/q/29055333
has text: I just did it, look at the question
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46552916
type: AnswerComment
comment on: http://stackoverflow.com/a/29119152
score: 0
type: Comment
has text: That's strange. Please check update answer and see if its working for u.

http://stackoverflow.com/a/28970386
has body: Try this: var row = " some text "; $('#pl_table').append(row); function change(element) { if(element.checked) { element.closest('tr').addClass('selected'); } else{ element.closest('tr').removeClass('selected'); } }
type: Answer
has comment: http://stackoverflow.com/comment/46212469
answers question: http://stackoverflow.com/q/28970323
has comment: http://stackoverflow.com/comment/59920482
score: 0

http://stackoverflow.com/comment/46169750
has text: When i am reloading the slider and call to goToSlide function, slider is stops working, but when i am removing that function, slider always stays at the first position. And the very first time it is loading more items ,it seams like slider is not reloading, http://awesomescreenshot.com/0ed4l0lj0d
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28940838
type: AnswerComment

http://stackoverflow.com/comment/46349334
score: 0
comment on: http://stackoverflow.com/q/29055884
type: Comment
type: QuestionComment
has text: Why do you need to JSON.parse if the data is already an object?

http://stackoverflow.com/comment/46091815
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28917038
score: 2
has text: Iterating based on `JSONobject.length` and changing `results[i]`?

http://stackoverflow.com/q/28989959
score: 0
has comment: http://stackoverflow.com/comment/46228555
tagged with: jquery
type: UnansweredQuestion
tagged with: razor
has comment: http://stackoverflow.com/comment/46228714
tagged with: css
has body: I have the following script inside my asp.net mvc web application :- $(document).ready(function () { $('body').on("submit", "form", function () { $(this).find('.btn-primary').prop("disabled", "disabled"); }); $('body').on("change", "form", function () { $(this).find('.btn-primary').prop("disabled",false); }); }); the purpose of the script is as follow:- to disable the button on submitting the form. to enable the button again when the form is changed. But after upgrading the jQuery from 1.8.2 o 1.11.2 it is partially working on partial view. for example when i submit a form that is rendered insdie a partial view, button will be disabled, but if i start typing on the form , for example after a client side validation error , the button will never be enabled again? can anyone adivce on this please ? Thanks.
has title: $('body').on("change") is not wroking after upgrading jquery from 1.8.2 to 1.11.2
answer count: 0
has comment: http://stackoverflow.com/comment/46228840
has comment: http://stackoverflow.com/comment/46228921
has comment: http://stackoverflow.com/comment/46228457
has comment: http://stackoverflow.com/comment/46228302
has comment: http://stackoverflow.com/comment/46228399
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46228876
has comment: http://stackoverflow.com/comment/46228838

http://stackoverflow.com/comment/46147386
type: Comment
type: QuestionComment
has text: i don't see what cors has to with angular, or what sails config has to do with google's server...
comment on: http://stackoverflow.com/q/28946179
score: 0

http://stackoverflow.com/comment/46080486
has text: Have absolutely no idea what you are asking. If you want to change something in your code, show the code and expected results
score: 0
comment on: http://stackoverflow.com/q/28910803
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28979516
accepted answer of: http://stackoverflow.com/q/28974784
score: 44
answers question: http://stackoverflow.com/q/28974784
downvote count: 0
has comment: http://stackoverflow.com/comment/64995369
type: AcceptedAnswer
upvote count: 44
type: Answer
has body: You have two options: Export EmberReflux like you are doing: export { EmberReflux }; and then import it like: import { EmberReflux } from '../utils/ember-reflux'; Use default when exporting: export default EmberReflux; and import it (like you are doing): import EmberReflux from '../utils/ember-reflux'; In both cases you can then use your EmberReflux like: EmberReflux.createActions();
has comment: http://stackoverflow.com/comment/69507847

http://stackoverflow.com/a/28980595
has comment: http://stackoverflow.com/comment/79738404
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/46211742
has comment: http://stackoverflow.com/comment/46211169
has comment: http://stackoverflow.com/comment/46211075
downvote count: 0
has comment: http://stackoverflow.com/comment/79705187
type: Answer
has body: reduce or filter will work for this. array.reduce(function(memo, item, index) { index % 2 &amp;&amp; memo.push(item); return memo; }, []) array.filter(function(item, index) { return index % 2; })
has comment: http://stackoverflow.com/comment/46211380
answers question: http://stackoverflow.com/q/28980510
has comment: http://stackoverflow.com/comment/46211769

http://stackoverflow.com/comment/46318077
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29009529
score: 1
has text: I think there are some possibilities using Data URIs. Try following some of the suggestions in this question: http://stackoverflow.com/questions/3665115/create-a-file-in-memory-for-user-to-download-not-through-server

cryptography
tag name: cryptography
type: Tag
tags question: http://stackoverflow.com/q/28980185
tags question: http://stackoverflow.com/q/28934850

http://stackoverflow.com/q/29031542
has comment: http://stackoverflow.com/comment/46304057
type: UnansweredQuestion
tagged with: iframe
has answer: http://stackoverflow.com/a/29032725
type: Question
has answer: http://stackoverflow.com/a/29032022
has body: I have problem with reloading a list of sites in infinite loop. When in first time I tried do it without iframe, the first site was loaded and nothing else happend. I want to reload some sites from list into iframe. There should be no buttons to reload site, it should be automatic -> show site, wait 20 sec, show site2, wait 60 sec... I want to have different delays, so thats way there is a sleep in infinite loop. In this point I stucked :) Below is my (rubbish :) ) example I tried to run. Any ideas how to do it easy and small as possible ? Your browser does not support iframes.
has comment: http://stackoverflow.com/comment/46304046
score: 0
answer count: 2
has title: Javascript - reload sites in infinite loop
tagged with: javascript
linked to: http://stackoverflow.com/q/8700636

http://stackoverflow.com/q/28911533
has comment: http://stackoverflow.com/comment/46081937
has body: fiddle here http://jsfiddle.net/prantikv/1nvdzv24/9/ i have some uneven data like so [{ "fname": "Tonja", //common "lname": "Mize", "tel": "(963)784-1098", "address": "3999 Quis Ln", "city": "Sebring", "state": "MI", "zip": 76593 }, { "fname": "Stella", //common "Othername": "Lester", "mobile": "(936)898-2886" }]; notice only the fname property is common between the two objects so when i do this {{ val.**fname**}} i do get the fname but the data is uneven so i cannot figure out how to go through over each object. also the length of the object is different as well. what i want to do is to filter the data over a select list Tonja Stella but i am unable to figure out a way to display the unmatched properties of objects is there a way i get all the key:value pairs on the sub data dynamically?
type: Question
accepted answer: http://stackoverflow.com/a/28911703
tagged with: http://stackoverflow.com/tag/json
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46082164
tagged with: javascript
has title: Parsing Uneven data/ json object using ng-repeat
tagged with: angularjs
has answer: http://stackoverflow.com/a/28911703
type: AnsweredQuestion

http://stackoverflow.com/q/29013659
has body: I'm writing some unit tests for my JS code using the Jasmine framework to learn the basics of Jasmine. This is more of a JS question than it is a Jasmine question. I checked out the JS string conversion methods and looked at Casting to string in JavaScript. I may be using toString() incorrectly. The function I wrote looks like: function factorial(input) { var result = 1; if(input === 0) { result = 0; } else if(input &lt; 0) { result = "cannot compute factorial of negative number"; } else if(input.isString) { result.toString(); result = "input is not a number"; } else { for(var i = 1; i &lt;= input; i++) { result *= i; } } return result; } The Jasmine spec looks like: describe("Factorializer", function() { it("factorial() should return the correct factorial value of an input &gt; 0.", function() { expect.factorial(3)).toBe(6); }); it("factorial() should return 0 if the input = 0.", function() { expect.factorial(0)).toBe(0); }); it("factorial() should return 1 if the input = 1.", function() { expect.factorial(1)).toBe(1); }); it("factorial() should return an error if the input is negative.", function() { expect.factorial(-5)).toBe("cannot computer factorial negative number"); }); it("factorial() should return an error if the input is not a number.", function() { expect.factorial("Herro")).toBe("input is not a number"); }); it("factorial() should return an error if the input is not a number.", function() { expect.factorial("Herro")).toBeNaN(); }); }); Whenever the input is a string, result is always 1. Either the else if(input.isString) is never entered, or the result is not being assigned the value it's supposed to in the statement. I am leaning towards the former, because the previous else if seems to be working (it passes the Jasmine test). The last two Jasmine tests are failing, which is good since it confirms that Jasmine is working and I caught a problem with my code. I'm trying the fix the problem that Jasmine found; I'm not trying to alter the Jasmine tests unl…
tagged with: javascript
tagged with: jasmine
has answer: http://stackoverflow.com/a/29013859
has title: JavaScript casting number to string test with Jasmine
possible better answer: http://stackoverflow.com/a/29013859
type: AnsweredQuestion
type: Question
linked to: http://stackoverflow.com/q/11083254
has answer: http://stackoverflow.com/a/29013778
accepted answer: http://stackoverflow.com/a/29013778
score: 0
answer count: 2

http://stackoverflow.com/comment/46298008
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29028221
has text: Why append a `script` element with inline code when you're *already* running JavaScript code? Just execute the statement (probably after appending the `div`).
type: Comment

http://stackoverflow.com/comment/46143684
comment on: http://stackoverflow.com/q/28944412
type: QuestionComment
score: 0
has text: TickPositioner works fine for me: http://jsfiddle.net/5846xjkr/1/
type: Comment

http://stackoverflow.com/q/28989015
tagged with: asp.net
has comment: http://stackoverflow.com/comment/46226598
has title: jquery export asp table to excel
has comment: http://stackoverflow.com/comment/46226710
accepted answer: http://stackoverflow.com/a/28989211
type: AnsweredQuestion
has body: i was reading from this blog http://growingtech.blogspot.in/2012/10/export-html-to-excel-using-jquery-and.html the aspx page is below: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="exportPage.aspx.cs" EnableEventValidation="false" Inherits="exportPage" %> Export <asp:Button ID="Button1" runat="server" Text="Export" OnClientClick="exportexcel()" onclick="Button1_Click" /> Name Age Email John 44 john@gmail.com Rambo 33 rambo@gmail.com It's hot 33 test@hotmail.com and c# is below using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class exportPage : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string data = Request.Form["data"]; data = HttpUtility.UrlDecode(data); Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=report.xls"); Response.Charset = ""; Response.ContentType = "application/excel"; HttpContext.Current.Response.Write(data); HttpContext.Current.Response.Flush(); HttpContext.Current.Response.End(); } } i wonder where did I fail to pass the table data to excel? My jquery link seems to reference ok, but somwhow i ended up downloading an empty excel. thanks for any advice!
type: Question
has answer: http://stackoverflow.com/a/28989211
tagged with: c#
has comment: http://stackoverflow.com/comment/46226843
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46226972
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1

typescript
tags question: http://stackoverflow.com/q/28947379
tags question: http://stackoverflow.com/q/28996271
tags question: http://stackoverflow.com/q/28989399
tag name: typescript
tags question: http://stackoverflow.com/q/28970572
tags question: http://stackoverflow.com/q/28960934
tags question: http://stackoverflow.com/q/29050092
tags question: http://stackoverflow.com/q/28909908
tags question: http://stackoverflow.com/q/29061874
type: Tag
tags question: http://stackoverflow.com/q/28990587
tags question: http://stackoverflow.com/q/28948410
tags question: http://stackoverflow.com/q/28975644
tags question: http://stackoverflow.com/q/29041959

http://stackoverflow.com/comment/46216925
score: 0
type: Comment
type: QuestionComment
has text: @Sirko: No, `()` will make no difference to the resulting value.
comment on: http://stackoverflow.com/q/28983907

http://stackoverflow.com/comment/46093184
score: 1
comment on: http://stackoverflow.com/q/28917747
has text: You tagged this "Java" but the code looks like JavaScript, which is a completely different language. Do you really mean Java or is it JavaScript?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28966047
score: 1
answers question: http://stackoverflow.com/q/28961717
has body: I have got it to work by using the information provided on the following pages: http://www.newtonsoft.com/json/help/html/SerializeTypeNameHandling.htm Polymorphism in Web API: Single endpoint possible? First I set the json setting: jsonsettings.SerializerSettings.TypeNameHandling = TypeNameHandling.Auto; then setting the type of the json object before sending with ajax using jsonObject { '$type' : .Models.ExternalSubscriber, solution.project', ....} after this I am able to cast the incoming Subscriber to an ExternalSubscriber and access its properties.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28961717
type: Answer
upvote count: 1

http://stackoverflow.com/comment/46249271
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29000721
has text: @thefourtheye if str = "55abcdef6ghij78" . i would like the new array to be [ 55 , 6 , 78 ] . your solution seperates the digits .

http://stackoverflow.com/a/29002642
has comment: http://stackoverflow.com/comment/46252761
answers question: http://stackoverflow.com/q/29002462
has comment: http://stackoverflow.com/comment/46252913
has comment: http://stackoverflow.com/comment/46253560
score: 0
has body: Try this. Bind to the change event instead of click event. var checkboxes = $("input[type='checkbox']"),submitButt = $("input[type='submit']"); checkboxes.change(function() { submitButt.attr("disabled", !checkboxes.is(":checked")); });
has comment: http://stackoverflow.com/comment/46252873
type: Answer

http://stackoverflow.com/comment/139757507
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28933945
has text: This question is similar to: [Representing single and double quotation marks in a string literal](https://stackoverflow.com/questions/8468607/representing-single-and-double-quotation-marks-in-a-string-literal). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.
score: 0

http://stackoverflow.com/a/29031541
upvote count: 1
has comment: http://stackoverflow.com/comment/46304522
accepted answer of: http://stackoverflow.com/q/29031405
score: 1
has body: Just change the url to include the selection as a GET parameter $('#Databases').change(function () { var yourDB = $(this).val(); window.location.assign("test.php?db=" + yourDB); }); The you can access it in your test.php page as a $_GET var
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46305185
type: Answer
has comment: http://stackoverflow.com/comment/46304473
answers question: http://stackoverflow.com/q/29031405

http://stackoverflow.com/comment/46136715
type: QuestionComment
score: 0
has text: It is a design pattern you need. Try google javascript promise - you will get a lot of tutorials, articles, blogs... it is worth reading especially if you are a beginner.
type: Comment
comment on: http://stackoverflow.com/q/28940040

http://stackoverflow.com/a/29045151
has comment: http://stackoverflow.com/comment/61374910
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29045018
has body: JQuery also has an fail() callback in case the Ajax fails. I'd just put the logic in both cases. (abstracted into a function) Check out this question. jQuery: Handle fallback for failed AJAX Request **Revision $.ajax's complete() method runs after an ajax call no matter what. Sounds perfect. http://api.jquery.com/jquery.ajax/
has comment: http://stackoverflow.com/comment/67097249

http://stackoverflow.com/q/29000283
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/29000375
has body: http://plnkr.co/edit/9Yq6aZHtKCuZMtPbjBIN?p=preview I've tried and tried to get this to work but I've had no luck. I'm trying to disable the submit button using angularJS and the built in validation function. What I find is that when you first load the form, the submit button is active--not disabled! I've tested and tried and I've found that my validation code accepts an empty string / null string in the Team Name, despite me requiring the input. Does anyone know how to format this correctly? The ONLY way I've gotten it to work is to fudge the data with replacing an empty string with a single space...in production this is unacceptable... Here is the index.html: Team Name This is not a valid team name. Division Select... A valid Division needs to be selected. Next And here is the app.js: angular.module('Enter', []) .controller("EnterController", [ function() { this.RegistrationPhase = 0; this.Divisions = [{ Id: 1,Name: "Normal"}, {Id: 2,Name: "Not Normal"}]; this.Team = { Name: "", ResumeKey: null, Division: { Id: -1 }, Players: []}; this.TeamNameNext = function() { //Code removed alert("Made it to the submit function!") }; } ]);
has title: ng-disabled in Angular validation not working as expected
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29000375
tagged with: javascript
has answer: http://stackoverflow.com/a/29001037
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29001037
tagged with: angularjs-validation

http://stackoverflow.com/q/28986007
tagged with: javascript
tagged with: date
score: 0
has title: Kendo AngularJS Date picker - how to set ng-model from timestamp to formatted date?He
answer count: 3
tagged with: kendo-ui
tagged with: angularjs
type: UnansweredQuestion
tagged with: datepicker
has body: A have the following date time picker based on the documentation http://demos.telerik.com/kendo-ui/datepicker/angular : &lt;input kendo-date-picker k-options="monthSelectorOptions" ng-model="milestone.estimate" k-ng-model="dateObject" /&gt; With following options: // SET OPTIONS FOR DATE TIME PICKER $scope.monthSelectorOptions = { format: "dd.MM.yyyy", change: $scope.onDateChange }; I would like to ask how can i do automatical date formatting from timestamp which is represented by: ng-model="milestone.estimate" And after the selection date from picker update value in scope to timestamp but with formatted date displayed in the date picker. Is it possible and how can i do it please? Many thanks for any advice.
has answer: http://stackoverflow.com/a/28986313
has answer: http://stackoverflow.com/a/28988377
has answer: http://stackoverflow.com/a/30883769
type: Question

http://stackoverflow.com/a/28940847
accepted answer of: http://stackoverflow.com/q/28940496
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28940496
has body: If you want to use regex you can do it. My suggestion is to use a three step approach. Split the text into lines, catch the text you want, and join the strings again: var text = ".hovered,.showFrame .container-fluid .added-element:hover , #MR_Modal_View.showFrame .container-fluid .added-element:hover ,.showFrame .container-fluid:hover,#MR_Modal_View.showFrame .container-fluid:hover,.added-element:hover, body ,div.test , #MR_Modal_View_Modal .added-element:hover, .ui-resizable-resizing"; text = text.replace(/,/g,'\n').replace(/.*:hover\s*\n*/g, "").replace(/\n/g,','); How this regex works Look this EXAMPLE
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46136318
type: Answer

http://stackoverflow.com/q/28997020
score: 1
upvote count: 1
has title: Setting values to AngularJS scope labels
type: Question
tagged with: graph
answer count: 2
has body: Hi I am trying to create bar graph using angular js here my requirement is to get data from url and show as bar graph I need to get suitename and set to $scope.labels actually I need to set values as $scope.labels = ['test a', 'test b', 'test c']; but what my code is doing is $scope.labels = ["'test a', 'test b', 'test c'"] (quotes in begging and ending); (when I inspect in firebug, console.log seems to be correct) total 3 names are considered as 1 string because I am appending to variable due to this my bar graph x-axis showing only 1 long name instead of 3 names is there any way to achieve this below is my code what i have tried app.controller("BarCtrl", function ($scope, $http) { var apiResponse = $http.get("http://166.62.36.83/DataService/DataService.asmx/GetSuiteCoverageJson?testsuiteid=9"); apiResponse.success(function(responseData, status, headers, config) { var testSuiteName = ""; var totalAutomationCases = ""; for (var i = 0, l = responseData.length; i &lt; l; i++) { testSuiteName = testSuiteName + "\'"+ responseData[i].testSuiteName +"\'" +","; totalAutomationCases = totalAutomationCases + "'"+responseData[i].totalAutomationCases +"'" +","; //$scope.labels = [responseData[i].testSuiteName]; console.log(testSuiteName.substring(0,testSuiteName.length-1)); } $scope.labels = [testSuiteName.substring(0,testSuiteName.length-1)]; console.log(totalAutomationCases.substring(0,totalAutomationCases.length-1)); console.log(testSuiteName.substring(0,testSuiteName.length-1)); $scope.series = ['Series A', 'Series B']; $scope.data = [ ['2','4','1'] ]; }); });
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28997107
favorite count: 0
possible better answer: http://stackoverflow.com/a/28997260
tagged with: angularjs
has answer: http://stackoverflow.com/a/28997260
has answer: http://stackoverflow.com/a/28997107
type: AnsweredQuestion

http://stackoverflow.com/comment/46147196
comment on: http://stackoverflow.com/a/28946078
type: AnswerComment
score: 0
type: Comment
has text: For Digital Ocean you can test out the new (and not yet stable) [Machine](https://github.com/docker/machine), [Compose](https://docs.docker.com/compose/), and [Swarm](https://github.com/docker/swarm/). Of course you can also use Machine (and Compose) on your local dev machine to simplify running the required services.

http://stackoverflow.com/comment/46088175
type: Comment
score: 0
has text: @Tobsta If an answer helps you, it's good to accept it to show that. Click the check mark below the voting buttons on the answer.
type: QuestionComment
comment on: http://stackoverflow.com/q/28913571

http://stackoverflow.com/q/28976506
answer count: 1
tagged with: javascript
has body: I'm just trying out the code to see how it works. I created two buttons, formatted with Google's CSS package, and one button enables the radios and the other disables them. There are two issues I can't solve. 1. The code won't disable the radios. 2. The format for the first button, class="action", isn't blue. It is all gray and turns blue only when I select it. Then it's gray again when un-selected. Enable Disable First Second
tagged with: css
has answer: http://stackoverflow.com/a/28998882
type: UnansweredQuestion
score: 0
has title: Enable Disable radio buttons with buttons & Google's CSS won't format "action" button
type: Question
tagged with: google-apps-script

http://stackoverflow.com/comment/46222667
has text: You are right, but, here on my site the modal always shows up in the page. and the script is coming from the database using text editor. Kindly let me know if you find any other solution. thanx
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28986699

http://stackoverflow.com/q/29035530
tagged with: jquery
favorite count: 0
tagged with: kendo-ui
has body: Using a Kendo ListView and when my page reloads, if a selection has been made, I need to have my code automatically select the ListView Item that was previously selected. I'm able to obtain the Kendo DataItem by iterating over the datasource collection, but when I do listView.select(item) the UI does not display anything as selected. Here is my list view: $("#listview").kendoListView({ dataSource: coverages, template: kendo.template($("#listTemplate").html()), selectable: true, change: function() { var index = this.select().index(); dataItem = this.dataSource.view()[index]; if (selectedCoverageCode == null) { selectedCoverageCode = dataItem; } onCodeChanged(categoryId, planId, dataItem); } }); And here is my code to set the previously selected item: function setSelectedCoverageCode(code) { var listView = $("#listview").data("kendoListView"); var dataSource = listView.dataSource.view(); if (listView) { $.each(dataSource, function(index, item) { if (item.Code === code) { listView.select(item); selectedCoverageCode = item; } }); } } I need the DOM object not the data source DataItem, I believe. The above setSelectedCoverageCode function fires the Change event, but the actual element is not selected at that point in the DOM. How can I do this so I can show the item as already selected whenever a reload happens? Suggestions? Thanks
has answer: http://stackoverflow.com/a/29035935
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
accepted answer: http://stackoverflow.com/a/29035935
tagged with: javascript
tagged with: listview
tagged with: kendo-listview
has title: Select Kendo UI ListView Item
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/46203302
has text: ok thanks for the explanation. so lets see for a work around. I have an input file here, where when the user selects a picture its get displayed to a different ID up to 3 times. Like theres 3 output, and each output relates to an id, the problem i have is that it only outputs to the first one, and any other pictures fall right beside it and not at a different id. I have included an update under my initial postr
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28975902

http://stackoverflow.com/comment/84795111
has text: a Set is a a group of Keys, a Map a group of keys and values, from the description of his problem i deduced that the Map is what he wants
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28965112
type: QuestionComment

http://stackoverflow.com/q/29043030
type: AnsweredQuestion
tagged with: ember-cli-addons
has title: Ember cli Uncaught TypeError: undefined is not a function
has comment: http://stackoverflow.com/comment/46330135
type: Question
has answer: http://stackoverflow.com/a/29045511
answer count: 1
tagged with: javascript
score: 0
tagged with: ember.js
tagged with: ember-cli
has body: I am an ember noob and i originally built my app without ember-cli it works fine then i got the bright idea of rebuilding my very simple app with ember-cli what could possible go wrong:) Everything works the same in both apps until ember throws an error and points me to line 52 in my verse controller keep in mind that this file is exactly the same in my non ember-cli version Update i just put a lot of spaces where line 52 was and now it is saying the error is on line 53 which is empty:((( import Ember from 'ember'; export default Ember.Controller.extend({ sortProperties:["time"], sortAscending:true, start:new Date(), count:0, incorrect:0, startReview:true, showHighScores:false, actions:{ startReview:function(){ this.set('startReview',false); this.set("showHighScores",false); this.start = new Date(); this.count = 0; this.incorrect = 0; console.log(this.count); }, showHighScores:function(){ this.toggleProperty("showHighScores"); }, checkCorrectness:function(word){ var textArray = this.get("model.text").split(" "); var length = textArray.length; console.log(this.array); if(word === textArray[this.count]){ console.log("correct"); this.count++; console.log(this.count); }else{ console.log("Incorrect"); this.incorrect++; } if(length === this.count){ var finish = new Date(); var time = finish-this.start; var accuracy = (this.count/(this.count+this.incorrect)*100); alert("You took "+time/1000+" seconds! With "+accuracy+"% accuracy!"); this.saveResult(time); this.set('startReview',true); } }, }, randomizer:function(){ this.set("randomArray",this.get("model.text").split(" ").randomize()); **}.observes("startReview"),**//The offending line saveResult:function(timeTaken){ var date = new Date(), userName = "TimTheGreat"; var score = this.store.createRecord('score',{ userName:userName, date:date, time:timeTaken, verse:this.get('model'), }); var controller = this; var scores = controller.get("model.scores"); score.save().then(function(score){ scores.addObject(score).then(function()…
favorite count: 0
accepted answer: http://stackoverflow.com/a/29045511
upvote count: 1
has comment: http://stackoverflow.com/comment/46326059
downvote count: 1
tagged with: firebase

ruby
tags question: http://stackoverflow.com/q/29060021
tags question: http://stackoverflow.com/q/29017809
tag name: ruby
tags question: http://stackoverflow.com/q/28915321
tags question: http://stackoverflow.com/q/29033548
tags question: http://stackoverflow.com/q/28917926
tags question: http://stackoverflow.com/q/28956940
tags question: http://stackoverflow.com/q/28972935
tags question: http://stackoverflow.com/q/29047737
tags question: http://stackoverflow.com/q/29023544
tags question: http://stackoverflow.com/q/29046146
tags question: http://stackoverflow.com/q/29038495
tags question: http://stackoverflow.com/q/28949981
tags question: http://stackoverflow.com/q/29024097
tags question: http://stackoverflow.com/q/28970305
tags question: http://stackoverflow.com/q/28982587
type: Tag

http://stackoverflow.com/q/29010517
favorite count: 0
tagged with: colorbox
type: UnansweredQuestion
has body: I'm trying to use new google recaptcha in ajax window with colorbox. But there is a problem in IE 9, 10, 11: I can enter nothing in text field. Without colorbox it's allright. Here's my code <div class="g-recaptcha" id="g-recaptcha" data-sitekey="<?= RECAPTCHA_KEY ?>"> Send Does anyone know the solution?
downvote count: 0
has title: google recaptcha in colorbox IE can't enter text
score: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29078414
linked to: http://stackoverflow.com/q/27886618
upvote count: 1
answer count: 1
tagged with: recaptcha
tagged with: jquery

http://stackoverflow.com/comment/46324564
type: Comment
comment on: http://stackoverflow.com/a/28967768
has text: but since the example with one button works without permission or debug, why should this one not work? :P
type: AnswerComment
score: 0

http://stackoverflow.com/a/29031519
type: Answer
answers question: http://stackoverflow.com/q/29031365
has body: Try this, here is http://api.jqueryui.com/autocomplete/ reference. $( "#CompanyList" ).on( "autocompletechange", function( event, ui ) { alert('changed'); });
score: 0

http://stackoverflow.com/a/29081233
has body: My working solution at the moment is to avoid the use of components completely. I simply use the template binding and apply the view models manually. &lt;ul data-bind="menu: {...}"&gt; &lt;!-- ko foreach: menuItems --&gt; &lt;li&gt; &lt;div data-bind="template: {name: $data.template, data: $data.data}"&gt;&lt;/div&gt; &lt;/li&gt; &lt;!-- /ko --&gt; &lt;/ul&gt; I tried using the synchronous option for my components, but the problem is that it does not gurantee synchronous operation. Another solution was to bind my menu in a setTimeout call, but I avoided this solution because it can potentially cause other issues. But that would have looked like this: ko.bindingHandlers.menu = { init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { ko.applyBindingsToDescendants(bindingContext, element); setTimeout(function() { $(element).menu(); }); return {controlsDescendantBindings: true}; } };
type: Answer
accepted answer of: http://stackoverflow.com/q/29021523
score: 0
answers question: http://stackoverflow.com/q/29021523
type: AcceptedAnswer

http://stackoverflow.com/comment/46325029
type: Comment
type: QuestionComment
score: 3
has text: Because the nodeName of ` ` is "INPUT", not "CHECKBOX".
comment on: http://stackoverflow.com/q/29042454

http://stackoverflow.com/comment/46215644
has text: @Bartdude I know, but I have different "packs" which contain a lot of items, but if someone chose a pack and decides to change what he wants, he'll leave back to the home page again. Here I want to remove all set cookies.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28983049
score: 0

http://stackoverflow.com/a/28927290
has comment: http://stackoverflow.com/comment/46123895
downvote count: 0
has body: The webjars-requirejs.js files are legacy artifacts. The newer RequireJS metadata is in the WebJar's pom.xml file. The webjars-locator library has some RequireJS utilities that make it easy to work with this metadata. The WebJar Docs include some details on how to use this.
has comment: http://stackoverflow.com/comment/46120138
has comment: http://stackoverflow.com/comment/46115498
score: 4
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28919076
answers question: http://stackoverflow.com/q/28919076
type: Answer
upvote count: 4

http://stackoverflow.com/a/28999972
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28946739
upvote count: 2
has body: Have you enabled CORS (cross-origin resource sharing) on your tile server? An origin is defined as a URI scheme, hostname, and port number. Even though your tileserver and Cesium are both running on localhost, you'll need to configure the server to provide a CORS header in order for Cesium to use the images. See http://enable-cors.org/server_apache.html for instructions on how to configure CORS on the osm apache server.
has comment: http://stackoverflow.com/comment/46276896
score: 2

http://stackoverflow.com/q/28956629
upvote count: 1
tagged with: php
has title: Uploading data and files in one form using Ajax PHP?
score: 1
type: Question
downvote count: 0
has answer: http://stackoverflow.com/a/49768948
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 3
has body: I'm using jQuery and Ajax for my forms to submit data and files but I'm not sure how to send both data and files in one form? Submit I was planning to use FormData as below var formData = new FormData($(this)[0]); but figured out that it does not work in IE<10 and which is not accepted. Is there any other approach for same?
has answer: http://stackoverflow.com/a/49769576
favorite count: 0
has answer: http://stackoverflow.com/a/28956755
type: UnansweredQuestion

http://stackoverflow.com/a/44071809
answers question: http://stackoverflow.com/q/29055518
upvote count: 4
score: 2
has body: For a simple test with random numbers as string, both are coming so close in Chrome &amp; FF Testing in Chrome 58.0.3029 / Windows 10 String literals 2,996,883 ±2.36% fastest Operator (+) 3,054,078 ±2.01% fastest Concat function 2,659,391 ±2.35% 13% slower Testing in Firefox 53.0.2 / Windows 10 String literals 1,923,835 ±1.52% fastest Operator (+) 1,948,503 ±1.13% fastest Concat function 1,810,857 ±1.81% 8% slower Test here at jsperf
type: Answer
downvote count: 2

http://stackoverflow.com/comment/46233441
has text: @aldel indeed. Implemented as well. :)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28927704

http://stackoverflow.com/comment/46108479
comment on: http://stackoverflow.com/a/28923621
type: AnswerComment
has text: @jimmyjansen Added a fourth option: Laravel (a PHP framework). Since the OP mentioned PHP, I figured it might be best to suggest something that works more or less "right out of the box."
score: 0
type: Comment

angular-ui-router
tags question: http://stackoverflow.com/q/28975650
tags question: http://stackoverflow.com/q/28944625
tags question: http://stackoverflow.com/q/28963452
tags question: http://stackoverflow.com/q/28973260
tags question: http://stackoverflow.com/q/28929959
tags question: http://stackoverflow.com/q/29009715
tag name: angular-ui-router
tags question: http://stackoverflow.com/q/29059507
tags question: http://stackoverflow.com/q/29052817
tags question: http://stackoverflow.com/q/28976522
tags question: http://stackoverflow.com/q/28925396
tags question: http://stackoverflow.com/q/28978271
tags question: http://stackoverflow.com/q/28947065
tags question: http://stackoverflow.com/q/29017682
tags question: http://stackoverflow.com/q/29023440
tags question: http://stackoverflow.com/q/28954978
tags question: http://stackoverflow.com/q/28965756
tags question: http://stackoverflow.com/q/29019467
tags question: http://stackoverflow.com/q/28967957
tags question: http://stackoverflow.com/q/28913377
tags question: http://stackoverflow.com/q/28977878
type: Tag
tags question: http://stackoverflow.com/q/29012982
tags question: http://stackoverflow.com/q/28968826
tags question: http://stackoverflow.com/q/29040406

http://stackoverflow.com/comment/53270977
has text: What If I want change all elements in the array? is it `'nest.$.one'` ?
comment on: http://stackoverflow.com/a/28996119
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29030352
downvote count: 0
tagged with: bootstrap-modal
tagged with: jquery-bootgrid
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30876649
has body: I have a jQuery-bootgrid as described in the examples on the homepage. In the last column I have two buttons for Edit/Delete of the row-content. All I want to do is to show a modal dialog when the user clicks the Delete-button. However, nothing happens on click. No error, no warning, nothing. Here is the code for the bootgrid commands-part: "commands": function(column, row) { return " @Translator.TranslateGlobal(Keys.Global.Edit) " + " Show modal "; }, I have the exact same button outside the bootgrid and on click it shows the dialog as expected. Any ideas where to look at or what is causing this behavior?
upvote count: 3
type: Question
tagged with: javascript
has title: jQuery-bootgrid modal dialog
tagged with: jquery-plugins
has answer: http://stackoverflow.com/a/52254984
answer count: 2
score: 3

http://stackoverflow.com/comment/93163456
comment on: http://stackoverflow.com/a/48531693
has text: Use of `eval()` or `Function()` is incompatible with a Content Security Policy that does not specify `'unsafe-eval'`.
type: AnswerComment
type: Comment
score: 6

http://stackoverflow.com/comment/46122478
has text: @Alundrathedreamwalker No it does not. You cannot select whole folders, while in Chrome you can.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28933293
score: 0

http://stackoverflow.com/comment/46097487
type: Comment
has text: any help would be appreciated
score: 0
comment on: http://stackoverflow.com/q/28916931
type: QuestionComment

http://stackoverflow.com/comment/46272817
has text: Your fix enables me to click the button but as I hover over the gap there is a flicker. Obviously your code is free to use or not use, I'm offering my opinion so you can continue to improve your solution (which at the beginning, I thought had a major flaw - now there's just something aesthetic that I don't like).
comment on: http://stackoverflow.com/a/28993325
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46287741
score: 2
comment on: http://stackoverflow.com/a/29021632
type: AnswerComment
type: Comment
has text: @nicomv95 - any chance you have more than one of these `#anInput` fields in your page? If so, the jQuery will likely fetch the value of the first one.

http://stackoverflow.com/comment/46126529
type: Comment
type: QuestionComment
score: 0
has text: What's less readable about the array?
comment on: http://stackoverflow.com/q/28935516

http://stackoverflow.com/a/28924866
downvote count: 0
score: 15
has comment: http://stackoverflow.com/comment/46107146
has comment: http://stackoverflow.com/comment/65409948
has comment: http://stackoverflow.com/comment/46106619
type: Answer
answers question: http://stackoverflow.com/q/28924756
has comment: http://stackoverflow.com/comment/65418581
has body: You should simply be able to use the {{variable}} notation within a HTML title tag. So something like: &lt;td title="{{project.inrtcvalue}}"&gt; See this plunkr for an example (Thanks dfsq)
has comment: http://stackoverflow.com/comment/46106417
upvote count: 15
has comment: http://stackoverflow.com/comment/46106653

http://stackoverflow.com/comment/46112558
comment on: http://stackoverflow.com/q/28928383
has text: You need to learn about loops.
type: QuestionComment
type: Comment
score: 4

http://stackoverflow.com/comment/46218833
has text: Frankly I would recommend the measurement protocol (https://developers.google.com/analytics/devguides/collection/protocol/v1/reference), that way it doesn't matter from where you send your request.
comment on: http://stackoverflow.com/a/28983849
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46194303
comment on: http://stackoverflow.com/q/28971236
score: 0
type: Comment
type: QuestionComment
has text: One thing to understand is `==` does type coercion, however `===` does not. So instead of relying on `==` to coerce a variable type you do so beforehand so you know the variable type is what you want it to be for your comparison

enyo
tags question: http://stackoverflow.com/q/28995167
type: Tag
tag name: enyo

http://stackoverflow.com/a/29026500
has comment: http://stackoverflow.com/comment/46295116
downvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29026301
has body: I tried this in my php if(mysqli_num_rows($res)) { //do something } but it's also display undefined. I guess that should be because you are calling this php code every 15000 ms via ajax with a setTimeout. So instead stopping it there you can just ignore it with your js code in addrep() function. function addrep(type, msg) { CID.forEach(function(id) { if (msg.id !== undefined && msg.detail !== undefined) { // <--check undefined here $("#newreply" + id).append(" "+ " " + msg.detail + " "); } }); } Or other option is to make use of clearTimeout() when you get undefined. var timer; // declare the timer here var CID = []; // Get all dynamic ids of posts (works well) $('div[data-post-id]').each(function(i) { CID[i] = $(this).data('post-id'); }); function addrep(type, msg) { CID.forEach(function(id) { if(msg.id === undefined || msg.details === undefined){ clearTimeout(timer); // cleartimeout timer }else{ $("#newreply" + id).append(" " + msg.detail + " "); } }); } function waitForRep() { $.ajax({ type: "GET", url: "server.php", cache: false, data: { CID: CID }, timeout: 15000, success: function(data) { addrep("postreply", data); timer = setTimeout(waitForRep, 15000); // assign the settimeout to timer }, error: function(XMLHttpRequest, textStatus, errorThrown) { setTimeout(waitForRep, 15000); } }); } $(document).ready(function() { waitForRep(); });
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29026301
score: 1

http://stackoverflow.com/comment/46205326
comment on: http://stackoverflow.com/q/28977110
score: 0
has text: what about working this in jquery?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29153348
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28962913
has body: The first time your page has a readyState of complete, you know it has loaded fully and your scripts can run. When the user clicks a link that doesn't move away from the page (such as a page that only performs a file download) you could ignore the resulting readyState. So instead of checking the readyState in all your scripts, you could check whether the page has ever been in the complete readyState. The rationale behind setting the readyState to interactive could be that technically, a different page has loaded, but was never rendered, and didn't make it into the history. But I'm just guessing. As you've seen in your fiddle, the behavior seems inconsistent.
score: 0
answers question: http://stackoverflow.com/q/28962913

http://stackoverflow.com/comment/46229743
has text: The w3schools tutorial should have examples for modifying the XML. Then you'll need to post the altered XML back to the server, and then the server will need to save the changes to the file. There are lots of ways to do both of these. Maybe the best place to start would be any tutorial for whatever server side technology you are using.
comment on: http://stackoverflow.com/a/28990137
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28907268
type: UnansweredQuestion
has title: Javascript: parsing negative Number(hexadecimal | binary)
has body: It works with a lot number types, but not with negatives hexadecimal or binary. Too, Number(octal) doesn't parse an octal number. Number("15") === 15; // OK Number("-15") === -15; // OK Number("0x10") === 16; // OK Number("0b10") === 2; // OK Number("-0x10") === NaN; // FAIL (expect -16) Number("-0b10") === NaN; // FAIL (expect -2) Number("0777") === 777; // FAIL (expect 511) Number("-0777") === -777; // FAIL (expect -511) Question: how I can parse all valid Javascript numbers correctly? Edit A parseInt() don't help me because I need check by each possibility (if start with 0x I use 16, for instance). Edit B If I write on Chrome console 0777 it turns to 511, and too allow negative values. Even works if I write directly into javascript code. So I expect basically a parser that works like javascript parser. But I think that the negative hexadecimal, for instance, on really is 0 - Number(hex) in the parser, and not literraly Number(-hex). But octal values make not sense.
has comment: http://stackoverflow.com/comment/46074780
has answer: http://stackoverflow.com/a/28907672
tagged with: numbers
has answer: http://stackoverflow.com/a/28907371
has answer: http://stackoverflow.com/a/28907378
has comment: http://stackoverflow.com/comment/46074327
has comment: http://stackoverflow.com/comment/46074245
type: Question
score: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/28907376
favorite count: 0
has comment: http://stackoverflow.com/comment/46074429
has comment: http://stackoverflow.com/comment/46074092
has comment: http://stackoverflow.com/comment/46074078
has comment: http://stackoverflow.com/comment/46074843
answer count: 4
has comment: http://stackoverflow.com/comment/46074072
has comment: http://stackoverflow.com/comment/46074905
upvote count: 5
downvote count: 0

http://stackoverflow.com/a/28952402
upvote count: 2
type: AcceptedAnswer
has body: For the first loop, why does it show undefined? Why is there the little &lt;· on the left of undefined? The &lt;- signifies the return value. The code doesn't return anything. For the second loop, why does 1 print where it does? It looks like this is something the console is doing, not my code. Here, the code does return something: 1. That is the ID of the setTimeout. For the second loop, why does 2 print out? The for loop is for strictly less than 2. See JavaScript closure inside loops – simple practical example -- by the time your code has run, i is now at 2. Why does the third loop print undefined and 3? What's different that the console didn't actually print out a number next to the &lt;· symbol? undefined is the last value returned by the loop -- that of console.log(). 3 is logged in the timeout. For the last loop, why didn't 1 and 3 print? Kind of seems like it printed 4 3 times. How do you accomplish the intent of my code using setTimeout in this way? See JavaScript closure inside loops – simple practical example again.
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28951617
downvote count: 0
answers question: http://stackoverflow.com/q/28951617
has comment: http://stackoverflow.com/comment/46159801

http://stackoverflow.com/a/29045158
has body: The error itself very clear. The current array is undefined; To avoid getting these error you can check for the existence of the array. currentLen = current &amp;&amp; current.length - 1;
answers question: http://stackoverflow.com/q/29045128
score: 0
type: Answer

http://stackoverflow.com/q/29048743
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29051791
score: 1
upvote count: 1
tagged with: waterline
type: Question
tagged with: sails.js
has title: ER_BAD_FIELD_ERROR in sails.js using waterline
has comment: http://stackoverflow.com/comment/46339813
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29051382
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/46337316
favorite count: 0
accepted answer: http://stackoverflow.com/a/29051791
has body: I know there are similar questions but they haven't help me. I've got an error when trying to use .find() method on model: product2 (.query() method is working ) I was trying to find out how to get more verbose output from database, but with failure. { "error": "E_UNKNOWN", "status": 500, "summary": "Encountered an unexpected error", "raw": { "code": "ER_BAD_FIELD_ERROR", "errno": 1054, "sqlState": "42S22", "index": 0 } }% my model "Product2.js" module.exports = { connection:'someMysqlServer', migration:'safe', tableName:'NUTR_DATA', attributes:{ id:{ columnName:'Nutr_No', primaryKey:true, type:'string' } } }; routes.js module.exports.routes{ 'GET /select':'Product2Controller.select' }; Product2Controller.js module.exports = { select:function(req,res){ Product2.find({limit:10}).exec(function(err, results) { if (err){res.serverError(err)} else{res.json(results)}; }); } }; database schema +---------------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------------+------+-----+---------+-------+ | NDB_No | varchar(5) | NO | PRI | NULL | | | Nutr_No | varchar(3) | NO | PRI | NULL | | | Nutr_Val | decimal(13,3) | NO | | NULL | | | Num_Data_Ptr | decimal(10,0) | NO | | NULL | | | Std_Error | decimal(11,3) | YES | | NULL | | | Src_Cd | varchar(2) | NO | | NULL | | | Deriv_cd | varchar(4) | YES | | NULL | | | Ref_NDB_No | varchar(5) | YES | | NULL | | | Add_Nutr_Mark | varchar(1) | YES | | NULL | | | Num_Studies | int(11) | YES | | NULL | | | Min | decimal(13,3) | YES | | NULL | | | Max | decimal(13,3) | YES | | NULL | | | DF | int(11) | YES | | NULL | | | Low_EB | decimal(13,3) | YES | | NULL | | | Up_EB | decimal(13,3) | YES | | NULL | | | Stat_cmd | varchar(10) | YES | | NULL | | | AddMod_Date | varchar(10) | YES | | NULL | | | CC | varchar(1) | YES | | NULL | | +---------------+---------------+------+-----+---------+-------+ Any ideas as to what is going wrong?
has answer: http://stackoverflow.com/a/29051382

http://stackoverflow.com/comment/46112460
score: 0
has text: This has really been insightful, although I do have a question, I tried replacing the bootbox code with " " I'm just wondering if what can I do to hide the s since my main plan was a textarea inside the modal.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28928069

http://stackoverflow.com/comment/46315472
has text: If we can't get it figured out, I'm going to post this as a new Issue at Github, because I've got to believe I'm not the only one who needs this...
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29036576
type: AnswerComment

http://stackoverflow.com/q/29002523
tagged with: asp.net-mvc
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/46252574
answer count: 1
downvote count: 0
tagged with: asp.net
favorite count: 0
has body: I am trying to learn ASP.Net MVC and I wanted to post array of JSON objects to the server and sent it back to the client side. But I am getting strange results. Everything was fine without adding the fourth variable (bool Required). I also tried to change for example true to "true" in JavaScript part that post the JSON, but I got the same strange results back from the server. The result of POST were the same in both using both JavaScript and POSTMAN, I think the problem is with Server side code. Any help would be great. Here is my controller code: public ActionResult GetResult() { List&lt;SurveyDetails&gt; tableList = new List&lt;SurveyDetails&gt;(); tableList.Add(new SurveyDetails { Id = 500, Question = "where are you from", Answer = 2, Required = true }); tableList.Add(new SurveyDetails { Id = 501, Question = "how old are you", Answer = 1, Required = false }); tableList.Add(new SurveyDetails { Id = 502, Question = "what is your first car", Answer = 2, Required = false }); tableList.Add(new SurveyDetails { Id = 503, Question = "do you have kids", Answer = 1, Required = true }); return Json(tableList, JsonRequestBehavior.AllowGet); } [HttpPost] public ActionResult GetResult(List&lt;Table&gt; list) { return Json(list); } Here is my object declaration: namespace CapstoneProject.Models { public class SurveyDetails { public int Id { get; set; } public string Question { get; set; } public int Answer { get; set; } public bool Required { get; set; } } } Here is what I am getting from the server (GET Request): [ { "Id": 500, "Question": "where are you from", "Answer": 2, "Required": true }, { "Id": 501, "Question": "how old are you", "Answer": 1, "Required": false }, { "Id": 502, "Question": "what is your first car", "Answer": 2, "Required": false }, { "Id": 503, "Question": "do you have kids", "Answer": 1, "Required": true } ] And here the strange results that I am getting back from the server after POSTing what I have received in GET request: [ { "BackImageUrl": "", "Capt…
linked to: http://stackoverflow.com/q/28973634
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29002776
accepted answer: http://stackoverflow.com/a/29002776
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: c#
has title: Unexpected results, Parse Array of JSON Objects in ASP.Net

http://stackoverflow.com/comment/46272908
type: QuestionComment
has text: Have a look: http://www.sencha.com/forum/showthread.php?153253-How-to-download-a-file-using-Ext.Ajax-using-a-POST-call I think you'll need an IFRAME.
comment on: http://stackoverflow.com/q/29012888
score: 0
type: Comment

http://stackoverflow.com/comment/46529850
type: QuestionComment
has text: @Xan yes the background script.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29055555

http://stackoverflow.com/q/29059551
tagged with: javascript
upvote count: 1
has body: I'm using Parse to run a background job which will query a parse class and be given a list of Stripe tokens to charge. I've got the background job to easily make one charge however there's issues when multiple payments are present within the one job because of the calling of success/error. I require each stripe charge to give a success or error return so that I can then set the parse object as being paid or unpaid. I'm pretty inexperienced with JavaScript. I'm able to make two charges successfully however can't get the success/error methods to return on the second stripe charge. Eventually I will want to run a 'for' method to iterate through various customer tokens to make bulk charges. Parse.Cloud.job("makeCharge", function(request, status) { Stripe.Charges.create({ amount: 1000 * 10, currency: "usd", customer: "cus_customer1" client },{ success: function() { status.success("Purchase made!"); }, error: function() { status.error("Uh oh, something went wrong"); } }); Stripe.Charges.create({ amount: 100000 * 10, currency: "usd", customer: "cus_customer2" },{ success: function() { status.success("Purchase made!"); }, error: function() { status.error("Uh oh, something went wrong"); } }); });
tagged with: payment
tagged with: stripe-payments
favorite count: 0
tagged with: parse-platform
tagged with: token
has title: Multiple Stripe Transactions Parse Background Jobs
answer count: 0
downvote count: 0
type: UnansweredQuestion
score: 1
type: Question

http://stackoverflow.com/comment/46206258
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28952550
has text: @Leo that is super incorrect.
type: Comment

http://stackoverflow.com/comment/46184140
comment on: http://stackoverflow.com/a/28966000
type: AnswerComment
score: 0
type: Comment
has text: The link leads to a html minifier - I'm looking to strip comments from javascript only. However, I thank you for the tip, since minifiers are probably a good place to start looking. After all, javascript minifiers do strip away comments.

http://stackoverflow.com/comment/46343550
type: QuestionComment
comment on: http://stackoverflow.com/q/29040972
has text: something similar has to be done. Sorry for asking question poorly. I ll try making it more readable.
score: 0
type: Comment

recaptcha
tag name: recaptcha
tags question: http://stackoverflow.com/q/28951929
tags question: http://stackoverflow.com/q/29010517
type: Tag

http://stackoverflow.com/comment/91837438
comment on: http://stackoverflow.com/a/52254984
type: AnswerComment
has text: I tried the following it does display the buttons in the jquery.bootgrid but the button is not responsive.
score: 0
type: Comment

axes
tag name: axes
type: Tag
tags question: http://stackoverflow.com/q/29026465

http://stackoverflow.com/a/28908830
has comment: http://stackoverflow.com/comment/46078119
has body: The optionsAfterRender callback passes 2 parameters: option (element), and item (data bound to the option). The callback already loops over the options, so no need to reiterate: self.SecondSelectedOption.SetDefault = function (option, item) { var self = viewModel; if (item.Color === 'Blue') self.SecondSelectedOption(item); }; Updated fiddle Ref: from the docs EDIT: That being said, if you don't want the options to re-evaluate every time, you could also simply bind the change event with the setDefault method on the first &lt;select&gt;. If I were faced with this code 'issue', I would probably preprocess the data into separate arrays, like in this fiddle
score: 0
answers question: http://stackoverflow.com/q/28908391
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28908391
has comment: http://stackoverflow.com/comment/46077263
type: Answer
has comment: http://stackoverflow.com/comment/46080728

http://stackoverflow.com/comment/46180586
has text: [the code you posted works standalone](http://jsfiddle.net/42ytkyub/) (doesn't exhibit the issue). It has something to do with how you are including it in the blog, which you haven't provided/described.
comment on: http://stackoverflow.com/q/28962879
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28995756
tagged with: http://stackoverflow.com/tag/html
has body: MongoDB Display H 1 PAGE SCRIPTS In short; I have a MongoDB ready to be displayed at localhost:3000. Server is running and I can display the data on the browser with localhost:3000 But when i try to run the above code on the browser, all i can get the js Alert("Success") and the hard coded part of the table. PAGE and SCRIPTS... the data is: { "offset": 0, "rows": [ { "_id": {}, "url": "http://www.qweq.com\r", "totalLines": 3084, "scripts": [ { "line": 111, "tag": "\"asdas/etc/designs/qwe/assets/head-5.30.31.min.js\"" },{ "line": 3065, "tag": "\"asdas/etc/designs/qwe/assets/common-5.30.31.min.js\"" },{ "line": 3067, "tag": "\"asda/etc/designs/qwe/assets/category-5.30.31.min.js\"" } ] },{ "_id": {}, "url": "http://www.qweqsd.com/qwdq23/qweq/qweqw/\r", "totalLines": 3042, "scripts": [ { "line": 113, "tag": "\"asda/etc/designs/asd/assets/head-5.30.31.min.js\"" },{ "line": 3023, "tag": "\"asdasd/etc/designs/asd/assets/common-5.30.31.min.js\"" },{ "line": 3025, "tag": "\"asdad/etc/designs/qwe/assets/category-5.30.31.min.js\"" } ] }, How can I make this Json data to be display in a dynamic table? Thank you.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28996201
score: 1
tagged with: http://stackoverflow.com/tag/json
has title: Populating dynamic table with json data
upvote count: 1
type: Question
tagged with: mongodb
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28995979
answer count: 2
has answer: http://stackoverflow.com/a/28996201
possible better answer: http://stackoverflow.com/a/28995979
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/46240016

http://stackoverflow.com/comment/46090036
comment on: http://stackoverflow.com/q/28915790
has text: The reason is because I want to add github,linkedIn and Twitter as I find myself searching these 3 quite often. I know it only saves about 5 seconds, but the omnibox feature is really nice and I wanted to use it when creating my chrome extension.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46148177
type: AnswerComment
score: 0
type: Comment
has text: Ouch...thought that might have been the trick. Gonna need someone smarter than me on this. Looks clean to me otherwise, so I'm missing it too unfortunately.
comment on: http://stackoverflow.com/a/28943712

http://stackoverflow.com/q/29058371
has comment: http://stackoverflow.com/comment/46353420
tagged with: pipe
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46353491
has comment: http://stackoverflow.com/comment/46353683
has comment: http://stackoverflow.com/comment/46353464
has comment: http://stackoverflow.com/comment/46353355
has comment: http://stackoverflow.com/comment/46353584
has comment: http://stackoverflow.com/comment/46353712
score: 1
has comment: http://stackoverflow.com/comment/46353579
has comment: http://stackoverflow.com/comment/46353393
has body: I'm trying to use streams in Node.js to basically build a running buffer of HTTP data until some processing is done, but I'm struggling with the specifics of streams. Some pseudocode will probably help: var server = http.createServer(function(request, response) { // Create a buffer stream to hold data generated by the asynchronous process // to be piped to the response after headers and other obvious response data var buffer = new http.ServerResponse(); // Start the computation of the full response as soon as possible, passing // in the buffer stream to hold returned data until headers are written beginAsyncProcess(request, buffer); // Send headers and other static data while waiting for the full response // to be generated by 'beginAsyncProcess' sendObviousData(response, function() { // Once obvious data is written (unfortunately HTTP and Node.js have // certain requirements for the order data must be written in) then pipe // the stream with the data from 'beginAsyncProcess' into the response buffer.pipe(response); }); }); Most of this is almost legitimate code, but it doesn't work. The basic issue is figuring out a way to take advantage of the asynchronous nature of Node.js when there are certain order requirements associated with HTTP requests, namely that headers must always be written first. While I would definitely appreciate any answers with little hacks to get around the order problem without directly addressing streams, I wanted to use the opportunity to get to know them better. There are plenty of similar situations, but this scenario is more to open the can of worms than anything else.
favorite count: 0
has comment: http://stackoverflow.com/comment/46353427
has comment: http://stackoverflow.com/comment/46353849
has comment: http://stackoverflow.com/comment/46353620
has comment: http://stackoverflow.com/comment/46353784
type: Question
has comment: http://stackoverflow.com/comment/46353553
has answer: http://stackoverflow.com/a/29058686
has comment: http://stackoverflow.com/comment/46353601
answer count: 1
tagged with: node.js
has comment: http://stackoverflow.com/comment/46353517
has title: Using streams in Node.js to buffer HTTP communications
tagged with: stream
upvote count: 1
tagged with: http

http://stackoverflow.com/q/28980266
has answer: http://stackoverflow.com/a/32193816
upvote count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/28989012
score: 4
has comment: http://stackoverflow.com/comment/46217961
answer count: 3
tagged with: arrays
tagged with: jquery
tagged with: unique
favorite count: 0
type: UnansweredQuestion
tagged with: ember.js
has body: I have a array with objects which has different properties. There are objects with similar properties. For example, var array=[{'property':1},{'property':2},{'property':1}] How to get the array with unique properties using ember js? Finally I need an array of [{'property':1},{'property':2}] your kind help is really appreciated. Update: I tried the uniq() method. But that does not allow to pass the property as ember allows with sorting. Thank You!
has comment: http://stackoverflow.com/comment/46210620
downvote count: 1
has answer: http://stackoverflow.com/a/43448483
has title: Ember JS how to get an array with unique property values
type: Question

http://stackoverflow.com/a/28980820
answers question: http://stackoverflow.com/q/28979691
score: 0
type: Answer
has body: Is because Google Chrome lets not read files from your hard drive itself ... I think if you allow Firefox to run your example correctly :)

http://stackoverflow.com/q/28992196
tagged with: file-upload
favorite count: 0
has comment: http://stackoverflow.com/comment/46233117
has title: Insert a file into Database using pur Html and Javascript
tagged with: http://stackoverflow.com/tag/html
score: -2
type: AnsweredQuestion
has body: I'm looking for the simplest way to upload a file and insert it into a table in a database using pur HTML and JAVASCRIPT. There is no way to use JAVASCRPIT framworks or HTML5 since I'm trying to add a custom HTML part into a complex application. I've found many examples using PHP, HTML5 and JAVASCRIPT but I'm really looking for pur simple JAVASCIPT and HTML script. Ismail
downvote count: 2
has answer: http://stackoverflow.com/a/28992369
type: Question
linked to: http://stackoverflow.com/q/857670
accepted answer: http://stackoverflow.com/a/28992369
tagged with: database
tagged with: javascript
has comment: http://stackoverflow.com/comment/46232789
upvote count: 0
answer count: 1

promise
tags question: http://stackoverflow.com/q/28956080
tags question: http://stackoverflow.com/q/28937788
tags question: http://stackoverflow.com/q/29011155
tags question: http://stackoverflow.com/q/29010069
tags question: http://stackoverflow.com/q/29013899
tags question: http://stackoverflow.com/q/29049964
tags question: http://stackoverflow.com/q/28993673
tags question: http://stackoverflow.com/q/28915677
tags question: http://stackoverflow.com/q/28954684
tags question: http://stackoverflow.com/q/29053868
tag name: promise
tags question: http://stackoverflow.com/q/28916710
tags question: http://stackoverflow.com/q/28996727
tags question: http://stackoverflow.com/q/28937525
tags question: http://stackoverflow.com/q/29021783
type: Tag
tags question: http://stackoverflow.com/q/29010639
tags question: http://stackoverflow.com/q/29020722
tags question: http://stackoverflow.com/q/29002495
tags question: http://stackoverflow.com/q/28955823
tags question: http://stackoverflow.com/q/29040868
tags question: http://stackoverflow.com/q/28956946
tags question: http://stackoverflow.com/q/28978485
tags question: http://stackoverflow.com/q/28921074
tags question: http://stackoverflow.com/q/29000478
tags question: http://stackoverflow.com/q/28975737
tags question: http://stackoverflow.com/q/29038585
tags question: http://stackoverflow.com/q/28949178
tags question: http://stackoverflow.com/q/29030846
tags question: http://stackoverflow.com/q/29042208
tags question: http://stackoverflow.com/q/28921127
tags question: http://stackoverflow.com/q/28953645
tags question: http://stackoverflow.com/q/28983424
tags question: http://stackoverflow.com/q/28958458
tags question: http://stackoverflow.com/q/28926055
tags question: http://stackoverflow.com/q/28906875
tags question: http://stackoverflow.com/q/28972060

http://stackoverflow.com/comment/46146668
comment on: http://stackoverflow.com/q/28946210
type: Comment
type: QuestionComment
has text: A better approach is probably to configure the date format in your server-side app.
score: 2

http://stackoverflow.com/comment/46182948
has text: @bviale: haha yeah, very jquery-oriented.. i am new to angular
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28965579

http://stackoverflow.com/comment/46212194
type: Comment
has text: Did that and still not opening :/
comment on: http://stackoverflow.com/a/28981161
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46243686
comment on: http://stackoverflow.com/q/28997396
type: Comment
has text: Replace the last line in your enb/dsb click handlers (`.change` call) with something like `$.get("scriptThatSavesValue.php?newValue=Yes");`. Change the script name or create one that saves the value.
score: 0
type: QuestionComment

http://stackoverflow.com/q/29001277
has title: how to replace href url of html tags with incomplete attribute in jquery?
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29001463
has answer: http://stackoverflow.com/a/29001477
type: Question
has body: HTML : DOWNLOAD From Server 1 DOWNLOAD From Server 2 DOWNLOAD From Server 3 DOWNLOAD From Server 4 DOWNLOAD From Server 5 JQUERY : $(document).ready(function() { $("a").click(function(e){ var url1 = $(this).attr('href'); var url = url1.replace(url1,'http://alfanetcell.hostoi.com/phpwidget/download.php?type=int&link='+url1); //$('#result').replaceWith( " " + url + " " ); var newurl = $('a[href="'+url1+'"]').attr("href", url); $('a[href="'+url1+'"]').$(this).attr("target", "_blank"); return false; }); }); I want to replace all link in html above with http://alfanetcell.hostoi.com/phpwidget/download.php?type=int&link='+url1 when the script that I enter into my blog and then all the links in my blog be changed by the script (i'am sorry, My English is very difficult !) UPDATE !, thank's for all my friends, I have found the solution of this discussion: $("p a").click(function(e){ var url1 = $(this).attr('href'); var url = url1.replace(url1,'http://alfanetcell.hostoi.com/phpwidget/download.php?type=int&link='+url1); //$('#result').replaceWith( " " + url + " " ); var newurl = $('a[href="'+url1+'"]').attr("href", url); $('a[href="'+url1+'"]').$(this).attr("target", "_blank"); return false; }); });
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46250357

http://stackoverflow.com/a/28945926
type: Answer
score: 2
has body: You're passing a jQuery wrapper object to React instead of a DOM element. Instead you should unwrap it using jQuery's get() method and pass the raw DOM object to React: $('#tickets').get(0) // returns the DOM element Also move the call to siteFetchComplete() to after the append() operation, otherwise jQuery will be trying to find the element before it exists!
downvote count: 0
has comment: http://stackoverflow.com/comment/46152789
accepted answer of: http://stackoverflow.com/q/28941623
answers question: http://stackoverflow.com/q/28941623
type: AcceptedAnswer
upvote count: 2

http://stackoverflow.com/a/28921277
answers question: http://stackoverflow.com/q/28921248
has comment: http://stackoverflow.com/comment/46100039
type: Answer
has body: Change setInterval to setTimeout. This will run the function only once instead of running it every 100 ms. var position_X = ["0px", "-525px", "-1050px", "-1575px", "-2100px", "-2625px", "-3150px", "-3675px", "-4200px", "-4725px", "-5250px", "-5775px", "-6300px", "-6825px", "-7350px"]; var _lock = document.getElementById('hi'); // console.log(_lock); _lock.style.border = "1px solid black"; _lock.style.backgroundImage = "url('http://handbagmanufacturing.com/wp-content/CDN/images/lock.png')"; function lockAnimation(){ setTimeout(function(){ var _count = position_X.length; for(var i = 0; i < _count; i++){ if(i == _count) break; _lock.style.backgroundPosition = position_X[i] + " 263px"; console.log("Here is the background positions : " + i + ") " + position_X[i]); } } , 100); } #hi { width: 525px; height: 263px; background-position-x: "-7875px" } Click Me I'm Irish!
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/46105552
upvote count: 2

http://stackoverflow.com/comment/46185490
type: QuestionComment
type: Comment
has text: Why are you always ignoring `er`rors? Use proper [promisification](https://github.com/petkaantonov/bluebird/blob/master/API.md#promisification) instead of the `Promise` constructor.
score: 1
comment on: http://stackoverflow.com/q/28958458

http://stackoverflow.com/comment/46237375
type: Comment
comment on: http://stackoverflow.com/q/28994641
score: 4
has text: There is a missing comma "," after `type: "GET"`
type: QuestionComment

http://stackoverflow.com/comment/46254042
has text: document.getElementById('stTxtMapName1').style.display = 'block'; for making it visible !
type: QuestionComment
comment on: http://stackoverflow.com/q/29003673
score: 1
type: Comment

http://stackoverflow.com/q/29016425
upvote count: 1
has answer: http://stackoverflow.com/a/29016777
accepted answer: http://stackoverflow.com/a/29016777
has body: Would like to pass directly from the controller to a JavaScript file. TestControler.groovy def list() { render (view: "list", model:[theId: theId]) } Test.js function test() { // do smth with theId } Found solution have the rendered gsp in the middle, i.e. this one, but I would like to know if there is a way to avoid that including using hidden fields or having in the gsp file a javascript code snippet such as: &lt;g:javascript&gt; function test(${theId}) { // do smth with theId } &lt;/g:javascript&gt;
possible better answer: http://stackoverflow.com/a/29027512
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/46277550
type: Question
answer count: 2
downvote count: 0
linked to: http://stackoverflow.com/q/25702043
tagged with: javascript
tagged with: grails
has answer: http://stackoverflow.com/a/29027512
has title: How to pass a value directly from a controller to a javascript file in Grails
tagged with: groovy
has comment: http://stackoverflow.com/comment/46277679
favorite count: 0

http://stackoverflow.com/a/28978118
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46207441
has comment: http://stackoverflow.com/comment/46208139
has comment: http://stackoverflow.com/comment/46207357
type: Answer
has comment: http://stackoverflow.com/comment/46208367
has comment: http://stackoverflow.com/comment/46207008
has body: Fixed Code: public HttpResponseMessage Put(int id,[FromBody]Search editFavorite) { if (_favRepo.EditFavorite(id, editFavorite)) { _favRepo.Save() return Request.CreateResponse(HttpStatusCode.Created, editFavorite); } return Request.CreateResponse(HttpStatusCode.BadRequest); } I am also posting code which should work fine for handling edit on server side using WEB API and Repository Pattern. WebAPI Controller: public HttpResponseMessage Put(int id,[FromBody]Search editFavorite) { if (!ModelState.IsValid || id != editFavorite.Id) { return Request.CreateResponse(HttpStatusCode.BadRequest); } db.EditFavorite(editFavorite); try { db.Save(); } catch (DbUpdateConcurrencyException) { if (!db.SearchExists(id)) { return Request.CreateResponse(HttpStatusCode.NotFound); } else { throw; } } return Request.CreateResponse(HttpStatusCode.Created, editFavorite); } Repository Method: public void EditFavorite(Search editFavorite) { db.Entry(editFavorite).State = EntityState.Modified; } public void Save() { db.SaveChanges(); } public bool SearchExists(int id) { return db.Search.Count(e =&gt; e.Id == id) &gt; 0; } Modify Interface: void Save(); void EditFavorite(Search newSearch); bool SearchExists(int id); Edit: I have made some changes so that only operations that are carried out on your db context is done in repository layer (Data Layer) and the error checking is done in the WEB API Controller. Suggestion: You should inherit IDisposable on the interface and implement it your repository class so that your entities are properly disposed... public interface IFavoritesRepository : IDisposable { // code here } public class FavoritesRepository : IFavoritesRepository { // code here private bool disposed = false; protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { db.Dispose(); } } this.disposed = true; } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } }
has comment: http://stackoverflow.com/comment/46208346
downvote count: 0
has comment: http://stackoverflow.com/comment/46208271
has comment: http://stackoverflow.com/comment/46207151
has comment: http://stackoverflow.com/comment/46207982
accepted answer of: http://stackoverflow.com/q/28977848
score: 3
has comment: http://stackoverflow.com/comment/46207653
has comment: http://stackoverflow.com/comment/46208256
answers question: http://stackoverflow.com/q/28977848
has comment: http://stackoverflow.com/comment/46208324
has comment: http://stackoverflow.com/comment/46207295
upvote count: 3
has comment: http://stackoverflow.com/comment/46208311
has comment: http://stackoverflow.com/comment/46208095

http://stackoverflow.com/comment/46298981
type: Comment
comment on: http://stackoverflow.com/a/29028760
has text: This is about the tabs not the accordion on itselfs
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46179775
type: QuestionComment
comment on: http://stackoverflow.com/q/28963673
has text: var dTime = moment(dt); // is not required, var timeDifference = moment().diff(moment(dTime)), 'hours'); // this is also not required. Just you do var timeDifference = moment().diff(dt), 'hours');
score: 0
type: Comment

http://stackoverflow.com/a/28907894
answers question: http://stackoverflow.com/q/28907765
has comment: http://stackoverflow.com/comment/46075251
has comment: http://stackoverflow.com/comment/46075198
upvote count: 2
has body: The JSON data is invalid. If it is returned from a server, you need to go there and correct the data source, (if you have access to that). Otherwise, perhaps notify the backend guy(s) about it. If it is from a REST API, and you are "sure" that the server code should be error free, then check that you have supplied all the required parameters in the API request you are making.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46075622
has comment: http://stackoverflow.com/comment/46075702
has comment: http://stackoverflow.com/comment/46075444
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28907765
downvote count: 0

http://stackoverflow.com/q/28917119
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28917750
downvote count: 1
type: Question
has body: I am looking for an outlook style navigation sidebar for my web application which looks similar to: I know there are versions of this available as winform controls and through the Visual WebGUI system but these are Microsoft based solutions. What we are looking for is a strictly Javascript &amp; CSS based solution or at the very least server independent. I am aware of similar solutions which have been made in the past which use jQuery's accordian plugin but that results in the sections moving up and down rather than being pinned to the bottom of the navigation bar the way the outlook solution works. The basics of what we are after is... Title Bar Tree Navigation Section Section Navigation Buttons at Bottom Section Navigation Buttons Compressable To Single Row (Optional) Would like to use an existing solution out there if there is one rather than needing to build my own. Thanks in advance.
has title: Javascript & CSS Outlook Style Navigation Bar
tagged with: javascript
score: -1
upvote count: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28917750
favorite count: 0
has comment: http://stackoverflow.com/comment/46092187
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/46295072
type: QuestionComment
comment on: http://stackoverflow.com/q/29026529
has text: @thefourtheye Sorry, I searched for an hour first. I always try to figure it out on my own. Dan D.: Thanks! I'll check out that other question for more info.
score: 0
type: Comment

http://stackoverflow.com/a/29057112
type: Answer
has comment: http://stackoverflow.com/comment/46351293
downvote count: 0
has body: You need to event delegation for dynamic added element $(document).on("click",".testingClass",function() { alert("hiiiiiiiiiiiiiiiiii") }); Event delegation
score: 1
has comment: http://stackoverflow.com/comment/46351266
answers question: http://stackoverflow.com/q/29057084
upvote count: 1

http://stackoverflow.com/a/28987825
answers question: http://stackoverflow.com/q/28987543
score: 0
has body: There are two main ways that variable references are kept long-term in JavaScript; as object properties (myObj = {x: 3}, x is a simple property of myObj), and through a JavaScript internal system called "closures" that takes local variables and maintains their reference as long as a function can still access them (like your property accessors). Examples of local variables would be as follows: function myFunction(localVariable1) { var localVariable2 = ... ... } If myFunction runs once and ends, the garbage collector gets rid of localVariable1 and localVariable2 when the function finishes; it doesn't need them. A useful trick in JavaScript though, is the fact that the compiler can keep variable references even inside a function, if an inner function will need them. function myFunction(localVariable1) { document.onload = function() { document.write(localVariable1; }; } In that case, it will keep a reference to localVariable1 until document onload (and perhaps after since the function still exists). In your case though, it will keep it for the entire length of the object so that those set and get functions can operate on it.
type: Answer

http://stackoverflow.com/comment/46217513
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28984304
type: Comment
has text: between the two divs in row, cause in real example i have text and the divs is too close.

http://stackoverflow.com/q/28989887
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46231690
type: Question
has body: I have a site where I've altered the bootstrap nav bar slightly so that it will be hoverable until it's viewed on mobile and then it's clickable. I just added a submenu within the dropdown and for some reason when I hover over the parent/main nav the dropdown appears and the submenu will appear as well before I've hovered over it's parent element. Can anyone figure out why this is happening or offer another way to do this? Below is what it looks like when I scroll over the main Administrator link and haven't hovered over the Page 1-1 submenu. Thanks! Example of one of the menu items Administor Page 1-1 Page 1-1 Page 1-2 Page 1-3 Submenu 1 Submenu 2
tagged with: submenu
has answer: http://stackoverflow.com/a/29001244
score: 0
has title: Bootstrap Submenu showing up before hovered over?
answer count: 1
tagged with: javascript
tagged with: drop-down-menu
has comment: http://stackoverflow.com/comment/46228401
tagged with: css

http://stackoverflow.com/comment/46255541
has text: Sorry, but why you makes so difficult for other to read your code? You write about the "first 2 select" for example. The reader have to scroll through your code skip many first columns to find the selects. Do you mean that you have problems with `SalesPerson` and `StageKey` columns? Why you don't write that? Even the formatting of the code is terrible. Why you don't remove unneeded space on the left size of the code before posting the code. Why you absolutely don't think about the reader of your question?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29002512

http://stackoverflow.com/comment/46269615
comment on: http://stackoverflow.com/q/29012206
has text: It is good, but why in controller is not changed variable `ng-model="phone"` from form, when I am typing text in input?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46128046
type: QuestionComment
has text: The name of the function should be document.getElementById. Javascript is case sensitive.
score: 0
comment on: http://stackoverflow.com/q/28936410
type: Comment

http://stackoverflow.com/q/28934248
tagged with: javascript
linked to: http://stackoverflow.com/q/22231911
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28934975
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46124808
has comment: http://stackoverflow.com/comment/46124251
has comment: http://stackoverflow.com/comment/46124755
tagged with: fonts
has body: I defer loading fonts to speed up page load var assets = { 1:{ type:"link", attributes:{ href:"http://fonts.googleapis.com/css?family=Open+Sans:300,400", rel:"stylesheet", type:"text/css" } } } for(var n=0,k=Object.keys(assets);n&lt;k.length;n++){ var a = document.createElement(assets[k[n]].type); for(var i=0,k2=Object.keys(assets[k[n]].attributes);i&lt;k2.length;i++){ a.setAttribute(k2[i],assets[k[n]].attributes[k2[i]]); } if(assets[k[n]].hasOwnProperty("onload")){ assets[k[n]].onload(); } document.getElementsByTagName("head")[0].appendChild(a); } But the tendency in this process is that the page will blink to update the fonts. I am ok with the blinking but I prefer for it to happen on the initial page load only. How can I detect if the font is cached so that I can load it without deferring?
has comment: http://stackoverflow.com/comment/46124920
has comment: http://stackoverflow.com/comment/46124210
type: Question
has title: How to detect if the google font is cached client side
has comment: http://stackoverflow.com/comment/46124928

http://stackoverflow.com/comment/46168927
has text: First: you link is broken, second: `delegate` is superseded by [.on()](http://api.jquery.com/on/)
type: Comment
score: 3
comment on: http://stackoverflow.com/a/28958097
type: AnswerComment

http://stackoverflow.com/a/28908983
score: 0
has body: I would say that .next() make things needlessly complicated. This task is easily solved with some jQuery and a little math. Complete solution at the bottom, step-by-step with explanations following. Pretty much only the internals of slideSwitch are changed. Requires that .active is set on one element. I like this solution because of its mathematical elegance, and because it's pretty easy to use once you understand the concept of it, and because it allows us to understand what we do instead of relying on things that "just work". Step-by-step with explanation What you want to do is get a list, iterate over it, change the class and then start from the beginning, right? A trick for this is using index % length. Pretty much only the internals of slideSwitch are changed. Requires that .active is set on one element. First, get the list of slides: (cache outside function for better performance) var $list = $("div#slideshow"); Then, we want to find the active element and its index. This is done with: var $current = $list.find(".active").index(); Then the magic. To find the next number, regardless of current position, we take $current, and add 1, then get the modulus (remained, essentially) of that number divided by the number of items total. The list of elements in #slideshow is returned by $list.children(). Thus, it will magically wrap around and start over when it reaches the end. var $next = ($current + 1) % $list.children().length; Then it's only a matter of removing the class from the current element and adding it to the next, using .get(index) which allows us to find() elements by their index and wrapping them in a jQuery object so we can use addClass() and removeClass(), because backwards compability. $($list.children().get($current)).removeClass("active") $($list.children().get($next)).addClass("active"); And that's it. Full solution: jsFiddle: http://jsfiddle.net/thn1vnmg/ function slideSwitch() { // Cache this outside function for performance var $list = $("div#sli…
has comment: http://stackoverflow.com/comment/46078317
type: Answer
answers question: http://stackoverflow.com/q/28907440

http://stackoverflow.com/comment/46089292
comment on: http://stackoverflow.com/q/28914653
score: 0
type: Comment
has text: note also that javascript is case sensitive. So in your data you have samples and measurements twice - once (capitalized) as strings and once with the converted type. I guess you just need the latter for processing.
type: QuestionComment

http://stackoverflow.com/q/28925394
tagged with: php
has comment: http://stackoverflow.com/comment/46107332
score: 0
upvote count: 1
answer count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28925623
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28925623
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46107551
has title: How to call a PHP function within a page using AJAX
favorite count: 0
tagged with: ajax
type: Question
has body: I wrote a php function which does the job perfectly if it is called standalone by PHP page. but I want to integrate this function in a program and want to call it when a button is clicked. My PHP function is function adddata($mobile){ // outside of this function, another database is already selected to perform different //tasks with program's original database, These constants are defined only within this //this function to communicate another database present at the same host define ("HOSTNAME","localhost"); define ("USERNAME","root"); define ("PWD",""); define ("DBNAME","budgetbot"); // link to mysql server if (!mysql_connect(HOSTNAME,USERNAME,PWD)) { die ("Cannot connect to mysql server" . mysql_error() ); } // selecting the database if (!mysql_select_db(DBNAME)) { die ("Cannot select database" . mysql_error() ); } //inserting phone number into database $query = "INSERT INTO `verify_bot` (phone_number) values('".$mobile."')"; if(!mysql_query($query)){ die( mysql_error() ); } // wait for 2 seconds after adding the data into the database sleep(2); $query = "SELECT * FROM `verify_bot` WHERE phone_number = ".$mobile; $result = mysql_query($query) or die( mysql_error() ); // if more than one records found for the same phone number if(mysql_num_rows($result) > 1){ while($row = mysql_fetch_assoc($result)){ $data[] = $row['response']; } // return an array of names for the same phone numbers return $data; }else{ // if only one record found $row = mysql_fetch_assoc($result); $response = $row['response']; return $response; } // end of function } HTML Code is written as Verify I want to call this function and assign the return value to a javascript variable by ajax/jquery. My code to do this is... I would like to share that the above javascript code is placed outside of documnet.ready(){} scope Any help would be much appreciated. Thanks
has comment: http://stackoverflow.com/comment/46107259

http://stackoverflow.com/comment/46279175
comment on: http://stackoverflow.com/q/29017494
has text: Difficult if you don't have http:// or mailto:// in front as an url can (but rarely does) contain the "@" character.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/46191062
type: QuestionComment
comment on: http://stackoverflow.com/q/28969175
score: 0
type: Comment
has text: will do that if this take lot of time to fix. now in my time I can afford to learn this..

http://stackoverflow.com/comment/46355494
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28938624
has text: Hello, I guess your problem is fitting `wysihtml5` according to document `height`. Isn't it? I've worked with `wysihtml5` in my project. Note this functions. These may be solve your issue. `$(document).height()` and `$(window).height()` Actually I couldn't fully understand your problem.

http://stackoverflow.com/q/28966830
has body: Name Number submit What should I write to jQuery.post to send the data from the form to a php page, I tried some posibilities but when I clicked submit the php page responded "No value". I don't have to change anything at the php page just in this script.
tagged with: javascript
tagged with: jquery
score: 0
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 1
favorite count: 0
type: UnansweredQuestion
has title: Posting data to php page
tagged with: php
has answer: http://stackoverflow.com/a/28967021
has comment: http://stackoverflow.com/comment/46187004
has comment: http://stackoverflow.com/comment/46185705
has comment: http://stackoverflow.com/comment/46185754
tagged with: forms
has comment: http://stackoverflow.com/comment/46185349
has comment: http://stackoverflow.com/comment/46185701
type: Question

http://stackoverflow.com/a/29041041
has comment: http://stackoverflow.com/comment/46388698
has comment: http://stackoverflow.com/comment/46330083
type: Answer
has comment: http://stackoverflow.com/comment/46338032
has body: if ($encoding !== 'UTF-8'){ return mb_convert_encoding( $source, 'UTF-8','UTF-8'); } You are converting from UTF-8 encoding to UTF-8 encoding. As result safari seems to get url in unsupported encoding which seems not to handle properly. Try: if ($encoding !== 'UTF-8'){ return mb_convert_encoding( $source, 'UTF-8','UTF-8,ISO-8859-7 '); } UPDATE I did some additional testing and it seems that mb_detect_encoding() always returns UTF-8 if "auto" is specified as attribute or no second attribute is passed. I solved this by doing that like below, but can't fully test it without the actual files and paths. Try if it works this way: function convert_to( $source ){ $encoding = mb_detect_encoding( $source, "Windows-1253,ISO-8859-7,UTF-8" ); if ($encoding !== 'UTF-8'){ return mb_convert_encoding( $source, 'utf-8','Windows-1253,ISO-8859-7,UTF-8'); } else { return $source; } }
answers question: http://stackoverflow.com/q/29040605
score: 0

http://stackoverflow.com/q/29004501
tagged with: php
has answer: http://stackoverflow.com/a/50871471
has comment: http://stackoverflow.com/comment/88744267
has body: Note: This is a follow-up question to an earlier post of mine. I have a PHP array which I need to parse to a JavaScript. Currently I am attempting to do so, using &lt;?php echo json_encode($array_name)?&gt; inside the JavaScript. For most of the data in the array, this works fine, except for the dates. The array I am trying to parse looks like this: $timeData = array( array('1', 'Some task', date('2015-04-09'), date('2015-04-23')), array('2', 'Another task', date('2015-04-13'), date('2015-04-20')), array('3', 'A different task', date('2015-04-16'), date('2015-04-30)) ); ?&gt; I need to parse this array, in a way that makes it usable in Google Charts Timeline, where the function looks like this (see comment in code): &lt;script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization', 'version':'1','packages':['timeline']}]}"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; google.setOnLoadCallback(drawChart); function drawChart() { var container = document.getElementById('example2.1'); var chart = new google.visualization.Timeline(container); var dataTable = new google.visualization.DataTable(); dataTable.addColumn({ type: 'string', id: 'Term' }); dataTable.addColumn({ type: 'string', id: 'Name' }); dataTable.addColumn({ type: 'date', id: 'Start' }); dataTable.addColumn({ type: 'date', id: 'End' }); // This is the part I would like to replace with the PHP array dataTable.addRows([ [ '1', 'George Washington', new Date(1789, 3, 29), new Date(1797, 2, 3) ], [ '2', 'John Adams', new Date(1797, 2, 3), new Date(1801, 2, 3) ], [ '3', 'Thomas Jefferson', new Date(1801, 2, 3), new Date(1809, 2, 3) ]]); chart.draw(dataTable); } &lt;/script&gt; I have tried several different ways of creating the dates in the PHP array, including new Date() and new DateTime(), all without luck. My final resort is to split the array up into pieces, before parsing the data. However this seems somewhat silly, as it is to be put together as an ar…
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
has answer: http://stackoverflow.com/a/29006120
linked to: http://stackoverflow.com/q/36233412
type: Question
linked to: http://stackoverflow.com/q/9755911
has title: PHP date() to JavaScript new Data() - Inside array
tagged with: arrays
tagged with: javascript
tagged with: date
has answer: http://stackoverflow.com/a/29004639
answer count: 3
linked to: http://stackoverflow.com/q/28946553
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/112630316
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28989222
has title: How to change a CSS attribute by changing a global variable?
tagged with: global-variables
type: Question
has comment: http://stackoverflow.com/comment/46227024
tagged with: javascript
has body: I've got a button that when pressed changes a variable between true and false. When true I want the test to display blue, when false I want the text to display black. I'm not sure why but the text is staying blue, despite the variable changing. Here's my code: Hello Change
score: 0
answer count: 2
tagged with: variables
has answer: http://stackoverflow.com/a/28989349
tagged with: css
tagged with: attributes
has answer: http://stackoverflow.com/a/28989327
type: UnansweredQuestion

http://stackoverflow.com/comment/46291201
type: QuestionComment
type: Comment
has text: How you set values to `movieNetwork`? @maverick
score: 0
comment on: http://stackoverflow.com/q/29024270

http://stackoverflow.com/a/70892190
has body: if i use code like this const alpha = a ? a : b ? b : c it will get Extract this nested ternary operation into an independent statement. from so i recommend to use this const alpha = a || b || c it works for me
score: 1
answers question: http://stackoverflow.com/q/29043135
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/q/29022245
type: UnansweredQuestion
has body: I have a function inside a service which has lots of lines and I want to convert that function into two different functions this is the function angular.module('capilleira.clickAndGambleMobile.services') .factory('SportsFactory', function($http, $q, AuthFactory, LocalForageFactory, LeaguesFactory, CONSTANT_VARS) { return { getSports: function(customer) { var defer = $q.defer(), _this = this; LocalForageFactory.retrieve(CONSTANT_VARS.LOCALFORAGE_SPORTS) .then(function(sports) { if (!_.isNull(sports)) { defer.resolve(sports); }else { $http.get(CONSTANT_VARS.BACKEND_URL + '/lines/sports/' + customer.agent) .success(function(sports) { sports = _.sortBy(sports, function(sport) { return sport.priority; }); //THIS THE PART THAT I WANT TO MOVE FROM HERE _this.getSportChecked(customer).then(function(sportChecked) { var sportIds = _.pluck(sports, 'id'), intersectedSports = _.intersection(sportIds, sportChecked.sport); if (sports.length) { sports = _.map(sports, function(sport) { sport.checked = !_.includes(intersectedSports, sport.id); return sport; }); }else { AuthFactory.logout(); } }); LocalForageFactory.set(CONSTANT_VARS.LOCALFORAGE_SPORTS, sports); defer.resolve(sports); }) .error(function(err) { defer.reject(err); }); } }); return defer.promise; } }); and here is what I have so far but I am receiving an error sports is not defined getSports: function(customer) { var defer = $q.defer(), _this = this; LocalForageFactory.retrieve(CONSTANT_VARS.LOCALFORAGE_SPORTS) .then(function(sports) { if (!_.isNull(sports)) { defer.resolve(sports); }else { $http.get(CONSTANT_VARS.BACKEND_URL + '/lines/sports/' + customer.agent) .success(function(sports) { sports = _.sortBy(sports, function(sport) { return sport.priority; }); // HERE I AM CALLING THE NEW FUNCTION _this.intersectedSportsChecked(customer); LocalForageFactory.set(CONSTANT_VARS.LOCALFORAGE_SPORTS, sports); defer.resolve(sports); }) .error(function(err) { defer.reject(err); }); } }); return defer.promise; }, // HERE IS THE NE…
has comment: http://stackoverflow.com/comment/46287786
answer count: 0
has comment: http://stackoverflow.com/comment/46287602
has comment: http://stackoverflow.com/comment/46287658
tagged with: javascript
has comment: http://stackoverflow.com/comment/46287649
has comment: http://stackoverflow.com/comment/46287933
favorite count: 0
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/46287787
has comment: http://stackoverflow.com/comment/46287693
has comment: http://stackoverflow.com/comment/46287803
has comment: http://stackoverflow.com/comment/46287747
has comment: http://stackoverflow.com/comment/46287588
has comment: http://stackoverflow.com/comment/46287758
score: 0
has comment: http://stackoverflow.com/comment/46287723
has comment: http://stackoverflow.com/comment/46288131
upvote count: 1
downvote count: 1
has title: from a service, turning one function into two different functions
has comment: http://stackoverflow.com/comment/46288051

http://stackoverflow.com/q/28977242
has title: Bootstrap form dynamically add remove form with fields
linked to: http://stackoverflow.com/q/9768721
has answer: http://stackoverflow.com/a/28977284
type: Question
answer count: 2
has body: I have a Bootstrap horizontal form (with many fields) and would like functionality to add/remove one or many "sub-forms (with many fields) to the parent form. Also I'm not sure which path to go down, i.e. code with Bootstrap components, or purely with jQuery and CSS (within Bootstrap), or JavaScript only (within Bootstrap). This may be a simple question, and I've been searching for a bread and butter solution, but with no luck. Perhaps it's very difficult to do. Found this, but no help Similar question on SO And this, but it's done in JavaScript Another question on SO Here is an example of what I'd like to do, I have a parent form which contains personal details fields, and would like when a user clicks a button (+) an address form is dynamically added, and if button (-) is clicked, the address form is removed. Person Firstname: Surname: Email: Button (+/-) Address 1 Street: Suburb: Postcode: Address 2 Street: Suburb: Postcode:
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
tagged with: css
has answer: http://stackoverflow.com/a/30718968
tagged with: twitter-bootstrap
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/comment/46296730
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28986523
has text: I ended up using `$scope.dateChange = function(event){ var d = new Date(); $scope.minDate1 = d.setDate($scope.dt.getDate() + 1); };` as couldn't get the above code to work as you did. It's essentially the same as your code. Thanks :)
score: 0

http://stackoverflow.com/a/29023666
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29022534
has body: The option I was needing was prependTo. prepend by itself without To does not handle HTML See this page for more details. http://www.w3schools.com/jquery/jquery_ref_html.asp
answers question: http://stackoverflow.com/q/29022534
score: 0

http://stackoverflow.com/comment/46250883
type: Comment
has text: Like the other comments say, there is an error at the tabulous line. The script never makes it to the keyup functions, therefore the divs won't update
score: 0
comment on: http://stackoverflow.com/q/29001604
type: QuestionComment

jasmine
tags question: http://stackoverflow.com/q/29030731
tags question: http://stackoverflow.com/q/28980660
tags question: http://stackoverflow.com/q/29012268
tags question: http://stackoverflow.com/q/29020704
tags question: http://stackoverflow.com/q/28997008
tag name: jasmine
tags question: http://stackoverflow.com/q/29050715
tags question: http://stackoverflow.com/q/28944520
tags question: http://stackoverflow.com/q/29013659
tags question: http://stackoverflow.com/q/29034374
type: Tag
tags question: http://stackoverflow.com/q/28987646
tags question: http://stackoverflow.com/q/29010089
tags question: http://stackoverflow.com/q/28944353
tags question: http://stackoverflow.com/q/28989358

http://stackoverflow.com/comment/46389248
type: AnswerComment
has text: I second @gfullam, that's a bad practice. You should bind a function to `document.onkeypress` only once, and then update it depending of what you want. Concerning your true/false question, r is unecessary: just replace `r = true` by `return true`. And `return r` by `return false`.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29060271

http://stackoverflow.com/a/28926995
has comment: http://stackoverflow.com/comment/46111360
score: 1
accepted answer of: http://stackoverflow.com/q/28926055
upvote count: 1
answers question: http://stackoverflow.com/q/28926055
has body: I'm not even sure I'm using them right in my example. It looks like you've forgotten to return a promise from your each() callback. Also, I'm not sure whether you need that Promise.try wrapper, I would think using the promise returned by .fetch() directly should be pretty safe. The issue I have is that I'd like to pass some truthy or falsy to ".then" part of the promise. I think the easiest way here is to nest the then calls, and put the callbacks right for the respective .save() invocation. return new Term().where({'date_of_driving': d.date_of_driving}).fetch() .then(function(result){ d.updated_at = dater.formatDate(new Date(), true); if (result !== null) { var res = result.toJSON(); return new Term({'id': res.id}).save(d) // update .then(function(item) { // here you know that before you updated the Term record }); } else { d.created_at = dater.formatDate(new Date(), true); return new Term().save(d) // save .then(function(item) { // here you know that before you saved the Term record }); } }) Basically, if your problem boils down to accessing the result !== null expression, see How do I access previous promise results in a .then() chain? for other approaches.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46115645
has comment: http://stackoverflow.com/comment/46111530
type: Answer

http://stackoverflow.com/comment/46204431
type: QuestionComment
comment on: http://stackoverflow.com/q/28975487
score: 0
has text: Since you don't have the entire code shown, are you adding the special `key` attribute to each `tr` so that React knows what's changed properly? http://facebook.github.io/react/docs/multiple-components.html#dynamic-children
type: Comment

http://stackoverflow.com/comment/46147743
comment on: http://stackoverflow.com/q/28946190
type: Comment
type: QuestionComment
has text: http://jsfiddle.net/77tbLjwp/ Something like this. I want those 2 divs to be triangles.
score: 0

http://stackoverflow.com/a/29059364
type: Answer
has body: I create the logout button that calls FB.logout(): Facebook logout Then replace $(\".fb-login-button\").empty(); with $("#facebook-logout-button").remove();
accepted answer of: http://stackoverflow.com/q/29040216
answers question: http://stackoverflow.com/q/29040216
type: AcceptedAnswer
score: 0

http://stackoverflow.com/comment/46274408
comment on: http://stackoverflow.com/a/28946838
type: AnswerComment
score: 0
type: Comment
has text: This is the only solution i see available as i dont find any way to access to the google api through my angular endpoint . Thanks Richard!

http://stackoverflow.com/q/28971881
type: Question
has title: How to make a div that appear on hover, stay while its hovered on in jquery or css
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: show-hide
has comment: http://stackoverflow.com/comment/46204987
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28971963
upvote count: 2
has body: I have a div called title, and another one called description. I have managed to make the div description appear while hovering on title. here is the fiddle Now I want to make the div description stay visible while I'm hovering on it (ON THE DESCRIPTION DIV). Once i remove the hover form the div description, it should hide. Here is my html Last some description Here is my JS var cancel = false; $("div.description").hide(); $(".title").hover(function () { cancel = (cancel) ? false : true; if (!cancel) { $("div.description").hide(); } else if (cancel) { $("div.description").show(); } }); And this is the CSS .title { background: red; } .description { background: yellow; }
has comment: http://stackoverflow.com/comment/46205876
accepted answer: http://stackoverflow.com/a/28971963
tagged with: css
score: 2
type: AnsweredQuestion

http://stackoverflow.com/a/29002265
score: 0
answers question: http://stackoverflow.com/q/29001535
type: Answer
has body: Something like: With appIE.document .getElementsByName("j_username")(0).Value = "myUserName" .getElementsByName("j_password")(0).Value = "myPassword" .getElementsByName("btnLogin")(0).Click End With getElementsByName() returns a set of elements (even if there's only one match in the document) so you have to address the first element in the collection (which is zero-based) and not the collection itself.

http://stackoverflow.com/a/28984146
answers question: http://stackoverflow.com/q/28983477
score: 0
has body: You mess up small code error BUT your logic is totally right...Just take a look at your code you used document.getElementByID it may be document.getElementById ...did you get that ? Not ID. it's Id.
type: Answer

http://stackoverflow.com/comment/46266137
has text: ... but I forgot that `finally` is a reserved name in JS, edited.
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29010451

http://stackoverflow.com/comment/46311528
type: Comment
comment on: http://stackoverflow.com/a/29035151
type: AnswerComment
has text: From what I can find, Ajax doesn't support binary data. When I did something similar to what you have, and the "data" object returned had a String that looks like binary PDF content, but I'm doubtful a String of binary data is exactly the same thing as a byte[] array. The idea of returning a URL via Ajax and doing a separate retrieve sounds like the cleanest, but it would require some serious rework of the app
score: 0

http://stackoverflow.com/comment/118732899
comment on: http://stackoverflow.com/a/67170775
type: Comment
has text: This is a JavaScript specific question related to how JavaScript handles references, why is your code example .NET?
type: AnswerComment
score: 4

http://stackoverflow.com/comment/46111140
has text: Hi Ken my biggest worry with this is that I'll be working with numbers outside of the javascript range, the byte shifting is happening outside of the DataView right? I was just worried about that, so would reading it as little endian and doing the shifting be safe way? Then I can read the big endian numbers as strings? :)
comment on: http://stackoverflow.com/a/28923612
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46143199
type: QuestionComment
has text: I tried with ng-src but it doesn't work
comment on: http://stackoverflow.com/q/28944413
score: 0
type: Comment

http://stackoverflow.com/a/29018970
answers question: http://stackoverflow.com/q/29018618
has comment: http://stackoverflow.com/comment/46395589
downvote count: 3
type: Answer
upvote count: 0
score: -3
has body: There is this concept of overhead that I slept through in college, but my basic understanding is that looping can be expensive. (performance intensive) So if there are 100 lines and you loop through them 1 at a time, that's 100 loops, but if you can handle 5 lines per loop then it's only 20 loops. It's called "loop unrolling", http://en.wikipedia.org/wiki/Loop_unrolling So don't do this... while (x&lt;= lineCount) { //do stuff on line x x++; } Instead try this... while (x&lt;= lineCount) { //do stuff on line x //do stuff on line x+1 //do stuff on line x+2 //do stuff on line x+3 //do stuff on line x+4 x=x+5; } And you also have to handle situations where there are 47 lines, so you only loop up to ((int)(linecount/5)*5) and then do a mini 1-at-a-time loop at the end to handle 46 and 47 (linecount%5). This results in really ugly, not elegant code, but I've seen it be very helpful for performance, specifically in chunking long sql queries. You have to play around with the chunk size, 5 might be too small or too large to have a benefit, so adjust it and log your times until you find the sweet spot.

http://stackoverflow.com/a/54902762
upvote count: 11
score: 11
answers question: http://stackoverflow.com/q/29006999
downvote count: 0
has body: const arr = [{"id":"5","name":"Immidiate"}, {"id":"4","name":"30 days"}, {"id":"3","name":"21 days"}, {"id":"2","name":"14 days"}, {"id":"1","name":"7 days"}, {"id":"6","name":"Custom"}]; const resultArray = arr.map(elm =&gt; ({ Name: elm.id, Data: elm.name})); console.log(resultArray);
type: Answer

http://stackoverflow.com/a/29016725
has body: scroll(X, Y) is already a defined javascript function, which is now replaced by the identical function scrollTo(X, Y), so using scroll() might not work always (as it is not working on jsfiddle). Instead you could write &lt;a onclick="window.scrollTo(0, 0)"&gt; to make it work. For hiding the span, you may use jQuery. Make sure to remove the visibility: hidden attribute also. $(document).ready(function() { // hide the span $('#scroll-to-top span').hide(); // bind the hover event (mouseenter) to show the span and // next hover event (mouseleave) to hide again $('#scroll-to-top').hover(function(){ $('#scroll-to-top span').show(); }, function() { $('#scroll-to-top span').hide(); }); });
accepted answer of: http://stackoverflow.com/q/29016076
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29016076
type: AcceptedAnswer

http://stackoverflow.com/comment/46084324
comment on: http://stackoverflow.com/q/28912937
has text: Hoe the page does it?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46165708
type: QuestionComment
score: 1
has text: how about you set up a jsfiddle to help us see what you are doing?
comment on: http://stackoverflow.com/q/28956293
type: Comment

http://stackoverflow.com/comment/46277396
comment on: http://stackoverflow.com/q/29016484
type: Comment
type: QuestionComment
score: 2
has text: HOLY PLUG-INS! Never seen so many in one project!

http://stackoverflow.com/comment/48493637
has text: Is ***52525525255252*** in the dataset `"serial[1][2]":["5225","11","33","52525525255252","200","1"]` a typo? It looks different in your original dataset vs the desired dataset. I'm wondering if this is a typo and that you only want the structure to change or if you want the structure to change and the data to be manipulated too?
score: 0
comment on: http://stackoverflow.com/q/29016944
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46082382
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28911825
score: 2
has text: You've created an array with 50 elements, but all of them are, so far, `undefined`.

http://stackoverflow.com/a/29009379
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29009310
score: 2
upvote count: 2
has body: your missing an ' in the selector :

http://stackoverflow.com/comment/46089411
type: QuestionComment
has text: If `$name` and `$x` are JavaScript variables, then you cannot access them within PHP (which is processed on the server-side, before the JavaScript is even transmitted to the client): therefore they are not defined when used in your SQL.
comment on: http://stackoverflow.com/q/28915565
score: 0
type: Comment

http://stackoverflow.com/q/28941823
type: Question
tagged with: c#
tagged with: asp.net-mvc
has title: Change the name of a local-storage collection
tagged with: javascript
has body: As per my new requirement I have to change the name of the local-storage collection name, which is by default set to its domain name. Is this possible? I have already searched it and didn't get anything. It is just to confirm that is this possible. Suppose I have a domain named : http://www.example.com then the local-storage will be created as http://www.example.com and its key value pair. I want to change this from "http://www.example.com" to "http://www.example.com_local". Please confirm me if it is possible anyhow. I am building an Umbraco website using MVC 4. Thanks in advance.
linked to: http://stackoverflow.com/q/20862054
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46139884
tagged with: jquery
has answer: http://stackoverflow.com/a/28958912
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46166548
tagged with: local-storage

http://stackoverflow.com/q/28927741
type: Question
has comment: http://stackoverflow.com/comment/46134683
tagged with: highcharts
tagged with: javascript
has title: I'm trying to getting image from Highchart
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
tagged with: php
has body: I'm trying to getting image from Highchart. Highchart provides download chart image function. A context button with a menu appears in the top right corner of the chart. (http://www.highcharts.com/stock/demo/candlestick-and-volume) I'd like to create chart image to designated folder in my server when I click button. How do I develop this using php?
answer count: 0
has comment: http://stackoverflow.com/comment/46111902

http://stackoverflow.com/q/28976254
has answer: http://stackoverflow.com/a/28976303
has answer: http://stackoverflow.com/a/28976357
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46203775
type: UnansweredQuestion
has title: Change text on parent div on hover?
has answer: http://stackoverflow.com/a/28976429
type: Question
tagged with: http://stackoverflow.com/tag/html
score: 1
favorite count: 0
has body: My idea is that i have something that looks like this in HTML &lt;h1&gt; A title &lt;/h1&gt; &lt;h2&gt; Under title &lt;h2&gt; &lt;ul&gt; &lt;li&gt; something &lt;/li&gt; &lt;li&gt; something else &lt;/li&gt; &lt;li&gt; something third &lt;/li&gt; I wish to do so that when i hover over "something" - there is a hover effect on that item itself, AND the text in "A Title" changes to something else like "This title" ?? and the same for the other list items. How would you go about this?? I have been searching for various hover states both in CSS and JS.. I am guessing now that it would have to be some kind of JavaScript.
upvote count: 1
tagged with: css
has comment: http://stackoverflow.com/comment/46203657
answer count: 3

http://stackoverflow.com/comment/46158306
has text: @MuhammadUmer Thank you very much. `^B.{7}` works with only the multiline flag, too.
comment on: http://stackoverflow.com/q/28951845
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/46352094
comment on: http://stackoverflow.com/a/29057587
type: AnswerComment
score: 0
type: Comment
has text: Can u please help me with that?

http://stackoverflow.com/comment/46213822
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28981069
has text: what "?" means in your query. actually i am not getting your code. can you please tell me meaning of your code.

http://stackoverflow.com/q/29001604
type: Question
has comment: http://stackoverflow.com/comment/46250883
possible better answer: http://stackoverflow.com/a/29001669
has comment: http://stackoverflow.com/comment/46250871
tagged with: tabulous
has comment: http://stackoverflow.com/comment/46250938
has title: Jquery code not working - seems really easy to fix - have fiddle
has comment: http://stackoverflow.com/comment/46250848
has comment: http://stackoverflow.com/comment/46250898
has comment: http://stackoverflow.com/comment/46250895
has body: $('#tabs2').tabulous({ effect: 'slideLeft' }); $('#text1in').keyup(function () { var value = $(this).val(); $('#test1out').text(value); }).keyup(); $('#text2in').keyup(function () { var value = $(this).val(); $('#test2out').text(value); }).keyup(); Here is the new fiddle: New fiddle It doesn't show the tabs working. I CAN get this working not on jsfiddle. But hopefully you will see what I am trying to do. I have both the tabs script working and the display field script working. I just can't seem to put them together. As soon as I add the form fields into the tabs-1 div container, it doesn't work. However, it does work outside of the tabs-1 div. Any help would be appreciated. Thanks!
accepted answer: http://stackoverflow.com/a/29002318
answer count: 2
has comment: http://stackoverflow.com/comment/46251268
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/46250980
has comment: http://stackoverflow.com/comment/46251209
has comment: http://stackoverflow.com/comment/46250969
has comment: http://stackoverflow.com/comment/46250852
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29001669
has comment: http://stackoverflow.com/comment/46250878
has answer: http://stackoverflow.com/a/29002318
has comment: http://stackoverflow.com/comment/46251296
upvote count: 1
has comment: http://stackoverflow.com/comment/46250959

http://stackoverflow.com/comment/46226567
type: Comment
score: 2
comment on: http://stackoverflow.com/a/28989012
has text: Sure. The main point of the example is the `unique` property whether it lives inside a controller or component. ;)
type: AnswerComment

http://stackoverflow.com/comment/46376320
has text: Sure, this is what it looks like (JSON): `{ "Attr1": { "value": "Attr1", "text": "Attr1" }, "Attr2": { "value": "Attr2", "text": "Attr2" } }`
comment on: http://stackoverflow.com/a/28979939
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28930232
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46117129
tagged with: css
has comment: http://stackoverflow.com/comment/46117123
upvote count: 2
has comment: http://stackoverflow.com/comment/46116268
has comment: http://stackoverflow.com/comment/46116194
tagged with: node.js
has title: Given an url, how could a script find what resources are loaded?
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28930723
has comment: http://stackoverflow.com/comment/46116365
type: Question
accepted answer: http://stackoverflow.com/a/28930723
has comment: http://stackoverflow.com/comment/46116405
downvote count: 0
answer count: 1
has body: Given an url (e.g. localhost:8000), how can a script find what resources will a browser load (via HTTP requests)? For example, let's suppose that the / route responds with: Test some content The resources which will be loaded are: /css/style.css foo.png This is simple (just a dom iteration with via cheerio or so), but it's not so native I think it should. An iteration in the response HTML will not work for the additional CSS @imports and background-image and so on. What is the native way to get the list with the CSS, images and maybe other resources which are loaded by the browser? Maybe is it possible via jsdom?
linked to: http://stackoverflow.com/q/19786525
tagged with: javascript

http://stackoverflow.com/a/28996462
accepted answer of: http://stackoverflow.com/q/28992870
score: 0
answers question: http://stackoverflow.com/q/28992870
type: Answer
has body: Ok, based on the sliders you referred to at jssor.com, it seems like a slider should be much more efficient in most ways. If there are no animations except when the user is moving the slider, then there should be no CPU/GPU usage either (assuming the slider is implemented efficiently). A video playing in the background will always use some CPU/GPU. If it's a format that most GPUs can accelerate (MPEG-2 or H.264), the CPU usage may be very small, but you can't count on that. Of course most of those slider demos have animations going all the time. That will use CPU too. As far as loading/startup time, a few JPEG images will usually be much smaller than a video file. The slider should start up at least as fast as a video, and use a lot less bandwidth. As usual, the only final answer to "which is more efficient?" is "Try both and see."
type: AcceptedAnswer

http://stackoverflow.com/q/28942985
tagged with: cordova
type: Question
has body: I want to track a car on the road using the javascript Google map API. So that I used this function to change the car location: function getDrivingRoute(myLatlng, arrival) { var directionsDisplay = new google.maps.DirectionsRenderer(); map = new google.maps.Map(document.getElementById("googlemaps"), mapOptions); startMarker = new google.maps.Marker({ position : myLatlng, map : map, icon : '../images/taxii.png' }); var stopMarker = new google.maps.Marker({ position : arrival, map : map, icon : 'icon-1.png' }); directionsDisplay.setMap(map); directionsDisplay.setOptions({ suppressMarkers : true, polylineOptions : { strokeWeight : 3, strokeOpacity : 0.7, strokeColor : 'green' } }); request = { origin : myLatlng, destination : arrival, travelMode : google.maps.DirectionsTravelMode.DRIVING }; directionsService = new google.maps.DirectionsService(); directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); } }); var i = 0; // var addr1=new google.maps.LatLng('35.8416079','10.5983287'); var addr2 = new google.maps.LatLng('35.8423558', '10.5986720'); var addr3 = new google.maps.LatLng('35.8425124', '10.5992299'); var addr4 = new google.maps.LatLng('35.8423558', '10.5997664'); var addr5 = new google.maps.LatLng('35.8420775', '10.6006032'); var position_driver = [ addr2, addr3, addr4, addr5 ]; var myVar = setInterval( function() { myLatlng = position_driver[i]; if (myLatlng.lat() == arrival.lat() &amp;&amp; myLatlng.lng() == arrival.lng()) { changePosition(myLatlng.lat(), myLatlng.lng()); window.clearInterval(myVar); } else { startMarker.setPosition(new google.maps.LatLng(myLatlng.lat(), myLatlng.lng()); } i++; }, 8000); } The car marker change its position and get the right position on the map, but the route line doesn't change, I want to disappear the travelled distance or show it with another color and show the non travelled distance with different color. Is that possible? I tri…
has title: Draw a line over another line using google maps API
score: 0
tagged with: google-maps
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28948281

http://stackoverflow.com/comment/46150003
has text: @AndreiKap I misread your code a bit. Now it should work but as I edited in, n-dru's answer is probably the way to go.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28945123
type: Comment

http://stackoverflow.com/comment/46362106
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29062122
has text: I did, but nothing changed. I copied a snippet for a material box from the docs and placed it outside of ng-repeat and it worked.
score: 0

http://stackoverflow.com/a/29019420
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29019362
upvote count: 1
has body: These are Strings, and should be wrapped with quotes: var card = { 'visa' : '10a0', 'mastercard' : 'b200', 'discover' : '300', 'americanexpress' : '400', 'jcb' : '500' };
score: 1
answers question: http://stackoverflow.com/q/29019362

http://stackoverflow.com/comment/46320258
score: 0
comment on: http://stackoverflow.com/q/29039144
type: Comment
has text: Thanks, will try to do an alternate route.
type: QuestionComment

http://stackoverflow.com/a/28921342
type: Answer
answers question: http://stackoverflow.com/q/28921181
has comment: http://stackoverflow.com/comment/46105264
score: 4
has comment: http://stackoverflow.com/comment/46105398
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28921181
has comment: http://stackoverflow.com/comment/46100341
has body: You don't need to delay bootstrapping your app. You use $http service to request data. $http methods return promises. You can use the $q service's $q.all() method to wait until all the $http promises have resolved. Something similar to this: &lt;body ng-app="app"&gt; &lt;div ng-if="!Initialized"&gt; Overlay (waiting for data) &lt;/div&gt; &lt;div ng-if="Initialized"&gt; Application &lt;/div&gt; &lt;/body&gt; angular.module('app', []) .run(function($rootScope, $q, $http){ $rootScope.Initialized = false; $q.all({ firstRequest: $http.get('/someresource'), secondRequest: $http.get('/someotherresoruce'), thirdRequest: $http.get('/athirdresource') }).then(function(results) { $rootScope.resource1 = results.firstRequest; $rootScope.resource2 = results.secondRequest; $rootScope.resource3 = results.thirdRequest; $rootScope.Initialized = true; }); }); Note, this is to demonstrate how to wait for multiple $http requests concurrently and to change from a "loading" to a "ready" state. Using $rootScope is generally frowned upon as a way to share data across controllers.

http://stackoverflow.com/a/29070882
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29008083
type: AcceptedAnswer
score: 8
upvote count: 8
type: Answer
answers question: http://stackoverflow.com/q/29008083
has body: Javascript uses a binary floating point representation for numbers (IEEE754). This format is able to represent exactly (without approximation) only numbers that can be expressed in the form n/2m where both n and m are integers. Any number that is not a rational where the denominator is an integral power of two cannot be represented exactly because in binary it is a periodic number (it has infinite binary digits after the point). The number 0.5 (i.e. 1/2) is fine, (in binary is just 0.1₂) but for example 0.55 (i.e. 11/20) cannot be represented exactly (in binary it's 0.100011001100110011₂… i.e. 0.10(0011)₂ with the last part 0011₂ repeating infinite times). If you need to do any computation in which the result depends on exact decimal numbers you need to use an exact decimal representation. A simple solution if the number of decimals is fixed (e.g. 3) is to keep all values as integers by multiplying them by 1000... 2.555 --&gt; 2555 5.555 --&gt; 5555 3.7 --&gt; 3700 and adjusting your computation when doing multiplications and divisions accordingly (e.g. after multiplying two numbers you need to divide the result by 1000). The IEEE754 double-precision format is accurate with integers up to 9,007,199,254,740,992 and this is often enough for prices/values (where the rounding is most often an issue).

http://stackoverflow.com/comment/64806885
has text: What do you mean with "where jquery come from"? You mean, you have to install it via npm? And why does method 2 not work for you?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28989476

http://stackoverflow.com/comment/130568024
comment on: http://stackoverflow.com/a/35403145
has text: This really works, Viewing Frame source saves more time!
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46172328
comment on: http://stackoverflow.com/a/28959265
score: 0
has text: Have I answered your question? if yes, please accept it, Thanks! or if there's lacking just tell me..
type: Comment
type: AnswerComment

http://stackoverflow.com/q/29038320
tagged with: javascript
tagged with: multitasking
answer count: 1
downvote count: 0
favorite count: 0
has title: nodejs multiple worker web api
type: UnansweredQuestion
tagged with: web-services
tagged with: node.js
has answer: http://stackoverflow.com/a/29050970
score: 1
has body: I have seen the potential of NodeJS recently and try this for a small task to use . about the following: i want to create a web service , which allows you to start and stop multiple client instances (multiple nodejs tasks who should run, until i send a stop request to a instance): so a http server modul waits for start/stop requests (with params) (maybe with express?) like [start] http://taskservice/start?user=abc&amp;pass=123 the service should create a instance of a task like: var task = new MyTask(); task.login(user, pass); task.on("loginsuccess", function() { task.startwork(); }; [stop identified by user] http://taskservice/stop?user=abc The problem is, I do not know how this can be best implemented . It must always be able to create any number of tasks and the tasks must run until I say stop . (the tasks require very little performance) Does anyone have an idea or a small code example ?
upvote count: 1
type: Question

http://stackoverflow.com/comment/46258151
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29005991
has text: That is perfect and simple. Thanks a lot! :)
type: AnswerComment

arrow-functions
tag name: arrow-functions
type: Tag
tags question: http://stackoverflow.com/q/29030747

http://stackoverflow.com/comment/46107053
comment on: http://stackoverflow.com/q/28922246
type: QuestionComment
has text: If you have the data bound to each circle the typical pattern is d3.select("body").selectAll("circle").style("opacity", function(d) { ...//here comes your logic based on which you return a certain opacity...;})
score: 0
type: Comment

http://stackoverflow.com/comment/46106417
comment on: http://stackoverflow.com/a/28924866
type: Comment
score: 1
has text: The html 'title' attribute will show the text when you mouseover the element (In this case, the td element)
type: AnswerComment

http://stackoverflow.com/comment/46291672
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29024517
has text: That's one of the way, but I have to show out validation error to user instead of just showing them **Error**. So I can't comment it, or is that other possible way to do it?

http://stackoverflow.com/comment/46142015
has text: @Gezzamondo if you're asking where the for code goes, it's in your onPhotoLoaded function. Just change _len=_ref.length; to _len<10;
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28940750
type: Comment

http://stackoverflow.com/a/29000385
type: Answer
accepted answer of: http://stackoverflow.com/q/29000312
has comment: http://stackoverflow.com/comment/46249025
upvote count: 1
has comment: http://stackoverflow.com/comment/46248833
type: AcceptedAnswer
downvote count: 0
score: 1
has body: What you're looking for is commonly called a "polyfill". There are many polyfills available... usually several for each feature. You can find packages like Webshim which come with many out of the box: http://afarkas.github.io/webshim/demos/ Use http://caniuse.com/ to check for browser compatibility. It often links to polyfills in the comments section.
answers question: http://stackoverflow.com/q/29000312

http://stackoverflow.com/q/28913046
has comment: http://stackoverflow.com/comment/46084700
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46084750
has answer: http://stackoverflow.com/a/28913188
type: Question
has comment: http://stackoverflow.com/comment/46084495
answer count: 1
has comment: http://stackoverflow.com/comment/46084513
tagged with: javascript
has comment: http://stackoverflow.com/comment/46087001
has comment: http://stackoverflow.com/comment/46084543
tagged with: jquery
has comment: http://stackoverflow.com/comment/46084984
has title: Jquery execute mouse click after page redirect
has body: I have a blog category page to which I want to re direct from my one of my blog posts page and I want to simulate mouse click events which tells which category do they belong to i.e mouse click on the appropriate category in the blog page.I have achieved this on the blog page itself by means of jquery as follows, function categoryNav(){ window.onload() = function(){ $('#item-0').click(); $('#item-0-0').click(); }; } This works fine standalone on the page, but somehow I am not able to combine this with a href linking from my posts page i.e after a link click from the page this function is executed, in that case where the click always gets executed first before the redirect. I have tried window.onload,document.onload,document.ready but nothing seems to work correctly. What am I missing here?
has comment: http://stackoverflow.com/comment/46084595
score: 0
accepted answer: http://stackoverflow.com/a/28913188
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46084571
has comment: http://stackoverflow.com/comment/46084666

http://stackoverflow.com/q/28984012
has body: I want to make a menu closed and when I visite a URL the &lt;li&gt; should change his class to class="active" but at the beginning I want to that class stay without class="active". And I wonder which way is the best to do this Javascript or it can do it just with css.
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: menu
type: AnsweredQuestion
has title: HTML/CSS How to make a menu closed and then use class="active"
accepted answer: http://stackoverflow.com/a/28984575
has comment: http://stackoverflow.com/comment/46216955
upvote count: 1
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28984575
favorite count: 0

http://stackoverflow.com/q/28949124
favorite count: 0
type: Question
has body: I am in the process of completing a small portfolio 1 page scroller webpage. I have found a responsive template for a contact me / mail form. (the HTML/JS/PHP is displayed below). I have Plesk shared hosting with godaddy and from what I can see the mail form isn't functioning as it should. Does anyone please have any ideas or suggestions to how to makes this work. www.rockfizz.com (more specifically http://rockfizz.com/#contact) Is the webpage and the mail form is situated at the bottom. All THREE relevant files - contact_me.js index.html contact_me.php are in the root HTTPDOCS folder. The code HTML &lt;!-- Contact Section --&gt; &lt;section class="contact" id="contact"&gt; &lt;div class="container"&gt; &lt;div class="row"&gt; &lt;div class="col-lg-12 text-center"&gt; &lt;h2&gt;Contact me&lt;/h2&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="contact-form"&gt; &lt;div class="row"&gt; &lt;div class="col-lg-8 col-lg-offset-2"&gt; &lt;form name="sentMessage" id="contactForm" novalidate action="contact_me.php" method="post"&gt; &lt;div class="row control-group"&gt; &lt;div class="form-group col-xs-12 floating-label-form-group controls"&gt; &lt;label&gt;Name&lt;/label&gt; &lt;input type="text" class="form-control" placeholder="Name" id="name" required data-validation-required-message="Please enter your name."&gt; &lt;p class="help-block text-danger"&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="row control-group"&gt; &lt;div class="form-group col-xs-12 floating-label-form-group controls"&gt; &lt;label&gt;Email Address&lt;/label&gt; &lt;input type="email" class="form-control" placeholder="Email Address" id="email" required data-validation-required-message="Please enter your email address."&gt; &lt;p class="help-block text-danger"&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="row control-group"&gt; &lt;div class="form-group col-xs-12 floating-label-form-group controls"&gt; &lt;label&gt;Phone Number&lt;/label&gt; &lt;input type="tel" class="form-control" plac…
has comment: http://stackoverflow.com/comment/46171403
has comment: http://stackoverflow.com/comment/94959101
has comment: http://stackoverflow.com/comment/46240731
score: 1
upvote count: 1
tagged with: php
tagged with: sendmail
has comment: http://stackoverflow.com/comment/46153207
has comment: http://stackoverflow.com/comment/46186948
type: UnansweredQuestion
has title: PHP/JS Mail() Form not sending - Godaddy Plesk hosting
linked to: http://stackoverflow.com/q/19138093
answer count: 0
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46187233

http://stackoverflow.com/a/28912669
has comment: http://stackoverflow.com/comment/46085892
answers question: http://stackoverflow.com/q/28912302
has comment: http://stackoverflow.com/comment/46084198
has body: The reason why is that, is probably because the #message-status element is initially placed outside of the voting_wrapper element. You could move #message-status inside that wrapper, below the .voting_btn button using .insertAfter() $('#message-status').hide().html(dataModified).insertAfter('#'+unique_id+' .voting_btn').fadeIn('slow').delay(5000).hide(1); So that after AJAX call, your HTML becomes: &lt;div class="voting_wrapper" id="1001"&gt; &lt;div class="voting_btn"&gt; &lt;div class="up_button"&gt;&amp;nbsp;ddd&lt;/div&gt; &lt;span class="up_votes"&gt;X&lt;/span&gt; &lt;/div&gt; &lt;div id="message-status"&gt;X users has voting including you&lt;/div&gt; &lt;/div&gt; [EDIT] If you need the message below the whole voting_wrapper, use this: $('#message-status').hide().html(dataModified).insertAfter('#'+unique_id).fadeIn('slow').delay(5000).hide(1);
has comment: http://stackoverflow.com/comment/46085615
accepted answer of: http://stackoverflow.com/q/28912302
has comment: http://stackoverflow.com/comment/46085544
score: 0
has comment: http://stackoverflow.com/comment/46085492
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/29047727
has body: You can listen the change on your element, and get the price attribute like so: $('#pname.0').on('change', function(){ var price = $(this).find('option:selected').data('price'); }); PS: I'm not sure you can use "." in ID attribute.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29047607

http://stackoverflow.com/q/29048465
has comment: http://stackoverflow.com/comment/46336871
favorite count: 0
has comment: http://stackoverflow.com/comment/46336254
has comment: http://stackoverflow.com/comment/46342176
answer count: 0
type: UnansweredQuestion
has body: I am relatively new to both programming and developing chrome extensions. I am developing a chrome extension that will do this simple thing. On selecting a text, show a button on clicking which the text will be highlighted. (Somewhat like the pin button) When i revisit the page I can see what where the areas i highlighted. So currently I have a extension working which can save the bookmark to the database. This is the link from which i got this understanding http://markashleybell.com/building-a-simple-google-chrome-extension.html. If you want i can share the actual code also but it is going to crowd the question. I think I can make get the selected text to go in to the database if i use contextmenus. But this is what i intend to do is select the text A icon comes up (How do i trigger the jquery to add the button, which chrome api i need to use and in which file i should put the code) 3 On clicking the icon the text gets highlighted. (how should i change the DOM of the current page) I can do the part of extracting the text and sending it to the Database. The next problem i have no idea about what information I need to store in the database (Example do i need to store the start or end node) so that i can have the text highlighted when i return to the URl. How does a chrome extension start on its own to figure out what part of the page need to be highlighted. In case you have a sample code that will be great or just tell me what is the logic and chrome api's i need to use. I know the question is too broad but even if you have a few links that can help to understand this flow it will be great. The project i am working on it to create a far similar version of https://www.diigo.com/, with just the ability to store URL along with the highlighted notes.
upvote count: 1
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/46336231
has comment: http://stackoverflow.com/comment/46338424
has comment: http://stackoverflow.com/comment/46338462
score: 0
has comment: http://stackoverflow.com/comment/46335733
has comment: http://stackoverflow.com/comment/46342189
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46336651
has comment: http://stackoverflow.com/comment/46336521
tagged with: javascript
tagged with: jquery
has title: How to build a chrome extension to highlight text on a specific URl
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/46337559
linked to: http://stackoverflow.com/q/29052171
has comment: http://stackoverflow.com/comment/46338364

http://stackoverflow.com/a/33853572
answers question: http://stackoverflow.com/q/28970611
type: Answer
score: 0
has body: Answer is given in the comment. Yet writing it as an answer. Use angular ui accordion instead of multiple collapsible panels.

http://stackoverflow.com/comment/46247447
type: QuestionComment
type: Comment
score: 2
has text: An interesting part of ECMAScript is that it has no input or output mechanism, it must be provided by the host environment.
comment on: http://stackoverflow.com/q/28999738

http://stackoverflow.com/comment/46257184
comment on: http://stackoverflow.com/a/29005369
type: AnswerComment
score: 0
has text: So how would it be possible to get the the label field as well as the value field? Do you have any idea for this Sir? Thanks
type: Comment

http://stackoverflow.com/comment/46089492
has text: I am not very tempted in JS, but may be it's possible to change object's methods and structure outside initial definition? And then containing complete state in object seems reasonable.
type: AnswerComment
comment on: http://stackoverflow.com/a/28915569
score: 0
type: Comment

http://stackoverflow.com/comment/46134975
type: QuestionComment
comment on: http://stackoverflow.com/q/28937525
has text: @Bergi he's using the old `done` async syntax, but still it should be better to do use the new syntax.
score: 0
type: Comment

http://stackoverflow.com/comment/46275584
score: 1
has text: FYI: the second example will error. It needs to be `var classProp = true` or `this.classProp= true`.
comment on: http://stackoverflow.com/q/29015421
type: QuestionComment
type: Comment

razor
tags question: http://stackoverflow.com/q/28989959
tags question: http://stackoverflow.com/q/28961224
tags question: http://stackoverflow.com/q/28962229
tags question: http://stackoverflow.com/q/29011107
tags question: http://stackoverflow.com/q/28919772
type: Tag
tags question: http://stackoverflow.com/q/28930330
tag name: razor
tags question: http://stackoverflow.com/q/29016458
tags question: http://stackoverflow.com/q/29016484
tags question: http://stackoverflow.com/q/28962178

http://stackoverflow.com/comment/46327112
type: Comment
type: QuestionComment
score: 0
has text: `json` is just a filter. You've provided so little information I was wondering if the object even exists in the eye of the scope. Maybe `dishInfo` exists but not `dishInfo.id`. Anyways I'm taking shots in the dark because you aren't providing more code or a demo.
comment on: http://stackoverflow.com/q/29043162

http://stackoverflow.com/q/28934563
tagged with: objective-c
score: 1
has comment: http://stackoverflow.com/comment/50522664
tagged with: uiwebview
favorite count: 0
upvote count: 1
has body: I struggle to implement highlight feature in my iOS application, because text selection works poorly in UIWebView. It jumps, it flickers, it selects wrong part of article etc. All that misbehavior is attributed to "paragraph snapping". I have control over the HTML page displayed in my app. Thus I've converted all block elements to inline: p,h1,h2 { display: inline-block; } It helps a bit, but still my selection jumps to the very beginning of paragraph when it shouldn't. I've tried text selection in iBooks and it works very smoothly there. As far as I know, the iBooks app was built with UIWebView as well. Is there a way to disable 'paragraph snapping' in UIWebView or fix text selection somehow??
tagged with: selection
answer count: 0
downvote count: 0
tagged with: ios
has title: Issue with text selection in UIWebView
tagged with: javascript
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/46187004
type: QuestionComment
type: Comment
has text: Where's the php code that sends `no value`? Add the ajax code used to question also so it is readable
comment on: http://stackoverflow.com/q/28966830
score: 0

http://stackoverflow.com/comment/46241042
type: QuestionComment
has text: May be because I don't know which class to add if it's valid and may be because the $invalid state is only preserved when the tab is selected?
comment on: http://stackoverflow.com/q/28991995
score: 0
type: Comment

http://stackoverflow.com/a/29044217
has comment: http://stackoverflow.com/comment/46328286
upvote count: 1
has body: Here's the fiddle: http://jsfiddle.net/dnd4kepr/ There were two issues: The single/double left/right quotes (“&amp;”) (or fancy quotes) were throwing exceptions. You'll want to replace those bad boys with just your plain jane single/double quotes ("&amp;"). Once the fancy quotes were replaced, there was an exception thrown due to the regex. You'll want to escape the + character like this: searchTerms = searchTerms.replace(/\+/g, ' '); Once those two things were done, the script started working!
score: 1
has comment: http://stackoverflow.com/comment/46347615
answers question: http://stackoverflow.com/q/29043745
downvote count: 0
type: Answer

http://stackoverflow.com/a/29022598
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29022553
answers question: http://stackoverflow.com/q/29022553
has body: In JavaScript (and in many other programming languages), when you add two strings together, you get the concatenation of their values. Currently your program is treating the form inputs as strings, but you can use the built-in function parseInt to extract integers from Strings. Try the following: function getResult() { var result1 = parseInt(document.getElementById("number1").value); var result3 = parseInt(document.getElementById ("op1").value); var result2 = parseInt(document.getElementById("number2").value); calculate (result1,result3,result2); }

http://stackoverflow.com/comment/46191046
comment on: http://stackoverflow.com/a/28969138
score: 0
type: Comment
has text: @IsmaelMiguel Damn you and your non-frazzled logic. Amended!
type: AnswerComment

http://stackoverflow.com/comment/46126449
type: AnswerComment
comment on: http://stackoverflow.com/a/28935249
has text: Thank you for the outstanding explanation, jfriend00. It actually makes sense. So to have an array of objects is logical. I am also glad to hear that this example is not all that common. I have always struggled with arrays, so this is welcome news. Thanks again for all your help and for the great explanations!
type: Comment
score: 0

http://stackoverflow.com/a/30198721
type: Answer
accepted answer of: http://stackoverflow.com/q/28941172
answers question: http://stackoverflow.com/q/28941172
has body: I have never resolved this particular mystery. However, I was able to find a workaround, thanks to my applet design specification which doesn't require exposing any applet methods which need to be invoked to perform privileged operations. I have found that executing privileged operations inside the applet init() function will work. Only privileged operations executed by invoking from JavaScript seem to cause problems. Consider the following code. public class MyApplet extends JApplet { private IHelper pHelper = null; private MyReturnedInfo pInfo = null; public void init() { pHelper = (IHelper)Native.loadLibrary("Helper", IHelper.class); if (pHelper != null) { pInfo = pHelper.GetInfo(); } } public String GetInfoString() { if (pInfo != null) { // need to call toString to convert from native wide char to something JavaScript will be able to interpret return pInfo.MyInfoString.toString(); } return null; } } Upon loading this applet, calling document.myApplet.GetInfoString() from JavaScript (providing the applet has an ID "myApplet") will return the required information. Interestingly though, after signing the applet with a certificate issued by a trusted authority such as VeriSign, even this would not work in IE, while it would work properly in FF and Chrome. I have seen signed Java applets which work fine when called from JavaScript in IE, but I guess my applet is special because it requires all-permissions attribute in the manifest and IE probably doesn't like that. It's a guess. However, I have never found the real reason for that either, because I was able to resort to another workaround. :) If you are reading this answer then I bet you are interested in it as well. Java applets allow us to provide additional parameters which we are able to obtain by calling this.getParameter() from inside the init() function. Also, if we allow the applet to call JavaScript functions from our HTML document by using mayscript attribute, we can easily combine these two facts to provid…
downvote count: 0
score: 2
type: AcceptedAnswer
upvote count: 2

http://stackoverflow.com/q/29018272
has title: ContentEditable div disable editing inside child divs
tagged with: javascript
linked to: http://stackoverflow.com/q/14615551
has comment: http://stackoverflow.com/comment/46280721
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/6690752
has comment: http://stackoverflow.com/comment/46280680
favorite count: 0
answer count: 0
downvote count: 0
type: UnansweredQuestion
score: 2
has body: I am building a sipmle WYSIWYG editor for my website. Insite the possible contents it will generate, there is a youtube video which is wrapped by a div to make it responsive. My problem is, once I insert this sub-div inside the contentEditable div, sometimes the user will place the caret inside the child div, adding content to it, when that element that should be left untouched and further data should be added outside of it. Is there a way to prevent the caret from going inside the child div? Or any other possible solution to this problem? Here is the basic code: function insertVideo(element){ $(element).closest('.htmlbox').children('.htmlboxedit').focus(); embed = ' '; pasteHtmlAtCaret(embed); }; pasteHTMLatCaret() is found here: https://stackoverflow.com/a/6691294/2724978
has comment: http://stackoverflow.com/comment/46280618
has comment: http://stackoverflow.com/comment/46281052
tagged with: wysiwyg
type: Question
upvote count: 2

http://stackoverflow.com/comment/46111902
type: Comment
has text: Welcome! If you can, add some more tags so you get more people involved. For example: "javascript"?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28927741

http://stackoverflow.com/comment/46331165
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29046022
type: Comment
has text: What do you mean by target server? There's two servers involved here: the server with the Javascript on the page, and the IP Payments server that I'm trying to send values to.

http://stackoverflow.com/a/28915559
downvote count: 0
answers question: http://stackoverflow.com/q/28915508
has body: In C# and other statically typed langauges, the methods each class users are defined once and then each instantiation of that object refers only to the single definition. As such, there is no need for the same construct as the prototype in JS.
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/46209125
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28979210
has text: Open your browser web inspector. I'll see the error. Even though you have added the files, it still not finding the function jScrollPane(). If you comment out the jScrollPane, you will see that your switch button works properly

http://stackoverflow.com/q/29003615
has title: CSS basic Multipanel Graph layout D3.js
has answer: http://stackoverflow.com/a/29006247
tagged with: http://stackoverflow.com/tag/html
has body: Am trying to create a custom layout for multipanel-graphs in D3. The layout should be 3 columns wide, with the first 2 columns split to two rows. The end result should be 4 equally sized rectangles on the left with a single top-to bottom column on the right (right-side bar). I have tried doing so with the following code: &lt;!DOCTYPE html&gt; &lt;script type="text/javascript" src="d3.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var dataset; var quadheight = "289"; var quadwidth = "450"; var maincontainer = d3.select("body") .append("div") .attr("class","main-container") .attr("id","main-cont"); var ltq = maincontainer .append("svg") .attr("id", "left-top-quadrant") .attr("width", quadwidth) .attr("height", quadheight) .attr("class","quadrant"); var rtq = maincontainer .append("svg") .attr("id", "right-top-quadrant") .attr("width", quadwidth) .attr("height", quadheight) .attr("class","quadrant"); var menu = d3.select("body") .append("div") .attr("id","menu-div"); var lbq = maincontainer .append("svg") .attr("id", "left-bottom-quadrant") .attr("width", quadwidth) .attr("height", quadheight) .attr("class","quadrant"); var rbq = maincontainer .append("svg") .attr("id", "right-bottom-quadrant") .attr("width", quadwidth) .attr("height", quadheight) .attr("class","quadrant"); &lt;/script&gt; However I cannot get my head around how to place the side-bar (final column) on the right hand side. Any help would be greatly appreciated. As am inexperienced in front-end development I realize this may not be the best solution of achieving the same result, so any alternative better solutions would also be great, including plain CSS/HTML solutions (without dynamically constructing the layout in D3.js). Thanks in advance, Tumaini
favorite count: 0
score: 2
upvote count: 2
tagged with: d3.js
tagged with: css
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/90178
type: Question
accepted answer: http://stackoverflow.com/a/29006247
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/46338587
type: AnswerComment
comment on: http://stackoverflow.com/a/29045291
type: Comment
has text: @BtrCSowl let`s one step at a time, I saw more the one error in your jsfiddle, 1 - ngRoute need a externeal file https://code.angularjs.org/1.3.9/angular-route.js 2 - your firebase module is not found, by those two errors, it wont compile 3 - the constant name is numUser , but you are changing numberOfUsers, which is out of the angular scope
score: 0

http://stackoverflow.com/q/29037260
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/46315233
possible better answer: http://stackoverflow.com/a/29037580
has answer: http://stackoverflow.com/a/29037580
accepted answer: http://stackoverflow.com/a/29037550
has answer: http://stackoverflow.com/a/29037615
linked to: http://stackoverflow.com/q/13338484
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46315258
type: Question
has comment: http://stackoverflow.com/comment/46315407
has answer: http://stackoverflow.com/a/29037550
has title: Javascript sequential execution after trigger
has comment: http://stackoverflow.com/comment/46315516
has comment: http://stackoverflow.com/comment/46315623
has comment: http://stackoverflow.com/comment/46315424
has comment: http://stackoverflow.com/comment/46315272
has body: I'm having trouble with the way javascript execute the code (async) I have this small piece of code that will trigger events and check the value of 'valid'. My problem is that 'valid' is always true when entering the if statement because the events have not finished processing yet : valid = true; $(this).find('input').trigger('blur'); //valid will be modified in the triggered events if(valid){ //Do something } So I'd like to wait till the events are finished to enter the statement, but trigger doesn't take a callback I have seen some questions about this already solved but I didn't understand them and how to implement them. What should I use to solve this ?
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28978600
answers question: http://stackoverflow.com/q/28978300
has body: You can add one more loop inside the for loop as, for (i = 1; i < 12; i++) { for ( min = 0; min < 3; min++ ) { var am = ' ' + i + ':' + min * 15 + 'AM '; $('#time').append(am); } } In the inner loop you are basically printing the time in minutes as 0, 15, 30 and 45. If you want to print it as '00' for hour, then you can format the number min*15 to a two digit value and use it.
score: 0
type: Answer

http://stackoverflow.com/comment/46221589
type: Comment
comment on: http://stackoverflow.com/a/28986547
has text: Thank you very much. [Here's an updated jsfiddle](http://jsfiddle.net/8g9L5e3q/3/) showing the working result, for anyone else coming across this.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46243060
has text: @Saeed You are right, the mistake was in days count and date format. updated fiddle
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28995946
type: Comment

http://stackoverflow.com/a/34296218
has body: You can initially set the paper to be the same dimensions as it's containing element, but that's only calculated initially when the paper is created. If you want to paper to change size as you resize your browser, you'll need to react to resize events. Firstly, you'll need to set overflow to hidden on your container, otherwise its dimensions will stretch to fit its child, and it won't shrink if you shrink the browser. #modelCanvas { overflow: hidden; } You'll have to make sure your #modelCanvaselement will stretch to fill available space by some method, either setting height: 100% (in situations where that will work) or using flexbox or absolute positioning. Secondly, you'll need a resize event handler $(window).resize(function() { var canvas = $('#modelCanvas'); paper.setDimensions(canvas.width(), canvas.height()); });
has comment: http://stackoverflow.com/comment/68795154
upvote count: 7
type: Answer
has comment: http://stackoverflow.com/comment/68795601
downvote count: 0
score: 7
answers question: http://stackoverflow.com/q/29029390

http://stackoverflow.com/q/28968108
has comment: http://stackoverflow.com/comment/46193258
type: Question
has comment: http://stackoverflow.com/comment/46255594
has comment: http://stackoverflow.com/comment/46225362
tagged with: httpclient
tagged with: javascript
tagged with: http-headers
has comment: http://stackoverflow.com/comment/46191219
has title: http response missing content length
has comment: http://stackoverflow.com/comment/46215267
has comment: http://stackoverflow.com/comment/46190751
type: UnansweredQuestion
has body: I'm new in web services. I have the following issue. If I make the following GET I don't receive the content-length in the response. I receive the result, but I need to know the content-length in the response. GET /api/xxxxxxxx/hourly/q/pws:ICATALUN7.json HTTP/1.1 Host: api.wunderground.com Accept: */* Content-Type: application/json; charset=UTF-8 But using the Accept-Encoding: gzip, deflate, sdch in the header, I receive the content-length. The only problem is that I receive the following format in the response result. HTTP/1.1 200 OK Server: Apache/2.2.15 (CentOS) Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true X-CreationTime: 0.116 Content-Encoding: gzip Last-Modified: Tue, 10 Mar 2015 15:35:33 GMT Content-Type: application/json; charset=UTF-8 Content-Length: 2446 Vary: Accept-Encoding Expires: Tue, 10 Mar 2015 15:35:34 GMT Cache-Control: max-age=0, no-cache Pragma: no-cache Date: Tue, 10 Mar 2015 15:35:34 GMT Connection: keep-alive Set-Cookie: DT=1426001733:24382:365-d10; path=/; expires=Fri, 01-Jan-2020 00:00:00 GMT; domain=.wunderground.com � ���n�6 ���)_g1I�sWd���!���b�%O��fE�}:ح̓D��D&amp;:Ԓ)K.�4ɟ�����h��:��`|3*�_�$ �h|3�p|U�ʂd��O_��%��ǋ,[�L&amp;���z��� �'q���,^M��4[�d�'��&lt;�z����G=��n�S�϶�7��5߂�֏ˋ������n��S��i��������?�����ϻ��'\T%��c 茯ʍ�������U��^?n�_�}i0ۿ| ��g! ��t\iT/&gt;�wM�~M��b�]~d�ϟ��'��Ë)ϰ+`��F���W+���٢,g" ��N�,+��n }��~���(?�l1��j���Y�. VW�-��*�]a~�ý��o�๸��!�� -.����(�/���G��X�_����D�i4o:Y�穦����_~����e�w�^�u������V~���*��,X���fD�e���ܶ9��WA���} �qU���8�2� �9&gt;`_~G~���=s�,n�r8�v͎w=�7��G�ؓ^o�m��CNf��Iy��&lt;|��z�e��/� ������fT��t��W�b���]����l���˗���̓�|&lt;���ܗ�V��D�ku��Kxp��*̿yu���K #��K�z~�������U�j���|ky�S,�e�pW���'�,�ǅ��l�[���x�{���U�$n9\#�,��q���z�\ u����.F��K���kE�n:G=� �:�b!lAj�P� se��U�*S�Q��T�������Ե����=fu��٨��G^�,6v�C�;���/���v$ÎY� c� ��b�[w��ˋ���k�~�Ҵ�Z`���Y��%�#�C^{��~�2�We� �:�,u��Q��R�i�ZQg���0u��&lt;��u�lֱ�w`����V�!�uHU��G&amp; ��n_Rkǩ�y����%�N�aG`g�7��zU�Π`g(����M@ȍ�ص��h���#v5]vݱ{�bYի0v����o�[)��C���\|p�B��u�bݮ…
answer count: 0
score: 0

http://stackoverflow.com/comment/46224140
type: QuestionComment
comment on: http://stackoverflow.com/q/28987754
has text: was about to answer but Andy got it,
score: 0
type: Comment

http://stackoverflow.com/a/29056918
has body: update to this code . DEMO $(document).ready(function(){ $('button[class^="x"').click(function(){ $(this).prev('li').toggle(1000);}); }); also your html is invalid so write proper HTML code so i can explain in more detail
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/29056895
has comment: http://stackoverflow.com/comment/46350940
downvote count: 0
score: 2

http://stackoverflow.com/comment/46269538
has text: @KenAdams The report is #19770992, unfortunately it's not public. I've added code above. The array is of Javascript objects, just like would be returned from `speechSynthesis.getVoices()`.
type: AnswerComment
comment on: http://stackoverflow.com/a/28993579
score: 0
type: Comment

http://stackoverflow.com/comment/46143490
type: QuestionComment
score: 0
has text: The value will not be undefined so the check makes no sense.
comment on: http://stackoverflow.com/q/28944254
type: Comment

http://stackoverflow.com/a/28979807
type: Answer
has body: You don't need to insert a node into the body in order to execute the JS. Instead you can just use eval command. You could do something like this jsVal = document.getElementById("textarea").value; document.getElementById("textarea2").value = eval(jsVal);
answers question: http://stackoverflow.com/q/28979417
has comment: http://stackoverflow.com/comment/46210216
score: 0

http://stackoverflow.com/comment/46089144
type: AnswerComment
has text: I think it's nicer to have it take a function and not a promise, effectively making it a disposer pattern.
score: 1
comment on: http://stackoverflow.com/a/28915249
type: Comment

printstacktrace
tags question: http://stackoverflow.com/q/29020120
type: Tag
tag name: printstacktrace

http://stackoverflow.com/q/29021606
tagged with: image
has answer: http://stackoverflow.com/a/29021867
has title: hide or delete image src=undefined
has body: I'm working with markers on google map and this is what happens I call this variable to the images and upload to the database and use a query to put two images into a single file (GROUP_CONCAT) var image = markers[i].getAttribute("image"); image = image.split(","); And here I show these pictures. var html = div id = "iw-container" + 'a Href="'+image[0]+'" data-lightbox="roadtrip" &lt;img src = "' + image [0] +" "width = 100" height = "100" / a '+ 'a Href="'+image[1]+'" data-lightbox="roadtrip" &lt;img src = "' + image [1] + '" width = 100 "height =" 100 " / a '+ 'a Href="'+image[2]+'" data-lightbox="roadtrip" &lt;img src = "' + image [2] + '" width = 100 "height =" 100 " / a '+ '/ Div'; The problem is if a marker is less than 3 images, for example a marker has 2 images, one of the images appear broken. obviously because not defined. () I wonder if there is any function or something to check if an image has the "SRC" undefined, remove it or hide it or do something to not appear. Any help is good, thanks :)
upvote count: 1
answer count: 1
tagged with: undefined
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46286756
downvote count: 0
has comment: http://stackoverflow.com/comment/46288628
score: 1
tagged with: src
has comment: http://stackoverflow.com/comment/46286773
type: Question
tagged with: javascript

http://stackoverflow.com/a/29002351
answers question: http://stackoverflow.com/q/29002186
downvote count: 0
has body: Some modifications to your code... function fizzBuzz(start, stop) { var i; var results = []; for (i = start; i &lt;= stop; i++) { if (i % 15 == 0) { results.push('Fizz Buzz'); } else if (i % 3 == 0) { results.push('Fizz'); } else if (i % 5 == 0) { results.push('Buzz'); } else { // cast to string just so all the results in the array are string results.push(i + ''); } } return results; } ANSWER = fizzBuzz(4, 22); // output: [ '4', 'Fizz', 'Buzz', '7', '8', ...etc ]
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/q/29032679
favorite count: 0
possible better answer: http://stackoverflow.com/a/29033443
has answer: http://stackoverflow.com/a/29033818
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46308266
tagged with: css
has comment: http://stackoverflow.com/comment/46308299
type: AnsweredQuestion
has body: I am trying to figure out a way to reverse the direction of an open &lt;details&gt; tag in HTML so that the summary is placed ABOVE instead of the default BELOW. Is it possible to do it with CSS only? CSS+Javascript? Here is a simple JSFiddle:
tagged with: google-chrome
type: Question
accepted answer: http://stackoverflow.com/a/29033818
has comment: http://stackoverflow.com/comment/46306528
upvote count: 5
tagged with: javascript
answer count: 2
score: 5
has answer: http://stackoverflow.com/a/29033443
has title: HTML details tag opening direction? How to change?
downvote count: 0

http://stackoverflow.com/a/28955850
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46165280
score: 4
has comment: http://stackoverflow.com/comment/46165384
has comment: http://stackoverflow.com/comment/46165156
type: Answer
accepted answer of: http://stackoverflow.com/q/28955823
answers question: http://stackoverflow.com/q/28955823
has body: $http.get() returns a promise. You can then call .then() on that promise. .then() returns yet another promise that you aren't actually using in your code. For example, you could do this: var p = $http.get('/someURL').then(function(response) { // do something }, function(error) { // do something on error }); // p is a promise p.then(function() { // more code here that runs after the previous code }); Or, you could do: $http.get('/someURL').then(function(response) { // do something }, function(error) { // do something on error }).then(function() { // more code here }); So, each .then() handler returns yet another promise so you can chain as many times as you want. One particularly useful feature is that if you return a promise from a .then() handler callback, then the promise that the .then() handler already returned will inherit that promise you return from the callback like this: $http.get('/someURL').then(function(response) { return $http.get('/someOtherURL'); }, function(error) { // do something on error }).then(function(secondResponse) { // will get here when both http.get operations are done });
has comment: http://stackoverflow.com/comment/46165187
has comment: http://stackoverflow.com/comment/46165300
upvote count: 4

http://stackoverflow.com/comment/46458334
has text: despite making the changes all suggested below, I've not been able to make any values save into localStorage at all. Can anyone suggest why with the code above one value is saved but not the other two?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29059638

http://stackoverflow.com/comment/46189214
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28966117
has text: They are both in the same domain and path however. I would have thought that would have been enough. Is this some kind of protection in modern browsers I am not aware of? I am looking at performing CSS so can't modify the code.

http://stackoverflow.com/q/29032498
has answer: http://stackoverflow.com/a/29032863
type: Question
has comment: http://stackoverflow.com/comment/46306565
has comment: http://stackoverflow.com/comment/46305853
has body: _doAction = [{ closepop: function(){ console.log( 'call' ); var parntid = $(this).attr('data-parentid'); $('#'+parntid).hide(); } }]; When i call the method. $(document).on('click', '.xyz', function(){ var action = $(this).attr('data-eventname'); _doAction[0][action].apply(this, args); // when use args getting error (args is undefined). Why? _doAction[0][action].apply(this, arguments); // when use arguments no error, working fine. }); Can someone help me out or explain me why this is happening..
tagged with: javascript
has answer: http://stackoverflow.com/a/29032581
tagged with: jquery
has title: Why arg is not defined?
has comment: http://stackoverflow.com/comment/46306188
has comment: http://stackoverflow.com/comment/46305964
answer count: 2
downvote count: 3
favorite count: 0
type: UnansweredQuestion
score: -3
upvote count: 0

meteor
tags question: http://stackoverflow.com/q/29016427
tags question: http://stackoverflow.com/q/28975438
tags question: http://stackoverflow.com/q/29018851
tags question: http://stackoverflow.com/q/28967351
tags question: http://stackoverflow.com/q/29056903
tags question: http://stackoverflow.com/q/29024029
tags question: http://stackoverflow.com/q/28964455
tags question: http://stackoverflow.com/q/28920958
tags question: http://stackoverflow.com/q/28929506
tags question: http://stackoverflow.com/q/28953172
tags question: http://stackoverflow.com/q/28945481
tags question: http://stackoverflow.com/q/28975086
tags question: http://stackoverflow.com/q/28989260
tags question: http://stackoverflow.com/q/29016328
tags question: http://stackoverflow.com/q/29023339
tags question: http://stackoverflow.com/q/28996727
tags question: http://stackoverflow.com/q/28913361
tags question: http://stackoverflow.com/q/28922148
tags question: http://stackoverflow.com/q/28959580
tags question: http://stackoverflow.com/q/28981615
tags question: http://stackoverflow.com/q/29022760
tags question: http://stackoverflow.com/q/28958942
tags question: http://stackoverflow.com/q/28970775
tags question: http://stackoverflow.com/q/29054679
tags question: http://stackoverflow.com/q/28925818
tags question: http://stackoverflow.com/q/29014494
tags question: http://stackoverflow.com/q/28932188
tags question: http://stackoverflow.com/q/28950627
tags question: http://stackoverflow.com/q/28963959
tags question: http://stackoverflow.com/q/29040779
tags question: http://stackoverflow.com/q/29022105
tags question: http://stackoverflow.com/q/29053979
tags question: http://stackoverflow.com/q/29060637
tags question: http://stackoverflow.com/q/28960818
type: Tag
tags question: http://stackoverflow.com/q/29057702
tags question: http://stackoverflow.com/q/28969223
tags question: http://stackoverflow.com/q/28942871
tags question: http://stackoverflow.com/q/28991943
tags question: http://stackoverflow.com/q/28908001
tags question: http://stackoverflow.com/q/28952389
tags question: http://stackoverflow.com/q/29024028
tags question: http://stackoverflow.com/q/28935468
tags question: http://stackoverflow.com/q/29017452
tags question: http://stackoverflow.com/q/28981941
tags question: http://stackoverflow.com/q/28978168
tags question: http://stackoverflow.com/q/28970570
tags question: http://stackoverflow.com/q/28932714
tags question: http://stackoverflow.com/q/28966697
tags question: http://stackoverflow.com/q/29056552
tags question: http://stackoverflow.com/q/28930265
tags question: http://stackoverflow.com/q/28922744
tags question: http://stackoverflow.com/q/29000189
tags question: http://stackoverflow.com/q/28933369
tags question: http://stackoverflow.com/q/29015201
tags question: http://stackoverflow.com/q/28938099
tags question: http://stackoverflow.com/q/28956324
tags question: http://stackoverflow.com/q/28943620
tags question: http://stackoverflow.com/q/29026259
tags question: http://stackoverflow.com/q/29024987
tag name: meteor
tags question: http://stackoverflow.com/q/28976613
tags question: http://stackoverflow.com/q/29022961
tags question: http://stackoverflow.com/q/28923787
tags question: http://stackoverflow.com/q/28975857
tags question: http://stackoverflow.com/q/28928917
tags question: http://stackoverflow.com/q/29058823
tags question: http://stackoverflow.com/q/28975589
tags question: http://stackoverflow.com/q/28915627
tags question: http://stackoverflow.com/q/28933638

http://stackoverflow.com/q/29055501
tagged with: css
tagged with: css-shapes
has answer: http://stackoverflow.com/a/29059464
has title: Active Page Triangle Marker in CSS
has answer: http://stackoverflow.com/a/29055915
type: Question
has answer: http://stackoverflow.com/a/29055835
score: -2
tagged with: javascript
answer count: 3
downvote count: 3
upvote count: 1
favorite count: 0
has body: I'm looking to create an active page marker like the one pictured. The title probably doesn't do a great job of describing what I'm trying to do here. What I'm looking for is a border that has an curved triangle active page marker using CSS.
type: UnansweredQuestion

http://stackoverflow.com/comment/46328888
comment on: http://stackoverflow.com/a/29044614
score: 0
type: AnswerComment
has text: I was going to make a really long-winded explanation on recursion, but honestly your answer does the job just fine. +1
type: Comment

http://stackoverflow.com/a/28927027
score: 4
has body: You have error in your selector , it should look like this: $('.notification-expand.Request.active-item .accept-button').click(function () { alert("hello"); });
type: AcceptedAnswer
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28926958
answers question: http://stackoverflow.com/q/28926958
downvote count: 0
has comment: http://stackoverflow.com/comment/46110087

http://stackoverflow.com/q/28979255
answer count: 0
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46218160
has title: d3.js force layout drag and maintain the positions in the Localstorage
has comment: http://stackoverflow.com/comment/46219277
has body: As i want to maintain the drag positions in the local storage. So when i refresh the page i can retain the position in the force layout in d3.js Can any one please give me an idea on this. Thanks in advance
has comment: http://stackoverflow.com/comment/46266086
has comment: http://stackoverflow.com/comment/46217612
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46217792
has comment: http://stackoverflow.com/comment/46218132
score: 0
has comment: http://stackoverflow.com/comment/46219007
has comment: http://stackoverflow.com/comment/46216633

http://stackoverflow.com/q/28940199
accepted answer: http://stackoverflow.com/a/28942572
type: AnsweredQuestion
has title: Radio Button if on click
tagged with: if-statement
tagged with: forms
type: Question
tagged with: radio-button
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28942572
has body: i want add if / else if in radio button when click if i click checked Radio Value "Radio 1" i can click radio value "Radio Sub 1" or "Radio Sub 2" and Disable text box "more" if i click checked Radio Value "Radio 2" disable text box "more" and disable radio value "Radio Sub 1" or "Radio Sub 2" (Sub Radio) if i click checked Radio Value "Radio 3" i can type in text box "more" and disable radio value "Radio Sub 1" or "Radio Sub 2" (Sub Radio) else i don't checked radio must disable text box "more" and disable radio value "Radio Sub 1" or "Radio Sub 2" (Sub Radio) This is my code &lt;input type="radio" name="myradio" value="Radio 1" &gt; &lt;label&gt;Radio 1&lt;/label&gt; &amp;nbsp; &amp;nbsp; &lt;input type="radio" name="mysubradio" value="Radio Sub 1" &gt; &lt;label&gt;Radio Sub 1&lt;/label&gt; &amp;nbsp; &amp;nbsp; &lt;input type="radio" name="mysubradio" value="Radio Sub 2" &gt; &lt;label&gt;Radio Sub 2&lt;/label&gt; &amp;nbsp; &amp;nbsp; &lt;br/&gt;&lt;br/&gt; &lt;input type="radio" name="myradio" value="Radio 2" &gt; &lt;label&gt;Radio 2&lt;/label&gt; &lt;br/&gt;&lt;br/&gt; &lt;input type="radio" name="myradio" value="Radio 3" &gt; &lt;label&gt;Radio 3&lt;/label&gt; &lt;input name="more" placeholder="more" maxlength="50" type="text" &gt; You can test code in here Js Fiddle Help me, Thank's :)
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46135366
has comment: http://stackoverflow.com/comment/46135298

http://stackoverflow.com/comment/46237295
has text: That works. Thanks! Hopefully this will help others as well. I appreciate your help. Editing to reflect the changes now. Woohoo!
comment on: http://stackoverflow.com/a/28993735
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46188351
type: QuestionComment
comment on: http://stackoverflow.com/q/28968379
has text: what do you expect `length` to come from?
score: 0
type: Comment

http://stackoverflow.com/a/28940184
score: 2
has comment: http://stackoverflow.com/comment/46167959
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/46135621
upvote count: 2
answers question: http://stackoverflow.com/q/28939107
has comment: http://stackoverflow.com/comment/46141841
has body: I had a similar issue two year ago and, here is how I solved it: var localtime = new Date(new Date(listed).getTime() - (new Date().getTimezoneOffset() * 60000)); var then = moment(localtime).unix(); EDITS: Tried this var localDate = new Date(new Date('2015-03-09T13:56:41').getTime() - (new Date().getTimezoneOffset() * 60000)); var then = moment(localDate).unix(); document.getElementById("demo").innerHTML = "Made it : &lt;span data-livestamp='" + then + "'&gt;&lt;/span&gt;" ; //Results: "Made it : 5 minutes ago" as I'm in a +1 timezone
has comment: http://stackoverflow.com/comment/46168134

youtube
tags question: http://stackoverflow.com/q/28960176
tags question: http://stackoverflow.com/q/29016718
tags question: http://stackoverflow.com/q/28977484
tags question: http://stackoverflow.com/q/29019674
type: Tag
tags question: http://stackoverflow.com/q/28931081
tags question: http://stackoverflow.com/q/28930727
tag name: youtube
tags question: http://stackoverflow.com/q/28948327
tags question: http://stackoverflow.com/q/29005349
tags question: http://stackoverflow.com/q/29051145
tags question: http://stackoverflow.com/q/28923502
tags question: http://stackoverflow.com/q/29038524
tags question: http://stackoverflow.com/q/29007269
tags question: http://stackoverflow.com/q/28933887

http://stackoverflow.com/q/28907024
has answer: http://stackoverflow.com/a/29674634
type: Question
tagged with: javascript
tagged with: jquery
tagged with: jsplumb
score: 0
has body: I'm trying to use jsPlumb, version 1.4.1 with the jquery dependency, to bind some divs in my UI together. My initial code: jsPlumb.bind("ready", function() { var eclipse = jsPlumb.addEndpoint("java-eclipse"); var netbeans = jsPlumb.addEndpoint("java-netbeans"); jsPlumb.connect({ source:eclipse, target:netbeans, connector:"Straight", paintStyle:{ lineWidth:5, strokeStyle:'rgba(0, 0, 200, 0.5)' }, endpoint:"Dot", anchor:[ "Perimeter", { shape:"Circle" }] }); }); Which works as intended, but as soon as I try to add more end points to make another connection: //Innitial working endpoints var eclipse = jsPlumb.addEndpoint("java-eclipse"); var netbeans = jsPlumb.addEndpoint("java-netbeans"); //Just adding these endpoints causes my script to crash var javaSE = jsPlumb.addEndpoint("java-se"); var javaSW = jsPlumb.addEndpoint("java-sw"); This gets me the following error: Error: H is undefined r@https://cdnjs.cloudflare.com/ajax/libs/jsPlumb/1.4.1/jquery.jsPlumb-1.4.1-all-min.js:1:9455 I have no idea why the second set of endpoints I create causes the whole thing to crash, the divs exist and have the right ids and looking at the js plumb demos and docs making two separate connections (se->sw and eclipse->netbeans) should be possible.
answer count: 1
type: UnansweredQuestion
has title: jsPlumb unnable to connect mutiple points

http://stackoverflow.com/q/29050197
has answer: http://stackoverflow.com/a/29376701
type: UnansweredQuestion
has body: Is there a way to track adsense income for each page. I have a website where more users (1000+) manage there own page and I like to give them there share. Can't find on adsense pay per page stats or export something usefull for this. Somebody any suggestions ?
tagged with: adsense
tagged with: php
has title: track adsense for eache page
type: Question
answer count: 1
tagged with: javascript
tagged with: statistics
score: 0

http://stackoverflow.com/q/28997502
downvote count: 0
type: Question
has body: When using Q.allSettled, I can't use Q.fail to get the error. If i have promises which contains a promise that is eventually rejected, this code never gets in the .fail block Q.allSettled(promises) .then(function () { // Handle success }) .fail(function (err) { console.log('IN ERRR', err); }); }); The documentation for .allSettled has this as the example: Q.allSettled(promises) .then(function (results) { results.forEach(function (result) { if (result.state === "fulfilled") { var value = result.value; } else { var reason = result.reason; } }); }); Is this expected behavior for the .allSettled function to not get inside a .fail block?
upvote count: 2
has title: Q.fail not working when using Q.allSettled
answer count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
favorite count: 0
has answer: http://stackoverflow.com/a/28997707
accepted answer: http://stackoverflow.com/a/28997707
tagged with: node.js
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/46350424
type: QuestionComment
comment on: http://stackoverflow.com/q/29056673
has text: What are you trying to do? Post a complete code example please.
score: 0
type: Comment

http://stackoverflow.com/comment/46236413
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28976051
has text: @Andrus: Chrome is my main web browser and I can't see any problem **if zoom is 100% or 200%**. If one use other zoom then there are small hovering effects on standard navigator buttons. The effects exist in all versions of jqGrid. New toggle button have absolutely the same behavior in my tests. I don't changed *the whole structure* of navigator buttons in free jqGrid to have more backwards compatibility with 4.6/4.7. So I don't see any simple way to eliminate all hovering effects of buttons in case of zoom not equal 100% or 200%.
type: AnswerComment

http://stackoverflow.com/comment/46264740
type: QuestionComment
comment on: http://stackoverflow.com/q/29009611
type: Comment
has text: yeah, it is just a typo, i renamed real names
score: 0

http://stackoverflow.com/comment/46125918
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28935005
has text: I closed the row. My question is how do I populate the table.

http://stackoverflow.com/a/29010100
downvote count: 1
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/29010069
has comment: http://stackoverflow.com/comment/46285248
has comment: http://stackoverflow.com/comment/46286163
has comment: http://stackoverflow.com/comment/46266104
has comment: http://stackoverflow.com/comment/46266007
has body: Short and simple: this.save = function() { self.methodA().then( self.methodB ).then( self.methodC ) } It has bothered me all **&amp;^*$&amp; day that @meagar was right and I was wrong on this one but I was sure that I was right. His answer seemed too complicated and but I was fuzzy headed in the morning and my answer wasn't right either. This is the right answer and it works perfectly when you plug it into the JSFiddle.
score: 3

http://stackoverflow.com/comment/46093543
type: AnswerComment
has text: Some of the javascript is pretty heavy and very page-specific. Hence the reason that I decided to break it all up. Your anser makes sense, is there a way to get some of the turbo-links benefits without combining all of the javascript?
comment on: http://stackoverflow.com/a/28917956
score: 0
type: Comment

http://stackoverflow.com/comment/46240889
comment on: http://stackoverflow.com/q/28996128
score: 0
type: Comment
type: QuestionComment
has text: Could this problem be something to do with needing to supply gulp with hints as to the manner of task termination?

http://stackoverflow.com/q/29046515
has comment: http://stackoverflow.com/comment/46331942
tagged with: javascript
has comment: http://stackoverflow.com/comment/46331824
score: 0
answer count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29046567
tagged with: http://stackoverflow.com/tag/html
has title: How to use if condition in document.getelementbyname in javascript
has answer: http://stackoverflow.com/a/29046628
has body: Here I am facing problem in if condition it validates for subject and not validate for medium field. Here checkbox is coming from mysql. But it gives source like this only. Here Know the problem is with if conditional only how to overcome this?can any figure out what is the problem in my code?what I have to do here.I hope everyone understand the question.I don't understand why the second if conditional statement is not working. function check() { //alert('done') var chk = document.getElementsByName('subject[]'); var reg = document.getElementsByName('regional[]'); var len = chk.length; var regl = reg.length; //alert(len); if (len) { for (i = 0; i &lt; len; i++) { if (chk[i].checked) { return true; } else { alert('please select the subject'); return false; } } } if (regl) { for (i = 0; i &lt; regl; i++) { if (reg[i].checked) { return true; } else { alert('please select the regional'); return false; } } } } &lt;form name="f1" action="" method="post"&gt; Subject &lt;input type='checkbox' name='subject[]' value='science'&gt;science&lt;br/&gt; &lt;input type='checkbox' name='subject[]' value='maths'&gt;maths&lt;br/&gt; Medium &lt;input type='checkbox' name='regional[]' value='Hindi'&gt;Hindi&lt;br/&gt; &lt;input type='checkbox' name='regional[]' value='english'&gt;english&lt;br/&gt; &lt;input type="submit" name="land" class="butt" value="SUBMIT" onClick="return check();"&gt; &lt;/form&gt;
type: Question

http://stackoverflow.com/comment/46159292
comment on: http://stackoverflow.com/a/28952381
score: 0
type: AnswerComment
has text: Make sure all is working as intended, if so and this post answers your question please make sure you mark your question as answered. This will help others who face the same problem find answers much easier.
type: Comment

http://stackoverflow.com/comment/46723810
type: Comment
score: 0
has text: Try setting up a local web server and see if you have the same issue.
type: AnswerComment
comment on: http://stackoverflow.com/a/28976037

http://stackoverflow.com/comment/46147816
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28946617
has text: @dandavis no it doesn't. no stack trace. just plain "An error occurred".
score: 0

http://stackoverflow.com/comment/46097224
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28919446
has text: Integers are automatically parsed into a string value when necessary in Javascript, C#, and VB.NET; `i.ToString()` is unnecessary. Other than that, you need to add `;` to the end of your function, other wise you will get something like this rendered on your page: `myFunction('1')myFunction('2')myFunction('3')myFunction('4')`
score: 0

cors
type: Tag
tag name: cors
tags question: http://stackoverflow.com/q/28990565
tags question: http://stackoverflow.com/q/28946179
tags question: http://stackoverflow.com/q/28919732
tags question: http://stackoverflow.com/q/29007652

http://stackoverflow.com/comment/46151536
type: AnswerComment
has text: Many thanks! I just picked up Scott Murray's O'Reilly book over the weekend, and super impressed how amazing D3 is. Slick animations by just adding .transition() - my jaw dropped to the floor. I spent another two hours or so after the post and managed to get it to work in a hack-y way, though naturally would love to use yours. http://jsfiddle.net/savarin/nssoy26r/ Very much appreciate the help and the example on enter, update and exit - super insightful. Will implement in new examples as soon as sort out my current problem - have two bar charts but tooltips refer to only the first chart :).
type: Comment
comment on: http://stackoverflow.com/a/28947261
score: 0

http://stackoverflow.com/comment/46081705
score: 1
type: Comment
type: QuestionComment
has text: use contenteditable for the div and achieve the same result :)
comment on: http://stackoverflow.com/q/28911256

http://stackoverflow.com/comment/46104005
type: Comment
comment on: http://stackoverflow.com/a/28923664
type: AnswerComment
has text: I just tried `this.innerText` but I get the whole array that populates the list, not the single list item.
score: 0

http://stackoverflow.com/comment/46114922
comment on: http://stackoverflow.com/q/28928805
score: 0
type: Comment
type: QuestionComment
has text: @JLRishe you can refer to _dropOver event in the javascript snapshot

http://stackoverflow.com/q/28949911
has body: Can someone, please, explain this type of format in javascript T00:00:00.000Z And how to parse it?
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46153668
favorite count: 0
has answer: http://stackoverflow.com/a/58712362
answer count: 7
has answer: http://stackoverflow.com/a/28950138
has comment: http://stackoverflow.com/comment/121182979
has title: What does this format mean T00:00:00.000Z?
upvote count: 172
has comment: http://stackoverflow.com/comment/46154740
tagged with: time
tagged with: timezone
tagged with: timestamp
has answer: http://stackoverflow.com/a/73805191
type: AnsweredQuestion
tagged with: format
has answer: http://stackoverflow.com/a/76004518
accepted answer: http://stackoverflow.com/a/28950138
possible better answer: http://stackoverflow.com/a/28950440
has answer: http://stackoverflow.com/a/28950440
type: Question
has answer: http://stackoverflow.com/a/59404931
score: 172
has answer: http://stackoverflow.com/a/69308124

http://stackoverflow.com/a/28920031
score: 0
has comment: http://stackoverflow.com/comment/46097845
answers question: http://stackoverflow.com/q/28919822
has body: With every call of $("#WAFTest").load(function () { alert("Test done"); }); you are binding a new Event-Listener to the load event of the iframe. You have to put the call outside of the function, so it is only called and binded once. Edit: To prevent a failure of the code, when the DOM is not ready when the code-snippet is called, you have to wrap it in the ready function of jQuery $(document).ready(function(){ $("#WAFTest").load(function () { alert("Test done"); }); })
type: Answer

http://stackoverflow.com/comment/46280680
comment on: http://stackoverflow.com/q/29018272
score: 4
type: Comment
type: QuestionComment
has text: "a simple WYSIWYG editor".

http://stackoverflow.com/q/28921181
has answer: http://stackoverflow.com/a/28921342
accepted answer: http://stackoverflow.com/a/28921342
tagged with: asynchronous
tagged with: initialization
tagged with: angularjs
upvote count: 2
has title: how to initialize application asynchronously in angular
has body: I am writing an angular app that will need some asynchronous code to run during the bootstrap phase. Let's say that this pahe includes collecting several AJAX call responses. As the resources are being requested, there is an overlay icon shown (waiting for data). After all of the requests are done, the application is ready to start working. The question is: how to do this correctly in angular? The things I've found in the web so far seem to be hacky, such as: http://xcellerant.net/2014/10/30/initializing-global-variables-and-synchronous-ajax-calls-in-an-angular-xpages-application/ - here the author uses jQuery to run $.ajax synchronously, which is 100% what I don't want to do, because of obvious reasons. https://blog.mariusschulz.com/2014/10/22/asynchronously-bootstrapping-angularjs-applications-with-server-side-data - here the author removes the ng-app from HTML to bootstrap the application manually. This is better then above, but still, quite hacky. I am looking for a convenient and clean solution. In backbone (or anything built on top of it), for example, you may simply run several ajax requests inside initialize method. Backbone relies on jQuery afterall - or something complaint - so just collect them all asynchronously using $.when(list-of-promises) and fire an event that will asynchronously bootstrap the whole app. This is purely modular. And there are no hacks.
score: 2
type: AnsweredQuestion
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: ajax

http://stackoverflow.com/q/28923785
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have a div that I'm resizing through simple css that resizes beautifully on chrome , firefox , and some other browsers however it doesn't seem to do anything on internet explorer. I have put my code below to have a look at it as I'm not sure what I'm missing. I'd prefer if possible to keep the solution within css but if I need to implement something else I am open to options and any help. Thank you.
has answer: http://stackoverflow.com/a/28924350
score: 2
type: AnsweredQuestion
type: Question
has title: Div Resize not working on Internet explorer
tagged with: javascript
upvote count: 2
answer count: 1
downvote count: 0
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28924350
favorite count: 0

http://stackoverflow.com/comment/46191135
type: QuestionComment
has text: Where are the second combobox ?
score: 0
comment on: http://stackoverflow.com/q/28966644
type: Comment

http://stackoverflow.com/comment/46118638
has text: Sure thing! let me know if you run into more trouble!
comment on: http://stackoverflow.com/a/28923501
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28997350
downvote count: 0
has comment: http://stackoverflow.com/comment/46243167
score: 1
tagged with: blogspot
type: Question
upvote count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46243254
has body: When I update the content using google blogger API, the contentString goes inside an li tag. &lt;li class="item" data-id="7225215730495036885"&gt; ContentString &lt;/li&gt; I need to auto refresh this li tag automatically every 30 seconds. Note : I don't want to refresh the entire webpage; Just the li tag. It's also sufficient for me to refresh a &lt;table&gt; tag which is part of my content string.
has title: Auto refreshing google blog content automatically every x seconds
favorite count: 0
has comment: http://stackoverflow.com/comment/46257070
has comment: http://stackoverflow.com/comment/46243347
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46245667
has comment: http://stackoverflow.com/comment/46243054

http://stackoverflow.com/comment/46202220
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28975549
has text: If you don't make the Element value required it isn't required then.

http://stackoverflow.com/a/28918374
downvote count: 0
answers question: http://stackoverflow.com/q/28918303
type: Answer
score: 1
has body: You could use /src="([^"]+)"/gm and then get first matching group for each match. For example: s = ' '; (/src="([^"]+)"/gm).exec(s)[1]; returns: /vendor/handlebars/handlebars.js
upvote count: 1

http://stackoverflow.com/comment/46197214
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28962835
has text: @AlexanderSolonik I added a little something at the bottom of my answer, which replicates what you are talking about.
type: AnswerComment

http://stackoverflow.com/a/28925414
answers question: http://stackoverflow.com/q/28925230
has comment: http://stackoverflow.com/comment/46110515
upvote count: 2
type: Answer
has body: Using a reducer with an accumulator, and recursion: var findLast = function(xs) { return xs.reduce(function(acc, x) { if (Array.isArray(x)) { var last = x[x.length-1] if (Array.isArray(last)) { return acc.concat(findLast(x)) } return acc.concat(last) } return acc },[]) } console.log(findLast(yourArray)) /*^ [ 'this is a paragraph', 'another paragraph', 'hr', 'This is a list', 'This is another list' ] */ Note that recursion isn't a necessity, since a recursive problem can always be solved using a loop, and a stack if necessary. Recursion is more elegant, but in JavaScript it would blow up the stack with many nested arrays (until browsers ship TCO) but a loop won't: var findLast = function(xs) { var out = [] for (var i = 0; i &lt; xs.length; i++) { var x = xs[i] if (Array.isArray(x)) { var last = x[x.length-1] if (Array.isArray(last)) { xs = x i = 0 } else { out.push(last) } } } return out } This solves the general problem you described, but if you want to exclude arrays with a single element you need to add one more condition: if (Array.isArray(x) &amp;&amp; x.length &gt; 1) { Demo: http://jsfiddle.net/e46wnbv3/
score: 2
accepted answer of: http://stackoverflow.com/q/28925230
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46110336
type: AnswerComment
has text: No worries, glad I was able to help! :)
type: Comment
comment on: http://stackoverflow.com/a/28926493
score: 0

http://stackoverflow.com/q/29048740
tagged with: src
type: Question
has comment: http://stackoverflow.com/comment/46335939
has answer: http://stackoverflow.com/a/29079744
tagged with: javascript
has title: How to know if php file is being called within a src="..."?
upvote count: 3
has answer: http://stackoverflow.com/a/29048768
answer count: 2
has comment: http://stackoverflow.com/comment/46335837
has body: In my website I have &lt;script src="js.php"&gt;&lt;/script&gt; Question is very simple but I have no idea of the answer: Within js.php, how can I check if the file has been called though a script src="..."? Purpose is to change the returned HTML code of js.php depending on how this php script file is called (direct access or script src="...").
favorite count: 0
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/46336071
score: 3
downvote count: 0

http://stackoverflow.com/a/28985739
has comment: http://stackoverflow.com/comment/46220628
has comment: http://stackoverflow.com/comment/46220264
has body: I find on change more accurate for this: https://jsfiddle.net/z46kox4u/ jQuery(document).ready(function ($) { 'use strict'; $('#visit_adults_number').on('change', function(){ alert('Adult age'); }); });
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28985651
type: Answer
answers question: http://stackoverflow.com/q/28985651
has comment: http://stackoverflow.com/comment/46220028
has comment: http://stackoverflow.com/comment/46220799
downvote count: 0
score: 1

http://stackoverflow.com/comment/46278430
type: AnswerComment
score: 0
has text: Probably not a big deal, but this solution relies on having ` `s directly inside other ` `s, which is not technically valid HTML.
type: Comment
comment on: http://stackoverflow.com/a/29016254

http://stackoverflow.com/comment/46156814
score: 0
type: Comment
type: QuestionComment
has text: The key to getting help is posting relevant source code. I see you have updated you post but this still doesn't have a form to submit and the existing javascript appears to have errors. `sncro` will be undefined and you have a script tag inside your javascript. When you say you want to **submit** do you mean you want to call the changeSncro() function?
comment on: http://stackoverflow.com/q/28950936

http://stackoverflow.com/a/28978205
score: 1
type: AcceptedAnswer
downvote count: 0
has body: You could use .is() if (check.is(this)) { ... }
has comment: http://stackoverflow.com/comment/46225184
accepted answer of: http://stackoverflow.com/q/28978179
type: Answer
answers question: http://stackoverflow.com/q/28978179
upvote count: 1

http://stackoverflow.com/comment/46241523
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28996610
has text: So where is the problem? Please write what's not working and where you're stuck. I can't see a question. You have to be clear in what you're looking for. Then someone can help you.

http://stackoverflow.com/q/28953795
has comment: http://stackoverflow.com/comment/46161635
tagged with: closures
has answer: http://stackoverflow.com/a/28953806
type: Question
answer count: 2
tagged with: for-loop
has body: Forgive me if this might be a bit of a noobie question, but this should work shouldn't it? var elems = [1,2,3,4,5] for (var i = 0; i &lt;elems.length; i++) { return (function(e){ console.log(e) })(i); } Meaning, it should spit out &gt;&gt;node file.js 1 2 3 4 5 For some reason this isn't doing this. Rather when it is run in terminal, it spits out &gt;&gt;node file.js 1 What am I missing? Could you please elaborate.
has title: For-loop saving state with closure
downvote count: 0
linked to: http://stackoverflow.com/q/28955047
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28953806
favorite count: 0
has comment: http://stackoverflow.com/comment/46176499
has answer: http://stackoverflow.com/a/28953872
upvote count: 6
possible better answer: http://stackoverflow.com/a/28953872
score: 6
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/q/28961867
has body: My project is setup with the brunch-with-chapling boilerplate with some additional libraries: Sinon Chai Mocha PapaParse StringView The problem I am having is when i am trying to fetch a model my fake server shows that i have successfully received and replied to a request that has been made. Jet the success nor error function is triggered. This is my code for fetching: Base (Shop) class: ### # Appends header to fetch request. ### getModel: (id, obj)-&gt; console.log "Requesting model #{@type} with id #{id}", 'model' obj.url = "#{@urlRoot()}/#{id}" @fetch obj ### # Fetches models. ### fetch: (options = {})=&gt; console.log options options.headers ?= {} options.headers.Authorization = Mediator.execute 'getAuth' options.headers.Accept = 'application/json;charset=utf-8' success = options.success options.success = -&gt; console.log 'test' success() options.error = -&gt; console.log 'error' super options View class initialize: (options = {})-&gt; shopId = Mediator.execute 'getActiveShop' if shopId is undefined setTimeout (=&gt;@initialize()), 50 return @shop = new Shop console.log @shop @shop.accountId = (Mediator.execute 'getAccount').get 'id' @shop.getModel shopId, { success: =&gt; console.log 'test' @render() error: ((a,b,c)=&gt; @publishEvent 'modelConnectionError', a,b,c) } super
tagged with: coffeescript
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46211010
score: 0
tagged with: backbone.js
tagged with: ajax
type: UnansweredQuestion
has title: Backbone fetch abruptly stopping without error or waring
tagged with: sinon
has comment: http://stackoverflow.com/comment/46209939
answer count: 0

http://stackoverflow.com/comment/46222515
type: QuestionComment
has text: I have js library for convert whole table data to json form.
type: Comment
comment on: http://stackoverflow.com/q/28986767
score: 0

http://stackoverflow.com/a/28976961
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46304524
type: Answer
accepted answer of: http://stackoverflow.com/q/28958823
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/46215877
has body: this works for me Bell Box Labels Camera Labels CCTV Signs Certificates & Job Books Extinguisher Labels Fascia Overlays Fire Exit Signage Panel Labels Serviced By Labels Warning Boards Window Stickers reset var lis = document.getElementById("products").getElementsByTagName('li'); for (var i=0; i<lis.length; i++) { lis[i].addEventListener('click', sampleChoice); } var count=0; function sampleChoice() { if(count<5) { document.getElementById("selection").innerHTML+= this.innerHTML; count++; }} function resetSelection() { count=0; document.getElementById("selection").innerHTML= ""; }
answers question: http://stackoverflow.com/q/28958823
has comment: http://stackoverflow.com/comment/46259217

http://stackoverflow.com/q/28957517
has body: I am getting the expected identifier, string or number error in IE-7. There is no trailing comma in the code // Merge defaults with options options = (options) ? options : {}; options = copyProperties({logging:true},options); var appId = options.appId || options.apiKey; if (/number|string/.test(typeof appId)) { Runtime.setClientID(appId.toString()); } The error occour after the 2nd line options = copyProperties({logging:true},options);
score: 0
has title: IE-7: expected identifier, string or number: no trailing comma
tagged with: jquery
has comment: http://stackoverflow.com/comment/46167957
has comment: http://stackoverflow.com/comment/46416640
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46167879
answer count: 0
tagged with: ie7.js
type: Question
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/46167994
tagged with: javascript

http://stackoverflow.com/comment/46130561
has text: I need to be able to change on the fly the state of the animating object, so preventing double clicks it's not really an option for my purpose. Cheers!
type: AnswerComment
comment on: http://stackoverflow.com/a/28932189
score: 0
type: Comment

http://stackoverflow.com/q/29028771
tagged with: javascript
has comment: http://stackoverflow.com/comment/46299286
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46299068
tagged with: jquery
type: UnansweredQuestion
has body: When i click first row it shows the output. When i click second, it is also showing, but the first row is not hided. It's still displaying. It should happen for all the rows, not only the first two. JavaScript code: $('#table_struct tr').click(function() { var $this = $(this); var offset = $this.offset(); var height = $this.height(); var order_id = $this.data('order_id'); $('.menu').remove(); $.get('getuser.php?order_id=' + order_id, function(table) { $('#showmenu').append(table); $('.menu').css({ right: offset.right, top: offset.top+height }); }); }); index.php include "db.php"; $query = "select * from orders_list"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); if($num_rows >= 1) { echo " "; echo " Select order_id customer_name no_of_pack price Weight payment mode "; while($row = mysql_fetch_array($result)) { $order_id = $row['order_id']; $_SESSION['order_id'] = $order_id; echo " ".$row['order_id']." ".$row['customer_name']." ".$row['number_of_pack']." ".$row['price']." ".$row['weight']." ".$row['payment']." "; echo " "; } echo " "; echo " "; } if(!mysql_close($con)) { echo "failed to close"; } getuser.php include "db.php"; $order_id = intval($_GET['order_id']); $query = "select * from orders_details where order_id=$order_id"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); if($num_rows >= 1) { echo " "; echo " Product Quantity Sku Price Total "; while($row = mysql_fetch_array($result)) { echo " ".$row['product']." ".$row['quantity']." ".$row['sku']." ".$row['price']." ".$row['total']." "; echo " "; } echo " "; echo " "; }
tagged with: php
has answer: http://stackoverflow.com/a/29030016
has answer: http://stackoverflow.com/a/29029754
type: Question
has comment: http://stackoverflow.com/comment/46299146
has title: How to hide the previous row in JavaScript?

modal-dialog
tag name: modal-dialog
tags question: http://stackoverflow.com/q/28989974
tags question: http://stackoverflow.com/q/29037807
tags question: http://stackoverflow.com/q/28927923
type: Tag
tags question: http://stackoverflow.com/q/29030212
tags question: http://stackoverflow.com/q/28937341
tags question: http://stackoverflow.com/q/28941305
tags question: http://stackoverflow.com/q/29027047
tags question: http://stackoverflow.com/q/28918618
tags question: http://stackoverflow.com/q/28907496

http://stackoverflow.com/comment/46259407
type: Comment
has text: That Google link seems promising, now I just need to figure out how to put that to use :-)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29006120

http://stackoverflow.com/q/29043463
has answer: http://stackoverflow.com/a/29279124
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29043694
tagged with: grunt-usemin
tagged with: javascript
tagged with: gruntjs
has body: My grunt usemin is not working for my javascripts that is on app/scripts only for scripts outside app folder, like bower. What I mean is, usemin is not uglify my app/scripts: Here is my GruntFile: http://pastebin.com/7jV9mipH Please someone could help me? SOLUTION I figure out how to resolve my problem: I just put the base path to my scripts folder at usemin comment block, like this: &lt;!-- build:js(app/) scripts/app.js --&gt; instead of: &lt;!-- build:js scripts/app.js --&gt;
has title: Grunt usemin not working with scripts inside app folder
upvote count: 1
tagged with: yeoman
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/23895397
downvote count: 0
score: 1

http://stackoverflow.com/q/29030696
type: AnsweredQuestion
has body: I want to reset i18next translations on my web app. I am currently trying this: // After user action: i18n.init({ lng: language }); $('body').i18n(); But its not working as i expected. Translations who are inyected using [prepend] or [append] are being duplicated. Descubre una nueva forma de enseñar.Irakasteko era berri bat aurkitu.Scopri una nuova forma di insegnare.Descubre una nueva forma de enseñar.Discover a new way of teaching.Descubre una nueva forma de enseñar.Irakasteko era berri bat aurkitu.Descubre una nueva forma de enseñar.
type: Question
has title: Reset i18next on user action
score: 0
answer count: 1
tagged with: i18next
has answer: http://stackoverflow.com/a/29208874
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29208874

http://stackoverflow.com/q/28954106
favorite count: 0
tagged with: ajax
type: Question
has answer: http://stackoverflow.com/a/28954219
upvote count: 2
answer count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/28954219
has title: Why does .length always return 0 in this code?
tagged with: javascript
has comment: http://stackoverflow.com/comment/46162009
type: AnsweredQuestion
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/46161838
has body: I am trying to check if a div exist or not for the purpose that someone might get the result or not. If the user get the result then class display_box will exist. So I am using .length to check the class display_box exist or not; however, I have test that it always return 0 no matter there was a class or not. I try to use ID. I tried to use $myDiv.html().length I tried .text(), .content(). I had tried .is(:empty) too. Is that because ajax, so basically, it will consider the class is not existed at all? ajax_search_load();//this is function to load my ajax var $myDiv = $('.display_box'); if ( $myDiv.length==0){ alert('fsdfa'); }

http://stackoverflow.com/a/29047948
type: Answer
accepted answer of: http://stackoverflow.com/q/29036949
answers question: http://stackoverflow.com/q/29036949
has body: Ended up using the bounding box method: var min = { x: size, y: size }; var max = { x: 0, y: 0 }; for(y = 0; y &lt; size; y++) { for(x = 0; x &lt; size; x++) { if(chunk[size * y + x]) { if(min.x &gt; x) min.x = x; if(min.y &gt; y) min.y = y; if(max.x &lt; x) max.x = x; if(max.y &lt; y) max.y = y; } } } var diff = { x: Math.floor((size / 2) - (min.x + (max.x - min.x) / 2)), y: Math.floor((size / 2) - (min.y + (max.y - min.y) / 2)) }; // move 1's accordingly
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/29034411
has comment: http://stackoverflow.com/comment/46311533
accepted answer of: http://stackoverflow.com/q/29033286
score: 2
has comment: http://stackoverflow.com/comment/46311263
upvote count: 2
type: AcceptedAnswer
type: Answer
has body: The reason why you are printing undefined undefined is because none of the images have been loaded at the time that you are doing your for loop. If you need to "process" (as you say) the results in the parent, then setting the value on the scope-exposed object may not be the best approach. How would you know that it's done loading, for example? How would you know that something has changed without an expensive deep $watch? The better approach, I think, is to expose an API that child directives could call. This is done by exposing a function on the parent's controller and using require: "^imageDirective" on the child's. .directive("imageDirective", function(){ return { // .. whatever you currently have controller: function($scope){ var toBeLoaded = 0; this.registerChild = function(childElem){ toBeLoaded++; }; this.childLoaded = function(childElem){ toBeLoaded--; // do whatever processing you need }; } } }) .directive("imageDirectiveItem", function(){ return { require: "^imageDirective", link: function(scope, element, attrs, imageDirectiveCtrl){ imageDirectiveCtrl.registerChild(element); element.bind("load", function(){ scope.$apply(function(){ imageDirectiveCtrl.childLoaded(element); }) }) } } }
downvote count: 0
answers question: http://stackoverflow.com/q/29033286

http://stackoverflow.com/q/28917824
tagged with: google-chrome
accepted answer: http://stackoverflow.com/a/28919385
has answer: http://stackoverflow.com/a/78902045
has body: I get an object from chrome.storage.local.get and then I want to update that object by using chrome.storage.local.set in the callback. If the callback is executed multiple times a race condition happens. What can I do to avoid this? I know it can be resolved by jQuery.defer, but is there any method to do an atomic update? Or any suggestions to improve my code? Below is a very simple example: chrome.tabs.onCreated.addListener(function(tab){//a lot of at the same time //just test chrome.storage.local.get(null, function(items) { if(!items.test){ items.test=[]; } items.test.push(something); chrome.storage.local.set(items,function(){}); console.log('a'+JSON.stringify(items)); }); });
has comment: http://stackoverflow.com/comment/46094160
possible better answer: http://stackoverflow.com/a/78902045
has comment: http://stackoverflow.com/comment/46095475
type: AnsweredQuestion
downvote count: 0
has title: chrome extension chrome.storage how to do a lot of get and set the same time and avoid race condition?
has comment: http://stackoverflow.com/comment/46095820
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28919385
type: Question
score: 3
tagged with: google-chrome-extension
upvote count: 3
answer count: 2

http://stackoverflow.com/q/29056582
tagged with: javascript
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29056714
has body: http://tree-leaves.comuf.com/ In this website, I want to fix the leaves position just over the branchs of the tree in spite of resizing the window. For this, I used percentage in the CSS positioning, but when I resize the window, I can see that the leaves aren't perfectly aligned with the branchs. How can I do to position the leaves with more precision, knowing that the tree and the leaves change their dimensions when we resize the window ? HTML code : &lt;pre&gt; &lt;div id="leaves"&gt; &lt;img src="images/leaf1.svg" id="l_1"&gt; &lt;img src="images/leaf1.svg" id="l_2"&gt; &lt;img src="images/leaf1.svg" id="l_3"&gt; &lt;/div&gt; &lt;div id="content"&gt; &lt;img src="images/tree.svg" id="tree"&gt; &lt;/div&gt; &lt;/pre&gt; CSS code : #content { float: left; width: 100%; text-align: center; background: linear-gradient(to bottom, transparent 0%,transparent 85%,#893700 85%,#893700 100%); } #tree { width: 80%; left: 10%; z-index: 10; } #leaves { background-color: red; } #leaves img { width: 5%; } #l_1 { margin: 0; margin-bottom: -4%; margin-left:5.7%; transform: rotate(-35deg); } #l_2 { margin: 0; margin-bottom: 0%; margin-left: 12.9%; } #l_3 { margin: 0; margin-bottom: -4%; margin-left: 7%; transform: rotate(-5deg); }
tagged with: css-position
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29056714
has title: How to fix an image compared with another one in CSS?
type: Question

http://stackoverflow.com/comment/46242847
comment on: http://stackoverflow.com/q/28996491
type: Comment
type: QuestionComment
has text: Thanks for the answers. Yes I'm sure to be correctly directed to map.php, but the url doesn't change and is still login.php.
score: 0

http://stackoverflow.com/a/28953806
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28953795
type: Answer
upvote count: 7
score: 7
accepted answer of: http://stackoverflow.com/q/28953795
has body: Because you are returning the value returned by the IIFE immediately, in this statement return (function(e){ console.log(e) })(i); since the IIFE just prints 0 and doesn't return anything explicitly, JavaScript will return undefined by default and exit immediately. To fix this, just drop the return keyword, (function(e){ console.log(e) })(i); PS: Have you ever wondered, why the return statement in the above code works? To think about it, it is not inside a function. Then technically its an error, right? ;-) I explained this in detail, in this question.

http://stackoverflow.com/comment/46290679
has text: `if` statements do not need `true` or `false` explicitly.
comment on: http://stackoverflow.com/a/29023990
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28913613
type: Answer
has comment: http://stackoverflow.com/comment/46086696
has body: Define it in this way: .state('WorkArea', { parent: 'site', url: '/WorkArea', data: { roles: (function() { return ['User', 'Dev']; })() }, }) You can use IIFE for this case to dynamically add properties to data attribute. In your app.run use: $rootScope.$on('$stateChangeStart', function(event, toState){ var roles = toState.data.roles ; console.log(roles); // your custom logic here for that state })
score: 0
accepted answer of: http://stackoverflow.com/q/28913377
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28913377

http://stackoverflow.com/comment/46228724
has text: Tried `ViewToolbar` but it is not adding in List Tools -> Items
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28989250

http://stackoverflow.com/q/28946004
has comment: http://stackoverflow.com/comment/46146128
answer count: 0
has comment: http://stackoverflow.com/comment/46146222
has title: Jquery Ajax Call runs an infinite loop
linked to: http://stackoverflow.com/q/4146144
type: Question
duplicate of: http://stackoverflow.com/q/14220321
tagged with: javascript
tagged with: jquery
score: 0
has body: I am trying to return the Response of a $.ajax query using the while loop which runs into an infinite loop Heres the code //The function that makes the jax call and stores the response function findResponse(Reqtype,Requrl) { var response; while(!response) { function keepFinding() { $.ajax({ type: Reqtype, url: Requrl, success:function(data) { response=data; } }) } } return response;} And here is the Call to the function var emailResponse = findResponse("get","form.php?emailField="+x); console.log(emailResponse);
linked to: http://stackoverflow.com/q/14220321
tagged with: ajax
type: UnansweredQuestion

http://stackoverflow.com/comment/46184950
comment on: http://stackoverflow.com/q/28966618
has text: Where is your jQuery include!!! It is not magically included. https://developers.google.com/speed/libraries/devguide#jquery
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/29039388
tagged with: gridview
has answer: http://stackoverflow.com/a/29064543
has title: How to amend gridview cell value with javascript
has comment: http://stackoverflow.com/comment/46362836
has comment: http://stackoverflow.com/comment/46320763
upvote count: 1
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/29064543
type: Question
tagged with: c#
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I have create a gridview as following: &lt;asp:GridView ID="Grid1" runat="server" CellPadding="1" ClientIDMode="Static" AutoGenerateColumns="false" ShowHeader="true"&gt; &lt;Columns&gt; &lt;asp:TemplateField headertext="ColumnA"&gt; &lt;ItemTemplate&gt; &lt;asp:label id="ColumnA" Text='&lt;%#Eval("ColumnA")%&gt;' runat="server"/&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; How I can add a click event (on the label) and change the value of the cell (that is clicked) in javascript? I've tried various ways using jquery but none of them are working properly, hopefully you can help me with that. Thanks.
tagged with: asp.net

http://stackoverflow.com/q/29060352
type: AnsweredQuestion
type: Question
tagged with: javascript
score: 4
tagged with: dom
upvote count: 4
has body: I have jquery-2.1.3.js library in the /opt/lampp/htdocs directory and to test it I included it in a html file Some paragraph From this I expected to change all text within tags to orange and set the background to green but I all I get is simple output : Some paragraph in default color and default background. Why this dont work?
has comment: http://stackoverflow.com/comment/46357039
downvote count: 0
answer count: 1
has title: Why I cant use jQuery functionality
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29060365
accepted answer: http://stackoverflow.com/a/29060365

http://stackoverflow.com/comment/46345148
has text: Keep a count of how many requests were made and how many "successes" you've had. Once they are equal then do the alert. There are several ways to implement this mechanic.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29053773

http://stackoverflow.com/comment/46137548
type: QuestionComment
type: Comment
has text: `arrayCollection` is a JS object. `json` is the _stringified_ version of that object. Looks like jQuery can only use the object and not the string which makes a lot of sense. Why don't you use `arrayCollection`?
score: 0
comment on: http://stackoverflow.com/q/28941449

http://stackoverflow.com/q/29059035
has comment: http://stackoverflow.com/comment/46355183
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/29059121
possible better answer: http://stackoverflow.com/a/29059052
favorite count: 0
has comment: http://stackoverflow.com/comment/46355146
has body: I have this if statement shown below and i cant use the variable letter outside the if statement in the section below it. any ideas whats wrong? window.addEventListener('keydown', function(event) { if(event.keyCode == 65) { context.clearRect(0, canvas.height * 0.80, canvas.width, canvas.height); letter = "a"; context.font = '50pt Calibri'; context.textAlign = 'center'; context.fillStyle = 'white'; context.fillText(letter, canvas.width * 0.5, canvas.height * 0.85); alert(letter + " was pressed"); }); document.addEventListener('keydown', function(event) { if(event.keyCode == 13) { alert(letter + " and enter was pressed"); } }); edited: This is my full code and it is still not working. Any more ideas? /* Hangman Game CSS File */ body { background-color: #9b59b6; } #main { background-color: #3498db; height: 97vh; width: 95vw; vertical-align: middle; } canvas { padding-left: 0; padding-right: 0; margin-left: auto; margin-right: auto; display: block; margin-top: auto; margin-bottom: auto; } Hangman by Lachlan Teale
score: -2
has comment: http://stackoverflow.com/comment/46355170
has title: Why wont a variable I set in my If statement work outside that if statement in javascript?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29059121
has comment: http://stackoverflow.com/comment/46355218
downvote count: 2
has comment: http://stackoverflow.com/comment/46355250
has comment: http://stackoverflow.com/comment/46355126
type: Question
tagged with: if-statement
tagged with: javascript
has answer: http://stackoverflow.com/a/29059052

http://stackoverflow.com/comment/46092746
type: Comment
has text: you don't need to use a capturing group, just `"$cs+55+mod($a)".match(/[+-/*()\s*]|[^+-/*()\s*]+/g);` would be fine.
score: 1
comment on: http://stackoverflow.com/a/28917010
type: AnswerComment

http://stackoverflow.com/q/28929846
has body: I am new to AngularJS and want to convert my current website to AngularJS. Below is a section of my webpage that shows meetings pulled from Google calendar. I am using the API to do this. My questions is how would I convert the HTML/Javascript to an AngularJS template? Do I just use a controller and dump all the javascript in it? Currently my HTML shows the first two results in my calendar list. This is my HTML: NEXT MEETING UPCOMING MEETINGS This is part of my Javascript that shows the callback response API request.then(function(callbackResponse) { var entries = callbackResponse.result.items; //returns an array entries //get meeting info var nextMeeting = entries[0]; var nextMeetingTimeStart = nextMeeting.start; var nextMeetingTimeEnd = nextMeeting.end; var nextMeetingTitle = nextMeeting.summary; var nextMeetingLocation = nextMeeting.location; var secondMeeting = entries[1]; var secondMeetingTimeStart = secondMeeting.start; var secondMeetingTimeEnd = secondMeeting.end; var secondMeetingTitle = secondMeeting.summary; var secondMeetingLocation = secondMeeting.location; //formatting info for (var x in nextMeetingTimeStart && nextMeetingTimeEnd && secondMeetingTimeStart && secondMeetingTimeEnd) { var nextMeetingStart = nextMeetingTimeStart[x]; var nextMeetingEnd = nextMeetingTimeEnd[x]; var secondMeetingStart = secondMeetingTimeStart[x]; var secondMeetingEnd = secondMeetingTimeEnd[x]; var nextMeetingStartFormat = new Date(nextMeetingStart).toString('hh:mm tt'); var nextMeetingEndFormat = new Date(nextMeetingEnd).toString('hh:mm tt'); var secondMeetingStartFormat = new Date(secondMeetingStart).toString('hh:mm tt'); var secondMeetingEndFormat = new Date(secondMeetingEnd).toString('hh:mm tt'); $('.next-meetings-section').find('.next-meeting-time-start').text(nextMeetingStartFormat+'-'); $('.next-meetings-section').find('.next-meeting-time-end').text(nextMeetingEndFormat); $('.upcoming-meetings-section').find('.second-meeting-time-start').text(secondMeetingStartFormat+'-')…
has answer: http://stackoverflow.com/a/28930776
tagged with: angularjs
answer count: 1
score: 0
tagged with: api
has title: Setting up AngularJS template with API javascript
tagged with: javascript
type: UnansweredQuestion
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28957570
type: Question
tagged with: ng-options
tagged with: javascript
tagged with: drop-down-menu
score: -1
has body: I'm trying to preselect a item in the list which is generated by ng-options directive. Could someone please tell me whats happening in the plunker? http://plnkr.co/edit/GTnR76HEnB5NxQRe484m?p=preview Works {{selected1}} Does not work. Why? {{selected2}}
answer count: 2
accepted answer: http://stackoverflow.com/a/28958017
favorite count: 0
tagged with: angularjs
downvote count: 2
linked to: http://stackoverflow.com/q/13916726
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28957812
has title: Pre-select option form ng-options list
has answer: http://stackoverflow.com/a/28958017
possible better answer: http://stackoverflow.com/a/28957812

http://stackoverflow.com/a/29011641
has comment: http://stackoverflow.com/comment/46279124
has comment: http://stackoverflow.com/comment/46270166
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29011565
has body: In your statement if(document.getElementById('test').style.width="500px") it should be if(document.getElementById('test').style.width == "500px") In javascript you have to user == or === as operator for comparing values In addition, if you want to have a blue background when the element width became 500px you will have two options 1- Add an interval function Go() { var div_test = document.getElementById('test').style; div_test.width="500px"; } var interval = setInterval(function() { if (document.getElementById('test').style.width="500px") { document.getElementById('test').style.cssText="background-color:blue"; clearInterval(interval); } }, 500); 2 - just move your statement to your Go() Function (you will not need the if statement anymore) function Go() { var div_test = document.getElementById('test').style; div_test.width="500px"; document.getElementById('test').style.cssText= " background-color:blue"; }
type: Answer
has comment: http://stackoverflow.com/comment/46268814
upvote count: 1

http://stackoverflow.com/q/29002461
has answer: http://stackoverflow.com/a/29018508
score: 0
type: Question
tagged with: c#
linked to: http://stackoverflow.com/q/5825165
has body: I'm working in C# to replace a file in a Sharepoint library, I've got a method which checks for the existence of the file but based on the result of this I need there to be a confirmation dialog box for the user to warn them that they are about to overwrite a file which already exists. Please see my snippet below: using (var clientContext = spContext.CreateUserClientContextForSPHost()) { var pageUrl = webUrl + "Pages/home.aspx"; var list = clientContext.Web.Lists.GetByTitle("Pages"); if (fileExists(list, pageUrl)) { // show confirmation dialog here } } Then I'd like to have some logic based on the result of my confirmation dialog which will either continue executing the code or just return; I've been looking at the ClientScriptManager class and although it is close I can't seem to get it to do exactly what I want (a logic dependent confirmation dialog). Any help would be much appreciated.
answer count: 2
has answer: http://stackoverflow.com/a/29002543
tagged with: javascript
type: UnansweredQuestion
has title: Javascript/C# - Confirmation Dialog if statement conditions are met

http://stackoverflow.com/q/28973603
has body: Consider following code: (function () { 'use strict'; delete document.body.dataset.state; })(); where body dataset is empty. Safari treats all DOMStringMap values — well, I guess so — as ReadOnly, and their enumerable, configurable and writable descriptor values are all set to false. This causes the TypeError: Unable to delete property to appear in the mentioned above example. But in Chrome dataset property descriptor values are set to true (can be checked with Object.getOwnPropertyDescriptor()), and deleting inexistent attribute does not throw the error. So, what behavior is correct? The spec says about readonly dataset, but writable DOMStringMap, so I assume dataset properties must be deletable. Am I missing something?
score: 11
type: Question
tagged with: safari
has comment: http://stackoverflow.com/comment/67320221
has answer: http://stackoverflow.com/a/44429667
upvote count: 11
tagged with: dom
has comment: http://stackoverflow.com/comment/67318125
has comment: http://stackoverflow.com/comment/49502977
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/16652589
favorite count: 0
has comment: http://stackoverflow.com/comment/46198476
has comment: http://stackoverflow.com/comment/61554073
has comment: http://stackoverflow.com/comment/61522083
has title: 'Unable to delete property' on Safari when trying to delete dataset attribute in strict mode
downvote count: 0
has comment: http://stackoverflow.com/comment/67318269
type: UnansweredQuestion

tabs
type: Tag
tags question: http://stackoverflow.com/q/28922324
tags question: http://stackoverflow.com/q/29000746
tags question: http://stackoverflow.com/q/28983438
tags question: http://stackoverflow.com/q/29016485
tags question: http://stackoverflow.com/q/29041272
tag name: tabs
tags question: http://stackoverflow.com/q/28935363

http://stackoverflow.com/q/29040918
type: Question
tagged with: javascript
has title: Adobe LiveCycle. Conditional character limit based on option selected from radio button
tagged with: livecycle-designer
has body: I have a radio button that the user has to choose either A or B. Depending on the choice I would like it to affect the character limits for the rest of the form. Sample code from the internet that controls the character limit from the form (Source: Assure Dynamics). if (this.rawValue.length &gt; 25) { var vInput = TextField3.rawValue.toString(); this.rawValue = vInput.substring(0,25); } I would like to modify the script such that the value 25 is changed to 50 if B is selected.
answer count: 1
has answer: http://stackoverflow.com/a/29041236
tagged with: adobe
type: AnsweredQuestion
tagged with: livecycle
score: 0
accepted answer: http://stackoverflow.com/a/29041236

http://stackoverflow.com/q/29060086
answer count: 1
tagged with: events
has title: JavaScript Keyboard events and comparison
type: UnansweredQuestion
has body: I wrote a function which should check if one particular button is being pressed. However, it seems to always return false. This is the function: function keyPressed(ev) { var r = false; document.onkeypress = function(e) { if (ev == e.which || ev == e.keyCode) { r = true; } } return r; } And this is how you'd call it: if (keyPressed(119)) { // do something } Checking with alert, they seem to be the same number when I press "W", but the function just always returns false. Are they different type?
has answer: http://stackoverflow.com/a/29060271
type: Question
tagged with: javascript
tagged with: keyboard
score: 0

http://stackoverflow.com/a/28977053
downvote count: 0
has comment: http://stackoverflow.com/comment/46205182
score: 4
has comment: http://stackoverflow.com/comment/46205535
has comment: http://stackoverflow.com/comment/46205490
type: Answer
has comment: http://stackoverflow.com/comment/46205317
has comment: http://stackoverflow.com/comment/50298587
has comment: http://stackoverflow.com/comment/46205467
has comment: http://stackoverflow.com/comment/46205396
has body: Having your locator based on the ng-click is not quite reliable and readable. Instead I would rely on the button text: by.xpath('//button[contains(., "Select None")]') or, on the class: by.css('button.helperButton') Or, if have a control over the application HTML templates - add an id attribute and use: by.id('mybuttonid') If you still want to use ng-click - try using starts-with CSS selector syntax to check ng-click attribute: by.css('button[ng-click^=select]')
upvote count: 4
has comment: http://stackoverflow.com/comment/46205246
has comment: http://stackoverflow.com/comment/46205255
has comment: http://stackoverflow.com/comment/46205521
answers question: http://stackoverflow.com/q/28977005

http://stackoverflow.com/comment/46156236
comment on: http://stackoverflow.com/a/28950961
score: 0
type: AnswerComment
has text: in your first example why not use toggleClass("shown") instead of toggle()?
type: Comment

http://stackoverflow.com/comment/46236450
type: Comment
type: QuestionComment
has text: can u provide demo link for this?
comment on: http://stackoverflow.com/q/28986037
score: 0

http://stackoverflow.com/q/28980963
tagged with: javascript
has comment: http://stackoverflow.com/comment/46211866
score: 0
favorite count: 0
upvote count: 1
tagged with: regex
has comment: http://stackoverflow.com/comment/46215651
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46211801
has comment: http://stackoverflow.com/comment/46211680
has body: I am beginner in RegEx so I am reading the info page of regEx on stackoverflow. eg: /(d).\1/ matches and captures 'dad' in "abcdadef" while /(?:.d){2}/ matches but doesn't capture 'cdad'. I tried :- var pattern=/(d).\1/ var val="abcdadef"; console.log(pattern.exec(val)); It shows array of ["dad","d"] but i don't know why ? As said in info it just only capture the "dad" why it is capturing two values in array?. And what is the use of '\1' in the end of pattern ? Please provide me more info how to use it. Thanks :-)
has title: RegEx not working as expected /(d).\1/
downvote count: 1
has answer: http://stackoverflow.com/a/28981038
has comment: http://stackoverflow.com/comment/46211876
accepted answer: http://stackoverflow.com/a/28981038
type: Question
has comment: http://stackoverflow.com/comment/46211734
has comment: http://stackoverflow.com/comment/46215701
tagged with: arrays
answer count: 1

http://stackoverflow.com/comment/46256255
type: Comment
comment on: http://stackoverflow.com/a/29004865
score: 0
type: AnswerComment
has text: @user4571629: use `$('table tr td:nth-child(2)').length;`

graph
tags question: http://stackoverflow.com/q/28961556
tag name: graph
tags question: http://stackoverflow.com/q/28997020
tags question: http://stackoverflow.com/q/29010928
tags question: http://stackoverflow.com/q/29032353
type: Tag

http://stackoverflow.com/q/28906878
has comment: http://stackoverflow.com/comment/46073516
has comment: http://stackoverflow.com/comment/46073820
type: UnansweredQuestion
tagged with: jsni
has body: im new to JS and JSNI. i am not clear about those $wnd and $doc. for example i have this function in JS: How may i convert it JSNI ? Trying to change document to $doc, because it stands for doc.. but it doesn't work. function homeHelp(){ var intro = introJs(); intro.setOptions({ steps: [ { element: document.querySelector('#left_side_block'), intro: "This is a tooltip.", position:'right' }, { element: document.querySelectorAll('#right_side_block')[0], intro: "Ok, wasn't that fun?", position: 'right' }, { element: '#step3', intro: 'More features, more fun.', position: 'left' }, { element: '#step4', intro: "Another step.", position: 'bottom' }, { element: '#step5', intro: 'Get it, use it.' } ] }); intro.start(); }
answer count: 0
has comment: http://stackoverflow.com/comment/46073482
type: Question
has title: Convert JS code to JSNI
tagged with: javascript
has comment: http://stackoverflow.com/comment/46073377
score: 0

http://stackoverflow.com/comment/46296598
comment on: http://stackoverflow.com/q/29026044
score: 0
has text: @Noah: Plnkr seems to work, because you haven't executed everything in it that you're doing in your actual code... Check my answer that compares working and invalid code side-by-side.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46296992
has text: Are you doing it for learning purposes? There are plenty of ready-made image galleries.
comment on: http://stackoverflow.com/q/29027630
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28915019
possible better answer: http://stackoverflow.com/a/43195155
downvote count: 0
tagged with: socket.io
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28915079
has body: How do I find out if a socket = null or undefined Example of what I want to achieve if(socket.username == NULL){ givenulldata() } Here is my socket deleting on disconnect, however some times the user hasn't actually left the website and I don't want to annoy them with a please refresh page thing, when it's unneeded. due to deleting on laptop running out of battery or there wifi disconnecting and reconnecting (more common issue for mobile devices) etc. socket.on('disconnect', function(data){ if(!socket.username) return; delete username[socket.username]; });
score: 1
tagged with: javascript
type: Question
has title: Find out if a socket equals null
has answer: http://stackoverflow.com/a/43195155
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28915079
has comment: http://stackoverflow.com/comment/46088195
favorite count: 0
has comment: http://stackoverflow.com/comment/46088286
tagged with: sockets
tagged with: node.js

http://stackoverflow.com/comment/46106547
score: 0
comment on: http://stackoverflow.com/q/28924682
type: Comment
type: QuestionComment
has text: Because my divs (in the php) are looped to always have +1 and my button too, so i figured that in my js i should loop the button to always get +1 and the div to get plus one but since div != button they should have different variables. Otherwise i can only open prompt through one button only. i can't think of any other way to do this...

http://stackoverflow.com/comment/46197538
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28969496
has text: This is killing me. I am getting nothing. I know as usual it is some simple error on m part.
type: Comment

http://stackoverflow.com/a/28943437
answers question: http://stackoverflow.com/q/28916223
score: 2
downvote count: 0
type: AcceptedAnswer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28916223
has body: Try this in your chart options : scaleOverride: true, scaleSteps: 10, scaleStartValue: 100, scaleStepWidth: -10 it shoud just do the trick. See a jsfiddle of it here.
type: Answer

http://stackoverflow.com/a/29010129
has comment: http://stackoverflow.com/comment/46266496
type: AcceptedAnswer
has body: This is wrong: self.methodA().then( self.methodB() ).then( self.methodC() ) You're invoking each method immediately, and passing the promises into then. If you want each function to wait until the previous finishes, you need to give each then a callback to execute when the previous promise resolves: self.methodA().then(function () { return self.methodB() }).then(function() { return self.methodC() });
has comment: http://stackoverflow.com/comment/46265483
score: 4
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/29010069
has comment: http://stackoverflow.com/comment/46266978
has comment: http://stackoverflow.com/comment/46284547
answers question: http://stackoverflow.com/q/29010069
has comment: http://stackoverflow.com/comment/46265413
downvote count: 0
has comment: http://stackoverflow.com/comment/46279865

http://stackoverflow.com/comment/46230712
score: 0
type: AnswerComment
has text: Thanks! That's the solution. I had to change the value of specialEnabled to boolean: ` $scope.specialEnabled = true;`
type: Comment
comment on: http://stackoverflow.com/a/28989552

http://stackoverflow.com/comment/90351752
type: Comment
has text: I think this option may be called "Use a prediction service to load pages more quickly" now?
type: AnswerComment
comment on: http://stackoverflow.com/a/29094682
score: 0

http://stackoverflow.com/comment/46235195
type: QuestionComment
has text: edited the post: parameters: efficiency, flexibility and possibly aggregation. Something similar to MongoDB or Redis.
comment on: http://stackoverflow.com/q/28993076
score: 0
type: Comment

http://stackoverflow.com/comment/46251328
type: Comment
comment on: http://stackoverflow.com/a/29001886
type: AnswerComment
has text: Do you know why max-height would effect this?
score: 0

http://stackoverflow.com/a/29018532
type: AcceptedAnswer
has body: I've looked at the page. Your misconception is probably that you think the .badge-post-grid-load-more element vanishes as soon as the next elements are loaded. This is not the case. It doesn't change at all. You have to find another way to test whether new elements were put into the DOM. You could for example retrieve the current number of elements and use waitFor to detect when the number changes. function getNumberOfItems(casper) { return casper.getElementsInfo(".listview .badge-grid-item").length; } function tryAndScroll(casper) { casper.page.scrollPosition = { top: casper.page.scrollPosition["top"] + 4000, left: 0 }; var info = casper.getElementInfo('.badge-post-grid-load-more'); if (info.visible) { var curItems = getNumberOfItems(casper); casper.waitFor(function check(){ return curItems != getNumberOfItems(casper); }, function then(){ tryAndScroll(this); }, function onTimeout(){ this.echo("Timout reached"); }, 20000); } else { casper.echo("no more items"); } } I've also streamlined tryAndScroll a little. There were completely unnecessary functions: the first casper.waitFor wasn't waiting at all and because of that the onTimeout callback could never be invoked.
has comment: http://stackoverflow.com/comment/46453694
upvote count: 5
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/46285784
has comment: http://stackoverflow.com/comment/46283219
accepted answer of: http://stackoverflow.com/q/29017726
has comment: http://stackoverflow.com/comment/46313229
answers question: http://stackoverflow.com/q/29017726
has comment: http://stackoverflow.com/comment/46311830
has comment: http://stackoverflow.com/comment/46285381
score: 5

http://stackoverflow.com/comment/46152789
type: AnswerComment
has text: That seems very obvious now that it's in front of me...thanks!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28945926

http://stackoverflow.com/comment/46345220
type: Comment
comment on: http://stackoverflow.com/a/29052526
score: 2
has text: YES YES YES!! Thank you so much! You're awesome. I'm going to mark it now as accepted answer. Thank you for your time again and again! :) @Artur Filipiak
type: AnswerComment

http://stackoverflow.com/q/28915081
upvote count: 1
has answer: http://stackoverflow.com/a/28915640
type: Question
has comment: http://stackoverflow.com/comment/46088324
has comment: http://stackoverflow.com/comment/46088467
has title: bootstrap menu icon change to x close
tagged with: javascript
has comment: http://stackoverflow.com/comment/46088792
has comment: http://stackoverflow.com/comment/46088542
linked to: http://stackoverflow.com/q/28247310
downvote count: 0
has comment: http://stackoverflow.com/comment/46089444
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46088427
tagged with: css
has comment: http://stackoverflow.com/comment/46088366
has body: I would like,when clicking on the menu icon change to an X shape with animation and when clicking on X shape it change to menu icon. menu style in my site is exactly like evernote.com but menu icon must change to X . I don't know how can I write this changing shape.can any one give me idea or guide me with this problem. I'm new in bootstrap and js . I uploaded my site here HTML دانلود اپلیکیشن × صفحه اصلی سوالات متداول فرصت های شغلی درباره ما css .icon-bar{ transition: 0.6s ease; transition-timing-function: cubic-bezier(.75, 0, .29, 1.01); } .top-animate { background: #fff !important; top: 13px !important; -webkit-transform: rotate(45deg); /* Chrome, Safari, Opera */ transform: rotate(45deg); } .mid-animate { opacity: 0; } .bottom-animate { background: #fff !important; top: 13px !important; -webkit-transform: rotate(-225deg); /* Chrome, Safari, Opera */ transform: rotate(-225deg); } .bazar-green, .bazar { color: #fff; display: block; font-size: 20px; position: absolute; right: 80px; top: 5px; line-height: 43px; background: url(image/bazarlogo.png) no-repeat left center; padding-left: 80px; z-index: 401; } .navbar-toggle { display: block; position: absolute; right: 0px; top: 0px; } .navbar-toggle{ float: right; padding: 9px 10px; margin-top: 8px; margin-right: 15px; margin-bottom: 8px; background-color: transparent; background-image: none; border: 1px solid transparent; border-radius: 4px; } .navbar-toggle .icon-bar { background-color: #fff; } .navbar-toggle .icon-bar { display: block; width: 22px; height: 2px; border-radius: 1px; } .menu { width: 300px; position: absolute; z-index: 400; background: rgba(0,0,0,0.7); padding: 10px 30px; text-align: right; color: #fff; font-size: 17px; transition: all 1s; right: -316px; } .btnClose { color: #fff; font-size: 30px; cursor: pointer; z-index: 500; } js $('.navbar-toggle').click(function() { $('.top-m').addClass('top-animate'); $('.mid-m').addClass('mid-animate'); $('.bottom-m').addClass('bottom-animate'); $('.menu').addCla…
has comment: http://stackoverflow.com/comment/46088493
score: 1

http://stackoverflow.com/comment/46169669
has text: `if(value1 && value2)` was the correct way to check in my case. I don't see the logic but it works ;)
comment on: http://stackoverflow.com/a/28944302
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/90388839
score: 0
type: AnswerComment
type: Comment
has text: Just missing a backslash in the closing ul tag. In case people are copy pasting.
comment on: http://stackoverflow.com/a/29007874

http://stackoverflow.com/comment/97400957
type: Comment
has text: I found your answer to working for zoom doesn't work accurately. do you know any changes required?
comment on: http://stackoverflow.com/a/51535728
type: AnswerComment
score: 0

http://stackoverflow.com/q/29006494
type: UnansweredQuestion
tagged with: load
has title: How to load a java script in blogspot (Dynamic theme)
has answer: http://stackoverflow.com/a/29119152
downvote count: 0
score: 1
tagged with: blogger
tagged with: blogspot
type: Question
has answer: http://stackoverflow.com/a/77737391
answer count: 2
upvote count: 1
has body: I want to load this java script in my blogspot but i am unable to find how to load using onload event in blogspot. Check Any idea how i can use onload event in blogspot PS: Above html script is working fine i only need it to work inside blogspot
tagged with: javascript
favorite count: 0

checkbox
tag name: checkbox
tags question: http://stackoverflow.com/q/28982207
tags question: http://stackoverflow.com/q/29024165
tags question: http://stackoverflow.com/q/29002278
tags question: http://stackoverflow.com/q/28974680
tags question: http://stackoverflow.com/q/28981264
tags question: http://stackoverflow.com/q/28985545
tags question: http://stackoverflow.com/q/28932126
tags question: http://stackoverflow.com/q/29005660
tags question: http://stackoverflow.com/q/28921451
tags question: http://stackoverflow.com/q/28978158
tags question: http://stackoverflow.com/q/28971045
tags question: http://stackoverflow.com/q/28922761
tags question: http://stackoverflow.com/q/28972886
tags question: http://stackoverflow.com/q/29004409
tags question: http://stackoverflow.com/q/29006166
tags question: http://stackoverflow.com/q/28964904
tags question: http://stackoverflow.com/q/28991290
type: Tag
tags question: http://stackoverflow.com/q/29043158
tags question: http://stackoverflow.com/q/28987802
tags question: http://stackoverflow.com/q/28922422
tags question: http://stackoverflow.com/q/28960899
tags question: http://stackoverflow.com/q/28926261
tags question: http://stackoverflow.com/q/28940160
tags question: http://stackoverflow.com/q/29020835
tags question: http://stackoverflow.com/q/28911698
tags question: http://stackoverflow.com/q/28929080

http://stackoverflow.com/comment/46250816
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29001565
score: 1
has text: Only the script that opened a window is allowed to close it.

http://stackoverflow.com/comment/46315555
score: 0
type: Comment
has text: I think I would use the Data URI rather than storing the data temporarily and providing a link. That way lies a lot of complexity (tracking when to delete the temp file). LiveCycle does something similar for attachments on SOAP calls and it is problematic (clients get errors because the files get deleted before they've been downloaded). Using the Data URI approach eliminates the asynchronous aspects of the response processing which will be simpler and less error-prone in the long run, IMHO.
comment on: http://stackoverflow.com/a/29035151
type: AnswerComment

http://stackoverflow.com/a/28942770
answers question: http://stackoverflow.com/q/28942390
upvote count: 2
has body: There are a number of errors, I don't have time to point them all out, hopefully the following is sufficient: var array1 = [46,73,-18,0,-442,779,5,1400]; var arrayAverage = function(arrayavg) { I don't know why you using a function expression rather than a function declaration. It doesn't affect the issue, but is more code to write. It's also good to give variables names that express what they are for, so given that the function expects an array: function arrayAverage(array) { then: for (var average = 0,answer=0, arrayavg = arrayavg.length;array1 &gt; answer;answer++) It's not a good idea to pile all those variable declarations into the for condition, far better to separate concerns and only create variables that you need: var total = 0; Now iterate over the array to get the total value. The '{' brackets can be omitted, but it's clearer to include them: for (var i=0, iLen=array.length; i&lt;iLen; i++) { total += array[i]; } Now calculate the average and return it in one statement: return total/iLen; } console.log(arrayAverage(array1)); // 230.375
downvote count: 0
has comment: http://stackoverflow.com/comment/46140088
type: Answer
score: 2

http://stackoverflow.com/a/28990868
score: 3
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/46230424
answers question: http://stackoverflow.com/q/28990587
accepted answer of: http://stackoverflow.com/q/28990587
has comment: http://stackoverflow.com/comment/46230318
type: AcceptedAnswer
downvote count: 0
has body: You can use a comma-separated list with querySelectorAll, where the first item is the element itself. This Snippet uses your HTML to retrieve section Test and its children: header, p, and div: var elements= document.querySelectorAll('#Test, #Test *'); console.log(elements.length); //4 Welcome This is a test Nothing here

http://stackoverflow.com/q/28999819
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46247556
type: UnansweredQuestion
tagged with: sliding
type: Question
has title: Sliding puzzle jquery
has answer: http://stackoverflow.com/a/28999864
tagged with: javascript
tagged with: jquery
has body: I'm trying to solve the sliding problem(3*3 grid) through jquery. In my HTML file I have 8 li's(9th empty). 1 2 3 4 5 6 7 8 I want to access these li's in my js(javascript file) through jQuery,so that I can implement the sliding effect. I tried to convert them into arrays through jQuery.map() function but it didn't work var liclass = $('Puzzle li').map(function(i,n){ return $(n).attr('class'); }).get().join(','); Can someone please tell me how can I convert them into arrays and use them in my js file. Thanks

http://stackoverflow.com/q/28976326
has answer: http://stackoverflow.com/a/28976380
has answer: http://stackoverflow.com/a/48797590
upvote count: 6
has comment: http://stackoverflow.com/comment/46203956
linked to: http://stackoverflow.com/q/15671471
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46204104
type: Question
has comment: http://stackoverflow.com/comment/46203900
has body: Really hoping someone can help me with a problem I've had a couple of times recently. Let's say I have two objects in AngularJS. $scope.fields = ['info.name', 'info.category', 'rate.health'] $scope.rows = [{ info: { name: "Apple", category: "Fruit"}, rate: { health: 100, ignored: true} },{ info: { name: "Orange", category: "Fruit"}, rate: { health: 100, ignored: true} },{ info: { name: "Snickers", category: "Sweet"}, rate: { health: 0, ignored: true} }] I would then like to display a table in a view that shows only the fields in the $scope.fields. This would be super easy if the table was flat, and I know I could flatten it using JavaScript, but there must be a way to do this by converting the dot notation to the path. I have added a JSFiddle to demonstrate the problem I'm having: JSFiddle: http://jsfiddle.net/7dyqw4ve/1/ I have also tried doing something as suggested below, but the problem is its terrible practice to use functions in the view: Convert JavaScript string in dot notation into an object reference If anyone has any ideas I would greatly appreciate it.
accepted answer: http://stackoverflow.com/a/28976380
has title: Evaluate string in dot notation to get the corresponding value from an object in the view
has comment: http://stackoverflow.com/comment/46203864
linked to: http://stackoverflow.com/q/6393943
answer count: 2
downvote count: 0
tagged with: javascript
score: 6
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/48797590

http://stackoverflow.com/comment/46081182
comment on: http://stackoverflow.com/q/28911052
type: Comment
has text: bug in chrome however, setting `vertical-align:top;` in :first-letter class also works.
type: QuestionComment
score: 0

http://stackoverflow.com/a/34456791
type: Answer
has body: From the docs i've seen that the default output stream for jsx is stdout, which means it should output the file into the console. Either try to use the --output option or redirect the command into a file: jsx ./src/helloworld.jsx --output ./build/helloworld.js or jsx ./src/helloworld.jsx &gt; ./build/helloworld.js I myself couldn't run your code with jsx (It said my syntax isn't good?), maybe try to use babel-cli instead: How to convert react JSX files to simple JavaScript file [offline transformation]
answers question: http://stackoverflow.com/q/28942456
score: 0

http://stackoverflow.com/q/28987290
has answer: http://stackoverflow.com/a/28987430
has comment: http://stackoverflow.com/comment/46223440
tagged with: http://stackoverflow.com/tag/html
has title: Populate select menu with options from array
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28987510
has answer: http://stackoverflow.com/a/28987510
accepted answer: http://stackoverflow.com/a/28987430
type: Question
tagged with: javascript
score: 0
answer count: 3
has body: I'm having issues populating my select menu with options from array using this approach var adultAgesArr = ['18 - 20', '21 - 30', '31 - 40', '41 - 50', '51 - 60', '60 +']; var $ageOptions = ''; $.each(adultAgesArr, function(index, value){ $ageOptions += $('&lt;option/&gt;', {text: value}); }) and after $('&lt;select/&gt;').append($ageOptions) what I get as a result is &lt;select&gt; [Object object] [Object object] [Object object] [Object object] [Object object] [Object object] &lt;/select&gt;
has answer: http://stackoverflow.com/a/28987436
tagged with: jquery

http://stackoverflow.com/q/29012717
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/46570387
score: 1
favorite count: 0
tagged with: angularjs
type: Question
tagged with: android
tagged with: memory-leaks
has answer: http://stackoverflow.com/a/29013441
has body: Devices tested on: Samsung S4, Ipad Browsers : Chrome and Safari for mobile Server : JBOSS Export type: war Chrome and Safari (mobile) crash intermittently during regular use of my application. I sent in a crash report to google and received this back: Thread 16 CRASHED [SIGABRT @ 0x000056e7] MAGIC SIGNATURE THREAD 0x40140134 [libc.so + 0x00022134 ] 0x4013118b [libc.so + 0x0001318b ] 0x4013139f [libc.so + 0x0001339f ] 0x401300d5 [libc.so + 0x000120d5 ] 0x4013f9ea [libc.so + 0x000219ea ] 0x64b07dd7 [dalvik-mark-stack (deleted) + 0x0222bdd7 ] 0x40130bbb [libc.so + 0x00012bbb ] 0x4015e14d [libc.so + 0x0004014d ] 0x4012d2c7 [libc.so + 0x0000f2c7 ] 0x4015e14d [libc.so + 0x0004014d ] 0x40161d2e [libc.so + 0x00043d2e ] 0x4012e1d3 [libc.so + 0x000101d3 ] 0x4012df73 [libc.so + 0x0000ff73 ] 0x4012bcff [libc.so + 0x0000dcff ] 0x78264ae7 [libchrome.2214.109.so -sqlite3.c:14539 ] sqlite3MemRoundup 0x78264af7 [libchrome.2214.109.so -sqlite3.c:14468 ] sqlite3MemMalloc 0x78264a8b [libchrome.2214.109.so -sqlite3.c:17981 ] mallocWithAlarm 0x78264a15 [libchrome.2214.109.so -sqlite3.c:18014 ] sqlite3Malloc 0x7826513f [libchrome.2214.109.so -sqlite3.c:18345 ] sqlite3DbMallocRaw 0x78277773 [libchrome.2214.109.so -sqlite3.c:56058 ] sqlite3VdbeMemGrow 0x782798f5 [libchrome.2214.109.so -sqlite3.c:64836 ] sqlite3VdbeExec 0x78277c19 [libchrome.2214.109.so -sqlite3.c:60748 ] sqlite3_step 0x7827e3eb [libchrome.2214.109.so -statement.cc:61 ] sql::Statement::Run 0x78196339 [libchrome.2214.109.so -sqlite_persistent_cookie_store.cc:1042 ] content::SQLitePersistentCookieStore::Backend::Commit 0x781936c9 [libchrome.2214.109.so -callback.h:401 ] base::SequencedWorkerPool::Inner::ThreadLoop 0x781930f5 [libchrome.2214.109.so -sequenced_worker_pool.cc:507 ] base::SequencedWorkerPool::Worker::Run 0x78192f55 [libchrome.2214.109.so -simple_thread.cc:60 ] base::SimpleThread::ThreadMain 0x7818674f [libchrome.2214.109.so -platform_thread_posix.cc:80 ] base::::ThreadFunc 0x4012b27a [libc.so + 0x0000d27a ] 0x401…
upvote count: 1
tagged with: google-chrome
answer count: 1
has title: What does this stack trace mean?

http://stackoverflow.com/comment/46277271
has text: If you don't have access to server, then obviously, you can't add a special stylesheet there. Then it looks more like monkey patching, and just should be done more carefully. E.g. test in your code for presence of the elements first, before changing them. You can either use `WebView.evaluateJavascript` if you target KitKat+, or just update the title of the page via `document.title` and read it back with `WebView.getTitle()` to communicate the results back to your app.
score: 0
comment on: http://stackoverflow.com/q/28992944
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46317452
has text: Nope, you should probably just recompute the total every time an input changes.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29038395

http://stackoverflow.com/q/28965223
type: UnansweredQuestion
tagged with: css
score: 0
has body: Is it possible to put line breaks on asp.net web page when the web page exceeds certain number of lines so if my web page has 15 lines then I want a page break after the 15th line and if my web page has 11 lines then I don't want a page break. any help will be appreciated
has title: page breaks at specific lines in asp.net
type: Question
has comment: http://stackoverflow.com/comment/46182107
has answer: http://stackoverflow.com/a/28969862
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/46187858
tagged with: asp.net

http://stackoverflow.com/comment/46096679
type: Comment
comment on: http://stackoverflow.com/a/28919182
score: 0
type: AnswerComment
has text: I'm hoping for it to return data from the firebase to be posted in to an html file. It stringifys everything once it's been received, and then appends it to a table.

http://stackoverflow.com/a/28935918
has body: If you want to subtract those two numbers then follow the below code it will do that var a="5,125,584,324.00"; var b="10243.45"; var k=a.split(","); var y=k[0]; for(var i=1;i&lt;k.length;i++) { y=y.concat(k[i]); } y=parseInt(y); b=parseInt(b); var result=y-b; alert(result); DEMO
type: Answer
answers question: http://stackoverflow.com/q/28935773
has comment: http://stackoverflow.com/comment/46139003
has comment: http://stackoverflow.com/comment/46138677
score: 0

http://stackoverflow.com/q/28994095
favorite count: 0
has comment: http://stackoverflow.com/comment/46236771
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28994324
has title: Save JSON data onto the server
tagged with: http://stackoverflow.com/tag/html
has body: To begin have a look at the following fiddle: https://jsfiddle.net/ob43hwdu/1/ with help from this community, JSON data are displayed on screen upon the user hitting the generate button. In the sense that they are various input field that user fills in and when they hit generate, it populates the json data on screen. What I would want to do is have another input and button known as name and confirm, and once the user clicks on it, it produces a json file with those information that is stored at lets say http://..json/NAMEPROVIDED.json In other words, as far as button goes, I could have: &lt;fieldset id="buildyourform"&gt; &lt;legend&gt;test&lt;/legend&gt; &lt;/fieldset&gt; &lt;input type="button" value="Add a field" class="add" id="add" /&gt; &lt;input type="button" value="Generate" class="add" id="preview" /&gt;&amp;nbsp; &lt;pre id="json"&gt;&lt;/pre&gt; &lt;input type="text" value="name of file"&gt; &lt;input type="button" value="submit"&gt; Thanks in advance
has comment: http://stackoverflow.com/comment/46236426
upvote count: 0
has answer: http://stackoverflow.com/a/28994518
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
score: -1
answer count: 2
downvote count: 1
tagged with: jquery

http://stackoverflow.com/q/28952379
tagged with: javascript
score: 0
answer count: 1
has body: I have a bootstrap side navbar setup on my site. I want to show the user what tabe has been selected by maintaining the active css property. Here is what the side navbar looks like: <asp:LinkButton ID="LB_MainPage" CssClass="activeBtn active" runat="server" OnClick="LB_MainPage_Click">Ticket Books Home</asp:LinkButton> <asp:LinkButton ID="LB_IssueTicket" CssClass="activeBtn" runat="server" OnClick="LB_IssueTicket_Click">Issue Ticket Book</asp:LinkButton> <asp:LinkButton ID="LB_Change_TicketBooks" CssClass="activeBtn" runat="server" OnClick="LB_Change_TicketBooks_Click" >Change Ticket Books</asp:LinkButton> <asp:LinkButton ID="LB_TicketBook_Reports" CssClass="activeBtn" runat="server" OnClick="LB_TicketBook_Reports_Click">Search Ticket Books</asp:LinkButton> <asp:LinkButton ID="LB_MissingTickets" CssClass="activeBtn" runat="server" OnClick="LB_MissingTickets_Click">Custom Reports</asp:LinkButton> <asp:LinkButton ID="LB_AddVoidTicket" CssClass="activeBtn" runat="server" OnClick="LB_AddVoidTicket_Click" >Add Void Ticket</asp:LinkButton> <asp:LinkButton ID="LB_VoidTickets" CssClass="activeBtn" runat="server" OnClick="LB_VoidTickets_Click" >Void Tickets</asp:LinkButton> I am trying to apply the CSS styling as such: li .activeBtn { cursor: pointer; } .activeBtn.active { color: purple; border-bottom: solid; } When a LinkButton is clicked I want to change the LinkButton to active and reset all of the other buttons back to not active. This is the jQuery function that I have in my MasterPage to do so: $(function () { $(".activeBtn").click(function () { // remove classes from all $(".activeBtn").removeClass("active"); // add class to the one we clicked $(this).addClass("active"); console.log("this is a test log"); }); }); the code is working properly in this jsFiddle. I believe the reason that it is not working because I have a multi-view on my page. When the LinkButton is clicked I change the view in the multi-view. Any ideas why this would not be working like it is in the js…
tagged with: asp.net
has answer: http://stackoverflow.com/a/28952465
type: UnansweredQuestion
tagged with: css
has title: Using Javascript to display current tab in navbar
type: Question
tagged with: c#

http://stackoverflow.com/comment/46209625
comment on: http://stackoverflow.com/q/28979536
has text: To be honest, your implementation sounds a little strange. iframes are generally used to embed other documents in your page. If you're leaving the src attribute blank, thus not embedding another document, why use an iframe in the first place? Perhaps we can help you find a better solution that will achieve your desired result instead of using an iframe.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46196918
comment on: http://stackoverflow.com/a/28967134
type: Comment
has text: Now that I'm back on my computer, I reworked my answer to explain better the limitation of using a plain Javascript object as a set-like object.
type: AnswerComment
score: 0

http://stackoverflow.com/q/29057441
tagged with: authentication
upvote count: 1
has title: Ember app served from node.js using baseUrl/rootUrl with authentication
answer count: 0
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
score: 1
tagged with: ember-cli
favorite count: 0
type: Question
tagged with: ember.js
has body: So, currently I have been using Ember cli to proxy to my api that is on a different port. I am trying to serve up a few routes using only node ('/', '/signIn', '/signUp'), and then once a user is authenticated through the '/signIn' route, serve up the ember app with a token. As of now I am using 'baseURL' defined in my 'environment.js' of ember-cli, and my ember app is served to '/app/'. I am getting confused on how one would go about serving up the ember app when a certain node route is accessed and the token is validated. In other words, I can visit my node routes fine, I can visit my ember routes fine using /app/, but am unsure of how to serve up the ember app once my server authenticates the user at '/signIn'. My reasoning for this, is that I do not want to serve up all the javascript assets to the client until I am sure they are an actual user. I am sure that this can be done using node and ember, but have not found much material online regarding such a configuration. I have done a good amount of research, and the things that have caught my eye are 'baseURL' defined in CLI, 'rootURL' defined in Ember, and this from the Ember CLI page: Integration When using Ember inside another project, you may want to launch Ember only when a specific route is accessed. If you’re preloading the Ember javascript before you access the route, you have to disable autoRun: var app = new EmberApp({ autoRun: false }); To manually run Ember: require("app-name/app")["default"].create({/* app settings */}); I know that people in production build the cli app into their '/dist' directory, and then server up the 'index' on their server, but I am not sure if this is the right path to go for development. To recap, I have an ember-cli app that is getting proxied to my node server. I have a '/', '/signIn', and a '/signUp' route that is handled by node.js completely. I also have an ember app that is served at '/app/' and is making requests to my node app successfully. What I am unsure of is how…
tagged with: node.js

http://stackoverflow.com/q/28939913
has title: Failed to load resource under Chrome! Not work ajax currently
score: 5
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/46134899
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: I am using this ajax code for checking domains. For each domain, a request is sent to API. I create 2000 rows in textarea with 3 suffixes (6000 domain) and click on submit. After submit all domains checked and display domain status in the table with ajax. In the first time display table of domains but after a few second table removed and code not display result! How to fix this problem? Chrome's console displays this error: Failed to load resource: net::ERR_INSUFFICIENT_RESOURCES Demo Link Ajax code(ajax.js): $(document).ready(function () { $("#submit").click(function () { // check if anything is selected: if(!$('#domains').val() || !$('[type="checkbox"]:checked').length){ return false; } // disable the button: var btn = $(this).prop('disabled', true); var domain = $('#domains').val().split("\n"); var counter = 0; // an indicator to state when the button should be enabled again: var ajaxQueue = 0; //send ajax request for earse txt file (new request) $.ajax({ type: "GET", url: "includes/ajax/ajax.php", data: {new_request: ajaxQueue }, }); var Table = ' ID Domain Name .Com .Net .Org .Ir .Biz .Info .Us .Name .Pro .Eu .In .Me .Tv .Cc '; // create the td elements, but do not perform AJAX requests there: $.each(domain, function (i, val) { counter++; Table += ' '+ counter +' '+ val +' '; $('input[type=checkbox]').each(function () { if($(this).is(':checked')){ ajaxQueue++; // if checkbox is checked make td element with specified values and a "load-me" class: Table += ' loading... '; }else{ Table += ' '; } }); Table += ' '; }); // Replace HTML of the 'domain_tables' div and perform AJAX request for each td element with "load-me" class: $('#domain_tables').html(Table+' ').find('td.load-me').each(function(){ var td = $(this); $.ajax({ type: "POST", url: "includes/ajax/ajax.php", dataType: "json", data: {domain: td.attr('data-domain'), suffix: td.attr('data-suffix')}, success: function (msg) { // decrease ajaxQueue and if it's 0 enable button again: ajaxQueue--; if(ajaxQueue ==…
tagged with: php
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29745709
accepted answer: http://stackoverflow.com/a/29745709
upvote count: 5
tagged with: javascript

http://stackoverflow.com/q/28960125
score: 1
has body: I've been searching about this a few days, but everything I found is with a selected text. I need to "bold" all the words within a contendEditable DIV that matches with "test". I've been messing around getting the innerText from the DIV and change those words with the same with bold, but the cursor gets lost and when inerting again the changes with innerHTML, the cursor goes at the beginning. So I started searching doing those changes directly on the DIV, and the only thing I found its the execCommand, but at far as I know, you must select text first, and do the change, one by one. I would like to read all the DIV and make changes on the fly, is this posible? Is there a way to combine execCommand with regex? Please, give me some light! :)
has title: Massive replacing in a contentEditable DIV
has answer: http://stackoverflow.com/a/29886340
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: regex
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46358593
downvote count: 0

http://stackoverflow.com/q/29004728
possible better answer: http://stackoverflow.com/a/29004854
answer count: 3
has title: Adding date function in php title tag?
tagged with: datetime
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29004812
favorite count: 0
has comment: http://stackoverflow.com/comment/46255978
downvote count: 2
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/46255840
type: Question
type: AnsweredQuestion
has body: I want to add date function in &lt;title&gt; tag in php. Is it possible? i tried this $this-&gt;pass_meta_data['title'] = "Welcome to our website, &lt;?php echo date("Y");?&gt;"; BUT this is not working, please help.
has comment: http://stackoverflow.com/comment/46255956
score: -1
has answer: http://stackoverflow.com/a/29004812
has answer: http://stackoverflow.com/a/29004854
tagged with: function
tagged with: javascript
has answer: http://stackoverflow.com/a/29005186

http://stackoverflow.com/a/28930767
has comment: http://stackoverflow.com/comment/46117513
has comment: http://stackoverflow.com/comment/46117352
has comment: http://stackoverflow.com/comment/46117473
score: 0
has body: If you want it to open in another window, why don't you link to it instead of using an iframe? Using a iframe is for when you want it specifically within an area of the same window. Try something like this: Setting the target attribute to _blank should open the link in a new window.
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28930727
accepted answer of: http://stackoverflow.com/q/28930727

http://stackoverflow.com/a/28957092
score: 1
has comment: http://stackoverflow.com/comment/46197074
accepted answer of: http://stackoverflow.com/q/28956946
has comment: http://stackoverflow.com/comment/46195288
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28956946
has body: You're calling your functions immediately, rather than passing a function reference to the .then() handlers. .then() takes a function reference, not a promise as an argument. Change to this: Sender.prototype.connect_ = function() { return this.createConnection_() .then( this.connectionReady_.bind(this) ) .then( this.createExchange_.bind(this) ) .then( this.exchangeReady_.bind(this) ) .catch( function(err) { console.info( err ); }); } The .bind(this) lets you pass a function reference (something the .then() infrastructure can call later) and still have it bound to this. It looks like you may also have binding issues when you pass callbacks like this: amqp.createConnection( this.connectOpt_, this.implementOpt_ ); These callbacks will not stay bound to this. Instead, use .bind() like this on any callback that is method: amqp.createConnection( this.connectOpt_.bind(this), this.implementOpt_.bind(this) ); The same issue exists several other places in your code.
upvote count: 1
has comment: http://stackoverflow.com/comment/46167361

http://stackoverflow.com/comment/46250752
has text: I try all browser before, this effect can do it via javascript?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29001053

http://stackoverflow.com/q/29016276
type: Question
has comment: http://stackoverflow.com/comment/46279558
has body: Please note that I want to use JQuery for this. This question How to trigger a click on a link using jQuery provided a solution for when only one anchor exists inside the list However I have more than one list item and more than one anchor. How do I trigger a click on only one of the anchors? For example I want to trigger the second list item anchor. I have tried the following without success $("#sub_menu2_tab a").trigger('click'); and $("#navigation_list #sub_menu2_tab a").trigger('click');
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29016303
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/5811122
has title: How to trigger a click on a list with many list items using jQuery
type: UnansweredQuestion

http://stackoverflow.com/comment/46299830
score: 1
has text: http://stackoverflow.com/questions/5735270/revert-a-jquery-draggable-object-back-to-its-original-container-on-out-event-of .. this might help you..
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29029112

http://stackoverflow.com/a/28953085
score: 0
has comment: http://stackoverflow.com/comment/46159882
type: Answer
has comment: http://stackoverflow.com/comment/46161203
has body: My first thought is that the iframe is not fully loaded before you try to get the values from it. My thought would be to try adding an onload event to your iframe and then when it loads invoke a function that grabs the value. I would add purchaseIframe.setAttribute("onload", "frameLoaded();"); to your purchaseIframe block and then add the frameLoaded() function to your script. something like: function frameLoaded() { var purchaseTitle = window.frames[0].document.getElementById("listingTitle" ); var purchaseNumber = window.frames[0].document.getElementById("auctionSoldIdDisplay"); console.log(purchaseTitle.innerHTML); console.log(purchaseNumber.innnerHTML); } And see if something like that grabs the right values. If it does than you can plug it in where you need it. Am I understanding your problem correctly?
has comment: http://stackoverflow.com/comment/46160674
has comment: http://stackoverflow.com/comment/46159860
has comment: http://stackoverflow.com/comment/46162578
answers question: http://stackoverflow.com/q/28951701
has comment: http://stackoverflow.com/comment/46161322
has comment: http://stackoverflow.com/comment/46160691

http://stackoverflow.com/q/28924798
has title: Angular $animate.addClass callback without jquery
tagged with: angular-ui
has answer: http://stackoverflow.com/a/28925329
tagged with: angularjs
has body: I had jquery included in my angular project and had the following code which worked fine scope.$watch('showWhen', function(newValue, oldValue) { if (newValue) { $animate.removeClass(element, 'ng-hide', scope.afterShow); } if (!newValue) { $animate.addClass(element, 'ng-hide', scope.afterHide); } }); Now i have removed jquery, the callback function doesnt seem to be called. I guess this is because its a jquery function. I cannot see anything on the $animate documentation that says you can pass a callback function. Does anyone know how to do this using angular only?
upvote count: 1
tagged with: angularjs-directive
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28925329
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/28975474
has comment: http://stackoverflow.com/comment/46203343
answer count: 0
tagged with: twitter-bootstrap
score: 0
type: UnansweredQuestion
has title: Change active tab
type: Question
has comment: http://stackoverflow.com/comment/46202761
has body: I have html code: Menu List li elements are my tab that controlled by bootstrap.min.js. Now I want change active tab with javascript: function backBtn() { var x = document.getElementById('list').className; if(x == 'active') { $("#list").removeClass('active'); $("#menu").addClass('active'); } else { alert('Exit'); } } Therefore I wrote this code to change it and it works but when I change it I could not see active tab content.
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29032380
downvote count: 0
has body: If you're using XSLT anyway, just use XSLT to output the value instead of JavaScript: Pass <xsl:value-of select="@total - @errors"/>
accepted answer of: http://stackoverflow.com/q/29031979
answers question: http://stackoverflow.com/q/29031979
upvote count: 2
has comment: http://stackoverflow.com/comment/46306171
type: AcceptedAnswer
type: Answer
score: 2

http://stackoverflow.com/comment/46113027
score: 7
has text: What is your question exactly? Can't find a question mark.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28928630

http://stackoverflow.com/a/28968738
has comment: http://stackoverflow.com/comment/46189431
has body: I like Bootstrap JS Collapse better. I tried your code in JSFiddle and it threw errors in the JS portion. Where will we meet? Simple collapsible In Bristol, we always meet In front In front of the Sainsburys/Subway On Broadquay In Cardiff, the pick up point is at the front of the National Museum. http://jsfiddle.net/p6dxrake/
type: Answer
answers question: http://stackoverflow.com/q/28968384
accepted answer of: http://stackoverflow.com/q/28968384
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/46309821
has text: Hi looks promising. I will go through this when back at desk thanks
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29034449

http://stackoverflow.com/comment/46347665
score: 0
type: Comment
type: QuestionComment
has text: Well, as you can see in your first example, it sometimes won't work and yield `undefined`. So it's definitely a **bad practice**.
comment on: http://stackoverflow.com/q/29055164

http://stackoverflow.com/comment/46342624
has text: Yes, all my files are in the same directory. I believe @balping is right because I tried using firebug to debug but I can't even start the debugging process for some reason. Sorry, I am new to this. How would can I fix this?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29052270

jquery-events
tag name: jquery-events
tags question: http://stackoverflow.com/q/28940175
tags question: http://stackoverflow.com/q/28997942
tags question: http://stackoverflow.com/q/28961350
tags question: http://stackoverflow.com/q/29041314
tags question: http://stackoverflow.com/q/29036164
type: Tag
tags question: http://stackoverflow.com/q/29031096
tags question: http://stackoverflow.com/q/28925459
tags question: http://stackoverflow.com/q/28977428

http://stackoverflow.com/a/51541356
answers question: http://stackoverflow.com/q/29013105
has body: Use the title tag to display the custom message: EDIT @Denis Chenu is right, this is not the correct solutions, this post has a correct javascript solution: changing the language of error message in required field in html5 contact form So this is a duplicate and can be closed? document.getElementById('fname').setCustomValidity('Dit is verplicht kut'); First name: Last name: Submit
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29013105
has comment: http://stackoverflow.com/comment/128153558
type: Answer

http://stackoverflow.com/q/28997283
answer count: 1
tagged with: jquery
tagged with: asp.net
favorite count: 0
has title: JQuery message confirmation asp.net
type: UnansweredQuestion
score: -3
downvote count: 3
has body: I have problem with this code : &lt;script type="text/javascript"&gt; $(document).ready(function () { $("a.show").click(function () { $("#Box").slideDown(500); //if i return false the message conformation show and stopped but i have //problem the Query String this not passing in the URL // and if i return true the message show and hide quickly but //the QueryString passing in the URL }); }); &lt;/script&gt; Note: in my solution i have do message confirmation for deleting but i will design my message box and i will do two button (Yes, NO) if Client click on yes the code of deleting execute (in this code i have the Query String :( )
has comment: http://stackoverflow.com/comment/46242747
type: Question
tagged with: c#
tagged with: javascript
has answer: http://stackoverflow.com/a/28998260
has comment: http://stackoverflow.com/comment/46242973
upvote count: 0

http://stackoverflow.com/q/28970517
tagged with: arrays
type: Question
answer count: 2
has body: My current code: function intersect(first, second) { var temp = []; for(var i = 0; i &lt; first.length; i++){ for(var k = 0; k &lt; second.length; k++){ if(first[i] == second[k]){ temp.push( first[i]); break; } } } return temp; } How can I change this so it returns ALL the intersections indices?
accepted answer: http://stackoverflow.com/a/28970619
score: 0
possible better answer: http://stackoverflow.com/a/28970653
has answer: http://stackoverflow.com/a/28970653
has title: Return ALL intersections array javascript
tagged with: intersection
tagged with: javascript
tagged with: array-intersect
has answer: http://stackoverflow.com/a/28970619
type: AnsweredQuestion

http://stackoverflow.com/comment/46351073
has text: As a work-around (until you figure out the hiccup), you could always use in the section, and put the CodePen CSS in between those. Embedding the style in the HTML page should work for you, if all else fails.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29056828

http://stackoverflow.com/comment/65219727
has text: wonderful, this seems to work, will need to do some more testing, thanks
comment on: http://stackoverflow.com/a/38879871
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46207734
type: AnswerComment
has text: I have small doubt, what is the difference between \.setDisplayFormat\s*\((?!\s*["'](shortdate|shortdate shorttime|shortdate longtime|longdate|longdate shorttime|longdate longtime|longtime|shorttime)["']) and \.setDisplayFormat\s*\(\s*(?!["'](shortdate|shortdate shorttime|shortdate longtime|longdate|longdate shorttime|longdate longtime|longtime|shorttime)["'])
type: Comment
comment on: http://stackoverflow.com/a/28960422
score: 0

http://stackoverflow.com/comment/46384266
comment on: http://stackoverflow.com/q/29033813
has text: I'm having certain methods like createPopup(),showModalDialog() which are supported in before version of IE8,which is not supported in chrome/firefox. I'm also having frames in the html pages where i access certain fields by document.frames[frm1].location.href which are not working in chrome.Could anyone have better idea of solving this??
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46300955
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29028939
score: 0
has text: lol seriously??? btw this started happening all of a sudden without any change to node_modules or anything!

http://stackoverflow.com/comment/46306158
type: AnswerComment
comment on: http://stackoverflow.com/a/29032576
type: Comment
has text: lol Too funny. I told them the issue, and everyone down votes me because they're fixed on printName. Agreed though, this guy explained it much better than I did.
score: 0

http://stackoverflow.com/comment/46136493
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28940874
has text: @NejcLovrencic Check post. I added a library that will help you write to the canvas in vector. Please upvote and mark correct if this helps you.

http://stackoverflow.com/comment/46383776
type: Comment
type: QuestionComment
has text: This [demo](http://www.highcharts.com/demo/combo-multi-axes) should be helpful. It's using separate axes for each of the series. And series can have different types (column, area, line etc.)
score: 0
comment on: http://stackoverflow.com/q/29032353

http://stackoverflow.com/q/28962647
score: 2
tagged with: a-star
tagged with: dijkstra
type: Question
tagged with: path-finding
tagged with: javascript
has answer: http://stackoverflow.com/a/29044872
answer count: 1
downvote count: 0
favorite count: 0
has title: Straight paths Dijkstra’s Algorithm implementation
upvote count: 2
type: UnansweredQuestion
has body: I have recently been trying to implement Dijkstra’s Algorithm in Javascript using the tutorial here. I'm able to make it go around obstacles successfully, but the paths it makes are simply not optimal, usually coming off as very straight. I think the problem is with how he implemented finding the neighbors. His code seems to pick the neighbors in a near-random order while mine always picks them in a set order, so that's probably a good place to look. I couldn't for the life of me figure it out. I tried everything I could think of. My filling implementation is this: function floodFill(array,sx,sy,dx,dy){ var frontier=sx,sy; array[sy][sx].visited=true; var look=[[-1,0],[0,-1],[1,0],[0,1]]; var looks=0; while(frontier.length&gt;0){ if(frontier.length&gt;0){ var current=frontier[0]; frontier.splice(0,1); if(current[0]==dx &amp;&amp; current[1]==dy){ console.log("Broke early!"); break; } for(var i=0;i&lt;look.length;i++){ var y=current[0]+look[i][0]; var x=current[1]+look[i][1]; if((y&gt;=0 &amp;&amp; y&lt;array[current[0]].length) &amp;&amp; (x&gt;=0 &amp;&amp; x&lt;array.length)){ if(array[y][x].visited==false &amp;&amp; array[y][x].type==0){ frontier.push([y,x]); looks++; array[y][x].visited=true; array[y][x].origin=[current[0],current[1]]; array[y][x].order=looks; } } } } } } You can find a demo here (you need to open up your javascript console to see it) Thank you very much for your time. Here's an image of my problem

http://stackoverflow.com/a/29030565
accepted answer of: http://stackoverflow.com/q/28963530
type: Answer
answers question: http://stackoverflow.com/q/28963530
has body: Eventually what I did was use Angular UI Utils which has a generic event binder. This allowed me to bind to an event that AngularJS doesn't out of the box. Using the following line ui-event="{ ended : 'ctrl.video()'}" I was able to call my function when the video ended which gave me the desired behaviour.
downvote count: 0
score: 6
upvote count: 6
type: AcceptedAnswer

http://stackoverflow.com/comment/46314305
has text: And if you use Mozilla Firefox does the console show errors ?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29036776
type: Comment

http://stackoverflow.com/q/28918884
has comment: http://stackoverflow.com/comment/46106331
type: AnsweredQuestion
type: Question
answer count: 2
score: 5
has answer: http://stackoverflow.com/a/28918916
has body: In .js files triple nested quotes ("one'two"three"'") can be escaped (see this post) and in HTML this can also be achieved using character references (see this post). I have a problem achieving this in an AngularJS expression in my template. I need to put this: {{ 'PLURAL' | translate:"{ GENDER: 'male' }":"messageformat" }} Into a placeholder element: &lt;input placeholder="{{ 'PLURAL' | translate:"{ GENDER: 'male' }":"messageformat" }}"&gt; How should I escape the quotes to make it work?
accepted answer: http://stackoverflow.com/a/28918916
has answer: http://stackoverflow.com/a/28925008
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46095404
linked to: http://stackoverflow.com/q/3039765
linked to: http://stackoverflow.com/q/27493270
has title: Nesting quotes in Angular expression
upvote count: 5
tagged with: angularjs
downvote count: 0
possible better answer: http://stackoverflow.com/a/28925008

http://stackoverflow.com/q/28944520
tagged with: angularjs
type: UnansweredQuestion
has title: How to prevent module's run block from being executed during testing?
has answer: http://stackoverflow.com/a/28945300
has body: I'm trying to unit test a service provided by an angular module I've created, however I'm struggling to find a way to do so without also invoking the module's run block when it is loaded in. Does anyone have any ideas?
tagged with: angularjs-ngmock
score: 0
type: Question
tagged with: javascript
answer count: 1
tagged with: jasmine

http://stackoverflow.com/a/29004731
score: 6
type: Answer
has comment: http://stackoverflow.com/comment/46434951
upvote count: 6
downvote count: 0
has body: Since you need complete width for the table and it should be responsive, you can keep the delete button inside last td(Username) and position it by getting few values from the hovered row using jQuery. $('.table-bordered-custom tr') .on('mouseenter', function () { var offset = $(this).offset(); var top = offset.top; var width = parseInt($('.table-responsive').css('width'),10); var elem = $(this).find('span.delete'); var parent_padding_left = parseInt($('.table-responsive').parent().css('padding-left'),10) elem.css({ "top": top + "px", "left": (width + parent_padding_left) - 1 + "px", "display": "inline" }); }) .on('mouseleave', function () { $('span.delete').css({ "display": "none" }) }); span.delete { display: none; position: absolute; background: crimson; color: #fff; cursor: pointer; padding: 9px 12px; } # First Name Last Name Username 1 Mark Otto @mdox 2 Jacob Thornton @fatx 3 Larry the Bird @twitterx
answers question: http://stackoverflow.com/q/28942949

http://stackoverflow.com/q/28953981
tagged with: c#
has body: I have a RenderAppraisalImage() Method which has a foreach loop to go trough my images and with html.Append it creates html tags for those images. I created a delete method and I need to add a button tag to the html.append so when the user clicks on the button it deletes the images. I dont know how to call the C# method from that button tag. any help would be appreciated. Here is the code: public void DeleteAnImage(string ImageName) { string filePath = @"\\serverName\MediaCom\bids\" + ImageName; FileIOPermission permission = new FileIOPermission(FileIOPermissionAccess.Write, filePath); PermissionSet permissionSet = new PermissionSet(PermissionState.None); permissionSet.AddPermission(permission); System.IO.File.Delete(filePath); } public string RenderAppraisalImages() { System.Text.StringBuilder html = new System.Text.StringBuilder(); string[] imageFilepaths = Advocar3.Business.Cars.ActivityBid.GetActivityBidImageFilepaths(ActaId, Aime.Global.MediaPathActivityBids, Aime.Global.MediaDirActivityBids); char nextImageAvailable = 'a'; foreach(string imageFilepath in imageFilepaths) { int pos = imageFilepath.LastIndexOf("/") + 1; html.Append(string.Concat(@" Delete Image ", @" ")); nextImageAvailable++; } return html.ToString(); } Here is the UI Output:
has answer: http://stackoverflow.com/a/28958820
tagged with: javascript
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: asp.net
has title: How to call C# method from html tag in string concat method?
type: Question
answer count: 1
score: 0

http://stackoverflow.com/q/28967581
has comment: http://stackoverflow.com/comment/46188047
has comment: http://stackoverflow.com/comment/46187318
downvote count: 0
tagged with: window.opener
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46188950
accepted answer: http://stackoverflow.com/a/28968614
tagged with: events
score: 1
has comment: http://stackoverflow.com/comment/46187699
has answer: http://stackoverflow.com/a/58117307
has comment: http://stackoverflow.com/comment/46188070
has comment: http://stackoverflow.com/comment/46186985
upvote count: 1
possible better answer: http://stackoverflow.com/a/58117307
type: AnsweredQuestion
has body: I have a problem since few days. On firefox my code works but not on IE. I have a window which open new window with window.open; In this new window, I do what I want and after that I would like to update a specific part on parent window. On parent window, I had : $(document).on('myEvent', doThis); And on the second window I had this (I don't want to use other library like jQuery if is possible) : var event = new CustomEvent("myEvent"); window.opener.document.dispatchEvent(event); window.close(); On Firefox the code seems Okay but on IE it doesn't work; I've tried to add a CustomEvent polyfill (because I undestand IE doesn't implement CustomEvent), but I have new problem... IE doesn't like my : window.opener.document.dispatchEvent(event); How can I send an event on my "opener" (or parent) window when I finnish to do what I want in new window which was opened by my "opener" (or parent) window ? Thx.
has comment: http://stackoverflow.com/comment/46187799
tagged with: internet-explorer
tagged with: dispatchevent
has answer: http://stackoverflow.com/a/28968614
has title: CustomEvent in IE with window.opener
has comment: http://stackoverflow.com/comment/46187753
type: Question
answer count: 2

http://stackoverflow.com/comment/46221260
type: QuestionComment
type: Comment
has text: I don't know how to do that's y i put this question.If u don't want to answer then its ok.
comment on: http://stackoverflow.com/q/28985980
score: 0

http://stackoverflow.com/comment/46200285
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28973610
has text: Yea.. when I do that the whole Unisex name section stops working

http://stackoverflow.com/q/29053073
downvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/46343869
has answer: http://stackoverflow.com/a/29053192
accepted answer: http://stackoverflow.com/a/29053192
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46343839
tagged with: jquery
has comment: http://stackoverflow.com/comment/46344063
has answer: http://stackoverflow.com/a/29053274
answer count: 2
has body: I am trying to execute this javascript code on each database table record. I have try to define all the div id on the script, but since i am not good a javascript i can not find where is the problem. I think that javascript should be specified with a uniq name... heres the code: echo '&lt;script&gt;'; echo '$(document).ready(function(){'; echo 'var menu = $("#shfaqa'.$row["id"].'")'; echo '$("#butoni'.$row["id"].'").click(function(event){'; echo 'event.preventDefault();'; echo 'event.stopPropagation();'; echo 'if (menu.is(":visible"))'; echo '{'; echo 'menu.slideUp(400);'; echo 'jwplayer( "my-video'.$row["id"].'" ).stop();'; echo '}'; echo 'else'; echo '{'; echo 'menu.slideDown(400);'; echo '}'; echo '});'; echo '$(document).not("#shfaqa'.$row["id"].', #butoni'.$row["id"].'").click(function(event) {'; echo 'event.preventDefault();'; echo 'if (menu.is(":visible"))'; echo '{'; echo 'menu.slideUp(400);'; echo 'jwplayer( "my-video'.$row["id"].'" ).stop();'; echo '}'; echo '});'; echo '})'; echo '&lt;/script&gt;';
favorite count: 0
score: -3
tagged with: php
has comment: http://stackoverflow.com/comment/46344233
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29053274
has title: Javascript not working on a php while cycle

http://stackoverflow.com/comment/46096902
comment on: http://stackoverflow.com/a/28914522
type: Comment
has text: This worked for me along with `typeof(page)` with pagescript. Thanks.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28967841
has comment: http://stackoverflow.com/comment/46187407
type: Question
accepted answer: http://stackoverflow.com/a/28968135
tagged with: javascript
score: 0
answer count: 3
tagged with: url
has answer: http://stackoverflow.com/a/28968080
has answer: http://stackoverflow.com/a/28968135
has answer: http://stackoverflow.com/a/28968116
has comment: http://stackoverflow.com/comment/46187643
has body: Having trouble parsing A url object how I would like, still new to url strings would love some help. My object looks like this : {mod1: "/hello/world", mod25: "/hey/jude/how/are/you"} and I need to parse it into something like this { "mod1" : {"hello" : ["world"]}, "mod2" : {"hey" : ["jude","how","are","you"]} } How do I parse this url into an object like so? Thanks! Edit: so far var parseObj = $location.search(); _.each(parseObj, function(ob){ console.log(ob.split()); }); This gives me back the strings, however i am not sure how to now split them into an object where the key is the first item
possible better answer: http://stackoverflow.com/a/28968080
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46187406
has title: parsing url string correctly

http://stackoverflow.com/a/29015283
has comment: http://stackoverflow.com/comment/46297133
score: 3
has comment: http://stackoverflow.com/comment/46276066
has comment: http://stackoverflow.com/comment/46296968
type: AcceptedAnswer
downvote count: 0
has body: Append text after span, like so parentElement.appendChild(span); parentElement.appendChild(text); Or with jQuery $(parentElement).append(span); $(parentElement).append(text); Example
accepted answer of: http://stackoverflow.com/q/29015241
type: Answer
answers question: http://stackoverflow.com/q/29015241
upvote count: 3

http://stackoverflow.com/a/28943144
has comment: http://stackoverflow.com/comment/46141108
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28942763
answers question: http://stackoverflow.com/q/28942763
type: Answer
has body: You must not use same ids for multiple controls. My suggestion is to use dummy attribute e.g.'data-group', which can be used in JavaScript and browser simply ignores it. Like: B I U S B I U S Hope it works.

http://stackoverflow.com/comment/46332544
score: 0
type: AnswerComment
type: Comment
has text: Yes. I don't see how imcluding a PHP page is any different from a static HTML file from the JavaScripts point of view. A script block further down the HTML document than the element you wanna access should always work. It's only when the DOM element you want to access is created after the JS is trying to access it you ran into problems.
comment on: http://stackoverflow.com/a/29034968

http://stackoverflow.com/q/29060343
type: Question
has title: password input starts JavaScript
answer count: 2
tagged with: javascript
score: -1
has body: I created a password input like this: /php/password.php looks like this <?php $formData = array( "password" => $_POST["password"] ); $query = mysql_query("SELECT password FROM data"); $fetch = mysql_fetch_assoc($query); $password = $fetch ["password"].""; $imagepath= "../jpg/P5010905.jpeg"; $image = imagecreatefromjpeg($imagepath); if($formData['password'] == $password ) { $pic = header('Content-Type: image/jpeg'); imagejpeg($image); } echo $pic; ?> this works just fine. On my site, there's also a slider object from jqwidgets, which is disabled by default. To enable it, I need in JavaScript $('#light1').jqxSlider({ disabled: false }); How can I enable the slider after the authentication?
has answer: http://stackoverflow.com/a/29060678
tagged with: jqwidget
favorite count: 0
has answer: http://stackoverflow.com/a/29072659
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/46356953
upvote count: 0
downvote count: 1

http://stackoverflow.com/q/29033270
score: 1
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 1
has answer: http://stackoverflow.com/a/29033338
accepted answer: http://stackoverflow.com/a/29033338
has title: Popup with value of slider when it's changed
answer count: 1
has body: I have the next jsfiddle: https://jsfiddle.net/alonshmiel/vxz7fnvk/1/ There is a slider with an ellipse that contains arrows. I want to write a function that shows a popup with the value of the ellipse when the user changes the value. BUT: There are two options to scroll it: 1) When you click on a certain value, a popup with the value will be shown on the screen. 2) When you click on the ellipse and move it to the left or right, and then stop clicking on the ellipse (in other words, stop scrolling it), a popup with the value will be shown on the screen with the value. $("#slider").slider({ value:30, min: 0, max: 100, step: 10, slide: function( event, ui ) { $( "#slider a" ).html("&lt;span class='Triangles'&gt;&amp;#9664;&amp;#9654;&lt;/span&gt;"); $( "#slider-value" ).html(ui.value); } }); Any help appreciated!
favorite count: 0
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/a/28911146
type: Answer
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28911112
has body: Pure javascript Use ordinary for loop: var blocks = document.getElementsByClassName("block-container"); for (var i = 0; i &lt; blocks.length; i++) { var block = blocks[i]; block.style.backgroundColor = "#252525"; } Working jsfiddle. Basically for..in loop iterates through the properties of an object passed. More info here. JQuery This could be easily done by jQuery. So just in case here is an example: $(function() { $(".block-container").css("background-color", "#252525"); }); Working jsfiddle.

http://stackoverflow.com/comment/46147572
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28946680
has text: This can be done in css but I prefer jquery on this project. Thanks again!

http://stackoverflow.com/q/29046916
has body: I have a winform that screen scrapes another application and generates a html file. I'd like to add js to the html file so that when a user clicks a heading, it will send a string and trigger a function within the winform. I've been researching this for a while now but all of the possible solutions I've seen involve the webbrowser control, which I'm not using and don't intend to use. Is it possible to call a winform function from an IE page via js? UPDATE: Now considering a webbrowser control.
score: 2
type: AnsweredQuestion
upvote count: 2
possible better answer: http://stackoverflow.com/a/29074933
has answer: http://stackoverflow.com/a/29074933
accepted answer: http://stackoverflow.com/a/29075498
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/46333403
linked to: http://stackoverflow.com/q/2771034
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: winforms
has answer: http://stackoverflow.com/a/29075498
has title: Call winform function from IE browser

http://stackoverflow.com/q/28995254
upvote count: 2
has title: ERROR: 180: EXCEPTION thrown ('dev!'): - and ERROR:> aqsrv> 70: Exception caught in (null) - Error -1
has answer: http://stackoverflow.com/a/29019975
tagged with: titanium
type: Question
has body: every time I call my function to use .wav files I get these errors: ERROR: 180: EXCEPTION thrown ('dev!'): - and ERROR:&gt; aqsrv&gt; 70: Exception caught in (null) - Error -1 it always happens in the line of play(). It only happens in IOS - on android it runs well. Function: function sonido() { var cont=0; //console.log(arregloDetalles[cont].tVelocidad); var intervalo=setInterval(function() { if(bnaddetener==1){ clearInterval(intervalo); } if(arregloDetalles[cont].click_clack==1) { soundclick.play(); } else { soundclack.play(); console.log("Clack"); } cont++; if(cont==arregloDetalles.length) { banderaclick=1; cont=0; } } ,arregloDetalles[cont].tVelocidad); } declaration of .wav files: var soundclick = Titanium.Media.createSound({ url:'/sonidos/beep-8.wav', preload:true }); soundclick.addEventListener('complete', function(e) { soundclick.release(); }); var soundclack = Titanium.Media.createSound({ url:'/sonidos/beep-7.wav', preload:true }); soundclack.addEventListener('complete', function(e) { soundclack.release(); });
tagged with: ios
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29019975
answer count: 1
downvote count: 0
favorite count: 0
tagged with: android
type: AnsweredQuestion
score: 2
tagged with: audio

http://stackoverflow.com/q/29061023
type: Question
has answer: http://stackoverflow.com/a/29061156
has comment: http://stackoverflow.com/comment/46358839
tagged with: javascript
has answer: http://stackoverflow.com/a/29061075
answer count: 3
possible better answer: http://stackoverflow.com/a/29061075
has comment: http://stackoverflow.com/comment/46358363
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/46358434
accepted answer: http://stackoverflow.com/a/29061156
favorite count: 0
has comment: http://stackoverflow.com/comment/46358422
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29061130
tagged with: php
type: AnsweredQuestion
score: 2
has title: How to change text to textbox on clicking it
upvote count: 2
has body: Here is the fiddle for changing the label's value by clicking on it. But i don't want to do it while i click on the edit (href) I just want to click on the name and change it to textbox and while i take the mouse outside it should change back to label How can i do this ? Here's the jquery code i have $(document).ready(function() { $('a.edit').click(function () { var dad = $(this).parent().parent(); dad.find('label').hide(); dad.find('input[type="text"]').show().focus(); }); $('input[type=text]').focusout(function() { var dad = $(this).parent(); $(this).hide(); dad.find('label').show(); }); });

http://stackoverflow.com/comment/46117062
type: QuestionComment
has text: I don't understand what you mean by "if I get in 4 parameters". If you're trying to implement a specific function signature, please show how that function is declared.
comment on: http://stackoverflow.com/q/28930511
score: 0
type: Comment

http://stackoverflow.com/a/29043013
score: 0
type: Answer
has body: This happens because every filter call basically returns a new object, which has a new identity and therefore Angular believes something has changed. This in turn triggers a new digest cycle and this goes on until the 10 digests limit is reached. I suppose there can be other ways to fix it with the use of caching to store your computed object and keep the filter, but I changed your code to the following which works just the same, but you have to recalculate chunks if the array changes: var app = angular.module('app', []); app.controller('ctrl', ['$scope', function($scope){ $scope.arr = [{name: 'foo', def: 'bar'}, {name: 'faz', def: 'baz'}, {name: 'boo', def: 'foo'}]; function getChunks() { var input = $scope.arr; var chunks = {}; for(var i = 0; i &lt; input.length; i++){ var firstLetter = input[i].name[0].toUpperCase(); if(!(chunks.hasOwnProperty(firstLetter))) { chunks[firstLetter]=[]; } chunks[firstLetter].push(input[i]); } return chunks; } $scope.chunks = getChunks(); }]); And change the HTML call to: &lt;div ng-repeat="(firstletter, values) in chunks"&gt; Fiddle
answers question: http://stackoverflow.com/q/29042714

http://stackoverflow.com/comment/46341980
score: 0
type: Comment
type: QuestionComment
has text: I don't have a real answer to your question, but, in the meantime: have you thougt of breaking up the JSON in smaller parts?
comment on: http://stackoverflow.com/q/29039272

http://stackoverflow.com/a/42447620
has comment: http://stackoverflow.com/comment/101719926
answers question: http://stackoverflow.com/q/29018151
has body: I don't know if it works in other browsers but in chrome you can do something like /* eventType is 'touchstart', 'touchmove', 'touchend'... */ function sendTouchEvent(x, y, element, eventType) { const touchObj = new Touch({ identifier: Date.now(), target: element, clientX: x, clientY: y, radiusX: 2.5, radiusY: 2.5, rotationAngle: 10, force: 0.5, }); const touchEvent = new TouchEvent(eventType, { cancelable: true, bubbles: true, touches: [touchObj], targetTouches: [], changedTouches: [touchObj], shiftKey: true, }); element.dispatchEvent(touchEvent); } const myElement = document.getElementById('foo') sendTouchEvent(150, 150, myElement, 'touchstart'); sendTouchEvent(220, 200, myElement, 'touchmove'); sendTouchEvent(220, 200, myElement, 'touchend'); To test if a given browser supports Touch and TouchEvent if (typeof Touch !== 'undefined' &amp;&amp; typeof TouchEvent !== 'undefined' &amp;&amp; Touch.length === 1 &amp;&amp; TouchEvent.length === 1) { sendTouchEvent(200, 200, myElement, 'touchmove'); } see Touch and TouchEvent constructors
upvote count: 23
has comment: http://stackoverflow.com/comment/78254290
type: Answer
has comment: http://stackoverflow.com/comment/78204049
has comment: http://stackoverflow.com/comment/78263365
downvote count: 0
score: 23

http://stackoverflow.com/comment/47616777
type: Comment
type: QuestionComment
has text: Not that I know. Here is the github issue for the activator: https://github.com/typesafehub/activator/issues/979 . I still use the workround that I added the play-fork-run.sbt to my gitignore and then I can deploy ;)
score: 0
comment on: http://stackoverflow.com/q/28947087

http://stackoverflow.com/comment/46448319
type: QuestionComment
comment on: http://stackoverflow.com/q/29037287
has text: @Brandon: I reworded your question, remember to keep as short as possible, and to provide all the problem's initial parameters (link to data, command line you use, buggy code, etc). You are also encouraged to validate below the answer if it solved your problem.
score: 0
type: Comment

http://stackoverflow.com/q/29005660
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
has comment: http://stackoverflow.com/comment/46257630
type: AnsweredQuestion
has title: Multiple checkboxes, if correct change background image (HTML/Javascript)
tagged with: javascript
tagged with: background
tagged with: image
type: Question
score: 0
has body: Theres a form with 4 answers. 2 of them are correct. If both answered are checked, there should appear some button to check if the correct ones are selected. If that is the case, the background image is supposed to change.
answer count: 1
has answer: http://stackoverflow.com/a/29006107
accepted answer: http://stackoverflow.com/a/29006107
has comment: http://stackoverflow.com/comment/46258007
has comment: http://stackoverflow.com/comment/46257919

http://stackoverflow.com/a/28909815
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28909753
has body: The ready event handler is called with the jQuery object as parameter, but the load event handler isn't. As you have $ as parameter for the load event handler, it will contain the event object, not the jQuery object. When you try to use the event object as if it is the jQuery object, you will get an error. Remove the parameter from the load event handler, so that you can access the $ variable from the global scope: jQuery(window).load(function() {
answers question: http://stackoverflow.com/q/28909753
upvote count: 3
type: AcceptedAnswer
type: Answer

algorithm
tags question: http://stackoverflow.com/q/29013386
tags question: http://stackoverflow.com/q/28966967
tag name: algorithm
tags question: http://stackoverflow.com/q/28920891
tags question: http://stackoverflow.com/q/28935811
tags question: http://stackoverflow.com/q/28960788
type: Tag
tags question: http://stackoverflow.com/q/28936347
tags question: http://stackoverflow.com/q/28955533
tags question: http://stackoverflow.com/q/29046059

http://stackoverflow.com/q/28983558
type: UnansweredQuestion
score: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/46216436
downvote count: 1
has answer: http://stackoverflow.com/a/28983952
type: Question
has body: I am repeating a form using ng-repeat. the repetition is to create a new form. I want to submit all forms data on single click. i am not able to find how I can assign multiple values in array. Here is my form: Name: Date: Save Add and it is my controller app.controller('main', function($scope){ $scope.screens = [{scrnid: "1"}]; $scope.scrnid = 1; $scope.createScreen = function() { $scope.screens.push({scrnid: "" + ($scope.screens.length + 1)}); }; $scope.bdays = []; // Create the function to push the data into the "bdays" array $scope.newBirthday = function(){ $scope.bdays.push($scope.screens.length); // how to push mutiple records in array dynamically $scope.screen.bdayname = ''; $scope.screen.bdaydate = ''; }; }); help will be appreciated...
has comment: http://stackoverflow.com/comment/46216752
tagged with: angularjs-ng-model
has title: angular js array in model
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/a/49546948
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29000132
upvote count: 3
score: 3
has body: creat html file and a sketch.js file in your html file you can put in a starter template and then add p5js in the sketch.js check the docs here // All the paths var paths = []; // Are we painting? var painting = false; // How long until the next circle var next = 0; // Where are we now and where were we? var current; var previous; function setup() { createCanvas(720, 400); current = createVector(0,0); previous = createVector(0,0); }; function draw() { background(200); // If it's time for a new point if (millis() > next && painting) { // Grab mouse position current.x = mouseX; current.y = mouseY; // New particle's force is based on mouse movement var force = p5.Vector.sub(current, previous); force.mult(0.05); // Add new particle paths[paths.length - 1].add(current, force); // Schedule next circle next = millis() + random(100); // Store mouse values previous.x = current.x; previous.y = current.y; } // Draw all paths for( var i = 0; i < paths.length; i++) { paths[i].update(); paths[i].display(); } } // Start it up function mousePressed() { next = 0; painting = true; previous.x = mouseX; previous.y = mouseY; paths.push(new Path()); } // Stop function mouseReleased() { painting = false; } // A Path is a list of particles function Path() { this.particles = []; this.hue = random(100); } Path.prototype.add = function(position, force) { // Add a new particle with a position, force, and hue this.particles.push(new Particle(position, force, this.hue)); } // Display plath Path.prototype.update = function() { for (var i = 0; i < this.particles.length; i++) { this.particles[i].update(); } } // Display plath Path.prototype.display = function() { // Loop through backwards for (var i = this.particles.length - 1; i >= 0; i--) { // If we shold remove it if (this.particles[i].lifespan <= 0) { this.particles.splice(i, 1); // Otherwise, display it } else { this.particles[i].display(this.particles[i+1]); } } } // Particles along the path function Particle(position, force, hue) { this.posi…

http://stackoverflow.com/comment/46281820
has text: If you wouldn't mind using jQuery you could do the following: http://stackoverflow.com/questions/918792/use-jquery-to-change-an-html-tag
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29018872
type: Comment

http://stackoverflow.com/comment/46348225
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29055428
type: Comment
has text: I am not sure I understand. I have already added my js code. It's actually placed here: `wp-content/themes/twmp-child-theme/js/dynamicdivs.js`. When I check the file I don't see any errors. Is that what you mean?

http://stackoverflow.com/comment/46290347
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29023692
has text: Did you forget to include jQuery in your page?
score: 0

http://stackoverflow.com/a/29060142
accepted answer of: http://stackoverflow.com/q/29060096
has comment: http://stackoverflow.com/comment/46357050
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29060096
has comment: http://stackoverflow.com/comment/46356593
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46356699
has comment: http://stackoverflow.com/comment/46357023
has comment: http://stackoverflow.com/comment/46356787
has comment: http://stackoverflow.com/comment/46356729
has body: $('.contact_form').click(function(e){ //check whether the target of the click has form_container as a parent if (!$(e.target).closest('.form_container').length) { $('.contact_form').fadeOut("slow"); $('html').removeClass("stop-scrolling") } }) http://codepen.io/jlowcs/pen/xbQZZo

http://stackoverflow.com/comment/46332179
comment on: http://stackoverflow.com/q/28989484
score: 0
type: QuestionComment
has text: Do you have the ability to control the output from the server or are these dates coming from an external system?
type: Comment

http://stackoverflow.com/comment/46146649
has text: Thank you for your answer but I am creating textbox in partial view like @Html.TextBoxFor(modelItem => item.StudentWorkReportFormModel.StartDate}) How can I override name param if is automatically created?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28946238
type: Comment

http://stackoverflow.com/a/28911284
score: 0
answers question: http://stackoverflow.com/q/28910803
type: Answer
has comment: http://stackoverflow.com/comment/46081411
has body: So I took a few minutes to see if I can pull it off, and here is what I got: https://jsfiddle.net/saxgtmjo/1/ HTML: You won't see this content! Link Name: Link URL: Change link! JS: $('#changeLink').on('click', function(e) { e.preventDefault(); $link_name = $('#linkName').val(); $link_url = $('#linkURL').val(); $('#replaceableDiv').html("" + $link_name + ""); }) Your question is worded a bit oddly, so I do not know if you want to use some sort of POST information to populate the link name/url. If that is the case, then all you really need to do is use the JQuery code I provided in the success: attribute of the JQuery $.ajax or $.get or $.post function, and change the $link_name and $link_url according to the data retrieved.
has comment: http://stackoverflow.com/comment/46081434

http://stackoverflow.com/q/29056531
has comment: http://stackoverflow.com/comment/46350171
score: 0
has comment: http://stackoverflow.com/comment/46350165
has answer: http://stackoverflow.com/a/29056610
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I'm attempting to use the following design on a responsive website. I'm curious if there's a way to set up some sort of inverse resizing method through jQuery / Javascript because as the viewport gets smaller, the copy will respond and get larger. I've tried using jQuery to modify the image size, but I only know enough to manually resize it at different breakpoints Here's my attempt at a solution: var viewportWidth = $(window).width(); if (viewportWidth &lt;= 768) { $("#curlybrace").css("width", "80px"); } Is there a way to set up a dynamic scaling image?
tagged with: css
has answer: http://stackoverflow.com/a/29056569
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has title: Inverted a Responsive Size for an Image

http://stackoverflow.com/a/28922913
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28922761
answers question: http://stackoverflow.com/q/28922761
has comment: http://stackoverflow.com/comment/46103085
type: AcceptedAnswer
downvote count: 0
has body: As explained in Why isn't my checkbox change event triggered?: The change event does not fire when you programmatically change the value of a check box. Below I give two solutions (the first is from the aforementioned link): 1: Explicitly trigger the change event after changing the checkbox setting. this.checked = true; $(this).trigger('change'); 2: Just programmatically delegate to the click event. $(this).trigger('click'); Demo: window.loadProduct = function(id) { alert('loadProduct() called on #'+id+'.'); }; // propagate select-all checkbox changes to all individual checkboxes $("#select_all").change(function() { if (this.checked) { $(".select-product").each(function() { // original code //this.checked = true; // solution #1: explicitly force a change event this.checked = true; $(this).trigger('change'); // solution #2: trigger click //$(this).trigger('click'); }); } else { $(".select-product").each(function() { this.checked = false; }); } // end if }); // propagate individual checkbox changes back to the select-all checkbox $(".select-product").click(function() { if (!$(this).is(":checked")) { $("#select_all").prop("checked", false ); } else { var flag = 0; $(".select-product").each(function() { if (!this.checked) flag = 1; }); if (flag == 0) { $("#select_all").prop("checked", true ); } // end if } // end if }); // call loadProduct() for any change of an individual checkbox $('.select-product').change(function() { var isChecked = $(this).is(':checked'); if (isChecked) { loadProduct(this.id); } // end if }); .select_container { margin-bottom:8px; } .img_container { display:flex; }

http://stackoverflow.com/q/29050100
tagged with: javascript
has title: best strategy to make a website mobile compatible
has answer: http://stackoverflow.com/a/29050435
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
score: -1
tagged with: twitter-bootstrap
type: UnansweredQuestion
downvote count: 2
upvote count: 1
has body: I am maintaining a legacy website that over the years have become a jungle of broken incorrect, outdated html, iframes, script tags all over the place, a gazillion analytic code snippets, inline css styling, hardcoded pixel adjustments etc. However, the fact of the matter is that the site looks perfectly fine in a desktop environment. (It will not break for 1360* 768 resolution and above). And it has a good page ranking in Google. Now that Google is changing its page ranking I need to make this site mobile compatible. I tried using bootstrap and media query, but I think it is a nightmare trying to convert the current html. What I wanted to check is- are there any other approaches I can use? I am thinking about how I can show a totally different page in the same URL when the user accesses it using a mobile device. Any pointers are very appreciated.
tagged with: css
tagged with: responsive-design
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29050293

http://stackoverflow.com/comment/46237077
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28994425
has text: I'm hoping there's already a script for it. If not, I'm going to have to take a few hours and perfect one for myself. I'm hoping for a script that will just add a little dropdown triangle to expand/contract the output.
score: 0

http://stackoverflow.com/a/28917721
type: Answer
has comment: http://stackoverflow.com/comment/46093442
upvote count: 1
has comment: http://stackoverflow.com/comment/46093191
score: 1
downvote count: 0
has body: Your guess#2 is correct. Browsers are given freedom by the spec to do Alpha &amp; Gamma adjustments to incoming images.
answers question: http://stackoverflow.com/q/28917518

http://stackoverflow.com/q/28907346
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46078089
has comment: http://stackoverflow.com/comment/46074346
has comment: http://stackoverflow.com/comment/46074186
score: 1
has comment: http://stackoverflow.com/comment/46076680
upvote count: 1
tagged with: web-scraping
has comment: http://stackoverflow.com/comment/46077443
type: Question
has answer: http://stackoverflow.com/a/28907548
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46074621
has comment: http://stackoverflow.com/comment/46076824
tagged with: ajax
tagged with: get
has comment: http://stackoverflow.com/comment/46074320
has title: Ajax GET request of URL fails, but hurl.it GET request of same URL works. What gives?
answer count: 1
downvote count: 0
has body: I'm trying to access the contents of a web page as part of the functionality of a javascript Chrome extension I'm creating and have encountered a bit of a puzzle. When accessing the resource as part of an Ajax GET request in my extension's script, the resource does not correctly load. When I attempt the same GET request through hurl.it (with follow-redirects on and no header modifications), the data loads. It also works if I just enter the URL in my browser. I can't figure out what hurl.it is doing differently in its request and how to fix my own. The URL I'm trying to query is in the form of (with 'Hello' as an example search): http://overdrive.dclibrary.org/BANGSearch.dll?Type=FullText&amp;PerPage=24&amp;URL=SearchResults.htm&amp;Sort=SortBy%3DRelevancy&amp;FullTextField=All&amp;FullTextCriteria=Hello&amp;x=0&amp;y=0%22 This would appear in my script like: var get_url = "http://overdrive.dclibrary.org/BANGSearch.dll?Type=FullText&amp;PerPage=24&amp;URL=SearchResults.htm&amp;Sort=SortBy%3DRelevancy&amp;FullTextField=All&amp;FullTextCriteria=Hello&amp;x=0&amp;y=0" $.get(get_url,function(data){ console.log(data); }); To be clear, the above code will output HTML to the console. It just doesn't include any of the results from the search query. Thanks in advance! Edit: My extension has been given permission to access anything in the dclibrary.org domain.

twitter-bootstrap
tags question: http://stackoverflow.com/q/28966411
tags question: http://stackoverflow.com/q/28999878
tags question: http://stackoverflow.com/q/28913495
tags question: http://stackoverflow.com/q/28944158
tags question: http://stackoverflow.com/q/28989174
tags question: http://stackoverflow.com/q/28992931
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/29030212
tags question: http://stackoverflow.com/q/28973734
tags question: http://stackoverflow.com/q/28920493
tags question: http://stackoverflow.com/q/29056394
tags question: http://stackoverflow.com/q/29032740
tags question: http://stackoverflow.com/q/28988887
tags question: http://stackoverflow.com/q/28975474
tags question: http://stackoverflow.com/q/29038960
tags question: http://stackoverflow.com/q/29031023
tags question: http://stackoverflow.com/q/29006724
tags question: http://stackoverflow.com/q/28923769
tags question: http://stackoverflow.com/q/28970534
tags question: http://stackoverflow.com/q/28989887
tags question: http://stackoverflow.com/q/28933819
tags question: http://stackoverflow.com/q/28984535
tags question: http://stackoverflow.com/q/28924551
tags question: http://stackoverflow.com/q/28938628
tags question: http://stackoverflow.com/q/29012913
tags question: http://stackoverflow.com/q/28950987
tags question: http://stackoverflow.com/q/28913570
tags question: http://stackoverflow.com/q/29033261
tags question: http://stackoverflow.com/q/29059619
tags question: http://stackoverflow.com/q/29058847
tags question: http://stackoverflow.com/q/28993322
tags question: http://stackoverflow.com/q/28992871
tags question: http://stackoverflow.com/q/28951142
tags question: http://stackoverflow.com/q/29035500
tags question: http://stackoverflow.com/q/28986681
tags question: http://stackoverflow.com/q/28971865
tags question: http://stackoverflow.com/q/28949339
tags question: http://stackoverflow.com/q/29034634
tags question: http://stackoverflow.com/q/28937341
tags question: http://stackoverflow.com/q/28954822
tags question: http://stackoverflow.com/q/28952375
tags question: http://stackoverflow.com/q/29035329
tags question: http://stackoverflow.com/q/28937755
tags question: http://stackoverflow.com/q/28971675
tags question: http://stackoverflow.com/q/28961429
tags question: http://stackoverflow.com/q/28926966
tags question: http://stackoverflow.com/q/28932414
tags question: http://stackoverflow.com/q/29029704
tags question: http://stackoverflow.com/q/29022850
tags question: http://stackoverflow.com/q/29042067
tags question: http://stackoverflow.com/q/29030275
tags question: http://stackoverflow.com/q/29006166
tags question: http://stackoverflow.com/q/28958540
tags question: http://stackoverflow.com/q/29016123
tags question: http://stackoverflow.com/q/29048643
tags question: http://stackoverflow.com/q/28991040
tags question: http://stackoverflow.com/q/28961853
tags question: http://stackoverflow.com/q/29018725
tags question: http://stackoverflow.com/q/29006108
tags question: http://stackoverflow.com/q/28980961
tags question: http://stackoverflow.com/q/28981860
tags question: http://stackoverflow.com/q/28933184
tags question: http://stackoverflow.com/q/28930818
tags question: http://stackoverflow.com/q/28910597
tags question: http://stackoverflow.com/q/28995873
type: Tag
tags question: http://stackoverflow.com/q/28924312
tags question: http://stackoverflow.com/q/28940527
tags question: http://stackoverflow.com/q/29048567
tags question: http://stackoverflow.com/q/28976802
tags question: http://stackoverflow.com/q/28984610
tags question: http://stackoverflow.com/q/28982110
tags question: http://stackoverflow.com/q/28926054
tags question: http://stackoverflow.com/q/28910709
tags question: http://stackoverflow.com/q/29021207
tags question: http://stackoverflow.com/q/29048201
tags question: http://stackoverflow.com/q/28941305
tags question: http://stackoverflow.com/q/29023888
tags question: http://stackoverflow.com/q/28985651
tags question: http://stackoverflow.com/q/28910879

http://stackoverflow.com/q/28925081
type: Question
has body: So I have aligned right by image, but now I want to put the image that was aligned right on the same bar/line as my navigation bar. CSS code, section for navigation bar: body { font-family: "Trebuchet MS", Verdana, sans-serif; font-size: 16px; background-color: lightblue; color: #696969; padding: 3px; } #main { padding: 5px; padding-left: 15px; padding-right: 15px; background-color: #ffffff; border-radius: 0 0 5px 5px; } h1 { font-family: Georgia, serif; border-bottom: 3px solid #cc9900; color: #996600; font-size: 30px; } table { width:100%; } table, th , td { border: 1px solid grey; border-collapse: collapse; padding: 5px; } th { text-align: left; } table tr:nth-child(odd) { background-color: #f1f1f1; } table tr:nth-child(even) { background-color: #ffffff; } ul#menu { padding: 0; margin-bottom: 11px; } ul#menu li { display: inline-block; margin-right: 2px; } ul#menu li a { background-color: orange; padding: 10px 40px; text-decoration: none; color: #ffffff; border-radius: 4px 4px 4px 4px; } ul#menu li a:hover { color: white; background-color: blue; } table { width:100%; } table, th , td { border: 1px solid grey; border-collapse: collapse; padding: 5px; } th { text-align: left; } table tr:nth-child(odd) { background-color: #f1f1f1; } table tr:nth-child(even) { background-color: #ffffff; } HTML code: X-treme FreeRoam Welcome to X-treme FreeRoam's website Welcome to X-treme FreeRoam's website, we setup a forum website for players from X-treme FreeRoam server in Grand Theft Auto San Andreas Multiplayer to communicate and voice their feedback and improvements for the server. This page is the homepage of our server. You can talk about other things unrelated to Grand Theft Auto on the Unrelated topic under the Other forum by clicking on the Forum tab in the navigation bar. Please do look around. Note that my nav01 and foot01 comes from the same javascript I created
tagged with: javascript
has comment: http://stackoverflow.com/comment/46106626
has comment: http://stackoverflow.com/comment/46107495
score: 0
has comment: http://stackoverflow.com/comment/46111857
has comment: http://stackoverflow.com/comment/46106571
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46107000
tagged with: css
has comment: http://stackoverflow.com/comment/46130087
answer count: 0
has title: Navigation bar and image on the same line
has comment: http://stackoverflow.com/comment/46106991

http://stackoverflow.com/q/28972966
tagged with: javascript
linked to: http://stackoverflow.com/q/19242439
score: 0
duplicate of: http://stackoverflow.com/q/19242439
tagged with: arrays
has comment: http://stackoverflow.com/comment/46197256
has comment: http://stackoverflow.com/comment/46197735
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46197345
has title: how to remove an element from an array with LODASH / UNDERSCORE
tagged with: lodash
has body: I have a list of items with the option to checked / unchecked them whether you want to see them or not in another view. right now I have a post request where I am saving all the elements that the user unchecked. this is what I have saved so far, printed in the console looks like this [ { sport: [ 9, 19, 58, 18, 24, 4, 8 ] } ] now the issue: if I checked again any of those elements, the one I checked must disappear from that list, but still persist in the DB whether I checked it or unchecked it. this is the part where I need to perform the mentioned above if (_.includes(sportChecked.sport, params.sport)) { sportChecked.sport = _.difference(newSport, params.sport); console.log(sportChecked.sport); }else { newSport.push(params.sport); sportChecked.sport = newSport; } as you see I am using _.difference to tell the user that the sport he is trying to unchecked is already on the list. this console.log(sportChecked.sport); is the one which shows me the array that I am printing in the terminal. So what can I do to delete from the list the checked items using lodash ? Update watching this from another point, could be: non element on the array must be there if you checked the element in the DOM, if the element is already in the list, I have there _.difference for that, so, once the user checked the item in the DOM, let's say the element with the id 9 which is the first element on that array, then that element doesn't must be there anymore.
answer count: 0
type: Question
tagged with: underscore.js

http://stackoverflow.com/q/29014145
tagged with: android
accepted answer: http://stackoverflow.com/a/29036098
has title: Control what JS is executed in an Android WebView
type: AnsweredQuestion
tagged with: android-webview
score: 1
upvote count: 1
type: Question
tagged with: javascript
has body: Is it possible to control which JS is executed in an Android WebView on a fine-grained level? As far as I can tell it is only possible to enable/disable JS in the WebView globally and add JS Interfaces. But what about blocking just certain APIs in a WebView? Is this possible?
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29036098
favorite count: 0

http://stackoverflow.com/comment/46293521
comment on: http://stackoverflow.com/a/29025480
type: Comment
has text: Its working for a static data.... But i'm not able to get the data from the text fields or a drop down..... :(
score: 0
type: AnswerComment

http://stackoverflow.com/q/28906829
has title: How to assign a value in document ready .fileupload
has comment: http://stackoverflow.com/comment/46390231
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28908205
has comment: http://stackoverflow.com/comment/46074732
type: Question
has body: I am try to assign a value to the videoid parameter in the URL below however when the url method is called in my C# MVC controller videoid is null $(document).ready(function() { var videoid; videoid = $scope.VideoId.id; $scope.alertVidUpload.show = false; $scope.$apply(); $("#fileupload").fileupload({ dataType: "json", url: '/Videos/UploadVideoFile/?videoid=' + $("#videoIdVal").text(), autoUpload: true Controller: method: [HttpPost] public ActionResult UploadVideoFile(string videoid) { var uploadedVideo = new VideoDetail(); if (videoid != null) { uploadedVideo = _companyRepo.GetPostedVideo(Guid.Parse(videoid)); } I initially tried the following using the value from the angular scope object url: '/Videos/UploadVideoFile/?videoid=' + $scope.VideoId.id I am pretty sure $scope.VideoId.id has a value because I watched it in my browser and saw the value. I tried creating an hidden label on my form and assign the value to the URL : url: '/Videos/UploadVideoFile/?videoid=' + $("#videoIdVal").text(), I can see the label value in my browser console $("#videoIdVal").text(), but when the controller method is hit videoID is empty Can anyone help to figure out why I can’t assign the videoId parameter value to the url in the document ready function?
has comment: http://stackoverflow.com/comment/46074448
has comment: http://stackoverflow.com/comment/46074262
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46074179
has comment: http://stackoverflow.com/comment/46073512
score: 0
tagged with: angularjs

http://stackoverflow.com/a/29088028
answers question: http://stackoverflow.com/q/29001510
type: Answer
score: 0
has body: You can simply update values and re-animate them at will. There's no need to fully destroy the object and create a new one, though that's a shortcut you see taken often because it is scary simple....but it also introduces display issues at the same time. Here's a simple example of changing values of a table and re-animating instead of destroying and making new: D3 redraw example You obviously get your data very differently via Backbone models, but the concepts are the same. I have a similar pattern as you in my lighting control app, and I really have grown fond of using a grid to render the collection, with links to open each of the individual views, whether via a link to a new page (my preferred method) or a modal (the bosses' favorite method) My current grid of choice is Backgrid.js which is tied directly to the collection and therefore requires no work at all to update on model change.

soap
tags question: http://stackoverflow.com/q/28938629
type: Tag
tag name: soap

http://stackoverflow.com/comment/46185636
comment on: http://stackoverflow.com/q/28966901
type: Comment
type: QuestionComment
score: 1
has text: But...is this a good way for sharing Models and connection to the database?

http://stackoverflow.com/comment/46311111
type: Comment
score: 1
type: QuestionComment
has text: Why not use the ` `?
comment on: http://stackoverflow.com/q/29035185

http://stackoverflow.com/comment/46265592
score: 0
type: AnswerComment
type: Comment
has text: That did not work. From the documentation, it seems that 'multiple' will determine if the listbox is single selection or multiple. That is not what I need. When the selections are displayed in the listbox, if the user wants to delete one, the default action is to backspace. To me, that is not intuitive enough. I would like each selected item in the list box to have an 'X' beside it to indicate if you want to delete it, click the 'x'. The example shown on the Chosen website shows the items this way. I have read the documents and don't see how to get there.
comment on: http://stackoverflow.com/a/28996928

http://stackoverflow.com/q/28932077
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/99809109
tagged with: setorientation
answer count: 1
tagged with: web-audio-api
type: UnansweredQuestion
has body: I've been trying to find more information about setting the listener orientation using Web Audio API. I've checked the api documentation but I'm not completely clear on how it should be used. https://docs.webplatform.org/wiki/apis/webaudio/AudioListener/setOrientation Describes which direction the listener is pointing in the 3D cartesian coordinate space. Both a front vector and an up vector are provided. In human terms, the front vector represents which direction the person's nose is pointing. The up vector represents the direction the top of a person's head is pointing. These values are expected to be linearly independent (at right angles to each other). The x, y, z parameters represent a front direction vector in 3D space, with the default value being (0,0,-1). The xUp, yUp, zUp parameters represent an up direction vector in 3D space, with the default value being (0,1,0). I need to use the orientation rotation to help the user determine whether the source sound is behind or in front, how could I turn the listener orientation 90 degrees to the right or left? Many thanks
has answer: http://stackoverflow.com/a/28933418
has title: Set listener orientation using Web Audio API

http://stackoverflow.com/comment/46179258
comment on: http://stackoverflow.com/a/28960851
type: AnswerComment
score: 0
type: Comment
has text: I don't get you. Can you please edit my question or provide the snippet that does this? or is there any other alternatives to this? All I'm worried about is the table's formatting. The parsing works fine but the formatting is what is needed now

http://stackoverflow.com/q/29002198
tagged with: execute
has comment: http://stackoverflow.com/comment/46251998
tagged with: yo
answer count: 1
has comment: http://stackoverflow.com/comment/46252030
tagged with: javascript
has answer: http://stackoverflow.com/a/29002459
favorite count: 0
score: 0
tagged with: angularjs
has title: Execute Script before angular load
has body: Sorry Guys this is my first question in stackoverflow, so I edited the question in order to be more clear. I have an angular app and I would like that the users could check their profile as following "http://myapp.com/username" instead of "http://myapp.com/#/user/username" without the html5mode enable. How can I achieve this? Thanks in advance.
has comment: http://stackoverflow.com/comment/46251824
type: UnansweredQuestion
upvote count: 1
downvote count: 1
type: Question

http://stackoverflow.com/a/28921044
type: Answer
answers question: http://stackoverflow.com/q/28920619
score: 0
has body: I don't know if that's the only issue, but your check function is flawed. What it currently does is check if there is a collision on the x-coordinate with any red ball and a collision on the y-coordinate with any (other!) red ball. It does not enforce that both collisions occur on the same red ball. By the way, this is a rather strange and inaccurate of way of detecting collisions between spherical balls: the natural one is to check if the euclidean distance between the centers is less than the sum of the radiuses, i.e function collides(blueX, blueY, blueR, redX, redY, redR) { return Math.sqrt(Math.pow(blueX - redX, 2) + Math.pow(blueY - redY, 2)) &lt; blueR + redR; }

http://stackoverflow.com/q/28978095
accepted answer: http://stackoverflow.com/a/28978184
has comment: http://stackoverflow.com/comment/46206953
type: Question
has comment: http://stackoverflow.com/comment/46207035
tagged with: javascript
tagged with: jquery
tagged with: jquery-plugins
score: 0
has body: I have copied the basic plugin from jQuery's website. Now, when I put this code into a file and load it into my app, the plugin does not work. I cannot access the plugin via $. but can seen to access it via $.fn. (which seems strange to me). Here is how I'm loading the scripts (I don't see anything). &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jquery-ui.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="plugins.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="index.js"&gt;&lt;/script&gt; And here's what's inside of plugins.js $.fn.greenify = function() { this.css( "color", "green" ); return this; } I have even tried the following: (function ( $ ) { $.fn.greenify = function( options ) { // This is the easiest way to have default options. var settings = $.extend({ // These are the defaults. color: "#556b2f", backgroundColor: "white" }, options ); // Greenify the collection based on the settings variable. return this.css({ color: settings.color, backgroundColor: settings.backgroundColor }); }; }( jQuery )); But this does not seem to work either. Nor does the console present any errors.
answer count: 1
has comment: http://stackoverflow.com/comment/46207000
has comment: http://stackoverflow.com/comment/46206989
has title: jQuery basic plugin not working?
has answer: http://stackoverflow.com/a/28978184
type: AnsweredQuestion

http://stackoverflow.com/comment/46261962
type: Comment
type: QuestionComment
score: 0
has text: why don't you use jQuery and $.ajax?
comment on: http://stackoverflow.com/q/28985562

http://stackoverflow.com/comment/46269981
type: Comment
comment on: http://stackoverflow.com/q/29011813
score: 0
has text: yes, It works, but I want to add params as I said above.
type: QuestionComment